Android应用程序在通过adb提取并重新安装后崩溃。

huangapple go评论83阅读模式
英文:

Android app crash after extracting and reinstalling through adb

问题

我尝试找到这种类型的问题,但没有解决。

我想为客户研究一个应用程序。

所以我解释一下问题:

我想提取应用程序(使用adb似乎是更好的方法),使用apktool在AndroidManifest中添加一些行,并重新打包(并签名)它。在这样做之后,我看到在对其进行一些操作后应用程序崩溃了。因此,作为一个控制点,为了确保我的操作没有破坏它,我尝试只是使用adb提取apk,并重新安装它(从设备和使用adb),而不进行任何修改,我看到问题仍然存在,所以我的修改不是问题。

我通过定位并提取执行:

adb shell pm list packages

找到APK路径

adb shell pm path com.my.app

结果:

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

使用以下命令重新安装:

adb install C:\mypathout\base.apk

而且,这个结果是“成功”。

这种方法是否适用于解决这种问题?

我找到了这些链接:https://stackoverflow.com/questions/70252428/android-app-crashed-after-installing-via-adb 关于一个类似的问题,但他提供的细节较少。

感谢你的帮助 Android应用程序在通过adb提取并重新安装后崩溃。

编辑:崩溃的日志已经被检索到,这里是 https://pastebin.com/peJTGb9N

英文:

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 : https://stackoverflow.com/questions/70252428/android-app-crashed-after-installing-via-adb about a similar question but the he provided less details.

Thanks you for you help Android应用程序在通过adb提取并重新安装后崩溃。

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

答案1

得分: 0

生成的文件清楚地显示该应用最初安装为Android应用捆绑包或拆分APK,并且安装被拆分为多个文件。
这是logcat中的错误:
Caused by: java.lang.NoClassDefFoundError: com.my.app.utilsjni.NativeUtils
这意味着应用无法找到其用C++编写并编译为.so的本机部分。它可能在这里:split_config.arm64_v8a.apk
我建议寻找一些工具,可以合并这些.apk文件或一次性安装所有这些文件。

base.apk  -                主要代码部分
split_config.arm64_v8a.apk 主要本机代码部分,适用于arm64v8处理器
split_config.fr.apk        法语翻译的文本
split_config.xxhdpi.apk    高分辨率屏幕的图形资源
英文:

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 

huangapple
  • 本文由 发表于 2023年3月9日 21:21:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/75685189.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定