update torrc and torrcdiag when you need to

This commit is contained in:
Nathan Freitas 2014-06-11 22:03:57 -04:00
parent f91a35bbac
commit 917ec8d7a0
1 changed files with 13 additions and 0 deletions

View File

@ -135,6 +135,19 @@ public class TorResourceInstaller implements TorServiceConstants {
streamToFile(sbis,outFile,true,false);
}
is = context.getResources().openRawResource(R.raw.torrcdiag);
outFile = new File(installFolder, TORRCDIAG_ASSET_KEY);
shell.add(new SimpleCommand(COMMAND_RM_FORCE + outFile.getAbsolutePath())).waitForFinish();
streamToFile(is,outFile, false, false);
if (extraLines != null && extraLines.length() > 0)
{
StringBufferInputStream sbis = new StringBufferInputStream('\n' + extraLines + '\n');
streamToFile(sbis,outFile,true,false);
}
shell.close();
return true;
}