version:2.3
fix:优化上传请求 update:增加获取内置应用白名单
This commit is contained in:
@@ -73,8 +73,8 @@ android {
|
|||||||
|
|
||||||
official {
|
official {
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
versionCode 13
|
versionCode 14
|
||||||
versionName "2.2"
|
versionName "2.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
17
app/src/main/java/com/fuying/sn/bean/AppAndWhiteBean.java
Normal file
17
app/src/main/java/com/fuying/sn/bean/AppAndWhiteBean.java
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package com.fuying.sn.bean;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class AppAndWhiteBean implements Serializable {
|
||||||
|
private static final long serialVersionUID = 3896715165027188298L;
|
||||||
|
|
||||||
|
String app_package;
|
||||||
|
|
||||||
|
public String getApp_package() {
|
||||||
|
return app_package;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApp_package(String app_package) {
|
||||||
|
this.app_package = app_package;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@ import android.util.Log;
|
|||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
import com.fuying.sn.BuildConfig;
|
import com.fuying.sn.BuildConfig;
|
||||||
|
import com.fuying.sn.bean.AppAndWhiteBean;
|
||||||
import com.fuying.sn.bean.AppInfo;
|
import com.fuying.sn.bean.AppInfo;
|
||||||
import com.fuying.sn.bean.AppJump;
|
import com.fuying.sn.bean.AppJump;
|
||||||
import com.fuying.sn.bean.AppStart;
|
import com.fuying.sn.bean.AppStart;
|
||||||
@@ -53,6 +54,7 @@ import com.fuying.sn.network.api.BrowserLabel;
|
|||||||
import com.fuying.sn.network.api.CloudLessonSettingApi;
|
import com.fuying.sn.network.api.CloudLessonSettingApi;
|
||||||
import com.fuying.sn.network.api.ForceInstall;
|
import com.fuying.sn.network.api.ForceInstall;
|
||||||
import com.fuying.sn.network.api.GetAdminAppApi;
|
import com.fuying.sn.network.api.GetAdminAppApi;
|
||||||
|
import com.fuying.sn.network.api.GetAppAndWhiteApi;
|
||||||
import com.fuying.sn.network.api.GetBatchApi;
|
import com.fuying.sn.network.api.GetBatchApi;
|
||||||
import com.fuying.sn.network.api.GetControlScreenshotApi;
|
import com.fuying.sn.network.api.GetControlScreenshotApi;
|
||||||
import com.fuying.sn.network.api.GetGuideApi;
|
import com.fuying.sn.network.api.GetGuideApi;
|
||||||
@@ -519,6 +521,13 @@ public class NetInterfaceManager {
|
|||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Observable<BaseResponse<List<AppAndWhiteBean>>> getAppAndWhiteApiObservable() {
|
||||||
|
return mRetrofit.create(GetAppAndWhiteApi.class)
|
||||||
|
.getAppAndWhite(Utils.getSerial())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* execution
|
* execution
|
||||||
@@ -793,16 +802,16 @@ public class NetInterfaceManager {
|
|||||||
this.add("com.fuying.sn");
|
this.add("com.fuying.sn");
|
||||||
this.add("com.uiui.health");
|
this.add("com.uiui.health");
|
||||||
this.add("com.uiui.city");
|
this.add("com.uiui.city");
|
||||||
//扶小鹰
|
|
||||||
this.add(JGYUtils.gkwxhd);
|
|
||||||
this.add(JGYUtils.fuxiaoying);
|
|
||||||
this.add(JGYUtils.moshujia);
|
|
||||||
this.add(JGYUtils.english);
|
|
||||||
this.add(JGYUtils.zhiduoke);
|
|
||||||
this.add(JGYUtils.aobama);
|
|
||||||
this.add(JGYUtils.growthspace);
|
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
private Set<String> getShowPackages() {
|
||||||
|
HashSet<String> pkgSet = new HashSet<>();
|
||||||
|
pkgSet.addAll(showPackages);
|
||||||
|
pkgSet.addAll(JGYUtils.getInstance().getFXYApp());
|
||||||
|
pkgSet.addAll(JGYUtils.getInstance().getAppAndWhite());
|
||||||
|
return pkgSet;
|
||||||
|
}
|
||||||
|
|
||||||
public static long getPackageSize(Context context, String filePath) {
|
public static long getPackageSize(Context context, String filePath) {
|
||||||
long size = new File(filePath).length();
|
long size = new File(filePath).length();
|
||||||
return size;
|
return size;
|
||||||
@@ -826,15 +835,22 @@ public class NetInterfaceManager {
|
|||||||
pkgs.add(info.activityInfo.packageName);
|
pkgs.add(info.activityInfo.packageName);
|
||||||
}
|
}
|
||||||
Log.e("SendAppInstallInfo", "pkgs: " + pkgs);
|
Log.e("SendAppInstallInfo", "pkgs: " + pkgs);
|
||||||
|
Set<String> showPkg = getShowPackages();
|
||||||
|
Log.e("SendAppInstallInfo", "showPkg: " + showPkg);
|
||||||
for (PackageInfo info : list) {
|
for (PackageInfo info : list) {
|
||||||
//排除掉部分系统应用
|
//排除掉部分系统应用
|
||||||
if (ApkUtils.isSystemApp(mContext, info.packageName) && !showPackages.contains(info.packageName)) {
|
if (ApkUtils.isSystemApp(mContext, info.packageName)) {
|
||||||
|
if (!showPkg.contains(info.packageName)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (!showPkg.contains(info.packageName)) {
|
||||||
//排除掉没有图标的应用
|
//排除掉没有图标的应用
|
||||||
if (!pkgs.contains(info.packageName)) {
|
if (!pkgs.contains(info.packageName)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
AppUploadInfo uploadInfo = new AppUploadInfo();
|
AppUploadInfo uploadInfo = new AppUploadInfo();
|
||||||
uploadInfo.setApp_name(info.applicationInfo.loadLabel(pm).toString());
|
uploadInfo.setApp_name(info.applicationInfo.loadLabel(pm).toString());
|
||||||
uploadInfo.setApp_package(info.packageName);
|
uploadInfo.setApp_package(info.packageName);
|
||||||
@@ -1106,7 +1122,9 @@ public class NetInterfaceManager {
|
|||||||
getUpdateObservable(JGYUtils.zhiduoke),
|
getUpdateObservable(JGYUtils.zhiduoke),
|
||||||
getUpdateObservable(JGYUtils.aobama),
|
getUpdateObservable(JGYUtils.aobama),
|
||||||
getUpdateObservable(JGYUtils.growthspace),
|
getUpdateObservable(JGYUtils.growthspace),
|
||||||
(appInfoBaseResponse, appInfoBaseResponse2, appInfoBaseResponse3, appInfoBaseResponse4, appInfoBaseResponse5, appInfoBaseResponse6, appInfoBaseResponse7) -> {
|
getUpdateObservable(JGYUtils.pandaabc),
|
||||||
|
getUpdateObservable(JGYUtils.qibenyi),
|
||||||
|
(appInfoBaseResponse, appInfoBaseResponse2, appInfoBaseResponse3, appInfoBaseResponse4, appInfoBaseResponse5, appInfoBaseResponse6, appInfoBaseResponse7, appInfoBaseResponse8, appInfoBaseResponse9) -> {
|
||||||
List<AppInfo> appInfoList = new ArrayList<>();
|
List<AppInfo> appInfoList = new ArrayList<>();
|
||||||
if (appInfoBaseResponse.code == 200) {
|
if (appInfoBaseResponse.code == 200) {
|
||||||
appInfoList.add(appInfoBaseResponse.data);
|
appInfoList.add(appInfoBaseResponse.data);
|
||||||
@@ -1129,6 +1147,12 @@ public class NetInterfaceManager {
|
|||||||
if (appInfoBaseResponse7.code == 200) {
|
if (appInfoBaseResponse7.code == 200) {
|
||||||
appInfoList.add(appInfoBaseResponse7.data);
|
appInfoList.add(appInfoBaseResponse7.data);
|
||||||
}
|
}
|
||||||
|
if (appInfoBaseResponse8.code == 200) {
|
||||||
|
appInfoList.add(appInfoBaseResponse7.data);
|
||||||
|
}
|
||||||
|
if (appInfoBaseResponse9.code == 200) {
|
||||||
|
appInfoList.add(appInfoBaseResponse7.data);
|
||||||
|
}
|
||||||
return appInfoList;
|
return appInfoList;
|
||||||
})
|
})
|
||||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||||
@@ -2921,8 +2945,7 @@ public class NetInterfaceManager {
|
|||||||
@Override
|
@Override
|
||||||
public HashSet<AppInfo> apply(BaseResponse<List<AppInfo>> listBaseResponse1, BaseResponse<List<AppInfo>> listBaseResponse2) throws Throwable {
|
public HashSet<AppInfo> apply(BaseResponse<List<AppInfo>> listBaseResponse1, BaseResponse<List<AppInfo>> listBaseResponse2) throws Throwable {
|
||||||
HashSet<AppInfo> appInfos = new HashSet<>();
|
HashSet<AppInfo> appInfos = new HashSet<>();
|
||||||
int code1 = listBaseResponse1.code;
|
if (listBaseResponse1.code == 200) {
|
||||||
if (code1 == 200) {
|
|
||||||
List<AppInfo> appInfos1 = listBaseResponse1.data;
|
List<AppInfo> appInfos1 = listBaseResponse1.data;
|
||||||
if (appInfos1 != null && appInfos1.size() != 0) {
|
if (appInfos1 != null && appInfos1.size() != 0) {
|
||||||
appInfos.addAll(appInfos1);
|
appInfos.addAll(appInfos1);
|
||||||
@@ -2932,8 +2955,7 @@ public class NetInterfaceManager {
|
|||||||
Log.e("getAppWhiteList", "onNext: " + allPkgString);
|
Log.e("getAppWhiteList", "onNext: " + allPkgString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int code2 = listBaseResponse2.code;
|
if (listBaseResponse2.code == 200) {
|
||||||
if (code2 == 200) {
|
|
||||||
List<AppInfo> appInfos2 = listBaseResponse2.data;
|
List<AppInfo> appInfos2 = listBaseResponse2.data;
|
||||||
if (appInfos2 != null) {
|
if (appInfos2 != null) {
|
||||||
appInfos.addAll(appInfos2);
|
appInfos.addAll(appInfos2);
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ public class UrlAddress {
|
|||||||
//不需要在后台添加sn的接口
|
//不需要在后台添加sn的接口
|
||||||
/*获取所有全局更新*/
|
/*获取所有全局更新*/
|
||||||
public final static String GE_TOVERALL_APPBYPLATFORM = "app/overallAppByPlatform";
|
public final static String GE_TOVERALL_APPBYPLATFORM = "app/overallAppByPlatform";
|
||||||
|
/*获取应用内置白名单*/
|
||||||
|
public static final String GET_APP_AND_WHITE = "getAppAndWhite";
|
||||||
/*获取管理员上传的应用*/
|
/*获取管理员上传的应用*/
|
||||||
public final static String GET_ADMIN_APP = "getAdminApp";
|
public final static String GET_ADMIN_APP = "getAdminApp";
|
||||||
/*根据包名获取更新*/
|
/*根据包名获取更新*/
|
||||||
@@ -90,9 +92,7 @@ public class UrlAddress {
|
|||||||
/*在线状态*/
|
/*在线状态*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public final static String SEND_DRIVE_STATE = "Online/online";
|
public final static String SEND_DRIVE_STATE = "Online/online";
|
||||||
/*获取应用白名单*/
|
|
||||||
@Deprecated
|
|
||||||
public static final String GET_APP_AND_WHITE = "getAppAndWhite";
|
|
||||||
|
|
||||||
/*获取公网IP*/
|
/*获取公网IP*/
|
||||||
public static final String SHOUHU_CITYJSON = "http://pv.sohu.com/cityjson/";
|
public static final String SHOUHU_CITYJSON = "http://pv.sohu.com/cityjson/";
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.fuying.sn.network.api;
|
||||||
|
|
||||||
|
import com.fuying.sn.bean.AppAndWhiteBean;
|
||||||
|
import com.fuying.sn.bean.BaseResponse;
|
||||||
|
import com.fuying.sn.network.UrlAddress;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface GetAppAndWhiteApi {
|
||||||
|
@GET(UrlAddress.GET_APP_AND_WHITE)
|
||||||
|
Observable<BaseResponse<List<AppAndWhiteBean>>> getAppAndWhite(
|
||||||
|
@Query("sn") String sn
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -106,7 +106,7 @@ public class APKinstallReceiver extends BroadcastReceiver {
|
|||||||
NetInterfaceManager.getInstance().getAppInside();
|
NetInterfaceManager.getInstance().getAppInside();
|
||||||
}
|
}
|
||||||
NetInterfaceManager.getInstance().SendAppInstallInfo();
|
NetInterfaceManager.getInstance().SendAppInstallInfo();
|
||||||
MainService.getPresenter().getAllApp();
|
MainService.getPresenter().getAppAndWhite();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public class MainSContact {
|
|||||||
void updateInfoFinish();
|
void updateInfoFinish();
|
||||||
void checkUpdateFinish();
|
void checkUpdateFinish();
|
||||||
void checkFXYUpdateFinish();
|
void checkFXYUpdateFinish();
|
||||||
void getAllAppFinish();
|
void getAppAndWhiteFinish();
|
||||||
void setOverallApp();
|
void setOverallApp();
|
||||||
void setAppInside();
|
void setAppInside();
|
||||||
void setForceInstall();
|
void setForceInstall();
|
||||||
@@ -33,7 +33,7 @@ public class MainSContact {
|
|||||||
|
|
||||||
/*更新的*/
|
/*更新的*/
|
||||||
//获取所有app包名
|
//获取所有app包名
|
||||||
void getAllApp();
|
void getAppAndWhite();
|
||||||
//检查更新
|
//检查更新
|
||||||
void checkUpdate();
|
void checkUpdate();
|
||||||
//检查扶小鹰App更新
|
//检查扶小鹰App更新
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.fuying.sn.service.main;
|
package com.fuying.sn.service.main;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.fuying.sn.bean.AppAndWhiteBean;
|
||||||
import com.fuying.sn.bean.AppStart;
|
import com.fuying.sn.bean.AppStart;
|
||||||
import com.fuying.sn.bean.BaseResponse;
|
import com.fuying.sn.bean.BaseResponse;
|
||||||
import com.fuying.sn.bean.MyAppUsageBean;
|
import com.fuying.sn.bean.MyAppUsageBean;
|
||||||
@@ -16,10 +16,12 @@ import com.fuying.sn.disklrucache.CacheHelper;
|
|||||||
import com.fuying.sn.gson.GsonUtils;
|
import com.fuying.sn.gson.GsonUtils;
|
||||||
import com.fuying.sn.manager.ControlManager;
|
import com.fuying.sn.manager.ControlManager;
|
||||||
import com.fuying.sn.network.NetInterfaceManager;
|
import com.fuying.sn.network.NetInterfaceManager;
|
||||||
|
import com.fuying.sn.network.UrlAddress;
|
||||||
import com.fuying.sn.service.ManagerService;
|
import com.fuying.sn.service.ManagerService;
|
||||||
import com.fuying.sn.utils.JGYUtils;
|
import com.fuying.sn.utils.JGYUtils;
|
||||||
import com.fuying.sn.utils.SPUtils;
|
import com.fuying.sn.utils.SPUtils;
|
||||||
import com.fuying.sn.utils.ServiceAliveUtils;
|
import com.fuying.sn.utils.ServiceAliveUtils;
|
||||||
|
import com.fuying.sn.utils.StringUtils;
|
||||||
import com.fuying.sn.utils.Utils;
|
import com.fuying.sn.utils.Utils;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
@@ -28,8 +30,10 @@ import com.trello.rxlifecycle4.RxLifecycle;
|
|||||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.rxjava3.annotations.NonNull;
|
||||||
import io.reactivex.rxjava3.core.Observer;
|
import io.reactivex.rxjava3.core.Observer;
|
||||||
import io.reactivex.rxjava3.disposables.Disposable;
|
import io.reactivex.rxjava3.disposables.Disposable;
|
||||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||||
@@ -73,9 +77,40 @@ public class MainSPresenter implements MainSContact.Presenter {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressLint("NewApi")
|
public void getAppAndWhite() {
|
||||||
public void getAllApp() {
|
NetInterfaceManager.getInstance()
|
||||||
mView.getAllAppFinish();
|
.getAppAndWhiteApiObservable()
|
||||||
|
.subscribe(new Observer<BaseResponse<List<AppAndWhiteBean>>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Log.e("getAppAndWhite", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseResponse<List<AppAndWhiteBean>> baseResponse) {
|
||||||
|
Log.e("getAppAndWhite", "onSubscribe: " + baseResponse);
|
||||||
|
if (baseResponse.code == 200) {
|
||||||
|
List<AppAndWhiteBean> appAndWhiteList = baseResponse.data;
|
||||||
|
if (appAndWhiteList != null) {
|
||||||
|
List<String> pkgList = appAndWhiteList.stream().map(AppAndWhiteBean::getApp_package).collect(Collectors.toList());
|
||||||
|
String pkgString = StringUtils.join(",", pkgList);
|
||||||
|
mMMKV.encode(UrlAddress.GET_APP_AND_WHITE, pkgString);
|
||||||
|
Log.e("getAppAndWhite", "onNext: " + pkgString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Log.e("getAppAndWhite", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("getAppAndWhite", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mView.getAppAndWhiteFinish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
public void run() {
|
public void run() {
|
||||||
if ((int) SPUtils.get(MainService.this, CommonConfig.JGY_FIRST_BOOT, 0) == 0) {
|
if ((int) SPUtils.get(MainService.this, CommonConfig.JGY_FIRST_BOOT, 0) == 0) {
|
||||||
mPresenter.getSnInfo();
|
mPresenter.getSnInfo();
|
||||||
mPresenter.getAllApp();
|
mPresenter.getAppAndWhite();
|
||||||
SPUtils.put(MainService.this, CommonConfig.JGY_FIRST_BOOT, 1);
|
SPUtils.put(MainService.this, CommonConfig.JGY_FIRST_BOOT, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -164,7 +164,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
public void run() {
|
public void run() {
|
||||||
NTPTimeTask task = new NTPTimeTask();
|
NTPTimeTask task = new NTPTimeTask();
|
||||||
task.execute("ntp.aliyun.com");
|
task.execute("ntp.aliyun.com");
|
||||||
mPresenter.getAllApp();
|
mPresenter.getAppAndWhite();
|
||||||
}
|
}
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
@@ -547,7 +547,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getAllAppFinish() {
|
public void getAppAndWhiteFinish() {
|
||||||
mPresenter.checkUpdate();
|
mPresenter.checkUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -706,7 +706,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
|||||||
break;
|
break;
|
||||||
case JIGUANG_BIND_UNBIND:
|
case JIGUANG_BIND_UNBIND:
|
||||||
ToastUtil.debugShow("老师授权/取消授权");
|
ToastUtil.debugShow("老师授权/取消授权");
|
||||||
MainService.getPresenter().getAllApp();
|
MainService.getPresenter().getAppAndWhite();
|
||||||
MainService.getPresenter().getForceInstall();
|
MainService.getPresenter().getForceInstall();
|
||||||
try {
|
try {
|
||||||
mCacheHelper.delete();
|
mCacheHelper.delete();
|
||||||
@@ -879,7 +879,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
|||||||
if (JGYUtils.getInstance().isScreenOn()) {
|
if (JGYUtils.getInstance().isScreenOn()) {
|
||||||
NetInterfaceManager.getInstance().screenshot();
|
NetInterfaceManager.getInstance().screenshot();
|
||||||
}
|
}
|
||||||
MainService.getPresenter().getAllApp();
|
MainService.getPresenter().getAppAndWhite();
|
||||||
MainService.getPresenter().getSnInfo();
|
MainService.getPresenter().getSnInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -860,6 +860,8 @@ public class ApkUtils {
|
|||||||
HashSet<String> factoryAppList = new HashSet<>();
|
HashSet<String> factoryAppList = new HashSet<>();
|
||||||
factoryAppList.addAll(JGYUtils.getInstance().getOwnApp());
|
factoryAppList.addAll(JGYUtils.getInstance().getOwnApp());
|
||||||
factoryAppList.addAll(JGYUtils.getInstance().getFXYApp());
|
factoryAppList.addAll(JGYUtils.getInstance().getFXYApp());
|
||||||
|
factoryAppList.addAll(JGYUtils.getInstance().getAppAndWhite());
|
||||||
|
Log.e("writeAppPackageList", "factoryAppList: " + factoryAppList);
|
||||||
if (!TextUtils.isEmpty(result)) {
|
if (!TextUtils.isEmpty(result)) {
|
||||||
HashSet<String> writeAppSet = new HashSet<>(Arrays.asList(result.split(",")));
|
HashSet<String> writeAppSet = new HashSet<>(Arrays.asList(result.split(",")));
|
||||||
writeAppSet.addAll(factoryAppList);
|
writeAppSet.addAll(factoryAppList);
|
||||||
|
|||||||
@@ -47,9 +47,11 @@ import com.fuying.sn.R;
|
|||||||
import com.fuying.sn.config.CommonConfig;
|
import com.fuying.sn.config.CommonConfig;
|
||||||
import com.fuying.sn.gson.GsonUtils;
|
import com.fuying.sn.gson.GsonUtils;
|
||||||
import com.fuying.sn.network.NetInterfaceManager;
|
import com.fuying.sn.network.NetInterfaceManager;
|
||||||
|
import com.fuying.sn.network.UrlAddress;
|
||||||
import com.fuying.sn.receiver.BootReceiver;
|
import com.fuying.sn.receiver.BootReceiver;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
|
import com.tencent.mmkv.MMKV;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
@@ -86,6 +88,7 @@ public class JGYUtils {
|
|||||||
private static JGYUtils sInstance;
|
private static JGYUtils sInstance;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private ContentResolver resolver;
|
private ContentResolver resolver;
|
||||||
|
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||||
|
|
||||||
public static int MTKPlatform = 1;
|
public static int MTKPlatform = 1;
|
||||||
public static int ZhanruiPlatform = 2;
|
public static int ZhanruiPlatform = 2;
|
||||||
@@ -159,6 +162,15 @@ public class JGYUtils {
|
|||||||
return fuxiaoyingApp;
|
return fuxiaoyingApp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HashSet<String> getAppAndWhite() {
|
||||||
|
String pkgString = mMMKV.decodeString(UrlAddress.GET_APP_AND_WHITE, "");
|
||||||
|
if(TextUtils.isEmpty(pkgString)){
|
||||||
|
return new HashSet<>();
|
||||||
|
}else {
|
||||||
|
return new HashSet<>(Arrays.asList(pkgString.split(",")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private JGYUtils(Context context) {
|
private JGYUtils(Context context) {
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
throw new RuntimeException("Context is NULL");
|
throw new RuntimeException("Context is NULL");
|
||||||
|
|||||||
Reference in New Issue
Block a user