|
|
@@ -5,7 +5,6 @@ import android.content.SharedPreferences;
|
|
|
import android.content.pm.ApplicationInfo;
|
|
|
import android.content.pm.PackageInfo;
|
|
|
import android.text.TextUtils;
|
|
|
-import android.util.Log;
|
|
|
import android.view.TextureView;
|
|
|
|
|
|
import com.kfzs.duanduan.utils.ApkUtils;
|
|
|
@@ -62,14 +61,14 @@ public class ChannelContent {
|
|
|
|
|
|
public boolean initChannelContent(Context context) {
|
|
|
channel_name = getChannelName(context);
|
|
|
- if (TextUtils.isEmpty(channel_name)) {
|
|
|
+ if(TextUtils.isEmpty(channel_name)){
|
|
|
return loadContentFromApk(context);
|
|
|
- } else {
|
|
|
+ }else {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private boolean loadContentFromApk(Context context) {
|
|
|
+ private boolean loadContentFromApk(Context context){
|
|
|
hasChannelFile = false;
|
|
|
ApplicationInfo appInfo = context.getApplicationInfo();
|
|
|
String sourceDir = appInfo.sourceDir;
|
|
|
@@ -117,7 +116,6 @@ public class ChannelContent {
|
|
|
PackageInfo packageInfo = ApkUtils.getPackageInfo(SheepApp.getInstance().getPackageName());
|
|
|
if (packageInfo != null && !TextUtils.isEmpty(packageInfo.applicationInfo.sourceDir)) {
|
|
|
String comment = ZipChannelUtil.readQUA(new File(packageInfo.applicationInfo.sourceDir));
|
|
|
- Log.e("ChannelContent", "ReadComment: "+comment);
|
|
|
if (!TextUtils.isEmpty(comment)) {
|
|
|
hasChannelFile = true;
|
|
|
if (comment.contains(";")) {
|
|
|
@@ -150,9 +148,7 @@ public class ChannelContent {
|
|
|
|
|
|
private String getChannelName(Context context) {
|
|
|
SharedPreferences sp = context.getSharedPreferences("channel_content", Context.MODE_PRIVATE);
|
|
|
- String tmp = sp.getString("channel_name", "");
|
|
|
- Log.e("ChannelContent", "invitation_code : " + channel_name);
|
|
|
- return tmp;
|
|
|
+ return sp.getString("channel_name", "");
|
|
|
}
|
|
|
|
|
|
public Map<String, String> getChanelInfo(String... key) {
|