[tor-commits] [orbot/master] ensure torrc values are overwritten

n8fr8 at torproject.org n8fr8 at torproject.org
Mon Jun 9 22:50:39 UTC 2014


commit 022436515d73f773d38149dc38c2aea0f07ab1d9
Author: Nathan Freitas <nathan at freitas.net>
Date:   Mon Jun 9 18:34:40 2014 -0400

    ensure torrc values are overwritten
---
 .../android/service/TorResourceInstaller.java          |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/org/torproject/android/service/TorResourceInstaller.java b/src/org/torproject/android/service/TorResourceInstaller.java
index 2744a55..438e68d 100644
--- a/src/org/torproject/android/service/TorResourceInstaller.java
+++ b/src/org/torproject/android/service/TorResourceInstaller.java
@@ -115,6 +115,22 @@ public class TorResourceInstaller implements TorServiceConstants {
 		return true;
 	}
 	
+	public boolean installTorrc () throws IOException, FileNotFoundException, TimeoutException
+	{
+		
+		InputStream is;
+        File outFile;
+        
+        Shell shell = Shell.startShell(new ArrayList<String>(),installFolder.getAbsolutePath());
+        
+		is = context.getResources().openRawResource(R.raw.torrc);
+		outFile = new File(installFolder, TORRC_ASSET_KEY);
+		shell.add(new SimpleCommand(COMMAND_RM_FORCE + outFile.getAbsolutePath())).waitForFinish();
+		streamToFile(is,outFile, false, false);
+
+		return true;
+	}
+	
 	/*
 	 * Extract the Tor binary from the APK file using ZIP
 	 */





More information about the tor-commits mailing list