Merge branch 'emulator' into dev_4.4.0

# Conflicts:
#	app/src/main/java/com/gh/common/util/EntranceUtils.java
#	app/src/main/java/com/gh/common/util/LogUtils.java
#	app/src/main/java/com/gh/gamecenter/adapter/viewholder/DetailViewHolder.java
#	app/src/main/java/com/halo/assistant/HaloApp.java
#	app/src/main/res/values/colors.xml
This commit is contained in:
张玉久
2020-10-22 16:12:24 +08:00
88 changed files with 2359 additions and 112 deletions

View File

@ -23,9 +23,6 @@ import android.view.View;
import android.view.Window;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModelProviders;
import com.gh.base.AppUncaughtHandler;
import com.gh.base.BaseActivity;
import com.gh.base.fragment.BaseFragment_ViewPager;
@ -37,6 +34,7 @@ import com.gh.common.constant.Constants;
import com.gh.common.exposure.meta.MetaUtil;
import com.gh.common.loghub.LoghubUtils;
import com.gh.common.repository.ReservationRepository;
import com.gh.common.simulator.SimulatorGameManager;
import com.gh.common.util.ActivationHelper;
import com.gh.common.util.ClassUtils;
import com.gh.common.util.ConcernUtils;
@ -48,6 +46,8 @@ import com.gh.common.util.DialogUtils;
import com.gh.common.util.DirectUtils;
import com.gh.common.util.DisplayUtils;
import com.gh.common.util.EntranceUtils;
import com.gh.common.util.ExtensionsKt;
import com.gh.common.util.GsonUtils;
import com.gh.common.util.HomePluggableHelper;
import com.gh.common.util.LogUtils;
import com.gh.common.util.LunchType;
@ -60,11 +60,13 @@ import com.gh.common.util.PushHelper;
import com.gh.common.util.SPUtils;
import com.gh.common.util.ShareUtils;
import com.gh.common.util.ThirdPartyPackageHelper;
import com.gh.common.util.ToastUtils;
import com.gh.common.util.UrlFilterUtils;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.download.DownloadFragment;
import com.gh.gamecenter.entity.CommunityEntity;
import com.gh.gamecenter.entity.GameDigestEntity;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.entity.InnerMetaInfoEntity;
import com.gh.gamecenter.entity.NotificationUgc;
import com.gh.gamecenter.eventbus.EBNetworkState;
@ -121,6 +123,8 @@ import java.util.TimerTask;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModelProviders;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import okhttp3.MediaType;
@ -128,6 +132,7 @@ import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import static com.gh.common.util.EntranceUtils.ENTRANCE_BROWSER;
import static com.gh.common.util.EntranceUtils.HOST_LAUNCH_SIMULATOR_GAME;
import static com.gh.common.util.EntranceUtils.HOST_QQ;
import static com.gh.common.util.EntranceUtils.HOST_QQ_GROUP;
import static com.gh.common.util.EntranceUtils.HOST_WEB;
@ -271,7 +276,6 @@ public class MainActivity extends BaseActivity {
HomePluggableHelper.activationFilterData();
});
//启动app删除视频缓存文件
AppExecutor.getIoExecutor().execute(() -> {
try {
@ -391,6 +395,20 @@ public class MainActivity extends BaseActivity {
DirectUtils.directToExternalBrowser(this, url);
}
break;
case HOST_LAUNCH_SIMULATOR_GAME:
String json = getIntent().getStringExtra(EntranceUtils.KEY_GAME);
GameEntity gameEntity = GsonUtils.getGson().fromJson(json, new TypeToken<GameEntity>(){}.getType());
DownloadEntity downloadEntity = SimulatorGameManager.findDownloadEntityByUrl(gameEntity.getApk().get(0).getUrl());
if (downloadEntity != null) {
File file = new File(downloadEntity.getPath());
if (!file.exists()) {
ToastUtils.INSTANCE.showToast("文件已被删除,无法启动");
return;
}
SimulatorGameManager.launchSimulatorGame(downloadEntity, gameEntity);
}
break;
}
}
}
@ -435,6 +453,7 @@ public class MainActivity extends BaseActivity {
|| PackageUtils.isSignedByGh(getApplicationContext(), entity.getPackageName()))) {
continue;
}
if (ExtensionsKt.isSimulatorGame(entity)) continue;
if (downloadEntity == null) {
downloadEntity = entity;
} else if (entity.getEnd() > downloadEntity.getEnd()) {