删除默认空值为Invalid

This commit is contained in:
2022-07-01 10:07:53 +08:00
parent 77d44943c5
commit dbd36adca5
6 changed files with 33 additions and 31 deletions

View File

@@ -151,7 +151,7 @@ public class MainAPresenter implements MainAContact.Presenter {
NetInterfaceManager.getInstance().getForceInstallState(appInfos); NetInterfaceManager.getInstance().getForceInstallState(appInfos);
} }
} else { } else {
boolean aole_force_app = JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "invalid"); boolean aole_force_app = JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "");
Log.e("getForceInstall", "aole_force_app: invalid: " + aole_force_app); Log.e("getForceInstall", "aole_force_app: invalid: " + aole_force_app);
} }
} }

View File

@@ -1251,7 +1251,7 @@ public class NetInterfaceManager {
if (!TextUtils.isEmpty(home_page)) { if (!TextUtils.isEmpty(home_page)) {
homepag.putExtra("homepage", home_page); homepag.putExtra("homepage", home_page);
} else { } else {
homepag.putExtra("homepage", "Invalid"); homepag.putExtra("homepage", "");
} }
mContext.sendBroadcast(homepag); mContext.sendBroadcast(homepag);
@@ -1265,7 +1265,7 @@ public class NetInterfaceManager {
if (label_page != null && !"".equals(label_page)) { if (label_page != null && !"".equals(label_page)) {
websiteBookMark.putExtra("websiteBookMark", label_page); websiteBookMark.putExtra("websiteBookMark", label_page);
} else { } else {
websiteBookMark.putExtra("websiteBookMark", "Invalid"); websiteBookMark.putExtra("websiteBookMark", "");
} }
mContext.sendBroadcast(websiteBookMark); mContext.sendBroadcast(websiteBookMark);
} else { } else {
@@ -1274,14 +1274,14 @@ public class NetInterfaceManager {
intent1.setPackage("com.android.settings") intent1.setPackage("com.android.settings")
.setPackage("com.android.browser"); .setPackage("com.android.browser");
} }
intent1.putExtra("homepage", "Invalid"); intent1.putExtra("homepage", "");
mContext.sendBroadcast(intent1); mContext.sendBroadcast(intent1);
Intent intent2 = new Intent("qch_app_brower_website"); Intent intent2 = new Intent("qch_app_brower_website");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
intent2.setPackage("com.android.settings") intent2.setPackage("com.android.settings")
.setPackage("com.android.browser"); .setPackage("com.android.browser");
} }
intent2.putExtra("websiteBookMark", "Invalid"); intent2.putExtra("websiteBookMark", "");
mContext.sendBroadcast(intent2); mContext.sendBroadcast(intent2);
} }
} }
@@ -1574,8 +1574,8 @@ public class NetInterfaceManager {
Log.e(TAG, "setAPPIDJump: " + packages); Log.e(TAG, "setAPPIDJump: " + packages);
Log.e(TAG, "setAPPIDJump: " + ids); Log.e(TAG, "setAPPIDJump: " + ids);
if (TextUtils.isEmpty(ids)) { if (TextUtils.isEmpty(ids)) {
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, "Invalid"); JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, "");
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, "Invalid"); JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, "");
} else { } else {
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, packages); JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, packages);
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, ids); JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, ids);
@@ -1584,23 +1584,23 @@ public class NetInterfaceManager {
} }
public void setInvalid() { public void setInvalid() {
boolean aole_app_power_on = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_POWER_ON, "Invalid"); boolean aole_app_power_on = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_POWER_ON, "");
boolean aole_network_allow = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "Invalid"); boolean aole_network_allow = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
boolean aole_network_disallow = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "Invalid"); boolean aole_network_disallow = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
boolean writeSucceed = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, ""); boolean writeSucceed = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, "");
} }
private void sendAllweb() { private void sendAllweb() {
Intent intent = new Intent("qch_app_website") Intent intent = new Intent("qch_app_website")
.setPackage("com.android.settings"); .setPackage("com.android.settings");
intent.putExtra("package_name", "Invalid"); intent.putExtra("package_name", "");
mContext.sendBroadcast(intent); mContext.sendBroadcast(intent);
} }
private void sendwebUrl() { private void sendwebUrl() {
Intent intent = new Intent("qch_app_inside_website") Intent intent = new Intent("qch_app_inside_website")
.setPackage("com.android.settings"); .setPackage("com.android.settings");
intent.putExtra("websitelist", "Invalid"); intent.putExtra("websitelist", "");
mContext.sendBroadcast(intent); mContext.sendBroadcast(intent);
} }
@@ -1732,8 +1732,8 @@ public class NetInterfaceManager {
} }
// JGYUtils.getInstance().deleteOtherApp(); // JGYUtils.getInstance().deleteOtherApp();
} else { } else {
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "invalid"); boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "");
Log.e(TAG, "aole_force_app:" + aole_force_app + ":" + "invalid"); Log.e(TAG, "aole_force_app:" + aole_force_app + ":" + "");
} }
} }
@@ -1782,8 +1782,8 @@ public class NetInterfaceManager {
Log.e(TAG, "getForceInstallState: " + packageList); Log.e(TAG, "getForceInstallState: " + packageList);
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, packageList); boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, packageList);
} else { } else {
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "invalid"); boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "");
Log.e(TAG, "getForceInstallState:" + aole_force_app + ":" + "invalid"); Log.e(TAG, "getForceInstallState:" + aole_force_app + ":" + "");
} }
} }

