AppManager icon indicating copy to clipboard operation
AppManager copied to clipboard

Can't use root mode in versions 3.0.0 onwards

Open Zafrkant opened this issue 3 years ago • 107 comments

Please check before submitting an issue

  • [X] I know what my device, OS and App Manager versions are
  • [X] I know how to take logs
  • [X] I know how to reproduce the issue which may not be specific to my device

Describe the bug

I'm using Xiaomi Mi 11i, Xiaomi EU 13.0.13.0, App Manager Debug 2130. I've tried multiple 3.x.x versions but results are the same, I can't use root mode. On v2.6.5.1 everything is working fine. Full system log will be provided.

To Reproduce

    1. Install debug version
    1. Select root mode.
    1. Settings | Mode of operation | Root

Expected behavior

No root access will be provided.

Screenshots

No response

Logs

Log is provided via Mega due to it's large size, GitHub: There was an error creating your Issue: body is too long, body is too long (maximum is 65536 characters). https://mega.nz/file/e5clkSSB#hvEJ_JSzxOQnmcPzXHC5uKnEfK8VOe4n3bifOGxyZL4

Device info

  • Device: Xiaomi Mi 11i
  • OS Version: Xiaomi EU 13.0.13.0
  • App Manager Version: AM Debug v3.1.0-alpha02 Run#2130
  • Mode: Root/ADB/NonRoot: Root

Additional context

No response

Zafrkant avatar Dec 05 '22 06:12 Zafrkant

617:696 E/vold: Failed to set project id on /data/media/0/Android/data/io.github.muntashirakon.AppManager.debug/: Operation not supported on transport endpoint
30553:30553 W/ContextImpl: Failed to ensure /storage/emulated/0/Android/data/io.github.muntashirakon.AppManager.debug/cache: android.os.ServiceSpecificException:  (code -1)
30745:30745 D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
30553:30689 E/RootService: main.jar: open failed: EROFS (Read-only file system)
java.io.FileNotFoundException: main.jar: open failed: EROFS (Read-only file system)
	at libcore.io.IoBridge.open(IoBridge.java:575)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:236)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:186)
	at io.github.muntashirakon.AppManager.ipc.RootServiceManager.lambda$startRootProcess$1(RootServiceManager.java:193)
	at io.github.muntashirakon.AppManager.ipc.RootServiceManager$$ExternalSyntheticLambda3.run(Unknown Source:9)
	at io.github.muntashirakon.AppManager.ipc.RootService.lambda$asRunnable$0(RootService.java:201)
	at io.github.muntashirakon.AppManager.ipc.RootService$$ExternalSyntheticLambda0.run(Unknown Source:2)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:920)
Caused by: android.system.ErrnoException: open failed: EROFS (Read-only file system)
	at libcore.io.Linux.open(Native Method)
	at libcore.io.ForwardingOs.open(ForwardingOs.java:567)
	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:273)
	at libcore.io.ForwardingOs.open(ForwardingOs.java:567)
	at android.app.ActivityThread$AndroidOs.open(Unknown Source:15)
	at libcore.io.IoBridge.open(IoBridge.java:561)
	... 9 more

It is failing because the internal storage in your device is set to read-only for App Manager which shouldn't happen. Check if any of the other software is messing with App Manager, examples include Xposed or similar frameworks and Storage Redirect. Also check if the path /storage/emulated/0/Android/data/io.github.muntashirakon.AppManager.debug/ exists.

MuntashirAkon avatar Dec 05 '22 07:12 MuntashirAkon

Muntashir thanks for answering.

After installation '/storage/emulated/0/Android/data/io.github.muntashirakon.AppManager.debug' is present on storage, containing empty FIles subdirectory. I'm not using Xposed, only App Ops with Sui Zygisk. I've tried to disable all Magisk modules (including Sui, BusyBox, CloudFlare, Twemoji), reboot and try to select root mode but unfortunately state is the same. Do you have idea how can I check what is making storage read-only?

Thanks in advance.

Zafrkant avatar Dec 05 '22 09:12 Zafrkant

Do you have idea how can I check what is making storage read-only?

Not sure. You could do onething: Run AM Debug in no-root mode, grant file permissions. Then open the app details page of AM Debug, navigate to Activities tab, find FmActivity and open it to see if it can display anything.

MuntashirAkon avatar Dec 05 '22 09:12 MuntashirAkon

Thank you for answer. I've did as you suggested and on click it is opening file manager on /storage/emulated/0 path. signal-2022-12-05-135343

Zafrkant avatar Dec 05 '22 14:12 Zafrkant

I have the same issue. I'm also using a Xiaomi device (Mi 11 Ultra). The error I have is the same: open failed erofs (read-only file system)

As path, I'm having the same as @Zafrkant when opening FmActivity. Btw. I disabled lsposed which didn't help. Besides that I only have Magisk installed and nothing that should block AM.

unRekable avatar Dec 13 '22 23:12 unRekable

By the way, in case it matters, when opening FmActivity, I don't have permissions to view /android/data - probably that's causing the problem?

