Skip to content

Commit c4adc38

Browse files
author
gerhard.kalab
committedDec 5, 2014
use static stockfish binary instead of PIE and non-PIE versions
1 parent 57a666c commit c4adc38

File tree

7 files changed

+5
-15
lines changed

7 files changed

+5
-15
lines changed
 

‎libs/armeabi-v7a/libstockfish.so

444 KB
Binary file not shown.

‎libs/armeabi/libstockfish-nopie.so

-430 KB
Binary file not shown.

‎libs/armeabi/libstockfish.so

57.9 KB
Binary file not shown.

‎libs/x86/libstockfish-nopie.so

-614 KB
Binary file not shown.

‎libs/x86/libstockfish.so

136 KB
Binary file not shown.

‎src/org/scid/android/ScidAndroidActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private void checkUciEngine() {
229229
+ File.separator
230230
+ "lib"
231231
+ File.separator
232-
+ EngineManager.getInternalEngineFileName());
232+
+ EngineManager.INTERNAL_ENGINE_FILE_NAME);
233233
FileOutputStream fout = new FileOutputStream(
234234
engine.getAbsolutePath());
235235
byte[] b = new byte[1024];

‎src/org/scid/android/engine/EngineManager.java

+4-14
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import android.content.DialogInterface.OnCancelListener;
2828
import android.content.DialogInterface.OnClickListener;
2929
import android.os.AsyncTask;
30-
import android.os.Build;
3130
import android.util.Log;
3231
import android.util.Xml;
3332
import android.widget.Toast;
@@ -39,6 +38,7 @@
3938
* Class to manage UCI chess engines.
4039
*/
4140
public class EngineManager {
41+
public static final String INTERNAL_ENGINE_FILE_NAME = "libstockfish.so";
4242
private static final String ENGINE_DATA_FILE = "engines.xml";
4343
private static final String INTERNAL_ENGINE_NAME = "Stockfish 5";
4444
private static EngineConfig defaultEngine;
@@ -87,8 +87,9 @@ public interface EngineChangeListener {
8787
public EngineManager(Context context) {
8888
this.context = context;
8989
// Establish the default engine
90-
defaultEngine = new EngineConfig(INTERNAL_ENGINE_NAME, context
91-
.getFilesDir().getPath() + getInternalEngineFileName(), null, 0);
90+
defaultEngine = new EngineConfig(INTERNAL_ENGINE_NAME,
91+
new File(context.getFilesDir(), INTERNAL_ENGINE_FILE_NAME)
92+
.getAbsolutePath(), null, 0);
9293
}
9394

9495
public String getFilesDir() {
@@ -138,17 +139,6 @@ public EngineConfig getCurrentEngine() {
138139
return getDefaultEngine();
139140
}
140141

141-
public static String getInternalEngineFileName() {
142-
final String engineFileName;
143-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
144-
// use the position independent executable (PIE)
145-
engineFileName = "libstockfish.so";
146-
} else {
147-
engineFileName = "libstockfish-nopie.so";
148-
}
149-
return engineFileName;
150-
}
151-
152142
/**
153143
* Convenience method to get the name of the current engine.
154144
*

0 commit comments

Comments
 (0)
Failed to load comments.