View File

@@ -151,6 +151,8 @@ public class MainSPresenter implements MainSContact.Presenter {
NetInterfaceManager.getInstance().getAppStart(appInfoList); NetInterfaceManager.getInstance().getAppStart(appInfoList);
} }
JGYUtils.getInstance().deleteOtherApp(); JGYUtils.getInstance().deleteOtherApp();
}else {
ApkUtils.writeAppPackageList(mContext, "");
} }
} }
@@ -230,7 +232,7 @@ public class MainSPresenter implements MainSContact.Presenter {
NetInterfaceManager.getInstance().getForceInstallState(appInfos); NetInterfaceManager.getInstance().getForceInstallState(appInfos);
} }
} else { } else {
boolean aole_force_app = JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "invalid"); boolean aole_force_app = JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "");
Log.e("getForceInstall", "aole_force_app: invalid: " + aole_force_app); Log.e("getForceInstall", "aole_force_app: invalid: " + aole_force_app);
} }
} }
@@ -315,7 +317,7 @@ public class MainSPresenter implements MainSContact.Presenter {
if (!TextUtils.isEmpty(home_page)) { if (!TextUtils.isEmpty(home_page)) {
homepag.putExtra("homepage", home_page); homepag.putExtra("homepage", home_page);
} else { } else {
homepag.putExtra("homepage", "Invalid"); homepag.putExtra("homepage", "");
} }
mContext.sendBroadcast(homepag); mContext.sendBroadcast(homepag);
@@ -329,7 +331,7 @@ public class MainSPresenter implements MainSContact.Presenter {
if (!TextUtils.isEmpty(label_page)) { if (!TextUtils.isEmpty(label_page)) {
websiteBookMark.putExtra("websiteBookMark", label_page); websiteBookMark.putExtra("websiteBookMark", label_page);
} else { } else {
websiteBookMark.putExtra("websiteBookMark", "Invalid"); websiteBookMark.putExtra("websiteBookMark", "");
} }
mContext.sendBroadcast(websiteBookMark); mContext.sendBroadcast(websiteBookMark);
} else { } else {
@@ -338,14 +340,14 @@ public class MainSPresenter implements MainSContact.Presenter {
intent1.setPackage("com.android.settings") intent1.setPackage("com.android.settings")
.setPackage("com.android.browser"); .setPackage("com.android.browser");
} }
intent1.putExtra("homepage", "Invalid"); intent1.putExtra("homepage", "");
mContext.sendBroadcast(intent1); mContext.sendBroadcast(intent1);
Intent intent2 = new Intent("qch_app_brower_website"); Intent intent2 = new Intent("qch_app_brower_website");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
intent2.setPackage("com.android.settings") intent2.setPackage("com.android.settings")
.setPackage("com.android.browser"); .setPackage("com.android.browser");
} }
intent2.putExtra("websiteBookMark", "Invalid"); intent2.putExtra("websiteBookMark", "");
mContext.sendBroadcast(intent2); mContext.sendBroadcast(intent2);
} }
} }

View File

@@ -906,14 +906,14 @@ public class MessageReceiver extends XGPushBaseReceiver {
boolean aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, package0); boolean aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, package0);
Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW)); Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW));
} else { } else {
boolean aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "invalid"); boolean aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW)); Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW));
} }
if (package1.length() != 0) { if (package1.length() != 0) {
boolean aole_network_disallow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, package1); boolean aole_network_disallow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, package1);
Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW)); Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW));
} else { } else {
boolean aole_network_disallow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "invalid"); boolean aole_network_disallow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW)); Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW));
} }
} else { } else {
@@ -1302,7 +1302,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
} }
Log.e("blackList", JGYUtils.getString(context.getContentResolver(), "qch_webblack_url")); Log.e("blackList", JGYUtils.getString(context.getContentResolver(), "qch_webblack_url"));
} else { } else {
boolean setBrowserUrlpath = JGYUtils.putString(context.getContentResolver(), "DeselectBrowserArray", "invalid"); boolean setBrowserUrlpath = JGYUtils.putString(context.getContentResolver(), "DeselectBrowserArray", "");
ToastUtil.debugShow("setBrowserUrlpath jsonString is NULL,set default: " + setBrowserUrlpath); ToastUtil.debugShow("setBrowserUrlpath jsonString is NULL,set default: " + setBrowserUrlpath);
} }
} }

