4

So im making a C# application which I want to be like a small configuration GUI where the user can input his own parameters and select some features, and according to those a xml file will be made and put in a prebuilt ready-to-build android project (in the asset folder). Now i'm struggling with the part where the C# application should compile the project and make a final apk. I tried to use ant but fail hard at understanding how to use it. Any help would be appreciated, but please be detailed im new to this kind of stuff.

4

1 回答 1

3

这是一个相当古老的问题,但我将用我的最终解决方案来回答它。

我通过在我的项目中包含免费的 apktool(和所需的文件),在 C# 中创建了一个构建器,它可以反编译和编译 apk。

所以我所做的是在制作我的应用程序之后,使用 apk 工具对其进行反编译,然后将反编译的项目包含在我的 c# 项目中。用户使用 C# 应用程序生成了一个配置文件,它部署在我的应用程序的 /assets/ 文件夹中,因为我的应用程序希望它在那里。

然后我用 apktool 再次构建它并使用调试密钥库进行签名。(调试密钥库是默认的,如果用户不知道那是什么,可以选择另一个密钥库)

请记住,为此,最终用户必须安装 java SE,我在我的应用程序中将这两个列为“必需”(建议安装后重启 PC):

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html

希望这可以帮助任何人找到这个,相当老的帖子!

于 2014-04-01T15:35:44.480 回答