|
@@ -1,5 +1,6 @@
|
|
package com.zedu.cocos.congming.page.launcher;
|
|
package com.zedu.cocos.congming.page.launcher;
|
|
|
|
|
|
|
|
+import android.annotation.SuppressLint;
|
|
import android.app.Dialog;
|
|
import android.app.Dialog;
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
import android.content.pm.ActivityInfo;
|
|
import android.content.pm.ActivityInfo;
|
|
@@ -81,7 +82,6 @@ public class LauncherActivity extends BaseFragmentActivity {
|
|
@Bean(OrganClientZedu.class)
|
|
@Bean(OrganClientZedu.class)
|
|
OrganClient mOrganClient;
|
|
OrganClient mOrganClient;
|
|
public static String deviceId;
|
|
public static String deviceId;
|
|
- public static boolean nextStartExit = true;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
@@ -108,6 +108,7 @@ public class LauncherActivity extends BaseFragmentActivity {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @SuppressLint("WrongConstant")
|
|
@UiThread
|
|
@UiThread
|
|
public void initPermission() {
|
|
public void initPermission() {
|
|
AndPermission.with(this)
|
|
AndPermission.with(this)
|
|
@@ -166,8 +167,10 @@ public class LauncherActivity extends BaseFragmentActivity {
|
|
if (!activates.isEmpty()) {
|
|
if (!activates.isEmpty()) {
|
|
DeviceEntity.DeviceActivateEntity activate = activates.get(0);
|
|
DeviceEntity.DeviceActivateEntity activate = activates.get(0);
|
|
if (activate.status == 0 || activate.status == 2 || activate.status == 3 || activate.isExpireTime()) {
|
|
if (activate.status == 0 || activate.status == 2 || activate.status == 3 || activate.isExpireTime()) {
|
|
|
|
+
|
|
ActivateActivity_.intent(this).packageName(item.packageName).start();
|
|
ActivateActivity_.intent(this).packageName(item.packageName).start();
|
|
showToast(String.format("%s%s", item.appName, activate.getStateFormat()));
|
|
showToast(String.format("%s%s", item.appName, activate.getStateFormat()));
|
|
|
|
+
|
|
} else if (activate.status == 1) {
|
|
} else if (activate.status == 1) {
|
|
if (activate.isIssueTime()) {
|
|
if (activate.isIssueTime()) {
|
|
showToast(String.format("%s生效时间%s", item.appName, activate.getIssuedTime()));
|
|
showToast(String.format("%s生效时间%s", item.appName, activate.getIssuedTime()));
|
|
@@ -175,11 +178,15 @@ public class LauncherActivity extends BaseFragmentActivity {
|
|
}
|
|
}
|
|
|
|
|
|
//判断是否开始验证欠费情况
|
|
//判断是否开始验证欠费情况
|
|
- if (isStartCheckIsArrears(activate.issued) && mOrganPrefs.checkArrearsSuccess().get() == 0) {
|
|
|
|
|
|
+ if (isFullMoon(activate.issued) && mOrganPrefs.checkArrearsSuccess().get() == 0) {
|
|
showToast("StartCheckArrears !");
|
|
showToast("StartCheckArrears !");
|
|
mOrganClient.arrearsStatus(mOrganPrefs.organKey().get());
|
|
mOrganClient.arrearsStatus(mOrganPrefs.organKey().get());
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ //未满月 且验证过欠费的设备 重置验证欠费状态
|
|
|
|
+ if(!isFullMoon(activate.issued) && mOrganPrefs.checkArrearsSuccess().get() != 0){
|
|
|
|
+ mOrganPrefs.checkArrearsSuccess().put(0);
|
|
|
|
+ }
|
|
// 进入游戏页
|
|
// 进入游戏页
|
|
SDKUtils.AppKey= mOrganPrefs.organKey().get();;
|
|
SDKUtils.AppKey= mOrganPrefs.organKey().get();;
|
|
startAppActivity();
|
|
startAppActivity();
|
|
@@ -211,12 +218,11 @@ public class LauncherActivity extends BaseFragmentActivity {
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 判断是否开始验证 是否欠费
|
|
|
|
- *
|
|
|
|
|
|
+ * 判断是否满月了
|
|
* @param issuedDate
|
|
* @param issuedDate
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- private static boolean isStartCheckIsArrears(Date issuedDate) {
|
|
|
|
|
|
+ private static boolean isFullMoon(Date issuedDate) {
|
|
//激活时间是否满了一个月,满了一个月则要进行是否欠费的验证
|
|
//激活时间是否满了一个月,满了一个月则要进行是否欠费的验证
|
|
Calendar ct = Calendar.getInstance();
|
|
Calendar ct = Calendar.getInstance();
|
|
ct.setTime(issuedDate);
|
|
ct.setTime(issuedDate);
|