我想在我的根设备上从应用程序中的命令行运行 openvpn 二进制文件。它已经扎根了(我已经检查了几次)。我在用着
Process process = Runtime.getRuntime().exec(cmd);
为此,但最后我得到错误:
Note: Cannot ioctl TUNSETIFF tun: Operation not permitted (errno=1)
Attempting fallback to kernel 2.2 TUN/TAP interface
Cannot allocate TUN/TAP dev dynamically
Exiting
我试着用
Process process = Runtime.getRuntime().exec("su -c "+command);
我试过了
Process process = Runtime.getRuntime().exec(new String[]{"su", "-c", command});
我尝试使用来自http://muzikant-android.blogspot.com/2011/02/how-to-get-root-access-and-execute.html的方法- 一切都失败了,甚至没有一次运行(没有响应或 ANR 错误)。
你能帮我吗?