diff --git a/DroidFish/assets/stockfish15.mygz b/DroidFish/assets/stockfish15.mygz new file mode 100755 index 0000000..f9e5d8e Binary files /dev/null and b/DroidFish/assets/stockfish15.mygz differ diff --git a/DroidFish/src/org/petero/droidfish/engine/EngineUtil.java b/DroidFish/src/org/petero/droidfish/engine/EngineUtil.java index 338878a..0229d99 100644 --- a/DroidFish/src/org/petero/droidfish/engine/EngineUtil.java +++ b/DroidFish/src/org/petero/droidfish/engine/EngineUtil.java @@ -37,7 +37,7 @@ public class EngineUtil { public static String internalStockFishName() { final int sdkVersion = Integer.parseInt(Build.VERSION.SDK); if (sdkVersion < 4) - return null; + return "stockfish15.mygz"; return "stockfish-" + CpuAbi.get(); } } diff --git a/DroidFish/src/org/petero/droidfish/engine/InternalStockFish.java b/DroidFish/src/org/petero/droidfish/engine/InternalStockFish.java index 7144495..c3a381e 100644 --- a/DroidFish/src/org/petero/droidfish/engine/InternalStockFish.java +++ b/DroidFish/src/org/petero/droidfish/engine/InternalStockFish.java @@ -28,6 +28,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; +import java.util.zip.GZIPInputStream; import android.content.Context; @@ -73,6 +74,8 @@ public class InternalStockFish extends ExternalEngine { InputStream is = null; try { is = context.getAssets().open(sfExe); + if (sfExe.endsWith(".mygz")) + is = new GZIPInputStream(is); MessageDigest md = MessageDigest.getInstance("SHA-1"); byte[] buf = new byte[8192]; while (true) { @@ -112,6 +115,8 @@ public class InternalStockFish extends ExternalEngine { to.createNewFile(); InputStream is = context.getAssets().open(sfExe); + if (sfExe.endsWith(".mygz")) + is = new GZIPInputStream(is); OutputStream os = new FileOutputStream(to); try {