update:2020.06.03
fix:修复app禁止升级出现的问题 add:增加桌面图标隐藏功能
This commit is contained in:
@@ -9,6 +9,7 @@ import android.content.res.Configuration;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.provider.Settings;
|
||||
import android.support.multidex.MultiDexApplication;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -16,6 +17,7 @@ import android.util.Log;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.arialyy.aria.core.download.DownloadEntity;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.PathUtils;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.cache.CacheEntity;
|
||||
@@ -31,7 +33,6 @@ import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
|
||||
import com.mjsheng.myappstore.network.HTTPInterface;
|
||||
import com.mjsheng.myappstore.server.GuardService;
|
||||
import com.mjsheng.myappstore.server.InitJpushServer;
|
||||
import com.mjsheng.myappstore.server.MyDownloadService;
|
||||
import com.mjsheng.myappstore.utils.Configure;
|
||||
import com.mjsheng.myappstore.utils.MySQLData;
|
||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
||||
@@ -528,7 +529,7 @@ public class MyApplication extends MultiDexApplication {
|
||||
}
|
||||
|
||||
synchronized public void getWhitePackageList() {
|
||||
OkGo.post(Configure.SEND_APP_USAGE)
|
||||
OkGo.post(Configure.SET_WHITE_PACKAGE_LIST)
|
||||
.params("sn", Utils.getSerial())
|
||||
.params("key", Configure.HTTP_KEY)
|
||||
.execute(new StringCallback() {
|
||||
@@ -541,13 +542,10 @@ public class MyApplication extends MultiDexApplication {
|
||||
if (code == 200) {
|
||||
com.alibaba.fastjson.JSONObject resultJson = JSON.parseObject(data);
|
||||
String result = resultJson.getString("result");
|
||||
if (!TextUtils.isEmpty(result)) {
|
||||
String[] list = result.split(",");
|
||||
List<String> allList = new ArrayList<>(Arrays.asList(list));
|
||||
setAPPUsage(allList);
|
||||
}
|
||||
writeAppPackageList(result);
|
||||
// setAPPUsage(allList);
|
||||
} else {
|
||||
setAPPUsage();
|
||||
// setAPPUsage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -560,6 +558,25 @@ public class MyApplication extends MultiDexApplication {
|
||||
|
||||
}
|
||||
|
||||
private void writeAppPackageList(String result) {
|
||||
String appstore = "com.jiaoguanyi.appstore";
|
||||
String store = "com.jiaoguanyi.store";
|
||||
if (!TextUtils.isEmpty(result)) {
|
||||
LogUtils.e(result);
|
||||
if (!result.contains(appstore)) {
|
||||
result = result + "," + appstore;
|
||||
}
|
||||
if (!result.contains(store)) {
|
||||
result = result + "," + store;
|
||||
}
|
||||
Settings.System.putString(context.getContentResolver(), "qch_app_forbid", result);
|
||||
Log.e("mjsheng", "qch_app_forbid :"+result);
|
||||
} else {
|
||||
Log.e("mjsheng", "writeAppPackageList is null:");
|
||||
Settings.System.putString(context.getContentResolver(), "qch_app_forbid", appstore + "," + store);
|
||||
}
|
||||
}
|
||||
|
||||
private void catchException() {
|
||||
Thread.setDefaultUncaughtExceptionHandler(
|
||||
new Thread.UncaughtExceptionHandler() {
|
||||
@@ -690,7 +707,7 @@ public class MyApplication extends MultiDexApplication {
|
||||
} else {
|
||||
MyApplication.getInstance().setDownloadState(true);
|
||||
}
|
||||
Log.e("aria", "isDownloading=" + MyApplication.getInstance().isDownloading());
|
||||
Log.e("MyApplication", "isDownloading=" + MyApplication.getInstance().isDownloading());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user