ルート化されたデバイスのアプリで、コマンド ラインから 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 エラー)。
手伝ってくれませんか?