mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-15 02:12:40 +01:00
DroidFish: Fix for Android 1.5.
This commit is contained in:
@@ -46,6 +46,10 @@ public class InternalStockFish extends ExternalEngine {
|
|||||||
setOption("Skill Level", strength/50);
|
setOption("Skill Level", strength/50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final class CpuAbi {
|
||||||
|
final String get() { return Build.CPU_ABI; }
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void copyFile(File from, File to) throws IOException {
|
protected void copyFile(File from, File to) throws IOException {
|
||||||
if (new File(intSfPath).exists())
|
if (new File(intSfPath).exists())
|
||||||
@@ -55,7 +59,9 @@ public class InternalStockFish extends ExternalEngine {
|
|||||||
to.delete();
|
to.delete();
|
||||||
to.createNewFile();
|
to.createNewFile();
|
||||||
|
|
||||||
InputStream is = context.getAssets().open("stockfish-" + Build.CPU_ABI);
|
final int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
|
||||||
|
String abi = (sdkVersion < 4) ? "armeabi" : new CpuAbi().get();
|
||||||
|
InputStream is = context.getAssets().open("stockfish-" + abi);
|
||||||
OutputStream os = new FileOutputStream(to);
|
OutputStream os = new FileOutputStream(to);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user