I'm using AAssetManager_fromJava in my JNI code.
This works perfectly.
Until I enable proguard, then the call to AAssetManager_fromJava crashes.
I tried add -keep class android.content.res.* but that is not enough.
Anyone know what to add? Have tried searching the documentation and google but couldn't find any information about it.
05-28 16:02:04.752 23051 23051 F libc : Fatal signal 11 (SIGSEGV) at 0x0000002c (code=1), thread 23051 (llusionlabs.bmx)
05-28 16:02:04.853 123 123 I DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-28 16:02:04.853 123 123 I DEBUG : Build fingerprint: 'Amazon/soho/soho:4.2.2/JDQ39/11.3.2.2_user_322095420:user/release-keys'
05-28 16:02:04.853 123 123 I DEBUG : Revision: '1'
05-28 16:02:04.853 123 123 I DEBUG : pid: 23051, tid: 23051, name: llusionlabs.bmx >>> se.illusionlabs.bmx <<<
05-28 16:02:04.853 123 123 I DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000002c
05-28 16:02:04.931 123 123 I DEBUG : r0 00000000 r1 00000000 r2 40e8d950 r3 40929c88
05-28 16:02:04.931 123 123 I DEBUG : r4 00000000 r5 5c4ffa3d r6 40e8d950 r7 5c4ffa45
05-28 16:02:04.931 123 123 I DEBUG : r8 be9654d8 r9 40defc4c sl 40e8fe20 fp be9654a8
05-28 16:02:04.931 123 123 I DEBUG : ip 00000000 sp be965360 lr 408cb6f1 pc 408cb6f0 cpsr 60000030
05-28 16:02:04.931 123 123 I DEBUG : d0 6d41797469766961 d1 6341584d422f787a
05-28 16:02:04.931 123 123 I DEBUG : d2 65746e6f635f646f d3 415f7365725f746e
05-28 16:02:04.931 123 123 I DEBUG : d4 0000000000000000 d5 3ff0000000000000
05-28 16:02:04.931 123 123 I DEBUG : d6 42c8000000000963 d7 0000000000000000
05-28 16:02:04.931 123 123 I DEBUG : d8 0000000000000000 d9 0000000000000000
05-28 16:02:04.931 123 123 I DEBUG : d10 0000000000000000 d11 0000000000000000
05-28 16:02:04.931 123 123 I DEBUG : d12 0000000000000000 d13 0000000000000000
05-28 16:02:04.931 123 123 I DEBUG : d14 0000000000000000 d15 0000000000000000
05-28 16:02:04.931 123 123 I DEBUG : d16 0000000000000017 d17 0000000000000000
05-28 16:02:04.931 123 123 I DEBUG : d18 0000000000000000 d19 0000000000000000
05-28 16:02:04.931 123 123 I DEBUG : d20 3fc554e7eb0eb47c d21 3e66376972bea4d0
05-28 16:02:04.931 123 123 I DEBUG : d22 3f4de16b9c24a98f d23 3fb0f4a31edab38b
05-28 16:02:04.931 123 123 I DEBUG : d24 3fede16b9c24a98f d25 3fe55559ee5e69f9
05-28 16:02:04.931 123 123 I DEBUG : d26 0000000000000000 d27 0000000000000000
05-28 16:02:04.931 123 123 I DEBUG : d28 0000000000000005 d29 0000000000000000
05-28 16:02:04.931 123 123 I DEBUG : d30 0000000000000000 d31 0000000000000000
05-28 16:02:04.931 123 123 I DEBUG : scr 80000090
05-28 16:02:04.931 123 123 I DEBUG :
05-28 16:02:04.931 123 123 I DEBUG : backtrace:
05-28 16:02:04.931 123 123 I DEBUG : #00 pc 0004b6f0 /system/lib/libdvm.so
05-28 16:02:04.931 123 123 I DEBUG : #01 pc 00008add /system/lib/libandroid.so (AAssetManager_fromJava+52)
05-28 16:02:04.931 123 123 I DEBUG : #02 pc 0011f82c /data/app-lib/se.illusionlabs.bmx-1/libcommon.so (ILFile_InitAssetManager(_JNIEnv*, _jobject*, char const*)+72)
05-28 16:02:04.931 123 123 I DEBUG : #03 pc 002003b8 /data/app-lib/se.illusionlabs.bmx-1/libbmx.so (Java_se_illusionlabs_bmx_BMXJNILib_setup+140)
05-28 16:02:04.931 123 123 I DEBUG : #04 pc 0001e390 /system/lib/libdvm.so (dvmPlatformInvoke+112)
05-28 16:02:04.931 123 123 I DEBUG : #05 pc 0004d319 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+396)
05-28 16:02:04.931 123 123 I DEBUG : #06 pc 0004f477 /system/lib/libdvm.so (dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*)+174)
05-28 16:02:04.931 123 123 I DEBUG : #07 pc 000277a0 /system/lib/libdvm.so
05-28 16:02:04.931 123 123 I DEBUG : #08 pc 0002b488 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
05-28 16:02:04.931 123 123 I DEBUG : #09 pc 0005ff23 /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+374)
05-28 16:02:04.931 123 123 I DEBUG : #10 pc 0006783d /system/lib/libdvm.so
05-28 16:02:04.931 123 123 I DEBUG : #11 pc 000277a0 /system/lib/libdvm.so
05-28 16:02:04.931 123 123 I DEBUG : #12 pc 0002b488 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
05-28 16:02:04.939 123 123 I DEBUG : #13 pc 0005fc4d /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
05-28 16:02:04.939 123 123 I DEBUG : #14 pc 00049903 /system/lib/libdvm.so
05-28 16:02:04.939 123 123 I DEBUG : #15 pc 0004bc59 /system/lib/libandroid_runtime.so
05-28 16:02:04.939 123 123 I DEBUG : #16 pc 0004c903 /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, char const*)+390)
05-28 16:02:04.939 123 123 I DEBUG : #17 pc 00000db7 /system/bin/app_process
05-28 16:02:04.939 123 123 I DEBUG : #18 pc 0001279f /system/lib/libc.so (__libc_init+38)
05-28 16:02:04.939 123 123 I DEBUG : #19 pc 00000ae8 /system/bin/app_process
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-dontwarn com.amazon.**
-keep class com.amazon.** {*;}
-keepattributes *Annotation*
-keep class se.illusionlabs.bmx.BMXJNILib
-keepclassmembers public class se.illusionlabs.bmx.BMXActivity {
public void startMusic();
public void stopMusic();
public void lockRotation();
public void unlockRotation();
}
-keepclassmembers public class se.illusionlabs.bmx.BMXActivityAmazon {
public void setupIAP();
public void buyItem(String);
public void addItem(String);
}