redex icon indicating copy to clipboard operation
redex copied to clipboard

Issue with ProGuard

Open tushar7sharma opened this issue 9 years ago • 8 comments

Getting this error on build after applying proguard.

This is the command I run: redex -o faster.apk input.apk -P proguard-project.txt

Its working fine when I don't use proguard

Unimplemented command (skipping): -adaptclassstrings at line 225 Unimplemented command (skipping): -renamesourcefileattribute at line 226 Unimplemented command (skipping): -renamesourcefileattribute at line 231 libredex/Transform.cpp:316: MethodItemEntry *(anonymous namespace)::get_target(MethodItemEntry *, const addr_mei_t &): assertion `addr_to_mei.count(target) != 0' failed. Invalid opcode target 000000100x7fce35eda600 0000003b in get_target if-eqz v4

0 redex-all 0x00000001011628ea _Z11assert_failPKcS0_jS0_S0_z + 218 1 redex-all 0x00000001011ec9e3 _ZN12_GLOBAL__N_1L10get_targetEP15MethodItemEntryRKNSt3__113unordered_mapIjS1_NS2_4hashIjEENS2_8equal_toIjEENS2_9allocatorINS2_4pairIKjS1_EEEEEE + 275 2 redex-all 0x00000001011e46f5 _ZN15MethodTransform7balloonEP7DexCode + 517 3 redex-all 0x00000001011e4486 _ZN15MethodTransformC2EPK7DexCode + 70 4 redex-all 0x000000010116b0d9 _ZN7DexCode7balloonEv + 41 5 redex-all 0x00000001011f77d2 _ZN9WorkQueue13worker_threadEPv + 82 6 libsystem_pthread.dylib 0x00007fffc77edabb _pthread_body + 180 7 libsystem_pthread.dylib 0x00007fffc77eda07 _pthread_body + 0 8 libsystem_pthread.dylib 0x00007fffc77ed231 thread_start + 13 libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Redex assertion failure 0 redex-all 0x00000001011627d4 _Z23crash_backtrace_handleri + 52 1 libsystem_platform.dylib 0x00007fffc77e3bba _sigtramp + 26 2 ??? 0x00000004d02b1240 0x0 + 20672352832 3 libsystem_c.dylib 0x00007fffc766b440 abort + 129 4 libc++abi.dylib 0x00007fffc61cd85a __cxa_bad_cast + 0 5 libc++abi.dylib 0x00007fffc61f2c37 _ZL25default_terminate_handlerv + 243 6 libobjc.A.dylib 0x00007fffc6cfbf33 _ZL15_objc_terminatev + 124 7 libc++abi.dylib 0x00007fffc61efd69 _ZSt11__terminatePFvvE + 8 8 libc++abi.dylib 0x00007fffc61ef7de _ZN10__cxxabiv1L22exception_cleanup_funcE19_Unwind_Reason_CodeP17_Unwind_Exception + 0 9 redex-all 0x000000010116292b _Z11assert_failPKcS0_jS0_S0_z + 283 10 redex-all 0x00000001011ec9e3 _ZN12_GLOBAL__N_1L10get_targetEP15MethodItemEntryRKNSt3__113unordered_mapIjS1_NS2_4hashIjEENS2_8equal_toIjEENS2_9allocatorINS2_4pairIKjS1_EEEEEE + 275 11 redex-all 0x00000001011e46f5 _ZN15MethodTransform7balloonEP7DexCode + 517 12 redex-all 0x00000001011e4486 _ZN15MethodTransformC2EPK7DexCode + 70 13 redex-all 0x000000010116b0d9 _ZN7DexCode7balloonEv + 41 14 redex-all 0x00000001011f77d2 _ZN9WorkQueue13worker_threadEPv + 82 15 libsystem_pthread.dylib 0x00007fffc77edabb _pthread_body + 180 16 libsystem_pthread.dylib 0x00007fffc77eda07 _pthread_body + 0 17 libsystem_pthread.dylib 0x00007fffc77ed231 thread_start + 13 Traceback (most recent call last): File "/tmp/redex.ZM1nnr/redex.py", line 545, in run_redex(args) File "/tmp/redex.ZM1nnr/redex.py", line 484, in run_redex debugger) File "/tmp/redex.ZM1nnr/redex.py", line 133, in run_pass raise err subprocess.CalledProcessError: Command '/tmp/redex.ZM1nnr/redex-all --apkdir /tmp/redex.ZM1nnr/tmp8SZ4JQ.redex_extracted_apk --outdir /tmp/redex.ZM1nnr/tmpJ01_r4.redex_dexen --proguard-config=proguard-project.txt /tmp/redex.ZM1nnr/tmpJ01_r4.redex_dexen/dex0/classes.dex /tmp/redex.ZM1nnr/tmpJ01_r4.redex_dexen/dex1/classes2.dex' returned non-zero exit status -6

tushar7sharma avatar Mar 21 '17 11:03 tushar7sharma

Could you retry with the latest git master? We improved our code base significantly recently. If you still see a crash, we'd like to take a look at. Please share your apk in Dropbox or so if you're able to share it.

minjang avatar Mar 23 '17 06:03 minjang

I pulled in the latest code from master. But still can't seem to get it working.

This is the error log :

libredex/Transform.cpp:316: MethodItemEntry *(anonymous namespace)::get_target(MethodItemEntry *, const addr_mei_t &): assertion `addr_to_mei.count(target) != 0' failed. Invalid opcode target 000000100x7fa096420cc0 0000003b in get_target if-eqz v4

