zhanghai / MaterialFiles

Material Design file manager for Android
https://play.google.com/store/apps/details?id=me.zhanghai.android.files
GNU General Public License v3.0
5.87k stars 397 forks source link

Timeout while connect to root process #511

Closed o0Mardev closed 3 years ago

o0Mardev commented 3 years ago

Hi, When i'm using root explorer, I am not able to use the app properly. It doesn't let me access to the storage. I'm using android 10 on a custom ROM (Lineage OS 17.1), on the latest version of the app, of course. Maybe it doesn't work because i'm using an older version of magisk 19.3, (unfortunately I can't update it otherwise it will cause bootloop) I tried to disable root for this app and reenabled it, but nothing changes. Screenshot_20210505-181018_Material_Files

Sorry for bad english

zhanghai commented 3 years ago

I'll need relevant adb logcat output to actually know what is going wrong on your device. But meanwhile, Magisk 19.3 was released June 2019, and this app does require certain newer Magisk features , so there is possibility that the only fix is to update Magisk.

o0Mardev commented 3 years ago

Here you are log.txt The asterisks indicate the personal parts that I removed.

zhanghai commented 3 years ago

Sorry for the delay, finally got the time to take a look at the log. Some suspicious log entries:

05-07 07:53:05.723  root  5471  5471 F linker  : CANNOT LINK EXECUTABLE "/system/bin/app_process64": cannot locate symbol "JniInvocationCreate" referenced by "/system/lib64/libandroid_runtime.so"...
...
05-07 07:53:14.761 10179  5102  5102 W System.err: me.zhanghai.android.files.provider.remote.RemoteFileSystemException: java.util.concurrent.TimeoutException: Timeout while connecting to root process
05-07 07:53:14.762 10179  5102  5102 W System.err:  at me.zhanghai.android.files.provider.root.g.c(Unknown Source:137)
05-07 07:53:14.762 10179  5102  5102 W System.err:  at me.zhanghai.android.files.provider.root.h.d(:1)
05-07 07:53:14.763 10179  5102  5102 W System.err:  at me.zhanghai.android.files.provider.remote.y0.b(Unknown Source:9)
05-07 07:53:14.763 10179  5102  5102 W System.err:  at me.zhanghai.android.files.provider.remote.M.b(Unknown Source:7)
05-07 07:53:14.763 10179  5102  5102 W System.err:  at me.zhanghai.android.files.provider.root.m.d(:1)
05-07 07:53:14.763 10179  5102  5102 W System.err:  at me.zhanghai.android.files.provider.remote.y0.b(Unknown Source:9)
05-07 07:53:14.763 10179  5102  5102 W System.err:  at me.zhanghai.android.files.provider.remote.e0.v(:2)
05-07 07:53:14.764 10179  5102  5102 W System.err:  at me.zhanghai.android.files.provider.root.y.p(:1)
05-07 07:53:14.764 10179  5102  5102 W System.err:  at me.zhanghai.android.fastscroll.u.g(Unknown Source:68)
05-07 07:53:14.764 10179  5102  5102 W System.err:  at me.zhanghai.android.files.provider.root.F.v(:1)
05-07 07:53:14.764 10179  5102  5102 W System.err:  at java8.nio.file.r.g(:2)
05-07 07:53:14.764 10179  5102  5102 W System.err:  at me.zhanghai.android.files.provider.common.y.E(Unknown Source:5)
05-07 07:53:14.764 10179  5102  5102 W System.err:  at me.zhanghai.android.files.filelist.p0.call(:1)
05-07 07:53:14.764 10179  5102  5102 W System.err:  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
05-07 07:53:14.764 10179  5102  5102 W System.err:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
05-07 07:53:14.764 10179  5102  5102 W System.err:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
05-07 07:53:14.764 10179  5102  5102 W System.err:  at java.lang.Thread.run(Thread.java:919)
05-07 07:53:14.764 10179  5102  5102 W System.err: Caused by: java.util.concurrent.TimeoutException: Timeout while connecting to root process
05-07 07:53:14.764 10179  5102  5102 W System.err:  at me.zhanghai.android.files.provider.root.g.c(Unknown Source:134)
05-07 07:53:14.764 10179  5102  5102 W System.err:  ... 16 more
05-07 07:53:14.759 10179  5102  5102 W me.zhanghai.android.files: type=1400 audit(0.0:290): avc: denied { getattr } for comm=4173796E635461736B202333 path="/system/lib64/bootstrap" dev="mmcblk0p53" ino=3789 scontext=u:r:untrusted_app:s0:c179,c256,c512,c768 tcontext=u:object_r:system_bootstrap_lib_file:s0 tclass=dir permissive=0
...
05-07 07:53:14.906  root  7321  7321 F linker  : CANNOT LINK EXECUTABLE "/system/bin/app_process64": cannot locate symbol "JniInvocationCreate" referenced by "/system/lib64/libandroid_runtime.so"...
...
05-07 07:53:24.793 10179  5102  5217 W System.err: me.zhanghai.android.files.provider.remote.RemoteFileSystemException: java.util.concurrent.TimeoutException: Timeout while connecting to root process
05-07 07:53:24.795 10179  5102  5217 W System.err:  at me.zhanghai.android.files.provider.root.g.c(Unknown Source:137)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at me.zhanghai.android.files.provider.root.h.d(:1)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at me.zhanghai.android.files.provider.remote.y0.b(Unknown Source:9)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at me.zhanghai.android.files.provider.remote.M.b(Unknown Source:7)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at me.zhanghai.android.files.provider.root.m.d(:1)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at me.zhanghai.android.files.provider.remote.y0.b(Unknown Source:9)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at me.zhanghai.android.files.provider.remote.e0.a(Unknown Source:7)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at me.zhanghai.android.files.provider.root.B.p(:1)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at me.zhanghai.android.fastscroll.u.g(Unknown Source:68)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at me.zhanghai.android.files.provider.root.F.a(:1)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at me.zhanghai.android.files.provider.common.y.H(Unknown Source:11)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at me.zhanghai.android.files.filelist.O0.run(Unknown Source:23)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
05-07 07:53:24.795 10179  5102  5217 W System.err:  at java.lang.Thread.run(Thread.java:919)
05-07 07:53:24.795 10179  5102  5217 W System.err: Caused by: java.util.concurrent.TimeoutException: Timeout while connecting to root process
05-07 07:53:24.795 10179  5102  5217 W System.err:  at me.zhanghai.android.files.provider.root.g.c(Unknown Source:134)
05-07 07:53:24.795 10179  5102  5217 W System.err:  ... 14 more

It's not clear what exactly is going wrong on the device (plus that the device seems not very stable, a number of other things are crashing). The timeout for a failed connection to root process is 10 seconds, so I usually look back 10 seconds relative to the timeout stacktrace, but the only thing I could found was a app_process64 linker error, and a SELinux denial, neither provides enough information for what exactly is wrong or how to fix it.

If you are using a Huawei device (saw some Huawei things in the log), which means your custom ROM may be using their kernel image, Huawei kernel is known to break things like this (e.g. They disabled patching SELinux policy from their kernel).

There's also an alternative that may (or may not) work. You can try to install the Magisk module Sui and its dependency Riru, which provides an alternative way to start root processes, and Material Files will try to use that if installed.

o0Mardev commented 3 years ago

Thank you for the help, I’ll leave a positive review on the play store. This is a great app.