1

I want to use shell command for my app as root permission. I put in my manifest:

<uses-permission android:name="android.permission.ACCESS_SUPERUSER"/>

I want to know if there is a way to allow Super User permission programmatically without using any input device. As you know a window like this is appearing : enter image description here

I want to avoid that step and programmatically select Remember choice forever.

Community
  • 1
  • 1
Daniele
  • 606
  • 1
  • 9
  • 23

2 Answers2

1

Short answer! You can not do programatically !

Yogesh Rathi
  • 6,056
  • 4
  • 48
  • 76
1

Just exec the command su and within that Process you have root priviliges:

Process p = Runtime.getRuntime().exec("su");

See this blog post for full example.

Source

Dr Mido
  • 2,389
  • 2
  • 19
  • 48