Skip to content

Commit

Permalink
compatible arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
8enet committed Jan 11, 2017
1 parent 195bf96 commit b4f7ebe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions opsxpro/src/main/java/com/zzzmode/appopsx/AssetsUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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()};
Expand Down

0 comments on commit b4f7ebe

Please sign in to comment.