This method can be used for channel distribution and the like, and the attachment is a jar package! public static void main(String[] args) { PackApkApi pack = new PackApkApi(); //apktool.jar file path pack.setApktool("d:\\APK\\tools\\apktool2.1.0.jar"); //Signature file path pack.setKeyFile("D:/APK/keyStory/password.keystore"); //signature password pack.setKeyPasswd("password123"); //Complete the package APK output directory pack.setOutputPath("D:/appserver/apk/share/"); //temporary working directory pack.setTempPath("D:/appserver/apk/temp/"); HashMap<String, String> map = new HashMap<String, String>(); map.put("PACK_ID", "123456"); pack.setMetas(map); System.out.println(pack.startApk("D:/appserver/apk/Clash Royale_20160331.apk")); }
The packaging is successful and the AndroidManifest.xml resource file can be seen
<meta-data android:name="PACK_ID" android:value="123456"/>