diff --git a/app/src/main/java/com/gh/common/util/DeviceTokenUtils.kt b/app/src/main/java/com/gh/common/util/DeviceTokenUtils.kt index cd181e700c..63113b78e5 100644 --- a/app/src/main/java/com/gh/common/util/DeviceTokenUtils.kt +++ b/app/src/main/java/com/gh/common/util/DeviceTokenUtils.kt @@ -39,7 +39,7 @@ object DeviceTokenUtils { } @JvmStatic - fun getLaunchType(): LunchType { + fun getLaunchType(readOnly: Boolean = false): LunchType { var lunchType: LunchType? = null val values = PreferenceManager.getDefaultSharedPreferences(HaloApp.getInstance().application).all // 版本更新 @@ -64,7 +64,10 @@ object DeviceTokenUtils { if (deviceId.isNullOrEmpty()) { deviceId = Utils.getTime(HaloApp.getInstance().application).toString() } - setDeviceId(deviceId) + + if (!readOnly) { + setDeviceId(deviceId) + } return lunchType } diff --git a/app/src/main/java/com/gh/gamecenter/MainActivity.java b/app/src/main/java/com/gh/gamecenter/MainActivity.java index 4f903a6ad8..9994d5f6db 100644 --- a/app/src/main/java/com/gh/gamecenter/MainActivity.java +++ b/app/src/main/java/com/gh/gamecenter/MainActivity.java @@ -200,7 +200,7 @@ public class MainActivity extends BaseActivity { isNewFirstLaunch = mSp.getBoolean("isNewFirstLaunchV" + PackageUtils.getGhVersionName(), true); if (isNewFirstLaunch) { - final LunchType lunchType = DeviceTokenUtils.getLaunchType(); + final LunchType lunchType = DeviceTokenUtils.getLaunchType(false); // 延时两秒提交,避免提交时还没获取到 GID/OAID AppExecutor.getUiExecutor().executeWithDelay(() -> { if (!this.isFinishing()) { diff --git a/app/src/main/java/com/gh/gamecenter/SplashScreenActivity.java b/app/src/main/java/com/gh/gamecenter/SplashScreenActivity.java index 0c85846024..fff5077ad0 100644 --- a/app/src/main/java/com/gh/gamecenter/SplashScreenActivity.java +++ b/app/src/main/java/com/gh/gamecenter/SplashScreenActivity.java @@ -295,7 +295,7 @@ public class SplashScreenActivity extends BaseActivity { HaloApp.getInstance().setLocalTemporaryDeviceId(localTemporaryDeviceId); SPUtils.setString(Constants.SP_TEMPORARY_DEVICE_ID, localTemporaryDeviceId); } - map.put("launch_type", DeviceTokenUtils.getLaunchType().name()); + map.put("launch_type", DeviceTokenUtils.getLaunchType(true).name()); } else if (HaloApp.getInstance().isReinstallTheSameVersion) { map.put("launch_type", LunchType.UPDATE.toString()); }