DroidFish: Fix for Android 1.5.

This commit is contained in:
Peter Osterlund 2012-01-06 19:31:34 +00:00
parent 99717796fe
commit f3c99a56f4

View File

@ -46,6 +46,10 @@ public class InternalStockFish extends ExternalEngine {
setOption("Skill Level", strength/50);
}
private static final class CpuAbi {
final String get() { return Build.CPU_ABI; }
}
@Override
protected void copyFile(File from, File to) throws IOException {
if (new File(intSfPath).exists())
@ -55,7 +59,9 @@ public class InternalStockFish extends ExternalEngine {
to.delete();
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);
try {