How to change data in assets folder in existing apk software?

I want to replace one file in assets folder with generated apk (there is sample.txt file in assets folder after apk generation, I want to change data in this file and regenerate new apk).

===> old APK + modified (sample.txt) = newApk

How to do it?

+3


source to share


2 answers


The APK file is a ZIP archive and the assets are not modified as part of the build process. So, on your development machine, you can:



  • unZIP APK file
  • replace your assets
  • Enter the result back into the APK file
  • use to sign an APK with your datastore jarsigner

  • use to flatten results on four-byte boundaries for faster loading at runtime zipalign

+7


source


This is not possible except for deploying the updated APK. APKs are digitally signed and cannot be changed at runtime



0


source







All Articles