version:1.7.4

date:2021-10-11 18:27:04
fix:修复禁止升级功能失效,修复重复下载,修复时钟管控失效,设备信息的激活时间修复
add:
This commit is contained in:
2021-10-11 18:27:32 +08:00
parent e41becbdb0
commit e1c6d69428
11 changed files with 100 additions and 51 deletions

View File

@@ -576,6 +576,9 @@ public class JGYUtils {
disableApp.add("com.android.documentsui");
disableApp.add("com.mediatek.filemanager");
}
if (JGYUtils.getInt(context.getContentResolver(), "qch_app_deskclock", 0) == 1) {
disableApp.add("com.android.deskclock");
}
if (JGYUtils.getInt(context.getContentResolver(), "qch_app_soundrecorder", 0) == 1) {
disableApp.add("com.android.soundrecorder");
}

View File

@@ -188,7 +188,7 @@ public class SPUtils {
public static boolean apply(SharedPreferences.Editor editor) {
try {
if (sApplyMethod != null) {
Log.e(TAG, "apply: false");
Log.i(TAG, "apply: false");
sApplyMethod.invoke(editor);
return false;
}

View File

@@ -870,56 +870,44 @@ public class Utils {
//所有app
String only_jgy_shortcut_list = Settings.System.getString(context.getContentResolver(), "only_jgy_shortcut_list");
Log.e("writeDisableUpdateList", now);
List<String> nowList = new ArrayList<>();
List<String> disallowList = new ArrayList<>();
List<String> allList = new ArrayList<>();
HashSet<String> nowList = new HashSet<>();
HashSet<String> disallowList = new HashSet<>();
HashSet<String> allList = new HashSet<>();
if (!TextUtils.isEmpty(now)) {
nowList = new ArrayList<>(new HashSet<>(Arrays.asList(now.trim().replaceAll(" ", "").split(","))));
nowList = new HashSet<>(Arrays.asList(now.trim().replaceAll(" ", "").split(",")));
}
if (!TextUtils.isEmpty(upgrade_disallow)) {
disallowList = new ArrayList<>(new HashSet<>(Arrays.asList(upgrade_disallow.trim().replaceAll(" ", "").split(","))));
disallowList = new HashSet<>(Arrays.asList(upgrade_disallow.trim().replaceAll(" ", "").split(",")));
}
if (!TextUtils.isEmpty(only_jgy_shortcut_list)) {
allList = new ArrayList<>(new HashSet<>(Arrays.asList(only_jgy_shortcut_list.trim().replaceAll(" ", "").split(","))));
allList = new HashSet<>(Arrays.asList(only_jgy_shortcut_list.trim().replaceAll(" ", "").split(",")));
}
Log.e("writeDisableUpdateList", "nowList: " + nowList);
Log.e("writeDisableUpdateList", "upgrade_disallow: " + disallowList);
Log.e("writeDisableUpdateList", "only_jgy_shortcut_list: " + allList);
if (allList.size() != 0) {
List<String> finalAllList = allList;
nowList.removeIf(new Predicate<String>() {
@Override
public boolean test(String s) {
return !finalAllList.contains(s);
}
});
}
//合并
allList.addAll(nowList);
boolean writeSucceed = false;
for (String s : disallowList) {
if (ApkUtils.isAvailable(context, s)) {
if (nowList.remove(s)) {
if (allList.remove(s)) {
Log.e("writeDisableUpdateList", "remove :" + s);
} else {
Log.e("writeDisableUpdateList", "remove failed:" + s);
}
//去掉已经安装的
} else {
if (!nowList.contains(s)) {
nowList.add(s);
if (!allList.contains(s)) {
allList.add(s);
}
//没有安装就加入进去
//没有加入会导致安装后卸载不能再安装的情况
}
Log.e("writeDisableUpdateList", "nowList:" + nowList);
}
for (String s : nowList) {
if (!allList.contains(s)) {
allList.add(s);
//没找到元素添加到白名单
}
Log.e("writeDisableUpdateList", "allList:" + allList);
}
boolean writeSucceed = false;
if (allList.size() > 0) {
Log.e("writeDisableUpdateList", "allList:" + allList);
String list = String.join(",", allList);
writeSucceed = JGYUtils.putString(context.getContentResolver(), "qch_app_forbid", list);
Log.e("writeDisableUpdateList", "qch_app_forbid:" + list);