Android executes the script language to complete root
Public class TestsuActivity extends Activity {
/** Called when the activity is first created .*/
@ Override
Public void onCreate (Bundle savedInstanceState ){
Super. onCreate (savedInstanceState );
SetContentView (R. layout. main );
Try {
Runtime.getruntime(cmd.exe c ("su ");
} Catch (IOException e ){
E. printStackTrace ();
}
/// Data/com. android. providers. telephony/databases/mmssms. db
// 1. modify the system's SMS database access permissions by 777
Try {
// RootTools. sendShell ("chmod 777/data/com. android. providers. telephony/databases/mmssms. db", 30000 );
//
//
// SQLiteDatabase db = SQLiteDatabase. openDatabase ("/data/com. android. providers. telephony/databases/mmssms. db", null, SQLiteDatabase. OPEN_READONLY );
// Cursor curosr = db. rawQuery ("select address, body from sms", null );
// While (curosr. moveToNext ()){
//
// String address = curosr. getString (0 );
// String body = curosr. getString (1 );
//
// System. out. println (address + "---" + body );
//}
// Curosr. close ();
// Db. close ();
// RootTools. sendShell ("chmod 660/data/com. android. providers. telephony/databases/mmssms. db", 30000 );
// RootTools. isAccessGiven ();
// RootTools. installBinary (this, R. raw. key, "key ");
} Catch (Exception e ){
E. printStackTrace ();
}
}
}