[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [orbot/master] update installer to get PLUTO binaries from assets
commit bb55557b44a781a23aebf25561a685deab499acc
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
Date: Wed Dec 16 10:27:06 2015 -0500
update installer to get PLUTO binaries from assets
---
.../android/service/TorResourceInstaller.java | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/org/torproject/android/service/TorResourceInstaller.java b/src/org/torproject/android/service/TorResourceInstaller.java
index 648f752..3e9621b 100644
--- a/src/org/torproject/android/service/TorResourceInstaller.java
+++ b/src/org/torproject/android/service/TorResourceInstaller.java
@@ -68,6 +68,11 @@ public class TorResourceInstaller implements TorServiceConstants {
InputStream is;
File outFile;
+
+ String cpuPath = "armeabi";
+
+ if (Build.CPU_ABI.contains("x86"))
+ cpuPath = "x86";
deleteDirectory(installFolder);
@@ -85,28 +90,24 @@ public class TorResourceInstaller implements TorServiceConstants {
shell.add(new SimpleCommand(COMMAND_RM_FORCE + outFile.getAbsolutePath())).waitForFinish();
streamToFile(is,outFile, false, false);
- String cpuPath = null;
-
//only install if ARM (GoLang only supports ARM for now)
- if (Build.CPU_ABI.contains("arm"))
+ if (cpuPath.equals("armeabi"))
{
- is = context.getResources().openRawResource(R.raw.obfs4proxy);
+ cpuPath = "armeabi";
+ is = context.getAssets().open(cpuPath + "/" + OBFSCLIENT_ASSET_KEY + ".mp3");
outFile = new File(installFolder, OBFSCLIENT_ASSET_KEY);
shell.add(new SimpleCommand(COMMAND_RM_FORCE + outFile.getAbsolutePath())).waitForFinish();
streamToFile(is,outFile, false, true);
setExecutable(outFile);
- is = context.getResources().openRawResource(R.raw.meek);
+ is = context.getAssets().open(cpuPath + "/" + MEEK_ASSET_KEY + ".mp3");
outFile = new File(installFolder, MEEK_ASSET_KEY);
shell.add(new SimpleCommand(COMMAND_RM_FORCE + outFile.getAbsolutePath())).waitForFinish();
streamToFile(is,outFile, false, true);
setExecutable(outFile);
- cpuPath = "armeabi";
}
- else if (Build.CPU_ABI.contains("x86"))
- cpuPath = "x86";
-
+
is = context.getAssets().open(cpuPath + "/tor.mp3");
outFile = new File(installFolder, TOR_ASSET_KEY);
shell.add(new SimpleCommand(COMMAND_RM_FORCE + outFile.getAbsolutePath())).waitForFinish();
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits