Closed myisduy closed 9 months ago
Ask about this issue in the upstream repo(https://github.com/official-stockfish/Stockfish) and see if there are any actions that need to be done. The NDK version Pikafish uses is fully synced with Stockfish.
1.change name to libpikafish.so . move to project app/src/main/jniLibs/arm64-v8a 2.pikafish.nnue to assets/pikafish.nnue
String apkFilePath = getPackageCodePath();
// 推断lib目录路径
LIB_PATH = apkFilePath.substring(0, apkFilePath.lastIndexOf("/")) + "/lib/arm64";
File cacheDir = getCacheDir();
String outputFilePath = cacheDir.getAbsolutePath() + File.separator + "pikafish.nnue";
ENGIN_PATH = outputFilePath;
Log.d(TAG, "lib目录路径: " + LIB_PATH);
Log.d(TAG, "引擎路径: " + ENGIN_PATH);
// 解压NNUE;
AssetUtils.extractAssetFile(this, "pikafish.nnue");
3.
Runtime.getRuntime().exec(LIB_PATH + "/libpikafish.so")
I'll mark this as resolved now.
Describe the issue
From android 10 version, we cannot execute binary file without root permission. If they set targetSDK = 28, they cannot be released on the play store.
Expected behavior
Any method that integrates the engine
Steps to reproduce
public class Engine { public Engine(File engineFile) { String command = engineFile.getAbsolutePath(); try { Process process = Runtime.getRuntime().exec(command);
}
Anything else?
No response
Operating system
Android
Pikafish version
Pikafish 2023-03-05