0 redex-all 0x00000001013918ea _Z11assert_failPKcS0_jS0_S0_z + 218 1 redex-all 0x000000010141b9e3 _ZN12_GLOBAL__N_1L10get_targetEP15MethodItemEntryRKNSt3__113unordered_mapIjS1_NS2_4hashIjEENS2_8equal_toIjEENS2_9allocatorINS2_4pairIKjS1_EEEEEE + 275 2 redex-all 0x00000001014136f5 _ZN15MethodTransform7balloonEP7DexCode + 517 3 redex-all 0x0000000101413486 _ZN15MethodTransformC2EPK7DexCode + 70 4 redex-all 0x000000010139a0d9 _ZN7DexCode7balloonEv + 41 5 redex-all 0x00000001014267d2 _ZN9WorkQueue13worker_threadEPv + 82 6 libsystem_pthread.dylib 0x00007fffc77edabb _pthread_body + 180 7 libsystem_pthread.dylib 0x00007fffc77eda07 _pthread_body + 0 8 libsystem_pthread.dylib 0x00007fffc77ed231 thread_start + 13 libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Redex assertion failure 0 redex-all 0x00000001013917d4 _Z23crash_backtrace_handleri + 52 1 libsystem_platform.dylib 0x00007fffc77e3bba _sigtramp + 26 2 ??? 0x00000004d02b1240 0x0 + 20672352832 3 libsystem_c.dylib 0x00007fffc766b440 abort + 129 4 libc++abi.dylib 0x00007fffc61cd85a __cxa_bad_cast + 0 5 libc++abi.dylib 0x00007fffc61f2c37 _ZL25default_terminate_handlerv + 243 6 libobjc.A.dylib 0x00007fffc6cfbf33 _ZL15_objc_terminatev + 124 7 libc++abi.dylib 0x00007fffc61efd69 _ZSt11__terminatePFvvE + 8 8 libc++abi.dylib 0x00007fffc61ef7de _ZN10__cxxabiv1L22exception_cleanup_funcE19_Unwind_Reason_CodeP17_Unwind_Exception + 0 9 redex-all 0x000000010139192b _Z11assert_failPKcS0_jS0_S0_z + 283 10 redex-all 0x000000010141b9e3 _ZN12_GLOBAL__N_1L10get_targetEP15MethodItemEntryRKNSt3__113unordered_mapIjS1_NS2_4hashIjEENS2_8equal_toIjEENS2_9allocatorINS2_4pairIKjS1_EEEEEE + 275 11 redex-all 0x00000001014136f5 _ZN15MethodTransform7balloonEP7DexCode + 517 12 redex-all 0x0000000101413486 _ZN15MethodTransformC2EPK7DexCode + 70 13 redex-all 0x000000010139a0d9 _ZN7DexCode7balloonEv + 41 14 redex-all 0x00000001014267d2 _ZN9WorkQueue13worker_threadEPv + 82 15 libsystem_pthread.dylib 0x00007fffc77edabb _pthread_body + 180 16 libsystem_pthread.dylib 0x00007fffc77eda07 _pthread_body + 0 17 libsystem_pthread.dylib 0x00007fffc77ed231 thread_start + 13 Traceback (most recent call last): File "/tmp/redex.vBb1ie/redex.py", line 545, in run_redex(args) File "/tmp/redex.vBb1ie/redex.py", line 484, in run_redex debugger) File "/tmp/redex.vBb1ie/redex.py", line 133, in run_pass raise err subprocess.CalledProcessError: Command '/tmp/redex.vBb1ie/redex-all --apkdir /tmp/redex.vBb1ie/tmp76BEZj.redex_extracted_apk --outdir /tmp/redex.vBb1ie/tmpXxTtJ8.redex_dexen --proguard-config=proguard-rules.txt /tmp/redex.vBb1ie/tmpXxTtJ8.redex_dexen/dex0/classes.dex /tmp/redex.vBb1ie/tmpXxTtJ8.redex_dexen/dex1/classes2.dex' returned non-zero exit status -6

tushar7sharma avatar Mar 23 '17 07:03 tushar7sharma

@int3 This looks similar to things you've been working on recently

justinjhendrick avatar Mar 30 '17 01:03 justinjhendrick

Same assertion failure as #126

justinjhendrick avatar Jun 27 '17 18:06 justinjhendrick

Are you using Kotlin? If so, you should try rebasing to a commit after ab25dcf164164bf52b206a934137c8588ceff6b4 in which Kotlin assertion failures were fixed

justinjhendrick avatar Aug 07 '17 20:08 justinjhendrick

@justinjhendrick not using Kotlin.

tushar7sharma avatar Aug 08 '17 07:08 tushar7sharma

Okay, if this reproduces on the latest master, could you send me the apk and config file(s) you're using? I'll try to reproduce it on my side.

justinjhendrick avatar Aug 08 '17 16:08 justinjhendrick

Closing due to inactivity. Feel free to reopen with new information.

NTillmann avatar Aug 14 '19 20:08 NTillmann