Change .apk asset file from outside

让人想犯罪 __ 提交于 2019-12-24 16:28:39

问题


I have apk file that will be distributed between a lot of users. The file is same for all but I need to specify ID for each one that will be used in code (ideally it should be done automatically by php script). For now I tried to put ID to text file in Assets and then open apk as archive in Windows, update value in text file then save (update archive). As result my application cannot be installed anymore. Why it doesn't work? Or may be there another way to set ID for each apk without recreating package in development environment?


回答1:


There is no way to do that, you must compile and sign your app on every change.

Android do a hash for your apk, if you change a bit the content, this hash do not coincide and will not be a valid apk (not able to install).

You can do somewhat script to automatize the change of a file and compile/sign after your apk.



来源:https://stackoverflow.com/questions/18918154/change-apk-asset-file-from-outside

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!