Home > Mobile >  Through the exec () to perform the iptables command to display the system must be as the root
Through the exec () to perform the iptables command to display the system must be as the root

Time:10-30

Runtime. GetRuntime (). The exec (" iptables - the nL - line - the number "),
Display can 't initialize iptables table' filter ': you must be root,

My AndroidManifest. XML configuration will be a problem, the exec (" ls/data ") this command is normal, is not the iptables, strives for the bosses,

CodePudding user response:

Is the insufficient permissions,
Need to phone ROOT, obtain ROOT
Process Process=Runtime. GetRuntime (). The exec (" su ");
DataOutputStream OS=null;
OS=new DataOutputStream (process. GetOutputStream ());
OS. Write (" iptables - nL - line - the number "getBytes ());
OS. WriteBytes (" \ n ");
OS. The flush ();
  • Related