unRekable avatar Dec 16 '22 22:12 unRekable

I've updated to Android 13 and MIUI 14 today - still the same issue. Any update on this @MuntashirAkon ?

unRekable avatar Jan 05 '23 23:01 unRekable

I've upgraded Xiaomi EU to v14.0.3.0, App Manager to v3.0.4 and it is working fine now.

Zafrkant avatar Jan 11 '23 09:01 Zafrkant

Hope it keeps working for you. Still doesn't work for me on MIUI 14 and Android 13. I will install the latest weekly and see. On Miui 13 and Android 12 one time it showed me root mode and asked me to select a storage for backups or something, don't entirely remember. Though, I think I disallowed root in first, restarted and allowed it then. Whatever, it just showed me the root mode for a short time, when swichting modes it didn't work anymore.

unRekable avatar Jan 11 '23 18:01 unRekable

Any update on this @MuntashirAkon ?

Sorry, no updates. If you're willing to help, I will publish some debug builds to figure out the issue first.

MuntashirAkon avatar Jan 12 '23 08:01 MuntashirAkon

Any update on this @MuntashirAkon ?

Sorry, no updates. If you're willing to help, I will publish some debug builds to figure out the issue first.

Sure, would appreciate to help figuring this out.

unRekable avatar Jan 13 '23 15:01 unRekable

Here's the log file/export - in case it helps you. Installed the latest build today.

https://file.io/0wcoXlniJ95j

unRekable avatar Jan 20 '23 13:01 unRekable

Can you build a debug build @MuntashirAkon ? Been waiting long 😄

unRekable avatar Feb 16 '23 22:02 unRekable

Screenshot_20230224-064416_Solid Explorer

Bladius2026 avatar Feb 24 '23 05:02 Bladius2026

Try 35d8c3b0aa0b8604a604fc39730c436a256dbd53

MuntashirAkon avatar Feb 27 '23 06:02 MuntashirAkon

I don't understand what to check. There is nothing to download from the link provided

Bladius2026 avatar Feb 27 '23 14:02 Bladius2026

I don't understand what to check. There is nothing to download from the link provided

Same. I never compiled into an apk file. If you can make a beta/test build, would be awesome @MuntashirAkon. Thanks!

unRekable avatar Feb 27 '23 15:02 unRekable

Read the docs: https://muntashirakon.github.io/AppManager/en/#subsec:binary-distribution-sources

MuntashirAkon avatar Feb 27 '23 18:02 MuntashirAkon

Downloaded the Debug Build from your telegram.

It crashes on start and cannot run. Here's the error log I could get: https://pastebin.com/FqJYKXqY

Thanks!

unRekable avatar Feb 27 '23 20:02 unRekable

Try#2: 77b1f5dd1889b3c9126dd9b69428fbad9982c28b

MuntashirAkon avatar Feb 28 '23 03:02 MuntashirAkon

Same. Re-installed. It tells me the key, then ask for root and after I give permission it crashes / closes the app.

https://pastebin.com/hxYZhyxe

unRekable avatar Feb 28 '23 09:02 unRekable

Same. Re-installed. It tells me the key, then ask for root and after I give permission it crashes / closes the app.

This is very weird. The shared storage clearly exists as per your previous comments, but App Manager is unable to use them somehow.

In a Terminal, run the following with root:

mount | grep Android/data

MuntashirAkon avatar Feb 28 '23 13:02 MuntashirAkon

Uploading Screenshot_2023-02-28-18-59-17-564_com.termux.jpg…

unRekable avatar Feb 28 '23 17:02 unRekable

@unRekable: Screenshot was not uploaded properly.

MuntashirAkon avatar Feb 28 '23 18:02 MuntashirAkon

https://ibb.co/VjwwtP3

unRekable avatar Feb 28 '23 18:02 unRekable

Ah, it's a device mapper no. 33 (disk encryption?). Run the following command to check the mapping:

ls -l /dev/mapper/

Also, check if /dev/media is properly mounted:

mount | grep /dev/media

Run everything using root.

MuntashirAkon avatar Feb 28 '23 20:02 MuntashirAkon

/dev/mapper/ no such directory, hence it isn't mounted.

I think my device is encrypted yes. I always enter my pin to decrypt it in TWRP.

unRekable avatar Feb 28 '23 23:02 unRekable

/dev/mapper/ no such directory, hence it isn't mounted.

And the output of the other command?

MuntashirAkon avatar Mar 01 '23 08:03 MuntashirAkon

I think my device is encrypted yes. I always enter my pin to decrypt it in TWRP.

Use of dm-X usually means that the partitions are encrypted in this context. It's absolutely okay to /dev/mapper not containing anything as a result.

MuntashirAkon avatar Mar 01 '23 08:03 MuntashirAkon

/dev/mapper/ no such directory, hence it isn't mounted.

And the output of the other command?

The other command gave me no output It couldn't grep something

unRekable avatar Mar 01 '23 10:03 unRekable