Demo-Mode-tile icon indicating copy to clipboard operation
Demo-Mode-tile copied to clipboard

Feature request: enable permissions w/o adb if root is available

Open notpushkin opened this issue 6 years ago • 4 comments

Thanks for such a neat app! I've noticed that if the device is rooted, there's no need to use adb to run the pm grant commands, one can run them using on-device Terminal instead (using su first, of course). It would be even more nice though if we could do this from the app itself.

notpushkin avatar Nov 19 '17 13:11 notpushkin

Well, yes but I didn't want to embed the app with root dependencies to be fair

franciscofranco avatar Sep 23 '20 15:09 franciscofranco

At least add a button to copy the command (without adb shell but with su -c) to the clipboard or make it selectable so we can paste it into our terminal emulator

binarynoise avatar Jul 02 '21 20:07 binarynoise

I forked the project (need to upload the changes, though) and implemented root. Didn't need to add a root lib, just used

Runtime.getRuntime().exec(arrayOf(
	  "su", "-c",
	  "pm grant ${BuildConfig.APPLICATION_ID} android.permission.DUMP && pm grant ${BuildConfig.APPLICATION_ID} android.permission.WRITE_SECURE_SETTINGS"
))

Here is an apk for you to test (just rename back to .apk): DemoModeTile-1.7-debug.apk.renamedTo.zip

binarynoise avatar Aug 11 '21 17:08 binarynoise

@franciscofranco @notpushkin Here is the code of my fork: https://github.com/franciscofranco/Demo-Mode-tile/compare/master...binarynoise:master What do you think?

binarynoise avatar Aug 11 '21 17:08 binarynoise