<div dir="ltr">Hi,<div>this looks like a soot bug.</div><span style="font-size:12.8px">05-29 15:12:51.962 4255 4255 W art : Failure to verify dex file '/data/app/com.example.webb.te</span><span style="font-size:12.8px">st4-1/base.apk': Invalid type descriptor: 'Ljava/lang/'annotation'/Annot</span><span style="font-size:12.8px">ation;'</span><div><span style="font-size:12.8px">the "'" around annotation is because "annotation" is also a keyword, which needs to be escaped in the Jimple files, but should not be escaped in the dex file. Apparently soot does not unescape this.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Are you using the newest version of soot from the nightly build server? </span></div><div><span style="font-size:12.8px"><a href="https://ssebuild.cased.de/nightly/soot/lib/">https://ssebuild.cased.de/nightly/soot/lib/</a></span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">If you do, consider posting a bug report with the APK file and the exact steps (commands) you were using in order to be easier reproducable. I assume the bug also occurs when you do not do any modify the Jimple code at all?</span><br></div><div><span style="font-size:12.8px">Yes, what you want to do is totally achievable using soot.</span></div><div><br></div><div><span style="font-size:12.8px">Marc</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-07-08 10:08 GMT+02:00 <span dir="ltr"><<a href="mailto:xwlin.roy@gmail.com" target="_blank">xwlin.roy@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Dave,<div>Have you fixed this problem?I'm facing the same problem.</div><div>If you have fixed this problem,hope you can share you solution.</div><div><br>在 2016年5月29日星期日 UTC+8下午9:39:45,Dave Webb写道:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>I want to use Soot in order to modify Android Apps.<br>However, I do *not* want to use the Instrumentation API shown in [1], but instead I want to transform an APK to Jimple, then manually manipulate the Jimple code with my own tools and afterwards transform the modified Jimple code back into an APK.<p>In order to setup this toolchain, I'm currently doing the following:<br>1. Use soot to transform an APK file into Jimple files<br>2. Use soot to transform the Jimple files into a DEX file<br>3. Repack the new DEX file with the original resources/assets/...<br>4. Sign and zipalign the APK</p><p>Although none of these steps produces an error, the final APK is not executable and crashes instantly when launched (see [2]).</p><p>My questions are:<br>1. Is my goal as described above achievable with Soot at all?<br>2. If so, which of the previously described steps is most likely the culprit?</p><p>Any help is highly appreciated!</p><p>[1] <a href="https://github.com/Sable/soot/wiki/Instrumenting-Android-Apps-with-Soot" rel="nofollow" target="_blank">https://github.com/Sable/soot/wiki/Instrumenting-Android-Apps-with-Soot</a><br>[2] adb logcat output:</p><p>05-29 15:12:51.841 4274 4274 E dex2oat : Failed to create oat file: /data/dalvik-cache/arm/data@app@com.example.webb.test4-1@base.apk@classes.dex: Permission denied<br>05-29 15:12:51.841 4274 4274 I dex2oat : dex2oat took 854.492us (threads: 4) <br>05-29 15:12:51.844 4255 4255 W art : Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/com.example.webb.test4-1/base.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.webb.test4-1@base.apk@classes.dex) because non-0 exit status<br>05-29 15:12:51.962 4255 4255 W art : Failure to verify dex file '/data/app/com.example.webb.test4-1/base.apk': Invalid type descriptor: 'Ljava/lang/'annotation'/Annotation;'<br>05-29 15:12:51.963 4255 4255 W System : ClassLoader referenced unknown path: /data/app/com.example.webb.test4-1/lib/arm<br>05-29 15:12:51.966 4255 4255 D AndroidRuntime: Shutting down VM<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: FATAL EXCEPTION: main<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: Process: com.example.webb.test4, PID: 4255<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.webb.test4/com.example.webb.test4.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.webb.test4.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.webb.test4-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.webb.test4-1/lib/arm, /vendor/lib, /system/lib]]<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2361)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2520)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5466)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.webb.test4.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.webb.test4-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.webb.test4-1/lib/arm, /vendor/lib, /system/lib]]<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:511)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:469)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1068)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2351)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: ... 9 more<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: Suppressed: java.io.IOException: Failed to open dex files from /data/app/com.example.webb.test4-1/base.apk<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at dalvik.system.DexFile.openDexFileNative(Native Method)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at dalvik.system.DexFile.openDexFile(DexFile.java:295)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at dalvik.system.DexFile.<init>(DexFile.java:80)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at dalvik.system.DexFile.<init>(DexFile.java:59)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at dalvik.system.DexPathList.loadDexFile(DexPathList.java:279)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at dalvik.system.DexPathList.makePathElements(DexPathList.java:248)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at dalvik.system.DexPathList.<init>(DexPathList.java:120)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:65)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:58)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.app.LoadedApk.getClassLoader(LoadedApk.java:376)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.app.LoadedApk.makeApplication(LoadedApk.java:569)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4729)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1424)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: ... 6 more<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: Suppressed: java.lang.ClassNotFoundException: com.example.webb.test4.MainActivity<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at java.lang.Class.classForName(Native Method)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at java.lang.BootClassLoader.findClass(ClassLoader.java:781)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:504)<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: ... 12 more<br>05-29 15:12:51.968 4255 4255 E AndroidRuntime: Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available<br>05-29 15:12:51.<a href="tel:970%20%C2%A0%20721%20%C2%A03302" value="+19707213302" target="_blank">970 721 3302</a> W ActivityManager: Force finishing activity com.example.webb.test4/.MainActivity<br>_______________________________________________<br>Soot-list mailing list<br><a rel="nofollow">Soot...@CS.McGill.CA</a><br><a href="https://mailman.CS.McGill.CA/mailman/listinfo/soot-list" rel="nofollow" target="_blank">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a><br></p><p></p><p></p><p></p><p></p><p></p></blockquote></div></div><br>_______________________________________________<br>
Soot-list mailing list<br>
<a href="mailto:Soot-list@CS.McGill.CA">Soot-list@CS.McGill.CA</a><br>
<a href="https://mailman.CS.McGill.CA/mailman/listinfo/soot-list" rel="noreferrer" target="_blank">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a><br>
<br></blockquote></div><br></div>