diff --git a/opsxpro/src/main/java/com/zzzmode/appopsx/AssetsUtils.java b/opsxpro/src/main/java/com/zzzmode/appopsx/AssetsUtils.java index d271221..d62ea3e 100644 --- a/opsxpro/src/main/java/com/zzzmode/appopsx/AssetsUtils.java +++ b/opsxpro/src/main/java/com/zzzmode/appopsx/AssetsUtils.java @@ -2,6 +2,7 @@ import android.content.Context; import android.content.res.AssetFileDescriptor; +import android.os.Build; import java.io.File; import java.io.FileOutputStream; @@ -69,4 +70,13 @@ public static void copyFile(Context context, String fileName, File destFile, boo } } + static boolean is64Bit() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + String[] supported64BitAbis = Build.SUPPORTED_64_BIT_ABIS; + return supported64BitAbis != null && supported64BitAbis.length > 0; + }else { + return Build.CPU_ABI.equals("arm64-v8a"); + } + } + } diff --git a/opsxpro/src/main/java/com/zzzmode/appopsx/LocalServerManager.java b/opsxpro/src/main/java/com/zzzmode/appopsx/LocalServerManager.java index 8fd0400..d348297 100644 --- a/opsxpro/src/main/java/com/zzzmode/appopsx/LocalServerManager.java +++ b/opsxpro/src/main/java/com/zzzmode/appopsx/LocalServerManager.java @@ -101,8 +101,8 @@ private boolean startServer() throws Exception{ writer = new BufferedWriter(new OutputStreamWriter(exec.getOutputStream())); sAuthToken.set("appopsx-"+System.currentTimeMillis()+"%$%"+Math.random()); - - String[] cmds = {"export LD_LIBRARY_PATH=/vendor/lib:/system/lib", + String arch = AssetsUtils.is64Bit() ? "64" : ""; + String[] cmds = {"export LD_LIBRARY_PATH="+String.format("/vendor/lib%1$s:/system/lib%2$s", arch,arch), "export CLASSPATH=" + SConfig.getClassPath(), "echo start", "exec app_process /system/bin com.zzzmode.appopsx.server.AppOpsMain $@ "+SOCKET_PATH+" "+sAuthToken.get()};