From 022436515d73f773d38149dc38c2aea0f07ab1d9 Mon Sep 17 00:00:00 2001 From: Nathan Freitas Date: Mon, 9 Jun 2014 18:34:40 -0400 Subject: [PATCH] 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 2744a55c..438e68d2 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(),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 */