Reputation: 1499
Is there a way to programmatically update the resources (more specifically icons and strings) within an APK on the device? I know I can get the APK path from an app's ApplicationInfo object. I also know that APKs are simply zip files and I can use ZipFie (https://developer.android.com/reference/java/util/zip/ZipFile) to read/modify its contents so I feel like this should be possible.
One idea I had on doing this would be to build apktool (https://ibotpeaches.github.io/Apktool/) and include this in my app. I could then decompile the resources, make my modifications, re-compile and use ZipFile to include it. This seems quite heavy though to do on an Android device. Is there any more efficient approaches?
Upvotes: 0
Views: 178
Reputation: 2998
You can use hot fix framework ,like Tencent's Tinker and Alibaba's Sophix(here is a Chinese doc)
Those hot fix framework can update your java code,so file and string drawable resource dynamically.
Upvotes: 1