Merge branch 'feature-sdk-free' into dev
# Conflicts: # app/src/main/java/com/gh/common/LocalBroadcastReceiver.kt # app/src/main/java/com/gh/common/im/ImManager.kt # app/src/main/java/com/gh/common/im/ImReceiver.kt # app/src/main/java/com/gh/gamecenter/gamedetail/desc/GameDetailCustomColumnAdapter.kt # app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingCommentItemViewHolder.kt # app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt # app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundViewModel.kt # app/src/main/java/com/gh/gamecenter/user/UserRepository.java # app/src/main/java/com/halo/assistant/HaloApp.java # dependencies.gradle
This commit is contained in:
@ -2,7 +2,6 @@ package com.gh.gamecenter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@ -18,10 +17,6 @@ import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.gh.base.AppUncaughtHandler;
|
||||
import com.gh.base.BaseActivity;
|
||||
@ -56,7 +51,6 @@ import com.gh.common.util.NotificationHelper;
|
||||
import com.gh.common.util.PackageInstaller;
|
||||
import com.gh.common.util.PackageUtils;
|
||||
import com.gh.common.util.PlatformUtils;
|
||||
import com.gh.common.util.PushHelper;
|
||||
import com.gh.common.util.SPUtils;
|
||||
import com.gh.common.util.ShareUtils;
|
||||
import com.gh.common.util.ThirdPartyPackageHelper;
|
||||
@ -87,18 +81,13 @@ import com.gh.gamecenter.retrofit.RetrofitManager;
|
||||
import com.gh.gamecenter.suggest.SuggestSelectFragment;
|
||||
import com.gh.gamecenter.suggest.SuggestType;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.halo.assistant.HaloApp;
|
||||
import com.halo.assistant.fragment.SettingsFragment;
|
||||
import com.lightgame.config.CommonDebug;
|
||||
import com.lightgame.download.DownloadEntity;
|
||||
import com.lightgame.download.DownloadStatus;
|
||||
import com.lightgame.download.FileUtils;
|
||||
import com.lightgame.utils.AppManager;
|
||||
import com.lightgame.utils.Utils;
|
||||
import com.tencent.bugly.beta.tinker.TinkerManager;
|
||||
import com.tencent.bugly.crashreport.CrashReport;
|
||||
import com.umeng.message.PushAgent;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@ -111,13 +100,10 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.zip.ZipEntry;
|
||||
@ -257,9 +243,9 @@ public class MainActivity extends BaseActivity {
|
||||
}, 500);
|
||||
}
|
||||
|
||||
handler.postDelayed(() -> {
|
||||
PushHelper.postPushClickAction(this.getApplicationContext(), null);
|
||||
}, 2000);
|
||||
// handler.postDelayed(() -> {
|
||||
// PushHelper.postPushClickAction(this.getApplicationContext(), null);
|
||||
// }, 2000);
|
||||
|
||||
|
||||
// 耗时操作
|
||||
@ -272,8 +258,8 @@ public class MainActivity extends BaseActivity {
|
||||
UpdateManager.getInstance(this).checkUpdate(true, null);
|
||||
// 初始化PlatformUtils
|
||||
PlatformUtils.getInstance(getApplicationContext());
|
||||
// 友盟记录启动
|
||||
PushAgent.getInstance(this).onAppStart();
|
||||
// // 友盟记录启动
|
||||
// PushAgent.getInstance(this).onAppStart();
|
||||
|
||||
HomePluggableHelper.activationFilterData();
|
||||
});
|
||||
@ -547,67 +533,67 @@ public class MainActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void checkTinkerPath() {
|
||||
CommonDebug.logMethodWithParams(this, TinkerManager.getTinkerId(), TinkerManager.getNewTinkerId());
|
||||
CommonDebug.logMethodWithParams(this, CrashReport.getAppVer(), CrashReport.getAppID(), CrashReport.getAppChannel(), CrashReport.getSdkExtraData());
|
||||
|
||||
// 1.(母包)首次启动,tinkerId不为空,newTinkerId(patchTinkerId)应该是空的
|
||||
// 2. 补丁包启动,tinkerId和之前一致,但newTinkerId不一致
|
||||
// 2.1 显示更新信息弹窗,记录tinkerId+newTinkerId
|
||||
// 2.1.1 若tinkerId一致,但newTinkerId不一致才能认为是一次补丁更新
|
||||
|
||||
String tinkerId = TinkerManager.getTinkerId();
|
||||
String newTinkerId = TinkerManager.getNewTinkerId();
|
||||
|
||||
if (TextUtils.isEmpty(newTinkerId)) {
|
||||
//这是一个新的母包,没有任何补丁信息
|
||||
return;
|
||||
}
|
||||
|
||||
final Gson gson = new Gson();
|
||||
|
||||
Type type = new TypeToken<HashMap<String, Set<String>>>() {
|
||||
}.getType();
|
||||
|
||||
final Map<String, Set<String>> tinkerIdMap;
|
||||
final String tinkerMapJson = mSp.getString(Config.PATCHES, "");
|
||||
if (!TextUtils.isEmpty(tinkerMapJson)) {
|
||||
tinkerIdMap = gson.fromJson(tinkerMapJson, type);
|
||||
} else {
|
||||
tinkerIdMap = new HashMap<>();
|
||||
}
|
||||
|
||||
Set<String> tinkerIdSet = tinkerIdMap.get(tinkerId);
|
||||
if (tinkerIdSet == null) {
|
||||
tinkerIdSet = new HashSet<>();
|
||||
tinkerIdMap.put(tinkerId, tinkerIdSet);
|
||||
}
|
||||
|
||||
// 有新的补丁,没有显示过
|
||||
if (!tinkerIdSet.contains(newTinkerId)) {
|
||||
tinkerIdSet.add(newTinkerId);
|
||||
|
||||
final Dialog dialog = new Dialog(this, R.style.GhAlertDialog);
|
||||
|
||||
View contentView = LayoutInflater.from(this).inflate(R.layout.dialog_alert, null);
|
||||
TextView contentTv = contentView.findViewById(R.id.dialog_content);
|
||||
TextView titleTv = contentView.findViewById(R.id.dialog_title);
|
||||
TextView negativeTv = contentView.findViewById(R.id.dialog_negative);
|
||||
TextView positiveTv = contentView.findViewById(R.id.dialog_positive);
|
||||
|
||||
titleTv.setText("补丁更新成功");
|
||||
contentTv.setText(("光环助手已成功更新到V" + PackageUtils.getVersionName() + "-" + newTinkerId));
|
||||
positiveTv.setText("知道了");
|
||||
negativeTv.setText(null);
|
||||
|
||||
negativeTv.setOnClickListener(view -> dialog.dismiss());
|
||||
|
||||
positiveTv.setOnClickListener(view -> dialog.dismiss());
|
||||
dialog.setOnDismissListener(dialog1 -> mSp.edit().putString(Config.PATCHES, gson.toJson(tinkerIdMap)).apply());
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(contentView);
|
||||
dialog.show();
|
||||
}
|
||||
// CommonDebug.logMethodWithParams(this, TinkerManager.getTinkerId(), TinkerManager.getNewTinkerId());
|
||||
// CommonDebug.logMethodWithParams(this, CrashReport.getAppVer(), CrashReport.getAppID(), CrashReport.getAppChannel(), CrashReport.getSdkExtraData());
|
||||
//
|
||||
// // 1.(母包)首次启动,tinkerId不为空,newTinkerId(patchTinkerId)应该是空的
|
||||
// // 2. 补丁包启动,tinkerId和之前一致,但newTinkerId不一致
|
||||
// // 2.1 显示更新信息弹窗,记录tinkerId+newTinkerId
|
||||
// // 2.1.1 若tinkerId一致,但newTinkerId不一致才能认为是一次补丁更新
|
||||
//
|
||||
// String tinkerId = TinkerManager.getTinkerId();
|
||||
// String newTinkerId = TinkerManager.getNewTinkerId();
|
||||
//
|
||||
// if (TextUtils.isEmpty(newTinkerId)) {
|
||||
// //这是一个新的母包,没有任何补丁信息
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// final Gson gson = new Gson();
|
||||
//
|
||||
// Type type = new TypeToken<HashMap<String, Set<String>>>() {
|
||||
// }.getType();
|
||||
//
|
||||
// final Map<String, Set<String>> tinkerIdMap;
|
||||
// final String tinkerMapJson = mSp.getString(Config.PATCHES, "");
|
||||
// if (!TextUtils.isEmpty(tinkerMapJson)) {
|
||||
// tinkerIdMap = gson.fromJson(tinkerMapJson, type);
|
||||
// } else {
|
||||
// tinkerIdMap = new HashMap<>();
|
||||
// }
|
||||
//
|
||||
// Set<String> tinkerIdSet = tinkerIdMap.get(tinkerId);
|
||||
// if (tinkerIdSet == null) {
|
||||
// tinkerIdSet = new HashSet<>();
|
||||
// tinkerIdMap.put(tinkerId, tinkerIdSet);
|
||||
// }
|
||||
//
|
||||
// // 有新的补丁,没有显示过
|
||||
// if (!tinkerIdSet.contains(newTinkerId)) {
|
||||
// tinkerIdSet.add(newTinkerId);
|
||||
//
|
||||
// final Dialog dialog = new Dialog(this, R.style.GhAlertDialog);
|
||||
//
|
||||
// View contentView = LayoutInflater.from(this).inflate(R.layout.dialog_alert, null);
|
||||
// TextView contentTv = contentView.findViewById(R.id.dialog_content);
|
||||
// TextView titleTv = contentView.findViewById(R.id.dialog_title);
|
||||
// TextView negativeTv = contentView.findViewById(R.id.dialog_negative);
|
||||
// TextView positiveTv = contentView.findViewById(R.id.dialog_positive);
|
||||
//
|
||||
// titleTv.setText("补丁更新成功");
|
||||
// contentTv.setText(("光环助手已成功更新到V" + PackageUtils.getVersionName() + "-" + newTinkerId));
|
||||
// positiveTv.setText("知道了");
|
||||
// negativeTv.setText(null);
|
||||
//
|
||||
// negativeTv.setOnClickListener(view -> dialog.dismiss());
|
||||
//
|
||||
// positiveTv.setOnClickListener(view -> dialog.dismiss());
|
||||
// dialog.setOnDismissListener(dialog1 -> mSp.edit().putString(Config.PATCHES, gson.toJson(tinkerIdMap)).apply());
|
||||
//
|
||||
// dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
// dialog.setContentView(contentView);
|
||||
// dialog.show();
|
||||
// }
|
||||
}
|
||||
|
||||
private void checkDevice() {
|
||||
|
||||
Reference in New Issue
Block a user