Apk 批量快速打包工具:BatchPackApk
BatchPackApk是一個快速的Android apk 批量打包工具。
1.Don't need keystrore.
2.Only provide a signed apk.
3.It can pack a large number apks in one second.
4.The signature of generated apk is the same as the signature of you provided APK.
Usage:
1.You don't need to write channel value in AndroidManifest.xml,so if you want get the channel value in your app,please use following code.
For example,you use Umeng to analyse channel:
Umeng.setChannel(attainChannelFromMETAINF(context))
private static String attainChannelFromMETAINF(Context context) {
String result = "";
ZipFile zipfile = null;
try {
zipfile = new ZipFile(context.getApplicationInfo().sourceDir);
Enumeration<?> entries = zipfile.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = ((ZipEntry) entries.nextElement());
if (entry.getName().startsWith("META-INF/channel")) {
result = entry.getName();
break;
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (zipfile != null) {
try {
zipfile.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
String[] split = result.split("-");
if (split.length >= 3) {
result = result.substring(split[0].length() + split[1].length() + 2);
return result;
} else {
result = "Develop";
}
return result;
}2.package
example:
java -jar batchpackapk.jar example.apk ./ -c channel1,channel2
introduction:
java -jar batchpackapk.jar apk_path output_path [options]
Options:
-help, --help
Default: false
-c
channel list string, Example:channel1,channel2
Default: []
-cf
channel list file path,file content format:one line,one channel string
-debug, -verbose
Debug mode
Default: false 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!