<div dir="ltr">Hi Dave,<div>Have you fixed this problem?I&#39;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&#39;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" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FSable%2Fsoot%2Fwiki%2FInstrumenting-Android-Apps-with-Soot\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGvFwpGF30vbViYsmOInfuNyGtBDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FSable%2Fsoot%2Fwiki%2FInstrumenting-Android-Apps-with-Soot\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGvFwpGF30vbViYsmOInfuNyGtBDw&#39;;return true;">https://github.com/Sable/soot/<wbr>wiki/Instrumenting-Android-<wbr>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@<wbr>app@com.example.webb.test4-1@<wbr>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=<wbr>smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/<wbr>framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=<wbr>krait --instruction-set-features=<wbr>default --dex-file=/data/app/com.<wbr>example.webb.test4-1/base.apk --oat-file=/data/dalvik-cache/<wbr>arm/data@app@com.example.webb.<wbr>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 &#39;/data/app/com.example.webb.<wbr>test4-1/base.apk&#39;: Invalid type descriptor: &#39;Ljava/lang/&#39;annotation&#39;/<wbr>Annotation;&#39;<br>05-29 15:12:51.963  4255  4255 W System  : ClassLoader referenced unknown path: /data/app/com.example.webb.<wbr>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.<wbr>webb.test4/com.example.webb.<wbr>test4.MainActivity}: java.lang.<wbr>ClassNotFoundException: Didn&#39;t find class &quot;com.example.webb.test4.<wbr>MainActivity&quot; on path: DexPathList[[zip file &quot;/data/app/com.example.webb.<wbr>test4-1/base.apk&quot;],<wbr>nativeLibraryDirectories=[/<wbr>data/app/com.example.webb.<wbr>test4-1/lib/arm, /vendor/lib, /system/lib]]<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at android.app.ActivityThread.<wbr>performLaunchActivity(<wbr>ActivityThread.java:2361)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at android.app.ActivityThread.<wbr>handleLaunchActivity(<wbr>ActivityThread.java:2520)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at android.app.ActivityThread.-<wbr>wrap11(ActivityThread.java)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at android.app.ActivityThread$H.<wbr>handleMessage(ActivityThread.<wbr>java:1363)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at android.os.Handler.<wbr>dispatchMessage(Handler.java:<wbr>102)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at android.os.Looper.loop(Looper.<wbr>java:148)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at android.app.ActivityThread.<wbr>main(ActivityThread.java:5466)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at java.lang.reflect.Method.<wbr>invoke(Native Method)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at com.android.internal.os.<wbr>ZygoteInit$<wbr>MethodAndArgsCaller.run(<wbr>ZygoteInit.java:726)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at com.android.internal.os.<wbr>ZygoteInit.main(ZygoteInit.<wbr>java:616)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime: Caused by: java.lang.<wbr>ClassNotFoundException: Didn&#39;t find class &quot;com.example.webb.test4.<wbr>MainActivity&quot; on path: DexPathList[[zip file &quot;/data/app/com.example.webb.<wbr>test4-1/base.apk&quot;],<wbr>nativeLibraryDirectories=[/<wbr>data/app/com.example.webb.<wbr>test4-1/lib/arm, /vendor/lib, /system/lib]]<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at dalvik.system.<wbr>BaseDexClassLoader.findClass(<wbr>BaseDexClassLoader.java:56)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at java.lang.ClassLoader.<wbr>loadClass(ClassLoader.java:<wbr>511)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at java.lang.ClassLoader.<wbr>loadClass(ClassLoader.java:<wbr>469)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at android.app.Instrumentation.<wbr>newActivity(Instrumentation.<wbr>java:1068)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:         at android.app.ActivityThread.<wbr>performLaunchActivity(<wbr>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.<wbr>test4-1/base.apk<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at dalvik.system.DexFile.<wbr>openDexFileNative(Native Method)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at dalvik.system.DexFile.<wbr>openDexFile(DexFile.java:295)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at dalvik.system.DexFile.&lt;init&gt;(<wbr>DexFile.java:80)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at dalvik.system.DexFile.&lt;init&gt;(<wbr>DexFile.java:59)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at dalvik.system.DexPathList.<wbr>loadDexFile(DexPathList.java:<wbr>279)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at dalvik.system.DexPathList.<wbr>makePathElements(DexPathList.<wbr>java:248)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at dalvik.system.DexPathList.&lt;<wbr>init&gt;(DexPathList.java:120)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at dalvik.system.<wbr>BaseDexClassLoader.&lt;init&gt;(<wbr>BaseDexClassLoader.java:48)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at dalvik.system.PathClassLoader.<wbr>&lt;init&gt;(PathClassLoader.java:<wbr>65)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at android.app.<wbr>ApplicationLoaders.<wbr>getClassLoader(<wbr>ApplicationLoaders.java:58)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at android.app.LoadedApk.<wbr>getClassLoader(LoadedApk.java:<wbr>376)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at android.app.LoadedApk.<wbr>makeApplication(LoadedApk.<wbr>java:569)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at android.app.ActivityThread.<wbr>handleBindApplication(<wbr>ActivityThread.java:4729)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at android.app.ActivityThread.-<wbr>wrap1(ActivityThread.java)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at android.app.ActivityThread$H.<wbr>handleMessage(ActivityThread.<wbr>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.<wbr>ClassNotFoundException: com.example.webb.test4.<wbr>MainActivity<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at java.lang.Class.classForName(<wbr>Native Method)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at java.lang.BootClassLoader.<wbr>findClass(ClassLoader.java:<wbr>781)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at java.lang.BootClassLoader.<wbr>loadClass(ClassLoader.java:<wbr>841)<br>05-29 15:12:51.968  4255  4255 E AndroidRuntime:                 at java.lang.ClassLoader.<wbr>loadClass(ClassLoader.java:<wbr>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.<wbr>NoClassDefFoundError: Class not found using the boot class loader; no stack trace available<br>05-29 15:12:51.970   721  3302 W ActivityManager:   Force finishing activity com.example.webb.test4/.<wbr>MainActivity<br>______________________________<wbr>_________________<br>Soot-list mailing list<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="3q-rMfoQAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">Soot...@CS.McGill.CA</a><br><a href="https://mailman.CS.McGill.CA/mailman/listinfo/soot-list" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fmailman.CS.McGill.CA%2Fmailman%2Flistinfo%2Fsoot-list\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNESpIFG08DX_QShQ4aH7soZrrlBBw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fmailman.CS.McGill.CA%2Fmailman%2Flistinfo%2Fsoot-list\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNESpIFG08DX_QShQ4aH7soZrrlBBw&#39;;return true;">https://mailman.CS.McGill.CA/<wbr>mailman/listinfo/soot-list</a><br></p><p></p><p></p><p></p><p></p><p></p></blockquote></div></div>