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

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



commit 022436515d73f773d38149dc38c2aea0f07ab1d9
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
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
 	 */



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits