Giter Site home page Giter Site logo

librootjava's People

Contributors

chainfire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

librootjava's Issues

librootjava_example shows crashes in logcat after clicking "Run"

Running on Nexus 5 phone Android 6.0.1

12-07 16:19:31.979 885-986/? D/WifiConfigStore: Retrieve network priorities after PNO.
12-07 16:19:35.814 26946-26946/eu.chainfire.librootjava_example D/librootjava: #app_process=/data/data/eu.chainfire.librootjava_example/cache/.app_process32_9531ff47-6e77-435d-88ba-872770f787a9
12-07 16:19:35.814 2772-2790/? D/audio_hw_primary: out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
12-07 16:19:35.814 26946-26946/eu.chainfire.librootjava_example D/librootjava: toybox cp /system/bin/app_process32 /data/data/eu.chainfire.librootjava_example/cache/.app_process32_9531ff47-6e77-435d-88ba-872770f787a9 >/dev/null 2>/dev/null
12-07 16:19:35.815 26946-26946/eu.chainfire.librootjava_example D/librootjava: toybox chmod 0700 /data/data/eu.chainfire.librootjava_example/cache/.app_process32_9531ff47-6e77-435d-88ba-872770f787a9 >/dev/null 2>/dev/null
12-07 16:19:35.815 26946-26946/eu.chainfire.librootjava_example D/librootjava: NO_ADDR_COMPAT_LAYOUT_FIXUP=1 ANDROID_ROOT=/system CLASSPATH=/data/app/eu.chainfire.librootjava_example-1/base.apk /data/data/eu.chainfire.librootjava_example/cache/.app_process32_9531ff47-6e77-435d-88ba-872770f787a9 /system/bin --nice-name=eu.chainfire.librootjava_example:root eu.chainfire.librootjava_example.root.RootMain /data/app/eu.chainfire.librootjava_example-1/base.apk
12-07 16:19:35.816 26946-26946/eu.chainfire.librootjava_example D/librootjava: toybox rm /data/data/eu.chainfire.librootjava_example/cache/.app_process32_9531ff47-6e77-435d-88ba-872770f787a9 >/dev/null 2>/dev/null
12-07 16:19:35.817 26946-26946/eu.chainfire.librootjava_example D/libsuperuser: [libsuperuser][C][SU+] #app_process=/data/data/eu.chainfire.librootjava_example/cache/.app_process32_9531ff47-6e77-435d-88ba-872770f787a9
12-07 16:19:35.817 26946-26946/eu.chainfire.librootjava_example D/libsuperuser: [libsuperuser][C][SU+] toybox cp /system/bin/app_process32 /data/data/eu.chainfire.librootjava_example/cache/.app_process32_9531ff47-6e77-435d-88ba-872770f787a9 >/dev/null 2>/dev/null
12-07 16:19:35.817 26946-26946/eu.chainfire.librootjava_example D/libsuperuser: [libsuperuser][C][SU+] toybox chmod 0700 /data/data/eu.chainfire.librootjava_example/cache/.app_process32_9531ff47-6e77-435d-88ba-872770f787a9 >/dev/null 2>/dev/null
12-07 16:19:35.818 26946-26946/eu.chainfire.librootjava_example D/libsuperuser: [libsuperuser][C][SU+] NO_ADDR_COMPAT_LAYOUT_FIXUP=1 ANDROID_ROOT=/system CLASSPATH=/data/app/eu.chainfire.librootjava_example-1/base.apk /data/data/eu.chainfire.librootjava_example/cache/.app_process32_9531ff47-6e77-435d-88ba-872770f787a9 /system/bin --nice-name=eu.chainfire.librootjava_example:root eu.chainfire.librootjava_example.root.RootMain /data/app/eu.chainfire.librootjava_example-1/base.apk
12-07 16:19:35.818 26946-26946/eu.chainfire.librootjava_example D/libsuperuser: [libsuperuser][C][SU+] toybox rm /data/data/eu.chainfire.librootjava_example/cache/.app_process32_9531ff47-6e77-435d-88ba-872770f787a9 >/dev/null 2>/dev/null
12-07 16:19:35.824 2772-2790/? D/audio_hw_primary: select_devices: out_snd_device(2: speaker) in_snd_device(0: none)
12-07 16:19:35.825 2772-2790/? D/msm8974_platform: platform_send_audio_calibration: sending audio calibration for snd_device(2) acdb_id(15)
12-07 16:19:35.825 2772-2790/? D/audio_hw_primary: enable_snd_device: snd_device(2: speaker)
12-07 16:19:35.828 2772-2790/? D/audio_hw_primary: enable_audio_route: apply and update mixer path: low-latency-playback
12-07 16:19:36.520 27230-27230/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
12-07 16:19:36.525 27230-27230/? D/AndroidRuntime: CheckJNI is OFF
12-07 16:19:36.574 27230-27230/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
12-07 16:19:36.604 27230-27230/? E/appproc: ERROR: could not find class 'eu.chainfire.librootjava_example.root.RootMain'
12-07 16:19:36.605 27230-27230/? A/art: art/runtime/thread.cc:1336] No pending exception expected: java.lang.ClassNotFoundException: Didn't find class "eu.chainfire.librootjava_example.root.RootMain" on path: DexPathList[[zip file "/data/app/eu.chainfire.librootjava_example-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
12-07 16:19:36.605 27230-27230/? A/art: art/runtime/thread.cc:1336]   at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
12-07 16:19:36.605 27230-27230/? A/art: art/runtime/thread.cc:1336]   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:511)
12-07 16:19:36.605 27230-27230/? A/art: art/runtime/thread.cc:1336]   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:469)
12-07 16:19:36.605 27230-27230/? A/art: art/runtime/thread.cc:1336] 
12-07 16:19:36.662 27230-27230/? A/art: art/runtime/barrier.cc:90] Check failed: count_ == 0 (count_=-1, 0=0) Attempted to destroy barrier with non zero count
12-07 16:19:36.662 27230-27230/? A/art: art/runtime/runtime.cc:366] Runtime aborting --- recursively, so no thread-specific detail!
12-07 16:19:36.662 27230-27230/? A/art: art/runtime/runtime.cc:366] 
    
    --------- beginning of crash
