问题描述
在3D方APK文件中我注意到不同架构的文件夹 - ARMv7,ARM64,X86,MIPS - 因此单个APK为多个体系结构工作,由Android支持.
但是,我似乎没有找到与Qt项目一起做的方法.我有一个针对多个体系结构的项目,但我只能一次为架构生成一个APK,仅适用于当前活动的项目套件.是否可以为Qt项目生产这样的Muti-arch APK?
推荐答案
我已经找到了这个问题的工作.当我的QT应用程序必须遵守谷歌的要求提供64个二进制架构的要求时,我遇到了这个问题.虽然这个过程并不完全自动化,但它有效.
1-为不同的架构构建APKS(在我的案例ARMEABI-V7A和ARM64-V8A中)
2-打开用任何压缩/解压缩软件进行编辑的所有APK(我使用Ubuntu提供的默认值.在Windows上,您可以使用winrar)
3-转到"lib"文件夹并复制与架构(ARM64-V8A,ARMEABI-V7A等)命名的文件夹.
4-将步骤#3的所有复制文件夹整合到任何一个APK的Lib文件夹中.现在我们将使用此APK前进
5-转到APK root上名为"Meta-Inf"的文件夹并删除文件* .rsa和* .sf
6-现在关闭apk文件.
7-转到 https://github.com/patrickfav/uber-apk-signer 并下载jar文件.您可以将此工具与ziphign一起使用并再次签署包裹.使用jar如下.
java -jar uber-apk-signer-1.0.0.jar --apks ./android-build-release-signed.apk --ks android_release.keystore --ksalias your_certificate_alias
现在您可以将最后的APK发布到Google Play.干杯!
问题描述
In 3d party APK files I notice there are folders for different architectures - armv7, arm64, x86, mips - so a single APK works for multiple architectures, supported by Android.
However, I don't seem to find a way to do that with Qt projects. I have a project that targets multiple architectures, but I can only produce an APK for an architecture at a time, only for the currently active project kit.
Is it possible to produce such a muti-arch APK for a Qt projects?
推荐答案
I have found a work-around for this problem. I came across this problem when my Qt application had to comply to Google's requirement of providing 64 binaries for 64 bit architecture. Although this process is not totally automated but it works.
1- Build your APKs for different architectures(in my case armeabi-v7a and arm64-v8a)
2- Open all APKs for editing with any compression/decompression software(I used the default provided by Ubuntu. On windows you can use WinRaR)
3- Go to "lib" folder and copy the folder named with the architecture (arm64-v8a, armeabi-v7a, etc.)
4- Consolidate all the copied folders from step#3 into the lib folder of any one APK. Now we will use this APK to move forward
5- Go to the folder named "META-INF" on APK root and delete files *.RSA and *.SF
6- Now close the APK file.
7- Go to https://github.com/patrickfav/uber-apk-signer and download the Jar file. You can use this tool to zipalign and sign your package again. Use the jar as follows.
java -jar uber-apk-signer-1.0.0.jar --apks ./android-build-release-signed.apk --ks android_release.keystore --ksAlias your_certificate_alias
Now you can publish the final APK to Google Play. Cheers!