在开发时,手机先要ROOT,然后在通过代码改变权限。
public synchronized static boolean getRoot(String paramString)
{
Process process = null;
DataOutputStream os = null;
try
{
process = Runtime.getRuntime().exec("su");
os = new DataOutputStream(process.getOutputStream());
os.writeBytes(paramString + "n");
os.writeBytes("exitn");
os.flush();
process.waitFor();
} catch (Exception localException)
{
System.out.println("@@@@root cmd error:"+localException);
//localException.printStackTrace();
return false;
}finally {
try {
if (os != null) {
os.close();
}
process.destroy();
} catch (Exception e) {
System.out.println("###root cmd error:"+e);
}
}
return true;
}
引用时需要注意加入权限:
getRoot("chmod -R 777 /data/data/com.xxxxx/databases/wa.db");
水物理模拟器手机版 安卓版v1.3.39
水物理模拟器是一款玩法非常多样的沙盒建造类手游,玩家可以在游
创造世界2 安卓版v2.1.0
创造世界2是一款非常有趣的模拟类游戏,玩家在游戏中可以控制自
时光杂货店0.1折 安卓版v1.9.1
时光杂货店折扣版是一款模拟经营类游戏,玩家们将在游戏中重回八
TRS12火车模拟器(内置模组) 安卓版v1.3.9
TRS12火车模拟器(内置模组)是一个非常有趣的火车模拟游戏
泽塔奥特曼升华器模拟器 最新版v2.3
泽塔奥特曼升华器模拟器是根据《泽塔奥特曼》电视剧出现的变身器