version:2.0.8
bugfixes: update:更滑图标,增加获取系统设置
This commit is contained in:
@@ -7,6 +7,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -18,6 +19,7 @@ import com.tencent.mmkv.MMKV;
|
||||
import com.uiui.zyos.bean.LessonJson;
|
||||
import com.uiui.zyos.config.CommonConfig;
|
||||
import com.uiui.zyos.jxw.JxwPackageConfig;
|
||||
import com.uiui.zyos.manager.RemoteManager;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.math.BigDecimal;
|
||||
@@ -64,12 +66,12 @@ public class OpenApkUtils {
|
||||
if (!ApkUtils.isAvailable(mContext, "com.uiui.zy")) {
|
||||
return true;
|
||||
}
|
||||
int is_activation = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||
if (is_activation != 1) {
|
||||
ApkUtils.openPackage(mContext, "com.uiui.zy", "com.uiui.zy.activity.main.MainActivity");
|
||||
boolean is_activation = RemoteManager.getInstance().getSnIsActivation();
|
||||
if (!is_activation) {
|
||||
OpenApkUtils.getInstance().openZySn();
|
||||
Toaster.show("请激活设备后使用");
|
||||
}
|
||||
return is_activation == 1;
|
||||
return is_activation;
|
||||
}
|
||||
|
||||
public boolean openPackageWithArgs(String packageName, String className, String name, String args) {
|
||||
@@ -607,4 +609,30 @@ public class OpenApkUtils {
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
|
||||
public boolean openZySn() {
|
||||
if (!ApkUtils.isAvailable(mContext, "com.uiui.zy")) {
|
||||
Toaster.show("应用未安装");
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
PackageInfo packageInfo = pm.getPackageInfo("com.uiui.zy", 0);
|
||||
long appVersionCode;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
appVersionCode = packageInfo.getLongVersionCode();
|
||||
} else {
|
||||
appVersionCode = packageInfo.versionCode;
|
||||
}
|
||||
if (appVersionCode <= 95) {
|
||||
openApp("com.uiui.zy", "com.uiui.zy.activity.main.MainActivity");
|
||||
} else {
|
||||
openApp("com.uiui.zy", "com.uiui.zy.activity.splash.SplashActivity");
|
||||
}
|
||||
return true;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
Log.e(TAG, "onCreate: " + e.getMessage());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user