Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加固后部分手机安装apk报错:Failure [-124: Failed parse during installPackageLI: Targeting R+ (version 30 and above) requires the resources.arsc of installed APKs to be stored uncompressed and aligned on a 4-byte boundary] #112

Closed
ffdsss opened this issue May 6, 2024 · 3 comments

Comments

@ffdsss
Copy link

ffdsss commented May 6, 2024

华为手机:Magic 7.1(荣耀Magic5)、Magic 6.0(荣耀Magic V)、HarmonyOS 2.0.1(nova 9 pro)、HarmonyOS 4.0.0(Mate 50 E)、HarmonyOS 3.0.0(nova 9 pro)
小米手机、oppo、vivo都有这个问题。

@maoabc
Copy link
Owner

maoabc commented May 6, 2024

先去了解apk打包,高版本有的地方不能压缩需要特殊对齐等,更何况这错误提示这么明显。如果你给的apk正常,转换程序并不会乱修改原本结构去乱压缩不能压缩的文件。项目里所有apk打包都是使用zipflinger,可以自行查看修改相关代码。

@ffdsss
Copy link
Author

ffdsss commented May 6, 2024

好的

@ffdsss ffdsss closed this as completed May 6, 2024
@maoabc
Copy link
Owner

maoabc commented May 6, 2024

ApkProtect里的zipCopy方法就是复制原apk文件,它没有对原apk里的文件做任何处理,只是单纯复制数据后做4字节对齐,这表示你原apk对.arsc文件做了错误的压缩。如果要在这里做修正可以加判断如果是resource.arsc强行改为不压缩,再做个数据对齐就行。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants