I want to set up a custom build process for our android game. In short our build process works like that: In first stage we build game code into binary blob and in second stage our tool packs code binary blob and assets and make a final package. This works for consoles and PC and we want the same also for android.
Till now I tried to make a apk with android studio, disassemble it with apktool, add assets, pack it again with same tool, realign it with zipalign and sign it with apksigner. I had to manually enter asset files into apktool.yml file to include it into packaging process.
This process produced apk that was almost 20% bigger compared to apk built with assets that were added via gradle. I assume that some files were differently compressed. And the most important part game crashed at statup.
What is the best way to achieve build process described above? First to compile game code to binary blob and assemble code and assets to apk in later stage? Or to add assets to existing apk as I tried before?