12-07 16:19:36.662 27230-27230/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 27230 (main)
12-07 16:19:36.767 284-284/? W/debuggerd: type=1400 audit(0.0:6609): avc: denied { search } for name="eu.chainfire.librootjava_example" dev="mmcblk0p28" ino=107668 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
12-07 16:19:36.763 284-284/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-07 16:19:36.763 284-284/? A/DEBUG: Build fingerprint: 'google/hammerhead/hammerhead:6.0.1/M4B30Z/3437181:user/release-keys'
12-07 16:19:36.763 284-284/? A/DEBUG: Revision: '11'
12-07 16:19:36.763 284-284/? A/DEBUG: ABI: 'arm'
12-07 16:19:36.763 284-284/? A/DEBUG: pid: 27230, tid: 27230, name: main  >>> eu.chainfire.librootjava_example:root <<<
12-07 16:19:36.763 284-284/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
    
    
    --------- beginning of system
12-07 16:19:36.766 885-1006/? W/NativeCrashListener: Couldn't find ProcessRecord for pid 27230
12-07 16:19:36.774 284-284/? A/DEBUG: Abort message: 'art/runtime/thread.cc:1336] No pending exception expected: java.lang.ClassNotFoundException: Didn't find class "eu.chainfire.librootjava_example.root.RootMain" on path: DexPathList[[zip file "/data/app/eu.chainfire.librootjava_example-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]'
12-07 16:19:36.774 284-284/? E/DEBUG: AM write failed: Broken pipe
12-07 16:19:36.774 284-284/? A/DEBUG:     r0 00000000  r1 00006a5e  r2 00000006  r3 b6fdcb7c
12-07 16:19:36.774 284-284/? A/DEBUG:     r4 b6fdcb84  r5 b6fdcb34  r6 00000000  r7 0000010c
12-07 16:19:36.774 284-284/? A/DEBUG:     r8 b4cff800  r9 b4cfde44  sl b4de44db  fp b4ce3450
12-07 16:19:36.774 284-284/? A/DEBUG:     ip 00000006  sp bee292d8  lr b6d4ab61  pc b6d4cf50  cpsr 40070010
12-07 16:19:36.787 284-284/? W/debuggerd: type=1400 audit(0.0:6610): avc: denied { search } for name="eu.chainfire.librootjava_example" dev="mmcblk0p28" ino=107668 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
12-07 16:19:36.794 284-284/? A/DEBUG: backtrace:
12-07 16:19:36.794 284-284/? A/DEBUG:     #00 pc 00041f50  /system/lib/libc.so (tgkill+12)
12-07 16:19:36.794 284-284/? A/DEBUG:     #01 pc 0003fb5d  /system/lib/libc.so (pthread_kill+32)
12-07 16:19:36.794 284-284/? A/DEBUG:     #02 pc 0001c30f  /system/lib/libc.so (raise+10)
12-07 16:19:36.795 284-284/? A/DEBUG:     #03 pc 000194c1  /system/lib/libc.so (__libc_android_abort+34)
12-07 16:19:36.795 284-284/? A/DEBUG:     #04 pc 000174ac  /system/lib/libc.so (abort+4)
12-07 16:19:36.795 284-284/? A/DEBUG:     #05 pc 00333971  /system/lib/libart.so (_ZN3art7Runtime5AbortEv+228)
12-07 16:19:36.795 284-284/? A/DEBUG:     #06 pc 000f45fb  /system/lib/libart.so (_ZN3art10LogMessageD2Ev+2226)
12-07 16:19:36.795 284-284/? A/DEBUG:     #07 pc 000f08d1  /system/lib/libart.so (_ZN3art7BarrierD2Ev+216)
12-07 16:19:36.795 284-284/? A/DEBUG:     #08 pc 0035b473  /system/lib/libart.so (_ZN3art10ThreadList4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+162)
12-07 16:19:36.795 284-284/? A/DEBUG:     #09 pc 00333a35  /system/lib/libart.so (_ZN3art7Runtime5AbortEv+424)
12-07 16:19:36.795 284-284/? A/DEBUG:     #10 pc 000f45fb  /system/lib/libart.so (_ZN3art10LogMessageD2Ev+2226)
12-07 16:19:36.795 284-284/? A/DEBUG:     #11 pc 0034f0b3  /system/lib/libart.so (_ZNK3art6Thread24AssertNoPendingExceptionEv.part.170+378)
12-07 16:19:36.795 284-284/? A/DEBUG:     #12 pc 00136aab  /system/lib/libart.so (_ZN3art11ClassLinker9FindClassEPNS_6ThreadEPKcNS_6HandleINS_6mirror11ClassLoaderEEE+34)
12-07 16:19:36.795 284-284/? A/DEBUG:     #13 pc 0029d4c1  /system/lib/libart.so (_ZN3art3JNI9FindClassEP7_JNIEnvPKc+812)
12-07 16:19:36.795 284-284/? A/DEBUG:     #14 pc 00002251  /system/lib/libnativehelper.so (jniRegisterNativeMethods+20)
12-07 16:19:36.795 284-284/? A/DEBUG:     #15 pc 0005edc1  /system/lib/libandroid_runtime.so
12-07 16:19:36.795 284-284/? A/DEBUG:     #16 pc 0005f2a3  /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime8startRegEP7_JNIEnv+26)
12-07 16:19:36.795 284-284/? A/DEBUG:     #17 pc 000605b9  /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime5startEPKcRKNS_6VectorINS_7String8EEEb+276)
12-07 16:19:36.795 284-284/? A/DEBUG:     #18 pc 00001721  /data/data/eu.chainfire.librootjava_example/cache/.app_process32_9531ff47-6e77-435d-88ba-872770f787a9
12-07 16:19:36.795 284-284/? A/DEBUG:     #19 pc 00017359  /system/lib/libc.so (__libc_init+44)
12-07 16:19:36.795 284-284/? A/DEBUG:     #20 pc 00001868  /data/data/eu.chainfire.librootjava_example/cache/.app_process32_9531ff47-6e77-435d-88ba-872770f787a9
12-07 16:19:36.807 284-284/? W/debuggerd: type=1400 audit(0.0:6611): avc: denied { search } for name="eu.chainfire.librootjava_example" dev="mmcblk0p28" ino=107668 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
12-07 16:19:36.966 284-284/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_03
12-07 16:19:36.966 885-904/? I/BootReceiver: Copying /data/tombstones/tombstone_03 to DropBox (SYSTEM_TOMBSTONE)
12-07 16:19:36.984 26946-27104/eu.chainfire.librootjava_example D/libsuperuser: [libsuperuser][O][SU*] Aborted 
12-07 16:19:36.997 26946-27103/eu.chainfire.librootjava_example D/libsuperuser: [libsuperuser][O][SU-] 4a8d372d-840f-41c4-af52-1ed8e137350d-00000003 0
12-07 16:19:36.998 26946-27104/eu.chainfire.librootjava_example D/libsuperuser: [libsuperuser][O][SU*] 4a8d372d-840f-41c4-af52-1ed8e137350d-00000003
12-07 16:19:37.759 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: BlockingExecutor com.google.android.finsky.bo.ao@e4698ae[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 7]
12-07 16:19:37.760 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: LightweightExecutor com.google.android.finsky.bo.ao@b28364f[Running, pool size = 3, active threads = 0, queued tasks = 0, completed tasks = 55]
12-07 16:19:38.829 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: bgExecutor com.google.android.finsky.bo.ao@c561dc[Running, pool size = 4, active threads = 0, queued tasks = 0, completed tasks = 9]
12-07 16:19:38.830 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: SimChangeExecutor com.google.android.finsky.bo.ao@403e2e5[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
12-07 16:19:39.041 2772-2790/? D/audio_hw_primary: disable_audio_route: reset and update mixer path: low-latency-playback
12-07 16:19:39.041 2772-2790/? D/audio_hw_primary: disable_snd_device: snd_device(2: speaker)
12-07 16:19:39.089 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: Db-xternal_referrer_status.db com.google.android.finsky.bo.ao@6e791ba[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
12-07 16:19:39.090 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: Db-split_install_service com.google.android.finsky.bo.ao@edbe86b[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 12]
12-07 16:19:39.090 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: Db-scheduler com.google.android.finsky.bo.ao@234bfc8[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 36]
12-07 16:19:39.209 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: StorageAwareDownloadServiceManagerSpaceChecker com.google.android.finsky.bo.ao@f94c861[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
12-07 16:19:39.349 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: Db-frosting.db com.google.android.finsky.bo.ao@36d0f86[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 2]
12-07 16:19:39.349 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: Db-notification_cache com.google.android.finsky.bo.ao@7cea047[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 2]
12-07 16:19:39.829 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: Db-scheduler_logging_store.db com.google.android.finsky.bo.ao@5ba1074[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 4]
12-07 16:19:40.369 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: InstallBackgroundThread com.google.android.finsky.bo.ao@ef4899d[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
12-07 16:19:40.369 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: Db-install_service com.google.android.finsky.bo.ao@c7a9e12[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
12-07 16:19:40.370 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: InstallBackgroundThread com.google.android.finsky.bo.ao@4af9e3[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
12-07 16:19:40.408 885-2613/? D/WifiService: acquireWifiLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@e3d2f3e}
12-07 16:19:40.919 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: Db-auto_update.db com.google.android.finsky.bo.ao@a1bfe0[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
12-07 16:19:41.489 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: Db-scheduled_acquisitions.db com.google.android.finsky.bo.ao@4952299[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
12-07 16:19:41.969 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: NotificationAssistDatabaseManager com.google.android.finsky.bo.ao@f60895e[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]
12-07 16:19:42.049 26131-26146/? I/Finsky: [2179] com.google.android.finsky.bo.an.run(6): Stats for Executor: InstallBackgroundThread com.google.android.finsky.bo.ao@2a9513f[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
12-07 16:19:45.449 885-1479/? D/WifiService: releaseWifiLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@e3d2f3e}

Multi user support

Hi, I'm using this library in my project but I have trouble with using RootIPC with non-owner users. I noticed that the starter app which registers receiver cannot receive the broadcast from the root process. I checked the code and noticed that the sendBroadcast method ALWAYS uses the user with id 0 which means the owner user:

mBroadcastIntent.invoke(oActivityManager, null, intent, null, null, 0, null, null, null, -1, null, false, false, 0);

mBroadcastIntent.invoke(oActivityManager, null, intent, null, null, 0, null, null, null, -1, false, false, 0);

I think it is a but so could you fix it? Thanks.

Bind system service as root?

When I attempt to bind it I encountered the exception:

            throw new SecurityException(
                    "Unable to find app for caller " + caller
                    + " (pid=" + Binder.getCallingPid()
                    + ") when binding service " + service);

Create a Service-like wrapper

Some feel a Service-like wrapper that makes usage more transparent would be a good idea. This is certainly possible to create.

Currently, the following things are analogous between librootjava and Android Service:

  • (client) Use a su library to execute getLaunchScript() vs context.bindService()
  • (client) Use a RootIPCReceiver instead of a ServiceConnection
  • (server) Implement main method instead of a Service class

(this could probably go into the docs as well)

Creating a Service-class-like wrapper will likely hide some functionalities, but those are probably only relevant to the most advanced users.

Foreseen difficulties:

  • Create wrappers that work with both normal and daemon services. This would be tricky if the wrapper is an additional library, but easy if the wrappers are included in both existing libraries itself.
  • Execute the script as root without directly depending on libsuperuser, libsu, or whatever root library the user may be using. This will probably either need an additional library plugin per root library, optionally using reflection to support the base ones out-of-the-box.

getInterfaceFromBinder() broken when built with build tools 31.0.0

getInterfaceFromBinder() assumes that the field DESCRIPTOR exists on IServiceName$Stub, however in the Java file generated by aidl in build tools 31.0.0 that field has moved to the outer class IServiceName.

2021-08-08 06:52:15.863 14126-14518/me.zhanghai.android.files D/librootjava: [EXCEPTION] NoSuchFieldException: No field DESCRIPTOR in class Lme/zhanghai/android/files/provider/remote/IRemoteFileService$Stub; (declaration of 'me.zhanghai.android.files.provider.remote.IRemoteFileService$Stub' appears in /data/app/me.zhanghai.android.files-6Bir_-HtGdJLZbio_yZFdA==/base.apk!classes4.dex)
2021-08-08 06:52:15.864 14126-14518/me.zhanghai.android.files W/System.err: java.lang.NoSuchFieldException: No field DESCRIPTOR in class Lme/zhanghai/android/files/provider/remote/IRemoteFileService$Stub; (declaration of 'me.zhanghai.android.files.provider.remote.IRemoteFileService$Stub' appears in /data/app/me.zhanghai.android.files-6Bir_-HtGdJLZbio_yZFdA==/base.apk!classes4.dex)
2021-08-08 06:52:15.864 14126-14518/me.zhanghai.android.files W/System.err:     at java.lang.Class.getDeclaredField(Native Method)
2021-08-08 06:52:15.864 14126-14518/me.zhanghai.android.files W/System.err:     at eu.chainfire.librootjava.Reflection$InterfaceRetriever.getInterfaceFromBinder(Reflection.java:276)
2021-08-08 06:52:15.864 14126-14518/me.zhanghai.android.files W/System.err:     at eu.chainfire.librootjava.RootIPCReceiver.getInterfaceFromBinder(RootIPCReceiver.java:260)
2021-08-08 06:52:15.864 14126-14518/me.zhanghai.android.files W/System.err:     at eu.chainfire.librootjava.RootIPCReceiver.access$700(RootIPCReceiver.java:45)
2021-08-08 06:52:15.864 14126-14518/me.zhanghai.android.files W/System.err:     at eu.chainfire.librootjava.RootIPCReceiver$2.onReceive(RootIPCReceiver.java:137)
2021-08-08 06:52:15.864 14126-14518/me.zhanghai.android.files W/System.err:     at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0(LoadedApk.java:1424)
2021-08-08 06:52:15.864 14126-14518/me.zhanghai.android.files W/System.err:     at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2)
2021-08-08 06:52:15.864 14126-14518/me.zhanghai.android.files W/System.err:     at android.os.Handler.handleCallback(Handler.java:873)
2021-08-08 06:52:15.864 14126-14518/me.zhanghai.android.files W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:99)
2021-08-08 06:52:15.865 14126-14518/me.zhanghai.android.files W/System.err:     at android.os.Looper.loop(Looper.java:193)
2021-08-08 06:52:15.865 14126-14518/me.zhanghai.android.files W/System.err:     at android.os.HandlerThread.run(HandlerThread.java:65)

See also zhanghai/MaterialFiles#546.

Resources$NotFoundException from systemMain on certain LG Android 8 devices

java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Method.invoke(Native Method)
        ...
Caused by: java.lang.RuntimeException: Unable to instantiate Application():android.content.res.Resources$NotFoundException: Resource ID #0x600a8
	at android.app.ActivityThread.attach(ActivityThread.java:6598)
	at android.app.ActivityThread.systemMain(ActivityThread.java:6638)
	... 14 more
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x600a8
	at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:231)
	at android.content.res.Resources.getBoolean(Resources.java:1066)
	at com.lge.systemservice.core.PerfTrackerManager.init(PerfTrackerManager.java:62)
	at android.app.Application.onCreate(Application.java:102)
	at android.app.ActivityThread.attach(ActivityThread.java:6596)
	... 15 more

JDWP provider `internal` no longer exists on Android 11

  • Device: Pixel 4 XL (coral)
  • Build: RQ2A.210305.006
  • App: zhanghai/MaterialFiles (debug build with Debugger.setEnabled(true))
  • Logcat:
    2021-03-06 14:21:59.278 31551-32696/me.zhanghai.android.files D/libsuperuser: [libsuperuser][C][SU+] #app_process=/system/bin/app_process64
    2021-03-06 14:21:59.278 31551-32696/me.zhanghai.android.files D/libsuperuser: [libsuperuser][C][SU+] NO_ADDR_COMPAT_LAYOUT_FIXUP=1 ANDROID_ROOT=/system LD_LIBRARY_PATH=/system/lib64:/system/lib64/drm:/system/lib64/hw:/vendor/lib64:/vendor/lib64/camera:/vendor/lib64/egl:/vendor/lib64/hw:/vendor/lib64/rfsa:/vendor/lib64/mediacas:/vendor/lib64/mediadrm:/vendor/lib64/soundfx:/system/bin:/librootjava CLASSPATH=/data/app/~~QsozZAvAA8hDNezkB64NSA==/me.zhanghai.android.files-ZZ6pIkMj1dFgTHtF5WiQEA==/base.apk /system/bin/app_process64 -Xcompiler-option --debuggable -XjdwpProvider:internal -XjdwpOptions:transport=dt_android_adb,suspend=n,server=y /system/bin --nice-name=me.zhanghai.android.files:root me.zhanghai.android.files.provider.root.RootFileService /data/app/~~QsozZAvAA8hDNezkB64NSA==/me.zhanghai.android.files-ZZ6pIkMj1dFgTHtF5WiQEA==/lib/arm64/libsyscalls.so /data/app/~~QsozZAvAA8hDNezkB64NSA==/me.zhanghai.android.files-ZZ6pIkMj1dFgTHtF5WiQEA==/lib/arm64/libselinux-jni.so
    2021-03-06 14:21:59.320 799-799/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
    2021-03-06 14:21:59.322 799-799/? I/AndroidRuntime: Using default boot image
    2021-03-06 14:21:59.322 799-799/? I/AndroidRuntime: Leaving lock profiling enabled
    2021-03-06 14:21:59.323 799-799/? I/vm-printf: not a valid jdwp provider: internal
    2021-03-06 14:21:59.323 799-799/? I/vm-printf: dalvikvm: [options] class [argument ...]
    2021-03-06 14:21:59.323 799-799/? I/vm-printf: The following standard options are supported:
    2021-03-06 14:21:59.323 799-799/? I/vm-printf:   -classpath classpath (-cp classpath)
    2021-03-06 14:21:59.323 799-799/? I/vm-printf:   -Dproperty=value
    2021-03-06 14:21:59.323 799-799/? I/vm-printf:   -verbose:tag[,tag...] (currently valid tags: 'agents', 'class',
            'collector', 'compiler', 'deopt', 'dex', 'gc', 'heap', 'image',
            'interpreter', 'jdwp', 'jit', 'jni', 'monitor', 'oat', 'profiler',
            'signals', 'simulator', 'startup', 'systrace-locks',
            'third-party-jni', 'threads', 'verifier', 'verifier-debug')
    2021-03-06 14:21:59.323 799-799/? I/vm-printf:   -showversion
    2021-03-06 14:21:59.323 799-799/? I/vm-printf:   -help
    2021-03-06 14:21:59.323 799-799/? I/vm-printf:   -agentpath:library_path=options (Experimental feature, requires
            -Xexperimental:agent, some features might not be supported)
    ...
    2021-03-06 14:21:59.323 799-799/? I/AndroidRuntime: VM exiting with result code 1.
    2021-03-06 14:21:59.326 31551-32125/me.zhanghai.android.files D/libsuperuser: [libsuperuser][O][SU-] 39fc2349-84ee-405e-a2c8-1c496e9db0f9-0000000a 1
    2021-03-06 14:21:59.327 31551-32126/me.zhanghai.android.files D/libsuperuser: [libsuperuser][O][SU*] 39fc2349-84ee-405e-a2c8-1c496e9db0f9-0000000a
    

The JDWP provider internal no longer exists after aosp/1216803 and is causing the failure. Could you please take a look?

What are the prerequisite to use libRootJava?

Hi,

I would like to know the Prerequistes to use this library. With this library, will I able to execute my Mobile App with Root access? Do we still need to Root the phone before using this library?

Thanks.

Missing JniInvocationCreate

Got this error on some Android 10 treble ROM devices (also samsung Galaxy J7(2016)): CANNOT LINK EXECUTABLE "/system/bin/app_process64": cannot locate symbol "JniInvocationCreate" referenced by "/system/lib64/libandroid_runtime.so"

This symbol seems to be located in /apex/com.android.runtime/lib64/libnativehelper.so (Android 10) or /apex/com.android.art/lib64/libnativehelper.so (Android 11), which might be why it only happens on Android 10 Treble ROMs. This can also be found in /system/etc/ld.config.$ABI_STRING.txt.

Cannot load native library with Runtime.getRuntime().loadLibrary() in root process

I tried to follow the example code on how to load native library in the root process, however, according to their javadoc both System.loadLibrary() and Runtime.getRuntime().loadLibrary() expect a library name instead of a library path. So when I tried to pass in a path, I got the following error (on API 27):

java.lang.UnsatisfiedLinkError: Directory separator should not appear in library name: ...

After some search, I found that System.load() or Runtime.getRuntime().load() should be used for a library path, and I actually loaded my libraries successfully with them. So maybe the example code is calling the wrong method?

app_process issues on Android Q

Obviously Q is in early stages at the moment, but it appears something has changed. It seems that app_process (64 in this case) has some restrictions on it, which prevent it from finding the runtime namespace when copied outside of /system/bin.

This is the launch script generated for running:

#app_process=/data/data/com.kieronquinn.app.configurator/cache/.app_process64_cefa02da-6d16-41da-99cb-2a8db8e0d05e
toybox cp /system/bin/app_process64 /data/data/com.kieronquinn.app.configurator/cache/.app_process64_cefa02da-6d16-41da-99cb-2a8db8e0d05e >/dev/null 2>/dev/null
toybox chmod 0766 /data/data/com.kieronquinn.app.configurator/cache/.app_process64_cefa02da-6d16-41da-99cb-2a8db8e0d05e >/dev/null 2>/dev/null
restorecon /data/data/com.kieronquinn.app.configurator/cache/.app_process64_cefa02da-6d16-41da-99cb-2a8db8e0d05e >/dev/null 2>/dev/null
supolicy --live "allow appdomain supersu binder { call transfer }" "allow appdomain magisk binder { call transfer }" >/dev/null 2>/dev/null
NO_ADDR_COMPAT_LAYOUT_FIXUP=1 ANDROID_ROOT=/system LD_LIBRARY_PATH=/system/lib64:/system/lib64/drm:/system/lib64/bootstrap:/system/lib64/hw:/system/lib64/vndk-Q:/system/lib64/vndk-sp-Q:/vendor/lib64:/vendor/lib64/egl:/vendor/lib64/hw:/vendor/lib64/mediacas:/vendor/lib64/mediadrm:/vendor/lib64/soundfx:/data/data/com.kieronquinn.app.configurator/cache:/librootjava CLASSPATH=/data/app/com.kieronquinn.app.configurator-yQZhhz0ii4xqio3QAnC40w==/base.apk /data/data/com.kieronquinn.app.configurator/cache/.app_process64_cefa02da-6d16-41da-99cb-2a8db8e0d05e /system/bin --nice-name=com.kieronquinn.app.configurator:root com.kieronquinn.app.configurator.root.RootLaunch
toybox rm /data/data/com.kieronquinn.app.configurator/cache/.app_process64_cefa02da-6d16-41da-99cb-2a8db8e0d05e >/dev/null 2>/dev/null

Which gives the following result:

Error finding namespace of apex: no namespace called runtime
Aborted

This error comes from the main app_process running line.

If I modify the script to run app_process64 directly from /system/bin, and run just that (not the copying or supolicy lines), as follows:

NO_ADDR_COMPAT_LAYOUT_FIXUP=1 ANDROID_ROOT=/system LD_LIBRARY_PATH=/system/lib64:/system/lib64/drm:/system/lib64/bootstrap:/system/lib64/hw:/system/lib64/vndk-Q:/system/lib64/vndk-sp-Q:/vendor/lib64:/vendor/lib64/egl:/vendor/lib64/hw:/vendor/lib64/mediacas:/vendor/lib64/mediadrm:/vendor/lib64/soundfx:/data/data/com.kieronquinn.app.configurator/cache:/librootjava CLASSPATH=/data/app/com.kieronquinn.app.configurator-yQZhhz0ii4xqio3QAnC40w==/base.apk /system/bin/app_process64 /system/bin --nice-name=com.kieronquinn.app.configurator:root com.kieronquinn.app.configurator.root.RootLaunch

It runs fine, and the Java code runs as expected.

Not really sure if it's an issue in Magisk (as it does seem to have issues with SELinux) or if something has changed in Q.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.