Android: statically load iconv library

Fixes #3291

Thanks to @arpruss for reporting the bug, and suggesting the fix.

Also, remove trailing whitespaces.
This commit is contained in:
est31 2015-10-24 20:44:07 +02:00
parent e46fa22003
commit 49bda7f98d
1 changed files with 16 additions and 15 deletions

View File

@ -12,23 +12,23 @@ public class MtNativeActivity extends NativeActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
m_MessagReturnCode = -1; m_MessagReturnCode = -1;
m_MessageReturnValue = ""; m_MessageReturnValue = "";
} }
@Override @Override
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();
} }
public void copyAssets() { public void copyAssets() {
Intent intent = new Intent(this, MinetestAssetCopy.class); Intent intent = new Intent(this, MinetestAssetCopy.class);
startActivity(intent); startActivity(intent);
} }
public void showDialog(String acceptButton, String hint, String current, public void showDialog(String acceptButton, String hint, String current,
int editType) { int editType) {
Intent intent = new Intent(this, MinetestTextEntry.class); Intent intent = new Intent(this, MinetestTextEntry.class);
Bundle params = new Bundle(); Bundle params = new Bundle();
params.putString("acceptButton", acceptButton); params.putString("acceptButton", acceptButton);
@ -40,37 +40,37 @@ public class MtNativeActivity extends NativeActivity {
m_MessageReturnValue = ""; m_MessageReturnValue = "";
m_MessagReturnCode = -1; m_MessagReturnCode = -1;
} }
public static native void putMessageBoxResult(String text); public static native void putMessageBoxResult(String text);
/* ugly code to workaround putMessageBoxResult not beeing found */ /* ugly code to workaround putMessageBoxResult not beeing found */
public int getDialogState() { public int getDialogState() {
return m_MessagReturnCode; return m_MessagReturnCode;
} }
public String getDialogValue() { public String getDialogValue() {
m_MessagReturnCode = -1; m_MessagReturnCode = -1;
return m_MessageReturnValue; return m_MessageReturnValue;
} }
public float getDensity() { public float getDensity() {
return getResources().getDisplayMetrics().density; return getResources().getDisplayMetrics().density;
} }
public int getDisplayWidth() { public int getDisplayWidth() {
return getResources().getDisplayMetrics().widthPixels; return getResources().getDisplayMetrics().widthPixels;
} }
public int getDisplayHeight() { public int getDisplayHeight() {
return getResources().getDisplayMetrics().heightPixels; return getResources().getDisplayMetrics().heightPixels;
} }
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, protected void onActivityResult(int requestCode, int resultCode,
Intent data) { Intent data) {
if (requestCode == 101) { if (requestCode == 101) {
if (resultCode == RESULT_OK) { if (resultCode == RESULT_OK) {
String text = data.getStringExtra("text"); String text = data.getStringExtra("text");
m_MessagReturnCode = 0; m_MessagReturnCode = 0;
m_MessageReturnValue = text; m_MessageReturnValue = text;
} }
@ -79,7 +79,7 @@ public class MtNativeActivity extends NativeActivity {
} }
} }
} }
static { static {
System.loadLibrary("openal"); System.loadLibrary("openal");
System.loadLibrary("ogg"); System.loadLibrary("ogg");
@ -87,13 +87,14 @@ public class MtNativeActivity extends NativeActivity {
System.loadLibrary("ssl"); System.loadLibrary("ssl");
System.loadLibrary("crypto"); System.loadLibrary("crypto");
System.loadLibrary("gmp"); System.loadLibrary("gmp");
System.loadLibrary("iconv");
// We don't have to load libminetest.so ourselves, // We don't have to load libminetest.so ourselves,
// but if we do, we get nicer logcat errors when // but if we do, we get nicer logcat errors when
// loading fails. // loading fails.
System.loadLibrary("minetest"); System.loadLibrary("minetest");
} }
private int m_MessagReturnCode; private int m_MessagReturnCode;
private String m_MessageReturnValue; private String m_MessageReturnValue;
} }