version:6.4.0
fix: update:更换推送
This commit is contained in:
@@ -37,8 +37,6 @@ import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.bean.AppListInfo;
|
||||
import com.aoleyun.sn.bean.Appground;
|
||||
@@ -95,7 +93,6 @@ import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
@@ -118,12 +115,14 @@ public class JGYUtils {
|
||||
public static final int CubePlatform = 2;
|
||||
public static final int ZhanruiPlatform = 3;
|
||||
public static final int MTK11Platform = 5;
|
||||
public static final int TeclastP20sPlatform = 6;
|
||||
|
||||
public static final String Other = "其他";
|
||||
public static final String MTKTag = "MTK";
|
||||
public static final String CubeTag = "展锐cube";
|
||||
public static final String ZhanruiTag = "展锐";
|
||||
public static final String MTK11Tag = "MTK11";
|
||||
public static final String TeclastP20sTag = "P20S";
|
||||
|
||||
private CacheHelper cacheHelper;
|
||||
|
||||
@@ -158,6 +157,7 @@ public class JGYUtils {
|
||||
public static native String getAuthorization();
|
||||
|
||||
public int checkSNPlatform(String sn) {
|
||||
if (TextUtils.isEmpty(sn)) return UnknowPlatform;
|
||||
String secondChars = sn.substring(1, 2);
|
||||
if ("N".equalsIgnoreCase(secondChars)) {//MTK平台
|
||||
return MTKPlatform;
|
||||
@@ -180,9 +180,12 @@ public class JGYUtils {
|
||||
} else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "ZhanRuiCube");
|
||||
return CubePlatform;
|
||||
} else if ("MTK11".equalsIgnoreCase(platform)) {
|
||||
} else if (MTK11Tag.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "MTK11");
|
||||
return MTK11Platform;
|
||||
} else if (TeclastP20sTag.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "P20S");
|
||||
return TeclastP20sPlatform;
|
||||
} else {
|
||||
Log.i(TAG, "checkAppPlatform: " + "没有数据");
|
||||
return UnknowPlatform;
|
||||
@@ -212,6 +215,8 @@ public class JGYUtils {
|
||||
getAppPlatformCallback.AppPlatform(CubePlatform);
|
||||
} else if ("MTK11".equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(MTK11Platform);
|
||||
} else if (TeclastP20sTag.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(TeclastP20sPlatform);
|
||||
} else {
|
||||
getAppPlatformCallback.AppPlatform(UnknowPlatform);
|
||||
}
|
||||
@@ -227,6 +232,8 @@ public class JGYUtils {
|
||||
return CubeTag;
|
||||
} else if ("MTK11".equalsIgnoreCase(platform)) {
|
||||
return MTK11Tag;
|
||||
} else if ("P20S".equalsIgnoreCase(platform)) {
|
||||
return TeclastP20sTag;
|
||||
} else {
|
||||
return Other;
|
||||
}
|
||||
@@ -490,11 +497,11 @@ public class JGYUtils {
|
||||
Log.e(TAG, "checkPackageAndVersion: appVersionCode: " + appVersionCode + " getApp_version_code: " + info.getApp_version_code());
|
||||
Log.e(TAG, "checkPackageAndVersion: " + pkg + " 卸载");
|
||||
ApkUtils.UninstallAPP(mContext, pkg);
|
||||
JSONObject packageObj = new JSONObject();
|
||||
packageObj.put("app_name", info.getApp_name());
|
||||
packageObj.put("app_package", info.getApp_package());
|
||||
packageObj.put("app_id", info.getApp_id());
|
||||
packageObj.put("MD5", info.getApp_md5());
|
||||
JsonObject packageObj = new JsonObject();
|
||||
packageObj.addProperty("app_name", info.getApp_name());
|
||||
packageObj.addProperty("app_package", info.getApp_package());
|
||||
packageObj.addProperty("app_id", info.getApp_id());
|
||||
packageObj.addProperty("MD5", info.getApp_md5());
|
||||
Utils.ariaDownload(mContext, info.getApp_url(), packageObj);
|
||||
} else {
|
||||
Log.e(TAG, "checkPackageAndVersion: " + pkg + " 版本正常");
|
||||
@@ -762,8 +769,11 @@ public class JGYUtils {
|
||||
synchronized public void setNewAppinsideWeb(BaseResponse response) {
|
||||
Log.e(TAG, "setNewAppinsideWeb: " + "应用内部联网管控: " + response);
|
||||
if (response.code == 200) {
|
||||
String jsonString = JSONArray.toJSONString(response.data);
|
||||
List<TTAppground> appgrounds = JSONObject.parseArray(jsonString, TTAppground.class);
|
||||
String jsonString = GsonUtils.toJSONString(response.data);
|
||||
Gson gson = new Gson();
|
||||
Type type = new TypeToken<List<TTAppground>>() {
|
||||
}.getType();
|
||||
List<TTAppground> appgrounds = gson.fromJson(jsonString, type);
|
||||
List<TTAppground> whiteApp = new ArrayList<>();
|
||||
List<TTAppground> blackApp = new ArrayList<>();
|
||||
if (appgrounds != null && appgrounds.size() > 0) {
|
||||
@@ -1070,39 +1080,42 @@ public class JGYUtils {
|
||||
if (TextUtils.isEmpty(data)) {
|
||||
Log.e(TAG, "SettingSysData: " + "data is empty");
|
||||
SysSettingUtils.setDisableSetting(mContext);
|
||||
SPUtils.put(mContext, JGYActions.ACTION_STATUSBAR_STATUS, "");
|
||||
} else {
|
||||
SysSettingUtils.setSystemSetting(mContext, data);
|
||||
}
|
||||
}
|
||||
|
||||
HashSet<String> defaultPackages = new HashSet<String>() {{
|
||||
this.add(BuildConfig.APPLICATION_ID);
|
||||
this.add(PackageNames.OLD_DEVICE_INFO);//设备信息
|
||||
this.add(PackageNames.OLD_APPSTORE);//教管壹
|
||||
this.add(PackageNames.DEVICE_INFO);
|
||||
this.add(PackageNames.APPSTORE);
|
||||
this.add("com.info.sn");
|
||||
this.add("com.uiuios.jgy1");
|
||||
this.add("com.uiuios.jgy2");
|
||||
this.add("com.tt.ttutils");
|
||||
this.add("com.aoleyun.browser");
|
||||
this.add("com.uiui.browser");
|
||||
this.add("com.android.uiuios");
|
||||
this.add("com.aoleyun.os");
|
||||
this.add("com.aoleyunos.dop1");
|
||||
this.add("com.aoleyunos.dop2");
|
||||
this.add("com.aoleyun.info");
|
||||
this.add("com.calculator.uiui");
|
||||
this.add("com.notepad.uiui");
|
||||
this.add("com.calendar.uiui");
|
||||
this.add("com.alarmclock.uiui");
|
||||
this.add("com.uiui.videoplayer");
|
||||
this.add("com.ygyb.yischool");
|
||||
}};
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public void writeAppPackageList(Context context, String packageList) {
|
||||
ApkUtils.addShortcut(context);
|
||||
HashSet<String> packages = new HashSet<String>() {{
|
||||
this.add(BuildConfig.APPLICATION_ID);
|
||||
this.add(PackageNames.OLD_DEVICE_INFO);//设备信息
|
||||
this.add(PackageNames.OLD_APPSTORE);//教管壹
|
||||
this.add(PackageNames.DEVICE_INFO);
|
||||
this.add(PackageNames.APPSTORE);
|
||||
this.add("com.info.sn");
|
||||
this.add("com.uiuios.jgy1");
|
||||
this.add("com.uiuios.jgy2");
|
||||
this.add("com.tt.ttutils");
|
||||
this.add("com.aoleyun.browser");
|
||||
this.add("com.uiui.browser");
|
||||
this.add("com.android.uiuios");
|
||||
this.add("com.aoleyun.os");
|
||||
this.add("com.aoleyunos.dop1");
|
||||
this.add("com.aoleyunos.dop2");
|
||||
this.add("com.aoleyun.info");
|
||||
this.add("com.calculator.uiui");
|
||||
this.add("com.notepad.uiui");
|
||||
this.add("com.calendar.uiui");
|
||||
this.add("com.alarmclock.uiui");
|
||||
this.add("com.uiui.videoplayer");
|
||||
}};
|
||||
HashSet<String> pkgSet = new HashSet<>(Arrays.asList(packageList.split(",")));
|
||||
pkgSet.addAll(packages);
|
||||
pkgSet.addAll(defaultPackages);
|
||||
pkgSet.addAll(ApkUtils.desktopAPP);
|
||||
pkgSet.addAll(ApkUtils.aoleyunAPP);
|
||||
pkgSet.addAll(ApkUtils.aihuaApp);
|
||||
@@ -1113,6 +1126,12 @@ public class JGYUtils {
|
||||
Log.e("writeAppPackageList: ", "aole_app_forbid: " + b + " " + Settings.System.getString(crv, CommonConfig.AOLE_ACTION_APP_FORBID));
|
||||
}
|
||||
|
||||
public void writeAppPackageList() {
|
||||
String aole_app_forbid = String.join(",", defaultPackages);
|
||||
Log.e(TAG, "writeAppPackageList: " + aole_app_forbid);
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid);
|
||||
}
|
||||
|
||||
public void checkForceDownload() {
|
||||
String jsonString = cacheHelper.getAsString(UrlAddress.GET_FORCE_INSTALL_LIST);
|
||||
//为 "" 是已经请求成功的
|
||||
@@ -1142,11 +1161,11 @@ public class JGYUtils {
|
||||
String app_url = forceDownloadData.getApp_url();
|
||||
String app_id = forceDownloadData.getApp_id();
|
||||
String app_md5 = forceDownloadData.getApp_md5();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("app_name", app_name);
|
||||
jsonObject.put("app_package", app_package);
|
||||
jsonObject.put("app_id", app_id);
|
||||
jsonObject.put("MD5", app_md5);
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("app_name", app_name);
|
||||
jsonObject.addProperty("app_package", app_package);
|
||||
jsonObject.addProperty("app_id", app_id);
|
||||
jsonObject.addProperty("MD5", app_md5);
|
||||
long app_version_code = forceDownloadData.getApp_version_code();
|
||||
Log.e("fht ", "packageName=" + app_package + ",URL= " + app_url + ",app_version_code=" + app_version_code);
|
||||
if (BuildConfig.APPLICATION_ID.equals(data.get(i).getApp_package())) {
|
||||
@@ -1191,10 +1210,10 @@ public class JGYUtils {
|
||||
String app_name = jsonObject.get("app_name").getAsString();
|
||||
String app_md5 = jsonObject.get("app_md5").getAsString();
|
||||
// String app_id = jsonObject.get("app_id").getAsString();
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("app_name", app_name);
|
||||
object.put("app_package", packageName);
|
||||
object.put("MD5", app_md5);
|
||||
JsonObject object = new JsonObject();
|
||||
object.addProperty("app_name", app_name);
|
||||
object.addProperty("app_package", packageName);
|
||||
object.addProperty("MD5", app_md5);
|
||||
// object.put("app_id", app_id);
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
PackageInfo packageInfo = null;
|
||||
@@ -1219,9 +1238,9 @@ public class JGYUtils {
|
||||
String packageName = jsonObject.get("app_package").getAsString();
|
||||
String app_name = jsonObject.get("app_name").getAsString();
|
||||
// String app_id = jsonObject.get("app_id").getAsString();
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("app_name", app_name);
|
||||
object.put("app_package", packageName);
|
||||
JsonObject object = new JsonObject();
|
||||
object.addProperty("app_name", app_name);
|
||||
object.addProperty("app_package", packageName);
|
||||
// object.put("app_id", app_id);
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
PackageInfo packageInfo = null;
|
||||
@@ -1251,10 +1270,10 @@ public class JGYUtils {
|
||||
String app_name = data.getApp_name();
|
||||
String app_md5 = data.getApp_md5();
|
||||
// String app_id = jsonObject.get("app_id").getAsString();
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("app_name", app_name);
|
||||
object.put("app_package", packageName);
|
||||
object.put("MD5", app_md5);
|
||||
JsonObject object = new JsonObject();
|
||||
object.addProperty("app_name", app_name);
|
||||
object.addProperty("app_package", packageName);
|
||||
object.addProperty("MD5", app_md5);
|
||||
// object.put("app_id", app_id);
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
PackageInfo packageInfo = null;
|
||||
@@ -1271,11 +1290,11 @@ public class JGYUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public void installDesktop(JSONObject jsonObject) {
|
||||
String app_name = jsonObject.getString("app_name");
|
||||
String app_url = jsonObject.getString("app_url");
|
||||
String app_package = jsonObject.getString("app_package");
|
||||
int app_version_code = jsonObject.getInteger("app_version_code");
|
||||
public void installDesktop(JsonObject jsonObject) {
|
||||
String app_name = jsonObject.get("app_name").getAsString();
|
||||
String app_url = jsonObject.get("app_url").getAsString();
|
||||
String app_package = jsonObject.get("app_package").getAsString();
|
||||
int app_version_code = jsonObject.get("app_version_code").getAsInt();
|
||||
if (ApkUtils.desktopAPP.get(0).equals(app_package)) {
|
||||
ApkUtils.UninstallAPP(mContext, ApkUtils.desktopAPP.get(1));
|
||||
} else {
|
||||
@@ -1311,9 +1330,9 @@ public class JGYUtils {
|
||||
public void deleteOtherApp() {
|
||||
Log.e(TAG, "deleteOtherApp: " + Build.MODEL);
|
||||
if ("K106".equalsIgnoreCase(Build.MODEL)
|
||||
||"G10".equalsIgnoreCase(Build.MODEL)
|
||||
||"G10P".equalsIgnoreCase(Build.MODEL)
|
||||
||"G10R".equalsIgnoreCase(Build.MODEL)
|
||||
|| "G10".equalsIgnoreCase(Build.MODEL)
|
||||
|| "G10P".equalsIgnoreCase(Build.MODEL)
|
||||
|| "G10R".equalsIgnoreCase(Build.MODEL)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
@@ -1442,6 +1461,24 @@ public class JGYUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public void hideApp(String pkg) {
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
try {
|
||||
pm.setApplicationEnabledSetting(pkg, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "hideApp: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void showApp(String pkg) {
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
try {
|
||||
pm.setApplicationEnabledSetting(pkg, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "hideApp: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 从Manifest中获取meta-data值
|
||||
@@ -1471,15 +1508,15 @@ public class JGYUtils {
|
||||
Log.e(TAG, "checkBootFile: Bootanimation file exists");
|
||||
setBootanimation(bootFile.getAbsolutePath());
|
||||
} else {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("MD5", MD5);
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("MD5", MD5);
|
||||
Utils.ariaDownload(mContext, url, jsonObject);
|
||||
Log.e(TAG, "checkBootFile: " + "download file");
|
||||
}
|
||||
} else {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("MD5", MD5);
|
||||
jsonObject.put("app_name", urlFileName);
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("MD5", MD5);
|
||||
jsonObject.addProperty("app_name", urlFileName);
|
||||
Utils.ariaDownload(mContext, url, jsonObject);
|
||||
}
|
||||
}
|
||||
@@ -2037,6 +2074,9 @@ public class JGYUtils {
|
||||
setDefaultDesktop(PackageNames.DESKTOP);
|
||||
}
|
||||
|
||||
public void setYxpDefaultDesktop() {
|
||||
setDefaultDesktop(PackageNames.YIXUEPAI_DESKTOP);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置默认桌面
|
||||
|
||||
Reference in New Issue
Block a user