1
我想將觸摸屏事件寫入'/ dev/input/event1',但它運行'open(「/ dev/input/event1」,O_RDWR);'經許可denied.My手機已經根深蒂固,我獲得的根與代碼:android open(「/ dev/input/event1」,O_RDWR);許可被拒絕?
String apkRoot="chmod 777 "+getPackageCodePath();
RootCommand(apkRoot);
public static boolean RootCommand(String command)
{
Process process = null;
DataOutputStream os = null;
try
{
process = Runtime.getRuntime().exec("su");
os = new DataOutputStream(process.getOutputStream());
os.writeBytes(command + "\n");
os.writeBytes("exit\n");
os.flush();
process.waitFor();
} catch (Exception e)
{
Log.d("*** DEBUG ***", "ROOT REE" + e.getMessage());
return false;
} finally
{
try
{
if (os != null)
{
os.close();
}
process.destroy();
} catch (Exception e)
{
}
}
Log.d("*** DEBUG ***", "Root SUC ");
return true;
}
它表明我的應用程序中獲取根的確,但我感到困惑的「權限被拒絕」。