Android 重构:提取和保护 APK 资源(技术问题)
我对 APK 文件的技术细节感兴趣。我已经知道 APKTOOL 能够提取 APK 文件的所有布局文件等(包括 smali 源),但我想知道 APKTOOL 如何提取布局,因为它们以某种方式加密(如果您通过解压缩打开它)。
有谁知道Android如何压缩/加密(?)APK文件中的那些布局文件?那里有什么描述吗?
有人知道如何保护布局免遭重新设计吗? (类似于源代码中使用的 ProGuard)?
I'm interested in the technical details of APK files. I know already that the APKTOOL is able to extract all those layout files and so on of an APK file (including the smali sources), but I would like to khow, how the APKTOOL does the extraction of layouts, since they are crypted somehow (in case that you open it with unzip).
Does anybody know something about how Android compresses/encrypts(?) those layout files in the APK files? Is there any description out there?
Does anybody know a way to protect layouts against reengineering? (similar to ProGuard used for the source code)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,APK中的所有xml文件都以二进制XML格式存储。所以它们没有加密,读取它们也不是什么大问题。
至于保护,我认为没有办法以某种方式混淆它们。使布局难以阅读的唯一方法是直接从代码创建视图,但我认为您不应该这样做。
As far as I know, all xml files in APKs are stored in Binary XML format. So they aren't encrypted and that's not a big deal to read them.
What about protection, I don't think there's a way to obfuscate them somehow. The only way to make layouts difficult for reading is to create view directly from code, but I don't think you should do it.