View File

@@ -249,14 +249,14 @@ public class JGYUtils {
private void sendAllweb() { private void sendAllweb() {
Intent intent = new Intent("qch_app_website") Intent intent = new Intent("qch_app_website")
.setPackage("com.android.settings"); .setPackage("com.android.settings");
intent.putExtra("package_name", "Invalid"); intent.putExtra("package_name", "");
mContext.sendBroadcast(intent); mContext.sendBroadcast(intent);
} }
private void sendwebUrl() { private void sendwebUrl() {
Intent intent = new Intent("qch_app_inside_website") Intent intent = new Intent("qch_app_inside_website")
.setPackage("com.android.settings"); .setPackage("com.android.settings");
intent.putExtra("websitelist", "Invalid"); intent.putExtra("websitelist", "");
mContext.sendBroadcast(intent); mContext.sendBroadcast(intent);
} }
@@ -710,11 +710,11 @@ public class JGYUtils {
//清除旧数据 //清除旧数据
if (!TextUtils.isEmpty(dis)) { if (!TextUtils.isEmpty(dis)) {
Log.e(TAG, "setAppNetwork: dis = " + dis); Log.e(TAG, "setAppNetwork: dis = " + dis);
Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "Invalid"); Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
} }
if (!TextUtils.isEmpty(not)) { if (!TextUtils.isEmpty(not)) {
Log.e(TAG, "setAppNetwork: not = " + not); Log.e(TAG, "setAppNetwork: not = " + not);
Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "Invalid"); Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
} }
String oldBlackList = (String) SPUtils.get(mContext, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, ""); String oldBlackList = (String) SPUtils.get(mContext, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");

View File

@@ -45,7 +45,7 @@ public class URLUtils {
Log.e(TAG, "setBrowserList old: " + oldwhiteList); Log.e(TAG, "setBrowserList old: " + oldwhiteList);
if (TextUtils.isEmpty(oldwhiteList) && TextUtils.isEmpty(oldHomePage)) { if (TextUtils.isEmpty(oldwhiteList) && TextUtils.isEmpty(oldHomePage)) {
Log.e(TAG, "getBrowserWhiteList: " + "oldwhiteList is empty"); Log.e(TAG, "getBrowserWhiteList: " + "oldwhiteList is empty");
Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", "Invalid"); Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", "");
} else { } else {
HashSet<String> URLList = new HashSet<>(); HashSet<String> URLList = new HashSet<>();
if (!TextUtils.isEmpty(oldwhiteList)) { if (!TextUtils.isEmpty(oldwhiteList)) {
@@ -59,7 +59,7 @@ public class URLUtils {
URLList.removeIf(s -> TextUtils.isEmpty(s.trim())); URLList.removeIf(s -> TextUtils.isEmpty(s.trim()));
if (URLList.size() == 0) { if (URLList.size() == 0) {
Log.e(TAG, "setBrowserWhiteList: URLList set is empty , set Invalid"); Log.e(TAG, "setBrowserWhiteList: URLList set is empty , set Invalid");
Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", "Invalid"); Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", "");
return; return;
} }
Log.e(TAG, "setBrowserList: " + URLList); Log.e(TAG, "setBrowserList: " + URLList);
@@ -171,7 +171,7 @@ public class URLUtils {
String qch_webblack_url = Settings.System.getString(mContext.getContentResolver(), "qch_webblack_url"); String qch_webblack_url = Settings.System.getString(mContext.getContentResolver(), "qch_webblack_url");
Log.e(TAG, "setBrowserBlackList: qch_webblack_url = " + qch_webblack_url); Log.e(TAG, "setBrowserBlackList: qch_webblack_url = " + qch_webblack_url);
if (TextUtils.isEmpty(qch_webblack_url)) { if (TextUtils.isEmpty(qch_webblack_url)) {
Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", "Invalid"); Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", "");
} else { } else {
String black_ip = (String) SPUtils.get(mContext, "black_ip", ""); String black_ip = (String) SPUtils.get(mContext, "black_ip", "");
if (!TextUtils.isEmpty(black_ip)) { if (!TextUtils.isEmpty(black_ip)) {