commit 22bd248a4b65e28f03429a4443dfdf2201da4005 Author: n8fr8 nathan@guardianproject.info Date: Fri May 1 14:00:56 2020 -0400
update binary install scripts, to fix pdnsd install - now pdnsd is packaged as libpdsnd.so to work on newer platforms --- .../torproject/android/service/util/CustomNativeLoader.java | 2 ++ .../android/service/util/CustomTorResourceInstaller.java | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/orbotservice/src/main/java/org/torproject/android/service/util/CustomNativeLoader.java b/orbotservice/src/main/java/org/torproject/android/service/util/CustomNativeLoader.java index 24a994d5..50dc2825 100644 --- a/orbotservice/src/main/java/org/torproject/android/service/util/CustomNativeLoader.java +++ b/orbotservice/src/main/java/org/torproject/android/service/util/CustomNativeLoader.java @@ -75,6 +75,8 @@ public class CustomNativeLoader {
File fileNativeBin = new File(getNativeLibraryDir(context),libname + ".so"); + if (!fileNativeBin.exists()) + fileNativeBin = new File(getNativeLibraryDir(context),"lib" + libname + ".so");
if (fileNativeBin.exists()) { diff --git a/orbotservice/src/main/java/org/torproject/android/service/util/CustomTorResourceInstaller.java b/orbotservice/src/main/java/org/torproject/android/service/util/CustomTorResourceInstaller.java index a44ff18d..3c4c1fc3 100644 --- a/orbotservice/src/main/java/org/torproject/android/service/util/CustomTorResourceInstaller.java +++ b/orbotservice/src/main/java/org/torproject/android/service/util/CustomTorResourceInstaller.java @@ -63,18 +63,20 @@ public class CustomTorResourceInstaller implements TorServiceConstants { } }
+ File fileTorBin = new File(installFolder, TOR_BINARY_KEY); + //it exists but we can't execute it, so copy it to a new path if (fileTor.exists()) { InputStream is = new FileInputStream(fileTor); - streamToFile(is, fileTor, false, true); - setExecutable(fileTor); + streamToFile(is, fileTorBin, false, true); + setExecutable(fileTorBin);
- if (fileTor.exists() && fileTor.canExecute()) - return fileTor; + if (fileTorBin.exists() && fileTorBin.canExecute()) + return fileTorBin; }
//let's try another approach - fileTor = CustomNativeLoader.loadNativeBinary(context,TOR_ASSET_KEY,new File(installFolder, TOR_ASSET_KEY)); + fileTor = CustomNativeLoader.loadNativeBinary(context,TOR_ASSET_KEY,fileTorBin);
if (fileTor != null && fileTor.exists()) setExecutable(fileTor);