version:2.0.9
update: fix:适配展锐桌面图标隐藏,部分图标隐藏后无法显示 add:
This commit is contained in:
@@ -35,6 +35,8 @@ import com.arialyy.aria.core.Aria;
|
||||
import com.blankj.utilcode.util.AppUtils;
|
||||
import com.blankj.utilcode.util.EncryptUtils;
|
||||
import com.blankj.utilcode.util.PathUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
@@ -67,6 +69,7 @@ import com.mjsheng.myappstore.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@@ -1222,7 +1225,11 @@ public class DiscardActivity extends AppCompatActivity {
|
||||
BaseApplication.getInstance().checkIsDownloading();
|
||||
if (!BaseApplication.getInstance().isDownloading()) {
|
||||
Aria.download(this).removeAllTask(true);
|
||||
forceDownload(forceDownloadBean.getData());
|
||||
Type type = new TypeToken<List<ForceDownloadData>>() {
|
||||
}.getType();
|
||||
Gson gson = new Gson();
|
||||
List<ForceDownloadData> forceDownloadData = gson.fromJson(gson.toJson(forceDownloadBean.getData()), type);
|
||||
forceDownload(forceDownloadData);
|
||||
} else {
|
||||
Aria.download(this).resumeAllTask();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
|
||||
@@ -50,7 +51,7 @@ public class HomeActivity extends AppCompatActivity {
|
||||
// setWebView();
|
||||
// hideStatusBar();
|
||||
Log.e(TAG, "DebugTest: " + HttpHeaders.getUserAgent());
|
||||
boolean qch_force_app = Settings.System.putString(getContentResolver(), "qch_launcher_icon_app", "");
|
||||
// boolean qch_force_app = Settings.System.putString(getContentResolver(), "qch_launcher_icon_app", "");
|
||||
Log.e(TAG, "DebugTest: " + Settings.System.getString(getContentResolver(), "qch_launcher_icon_app"));
|
||||
Log.e(TAG, "DebugTest: qch_hide_NavigationBar: " + Settings.System.getString(getContentResolver(), "qch_hide_NavigationBar"));
|
||||
// try {
|
||||
@@ -59,7 +60,7 @@ public class HomeActivity extends AppCompatActivity {
|
||||
// e.printStackTrace();
|
||||
// Log.e(TAG, "DebugTest: " + e.getMessage());
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private void hideStatusBar() {
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.base.BaseApplication;
|
||||
import com.mjsheng.myappstore.bean.Appground;
|
||||
@@ -29,6 +30,7 @@ import com.mjsheng.myappstore.bean.ForceDownloadData;
|
||||
import com.mjsheng.myappstore.bean.LogoImg;
|
||||
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
|
||||
import com.mjsheng.myappstore.bean.NewAppground;
|
||||
import com.mjsheng.myappstore.bean.SplitApks;
|
||||
import com.mjsheng.myappstore.bean.StudentsInfo;
|
||||
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
|
||||
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
||||
@@ -44,6 +46,7 @@ import com.mjsheng.myappstore.utils.URLUtils;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -63,6 +66,7 @@ import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
|
||||
|
||||
/**
|
||||
* MainActivity和MainService 的 Presenter
|
||||
*
|
||||
* @author jgy02
|
||||
*/
|
||||
public class MainPresenter implements MainContact.Presenter {
|
||||
@@ -137,10 +141,13 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
}
|
||||
SPUtils.put(mContext, "admin_id", studentsInfoBaseResponse.data.getAdmin_id());
|
||||
} else {
|
||||
mView.setNumberText("", View.GONE);
|
||||
mView.setNameText("", View.GONE);
|
||||
mView.setClassText("", View.GONE);
|
||||
mView.setBatchText("", View.GONE);
|
||||
/*
|
||||
* 没有获取到的时候显示缓存
|
||||
* */
|
||||
// mView.setNumberText("", View.GONE);
|
||||
// mView.setNameText("", View.GONE);
|
||||
// mView.setClassText("", View.GONE);
|
||||
// mView.setBatchText("", View.GONE);
|
||||
Log.e("getStudesInfo", "onNext: " + studentsInfoBaseResponse.toString());
|
||||
}
|
||||
}
|
||||
@@ -677,7 +684,7 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
JGYUtils.getInstance().writeAppPackageList(mContext, data);
|
||||
mView.getAppLimitFinished(data);
|
||||
} else {
|
||||
mView.getAppLimitFinished("");
|
||||
// mView.getAppLimitFinished("");
|
||||
boolean write = Settings.System.putString(mContext.getContentResolver(), "only_jgy_shortcut_list", "");
|
||||
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||
Log.e("getAppLimit", "onNext: " + bodyString);
|
||||
@@ -733,7 +740,8 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
// if (null != batchList && batchList.size() > 1) {
|
||||
// Log.e("getDeviceBatch", "onNext: " + "deleteOtherApp");
|
||||
// if (!BuildConfig.DEBUG) {
|
||||
JGYUtils.getInstance().deleteOtherApp(packageList);
|
||||
//暂时屏蔽
|
||||
// JGYUtils.getInstance().deleteOtherApp(packageList);
|
||||
// }
|
||||
// } else {
|
||||
// Log.e("getDeviceBatch", "批次为空");
|
||||
@@ -781,7 +789,11 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
BaseApplication.getInstance().checkIsDownloading();
|
||||
if (!BaseApplication.getInstance().isDownloading()) {
|
||||
// Aria.download(this).removeAllTask(true);
|
||||
JGYUtils.getInstance().forceDownload(forceDownloadBean.getData());
|
||||
Type type = new TypeToken<List<ForceDownloadData>>() {
|
||||
}.getType();
|
||||
Gson gson = new Gson();
|
||||
List<ForceDownloadData> forceDownloadData = gson.fromJson(gson.toJson(forceDownloadBean.getData()), type);
|
||||
JGYUtils.getInstance().forceDownload(forceDownloadData);
|
||||
} else {
|
||||
Aria.download(this).resumeAllTask();
|
||||
}
|
||||
@@ -1071,13 +1083,16 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
for (String pack : newList) {
|
||||
try {
|
||||
// TODO: 2021/5/24 需要后端替换包名,暂时解决方案
|
||||
if ("com.mediatek.camera".equals(pack)) {
|
||||
pm.setApplicationEnabledSetting("com.android.camera2", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
try {
|
||||
if ("com.mediatek.camera".equals(pack)) {
|
||||
pm.setApplicationEnabledSetting("com.android.camera2", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
}
|
||||
if ("com.android.mms".equals(pack)) {
|
||||
pm.setApplicationEnabledSetting("com.android.messaging", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
Log.e("getDesktopIcon", "Exception: ex: " + ex.getMessage());
|
||||
}
|
||||
if (" com.android.mms".equals(pack)) {
|
||||
pm.setApplicationEnabledSetting("com.android.messaging", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
}
|
||||
|
||||
pm.setApplicationEnabledSetting(pack, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
Log.e("getDesktopIcon", pack);
|
||||
} catch (Exception e) {
|
||||
@@ -1235,21 +1250,21 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getNewAppinsideWebObservable()
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(new Observer<BaseResponse<List<NewAppground>>>() {
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getNewAppinsideWeb", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<NewAppground>> listBaseResponse) {
|
||||
public void onNext(@NonNull BaseResponse listBaseResponse) {
|
||||
Log.e("getNewAppinsideWeb", "onNext: ");
|
||||
JGYUtils.getInstance().setNewAppinsideWeb(listBaseResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getNewAppinsideWeb", "onError: ");
|
||||
Log.e("getNewAppinsideWeb", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@@ -1389,8 +1404,8 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("setLogoImg", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
Log.e("setLogoImg", "onError: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
* 来自:
|
||||
*/
|
||||
|
||||
public class ForceDownloadBean {
|
||||
public class ForceDownloadBean<T> {
|
||||
|
||||
/**
|
||||
* code : 200
|
||||
@@ -20,7 +20,7 @@ public class ForceDownloadBean {
|
||||
private int code;
|
||||
private String msg;
|
||||
|
||||
private List<ForceDownloadData> data;
|
||||
private T data;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
@@ -38,11 +38,11 @@ public class ForceDownloadBean {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public List<ForceDownloadData> getData() {
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<ForceDownloadData> data) {
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,8 @@ public class AmapManager {
|
||||
} else {
|
||||
//定位失败
|
||||
sb.append("定位失败" + "\n");
|
||||
SPUtils.put(mContext, "AmapError", String.valueOf(aMapLocation.getErrorCode()));
|
||||
Log.e(TAG, "onLocationChanged: " + "定位失败");
|
||||
SPUtils.put(mContext, "AmapError", String.valueOf(aMapLocation.getErrorInfo()));
|
||||
}
|
||||
Log.e(TAG, (String) SPUtils.get(mContext, "AmapAddress", "-"));
|
||||
Log.e(TAG, (String) SPUtils.get(mContext, "AmapError", "-"));
|
||||
|
||||
@@ -226,7 +226,7 @@ public class NetInterfaceManager {
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<NewAppground>>> getNewAppinsideWebObservable() {
|
||||
public Observable<BaseResponse> getNewAppinsideWebObservable() {
|
||||
return mRetrofit
|
||||
.create(NewAppinsideWebApi.class)
|
||||
.getAppinsideWeb(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
|
||||
@@ -765,18 +765,23 @@ public class HTTPInterface {
|
||||
String msg = jsonObject.getString("msg");
|
||||
String data = jsonObject.getString("data");
|
||||
ApkUtils.showAllAPP(context);
|
||||
Logger.e("setHideDesktopIcon", "data" + data);
|
||||
Logger.e("setHideDesktopIcon", "data: " + data);
|
||||
if (code == 200) {
|
||||
if (data != null && !"".equals(data)) {
|
||||
List<String> newList = Arrays.asList(data.split(","));//新的list
|
||||
PackageManager pm = context.getPackageManager();
|
||||
for (String pack : newList) {
|
||||
// TODO: 2021/5/24 需要后端替换包名,暂时解决方案
|
||||
try {
|
||||
if ("com.mediatek.camera".equals(pack)){
|
||||
pm.setApplicationEnabledSetting("com.android.camera2", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
}
|
||||
if (" com.android.mms".equals(pack)){
|
||||
pm.setApplicationEnabledSetting("com.android.messaging", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
try {
|
||||
if ("com.mediatek.camera".equals(pack)) {
|
||||
pm.setApplicationEnabledSetting("com.android.camera2", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
}
|
||||
if ("com.android.mms".equals(pack)) {
|
||||
pm.setApplicationEnabledSetting("com.android.messaging", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
Log.e("setHideDesktopIcon", "Exception: ex: " + ex.getMessage());
|
||||
}
|
||||
pm.setApplicationEnabledSetting(pack, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
Logger.e("setHideDesktopIcon", pack);
|
||||
|
||||
@@ -15,7 +15,7 @@ import retrofit2.http.POST;
|
||||
public interface NewAppinsideWebApi {
|
||||
@FormUrlEncoded
|
||||
@POST(URLAddress.SET_APPINSIDEWEB)
|
||||
Observable<BaseResponse<List<NewAppground>>> getAppinsideWeb(
|
||||
Observable<BaseResponse> getAppinsideWeb(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@@ -648,21 +648,23 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
file.mkdirs();
|
||||
}
|
||||
if (TextUtils.isEmpty(jsonString)) {
|
||||
Log.e(TAG, "doDownloadAndInstall extras is null");
|
||||
Log.e(TAG, "doDownloadAndInstall: extras is null");
|
||||
return;
|
||||
}
|
||||
JSONObject jSONObject = JSON.parseObject(jsonString);
|
||||
String app_name = jSONObject.getString("app_name");
|
||||
String app_package = jSONObject.getString("app_package");
|
||||
String app_package = jSONObject.getString("bg");
|
||||
String app_url = jSONObject.getString("app_url");
|
||||
int app_version_code = jSONObject.getInteger("app_version_code");
|
||||
String app_id = jSONObject.getString("app_id");
|
||||
String MD5 = jSONObject.getString("app_md5");
|
||||
JSONObject packageObj = new JSONObject();
|
||||
packageObj.put("app_name", app_name);
|
||||
packageObj.put("app_package", app_package);
|
||||
packageObj.put("app_id", app_id);
|
||||
Log.e("mymjsheng", "app_package::" + app_package);
|
||||
Log.e("mymjsheng", "app_url::" + app_url);
|
||||
packageObj.put("MD5", MD5);
|
||||
Log.e(TAG, "doDownloadAndInstall: app_package:" + app_package);
|
||||
Log.e(TAG, "doDownloadAndInstall: app_url:" + app_url);
|
||||
SaveListUtils.addList(app_package);
|
||||
SaveListUtils.sendForceAPP(mContext);
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
@@ -673,6 +675,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (packageInfo == null) {
|
||||
Log.e(TAG, "doDownloadAndInstall: "+ app_package + "未安装");
|
||||
if (!SaveListUtils.isDownLoading(app_url)) {
|
||||
// Aria.download(this)
|
||||
// .load(app_url)
|
||||
@@ -698,6 +701,8 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
Utils.ariaDownload(mContext, app_url, packageObj);
|
||||
|
||||
}
|
||||
}else {
|
||||
Log.e(TAG, "doDownloadAndInstall: "+ app_package + "已安装最新版");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.util.Log;
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.network.HTTPInterface;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
import com.mjsheng.myappstore.utils.SaveListUtils;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -36,8 +37,9 @@ public class NewAppReceiver extends BroadcastReceiver {
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
mContext = context;
|
||||
String action = intent.getAction();
|
||||
JGYUtils.getInstance().cleanLauncherCache();
|
||||
Log.e(TAG, "onReceive: " + "action = " + action);
|
||||
String state = "";
|
||||
String state;
|
||||
if (TextUtils.isEmpty(action)) {
|
||||
Log.e(TAG, "onReceive: " + "action is empty ");
|
||||
return;
|
||||
|
||||
@@ -31,6 +31,8 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.blankj.utilcode.util.PathUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
@@ -65,6 +67,7 @@ import com.mjsheng.myappstore.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -821,7 +824,11 @@ public class DiscardServer extends Service {
|
||||
BaseApplication.getInstance().checkIsDownloading();
|
||||
if (!BaseApplication.getInstance().isDownloading()) {
|
||||
Aria.download(this).removeAllTask(true);
|
||||
forceDownload(forceDownloadBean.getData());
|
||||
Type type = new TypeToken<List<ForceDownloadData>>() {
|
||||
}.getType();
|
||||
Gson gson = new Gson();
|
||||
List<ForceDownloadData> forceDownloadData = gson.fromJson(gson.toJson(forceDownloadBean.getData()), type);
|
||||
forceDownload(forceDownloadData);
|
||||
} else {
|
||||
Aria.download(this).resumeAllTask();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.os.BatteryManager;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.Formatter;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -491,18 +492,22 @@ public class GuardService extends Service {
|
||||
String setting_usb = Settings.System.getString(getContentResolver(), "qch_usb_choose");
|
||||
Log.e("setDefaultUSBStatus", "setting_usb---------" + setting_usb);
|
||||
String usbStatus = "";
|
||||
switch (setting_usb) {
|
||||
case "usb_charge":
|
||||
usbStatus = "qch_action_usb_usb_charge";
|
||||
break;
|
||||
case "usb_mtp":
|
||||
usbStatus = "qch_action_usb_usb_mtp";
|
||||
break;
|
||||
case "usb_midi":
|
||||
usbStatus = "qch_action_usb_usb_midi";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
if (TextUtils.isEmpty(setting_usb)) {
|
||||
usbStatus = "qch_action_usb_usb_charge";
|
||||
} else {
|
||||
switch (setting_usb) {
|
||||
case "usb_charge":
|
||||
usbStatus = "qch_action_usb_usb_charge";
|
||||
break;
|
||||
case "usb_mtp":
|
||||
usbStatus = "qch_action_usb_usb_mtp";
|
||||
break;
|
||||
case "usb_midi":
|
||||
usbStatus = "qch_action_usb_usb_midi";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
|
||||
sendBroadcast(usbIntent);
|
||||
|
||||
@@ -107,6 +107,7 @@ public class MainService extends Service implements MainContact.MainView {
|
||||
mPresenter = new MainPresenter(this);
|
||||
mPresenter.attachView(this);
|
||||
if ((int) SPUtils.get(this, "first_connect", 0) == 0) {
|
||||
// TODO: 2021/5/26 待底层修改,临时解决办法
|
||||
Log.e(TAG, "onCreate: " + "Disable All Settings");
|
||||
mPresenter.setDisableSetting();
|
||||
}
|
||||
@@ -154,19 +155,6 @@ public class MainService extends Service implements MainContact.MainView {
|
||||
return START_STICKY;
|
||||
}
|
||||
|
||||
private void cleanLauncherCache() {
|
||||
int cleaned = (int) SPUtils.get(MainService.this, "cleanLauncherCache", 0);
|
||||
if (cleaned == 0) {
|
||||
try {
|
||||
new CacheUtils().cleanApplicationUserData(MainService.this, "com.android.launcher3");
|
||||
SPUtils.put(MainService.this, "cleanLauncherCache", 1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e(TAG, "DebugTest: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addShortcut() {
|
||||
ApkUtils.addShortcut(MainService.this);
|
||||
}
|
||||
|
||||
@@ -656,8 +656,8 @@ public class ApkUtils {
|
||||
return applicationInfos;
|
||||
}
|
||||
|
||||
//预置的可以卸载的系统应用,判断出来为第三方
|
||||
public static List<String> canremove_systemapp = new ArrayList<String>() {{
|
||||
//预置的可以卸载的系统应用,判断出来为第三方
|
||||
this.add("com.android.quicksearchbox");
|
||||
this.add("com.android.calendar");
|
||||
this.add("com.android.dreams.basic");
|
||||
@@ -666,15 +666,15 @@ public class ApkUtils {
|
||||
this.add("com.jiaoguanyi.sysc");
|
||||
}};
|
||||
|
||||
//需要管控的系统可以卸载的应用
|
||||
public static List<String> show_canremove_systemapp = new ArrayList<String>() {{
|
||||
//需要管控的系统可以卸载的应用
|
||||
this.add("com.android.calendar");
|
||||
this.add("com.android.email");
|
||||
}};
|
||||
|
||||
|
||||
//需要管控的系统应用
|
||||
public static List<String> systemapp = new ArrayList<String>() {{
|
||||
//需要管控的系统应用
|
||||
this.add("com.android.gallery3d");//图库
|
||||
this.add("com.android.settings");//图库
|
||||
this.add("com.android.deskclock");//时钟
|
||||
@@ -694,13 +694,23 @@ public class ApkUtils {
|
||||
this.add("com.easyclient.activity");//移动课堂
|
||||
this.add("com.jiandan.mobilelesson");//简单课堂
|
||||
this.add("com.jiaoguanyi.store");//教官壹
|
||||
//展讯
|
||||
this.add("com.android.calculator2");//计算器
|
||||
this.add("com.android.email");//电子邮件
|
||||
this.add("com.android.calendar");//日历
|
||||
|
||||
|
||||
|
||||
}};
|
||||
|
||||
//桌面app
|
||||
public static List<String> desktopAPP = new ArrayList<String>() {{
|
||||
this.add("com.uiuios.jgy1");
|
||||
this.add("com.uiuios.jgy2");
|
||||
this.add("com.android.uiuios");
|
||||
}};
|
||||
|
||||
//出厂自带的app
|
||||
public static List<String> factoryapp = new ArrayList<String>() {{
|
||||
this.add("com.android.fmradio");
|
||||
this.add("com.mediatek.gba");
|
||||
@@ -893,12 +903,20 @@ public class ApkUtils {
|
||||
//7.0是系统应用
|
||||
if (show_canremove_systemapp.contains(packageInfo.packageName)) {
|
||||
// Logger.e("showAllAPP2", "packageName:" + packageInfo.packageName);
|
||||
pm.setApplicationEnabledSetting(packageInfo.packageName, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
|
||||
try {
|
||||
pm.setApplicationEnabledSetting(packageInfo.packageName, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "showAllAPP: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Logger.e("showAllAPP", "packageName:" + packageInfo.packageName);
|
||||
pm.setApplicationEnabledSetting(packageInfo.packageName, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
|
||||
try {
|
||||
pm.setApplicationEnabledSetting(packageInfo.packageName, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "showAllAPP: " + e.getMessage());
|
||||
}
|
||||
hideSystemSettingAPP(context, packageInfo.packageName);
|
||||
}
|
||||
}
|
||||
@@ -1050,6 +1068,9 @@ public class ApkUtils {
|
||||
if ("com.jiaoguanyi.store".equals(s) || "com.jiaoguanyi.appstore".equals(s)) {
|
||||
continue;
|
||||
}
|
||||
if (!ApkUtils.isSystemApp(context, s)) {
|
||||
continue;
|
||||
}
|
||||
if (!ApkUtils.isAvailable(context, s)) {
|
||||
continue;
|
||||
}
|
||||
@@ -1093,6 +1114,10 @@ public class ApkUtils {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (desktopAPP.contains(packageInfo.packageName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == 2) {
|
||||
if ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||
continue;
|
||||
|
||||
@@ -18,6 +18,7 @@ import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.FileUtils;
|
||||
import com.blankj.utilcode.util.PathUtils;
|
||||
@@ -357,9 +358,10 @@ public class JGYUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public void setNewAppinsideWeb(BaseResponse<List<NewAppground>> response) {
|
||||
public void setNewAppinsideWeb(BaseResponse response) {
|
||||
if (response.code == 200) {
|
||||
List<NewAppground> appgrounds = response.data;
|
||||
String jsonString = JSONArray.toJSONString(response.data);
|
||||
List<NewAppground> appgrounds = JSONObject.parseArray(jsonString, NewAppground.class);
|
||||
StringBuilder whiteList = new StringBuilder();
|
||||
StringBuilder blackList = new StringBuilder();
|
||||
StringBuilder packageList = new StringBuilder();//单条管控名单
|
||||
@@ -666,6 +668,11 @@ public class JGYUtils {
|
||||
String app_url = jsonObject.getString("app_url");
|
||||
String app_package = jsonObject.getString("app_package");
|
||||
int app_version_code = jsonObject.getInteger("app_version_code");
|
||||
if (ApkUtils.desktopAPP.get(0).equals(app_package)) {
|
||||
ApkUtils.UninstallAPP(mContext, ApkUtils.desktopAPP.get(1));
|
||||
} else {
|
||||
ApkUtils.UninstallAPP(mContext, ApkUtils.desktopAPP.get(0));
|
||||
}
|
||||
PackageInfo info = null;
|
||||
PackageManager packageManager = mContext.getPackageManager();
|
||||
if (null != packageManager) {
|
||||
@@ -986,4 +993,20 @@ public class JGYUtils {
|
||||
getAppPlatformCallback.AppPlatform(UnknowPlatform);
|
||||
}
|
||||
}
|
||||
|
||||
public void cleanLauncherCache() {
|
||||
Log.e(TAG, "cleanLauncherCache: Start");
|
||||
int cleaned = (int) SPUtils.get(mContext, "cleanLauncherCache", 0);
|
||||
if (cleaned == 0) {
|
||||
try {
|
||||
new CacheUtils().cleanApplicationUserData(mContext, "com.android.launcher3");
|
||||
SPUtils.put(mContext, "cleanLauncherCache", 1);
|
||||
Log.e(TAG, "cleanLauncherCache: end");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e(TAG, "cleanLauncherCache: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public class SaveListUtils {
|
||||
|
||||
public static List<String> getList() {
|
||||
String data = SPStaticUtils.getString(CommonDatas.FORCE_INSTALL);
|
||||
Log.e("mjshenglistdata", data);
|
||||
Log.e("SaveListUtils", data);
|
||||
Gson gson = new Gson();
|
||||
Type listType = new TypeToken<List<String>>() {
|
||||
}.getType();
|
||||
|
||||
@@ -949,7 +949,7 @@ public class Utils {
|
||||
|
||||
private static String getMD5fromFileName(String fileName) {
|
||||
int position = fileName.lastIndexOf("/");
|
||||
return fileName.substring(position + 9, fileName.length() - 4);
|
||||
return fileName.substring(position + 13, fileName.length() - 4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user