Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wontfix] GrapheneOS: "Can't start: java.lang.UnsatisfiedLinkError: dlopen failed - Permission denied" #226

Closed
4 tasks done
marzzzello opened this issue Jun 30, 2022 · 15 comments

Comments

@marzzzello
Copy link

Please report bugs of Shizuku itself.

Requirements:

  • Shizuku version is up-to-date
  • Shizuku is downloaded from official channels (GitHub release)
  • Shizuku is not running in a virtual environment
  • (Root users) No Xposed installed / Xposed is not enabled for Shizuku (unrooted)

Change "[ ]" to "[x]" if it meets the requirements.

Reports not meet the requirements will be immediately closed.

Information:

  • Shizuku version: v12.8.1
  • Mode: adb
  • Android version: 12 (GrapheneOS)
  • Device: Pixel 6 Pro

Logs:

Relevant logcat:

06-29 13:46:31.569 10814 10814 D Shizuku : applet shizuku_starter
06-29 13:46:31.676 10814 10814 D Shizuku : start_server
06-29 13:46:31.677 10819 10819 D Shizuku : child
06-29 13:46:31.678 10819 10819 D Shizuku : exec app_process
06-29 13:46:31.793 10819 10819 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
06-29 13:46:31.792 10819 10819 W shizuku_server: type=1400 audit(0.0:24419): avc: denied { read } for name="u:object_r:odsign_prop:s0" dev="tmpfs" ino=227 scontext=u:r:shell:s0 tcontext=u:object_r:odsign_prop:s0 tclass=file permissive=0
06-29 13:46:31.797 10819 10819 I AndroidRuntime: Using default boot image
06-29 13:46:31.797 10819 10819 I AndroidRuntime: Leaving lock profiling enabled
06-29 13:46:31.797 10819 10819 W libc    : Access denied finding property "odsign.verification.success"
06-29 13:46:31.799 10819 10819 W shizuku_server: ART APEX data files are untrusted.
06-29 13:46:31.856 10819 10819 D shizuku_server: Time zone APEX ICU file found: /apex/com.android.tzdata/etc/icu/icu_tzdata.dat
06-29 13:46:31.856 10819 10819 D shizuku_server: I18n APEX ICU file found: /apex/com.android.i18n/etc/icu/icudt68l.dat
06-29 13:46:31.872 10819 10819 D AndroidRuntime: Calling main entry rikka.shizuku.server.ShizukuService
06-29 13:46:31.868 10819 10819 W main    : type=1400 audit(0.0:24420): avc: denied { execute } for path="/data/app/~~DmPJlqx-hgeJwV5MgQMcWQ==/moe.shizuku.privileged.api-n00WNHSFxOYwYoFGywplEg==/base.apk" dev="dm-34" ino=36962 scontext=u:r:shell:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0
06-29 13:46:31.874 10819 10819 D AndroidRuntime: Shutting down VM
06-29 13:46:31.874 10819 10819 E AndroidRuntime: FATAL EXCEPTION: main
06-29 13:46:31.874 10819 10819 E AndroidRuntime: PID: 10819
06-29 13:46:31.874 10819 10819 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: couldn't map "/data/app/~~DmPJlqx-hgeJwV5MgQMcWQ==/moe.shizuku.privileged.api-n00WNHSFxOYwYoFGywplEg==/base.apk!/lib/arm64-v8a/librish.so" segment 0: Permission denied
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at java.lang.Runtime.load0(Runtime.java:929)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at java.lang.System.load(System.java:1620)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at rikka.rish.b.f(SourceFile:3)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at rikka.rish.b.e(SourceFile:4)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at rikka.shizuku.server.c.<init>(SourceFile:2)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at rikka.shizuku.server.ShizukuService.<init>(SourceFile:1)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at rikka.shizuku.server.ShizukuService.main(SourceFile:4)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: Error reporting crash
06-29 13:46:31.874 10819 10819 E AndroidRuntime: java.lang.RuntimeException: Bad file descriptor
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at android.os.BinderProxy.transactNative(Native Method)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at android.os.BinderProxy.transact(BinderProxy.java:571)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at android.os.IServiceManager$Stub$Proxy.checkService(IServiceManager.java:416)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at android.os.ServiceManagerProxy.getService(ServiceManagerNative.java:63)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at android.os.ServiceManager.rawGetService(ServiceManager.java:335)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at android.os.ServiceManager.getService(ServiceManager.java:134)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at android.app.ActivityManager$1.create(ActivityManager.java:4452)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at android.app.ActivityManager$1.create(ActivityManager.java:4449)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at android.util.Singleton.get(Singleton.java:43)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at android.app.ActivityManager.getService(ActivityManager.java:4440)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$KillApplicationHandler.uncaughtException(RuntimeInit.java:156)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
06-29 13:46:31.874 10819 10819 E AndroidRuntime: 	at java.lang.Thread.dispatchUncaughtException(Thread.java:2200)
06-29 13:46:31.874 10819 10819 I Process : Sending signal. PID: 10819 SIG: 9

Terminal log:

