version:2.0.9
update: fix:适配展锐桌面图标隐藏,部分图标隐藏后无法显示 add:
This commit is contained in:
@@ -41,16 +41,16 @@ android {
|
|||||||
//新平台正式
|
//新平台正式
|
||||||
newly {
|
newly {
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
versionCode 508
|
versionCode 509
|
||||||
//versionCode 1037
|
//versionCode 1037
|
||||||
versionName "2.0.8"
|
versionName "2.0.9"
|
||||||
/*********************************极光推送************************************/
|
/*********************************极光推送************************************/
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
||||||
JPUSH_APPKEY : "20f70bbeb78bad23eddd08d0", //JPush上注册的包名对应的appkey.
|
JPUSH_APPKEY : "20f70bbeb78bad23eddd08d0", //JPush上注册的包名对应的appkey.
|
||||||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||||||
channel_value: "newly" ,
|
channel_value: "newly" ,
|
||||||
AMAP_KEY: "546eb5646a65ac6a5b7d1c7456466e05"
|
// AMAP_KEY: "546eb5646a65ac6a5b7d1c7456466e05"
|
||||||
]
|
]
|
||||||
/*********************************极光推送end************************************/
|
/*********************************极光推送end************************************/
|
||||||
buildConfigField "String", "ROOT_URL", '"http://name.jiaoguanyi.cn/api/"'
|
buildConfigField "String", "ROOT_URL", '"http://name.jiaoguanyi.cn/api/"'
|
||||||
@@ -68,48 +68,48 @@ android {
|
|||||||
JPUSH_APPKEY : "52d81643665bb2cadacf0e9e", //JPush上注册的包名对应的appkey.
|
JPUSH_APPKEY : "52d81643665bb2cadacf0e9e", //JPush上注册的包名对应的appkey.
|
||||||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||||||
channel_value: "beta" ,
|
channel_value: "beta" ,
|
||||||
AMAP_KEY: "5b68c8ee39800ff700a3762b6e028b78"
|
// AMAP_KEY: "5b68c8ee39800ff700a3762b6e028b78"
|
||||||
]
|
]
|
||||||
/*********************************极光推送end************************************/
|
/*********************************极光推送end************************************/
|
||||||
buildConfigField "String", "ROOT_URL", '"http://name.uiuios.com/api/"'
|
buildConfigField "String", "ROOT_URL", '"http://name.uiuios.com/api/"'
|
||||||
buildConfigField "String", "WebsocketURL", '"ws://39.108.116.195:2345"'
|
buildConfigField "String", "WebsocketURL", '"ws://39.108.116.195:2345"'
|
||||||
}
|
}
|
||||||
|
|
||||||
//老平台正式
|
// //老平台正式
|
||||||
official {
|
// official {
|
||||||
flavorDimensions "default"
|
// flavorDimensions "default"
|
||||||
versionCode 1038
|
// versionCode 1038
|
||||||
versionName "2.0.3.8"
|
// versionName "2.0.3.8"
|
||||||
/*********************************极光推送************************************/
|
// /*********************************极光推送************************************/
|
||||||
manifestPlaceholders = [
|
// manifestPlaceholders = [
|
||||||
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
// JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
||||||
JPUSH_APPKEY : "20f70bbeb78bad23eddd08d0", //JPush上注册的包名对应的appkey.
|
// JPUSH_APPKEY : "20f70bbeb78bad23eddd08d0", //JPush上注册的包名对应的appkey.
|
||||||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
// JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||||||
channel_value: "official",
|
// channel_value: "official",
|
||||||
AMAP_KEY: "5b68c8ee39800ff700a3762b6e028b78"
|
// AMAP_KEY: "5b68c8ee39800ff700a3762b6e028b78"
|
||||||
]
|
// ]
|
||||||
/*********************************极光推送end************************************/
|
// /*********************************极光推送end************************************/
|
||||||
buildConfigField "String", "ROOT_URL", '"http://partner.jiaoguanyi.com/api/"'
|
// buildConfigField "String", "ROOT_URL", '"http://partner.jiaoguanyi.com/api/"'
|
||||||
buildConfigField "String", "WebsocketURL", '"ws://47.107.133.19:1234"'
|
// buildConfigField "String", "WebsocketURL", '"ws://47.107.133.19:1234"'
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
//中优
|
// //中优
|
||||||
zhongyou {
|
// zhongyou {
|
||||||
flavorDimensions "default"
|
// flavorDimensions "default"
|
||||||
versionCode 1
|
// versionCode 1
|
||||||
versionName "1.0"//测试jiaoguanyi.cn
|
// versionName "1.0"//测试jiaoguanyi.cn
|
||||||
/*********************************极光推送************************************/
|
// /*********************************极光推送************************************/
|
||||||
manifestPlaceholders = [
|
// manifestPlaceholders = [
|
||||||
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
// JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
||||||
JPUSH_APPKEY : "a98c8a210687b4bb43c39c39", //JPush上注册的包名对应的appkey.
|
// JPUSH_APPKEY : "a98c8a210687b4bb43c39c39", //JPush上注册的包名对应的appkey.
|
||||||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
// JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||||||
channel_value: "zhongyou" ,
|
// channel_value: "zhongyou" ,
|
||||||
AMAP_KEY: "5b68c8ee39800ff700a3762b6e028b78"
|
// AMAP_KEY: "5b68c8ee39800ff700a3762b6e028b78"
|
||||||
]
|
// ]
|
||||||
/*********************************极光推送end************************************/
|
// /*********************************极光推送end************************************/
|
||||||
buildConfigField "String", "ROOT_URL", '"https://jgy.jundunxueyuan.com/api/"'
|
// buildConfigField "String", "ROOT_URL", '"https://jgy.jundunxueyuan.com/api/"'
|
||||||
buildConfigField "String", "WebsocketURL", '"ws://39.98.59.202:2345"'
|
// buildConfigField "String", "WebsocketURL", '"ws://39.98.59.202:2345"'
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -170,6 +170,9 @@ android {
|
|||||||
zhanRuiRelease {
|
zhanRuiRelease {
|
||||||
buildConfigField "String", "platform", '"ZhanRui"'
|
buildConfigField "String", "platform", '"ZhanRui"'
|
||||||
signingConfig signingConfigs.zhanRui
|
signingConfig signingConfigs.zhanRui
|
||||||
|
manifestPlaceholders = [
|
||||||
|
AMAP_KEY: "546eb5646a65ac6a5b7d1c7456466e05"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
zhanRuiDebug.initWith(debug)
|
zhanRuiDebug.initWith(debug)
|
||||||
@@ -178,10 +181,16 @@ android {
|
|||||||
buildConfigField "String", "platform", '"ZhanRui"'
|
buildConfigField "String", "platform", '"ZhanRui"'
|
||||||
debuggable true
|
debuggable true
|
||||||
signingConfig signingConfigs.zhanRui
|
signingConfig signingConfigs.zhanRui
|
||||||
|
manifestPlaceholders = [
|
||||||
|
AMAP_KEY: "546eb5646a65ac6a5b7d1c7456466e05"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
debug {
|
debug {
|
||||||
buildConfigField "String", "platform", '"MTK"'
|
buildConfigField "String", "platform", '"MTK"'
|
||||||
|
manifestPlaceholders = [
|
||||||
|
AMAP_KEY: "5b68c8ee39800ff700a3762b6e028b78"
|
||||||
|
]
|
||||||
// 不显示Log
|
// 不显示Log
|
||||||
//buildConfigField "boolean", "LOG_DEBUG", "false"
|
//buildConfigField "boolean", "LOG_DEBUG", "false"
|
||||||
//
|
//
|
||||||
@@ -204,6 +213,9 @@ android {
|
|||||||
|
|
||||||
release {
|
release {
|
||||||
buildConfigField "String", "platform", '"MTK"'
|
buildConfigField "String", "platform", '"MTK"'
|
||||||
|
manifestPlaceholders = [
|
||||||
|
AMAP_KEY: "5b68c8ee39800ff700a3762b6e028b78"
|
||||||
|
]
|
||||||
//混淆
|
//混淆
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ import com.arialyy.aria.core.Aria;
|
|||||||
import com.blankj.utilcode.util.AppUtils;
|
import com.blankj.utilcode.util.AppUtils;
|
||||||
import com.blankj.utilcode.util.EncryptUtils;
|
import com.blankj.utilcode.util.EncryptUtils;
|
||||||
import com.blankj.utilcode.util.PathUtils;
|
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.OkGo;
|
||||||
import com.lzy.okgo.callback.StringCallback;
|
import com.lzy.okgo.callback.StringCallback;
|
||||||
import com.mjsheng.myappstore.BuildConfig;
|
import com.mjsheng.myappstore.BuildConfig;
|
||||||
@@ -67,6 +69,7 @@ import com.mjsheng.myappstore.utils.Utils;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
@@ -1222,7 +1225,11 @@ public class DiscardActivity extends AppCompatActivity {
|
|||||||
BaseApplication.getInstance().checkIsDownloading();
|
BaseApplication.getInstance().checkIsDownloading();
|
||||||
if (!BaseApplication.getInstance().isDownloading()) {
|
if (!BaseApplication.getInstance().isDownloading()) {
|
||||||
Aria.download(this).removeAllTask(true);
|
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 {
|
} else {
|
||||||
Aria.download(this).resumeAllTask();
|
Aria.download(this).resumeAllTask();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import android.os.Bundle;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
|
|
||||||
@@ -50,7 +51,7 @@ public class HomeActivity extends AppCompatActivity {
|
|||||||
// setWebView();
|
// setWebView();
|
||||||
// hideStatusBar();
|
// hideStatusBar();
|
||||||
Log.e(TAG, "DebugTest: " + HttpHeaders.getUserAgent());
|
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: " + Settings.System.getString(getContentResolver(), "qch_launcher_icon_app"));
|
||||||
Log.e(TAG, "DebugTest: qch_hide_NavigationBar: " + Settings.System.getString(getContentResolver(), "qch_hide_NavigationBar"));
|
Log.e(TAG, "DebugTest: qch_hide_NavigationBar: " + Settings.System.getString(getContentResolver(), "qch_hide_NavigationBar"));
|
||||||
// try {
|
// try {
|
||||||
@@ -59,7 +60,7 @@ public class HomeActivity extends AppCompatActivity {
|
|||||||
// e.printStackTrace();
|
// e.printStackTrace();
|
||||||
// Log.e(TAG, "DebugTest: " + e.getMessage());
|
// Log.e(TAG, "DebugTest: " + e.getMessage());
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
private void hideStatusBar() {
|
private void hideStatusBar() {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import com.google.gson.Gson;
|
|||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.mjsheng.myappstore.BuildConfig;
|
import com.mjsheng.myappstore.BuildConfig;
|
||||||
import com.mjsheng.myappstore.base.BaseApplication;
|
import com.mjsheng.myappstore.base.BaseApplication;
|
||||||
import com.mjsheng.myappstore.bean.Appground;
|
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.LogoImg;
|
||||||
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
|
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
|
||||||
import com.mjsheng.myappstore.bean.NewAppground;
|
import com.mjsheng.myappstore.bean.NewAppground;
|
||||||
|
import com.mjsheng.myappstore.bean.SplitApks;
|
||||||
import com.mjsheng.myappstore.bean.StudentsInfo;
|
import com.mjsheng.myappstore.bean.StudentsInfo;
|
||||||
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
|
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
|
||||||
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
||||||
@@ -44,6 +46,7 @@ import com.mjsheng.myappstore.utils.URLUtils;
|
|||||||
import com.mjsheng.myappstore.utils.Utils;
|
import com.mjsheng.myappstore.utils.Utils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -63,6 +66,7 @@ import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* MainActivity和MainService 的 Presenter
|
* MainActivity和MainService 的 Presenter
|
||||||
|
*
|
||||||
* @author jgy02
|
* @author jgy02
|
||||||
*/
|
*/
|
||||||
public class MainPresenter implements MainContact.Presenter {
|
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());
|
SPUtils.put(mContext, "admin_id", studentsInfoBaseResponse.data.getAdmin_id());
|
||||||
} else {
|
} 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());
|
Log.e("getStudesInfo", "onNext: " + studentsInfoBaseResponse.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -677,7 +684,7 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
JGYUtils.getInstance().writeAppPackageList(mContext, data);
|
JGYUtils.getInstance().writeAppPackageList(mContext, data);
|
||||||
mView.getAppLimitFinished(data);
|
mView.getAppLimitFinished(data);
|
||||||
} else {
|
} else {
|
||||||
mView.getAppLimitFinished("");
|
// mView.getAppLimitFinished("");
|
||||||
boolean write = Settings.System.putString(mContext.getContentResolver(), "only_jgy_shortcut_list", "");
|
boolean write = Settings.System.putString(mContext.getContentResolver(), "only_jgy_shortcut_list", "");
|
||||||
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||||
Log.e("getAppLimit", "onNext: " + bodyString);
|
Log.e("getAppLimit", "onNext: " + bodyString);
|
||||||
@@ -733,7 +740,8 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
// if (null != batchList && batchList.size() > 1) {
|
// if (null != batchList && batchList.size() > 1) {
|
||||||
// Log.e("getDeviceBatch", "onNext: " + "deleteOtherApp");
|
// Log.e("getDeviceBatch", "onNext: " + "deleteOtherApp");
|
||||||
// if (!BuildConfig.DEBUG) {
|
// if (!BuildConfig.DEBUG) {
|
||||||
JGYUtils.getInstance().deleteOtherApp(packageList);
|
//暂时屏蔽
|
||||||
|
// JGYUtils.getInstance().deleteOtherApp(packageList);
|
||||||
// }
|
// }
|
||||||
// } else {
|
// } else {
|
||||||
// Log.e("getDeviceBatch", "批次为空");
|
// Log.e("getDeviceBatch", "批次为空");
|
||||||
@@ -781,7 +789,11 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
BaseApplication.getInstance().checkIsDownloading();
|
BaseApplication.getInstance().checkIsDownloading();
|
||||||
if (!BaseApplication.getInstance().isDownloading()) {
|
if (!BaseApplication.getInstance().isDownloading()) {
|
||||||
// Aria.download(this).removeAllTask(true);
|
// 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 {
|
} else {
|
||||||
Aria.download(this).resumeAllTask();
|
Aria.download(this).resumeAllTask();
|
||||||
}
|
}
|
||||||
@@ -1071,13 +1083,16 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
for (String pack : newList) {
|
for (String pack : newList) {
|
||||||
try {
|
try {
|
||||||
// TODO: 2021/5/24 需要后端替换包名,暂时解决方案
|
// TODO: 2021/5/24 需要后端替换包名,暂时解决方案
|
||||||
if ("com.mediatek.camera".equals(pack)) {
|
try {
|
||||||
pm.setApplicationEnabledSetting("com.android.camera2", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
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);
|
pm.setApplicationEnabledSetting(pack, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||||
Log.e("getDesktopIcon", pack);
|
Log.e("getDesktopIcon", pack);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -1235,21 +1250,21 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
NetInterfaceManager.getInstance()
|
NetInterfaceManager.getInstance()
|
||||||
.getNewAppinsideWebObservable()
|
.getNewAppinsideWebObservable()
|
||||||
.observeOn(Schedulers.io())
|
.observeOn(Schedulers.io())
|
||||||
.subscribe(new Observer<BaseResponse<List<NewAppground>>>() {
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
Log.e("getNewAppinsideWeb", "onSubscribe: ");
|
Log.e("getNewAppinsideWeb", "onSubscribe: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull BaseResponse<List<NewAppground>> listBaseResponse) {
|
public void onNext(@NonNull BaseResponse listBaseResponse) {
|
||||||
Log.e("getNewAppinsideWeb", "onNext: ");
|
Log.e("getNewAppinsideWeb", "onNext: ");
|
||||||
JGYUtils.getInstance().setNewAppinsideWeb(listBaseResponse);
|
JGYUtils.getInstance().setNewAppinsideWeb(listBaseResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onError(@NonNull Throwable e) {
|
||||||
Log.e("getNewAppinsideWeb", "onError: ");
|
Log.e("getNewAppinsideWeb", "onError: " + e.getMessage());
|
||||||
onComplete();
|
onComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1389,8 +1404,8 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Log.e("setLogoImg", "onError: " + e.getMessage());
|
||||||
onComplete();
|
onComplete();
|
||||||
Log.e("setLogoImg", "onError: ");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
* 来自:
|
* 来自:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ForceDownloadBean {
|
public class ForceDownloadBean<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* code : 200
|
* code : 200
|
||||||
@@ -20,7 +20,7 @@ public class ForceDownloadBean {
|
|||||||
private int code;
|
private int code;
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
private List<ForceDownloadData> data;
|
private T data;
|
||||||
|
|
||||||
public int getCode() {
|
public int getCode() {
|
||||||
return code;
|
return code;
|
||||||
@@ -38,11 +38,11 @@ public class ForceDownloadBean {
|
|||||||
this.msg = msg;
|
this.msg = msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ForceDownloadData> getData() {
|
public T getData() {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setData(List<ForceDownloadData> data) {
|
public void setData(T data) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,8 @@ public class AmapManager {
|
|||||||
} else {
|
} else {
|
||||||
//定位失败
|
//定位失败
|
||||||
sb.append("定位失败" + "\n");
|
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, "AmapAddress", "-"));
|
||||||
Log.e(TAG, (String) SPUtils.get(mContext, "AmapError", "-"));
|
Log.e(TAG, (String) SPUtils.get(mContext, "AmapError", "-"));
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ public class NetInterfaceManager {
|
|||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse<List<NewAppground>>> getNewAppinsideWebObservable() {
|
public Observable<BaseResponse> getNewAppinsideWebObservable() {
|
||||||
return mRetrofit
|
return mRetrofit
|
||||||
.create(NewAppinsideWebApi.class)
|
.create(NewAppinsideWebApi.class)
|
||||||
.getAppinsideWeb(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
.getAppinsideWeb(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||||
|
|||||||
@@ -765,18 +765,23 @@ public class HTTPInterface {
|
|||||||
String msg = jsonObject.getString("msg");
|
String msg = jsonObject.getString("msg");
|
||||||
String data = jsonObject.getString("data");
|
String data = jsonObject.getString("data");
|
||||||
ApkUtils.showAllAPP(context);
|
ApkUtils.showAllAPP(context);
|
||||||
Logger.e("setHideDesktopIcon", "data" + data);
|
Logger.e("setHideDesktopIcon", "data: " + data);
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
if (data != null && !"".equals(data)) {
|
if (data != null && !"".equals(data)) {
|
||||||
List<String> newList = Arrays.asList(data.split(","));//新的list
|
List<String> newList = Arrays.asList(data.split(","));//新的list
|
||||||
PackageManager pm = context.getPackageManager();
|
PackageManager pm = context.getPackageManager();
|
||||||
for (String pack : newList) {
|
for (String pack : newList) {
|
||||||
|
// TODO: 2021/5/24 需要后端替换包名,暂时解决方案
|
||||||
try {
|
try {
|
||||||
if ("com.mediatek.camera".equals(pack)){
|
try {
|
||||||
pm.setApplicationEnabledSetting("com.android.camera2", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
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);
|
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);
|
pm.setApplicationEnabledSetting(pack, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||||
Logger.e("setHideDesktopIcon", pack);
|
Logger.e("setHideDesktopIcon", pack);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import retrofit2.http.POST;
|
|||||||
public interface NewAppinsideWebApi {
|
public interface NewAppinsideWebApi {
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(URLAddress.SET_APPINSIDEWEB)
|
@POST(URLAddress.SET_APPINSIDEWEB)
|
||||||
Observable<BaseResponse<List<NewAppground>>> getAppinsideWeb(
|
Observable<BaseResponse> getAppinsideWeb(
|
||||||
@Field("key") String key,
|
@Field("key") String key,
|
||||||
@Field("sn") String sn
|
@Field("sn") String sn
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -648,21 +648,23 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
file.mkdirs();
|
file.mkdirs();
|
||||||
}
|
}
|
||||||
if (TextUtils.isEmpty(jsonString)) {
|
if (TextUtils.isEmpty(jsonString)) {
|
||||||
Log.e(TAG, "doDownloadAndInstall extras is null");
|
Log.e(TAG, "doDownloadAndInstall: extras is null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject jSONObject = JSON.parseObject(jsonString);
|
JSONObject jSONObject = JSON.parseObject(jsonString);
|
||||||
String app_name = jSONObject.getString("app_name");
|
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");
|
String app_url = jSONObject.getString("app_url");
|
||||||
int app_version_code = jSONObject.getInteger("app_version_code");
|
int app_version_code = jSONObject.getInteger("app_version_code");
|
||||||
String app_id = jSONObject.getString("app_id");
|
String app_id = jSONObject.getString("app_id");
|
||||||
|
String MD5 = jSONObject.getString("app_md5");
|
||||||
JSONObject packageObj = new JSONObject();
|
JSONObject packageObj = new JSONObject();
|
||||||
packageObj.put("app_name", app_name);
|
packageObj.put("app_name", app_name);
|
||||||
packageObj.put("app_package", app_package);
|
packageObj.put("app_package", app_package);
|
||||||
packageObj.put("app_id", app_id);
|
packageObj.put("app_id", app_id);
|
||||||
Log.e("mymjsheng", "app_package::" + app_package);
|
packageObj.put("MD5", MD5);
|
||||||
Log.e("mymjsheng", "app_url::" + app_url);
|
Log.e(TAG, "doDownloadAndInstall: app_package:" + app_package);
|
||||||
|
Log.e(TAG, "doDownloadAndInstall: app_url:" + app_url);
|
||||||
SaveListUtils.addList(app_package);
|
SaveListUtils.addList(app_package);
|
||||||
SaveListUtils.sendForceAPP(mContext);
|
SaveListUtils.sendForceAPP(mContext);
|
||||||
PackageManager pm = mContext.getPackageManager();
|
PackageManager pm = mContext.getPackageManager();
|
||||||
@@ -673,6 +675,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (packageInfo == null) {
|
if (packageInfo == null) {
|
||||||
|
Log.e(TAG, "doDownloadAndInstall: "+ app_package + "未安装");
|
||||||
if (!SaveListUtils.isDownLoading(app_url)) {
|
if (!SaveListUtils.isDownLoading(app_url)) {
|
||||||
// Aria.download(this)
|
// Aria.download(this)
|
||||||
// .load(app_url)
|
// .load(app_url)
|
||||||
@@ -698,6 +701,8 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
Utils.ariaDownload(mContext, app_url, packageObj);
|
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.BuildConfig;
|
||||||
import com.mjsheng.myappstore.network.HTTPInterface;
|
import com.mjsheng.myappstore.network.HTTPInterface;
|
||||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||||
|
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||||
import com.mjsheng.myappstore.utils.SaveListUtils;
|
import com.mjsheng.myappstore.utils.SaveListUtils;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@@ -36,8 +37,9 @@ public class NewAppReceiver extends BroadcastReceiver {
|
|||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
|
JGYUtils.getInstance().cleanLauncherCache();
|
||||||
Log.e(TAG, "onReceive: " + "action = " + action);
|
Log.e(TAG, "onReceive: " + "action = " + action);
|
||||||
String state = "";
|
String state;
|
||||||
if (TextUtils.isEmpty(action)) {
|
if (TextUtils.isEmpty(action)) {
|
||||||
Log.e(TAG, "onReceive: " + "action is empty ");
|
Log.e(TAG, "onReceive: " + "action is empty ");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.arialyy.aria.core.Aria;
|
import com.arialyy.aria.core.Aria;
|
||||||
import com.blankj.utilcode.util.PathUtils;
|
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.mjsheng.myappstore.utils.JGYUtils;
|
||||||
import com.lzy.okgo.OkGo;
|
import com.lzy.okgo.OkGo;
|
||||||
import com.lzy.okgo.callback.StringCallback;
|
import com.lzy.okgo.callback.StringCallback;
|
||||||
@@ -65,6 +67,7 @@ import com.mjsheng.myappstore.utils.Utils;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@@ -821,7 +824,11 @@ public class DiscardServer extends Service {
|
|||||||
BaseApplication.getInstance().checkIsDownloading();
|
BaseApplication.getInstance().checkIsDownloading();
|
||||||
if (!BaseApplication.getInstance().isDownloading()) {
|
if (!BaseApplication.getInstance().isDownloading()) {
|
||||||
Aria.download(this).removeAllTask(true);
|
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 {
|
} else {
|
||||||
Aria.download(this).resumeAllTask();
|
Aria.download(this).resumeAllTask();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import android.os.BatteryManager;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.text.format.Formatter;
|
import android.text.format.Formatter;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -491,18 +492,22 @@ public class GuardService extends Service {
|
|||||||
String setting_usb = Settings.System.getString(getContentResolver(), "qch_usb_choose");
|
String setting_usb = Settings.System.getString(getContentResolver(), "qch_usb_choose");
|
||||||
Log.e("setDefaultUSBStatus", "setting_usb---------" + setting_usb);
|
Log.e("setDefaultUSBStatus", "setting_usb---------" + setting_usb);
|
||||||
String usbStatus = "";
|
String usbStatus = "";
|
||||||
switch (setting_usb) {
|
if (TextUtils.isEmpty(setting_usb)) {
|
||||||
case "usb_charge":
|
usbStatus = "qch_action_usb_usb_charge";
|
||||||
usbStatus = "qch_action_usb_usb_charge";
|
} else {
|
||||||
break;
|
switch (setting_usb) {
|
||||||
case "usb_mtp":
|
case "usb_charge":
|
||||||
usbStatus = "qch_action_usb_usb_mtp";
|
usbStatus = "qch_action_usb_usb_charge";
|
||||||
break;
|
break;
|
||||||
case "usb_midi":
|
case "usb_mtp":
|
||||||
usbStatus = "qch_action_usb_usb_midi";
|
usbStatus = "qch_action_usb_usb_mtp";
|
||||||
break;
|
break;
|
||||||
default:
|
case "usb_midi":
|
||||||
break;
|
usbStatus = "qch_action_usb_usb_midi";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
|
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
|
||||||
sendBroadcast(usbIntent);
|
sendBroadcast(usbIntent);
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ public class MainService extends Service implements MainContact.MainView {
|
|||||||
mPresenter = new MainPresenter(this);
|
mPresenter = new MainPresenter(this);
|
||||||
mPresenter.attachView(this);
|
mPresenter.attachView(this);
|
||||||
if ((int) SPUtils.get(this, "first_connect", 0) == 0) {
|
if ((int) SPUtils.get(this, "first_connect", 0) == 0) {
|
||||||
|
// TODO: 2021/5/26 待底层修改,临时解决办法
|
||||||
Log.e(TAG, "onCreate: " + "Disable All Settings");
|
Log.e(TAG, "onCreate: " + "Disable All Settings");
|
||||||
mPresenter.setDisableSetting();
|
mPresenter.setDisableSetting();
|
||||||
}
|
}
|
||||||
@@ -154,19 +155,6 @@ public class MainService extends Service implements MainContact.MainView {
|
|||||||
return START_STICKY;
|
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() {
|
private void addShortcut() {
|
||||||
ApkUtils.addShortcut(MainService.this);
|
ApkUtils.addShortcut(MainService.this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -656,8 +656,8 @@ public class ApkUtils {
|
|||||||
return applicationInfos;
|
return applicationInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//预置的可以卸载的系统应用,判断出来为第三方
|
||||||
public static List<String> canremove_systemapp = new ArrayList<String>() {{
|
public static List<String> canremove_systemapp = new ArrayList<String>() {{
|
||||||
//预置的可以卸载的系统应用,判断出来为第三方
|
|
||||||
this.add("com.android.quicksearchbox");
|
this.add("com.android.quicksearchbox");
|
||||||
this.add("com.android.calendar");
|
this.add("com.android.calendar");
|
||||||
this.add("com.android.dreams.basic");
|
this.add("com.android.dreams.basic");
|
||||||
@@ -666,15 +666,15 @@ public class ApkUtils {
|
|||||||
this.add("com.jiaoguanyi.sysc");
|
this.add("com.jiaoguanyi.sysc");
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
//需要管控的系统可以卸载的应用
|
||||||
public static List<String> show_canremove_systemapp = new ArrayList<String>() {{
|
public static List<String> show_canremove_systemapp = new ArrayList<String>() {{
|
||||||
//需要管控的系统可以卸载的应用
|
|
||||||
this.add("com.android.calendar");
|
this.add("com.android.calendar");
|
||||||
this.add("com.android.email");
|
this.add("com.android.email");
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|
||||||
|
//需要管控的系统应用
|
||||||
public static List<String> systemapp = new ArrayList<String>() {{
|
public static List<String> systemapp = new ArrayList<String>() {{
|
||||||
//需要管控的系统应用
|
|
||||||
this.add("com.android.gallery3d");//图库
|
this.add("com.android.gallery3d");//图库
|
||||||
this.add("com.android.settings");//图库
|
this.add("com.android.settings");//图库
|
||||||
this.add("com.android.deskclock");//时钟
|
this.add("com.android.deskclock");//时钟
|
||||||
@@ -694,13 +694,23 @@ public class ApkUtils {
|
|||||||
this.add("com.easyclient.activity");//移动课堂
|
this.add("com.easyclient.activity");//移动课堂
|
||||||
this.add("com.jiandan.mobilelesson");//简单课堂
|
this.add("com.jiandan.mobilelesson");//简单课堂
|
||||||
this.add("com.jiaoguanyi.store");//教官壹
|
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>() {{
|
public static List<String> desktopAPP = new ArrayList<String>() {{
|
||||||
this.add("com.uiuios.jgy1");
|
this.add("com.uiuios.jgy1");
|
||||||
this.add("com.uiuios.jgy2");
|
this.add("com.uiuios.jgy2");
|
||||||
|
this.add("com.android.uiuios");
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
//出厂自带的app
|
||||||
public static List<String> factoryapp = new ArrayList<String>() {{
|
public static List<String> factoryapp = new ArrayList<String>() {{
|
||||||
this.add("com.android.fmradio");
|
this.add("com.android.fmradio");
|
||||||
this.add("com.mediatek.gba");
|
this.add("com.mediatek.gba");
|
||||||
@@ -893,12 +903,20 @@ public class ApkUtils {
|
|||||||
//7.0是系统应用
|
//7.0是系统应用
|
||||||
if (show_canremove_systemapp.contains(packageInfo.packageName)) {
|
if (show_canremove_systemapp.contains(packageInfo.packageName)) {
|
||||||
// Logger.e("showAllAPP2", "packageName:" + 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 {
|
} else {
|
||||||
// Logger.e("showAllAPP", "packageName:" + packageInfo.packageName);
|
// 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);
|
hideSystemSettingAPP(context, packageInfo.packageName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1050,6 +1068,9 @@ public class ApkUtils {
|
|||||||
if ("com.jiaoguanyi.store".equals(s) || "com.jiaoguanyi.appstore".equals(s)) {
|
if ("com.jiaoguanyi.store".equals(s) || "com.jiaoguanyi.appstore".equals(s)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!ApkUtils.isSystemApp(context, s)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!ApkUtils.isAvailable(context, s)) {
|
if (!ApkUtils.isAvailable(context, s)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1093,6 +1114,10 @@ public class ApkUtils {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (desktopAPP.contains(packageInfo.packageName)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (JGYUtils.getInstance().checkAppPlatform() == 2) {
|
if (JGYUtils.getInstance().checkAppPlatform() == 2) {
|
||||||
if ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
if ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import android.provider.Settings;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.blankj.utilcode.util.FileUtils;
|
import com.blankj.utilcode.util.FileUtils;
|
||||||
import com.blankj.utilcode.util.PathUtils;
|
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) {
|
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 whiteList = new StringBuilder();
|
||||||
StringBuilder blackList = new StringBuilder();
|
StringBuilder blackList = new StringBuilder();
|
||||||
StringBuilder packageList = new StringBuilder();//单条管控名单
|
StringBuilder packageList = new StringBuilder();//单条管控名单
|
||||||
@@ -666,6 +668,11 @@ public class JGYUtils {
|
|||||||
String app_url = jsonObject.getString("app_url");
|
String app_url = jsonObject.getString("app_url");
|
||||||
String app_package = jsonObject.getString("app_package");
|
String app_package = jsonObject.getString("app_package");
|
||||||
int app_version_code = jsonObject.getInteger("app_version_code");
|
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;
|
PackageInfo info = null;
|
||||||
PackageManager packageManager = mContext.getPackageManager();
|
PackageManager packageManager = mContext.getPackageManager();
|
||||||
if (null != packageManager) {
|
if (null != packageManager) {
|
||||||
@@ -986,4 +993,20 @@ public class JGYUtils {
|
|||||||
getAppPlatformCallback.AppPlatform(UnknowPlatform);
|
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() {
|
public static List<String> getList() {
|
||||||
String data = SPStaticUtils.getString(CommonDatas.FORCE_INSTALL);
|
String data = SPStaticUtils.getString(CommonDatas.FORCE_INSTALL);
|
||||||
Log.e("mjshenglistdata", data);
|
Log.e("SaveListUtils", data);
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
Type listType = new TypeToken<List<String>>() {
|
Type listType = new TypeToken<List<String>>() {
|
||||||
}.getType();
|
}.getType();
|
||||||
|
|||||||
@@ -949,7 +949,7 @@ public class Utils {
|
|||||||
|
|
||||||
private static String getMD5fromFileName(String fileName) {
|
private static String getMD5fromFileName(String fileName) {
|
||||||
int position = fileName.lastIndexOf("/");
|
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