[Android Software Development] MaxlMuller:
Problem after recompiling without modifications

Hello

I'm trying to use ApkTool v2.2.2 to decompile a Minilyrics apk to do some simple color modding.

So I just decompiled, recompiled without any modifications and resigned the apk, using the following commands:

Decompile:

Code:

apktool d minilyrics.apk

Recompile:

Code:

apktool b minilyrics -o minilyrics_rebuilt.apk

And then I signed with apk-signer-1.4.2.jar like I did with the other versions.

The commands seem to complete without any errors.

However, when launching the rebuilt apk on the phone, it just crashes and shows: "Unfortunately, Minilyrics has stopped"

By checking adb logcat, I found out that the crashed is caused by this exception:

Code:

02-27 08:52:52.156 E/MiniLyrics( 6907): Failed to copy JNI assets
02-27 08:52:52.156 E/MiniLyrics( 6907): Failed to copy JNI assets
02-27 08:52:52.156 E/MiniLyrics( 6907): java.io.FileNotFoundException: jni
02-27 08:52:52.156 E/MiniLyrics( 6907):	at android.content.res.AssetManager.openAsset(Native Method)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at android.content.res.AssetManager.open(AssetManager.java:313)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at android.content.res.AssetManager.open(AssetManager.java:287)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at com.crintsoft.music.LyricsApplication.a(LyricsApplication.java:62)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at com.crintsoft.music.LyricsApplication.onCreate(LyricsApplication.java:36)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1036)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4728)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:334)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at android.app.ActivityThread.handleBindApplication(<Xposed>)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at android.app.ActivityThread.-wrap1(ActivityThread.java)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at android.os.Handler.dispatchMessage(Handler.java:102)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at android.os.Looper.loop(Looper.java:148)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at android.app.ActivityThread.main(ActivityThread.java:5443)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at java.lang.reflect.Method.invoke(Native Method)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-27 08:52:52.156 E/MiniLyrics( 6907):	at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102)
02-27 08:52:52.162 D/AndroidRuntime( 6907): Shutting down VM
02-27 08:52:52.165 E/AndroidRuntime( 6907): FATAL EXCEPTION: main
02-27 08:52:52.165 E/AndroidRuntime( 6907): Process: com.crintsoft.zikiplayer, PID: 6907
02-27 08:52:52.165 E/AndroidRuntime( 6907): java.lang.RuntimeException: Unable to create application com.crintsoft.music.LyricsApplication: java.lang.ClassNotFoundException: Didn't find class "com.crintsoft.music.LyricsOnlineSearch" on path: DexPathList[[zip file "/data/app/com.crintsoft.zikiplayer-1/base.apk"],nativeLibraryDirectories=[/data/app/com.crintsoft.zikiplayer-1/lib/arm, /data/app/com.crintsoft.zikiplayer-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4731)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:334)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at android.app.ActivityThread.handleBindApplication(<Xposed>)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at android.app.ActivityThread.-wrap1(ActivityThread.java)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at android.os.Handler.dispatchMessage(Handler.java:102)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at android.os.Looper.loop(Looper.java:148)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at android.app.ActivityThread.main(ActivityThread.java:5443)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at java.lang.reflect.Method.invoke(Native Method)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102)
02-27 08:52:52.165 E/AndroidRuntime( 6907): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.crintsoft.music.LyricsOnlineSearch" on path: DexPathList[[zip file "/data/app/com.crintsoft.zikiplayer-1/base.apk"],nativeLibraryDirectories=[/data/app/com.crintsoft.zikiplayer-1/lib/arm, /data/app/com.crintsoft.zikiplayer-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at com.crintsoft.music.n.a.b(Native Method)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at com.crintsoft.music.n.b.a(NativeAPIs.java:21)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at com.crintsoft.music.LyricsApplication.onCreate(LyricsApplication.java:42)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1036)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4728)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	... 12 more
02-27 08:52:52.165 E/AndroidRuntime( 6907):	Suppressed: java.lang.ClassNotFoundException: Didn't find class "com.crintsoft.music.LyricsOnlineSearch" on path: DexPathList[[dex file "/data/dalvik-cache/xposed_XResourcesSuperClass.dex"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	... 18 more
02-27 08:52:52.165 E/AndroidRuntime( 6907):	Suppressed: java.lang.ClassNotFoundException: com.crintsoft.music.LyricsOnlineSearch
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at java.lang.Class.classForName(Native Method)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
02-27 08:52:52.165 E/AndroidRuntime( 6907):	... 19 more
02-27 08:52:52.165 E/AndroidRuntime( 6907):	Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
02-27 08:52:52.176 E/DropBoxManagerService( 2198): Can't write: data_app_crash
02-27 08:52:52.176 E/DropBoxManagerService( 2198): java.io.IOException: Can't list files: /data/system/dropbox
02-27 08:52:52.176 E/DropBoxManagerService( 2198):	at com.android.server.DropBoxManagerService.init(DropBoxManagerService.java:605)
02-27 08:52:52.176 E/DropBoxManagerService( 2198):	at com.android.server.DropBoxManagerService.add(DropBoxManagerService.java:186)
02-27 08:52:52.176 E/DropBoxManagerService( 2198):	at android.os.DropBoxManager.addText(DropBoxManager.java:270)
02-27 08:52:52.176 E/DropBoxManagerService( 2198):	at com.android.server.am.ActivityManagerService$19.run(ActivityManagerService.java:12807)
02-27 08:52:52.179 W/ActivityManager( 2198): Force finishing activity com.crintsoft.zikiplayer/com.crintsoft.music.MediaPlaybackActivity

Is this a problem with the rebuild apk, or am I doing something wrong when signing?

I've modded older versions of Minilyrics successfully, but not version 1.0.18.

So there must be a way to do this properly... what am I missing?