1.4.0318 修复升级后设置默认桌面,对接小程序管控,增加专注模式,接管系统打开app

This commit is contained in:
2024-03-19 09:30:51 +08:00
parent 367c8e333c
commit 124696a9dd
26 changed files with 1299 additions and 491 deletions

View File

@@ -29,8 +29,8 @@ android {
defaultConfig {
applicationId "com.aoleyun.sn"
versionCode 107
versionName "1.4.0202"
versionCode 114
versionName "1.4.0318"
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
minSdkVersion 24
@@ -44,11 +44,6 @@ android {
// 还可以添加 'armeabi' , 'x86', 'x86_64', 'mips', 'mips64'
}
manifestPlaceholders = [
XG_ACCESS_ID : "1500026372",
XG_ACCESS_KEY: "AR7A1L5M0LPH",
]
buildConfigField "String", "ROOT_URL", '"https://led.aoleyun.cn/api/"'
buildConfigField "String", "SCREEN_BASE_URL", '"https://led.aoleyun.cn:2018/"'
buildConfigField "String", "SCREEN_URL", '"https://led.aoleyun.cn:2018/wm/is_online"'
@@ -121,6 +116,15 @@ android {
v2SigningEnabled true
}
G11Userdebug {
storeFile file("keystore/G11Userdebug.keystore")
storePassword "123456"
keyAlias "G11Userdebug"
keyPassword "123456"
v1SigningEnabled true
v2SigningEnabled true
}
G10PUserDebug {
storeFile file("keystore/G10PUserDebug.jks")
storePassword "123456"
@@ -172,6 +176,8 @@ android {
keyPassword "123456"
v2SigningEnabled false
}
}
// Disable release builds for now
@@ -251,6 +257,20 @@ android {
signingConfig signingConfigs.mtk12
}
G11Debug.initWith(debug)
G11Debug {
versionNameSuffix "-debug"
debuggable true
signingConfig signingConfigs.G11Userdebug
buildConfigField "String", "platform", '"MTKG11"'
}
G11Release.initWith(release)
G11Release {
signingConfig signingConfigs.G11Userdebug
buildConfigField "String", "platform", '"MTKG11"'
}
G10PDebug.initWith(debug)
G10PDebug {
versionNameSuffix "-debug"

Binary file not shown.

View File

@@ -179,13 +179,6 @@ public class SplashActivity extends AppCompatActivity {
// ActivityManager mAm = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
// mAm.killBackgroundProcesses("com.android.documentsui");
Log.e(TAG, "debugTest: SPUtils all " + new Gson().toJson(SPUtils.getAll(this)));
try {
PackageManager packageManager = getPackageManager();
packageManager.setApplicationEnabledSetting(PackageNames.OLD_DEVICE_INFO, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
packageManager.setApplicationEnabledSetting(PackageNames.OLD_APPSTORE, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
} catch (Exception e) {
Log.e(TAG, "debugTest: " + e.getMessage());
}
// Utils.getPublicIP(this);
Utils.obtainWifiInfo(this);

View File

@@ -47,6 +47,7 @@ import com.aoleyun.sn.utils.Utils;
import com.blankj.utilcode.util.NetworkUtils;
import com.bumptech.glide.Glide;
import com.google.gson.JsonObject;
import com.tencent.mmkv.MMKV;
import java.util.concurrent.TimeUnit;
@@ -67,6 +68,8 @@ import static android.os.BatteryManager.EXTRA_VOLTAGE;
public class MainActivity extends BaseActivity implements MainAContact.MainView, NetworkUtils.OnNetworkStatusChangedListener {
private static final String TAG = MainActivity.class.getSimpleName();
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
public static final String UPDATE_LOCKED_STATUS = "UPDATE_LOCKED_STATUS";
public static final String REFRESHACTION = BuildConfig.APPLICATION_ID + ".REFRESH";
@@ -172,6 +175,13 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
public void initView() {
ButterKnife.bind(this);
if (BuildConfig.DEBUG) {
String defaultDesktop = mMMKV.decodeString(CommonConfig.DEFAULT_DESKTOP_PACKAGE_NAME, "");
Log.e(TAG, "initView: defaultDesktop = " + defaultDesktop);
String defaultLauncher = mMMKV.decodeString(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
Log.e(TAG, "initView: defaultLauncher = " + defaultLauncher);
}
mMainAPresenter = new MainAPresenter(this);
mMainAPresenter.attachView(this);
mMainAPresenter.setLifecycle(lifecycleSubject);

View File

@@ -0,0 +1,79 @@
package com.aoleyun.sn.bean;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.google.gson.JsonParser;
import java.io.Serializable;
import java.util.List;
public class LessonApp implements Serializable {
private static final long serialVersionUID = -7239207868023265592L;
int id;
List<App> app;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public List<App> getApp() {
return app;
}
public void setApp(List<App> app) {
this.app = app;
}
public class App implements Serializable {
private static final long serialVersionUID = -3442928771696560097L;
int id;
String app_package;
String app_md5;
String app_url;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getApp_package() {
return app_package;
}
public void setApp_package(String app_package) {
this.app_package = app_package;
}
public String getApp_md5() {
return app_md5;
}
public void setApp_md5(String app_md5) {
this.app_md5 = app_md5;
}
public String getApp_url() {
return app_url;
}
public void setApp_url(String app_url) {
this.app_url = app_url;
}
}
@NonNull
@Override
public String toString() {
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
}
}

View File

@@ -0,0 +1,64 @@
package com.aoleyun.sn.bean;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.google.gson.JsonParser;
import java.io.Serializable;
public class LessonJson implements Serializable {
private static final long serialVersionUID = 6825242822560631014L;
int is_lesson;
String start_time;
String end_time;
int is_monitor;
String pkgs;
public int getIs_lesson() {
return is_lesson;
}
public void setIs_lesson(int is_lesson) {
this.is_lesson = is_lesson;
}
public String getStart_time() {
return start_time;
}
public void setStart_time(String start_time) {
this.start_time = start_time;
}
public String getEnd_time() {
return end_time;
}
public void setEnd_time(String end_time) {
this.end_time = end_time;
}
public int getIs_monitor() {
return is_monitor;
}
public void setIs_monitor(int is_monitor) {
this.is_monitor = is_monitor;
}
public String getPkgs() {
return pkgs;
}
public void setPkgs(String pkgs) {
this.pkgs = pkgs;
}
@NonNull
@Override
public String toString() {
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
}
}

View File

@@ -0,0 +1,64 @@
package com.aoleyun.sn.bean;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.google.gson.JsonParser;
import java.io.Serializable;
public class LessonSetting implements Serializable {
private static final long serialVersionUID = -6129161360078961573L;
int id;
int is_lesson;//是否开启网课模式 0否1是
String start_time;//可用时段 开始时间
String end_time;//可用时段 结束时间
int is_monitor;//是否开启网课监控 0否1是
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getIs_lesson() {
return is_lesson;
}
public void setIs_lesson(int is_lesson) {
this.is_lesson = is_lesson;
}
public String getStart_time() {
return start_time;
}
public void setStart_time(String start_time) {
this.start_time = start_time;
}
public String getEnd_time() {
return end_time;
}
public void setEnd_time(String end_time) {
this.end_time = end_time;
}
public int getIs_monitor() {
return is_monitor;
}
public void setIs_monitor(int is_monitor) {
this.is_monitor = is_monitor;
}
@NonNull
@Override
public String toString() {
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
}
}

View File

@@ -11,6 +11,13 @@ public class SnSetting implements Serializable {
String timecontrol_end;
int is_storeinstall;
int is_usb;
int is_bluetooth_file;
int is_developer;
int is_restore;
int is_topbar;
int is_bottombar;
int is_memory_card;
public int getId() {
return id;
@@ -59,4 +66,52 @@ public class SnSetting implements Serializable {
public void setIs_usb(int is_usb) {
this.is_usb = is_usb;
}
public int getIs_bluetooth_file() {
return is_bluetooth_file;
}
public void setIs_bluetooth_file(int is_bluetooth_file) {
this.is_bluetooth_file = is_bluetooth_file;
}
public int getIs_developer() {
return is_developer;
}
public void setIs_developer(int is_developer) {
this.is_developer = is_developer;
}
public int getIs_restore() {
return is_restore;
}
public void setIs_restore(int is_restore) {
this.is_restore = is_restore;
}
public int getIs_topbar() {
return is_topbar;
}
public void setIs_topbar(int is_topbar) {
this.is_topbar = is_topbar;
}
public int getIs_bottombar() {
return is_bottombar;
}
public void setIs_bottombar(int is_bottombar) {
this.is_bottombar = is_bottombar;
}
public int getIs_memory_card() {
return is_memory_card;
}
public void setIs_memory_card(int is_memory_card) {
this.is_memory_card = is_memory_card;
}
}

View File

@@ -65,9 +65,14 @@ public class CommonConfig {
public final static String GET_DEVICES_TAG_LASTTIME = "Aoleyun_devices_tag_last_time";
/*专注模式刷新*/
public static final String FOCUS_MODE_REFRESH_KEY = "AOLEYUN_FOCUS_MODE_REFRESH";
/*专注模式设置*/
public static final String CLOUD_LESSON_SETTINGS_KEY = "cloud_lesson_settings_key";
/*应用市场允许安装*/
public static final String AOLEYUN_APPSTORE_INSTALL = "AOLEYUN_APPSTORE_INSTALL_KEY";
/*默认桌面 包括简易桌面和学习桌面*/
public static final String DEFAULT_DESKTOP_PACKAGE_NAME = "aoleyun_default_desktop_key";
/*默认应用桌面 单独设置*/
public static final String DEFAULT_LAUNCHER_PACKAGE_NAME = "aoleyun_default_launcher_key";
/**
* 管控系统指令

View File

@@ -8,9 +8,6 @@ package com.aoleyun.sn.comm;
* version: 1.0
*/
public class PackageNames {
//旧版的应用市场和设备信息包名
public static final String OLD_DEVICE_INFO = "com.jiaoguanyi.appstore";
public static final String OLD_APPSTORE = "com.jiaoguanyi.store";
//应用市场和设备信息包名
public static final String DEVICE_INFO = "com.aoleyun.sn";
public static final String APPSTORE = "com.aoleyun.appstore";

View File

@@ -15,10 +15,17 @@ public class AoleyunActivityController extends IActivityController.Stub {
@Override
public boolean activityStarting(Intent intent, String pkg) {
Log.e(TAG, "activityStarting: " + pkg + ", intent= " + intent);
//retrun false;//false 则不会启动,直接返回。
boolean status = JGYUtils.getInstance().isForbid(pkg);
Log.e(TAG, "activityStarting: " + pkg + "start = " + status);
return status;
//false 则不会启动,直接返回。
if (JGYUtils.getInstance().isCloudLessonMod(pkg)) {
if (JGYUtils.getInstance().isForbid(pkg)) {
return true;
} else {
return false;
}
} else {
ToastUtil.show("专注模式只允许使用指定应用");
return false;
}
}
@Override

View File

@@ -39,6 +39,9 @@ import com.aoleyun.sn.bean.DefaultApp;
import com.aoleyun.sn.bean.DeveloperBean;
import com.aoleyun.sn.bean.EBagCode;
import com.aoleyun.sn.bean.ForceDownloadData;
import com.aoleyun.sn.bean.LessonApp;
import com.aoleyun.sn.bean.LessonJson;
import com.aoleyun.sn.bean.LessonSetting;
import com.aoleyun.sn.bean.LogoImg;
import com.aoleyun.sn.bean.NetAndLaunchBean;
import com.aoleyun.sn.bean.PoweroffBean;
@@ -61,6 +64,8 @@ import com.aoleyun.sn.manager.ConnectMode;
import com.aoleyun.sn.network.api.GetWhoisApi;
import com.aoleyun.sn.network.api.aolelearn.ExclusiveAdminAppApi;
import com.aoleyun.sn.network.api.get.CheckTestUpdateApi;
import com.aoleyun.sn.network.api.get.CloudLessonApi;
import com.aoleyun.sn.network.api.get.CloudLessonAppApi;
import com.aoleyun.sn.network.api.get.DefaultAppApi;
import com.aoleyun.sn.network.api.get.DesktopsDiyUpdateApi;
import com.aoleyun.sn.network.api.get.GetAdminAppApi;
@@ -123,6 +128,7 @@ import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.MD5Util;
import com.aoleyun.sn.utils.NetworkUtils;
import com.aoleyun.sn.utils.SPUtils;
import com.aoleyun.sn.utils.SysSettingUtils;
import com.aoleyun.sn.utils.TimeUtils;
import com.aoleyun.sn.utils.ToastUtil;
import com.aoleyun.sn.utils.URLUtils;
@@ -697,6 +703,19 @@ public class NetInterfaceManager {
.observeOn(AndroidSchedulers.mainThread());
}
public Observable<BaseResponse<LessonSetting>> getCloudLessonObservable() {
return mRetrofit.create(CloudLessonApi.class)
.getCloudLessonSetting(Utils.getSerial(mContext))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
public Observable<BaseResponse<LessonApp>> getCloudLessonAppObservable() {
return mRetrofit.create(CloudLessonAppApi.class)
.getCloudLessonApp(Utils.getSerial(mContext))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
/*
@@ -1275,9 +1294,11 @@ public class NetInterfaceManager {
JsonObject data = GsonUtils.getJsonObject(jsonString);
cacheHelper.put(UrlAddress.GET_DESKTOP, jsonString);
JGYUtils.getInstance().installDesktop(data);
mMMKV.encode(CommonConfig.DEFAULT_DESKTOP_PACKAGE_NAME, desktopInfo.getApp_package());
setDefaultDesktop(desktopInfo.getApp_package());
} else {
Log.e("getDefaultDesktop", "onNext: " + "删除定制桌面");
mMMKV.encode(CommonConfig.DEFAULT_DESKTOP_PACKAGE_NAME, "");
cacheHelper.put(UrlAddress.GET_DESKTOP, "");
// String whiteList = Settings.System.getString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
for (String s : ApkUtils.desktopAPP) {
@@ -1296,6 +1317,7 @@ public class NetInterfaceManager {
} catch (Exception e) {
Log.e("getDefaultDesktop", "onNext: " + e.getMessage());
}
mMMKV.encode(CommonConfig.DEFAULT_DESKTOP_PACKAGE_NAME, "com.aoleyunos.dop3");
setDefaultDesktop("com.aoleyunos.dop3");
}
}
@@ -2014,6 +2036,7 @@ public class NetInterfaceManager {
}.getType();
DefaultApp defaultApp = gson.fromJson(jsonString, type);
if (defaultApp != null) {
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, defaultApp.getDefault_launcher());
setDefaultDesktop(defaultApp.getDefault_launcher());
}
callback.onComplete();
@@ -2073,9 +2096,12 @@ public class NetInterfaceManager {
}
JGYUtils.getInstance().setDefaultBrowser(default_IME);
String default_launcher = defaultApp.getDefault_launcher();
if (!TextUtils.isEmpty(default_launcher)) {
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, default_launcher);
JGYUtils.getInstance().setDefaultDesktop(default_launcher);
} else {
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "com.aoleyun.os");
JGYUtils.getInstance().setDefaultDesktop("com.aoleyun.os");
Log.e(TAG, "setDefaultApp: default_launcher is empty");
}
@@ -2093,12 +2119,19 @@ public class NetInterfaceManager {
return id;
}
/**
* 设置默认简易桌面或学习桌面
*
* @param defaultApp
*/
private void setDefaultDesktop(String defaultApp) {
if (!TextUtils.isEmpty(defaultApp)) {
JGYUtils.getInstance().setDefaultDesktop(defaultApp);
SPUtils.put(mContext, "default_launcher", defaultApp);
// SPUtils.put(mContext, "default_launcher", defaultApp);
} else {
String default_launcher = (String) SPUtils.get(mContext, "default_launcher", "");
//如果默认桌面不为空则设置为默认桌面
String default_launcher = mMMKV.decodeString(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
// String default_launcher = (String) SPUtils.get(mContext, "default_launcher", "");
Log.e("getDefaultApp", "onNext: " + default_launcher);
if (TextUtils.isEmpty(default_launcher)) {
JGYUtils.getInstance().setDefaultDesktop();
@@ -2222,6 +2255,7 @@ public class NetInterfaceManager {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform
) {
JGYUtils.getInstance().showApp(PackageNames.YIXUEPAI_DESKTOP);
JGYUtils.getInstance().setYxpDefaultDesktop();
@@ -2234,6 +2268,7 @@ public class NetInterfaceManager {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform
) {
JGYUtils.getInstance().hideApp(PackageNames.YIXUEPAI_DESKTOP);
JGYUtils.getInstance().setDefaultDesktop();
@@ -2458,6 +2493,8 @@ public class NetInterfaceManager {
tagSets.add(JGYUtils.C2Tag);
} else if (platform == JGYUtils.YXPD1Platform) {
tagSets.add(JGYUtils.YXPD1TAG);
} else if (platform == JGYUtils.G11Platform) {
tagSets.add(JGYUtils.G11TAG);
}
});
Log.e(TAG, "clearAndAppendTags: " + tagSets);
@@ -4092,30 +4129,9 @@ public class NetInterfaceManager {
Log.e("getSnSetting", "onNext: " + snSettingBaseResponse);
if (snSettingBaseResponse.code == OK) {
SnSetting snSetting = snSettingBaseResponse.data;
int is_timecontrol = snSetting.getIs_timecontrol();
int is_storeinstall = snSetting.getIs_storeinstall();
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.AOLEYUN_APPSTORE_INSTALL, is_storeinstall);
if (is_timecontrol == 0) {
TimeUtils.setEmpty(mContext);
TimeUtils.ContralTime c = TimeUtils.getDefaltContralTime(mContext);
if (null != c) {
Log.e("getTimeControl", c.toString());
}
SysSettingUtils.setSnSetting(mContext, snSetting);
} else {
String start_time = snSetting.getTimecontrol_start();
String end_time = snSetting.getTimecontrol_end();
TimeUtils.ContralTime c = TimeUtils.String2ContralTime(mContext, start_time + "-" + end_time);
if (null != c) {
Log.e("getTimeControl", "OK:" + c.toString());
}
}
} else {
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.AOLEYUN_APPSTORE_INSTALL, 1);
TimeUtils.setEmpty(mContext);
TimeUtils.ContralTime c = TimeUtils.getDefaltContralTime(mContext);
if (null != c) {
Log.e("getTimeControl", c.toString());
}
SysSettingUtils.setSnSetting(mContext, null);
}
}
@@ -4138,5 +4154,78 @@ public class NetInterfaceManager {
};
}
public void getCloudLessonSettings(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
Observable.zip(getCloudLessonObservable(), getCloudLessonAppObservable(), this::getLessonJson)
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
.subscribe(getCloudLessonSettingsObserver(callback));
}
public void getCloudLessonSettings(onCompleteCallback callback) {
Observable.zip(getCloudLessonObservable(), getCloudLessonAppObservable(), this::getLessonJson)
.subscribe(getCloudLessonSettingsObserver(callback));
}
public void getCloudLessonSettings() {
Observable.zip(getCloudLessonObservable(), getCloudLessonAppObservable(), this::getLessonJson)
.subscribe(getCloudLessonSettingsObserver(null));
}
private LessonJson getLessonJson(BaseResponse<LessonSetting> lessonSettingBaseResponse, BaseResponse<LessonApp> lessonAppBaseResponse) {
LessonJson lessonJson = new LessonJson();
if (lessonSettingBaseResponse.code == 200) {
LessonSetting lessonSetting = lessonSettingBaseResponse.data;
lessonJson.setIs_lesson(lessonSetting.getIs_lesson());
lessonJson.setStart_time(lessonSetting.getStart_time());
lessonJson.setEnd_time(lessonSetting.getEnd_time());
lessonJson.setIs_monitor(lessonSetting.getIs_monitor());
} else {
lessonJson.setIs_lesson(0);
lessonJson.setStart_time("00:00");
lessonJson.setEnd_time("00:00");
lessonJson.setIs_monitor(0);
}
if (lessonAppBaseResponse.code == 200) {
List<LessonApp.App> app = lessonAppBaseResponse.data.getApp();
if (app != null || app.size() != 0) {
List<String> appList = app.stream().map(LessonApp.App::getApp_package).collect(Collectors.toList());
String pkgs = String.join(",", appList);
lessonJson.setPkgs(pkgs);
} else {
lessonJson.setPkgs("");
}
} else {
lessonJson.setPkgs("");
}
return lessonJson;
}
public Observer<LessonJson> getCloudLessonSettingsObserver(onCompleteCallback callback) {
return new Observer<LessonJson>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
Log.e("getCloudLessonSettings", "onSubscribe: ");
}
@Override
public void onNext(@NonNull LessonJson lessonJson) {
Log.e("getCloudLessonSettings", "onNext: " + lessonJson);
mMMKV.encode(CommonConfig.CLOUD_LESSON_SETTINGS_KEY, GsonUtils.toJSONString(lessonJson));
}
@Override
public void onError(@NonNull Throwable e) {
Log.e("getCloudLessonSettings", "onError: " + e.getMessage());
onComplete();
}
@Override
public void onComplete() {
Log.e("getCloudLessonSettings", "onComplete: ");
JGYUtils.getInstance().refresh();
if (callback != null) {
callback.onComplete();
}
}
};
}
}

View File

@@ -20,6 +20,9 @@ public class UrlAddress {
/*绑定设备*/
public static final String SN_CONFIRM_BIND = "And/sn/snConfirmBind";
/*网课模式*/
public final static String GET_CLOUD_LESSON = "And/control/getCloudLessonSetting";
public final static String GET_CLOUD_LESSON_APP = "And/control/getCloudLessonApp";
/*获取批次*/
@Deprecated
@@ -154,6 +157,7 @@ public class UrlAddress {
/*上传应用图标*/
public static final String UPLOAD_APP_IMG = "And/collectData/uploadAppImg";
/*通过ip获取信息*/
public static final String PCONLINE_WHOIS = "http://whois.pconline.com.cn/";
public static final String WHOIS = "ipJson.jsp";

View File

@@ -0,0 +1,16 @@
package com.aoleyun.sn.network.api.get;
import com.aoleyun.sn.bean.BaseResponse;
import com.aoleyun.sn.bean.LessonSetting;
import com.aoleyun.sn.network.UrlAddress;
import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.GET;
import retrofit2.http.Query;
public interface CloudLessonApi {
@GET(UrlAddress.GET_CLOUD_LESSON)
Observable<BaseResponse<LessonSetting>> getCloudLessonSetting(
@Query("sn") String sn
);
}

View File

@@ -0,0 +1,16 @@
package com.aoleyun.sn.network.api.get;
import com.aoleyun.sn.bean.BaseResponse;
import com.aoleyun.sn.bean.LessonApp;
import com.aoleyun.sn.network.UrlAddress;
import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.GET;
import retrofit2.http.Query;
public interface CloudLessonAppApi {
@GET(UrlAddress.GET_CLOUD_LESSON_APP)
Observable<BaseResponse<LessonApp>> getCloudLessonApp(
@Query("sn") String sn
);
}

View File

@@ -622,13 +622,13 @@ public class PushManager {
});
camera2BackgroundUtil.startTakePicture(mContext.getExternalCacheDir().getAbsolutePath() + File.separator + TimeUtils.getPhotoDate() + ".jpg");
break;
case FOCUS_MODE:
refreshFocusMode();
break;
case TIME_CONTROL2:
case USB_CONTROL:
NetInterfaceManager.getInstance().getSnSetting();
break;
case FOCUS_MODE:
refreshFocusMode();
break;
case INSTALL_CONTROL:
case BLUETOOTH_CONTROL:
case DEVELOPER_CONTROL:
@@ -636,7 +636,8 @@ public class PushManager {
case SETTING_STATUSBAR:
case SETTING_NAVIGATION:
case SETTING_TF_CARD:
NetInterfaceManager.getInstance().setSystemSetting();
// NetInterfaceManager.getInstance().setSystemSetting();
NetInterfaceManager.getInstance().getSnSetting();
break;
case BIND_DEVICE:
bindService(extras);
@@ -646,11 +647,13 @@ public class PushManager {
}
private void refreshFocusMode() {
Intent intent = new Intent();
// Intent intent = new Intent();
// ComponentName componentName = new ComponentName("com.aoleyunos.dop6", "com.aoleyunos.dop6.service.main.MainService");
// intent.setComponent(componentName);
intent.setAction(CommonConfig.FOCUS_MODE_REFRESH_KEY);
mContext.sendBroadcast(intent);
// intent.setAction(CommonConfig.FOCUS_MODE_REFRESH_KEY);
// mContext.sendBroadcast(intent);
JGYUtils.getInstance().gotoLauncher();
NetInterfaceManager.getInstance().getCloudLessonSettings();
}
private void deleteApp(String extras) {
@@ -1088,15 +1091,19 @@ public class PushManager {
JsonElement launcherElement = jsonObject.get("default_launcher");
if (launcherElement.isJsonNull()) {
JGYUtils.getInstance().setDefaultDesktop("");
SPUtils.put(mContext, "default_launcher", "");
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
// SPUtils.put(mContext, "default_launcher", "");
} else {
String default_launcher = launcherElement.getAsString();
if (TextUtils.isEmpty(default_launcher)) {
JGYUtils.getInstance().setDefaultDesktop("");
SPUtils.put(mContext, "default_launcher", "");
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
// SPUtils.put(mContext, "default_launcher", "");
} else {
JGYUtils.getInstance().setDefaultDesktop(default_launcher);
SPUtils.put(mContext, "default_launcher", default_launcher);
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, default_launcher);
// SPUtils.put(mContext, "default_launcher", default_launcher);
}
}
}

View File

@@ -26,11 +26,14 @@ public class NewAppReceiver extends BroadcastReceiver {
private static final String TAG = NewAppReceiver.class.getSimpleName();
private static NewAppListener newAppListener;
private static LauncherListener launcherListener;
@SuppressLint("StaticFieldLeak")
private static Context mContext;
static {
sendAppInfo();
setLauncher();
}
@Override
@@ -62,7 +65,6 @@ public class NewAppReceiver extends BroadcastReceiver {
break;
}
Log.e(TAG, "sendAppInfo: " + state + packageName);
JGYUtils.getInstance().checkDefaultDesktop(packageName);
NetInterfaceManager.getInstance().checkUpdate();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (!PackageNames.APPSTORE.equals(packageName) || !PackageNames.DEVICE_INFO.equals(packageName)) {
@@ -73,6 +75,7 @@ public class NewAppReceiver extends BroadcastReceiver {
//启动教官壹
}
newAppListener.setNewAppListener(packageName);
launcherListener.setDefaultLauncher(packageName);
}
private void checkDefaultDesktop(String pkg) {
@@ -94,12 +97,12 @@ public class NewAppReceiver extends BroadcastReceiver {
.subscribe(new Observer<String>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
Log.e("sendAppInfo", "onSubscribe: ");
}
@Override
public void onNext(@NonNull String s) {
Log.e(TAG, "sendAppInfo: onNext: " + s);
Log.e("sendAppInfo", "onNext: " + s);
JGYUtils.getInstance().checkForceDownload();
JGYUtils.getInstance().updateNetworkWhiteList();
NetInterfaceManager.getInstance().getAppLimit();
@@ -110,21 +113,58 @@ public class NewAppReceiver extends BroadcastReceiver {
}
});
String oldDesktop = (String) SPUtils.get(mContext, "default_launcher", "");
if (s.equals(oldDesktop)) {
ApkUtils.openPackage(mContext, s);
}
@Override
public void onError(@NonNull Throwable e) {
Log.e("sendAppInfo", "onError: " + e.getMessage());
}
@Override
public void onComplete() {
Log.e("sendAppInfo", "onComplete: ");
}
});
}
public interface LauncherListener {
void setDefaultLauncher(String packageName);
}
private static void setLauncher() {
Observable.create((ObservableEmitter<String> emitter) -> {
launcherListener = emitter::onNext;
})
.throttleFirst(10, TimeUnit.SECONDS)
//这句很关键这是RxJava中的操作符在规定时间内观察者不在接收被观察者发送的事件
.subscribe(new Observer<String>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
Log.e("setLauncher", "onSubscribe: ");
}
@Override
public void onNext(@NonNull String pkg) {
Log.e("setLauncher", "onNext: " + pkg);
JGYUtils.getInstance().checkDefaultDesktop(pkg);
String oldDesktop = JGYUtils.getInstance().getDefaultDesktop();
// String oldDesktop = (String) SPUtils.get(mContext, "default_launcher", "");
Log.e("setLauncher", "onNext: oldDesktop = " + oldDesktop);
if (pkg.equals(oldDesktop)) {
ApkUtils.openPackage(mContext, pkg);
}
}
@Override
public void onError(@NonNull Throwable e) {
Log.e("setLauncher", "onError: " + e.getMessage());
}
@Override
public void onComplete() {
Log.e(TAG, "onComplete: ");
Log.e("setLauncher", "onComplete: ");
}
});
}
}

View File

@@ -16,6 +16,7 @@ import com.aoleyun.sn.utils.ForegroundAppUtil;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.SPUtils;
import com.aoleyun.sn.utils.Utils;
import com.tencent.mmkv.MMKV;
import java.util.ArrayList;
import java.util.Arrays;
@@ -24,6 +25,8 @@ import java.util.List;
public class RemoteService extends Service {
private String TAG = RemoteService.class.getSimpleName();
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
public RemoteService() {
}
@@ -77,7 +80,8 @@ public class RemoteService extends Service {
@Override
public void setDefaultDesktop(String pkg) throws RemoteException {
Log.e(TAG, "setDefaultDesktop: " + "pkg = " + pkg);
SPUtils.put(RemoteService.this, "default_launcher", pkg);
// SPUtils.put(RemoteService.this, "default_launcher", pkg);
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, pkg);
JGYUtils.getInstance().setDefaultDesktop(pkg);
if (PackageNames.DESKTOP.equals(pkg)) {
// JGYUtils.getInstance().killPackage(PackageNames.DESKTOP);

View File

@@ -81,6 +81,8 @@ public class MainSContact {
/*获取时间管控*/
void getSnTimeControl();
void getSnSetting();
/*获取网课模式*/
void getCloudLessonSettings();
/*获取电子书包激活码*/
void getEbagCode();
/*获取学习应用*/
@@ -158,6 +160,7 @@ public class MainSContact {
/*获取时间管控*/
void getSnTimeControlFinish();
void getSnSettingFinish();
void setCloudLessonSettings();
/*获取电子书包激活码*/
void getEbagCodeFinish(boolean activation);
/*获取学习应用*/

View File

@@ -552,6 +552,18 @@ public class MainSPresenter implements MainSContact.Presenter {
});
}
@Override
public void getCloudLessonSettings() {
NetInterfaceManager.getInstance().getCloudLessonSettings(lifecycle, new NetInterfaceManager.onCompleteCallback() {
@Override
public void onComplete() {
if (mView != null) {
mView.setCloudLessonSettings();
}
}
});
}
@Override
public void getEbagCode() {
NetInterfaceManager.getInstance()

View File

@@ -1,7 +1,9 @@
package com.aoleyun.sn.service.main;
import android.annotation.SuppressLint;
import android.app.ActivityManagerNative;
import android.app.AlarmManager;
import android.app.IActivityManager;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.Service;
@@ -21,6 +23,7 @@ import android.os.Binder;
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.os.RemoteException;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.DisplayMetrics;
@@ -45,6 +48,7 @@ import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.comm.JGYActions;
import com.aoleyun.sn.comm.PackageNames;
import com.aoleyun.sn.gson.GsonUtils;
import com.aoleyun.sn.hook.AoleyunActivityController;
import com.aoleyun.sn.network.NetInterfaceManager;
import com.aoleyun.sn.rlog.LogDBManager;
import com.aoleyun.sn.utils.ApkUtils;
@@ -375,6 +379,10 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
JGYUtils.getInstance().setTongyiAppTop();
}
String launcherPkg = JGYUtils.getInstance().getDefaultDesktop();
Log.e(TAG, "onCreate: " + launcherPkg);
JGYUtils.getInstance().checkDefaultDesktop(launcherPkg);
TimeTask task = new TimeTask();
task.execute("ntp.aliyun.com");
mPresenter.getLockedState();
@@ -467,13 +475,13 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
// createNotificationChannel();
// aliyunPushInit();
// IActivityManager activityManager = ActivityManagerNative.getDefault();
// try {
// activityManager.setActivityController(new AoleyunActivityController(), true);
// } catch (RemoteException e) {
// Log.e(TAG, "setActivityController: " + e.getMessage());
// e.printStackTrace();
// }
IActivityManager activityManager = ActivityManagerNative.getDefault();
try {
activityManager.setActivityController(new AoleyunActivityController(), false);
} catch (RemoteException e) {
Log.e(TAG, "setActivityController: " + e.getMessage());
e.printStackTrace();
}
}
@Override
@@ -1041,6 +1049,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
Log.e(TAG, "setTagsFinish: " + "not set tag");
// mPresenter.getStudesInfo(true);
mPresenter.checkAoleyunUpdate();
// SysSettingUtils.setEnableSetting(this);
} else {
mPresenter.getFirstConnect();
mPresenter.getStudesInfo();
@@ -1223,6 +1232,11 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
@Override
public void getSnSettingFinish() {
mPresenter.getCloudLessonSettings();
}
@Override
public void setCloudLessonSettings() {
mPresenter.getEbagCode();
}

View File

@@ -61,6 +61,432 @@ import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.schedulers.Schedulers;
public class ApkUtils {
public static final Set<String> aoleyunAPP = new HashSet<String>() {{
this.add(BuildConfig.APPLICATION_ID);
this.add("com.aoleyun.appstore");
this.add("com.aoleyun.sn");
this.add("com.aoleyun.info");
this.add("com.aoleyun.os");
this.add("com.aoleyun.browser");
this.add("com.uiui.filecloud");
this.add("com.gl.dwlauncher");
this.add("com.qunyu.dividedroad");
this.add("com.ygyb.yischool");
this.add("com.yxxmk.uiui");
this.add("com.uiui.floatwindow");
this.add("com.uiuipad.find");
this.add("com.uiuipad.appstore");
this.add("com.uiuipad.os");
this.add("com.uiuipad.zyinfo");
this.add("com.yixuepai.os");
this.add("com.tongyi.aistudent");
}};
/**
* 桌面app
*/
public static final Set<String> desktopAPP = new HashSet<String>() {{
this.add("com.aoleyunos.dop1");
this.add("com.aoleyunos.dop2");
this.add("com.aoleyunos.dop3");
this.add("com.aoleyunos.dop4");
this.add("com.aoleyunos.dop5");
this.add("com.aoleyunos.dop6");
this.add("com.aoleyunos.dop7");
this.add("com.aoleyunos.dop8");
this.add("com.aoleyunos.dop9");
this.add("com.aoleyunos.dop10");
// this.add("com.uiuios.jgy1");
// this.add("com.uiuios.jgy2");
// this.add("com.android.uiuios");
// this.add("com.shoufei.aole");
}};
/**
* 出厂自带的app
*/
public static final Set<String> factoryapp = new HashSet<String>() {{
this.add("com.android.fmradio");
this.add("com.mediatek.gba");
this.add("com.mediatek.ims");
this.add("com.mediatek.ppl");
this.add("com.android.cts.priv.ctsshim");
this.add("com.android.internal.display.cutout.emulation.corner");
this.add("com.android.internal.display.cutout.emulation.double");
this.add("com.mediatek.autobootcontroller");
this.add("com.android.providers.telephony");
this.add("com.android.dynsystem");
this.add("com.mediatek.camera");
this.add("com.android.providers.calendar");
this.add("com.mediatek.telephony");
this.add("com.android.providers.media");
this.add("com.android.theme.icon.square");
this.add("com.android.internal.systemui.navbar.gestural_wide_back");
this.add("com.mediatek.location.lppe.main");
this.add("com.android.wallpapercropper");
this.add("com.android.theme.color.cinnamon");
this.add("com.mediatek.gnss.nonframeworklbs");
this.add("com.verizon.remoteSimlock");
this.add("com.android.protips");
this.add("com.android.theme.icon_pack.rounded.systemui");
this.add("com.android.documentsui");
this.add("com.android.externalstorage");
this.add("com.mediatek.ygps");
this.add("com.mediatek.simprocessor");
this.add("com.android.htmlviewer");
this.add("com.mediatek.autodialer");
this.add("com.mediatek.mms.appservice");
this.add("com.android.companiondevicemanager");
this.add("com.android.quicksearchbox");
this.add("com.android.mms.service");
this.add("com.android.providers.downloads");
this.add("com.adups.fota");
this.add("com.mediatek.engineermode");
this.add("com.android.theme.icon_pack.rounded.android");
this.add("com.example.hragingtest");
this.add("com.mediatek.omacp");
this.add("com.bsm_wqy.validationtools");
this.add("com.android.browser");
this.add("com.android.theme.icon_pack.circular.themepicker");
this.add("com.android.soundrecorder");
this.add("com.android.providers.downloads.ui");
this.add("com.android.pacprocessor");
this.add("com.android.simappdialog");
this.add("com.android.networkstack");
this.add("com.android.internal.display.cutout.emulation.tall");
this.add("com.android.modulemetadata");
this.add("com.android.certinstaller");
this.add("com.android.theme.color.black");
this.add("com.android.carrierconfig");
this.add("com.android.theme.color.green");
this.add("com.android.theme.color.ocean");
this.add("com.android.theme.color.space");
this.add("com.android.internal.systemui.navbar.threebutton");
this.add("android");
this.add("com.android.contacts");
this.add("com.mediatek.emcamera");
this.add("com.android.theme.icon_pack.rounded.launcher");
this.add("com.st.nfc.dta.mobile");
this.add("com.android.egg");
this.add("com.android.mms");
this.add("com.android.mtp");
this.add("com.android.nfc");
this.add("com.android.ons");
this.add("com.android.stk");
this.add("com.android.launcher3");
this.add("com.android.backupconfirm");
this.add("com.mediatek.security");
this.add("com.android.internal.systemui.navbar.twobutton");
this.add("com.android.provision");
this.add("com.android.statementservice");
this.add("com.android.hotspot2");
this.add("com.mediatek.mdmlsample");
this.add("com.android.settings.intelligence");
this.add("com.android.calendar");
this.add("com.mediatek.frameworkresoverlay");
this.add("com.debug.loggerui");
this.add("com.android.internal.systemui.navbar.gestural_extra_wide_back");
this.add("com.android.providers.settings");
this.add("com.android.sharedstoragebackup");
this.add("com.mediatek.batterywarning");
this.add("com.android.printspooler");
this.add("com.android.theme.icon_pack.filled.settings");
this.add("com.android.dreams.basic");
this.add("com.android.webview");
this.add("com.android.se");
this.add("com.android.inputdevices");
this.add("com.chartcross.gpstest");
this.add("com.android.bips");
this.add("com.mediatek");
this.add("com.android.theme.icon_pack.circular.settings");
this.add("com.android.musicfx");
this.add("com.android.cellbroadcastreceiver");
this.add("com.android.theme.icon.teardrop");
this.add("android.ext.shared");
this.add("com.android.onetimeinitializer");
this.add("com.android.server.telecom");
this.add("com.android.keychain");
this.add("com.mediatek.security.service");
this.add("com.android.printservice.recommendation");
this.add("com.android.dialer");
this.add("com.android.gallery3d");
this.add("com.android.theme.icon_pack.filled.systemui");
this.add("android.ext.services");
this.add("com.android.calllogbackup");
this.add("com.hr.factorytesting");
this.add("com.android.localtransport");
this.add("com.android.packageinstaller");
this.add("com.android.carrierdefaultapp");
this.add("com.mediatek.atmwifimeta");
this.add("com.android.theme.font.notoserifsource");
this.add("com.android.theme.icon_pack.filled.android");
this.add("com.android.proxyhandler");
this.add("com.android.theme.icon_pack.circular.systemui");
this.add("com.android.inputmethod.latin");
this.add("com.android.managedprovisioning");
this.add("com.mediatek.capctrl.service");
this.add("com.mediatek.callrecorder");
this.add("com.android.wallpaper.livepicker");
this.add("com.android.apps.tag");
this.add("com.mediatek.gnssdebugreport");
this.add("com.android.theme.icon.squircle");
this.add("com.android.storagemanager");
this.add("com.android.bookmarkprovider");
this.add("com.android.settings");
this.add("com.google.android.inputmethod.pinyin");
this.add("com.android.theme.icon_pack.filled.launcher");
this.add("com.android.networkstack.permissionconfig");
this.add("com.mediatek.mdmconfig");
this.add("com.mediatek.lbs.em2.ui");
this.add("com.android.cts.ctsshim");
this.add("com.android.theme.icon_pack.circular.launcher");
this.add("com.android.vpndialogs");
this.add("com.android.email");
this.add("com.android.music");
this.add("com.android.phone");
this.add("com.android.shell");
this.add("com.android.theme.icon_pack.filled.themepicker");
this.add("com.android.wallpaperbackup");
this.add("com.android.providers.blockednumber");
this.add("com.android.providers.userdictionary");
this.add("com.android.emergency");
this.add("com.android.internal.systemui.navbar.gestural");
this.add("com.android.location.fused");
this.add("com.android.theme.color.orchid");
this.add("com.android.deskclock");
this.add("com.android.systemui");
this.add("com.android.theme.color.purple");
this.add("com.android.bluetoothmidiservice");
this.add("com.android.permissioncontroller");
this.add("com.android.traceur");
this.add("com.mediatek.sensorhub.ui");
this.add("android.auto_generated_rro_product__");
this.add("com.android.bluetooth");
this.add("com.android.wallpaperpicker");
this.add("com.android.providers.contacts");
this.add("com.android.captiveportallogin");
this.add("com.android.theme.icon.roundedrect");
this.add("com.android.internal.systemui.navbar.gestural_narrow_back");
this.add("com.android.theme.icon_pack.rounded.settings");
this.add("com.mediatek.dataprotection");
this.add("com.wapi.wapicertmanager");
this.add("android.auto_generated_rro_vendor__");
this.add("com.android.theme.icon_pack.circular.android");
this.add("com.example.eyeshielyplus");
this.add("cn.com.bifa.eyeshiely");
}};
public static final Set<String> systemApps = new HashSet<String>() {{
this.add("com.android.deskclock");
this.add("com.android.music");
this.add("com.android.documentsui");
this.add("com.mediatek.camera");
this.add("com.android.calendar");
this.add("com.android.calculator2");
this.add("com.android.gallery3d");
this.add("com.android.soundrecorder");
this.add("com.android.settings");
this.add("org.chromium.chrome");
this.add("com.softwinner.music");
this.add("com.softwinner.miracastReceiver");
this.add("com.softwinner.camera");
this.add("org.chromium.webview_shell");
// this.add("com.uiuipad.find");
// this.add("com.uiuipad.os");
this.add("com.softwinner.videoplayer");
this.add("com.sohu.inputmethod.sogou");
this.add("com.tencent.mtt");
}};
/**
* 需要管控的系统应用
*/
public static final Set<String> systemapp = new HashSet<String>() {{
this.add("com.android.gallery3d");//图库
this.add("com.android.settings");//图库
this.add("com.android.deskclock");//时钟
this.add("com.android.music");//音乐
this.add("com.mediatek.camera");//相机
this.add("com.android.camera");
this.add("com.android.camera2");//展讯相机
this.add("com.android.documentsui");//文件
this.add("com.mediatek.filemanager");//文件
this.add("com.android.soundrecorder");//录音机
this.add("com.android.browser");//浏览器
this.add("com.android.mms");//信息
this.add("com.android.messaging");//展讯信息
this.add("com.android.fmradio");//FM电台
this.add("com.android.dialer");//电话
this.add("com.android.contacts");//通讯录
//根据需求内置
this.add("com.easyclient.activity");//移动课堂
this.add("com.jiandan.mobilelesson");//简单课堂
this.add(PackageNames.APPSTORE);//教官壹
//展讯
this.add("com.android.calculator2");//计算器
this.add("com.android.email");//电子邮件
this.add("com.android.calendar");//日历
this.add("com.tencent.wework");
this.add("com.tencent.mm");
this.add("cn.wps.moffice_eng");
this.add("com.baidu.BaiduMap");
}};
/**
* 预置的可以卸载的系统应用,判断出来为第三方
*/
public static final Set<String> canremove_systemapp = new HashSet<String>() {{
this.add("com.android.quicksearchbox");
this.add("com.android.calendar");
this.add("com.android.dreams.basic");
this.add("com.android.musicfx");
this.add("com.android.email");
this.add("com.jiaoguanyi.sysc");
}};
/**
* 需要管控的系统可以卸载的应用
*/
public static final Set<String> show_canremove_systemapp = new HashSet<String>() {{
this.add("com.android.calendar");
// this.add("com.android.email");
}};
/**
* 爱华项目app
*/
public static final Set<String> aihuaApp = new HashSet<String>() {{
this.add("com.liuyang.jcstudentside");
this.add("com.qi.studycomputer.launcher");
this.add("com.qi.xiaoshi");
this.add("com.hardware.cn");
this.add("com.qi.gamemodel");
this.add("com.wyt.tongbuyouxue");
this.add("com.qi.wyt.setting");
this.add("air.wyt.modloader");
this.add("com.android.calculator2");
this.add("com.qi.TFSystem");
this.add("com.qi.appstore");
this.add("com.wyt.evaluating");
this.add("com.wyt.picturebook");
// this.add("com.hhdd.kadahd");
this.add("com.wyt.onlinedic");
this.add("com.ximalaya.ting.kid");
this.add("com.baidu.duershow.child");
this.add("com.gl.souti");
this.add("com.ihuman.pinyin");
this.add("com.hongen.app.word");
this.add("com.wyt.parents_assistant");
this.add("com.wyt.forbitpoint");
this.add("com.wyt.lessonhelper");
this.add("com.wyt.wangkexueximvvm");
this.add("com.wyt.clicktoread");
this.add("com.robot.app_ai");
this.add("com.wyt.appstore");
this.add("air.com.wyt.GLLearnMain");
this.add("com.wyt.examcenter");
this.add("com.gl.compositioncorrection");
this.add("com.gl.compositioncorrectionen");
this.add("cn.wps.moffice_eng");
this.add("com.ckl.launcher");
this.add("net.forclass.fcstudent");
this.add("com.creative.strokeprovider");
this.add("com.ckl.oraltraining");
this.add("com.ckl.fcfilemanager");
this.add("com.iflytek.inputmethod");
this.add("com.wyt.wangkexueximvvm1");
this.add("com.android.stk");
this.add("com.shoufei.aole");
this.add("com.ygyb.yischool");
}};
/**
* 学习桌面和九学王app
*/
public static final Set<String> jxwApp = new HashSet<String>() {{
this.add("com.google.android.inputmethod.pinyin");
this.add("air.com.zhihuiyoujiao.flashplayer");
this.add("com.example.arithmeticformula");
this.add("com.example.elementcycleapp");
this.add("com.example.pianpangbushou");
this.add("com.iflytek.cyber.iot.show.core");
this.add("com.iflytek.speechcloud");
this.add("com.jxw.bihuamingcheng");
this.add("com.jxw.bishunguize");
this.add("com.jxw.characterlearning");
this.add("com.jxw.dmxcy");
this.add("com.jxw.englishsoundmark");
this.add("com.jxw.examsystem");
this.add("com.jxw.game");
this.add("com.jxw.gb.zwpg");
this.add("com.jxw.handwrite");
this.add("com.jxw.jinfangyici");
this.add("com.jxw.jxwbook");
this.add("com.jxw.jxwcalculator");
this.add("com.jxw.laboratory");
this.add("com.jxw.learnchinesepinyin");
this.add("com.jxw.letterstudynew");
this.add("com.jxw.liancichengju");
this.add("com.jxw.mskt.video");
this.add("com.jxw.newyouer.video");
this.add("com.jxw.online_study");
this.add("com.jxw.question");
this.add("com.jxw.schultegrid");
this.add("com.jxw.singsound");
this.add("com.jxw.studydigital");
this.add("com.jxw.teacher.video");
this.add("com.jxw.wuweijidanci");
this.add("com.jxw.youer.video");
this.add("com.jxw.yuwenxiezuo");
this.add("com.jxw.yyhb");
this.add("com.jxw.zncd");
this.add("com.oirsdfg89.flg");
this.add("com.study.flashplayer");
this.add("com.tech.translate");
this.add("com.uiui.zybrowser");
this.add("com.uiui.zysn");
this.add("com.jxw.launcher");
this.add("com.uiui.zyappstore");
this.add("com.uiui.zy");
this.add("com.uiui.zyos");
this.add("com.teclast.zyos");
this.add("com.teclast.zybrowser");
this.add("com.teclast.zyappstore");
this.add("com.teclast.zy");
}};
/**
* 内置政务桌面项目内置白名单
*/
public static final Set<String> zhengwu = new HashSet<String>() {{
this.add("com.tencent.wework");
this.add("com.tencent.mm");
this.add("com.baidu.BaiduMap");
this.add("com.alibaba.android.rimet");
this.add("com.tencent.wemeet.app");
this.add("cn.wps.moffice_eng");
}};
/**
* dongwa桌面app
*/
public static final Set<String> dongwa = new HashSet<String>() {{
this.add("com.jxw.singsound");
this.add("com.qunyu.dividedroad");
this.add("com.gl.dwlauncher");
this.add("com.gl.dongwa");
}};
private static String TAG = ApkUtils.class.getSimpleName();
public static synchronized boolean getRootAhth() {
@@ -712,407 +1138,6 @@ 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");
this.add("com.android.musicfx");
this.add("com.android.email");
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");//时钟
this.add("com.android.music");//音乐
this.add("com.mediatek.camera");//相机
this.add("com.android.camera");
this.add("com.android.camera2");//展讯相机
this.add("com.android.documentsui");//文件
this.add("com.mediatek.filemanager");//文件
this.add("com.android.soundrecorder");//录音机
this.add("com.android.browser");//浏览器
this.add("com.android.mms");//信息
this.add("com.android.messaging");//展讯信息
this.add("com.android.fmradio");//FM电台
this.add("com.android.dialer");//电话
this.add("com.android.contacts");//通讯录
//根据需求内置
this.add("com.easyclient.activity");//移动课堂
this.add("com.jiandan.mobilelesson");//简单课堂
this.add(PackageNames.APPSTORE);//教官壹
//展讯
this.add("com.android.calculator2");//计算器
this.add("com.android.email");//电子邮件
this.add("com.android.calendar");//日历
this.add("com.tencent.wework");
this.add("com.tencent.mm");
this.add("cn.wps.moffice_eng");
this.add("com.baidu.BaiduMap");
}};
//桌面app
public static List<String> desktopAPP = new ArrayList<String>() {{
this.add("com.aoleyunos.dop1");
this.add("com.aoleyunos.dop2");
this.add("com.aoleyunos.dop3");
this.add("com.aoleyunos.dop4");
this.add("com.aoleyunos.dop5");
this.add("com.aoleyunos.dop6");
this.add("com.aoleyunos.dop7");
this.add("com.aoleyunos.dop8");
this.add("com.aoleyunos.dop9");
this.add("com.aoleyunos.dop10");
// this.add("com.uiuios.jgy1");
// this.add("com.uiuios.jgy2");
// this.add("com.android.uiuios");
// this.add("com.shoufei.aole");
}};
public static Set<String> aoleyunAPP = new HashSet<String>() {{
this.add(BuildConfig.APPLICATION_ID);
this.add("com.aoleyun.appstore");
this.add("com.aoleyun.sn");
this.add("com.aoleyun.info");
this.add("com.aoleyun.os");
this.add("com.aoleyun.browser");
this.add("com.uiui.filecloud");
this.add("com.gl.dwlauncher");
this.add("com.qunyu.dividedroad");
this.add("com.ygyb.yischool");
this.add("com.yxxmk.uiui");
this.add("com.uiui.floatwindow");
this.add("com.uiuipad.find");
this.add("com.uiuipad.appstore");
this.add("com.uiuipad.os");
this.add("com.uiuipad.zyinfo");
this.add("com.yixuepai.os");
this.add("com.tongyi.aistudent");
}};
//出厂自带的app
public static List<String> factoryapp = new ArrayList<String>() {{
this.add("com.android.fmradio");
this.add("com.mediatek.gba");
this.add("com.mediatek.ims");
this.add("com.mediatek.ppl");
this.add("com.android.cts.priv.ctsshim");
this.add("com.android.internal.display.cutout.emulation.corner");
this.add("com.android.internal.display.cutout.emulation.double");
this.add("com.mediatek.autobootcontroller");
this.add("com.android.providers.telephony");
this.add("com.android.dynsystem");
this.add("com.mediatek.camera");
this.add("com.android.providers.calendar");
this.add("com.mediatek.telephony");
this.add("com.android.providers.media");
this.add("com.android.theme.icon.square");
this.add("com.android.internal.systemui.navbar.gestural_wide_back");
this.add("com.mediatek.location.lppe.main");
this.add("com.android.wallpapercropper");
this.add("com.android.theme.color.cinnamon");
this.add("com.mediatek.gnss.nonframeworklbs");
this.add("com.verizon.remoteSimlock");
this.add("com.android.protips");
this.add("com.android.theme.icon_pack.rounded.systemui");
this.add("com.android.documentsui");
this.add("com.android.externalstorage");
this.add("com.mediatek.ygps");
this.add("com.mediatek.simprocessor");
this.add("com.android.htmlviewer");
this.add("com.mediatek.autodialer");
this.add("com.mediatek.mms.appservice");
this.add("com.android.companiondevicemanager");
this.add("com.android.quicksearchbox");
this.add("com.android.mms.service");
this.add("com.android.providers.downloads");
this.add("com.adups.fota");
this.add("com.mediatek.engineermode");
this.add("com.android.theme.icon_pack.rounded.android");
this.add("com.example.hragingtest");
this.add("com.mediatek.omacp");
this.add("com.bsm_wqy.validationtools");
this.add("com.android.browser");
this.add("com.android.theme.icon_pack.circular.themepicker");
this.add("com.android.soundrecorder");
this.add("com.android.providers.downloads.ui");
this.add("com.android.pacprocessor");
this.add("com.android.simappdialog");
this.add("com.android.networkstack");
this.add("com.android.internal.display.cutout.emulation.tall");
this.add("com.android.modulemetadata");
this.add("com.android.certinstaller");
this.add("com.android.theme.color.black");
this.add("com.android.carrierconfig");
this.add("com.android.theme.color.green");
this.add("com.android.theme.color.ocean");
this.add("com.android.theme.color.space");
this.add("com.android.internal.systemui.navbar.threebutton");
this.add("android");
this.add("com.android.contacts");
this.add("com.mediatek.emcamera");
this.add("com.android.theme.icon_pack.rounded.launcher");
this.add("com.st.nfc.dta.mobile");
this.add("com.android.egg");
this.add("com.android.mms");
this.add("com.android.mtp");
this.add("com.android.nfc");
this.add("com.android.ons");
this.add("com.android.stk");
this.add("com.android.launcher3");
this.add("com.android.backupconfirm");
this.add("com.mediatek.security");
this.add("com.android.internal.systemui.navbar.twobutton");
this.add("com.android.provision");
this.add("com.android.statementservice");
this.add("com.android.hotspot2");
this.add("com.mediatek.mdmlsample");
this.add("com.android.settings.intelligence");
this.add("com.android.calendar");
this.add("com.mediatek.frameworkresoverlay");
this.add("com.debug.loggerui");
this.add("com.android.internal.systemui.navbar.gestural_extra_wide_back");
this.add("com.android.providers.settings");
this.add("com.android.sharedstoragebackup");
this.add("com.mediatek.batterywarning");
this.add("com.android.printspooler");
this.add("com.android.theme.icon_pack.filled.settings");
this.add("com.android.dreams.basic");
this.add("com.android.webview");
this.add("com.android.se");
this.add("com.android.inputdevices");
this.add("com.chartcross.gpstest");
this.add("com.android.bips");
this.add("com.mediatek");
this.add("com.android.theme.icon_pack.circular.settings");
this.add("com.android.musicfx");
this.add("com.android.cellbroadcastreceiver");
this.add("com.android.theme.icon.teardrop");
this.add("android.ext.shared");
this.add("com.android.onetimeinitializer");
this.add("com.android.server.telecom");
this.add("com.android.keychain");
this.add("com.mediatek.security.service");
this.add("com.android.printservice.recommendation");
this.add("com.android.dialer");
this.add("com.android.gallery3d");
this.add("com.android.theme.icon_pack.filled.systemui");
this.add("android.ext.services");
this.add("com.android.calllogbackup");
this.add("com.hr.factorytesting");
this.add("com.android.localtransport");
this.add("com.android.packageinstaller");
this.add("com.android.carrierdefaultapp");
this.add("com.mediatek.atmwifimeta");
this.add("com.android.theme.font.notoserifsource");
this.add("com.android.theme.icon_pack.filled.android");
this.add("com.android.proxyhandler");
this.add("com.android.theme.icon_pack.circular.systemui");
this.add("com.android.inputmethod.latin");
this.add("com.android.managedprovisioning");
this.add("com.mediatek.capctrl.service");
this.add("com.mediatek.callrecorder");
this.add("com.android.wallpaper.livepicker");
this.add("com.android.apps.tag");
this.add("com.mediatek.gnssdebugreport");
this.add("com.android.theme.icon.squircle");
this.add("com.android.storagemanager");
this.add("com.android.bookmarkprovider");
this.add("com.android.settings");
this.add("com.google.android.inputmethod.pinyin");
this.add("com.android.theme.icon_pack.filled.launcher");
this.add("com.android.networkstack.permissionconfig");
this.add("com.mediatek.mdmconfig");
this.add("com.mediatek.lbs.em2.ui");
this.add("com.android.cts.ctsshim");
this.add("com.android.theme.icon_pack.circular.launcher");
this.add("com.android.vpndialogs");
this.add("com.android.email");
this.add("com.android.music");
this.add("com.android.phone");
this.add("com.android.shell");
this.add("com.android.theme.icon_pack.filled.themepicker");
this.add("com.android.wallpaperbackup");
this.add("com.android.providers.blockednumber");
this.add("com.android.providers.userdictionary");
this.add("com.android.emergency");
this.add("com.android.internal.systemui.navbar.gestural");
this.add("com.android.location.fused");
this.add("com.android.theme.color.orchid");
this.add("com.android.deskclock");
this.add("com.android.systemui");
this.add("com.android.theme.color.purple");
this.add("com.android.bluetoothmidiservice");
this.add("com.android.permissioncontroller");
this.add("com.android.traceur");
this.add("com.mediatek.sensorhub.ui");
this.add("android.auto_generated_rro_product__");
this.add("com.android.bluetooth");
this.add("com.android.wallpaperpicker");
this.add("com.android.providers.contacts");
this.add("com.android.captiveportallogin");
this.add("com.android.theme.icon.roundedrect");
this.add("com.android.internal.systemui.navbar.gestural_narrow_back");
this.add("com.android.theme.icon_pack.rounded.settings");
this.add("com.mediatek.dataprotection");
this.add("com.wapi.wapicertmanager");
this.add("android.auto_generated_rro_vendor__");
this.add("com.android.theme.icon_pack.circular.android");
this.add(PackageNames.OLD_DEVICE_INFO);
this.add(PackageNames.OLD_APPSTORE);
this.add("com.example.eyeshielyplus");
this.add("cn.com.bifa.eyeshiely");
}};
public static Set<String> aihuaApp = new HashSet<String>() {{
this.add("com.liuyang.jcstudentside");
this.add("com.alibaba.android.rimet");
this.add("com.tencent.wemeet.app");
this.add("com.qi.studycomputer.launcher");
this.add("com.qi.xiaoshi");
this.add("com.hardware.cn");
this.add("com.qi.gamemodel");
this.add("com.wyt.tongbuyouxue");
this.add("com.qi.wyt.setting");
this.add("air.wyt.modloader");
// this.add("com.google.android.inputmethod.pinyin");
this.add("com.android.calculator2");
this.add("com.qi.TFSystem");
this.add("com.qi.appstore");
this.add("com.wyt.evaluating");
this.add("com.wyt.picturebook");
this.add("com.hhdd.kadahd");
this.add("com.wyt.onlinedic");
this.add("com.ximalaya.ting.kid");
this.add("com.baidu.duershow.child");
this.add("com.gl.souti");
this.add("com.ihuman.pinyin");
this.add("com.hongen.app.word");
this.add("com.wyt.parents_assistant");
this.add("com.wyt.forbitpoint");
this.add("com.wyt.lessonhelper");
this.add("com.wyt.wangkexueximvvm");
this.add("com.wyt.clicktoread");
this.add("com.robot.app_ai");
this.add("com.wyt.appstore");
this.add("air.com.wyt.GLLearnMain");
this.add("com.wyt.examcenter");
this.add("com.gl.compositioncorrection");
this.add("com.gl.compositioncorrectionen");
this.add("cn.wps.moffice_eng");
this.add("com.ckl.launcher");
this.add("net.forclass.fcstudent");
this.add("com.creative.strokeprovider");
this.add("com.ckl.oraltraining");
this.add("com.ckl.fcfilemanager");
this.add("com.iflytek.inputmethod");
this.add("com.wyt.wangkexueximvvm1");
this.add("com.android.stk");
this.add("com.shoufei.aole");
this.add("com.ygyb.yischool");
this.add("com.tencent.wework");
this.add("com.tencent.mm");
this.add("com.baidu.BaiduMap");
this.add("com.jxw.singsound");
this.add("com.qunyu.dividedroad");
this.add("com.gl.dwlauncher");
this.add("com.gl.dongwa");
}};
public static Set<String> jxwApp = new HashSet<String>() {{
this.add("air.com.zhihuiyoujiao.flashplayer");
this.add("com.example.arithmeticformula");
this.add("com.example.elementcycleapp");
this.add("com.example.pianpangbushou");
this.add("com.iflytek.cyber.iot.show.core");
this.add("com.iflytek.speechcloud");
this.add("com.jxw.bihuamingcheng");
this.add("com.jxw.bishunguize");
this.add("com.jxw.characterlearning");
this.add("com.jxw.dmxcy");
this.add("com.jxw.englishsoundmark");
this.add("com.jxw.examsystem");
this.add("com.jxw.game");
this.add("com.jxw.gb.zwpg");
this.add("com.jxw.handwrite");
this.add("com.jxw.jinfangyici");
this.add("com.jxw.jxwbook");
this.add("com.jxw.jxwcalculator");
this.add("com.jxw.laboratory");
this.add("com.jxw.learnchinesepinyin");
this.add("com.jxw.letterstudynew");
this.add("com.jxw.liancichengju");
this.add("com.jxw.mskt.video");
this.add("com.jxw.newyouer.video");
this.add("com.jxw.online_study");
this.add("com.jxw.question");
this.add("com.jxw.schultegrid");
this.add("com.jxw.singsound");
this.add("com.jxw.studydigital");
this.add("com.jxw.teacher.video");
this.add("com.jxw.wuweijidanci");
this.add("com.jxw.youer.video");
this.add("com.jxw.yuwenxiezuo");
this.add("com.jxw.yyhb");
this.add("com.jxw.zncd");
this.add("com.oirsdfg89.flg");
this.add("com.study.flashplayer");
this.add("com.tech.translate");
this.add("com.uiui.zybrowser");
this.add("com.uiui.zysn");
this.add("com.jxw.launcher");
this.add("com.uiui.zyappstore");
this.add("com.uiui.zy");
this.add("com.uiui.zyos");
this.add("com.teclast.zyos");
this.add("com.teclast.zybrowser");
this.add("com.teclast.zyappstore");
this.add("com.teclast.zy");
}};
public static final Set<String> systemApps = new HashSet<String>() {{
this.add("com.android.deskclock");
this.add("com.android.music");
this.add("com.android.documentsui");
this.add("com.mediatek.camera");
this.add("com.android.calendar");
this.add("com.android.calculator2");
this.add("com.android.gallery3d");
this.add("com.android.soundrecorder");
this.add("com.android.settings");
this.add("org.chromium.chrome");
this.add("com.softwinner.music");
this.add("com.softwinner.miracastReceiver");
this.add("com.softwinner.camera");
this.add("org.chromium.webview_shell");
// this.add("com.uiuipad.find");
// this.add("com.uiuipad.os");
this.add("com.softwinner.videoplayer");
this.add("com.sohu.inputmethod.sogou");
this.add("com.tencent.mtt");
}};
public static void showAllAPP(Context context) {
PackageManager pm = context.getPackageManager();
// 查询所有已经安装的应用程序

View File

@@ -44,6 +44,7 @@ import com.aoleyun.sn.bean.AppListInfo;
import com.aoleyun.sn.bean.Appground;
import com.aoleyun.sn.bean.BaseResponse;
import com.aoleyun.sn.bean.ForceDownloadData;
import com.aoleyun.sn.bean.LessonJson;
import com.aoleyun.sn.bean.NetAndLaunchBean;
import com.aoleyun.sn.bean.NetAndLaunchData;
import com.aoleyun.sn.bean.TTAppground;
@@ -122,6 +123,9 @@ public class JGYUtils {
private Context mContext;
private ContentResolver crv;
private LessonJson mLessonJson;
private TimeUtils.ContralTime mContralTime;
public static final int UnknowPlatform = 0;
public static final int MTKPlatform = 1;
public static final int CubePlatform = 2;
@@ -134,6 +138,7 @@ public class JGYUtils {
public static final int G10PPlatform = 12;
public static final int C2Platform = 13;
public static final int YXPD1Platform = 15;
public static final int G11Platform = 16;
public static final String Other = "其他";
@@ -148,6 +153,7 @@ public class JGYUtils {
public static final String G10PTag = "G10P";
public static final String C2Tag = "MTK8183";
public static final String YXPD1TAG = "YXPD1";
public static final String G11TAG = "MTKG11";
private CacheHelper cacheHelper;
@@ -186,6 +192,7 @@ public class JGYUtils {
};
bindEbaifenService();
}
refresh();
}
public static void init(Context context) {
@@ -266,6 +273,9 @@ public class JGYUtils {
} else if (YXPD1TAG.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "YXPD1");
return YXPD1Platform;
} else if (G11TAG.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "MTKG11");
return G11Platform;
} else {
Log.i(TAG, "checkAppPlatform: " + "没有数据");
return UnknowPlatform;
@@ -310,6 +320,8 @@ public class JGYUtils {
getAppPlatformCallback.AppPlatform(C2Platform);
} else if (YXPD1TAG.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(YXPD1Platform);
} else if (G11TAG.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(G11Platform);
} else {
getAppPlatformCallback.AppPlatform(UnknowPlatform);
}
@@ -337,6 +349,10 @@ public class JGYUtils {
return G10PTag;
} else if (C2Tag.equalsIgnoreCase(platform)) {
return C2Tag;
} else if (YXPD1TAG.equalsIgnoreCase(platform)) {
return YXPD1TAG;
} else if (G11TAG.equalsIgnoreCase(platform)) {
return G11TAG;
} else {
return Other;
}
@@ -1191,8 +1207,6 @@ public class JGYUtils {
HashSet<String> defaultPackages = new HashSet<String>() {{
this.add(BuildConfig.APPLICATION_ID);
this.add(PackageNames.OLD_DEVICE_INFO);//设备信息
this.add(PackageNames.OLD_APPSTORE);//教管壹
this.add(PackageNames.DEVICE_INFO);
this.add(PackageNames.APPSTORE);
this.add("com.info.sn");
@@ -1227,8 +1241,14 @@ public class JGYUtils {
pkgSet.addAll(defaultPackages);
pkgSet.addAll(ApkUtils.desktopAPP);
pkgSet.addAll(ApkUtils.aoleyunAPP);
pkgSet.addAll(ApkUtils.aihuaApp);
pkgSet.addAll(ApkUtils.jxwApp);
if ("AS001".equals(Build.MODEL))
pkgSet.addAll(ApkUtils.aihuaApp);
if ("D1".equals(Build.MODEL))
pkgSet.addAll(ApkUtils.dongwa);
if ("G23".equals(Build.MODEL))
pkgSet.addAll(ApkUtils.zhengwu);
pkgSet.removeIf(TextUtils::isEmpty);
if (JGYUtils.C2Tag.equalsIgnoreCase(JGYUtils.getInstance().getAppPlatform())) {
pkgSet.remove("com.tencent.mm");
@@ -1250,8 +1270,13 @@ public class JGYUtils {
HashSet<String> pkgSet = new HashSet<>(defaultPackages);
pkgSet.addAll(ApkUtils.desktopAPP);
pkgSet.addAll(ApkUtils.aoleyunAPP);
pkgSet.addAll(ApkUtils.aihuaApp);
pkgSet.addAll(ApkUtils.jxwApp);
if ("AS001".equals(Build.MODEL))
pkgSet.addAll(ApkUtils.aihuaApp);
if ("D1".equals(Build.MODEL))
pkgSet.addAll(ApkUtils.dongwa);
if ("G23".equals(Build.MODEL))
pkgSet.addAll(ApkUtils.zhengwu);
if (JGYUtils.C2Tag.equalsIgnoreCase(JGYUtils.getInstance().getAppPlatform())) {
pkgSet.remove("com.tencent.mm");
}
@@ -1586,7 +1611,11 @@ public class JGYUtils {
*/
public void hideSystemAPP() {
PackageManager pm = mContext.getPackageManager();
try {
pm.setApplicationEnabledSetting("com.yxxmk.uiui", PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
} catch (Exception e) {
Log.e(TAG, "hideSystemAPP: " + e.getMessage());
}
Intent filterIntent = new Intent(Intent.ACTION_MAIN, null);
//Intent.CATEGORY_LAUNCHER主要的过滤条件
filterIntent.addCategory(Intent.CATEGORY_LAUNCHER);
@@ -1772,6 +1801,7 @@ public class JGYUtils {
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G10PPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform
) {
Settings.Global.putInt(crv, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, state == 1 ? 0 : 1);
Settings.Global.putInt(crv, Settings.Global.ADB_ENABLED, state == 1 ? 0 : 1);
@@ -2009,7 +2039,7 @@ public class JGYUtils {
/**
* 如果界面正在最近任务列表有些app可能不会被清理
*/
private void gotoLauncher() {
public void gotoLauncher() {
Intent i = new Intent(Intent.ACTION_MAIN);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //android123提示如果是服务里调用必须加入new task标识
i.addCategory(Intent.CATEGORY_HOME);
@@ -2223,13 +2253,33 @@ public class JGYUtils {
}
public void checkDefaultDesktop(String pkg) {
String desktopPkg = (String) SPUtils.get(mContext, "default_launcher", "");
String desktopPkg = getDefaultDesktop();
// String desktopPkg = (String) SPUtils.get(mContext, "default_launcher", "");
Log.e(TAG, "checkDefaultDesktop: " + desktopPkg);
if (desktopPkg.equalsIgnoreCase(pkg)) {
if (pkg.equalsIgnoreCase(desktopPkg)) {
setDefaultDesktop(pkg);
}
}
/**
* 获取默认的简易桌面,学习桌面或者默认应用桌面
*
* @return
*/
public String getDefaultDesktop() {
String defaultDesktop = mMMKV.decodeString(CommonConfig.DEFAULT_DESKTOP_PACKAGE_NAME, "");
String defaultLauncher = mMMKV.decodeString(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
if (TextUtils.isEmpty(defaultDesktop)) {
if (TextUtils.isEmpty(defaultLauncher)) {
return "";
} else {
return defaultLauncher;
}
} else {
return defaultDesktop;
}
}
/**
* 设置奥乐云桌面为默认
*/
@@ -2789,6 +2839,9 @@ public class JGYUtils {
}
}
/**
*
*/
private Set<String> mJxwApps = new HashSet<String>() {{
this.add("air.com.zhihuiyoujiao.flashplayer");
this.add("com.example.arithmeticformula");
@@ -3009,7 +3062,6 @@ public class JGYUtils {
}
}
/**
* No. 55
* 设置默认浏览器
@@ -3034,4 +3086,51 @@ public class JGYUtils {
ForegroundAppUtil.openTopApp(mContext);
}
}
public void refresh() {
String jsonString = mMMKV.decodeString(CommonConfig.CLOUD_LESSON_SETTINGS_KEY);
if (!TextUtils.isEmpty(jsonString)) {
Gson gson = new Gson();
Type type = new TypeToken<LessonJson>() {
}.getType();
LessonJson lessonJson = gson.fromJson(jsonString, type);
if (lessonJson != null) {
this.mLessonJson = lessonJson;
TimeUtils.ContralTime contralTime = TimeUtils.getContralTime(mContext, lessonJson.getStart_time(), lessonJson.getEnd_time());
if (contralTime != null) {
mContralTime = contralTime;
}
}
}
}
/**
* @param pkg
* @return true为能打开
*/
public boolean isCloudLessonMod(String pkg) {
if (ApkUtils.isSystemApp(mContext, pkg)) {
Log.e(TAG, "isCloudLessonMod: is system app");
return true;
}
if (mJxwApps.contains(pkg)) {
return true;
}
if (mLessonJson == null)
return true;
if (mLessonJson.getIs_lesson() == 1) {
if (mContralTime == null) {
return false;
} else {
String pkgs = mLessonJson.getPkgs();
if (mContralTime.inControlTime()) {
return pkgs.contains(pkg);
} else {
return false;
}
}
} else {
return true;
}
}
}

View File

@@ -12,6 +12,7 @@ import android.text.TextUtils;
import android.util.Log;
import com.aoleyun.sn.BuildConfig;
import com.aoleyun.sn.bean.SnSetting;
import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.comm.JGYActions;
import com.aoleyun.sn.gson.GsonUtils;
@@ -71,7 +72,11 @@ public class SysSettingUtils {
Log.e("setDisableSetting", "Close all settings: ");
setPhoneList(context, 1);
setUSBstate(context, 1);
if (JGYUtils.getInstance().getAppPlatform().equals(JGYUtils.YXPD1TAG)) {
setBluetooth(context, 1);
} else {
setBluetooth(context, 0);
}
setHotspot(context, 1);
setBar(context, 1);
setCamera(context, 1);
@@ -246,7 +251,6 @@ public class SysSettingUtils {
context.sendBroadcast(usbIntent);
}
}
}
private static void setBluetooth(Context context, int state) {
@@ -654,7 +658,7 @@ public class SysSettingUtils {
}
private static void setCanReset(Context context, int state) {
boolean aole_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 0);
boolean aole_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, state);
Log.e(TAG, "aole_restore_forbid_on: " + aole_restore_forbid_on);
//默认打开
}
@@ -822,10 +826,10 @@ public class SysSettingUtils {
JsonElement appInstall = jsonObject.get("is_app_install");
if (appInstall != null) {
int is_app_install = appInstall.getAsInt();
Log.e(TAG, "setAdminApp: is_admin_app = " + is_app_install);
Settings.System.putInt(context.getContentResolver(), "aole_app_allow_install", changeNum(is_app_install));
Log.e(TAG, "setAdminApp: is_app_install = " + is_app_install);
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, is_app_install);
} else {
Settings.System.putInt(context.getContentResolver(), "aole_app_allow_install", 1);
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, 0);
}
JsonElement adminApp = jsonObject.get("is_admin_app");
@@ -847,7 +851,147 @@ public class SysSettingUtils {
private static void setAdminApp(Context context, int state) {
Log.e(TAG, "setAdminApp: state = " + state);
Settings.Global.putInt(context.getContentResolver(), "is_admin_app", state);
Settings.System.putInt(context.getContentResolver(), "aole_app_allow_install", changeNum(state));
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, changeNum(state));
Settings.Global.putInt(context.getContentResolver(), "is_admin_app", changeNum(state));
}
public static void setSnSetting(Context context, SnSetting snSetting) {
if (snSetting != null) {
int is_timecontrol = snSetting.getIs_timecontrol();
if (is_timecontrol == 0) {
TimeUtils.setEmpty(context);
TimeUtils.ContralTime c = TimeUtils.getDefaltContralTime(context);
if (null != c) {
Log.e("getTimeControl", c.toString());
}
} else {
String start_time = snSetting.getTimecontrol_start();
String end_time = snSetting.getTimecontrol_end();
TimeUtils.ContralTime c = TimeUtils.String2ContralTime(context, start_time + "-" + end_time);
if (null != c) {
Log.e("getTimeControl", "OK:" + c.toString());
}
}
int is_storeinstall = snSetting.getIs_storeinstall();
Settings.Global.putInt(context.getContentResolver(), CommonConfig.AOLEYUN_APPSTORE_INSTALL, is_storeinstall);
int is_usb = snSetting.getIs_usb();
setUsb(context, changeNum(is_usb));
int is_bluetooth_file = snSetting.getIs_bluetooth_file();
setBluetooth(context, changeNum(is_bluetooth_file));
int is_developer = snSetting.getIs_developer();
JGYUtils.getInstance().setDeveloperOptions(changeNum(is_developer));
int is_restore = snSetting.getIs_restore();
setCanReset(context, changeNum(is_restore));
int is_topbar = snSetting.getIs_topbar();
setActionBar(context, changeNum(is_topbar));
int is_bottombar = snSetting.getIs_bottombar();
setNavigationBar(context, changeNum(is_bottombar));
int is_memory_card = snSetting.getIs_memory_card();
setTF(context, changeNum(is_memory_card));
} else {
TimeUtils.setEmpty(context);
TimeUtils.ContralTime c = TimeUtils.getDefaltContralTime(context);
if (null != c) {
Log.e("getTimeControl", c.toString());
}
Settings.Global.putInt(context.getContentResolver(), CommonConfig.AOLEYUN_APPSTORE_INSTALL, 1);
setUsb(context, 0);
setBluetooth(context, 0);
JGYUtils.getInstance().setDeveloperOptions(1);
setCanReset(context, 0);
setActionBar(context, 0);
setNavigationBar(context, 0);
setTF(context, 0);
}
}
private static void setActionBar(Context context, int status) {
//状态栏显示开关
int oldNum = Settings.System.getInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0);
if (oldNum != status) {
//写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示
boolean aole_hide_statusBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, status);
Log.e(TAG, "aole_hide_statusBar: " + aole_hide_statusBar);
String statusbarStatus = "";
switch (status) {
case 0:
statusbarStatus = CommonConfig.AOLE_ACTION_SHOW_STATUS_BAR;
break;
case 1:
statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR;
break;
default:
}
Intent statusIntent = new Intent(statusbarStatus);
// Intent statusIntent = new Intent(statusbarStatus).setPackage("com.android.systemui");
context.sendBroadcast(statusIntent);
}
}
private static void setNavigationBar(Context context, int status) {
//写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示
boolean aole_hide_NavigationBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR, status);
Log.e(TAG, "aole_hide_NavigationBar---------" + aole_hide_NavigationBar);
String navigationStatus = "";
switch (status) {
case 0:
navigationStatus = CommonConfig.AOLE_ACTION_SHOW_NAVIGATION_BAR;
break;
case 1:
navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR;
break;
default:
}
Intent navIntent = new Intent(navigationStatus);
// Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui");
context.sendBroadcast(navIntent);
}
private static void setUsb(Context context, int status) {
//USB数据功能管控
//仅充电usb_charge
//MTP模式usb_mtp
//Midi模式usb_midi
if (JGYUtils.isCubeDevice()) {
SuperPower mService = (SuperPower) context.getSystemService("mdm");
switch (status) {
case 0:
mService.setUsbDataDisabled(true);
break;
case 1:
mService.setUsbDataDisabled(false);
break;
default:
}
} else {
String usbStatus;
switch (status) {
default:
case 0:
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
JGYUtils.getInstance().setMtpEnable(false);
break;
case 1:
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP;
JGYUtils.getInstance().setMtpEnable(true);
break;
case 2:
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MIDI;
JGYUtils.getInstance().setMtpEnable(false);
break;
}
Intent usbIntent = new Intent(usbStatus);
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform
) {
usbIntent.setPackage("com.android.settings");
}
context.sendBroadcast(usbIntent);
}
}
}

View File

@@ -142,6 +142,33 @@ public class TimeUtils {
}
}
/**
* 是否在管控时间内
*
* @param context
* @param startTime
* @param endTime
* @return
*/
public static ContralTime getContralTime(Context context, String startTime, String endTime) {
if (null == startTime || null == endTime || ("00:00".equals(startTime) && "00:00".equals(endTime))) {
return null;
} else {
try {
Date startDate = df.parse(startTime.trim());
Date endDate = df.parse(endTime.trim());
ContralTime contralTime = new ContralTime();
contralTime.setStartTime(df.format(startDate));
contralTime.setEndTime(df.format(endDate));
return contralTime;
} catch (ParseException e) {
e.printStackTrace();
return null;
}
}
}
public static ContralTime String2ContralTime(Context context, @NonNull String timeText) {
DateFormat df = ContralTime.getDf();
String[] time = timeText.trim().split("-");
@@ -241,6 +268,14 @@ public class TimeUtils {
return df.format(new Date(time));
}
/**
* @return 这个时反的,为了对接专注模式
*/
public boolean inControlTime() {
long time = System.currentTimeMillis();
return !inControlTime(time);
}
public boolean inControlTime(long time) {
return inControlTime(df.format(new Date(time)));
}
@@ -256,6 +291,11 @@ public class TimeUtils {
try {
Date startDate = df.parse(startTime);
Date endDate = df.parse(endTime);
Log.e(TAG, "inControlTime: startDate time = " +startDate.getTime());
Log.e(TAG, "inControlTime: endDate time = " +endDate.getTime());
if (startDate.getTime() == endDate.getTime()) {
return false;
}
Date nowDate = df.parse(time);
if (startDate.getTime() > endDate.getTime()) {
//开始时间大于结束时间 列 1600-0100

View File

@@ -1773,6 +1773,7 @@ public class Utils {
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G10PPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform
) {
return Utils.getProperty("ro.build.display.id", "获取失败");
} else {