# AndroidTool **Repository Path**: yemesoft/AndroidTool ## Basic Information - **Project Name**: AndroidTool - **Description**: 安卓,快速,多渠道打包,代码零侵入 - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-05-15 - **Last Updated**: 2024-05-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 由于360多渠道打包工具开始收费了,所以做了个小工具免费给大家使用。 比360打包更快,零代码侵入。 欢迎加入QQ交流群:601971480 渠道配置文件和360渠道配置文件一样。 渠道名获取方法: ``` public class ChannelUtil { private static final String CHANNEL_FILE_PREFIX = "_app_channel_"; public static String getChannelName(Context context) { String channelName = null; try { String zipPath = context.getPackageResourcePath(); ZipFile zipFile = new ZipFile(zipPath); Enumeration entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); if (entry.getName().startsWith(CHANNEL_FILE_PREFIX)) { channelName = entry.getName().substring(CHANNEL_FILE_PREFIX.length()); break; } } } catch (IOException e) { e.printStackTrace(); } if (null == channelName) { try { //兼容友盟 ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA); channelName = applicationInfo.metaData.getString("UMENG_CHANNEL"); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } } System.err.println("channelName=" + channelName); if (null == channelName) { channelName = "normal"; } return channelName; } } ```