android執行腳本語言完成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().exec(“su”);
} catch (IOException e) {
e.printStackTrace();
}
// /data/data/com.android.providers.telephony/databases/mmssms.db
//1.修改系統的短信數據庫的訪問權限 777
try {
// RootTools.sendShell(“chmod 777 /data/data/com.android.providers.telephony/databases/mmssms.db”, 30000);
//
//
// SQLiteDatabase db = SQLiteDatabase.openDatabase(“/data/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/data/com.android.providers.telephony/databases/mmssms.db”, 30000);
// RootTools.isAccessGiven();

// RootTools.installBinary(this, R.raw.key, “key”);

} catch (Exception e) {
e.printStackTrace();
}
}
}

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *