从现有的.apk Regenrate新的动态的.apk [英] From Existing Apk Regenrate new Dynamic Apk

查看:203
本文介绍了从现有的.apk Regenrate新的动态的.apk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设在现场我有一个APK与网站的在线有JSON数据,现在取决于APK我要重新生成新的JSON数据的新apk文件,
以及需要从清单文件的应用程序图标也动态地改变,并且包名称也改名动态,资源图标应该动态变化,并希望把它放在网站动态。

Suppose on site i have one apk with there online JSON Data of site, now depend on that apk i want to regenerate new apk file with new JSON data, as well as need to application icon from Manifest file also dynamically change, and package name also dynamically rename,Resource icon should dynamic change and want to put it on site dynamically.

如何将其可能的?

thaks提前。

推荐答案

您需要使用蚂蚁/ Maven的或任何构建工具你选择,然后做:

You need to use ant/maven or whatever build tool you chose and then do:

1)首先你的活动创建的软件包,这将是应用程序包的名称,所有其他活动将在不同的包(不是当前的子包)

1)create package for first your activity, It will be application package name, all other activities will be in different package(not the sub package of current one)

2)使用正则表达式的任务(我知道Ant和Maven有这样的)在清单和包的名字在你的第一个活动取代软件包名称
2.1)使用拷贝任务的第一项活动复制到新的包目录

2) use regex task (I do know ant and maven have such) to replace package name in manifest and package name in your first activity 2.1) use copy task to copy first activity into new package directory

3)现在我们需要复制不同的图标的网址和对JSON数据。使用复制任务来复制新
图像当前配置。我建议创建文件夹结构,配置/ {} CONFIG_NAME和/drawable/icon.png配置/ {} CONFIG_NAME /values​​/config.xml(config.xml中是具有某种json_data_url资源的Andr​​oid资源文件)
然后自定义副本任务中,你将有不同的JSON数据和应用程序图标。

3) now we need to copy different icon's and url's for json data. use copy task to copy new image for current config. I suggest create folders structure config/{config_name}/drawable/icon.png and config/{config_name}/values/config.xml (config.xml is android resource file with some kind of json_data_url resource) then for custom copy task you will have different json data and application icon.

4)创建开关的配置任务,这将调用第二和第三个做你想做的与应用

4) create switch config task, which will call 2nd and 3rd to do what you want with application

这篇关于从现有的.apk Regenrate新的动态的.apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