首页 > 移动平台 > 详细

android 使用系统级别权限

时间:2016-10-31 13:51:44      阅读:247      评论:0      收藏:0      [点我收藏+]
java.lang.SecurityException: Neither user 10027 nor current process has android.permission.MODIFY_PHONE_STATE

 1、root手机,奇兔刷机助手

2、将app拷贝至/system/priv-app目录下

3、重启手机

 

 

 

附:

/**
* 应用程序运行命令获取 Root权限,设备必须已破解(获得ROOT权限)
*
* @return 应用程序是/否获取Root权限
*/
public static boolean upgradeRootPermission(String pkgCodePath) {
Process process = null;
DataOutputStream os = null;
try {
String cmd = "chmod 777 " + pkgCodePath;
process = Runtime.getRuntime().exec("su"); //切换到root帐号
os = new DataOutputStream(process.getOutputStream());
os.writeBytes(cmd + "\n");
os.writeBytes("exit\n");
os.flush();
process.waitFor();
} catch (Exception e) {
return false;
} finally {
try {
if (os != null) {
os.close();
}
process.destroy();
} catch (Exception e) {
}
}
return true;
}

 

android 使用系统级别权限

原文:http://www.cnblogs.com/agilezhu/p/6015403.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!