keymapperorg / KeyMapper

An Android app that change what the buttons do on your devices!
http://docs.keymapper.club
GNU General Public License v3.0
1.05k stars 153 forks source link

Granting permissions with shizuku crashes on Android 14 #1234

Closed b-risk closed 2 months ago

b-risk commented 3 months ago

Developer TODO (don't remove)

Describe the bug When granting Shizuku access the app immediately crashes, keeps crashing on launch until Shizuku is disabled. Other apps I've tried like SystemUI Tuner don't crash.

To Reproduce Follow app instructions to grant Shizuku access.

Expected behavior App shouldn't crash.

Smartphone (please complete the following information):

Additional context Tried reinstalling the app, disabling and re-enabling Shizuku, it always crashes when the permission is granted.

Crash Report

type: crash
osVersion: google/bluejay/bluejay:14/AP2A.240605.024/2024062000:user/release-keys
package: io.github.sds100.keymapper:63
process: io.github.sds100.keymapper
processUptime: 235 + 243 ms
installer: com.looker.droidify

java.lang.NoSuchMethodError: No interface method grantRuntimePermission(Ljava/lang/String;Ljava/lang/String;I)V in class Landroid/permission/IPermissionManager; or its super classes (declaration of 'android.permission.IPermissionManager' appears in /system/framework/framework.jar!classes3.dex)
    at io.github.sds100.keymapper.system.permissions.AndroidPermissionAdapter.grantPermissionWithShizuku(Unknown Source:23)
    at io.github.sds100.keymapper.system.permissions.AndroidPermissionAdapter.grant(Unknown Source:26)
    at io.github.sds100.keymapper.system.permissions.AutoGrantPermissionController$start$1.invokeSuspend(Unknown Source:30)
    at io.github.sds100.keymapper.system.permissions.AutoGrantPermissionController$start$1.invoke(SourceFile:2)
    at io.github.sds100.keymapper.system.permissions.AutoGrantPermissionController$start$1.invoke(SourceFile:1)
    at kotlinx.coroutines.flow.t$a$a.invokeSuspend(Unknown Source:63)
    at kotlinx.coroutines.flow.t$a$a.invoke(SourceFile:2)
    at kotlinx.coroutines.flow.t$a$a.invoke(SourceFile:1)
    at g3.l$a.invokeSuspend(SourceFile:1)
    at kotlin.coroutines.jvm.internal.a.resumeWith(Unknown Source:11)
    at d3.y0.run(SourceFile:1)
    at android.os.Handler.handleCallback(Handler.java:959)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loopOnce(Looper.java:232)
    at android.os.Looper.loop(Looper.java:317)
    at android.app.ActivityThread.main(ActivityThread.java:8623)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
    at com.android.internal.os.ExecInit.main(ExecInit.java:50)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:369)
    Suppressed: d3.w0: [r2{Cancelling}@3651d96, Dispatchers.Main]
sds100 commented 3 months ago

Hmm, I see you're using GrapheneOS and they mess with the permission system right? The error is saying it can't find the system function to grant a permission to an app.

b-risk commented 3 months ago

Hmm, I see you're using GrapheneOS and they mess with the permission system right? The error is saying it can't find the system function to grant a permission to an app.

Alright then maybe it's not possible with my device unfortunately, they don't recommend Shizuku overall and I guess I'm just out of luck for some of the features I want without root.

sds100 commented 3 months ago

I just reproduced this on my Pixel 7, stock Android so its a new Android 14 thing :) Will also fix for 2.6.1

b-risk commented 3 months ago

I just reproduced this on my Pixel 7, stock Android so its a new Android 14 thing :) Will also fix for 2.6.1

That's great! Guess I might not be out of luck then :)