如何比较由谷歌生成的 APK 与 App Bundle。

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

How to compare google-generated apks with appbundle

问题

我在Google Play商店发布了我的第一个Android应用程序。由于Google管理签名密钥,我需要依赖Google来发布我的应用程序并且不修改它。
为了验证我的包,我下载了所有分发的APK文件,提取它们并尝试将它们与我最初上传的AppBundle文件进行比较。
许多文件不同,我不知道为什么。

是否有一种简便的方法来比较这些存档,或者重现Google修改文件的步骤?

编辑:
我更深入地看了一下,基本上这些文件现在位于不同的位置。例如,Play商店将所有属性文件从“base/root”移动到“base”,将“base/dex/classes.dex”移动到“base/classes.dex”,将“base/root/kotlin”移动到“base/kotlin”。
所有的.xml文件都发生了变化(可能是压缩的)。

还要记住提取所有架构和所有分辨率的APK文件,以比较所有文件。

谢谢。

英文:

I published my first android App in the play store. Since google manages the signing keys, I need to rely on google to publish my app and not modify it.
To verify my package, I downloaded all the distributed APKs, extracted them and tried to compare them to my original uploaded appbundle file.
A lot of the files differ and I don't know why.

Is there a way to easily compare these archives or to reproduce the steps google took to modify the files?

Edit:
I had a deeper look and basically the files are now at different places. E.g the playstore moved all property files from base/root to base, the base/dex/classes.dex to base/classes.dex, base/root/kotlin to base/kotlin.
All .xml files changed (probably compressed).

Keep also in mind to extract apks for all architectures and all resolutions to compare all files.

Thank you

答案1

得分: 1

Google Play 使用 bundletool 从应用捆绑包生成 APK 文件。该工具是开源的,您可以在 https://github.com/google/bundletool 查看代码,以了解它的具体操作,或者您可以直接下载该工具并运行它(尽管我预期从 Play 控制台下载的 APK 文件与此相同)。

还应该澄清哪些文件有差异以及您如何测量差异。例如,AAB 和 APK 中的 AndroidManifest.xml 文件格式不同,因此字节和大小显然会有很大差异,但这并不意味着“内容”一定发生了变化。

英文:

Google Play uses bundletool to generate the APKs from the App Bundle. The tool is open-source at https://github.com/google/bundletool so you could check the code to see what is done or you can simply download the tool and run it yourself (although I'd expect the APKs to be the same than the ones you downloaded from the Play Console).

It would be good to clarify also what files differ and how you measured the difference. For example, the AndroidManifest.xml file is not in the same format in the AAB and in the APK, so the bytes and the size would be obviously quite different, but it doesn't mean that the "content" has necessarily changed.

huangapple
  • 本文由 发表于 2023年5月22日 04:01:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76301704.html
匿名

发表评论

匿名网友

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

确定