Skip to content

Android.Manifest.permission

안드로이드에서 Root권한 획득하는 방법

They can use the Intent that is exposed by Superuser, that Shell uses to get root:

final int SUPERUSER_REQUEST = 2323; // arbitrary number of your choosing.
Intent intent = new Intent("android.intent.action.superuser"); // superuser request.
intent.putExtra("name","Shell"); // tell Superuser the name of the requesting app.
intent.putExtra("packagename","koushikdutta.shell"); // tel Superuser the name of the requesting package.
startActivityForResult(intent, SUPERUSER_REQUEST); // make the request!

Then, if the user presses Yes or Always, that Java application can call su just like normal:

Runtime.getRuntime().exec("su -c ");

Favorite site