java在线打包APK包分享

      渠道分发之类的可以用此方法,附件是jar包!      
	
       public static void main(String[] args) {
		PackApkApi pack = new PackApkApi();
		//apktool.jar文件路径
		pack.setApktool("d:\\APK\\tools\\apktool2.1.0.jar");
		//签名文件路径
		pack.setKeyFile("D:/APK/keyStory/password.keystore");
		//签名密码
		pack.setKeyPasswd("password123");
		//打完包APK输出目录
		pack.setOutputPath("D:/appserver/apk/share/");
		//临时工作目录
		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/皇室战争_20160331.apk"));
	}

 打包成功可见AndroidManifest.xml资源文件

<meta-data android:name="PACK_ID" android:value="123456"/>

猜你喜欢

转载自wgxwyyanm.iteye.com/blog/2338342