In the case of apkbuilder, the APK file is generated. In fact, apkbuilder is a batch file, which can be opened. In fact, it runs sdklib internally. jar contains a class, so we know how to do it. It is very simple. We directly call Java to execute this class, as shown below:
[HTML] view plaincopy view code snippets derived from my code snippets on code
<Java classpath = "$ {Android. Tools}/lib/sdklib. Jar" classname = "com. Android. sdklib. Build. apkbuildermain">
<Arg value = "$ {path. Build. Main}/bin/unsigned.apk"/>
<Arg value = "-U"/>
<Arg value = "-z"/>
<Arg value = "$ {path. Build. Main}/bin/res.zip"/>
<Arg value = "-F"/>
<Arg value = "$ {path. Build. Main}/bin/classes. Dex"/>
<Arg value = "-RF"/>
<Arg value = "$ {path. Build. Main}/src"/>
<Arg value = "-RJ"/>
<Arg value = "$ {path. Build. Main}/Libs"/>
<Arg value = "-NF"/>
<Arg value = "$ {path. Build. Native}"/>
</Java>
In fact, the previous apkbuilder. bat was also executed internally.
[HTML] view plaincopy view code snippets derived from my code snippets on code
The class com. Android. sdklib. Build. apkbuildermain is directly executed here. It is actually the same!
Solution not found by using ant to package apkbuilder