update torrc and torrcdiag when you need to
This commit is contained in:
parent
f91a35bbac
commit
917ec8d7a0
|
@ -135,6 +135,19 @@ public class TorResourceInstaller implements TorServiceConstants {
|
||||||
streamToFile(sbis,outFile,true,false);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue