[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] small chnage to only check for sys iptables once



commit a5744d795891d0092f3127976a50381f30746fd2
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
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 mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits