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

n8fr8 at torproject.org n8fr8 at torproject.org
Thu Mar 2 04:10:21 UTC 2017


commit a5744d795891d0092f3127976a50381f30746fd2
Author: Nathan Freitas <nathan at 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;
 	}





More information about the tor-commits mailing list