将 APK 与动态应用程序属性文件捆绑在一起?
是否可以捆绑或生成带有某种动态文件的 APK,您可以在其中设置不同的应用程序属性,例如背景颜色等?
谢谢!
Is it possible to bundle or generate an APK with some sort of dynamic file where you can set different application properties, such as background colors, etc?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个高级答案,但假设他们从网络服务器下载 apk 文件,则没有什么可以阻止您生成某种配置文件,将其放入 res 并从您的应用程序访问它。 apk 文件只是一个带有一些额外修饰的“zip”文件。将classes.dex 文件与其他必需文件一起放在服务器上,并使用某种zip 库在该文件上创建一个apk 文件并不困难。现在,我根本不熟悉如何从 res 文件夹中访问任意文件(例如 xml 文件或 .properties 文件),但是稍微用 google 搜索应该可以给您答案。
This is a high level answer, but assuming they are downloading the apk file from a webserver, there's nothing stopping you from generating some sort of configuration file, dropping it in res and accessing it from your application. An apk file is simply a "zip" file with some extra trimmings. It would not be difficult to have your classes.dex file along with the other requisite files on the server, and create an apk file on the file using some sort of zip library. Now, I'm not familiar off the top of my head how you could access an arbitrary file (such as an xml file or .properties file) out of the res folder, but a little bit of googleing should give you that answer.