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
  • 668
  • 2
  • 10
  • 25

2 Answers2

1

Short answer! You can not do programatically !

Yogesh Rathi
  • 6,331
  • 4
  • 51
  • 81
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,414
  • 4
  • 32
  • 72