Runtime.getRuntime().exec("iptables -nL --line-number"),
顯示can't initialize iptables table'filter' : you must be root。
我的AndroidManifest.xml配置沒什么問題,exec("ls /data")這種命令正常,就是iptables不行,求大佬解惑。
uj5u.com熱心網友回復:
就是權限不足,需要手機ROOT,獲取ROOT權限
Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = null;
os = new DataOutputStream(process.getOutputStream());
os.write("iptables -nL --line-number".getBytes());
os.writeBytes("\n");
os.flush();
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/195625.html
標籤:Android
上一篇:微信小程式獲取openID的方式
