1

I tried to find this type of question, and nothing sorted out. I would like to do some research on an app for a customer.

So I explain the issue :

So I would like to extract the app (using adb seems the better way), use apktool to add some line in the AndroidManifest, and repack (and signing) it. After doing this I see the app is crashing after doing some manipulation on it. So as a control point, to be sure than my manipulation didn't break it, I tried to just extract the apk using adb, and resintalling it (from device and with adb) without doing any modification, and I saw the problem was the same, so my modification wasn't the problem.

I did it by locating it and extracting using :

adb shell pm list packages

Find the APK path

adb shell pm path com.my.app

Result :

package:/data/app/~~GdvAunQQGjig1h76mYro8w==/com.my.app-4jvBJLX-LuaGmXzifBYbgg==/base.apk
package:/data/app/~~GdvAunQQGjig1h76mYro8w==/com.my.app-4jvBJLX-LuaGmXzifBYbgg==/split_config.arm64_v8a.apk
package:/data/app/~~GdvAunQQGjig1h76mYro8w==/com.my.app-4jvBJLX-LuaGmXzifBYbgg==/split_config.fr.apk
package:/data/app/~~GdvAunQQGjig1h76mYro8w==/com.my.app-4jvBJLX-LuaGmXzifBYbgg==/split_config.xxhdpi.apk
adb pull /data/app/~~GdvAunQQGjig1h76mYro8w==/com.my.app-4jvBJLX-LuaGmXzifBYbgg==/base.apk C:\mypathout\base.apk

Reinstall by using this command :

adb install C:\mypathout\base.apk

And this result was Succes

Did this method is knowing to doing this type of issue.

I found this links : Android app crashed after installing via adb about a similar question but the he provided less details.

Thanks you for you help :)

EDIT : Logs of the crash has be retrieved and are here https://pastebin.com/peJTGb9N

StarkBin
  • 13
  • 3

1 Answers1

0

The resulting files clearly show that the app was initially installed as android app bundle or split apk and the installation is split to several files. This error from the logcat: Caused by: java.lang.NoClassDefFoundError: com.my.app.utilsjni.NativeUtils Means that the app cannot find it's native part written in C++ and compiled as .so. It is probably here: split_config.arm64_v8a.apk I recommend to look for some tool that allows to either merge those .apk files or to install all of them together.

base.apk  -                main code part
split_config.arm64_v8a.apk main native code part, specific for arm64v8 cpus
split_config.fr.apk        texts for french translation
split_config.xxhdpi.apk    graphic resources for hi res screens 
Pavel B.
  • 805
  • 10
  • 13
  • 1
    Hello, thanks for you answer. I'm pretty new to this world, and just managed to find the problem. To install and reinstall the app, I had to extract all the "App Bundle" and reinstall it by using `adb install-multiple base.apk split_config.arm64_v8a.apk split_config.fr.apk split_config.xxhdpi.apk`. Now I will see if I have to re-sign all the apk if I unpack and sign the first with my key. If you have the answer for this, I will be glad :) – StarkBin Mar 09 '23 at 14:26
  • There is a complete guide here https://stackoverflow.com/questions/10930331/how-to-sign-an-already-compiled-apk Note, that the signature will be different from the original. – Pavel B. Mar 09 '23 at 14:41