[tor-commits] [orbot/master] don't delete installed binaries

n8fr8 at torproject.org n8fr8 at torproject.org
Wed Dec 13 20:20:19 UTC 2017


commit f3f9162867f27531019b0ff674713825cb665dc2
Author: n8fr8 <nathan at freitas.net>
Date:   Thu Dec 7 15:44:06 2017 -0500

    don't delete installed binaries
---
 .../service/util/OtherResourceInstaller.java        | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/orbotservice/src/main/java/org/torproject/android/service/util/OtherResourceInstaller.java b/orbotservice/src/main/java/org/torproject/android/service/util/OtherResourceInstaller.java
index 6c1506b3..9768432c 100644
--- a/orbotservice/src/main/java/org/torproject/android/service/util/OtherResourceInstaller.java
+++ b/orbotservice/src/main/java/org/torproject/android/service/util/OtherResourceInstaller.java
@@ -71,9 +71,8 @@ public class OtherResourceInstaller implements TorServiceConstants {
         if (Build.CPU_ABI.contains("x86"))
             cpuPath = "x86";
 
-        deleteDirectory(installFolder);
-
-        installFolder.mkdirs();
+        if (!installFolder.exists())
+            installFolder.mkdirs();
 
         is = context.getAssets().open(cpuPath + '/' + OBFSCLIENT_ASSET_KEY + MP3_EXT);
         outFile = new File(installFolder, OBFSCLIENT_ASSET_KEY);
@@ -220,22 +219,6 @@ public class OtherResourceInstaller implements TorServiceConstants {
         // Change the permissions
         Runtime.getRuntime().exec("chmod "+mode+" "+abspath).waitFor();
     }
-    /**
-     * Asserts that the binary files are installed in the bin directory.
-     * @param ctx context
-     * @param showErrors indicates if errors should be alerted
-     * @return false if the binary files could not be installed
-     */
-    /*
-    public static boolean assertIpTablesBinaries(Context ctx, boolean showErrors) throws Exception {
-        boolean changed = false;
-
-        // Check iptables_g1
-        File file = new File(ctx.getDir("bin",0), "iptables");
-        copyRawFile(ctx, R.raw.iptables, file, CHMOD_EXEC, false);
-
-        return true;
-    }*/
 
 
     private void setExecutable(File fileBin) {





More information about the tor-commits mailing list