Java.lang.SecurityException:Neither user 10027 Nor current process have Android.permission.MODIFY_PHONE_STATE
1, Root mobile phone, odd rabbit brush machine assistant
2. Copy the app to the/system/priv-app directory
3. Restart your phone
Report:
/**
* Application Run command to get root permission, the device must be cracked (root access)
*
* @return App Yes/no get root permissions
*/
public static Boolean upgraderootpermission (String pkgcodepath) {
Process process = NULL;
DataOutputStream OS = null;
try {
String cmd = "chmod 777" + Pkgcodepath;
Process = Runtime.getruntime (). EXEC ("su"); Switch to root account
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 uses system-level permissions