Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable supersu permission dialog

Tags:

android

su

Is it possible to disable the "grant/deny" popup dialog when my app needs to perform tasks that require root access? I have full control of the device the app will run on (internal project), the device is rooted and it has supersu 2.x app.

This tells me that I need to declare the android.permission.ACCESS_SUPERUSER permission for my app to disable the popup, but it has no effect.

Is there a simple way to solve this (without changing the option i supersu app settings)?

like image 828
Misterer Avatar asked Feb 13 '23 12:02

Misterer


2 Answers

Remove the SuperSU APK (usually either /system/app/Superuser.apk or /data/app/eu.chainfire.supersu*.apk or /system/app/SuperSU/SuperSU.apk) and rm -rf the /data/data/eu.chainfire.supersu directory, and the su command will always grant access without showing the prompt.

If you're making a custom firmware image for your project, just exclude the APK.

Note that pm path eu.chainfire.supersu from an adb shell will give you the exact path for the APK.

like image 76
Jorrit Avatar answered Feb 15 '23 10:02

Jorrit


You can't decide in you app to disable the prompt. That's a security measure which no app can change.

If your device is rooted and you have supersu, you can still get rid of the dialog. You have to change a setting in supersu: Settings --> Access --> Default access --> Grant

like image 24
Mikel Pascual Avatar answered Feb 15 '23 09:02

Mikel Pascual