ensure torrc values are overwritten

This commit is contained in:
Nathan Freitas 2014-06-09 18:34:40 -04:00
parent 81bd61764c
commit 022436515d
1 changed files with 16 additions and 0 deletions

View File

@ -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
*/