|
|
@@ -2,9 +2,14 @@ package com.sheep.gamegroup.util;
|
|
|
|
|
|
import android.content.Context;
|
|
|
import android.content.pm.ApplicationInfo;
|
|
|
+import android.content.pm.PackageInfo;
|
|
|
import android.text.TextUtils;
|
|
|
|
|
|
+import com.kfzs.duanduan.utils.ApkUtils;
|
|
|
+import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
+
|
|
|
import java.io.BufferedReader;
|
|
|
+import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStreamReader;
|
|
|
import java.util.Enumeration;
|
|
|
@@ -93,6 +98,17 @@ public class ChannelContent {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if(!hasChannelFile){//zip方式获取渠道
|
|
|
+ try {
|
|
|
+ PackageInfo packageInfo = ApkUtils.getPackageInfo(SheepApp.getInstance().getPackageName());
|
|
|
+ if(packageInfo != null && !TextUtils.isEmpty(packageInfo.applicationInfo.sourceDir)) {
|
|
|
+ channel_name = ZipChannelUtil.readQUA(new File(packageInfo.applicationInfo.sourceDir));
|
|
|
+ hasChannelFile = !TextUtils.isEmpty(channel_name);
|
|
|
+ }
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
return hasChannelFile;
|
|
|
}
|
|
|
public String getChannel_name() {
|