Avoid XML convertion in .apk to .apk.zip in android
I create an application in android. I know .apk can convert into .开发者_StackOverflowzip and my layout and xml files are extracted. Is there any way to avoid the decoding of xml? How can i encode the apk so it cannot converted? thanks
An .APK file is simply a .ZIP file with a predefined directory/file layout, there is no "conversion" (unless you're simply talking about changing the extension).
ProGuard can be used to obfuscate code, but there's no "standard" way of encoding/encrypting the XML files. You could encrypt/decrypt them manually yourself, but you'd be introducing a great amount of overhead at runtime for decryption, and many standard interfaces would not work because they expect the standard plan-text XML format. You're looking at a great deal of code to accomplish what you're asking. This is all assuming you're loking to encrypt your strings.xml, etc.
If you're looking to encrypt custom XML data files, there's a thread with some good suggestions here.
精彩评论