commit a5744d795891d0092f3127976a50381f30746fd2 Author: Nathan Freitas nathan@freitas.net Date: Fri Jan 13 22:14:39 2017 -0500
small chnage to only check for sys iptables once --- .../android/service/transproxy/TorTransProxy.java | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/orbotservice/src/main/java/org/torproject/android/service/transproxy/TorTransProxy.java b/orbotservice/src/main/java/org/torproject/android/service/transproxy/TorTransProxy.java index ca6d830..6c3121a 100644 --- a/orbotservice/src/main/java/org/torproject/android/service/transproxy/TorTransProxy.java +++ b/orbotservice/src/main/java/org/torproject/android/service/transproxy/TorTransProxy.java @@ -103,20 +103,21 @@ public class TorTransProxy implements TorServiceConstants { private String findSystemIPTables () { - - //if the user wants us to use the built-in iptables, then we have to find it - File fileIpt = new File("/system/xbin/iptables"); - - if (fileIpt.exists()) - mSysIptables = fileIpt.getAbsolutePath(); - else + if (mSysIptables == null) { - - fileIpt = new File("/system/bin/iptables"); + //if the user wants us to use the built-in iptables, then we have to find it + File fileIpt = new File("/system/xbin/iptables");
if (fileIpt.exists()) mSysIptables = fileIpt.getAbsolutePath(); - } + else + { + + fileIpt = new File("/system/bin/iptables"); + + if (fileIpt.exists()) + mSysIptables = fileIpt.getAbsolutePath(); + }
return mSysIptables; }
tor-commits@lists.torproject.org