❯ adb shell sh /sdcard/Android/data/moe.shizuku.privileged.api/start.sh 
info: start.sh begin
info: attempt to copy starter from /storage/emulated/0/Android/data/moe.shizuku.privileged.api/starter to /data/local/tmp/shizuku_starter
info: exec /data/local/tmp/shizuku_starter
info: starter begin
info: killing old process...
info: apk path is /data/app/~~DmPJlqx-hgeJwV5MgQMcWQ==/moe.shizuku.privileged.api-n00WNHSFxOYwYoFGywplEg==/base.apk
info: starting server...
info: shizuku_starter exit with 0

Describe the bug:
shizuku doesn't seem to start because of some permission error

Additional context:

Maybe the error is related to some GrapheneOS specific patch of Android but I can't switch to another OS currently for testing

@marzzzello marzzzello changed the title java.lang.UnsatisfiedLinkError: dlopen failed - Permission denied Can't start: java.lang.UnsatisfiedLinkError: dlopen failed - Permission denied Jun 30, 2022
@RikkaW
Copy link
Member

RikkaW commented Jun 30, 2022

#181

@RikkaW RikkaW closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2022
@RikkaW
Copy link
Member

RikkaW commented Jun 30, 2022

avc: denied { execute } for path="/data/app/~~DmPJlqx-hgeJwV5MgQMcWQ==/moe.shizuku.privileged.api-n00WNHSFxOYwYoFGywplEg==/base.apk" dev="dm-34" ino=36962 scontext=u:r:shell:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0

Your log shows the reason clearly, GrapheneOS disallows shell (adb) to execute codes from apk.

Here is the related commit form GrapheneOS:

GrapheneOS/platform_system_sepolicy@fe67984

@RikkaW RikkaW changed the title Can't start: java.lang.UnsatisfiedLinkError: dlopen failed - Permission denied [Wontfix] GrapheneOS: "Can't start: java.lang.UnsatisfiedLinkError: dlopen failed - Permission denied" Jun 30, 2022
@RikkaW RikkaW pinned this issue Jun 30, 2022
@marzzzello
Copy link
Author

Ah makes sense, thank you for the quick answer

@tr1p0p
Copy link

tr1p0p commented Sep 19, 2022

Too bad, on grapheneos and confirm this happen yeah.

@e-t-l
Copy link

e-t-l commented Nov 30, 2022

Same here. Sounds like it should still start from physical ADB though?

@vvb2060
Copy link
Collaborator

vvb2060 commented Jan 18, 2023

@TempUser13
Copy link

In this GrapheneOS update https://grapheneos.org/releases#2023012500, shizuku can initialize and run

@e-t-l
Copy link

e-t-l commented Jan 26, 2023

In this GrapheneOS update https://grapheneos.org/releases#2023012500, shizuku can initialize and run

That's fantastic news. Seriously hoping they don't revert/patch it. Anything specific about your setup that you think was necessary to make it work? (also if I want to test this today, would I need to sideload the OTA, or is the release you linked to in one of the release channels?)

@TempUser13
Copy link

TempUser13 commented Jan 26, 2023

In this GrapheneOS update https://grapheneos.org/releases#2023012500, shizuku can initialize and run

That's fantastic news. Seriously hoping they don't revert/patch it. Anything specific about your setup that you think was necessary to make it work? (also if I want to test this today, would I need to sideload the OTA, or is the release you linked to in one of the release channels?)

Just installed the GrapheneOS update, I didn't need to do anything else as the issue was the SELinux policy blocking what shizuku did. The changelog explains why they reverted it and the update will be in the alpha channel for a few days I assume before moving to stable.

@e-t-l
Copy link

e-t-l commented Jan 28, 2023

So... I'm not sure if this is actually working?

I've installed this OTA update (via the beta channel) and installed and run Shizuku, activating it via wifi debugging. The shell output looks correct, Shizuku says it's running, I can connect apps (like AmbientMusicMod) to Shizuku and they say it's running... But I haven't actually see any behavior tha demonstrates it.

In other words, AmbientMusicMod is enabled, but it's not detecting any music. Fdroid Shizuku Privileged Extension is installed, Fdroid recognizes it and attempts to use it, but the updates that should be seamless in the background just hang indefinitely.

@TempUser13 @vvb2060 have you or anyone else been able to positively confirm Shizuku is actually doing what it's supposed to? What behavior are you seeing, and with what apps?

@TempUser13
Copy link

I used DarQ and it worked

@tr1p0p
Copy link

tr1p0p commented Jan 30, 2023

I confirm last grapheneOS build made Shizulu fully work. I try with Droid-ify, Rootless JamesDSP, audio mod, Swift Backup and everything work great ! That good news !

@e-t-l
Copy link

e-t-l commented Jan 30, 2023

I used DarQ and it worked

OK, I tested it with DarQ and it's not working for me. DarQ behaves normally, it let's me enable it and set the apps to force dark mode on, but when I go to one of those apps, the dark mode simply doesn't happen.

So something is going on with my install that is preventing it from working properly. Does Shizuku have any dependencies, like Google Play services, or any other things we can think of that would make it fail silently?

@TempUser13
Copy link

I personally use GMS, that might make a difference

@e-t-l
Copy link

e-t-l commented Jun 12, 2023

I figured it out: Shizuku kept crashing silently until I disabled the security setting "Secure app spawning." I also noticed some other apps stopped having ANRs after disabling this setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants