1.4.0202 增加易学派平台

This commit is contained in:
2024-02-28 10:15:59 +08:00
parent 6d8e4509f0
commit 367c8e333c
8 changed files with 86 additions and 27 deletions

View File

@@ -67,10 +67,18 @@ public class SplashActivity extends AppCompatActivity {
new Handler().postDelayed(() -> {
startActivity(new Intent(SplashActivity.this, MainActivity.class));
finish();
// sendBroadcastStatus("0");
// startActivity(new Intent(SplashActivity.this, CheckNetActivity.class));
}, 2000);
}
public void sendBroadcastStatus(String status) {
Intent intent = new Intent("receiver");
intent.setPackage("com.aoleyunos.dop7");
intent.putExtra("login_status", status);
sendBroadcast(intent);
}
private void setBar() {
UltimateBarX.statusBar(this)
.transparent()
@@ -145,11 +153,11 @@ public class SplashActivity extends AppCompatActivity {
Log.i(TAG, "DebugTest: aole_hide_NavigationBar: " + Settings.System.getString(getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR));
String only_jgy_shortcut_list = Settings.System.getString(getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
Log.i(TAG, "debugTest: only_jgy_shortcut_list:" + only_jgy_shortcut_list);
String aole_app_forbid = Settings.System.getString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
if (!TextUtils.isEmpty(aole_app_forbid)) {
Settings.System.putString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid + ",com.aoleyun.browser");
}
Log.e(TAG, "debugTest: aole_app_forbid:" + aole_app_forbid);
// String aole_app_forbid = Settings.System.getString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
// if (!TextUtils.isEmpty(aole_app_forbid)) {
// Settings.System.putString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid + ",com.aoleyun.browser");
// }
// Log.e(TAG, "debugTest: aole_app_forbid:" + aole_app_forbid);
Log.i(TAG, "debugTest: ip = " + JGYUtils.getInstance().getIPAddress());
Log.i(TAG, "debugTest: getPackage = " + Utils.getPackage());
Log.i(TAG, "debugTest: getMacAddress = " + Utils.getAndroid10MAC(this));

View File

@@ -1277,7 +1277,7 @@ public class NetInterfaceManager {
JGYUtils.getInstance().installDesktop(data);
setDefaultDesktop(desktopInfo.getApp_package());
} else {
Log.e("getDefaultDesktop", "onNext: " + "删除定制桌面");
Log.e("getDefaultDesktop", "onNext: " + "删除定制桌面");
cacheHelper.put(UrlAddress.GET_DESKTOP, "");
// String whiteList = Settings.System.getString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
for (String s : ApkUtils.desktopAPP) {
@@ -2219,7 +2219,10 @@ public class NetInterfaceManager {
// Log.e( "getLockedState", "onNext: " + "state changed , reset devices");
// Utils.doMasterClear(mContext);
// }
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform) {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform
) {
JGYUtils.getInstance().showApp(PackageNames.YIXUEPAI_DESKTOP);
JGYUtils.getInstance().setYxpDefaultDesktop();
}
@@ -2228,7 +2231,10 @@ public class NetInterfaceManager {
} else if (locked == JGYActions.NET_CODE_UNLOCKED) {
// SysSettingUtils.setEnableSetting(mContext);
JGYUtils.getInstance().writeAppPackageList();
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform) {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform
) {
JGYUtils.getInstance().hideApp(PackageNames.YIXUEPAI_DESKTOP);
JGYUtils.getInstance().setDefaultDesktop();
StatusBarManager mStatusBarManager = (StatusBarManager) mContext.getSystemService(Context.STATUS_BAR_SERVICE);
@@ -2236,7 +2242,9 @@ public class NetInterfaceManager {
}
Settings.System.putInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_UNLOCKED);
Settings.System.putInt(mContext.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, 1);
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, "");
JGYUtils.getInstance().addAppInstallWhiteList(new ArrayList<>());
JGYUtils.getInstance().setAppRestriction(0);
}
} else if (response.code == NOTFOUND) {
Settings.System.putInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
@@ -2448,6 +2456,8 @@ public class NetInterfaceManager {
tagSets.add(JGYUtils.G10PTag);
} else if (platform == JGYUtils.C2Platform) {
tagSets.add(JGYUtils.C2Tag);
} else if (platform == JGYUtils.YXPD1Platform) {
tagSets.add(JGYUtils.YXPD1TAG);
}
});
Log.e(TAG, "clearAndAppendTags: " + tagSets);
@@ -3162,7 +3172,7 @@ public class NetInterfaceManager {
cacheHelper.put(UrlAddress.SET_WHITE_PACKAGE_LIST, GsonUtils.toJSONString(strings));
//开机图标 只记录后台传的包名
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, pkgString));
JGYUtils.getInstance().writeAppPackageList(mContext, pkgString);
JGYUtils.getInstance().writeAppPackageList(pkgString);
JGYUtils.getInstance().deleteOtherApp();
}
}
@@ -3198,7 +3208,7 @@ public class NetInterfaceManager {
String result = appLimit.getResult();
//开机图标 只记录后台传的包名
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, result));
JGYUtils.getInstance().writeAppPackageList(mContext, result);
JGYUtils.getInstance().writeAppPackageList(result);
JGYUtils.getInstance().deleteOtherApp();
} else {
Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, "");
@@ -3507,7 +3517,7 @@ public class NetInterfaceManager {
} else {
if ("YX-T01".equalsIgnoreCase(Build.MODEL)) {
JGYUtils.getInstance().setTongyiAppTop();
}else {
} else {
cacheHelper.put(UrlAddress.GET_TOP_APP_CONTROL, "");
ForegroundAppUtil.setTopAppClass(mContext, "");
Settings.Global.putString(mContext.getContentResolver(), ForegroundAppUtil.TOPAPP_KEY, "");

View File

@@ -413,7 +413,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
// }
// }, UserHandle.ALL);
//根据要求卸载这两个应用
if (!JGYUtils.getInstance().getDeviceIsLocked()) {
if (JGYUtils.getInstance().getDeviceIsLocked()) {
ApkUtils.UninstallAPP(this, "com.joytv.live");
ApkUtils.UninstallAPP(this, "com.tencent.android.qqdownloader");
}

View File

@@ -791,6 +791,7 @@ public class ApkUtils {
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");

View File

@@ -133,6 +133,7 @@ public class JGYUtils {
public static final int HRAD13Platform = 11;
public static final int G10PPlatform = 12;
public static final int C2Platform = 13;
public static final int YXPD1Platform = 15;
public static final String Other = "其他";
@@ -146,6 +147,7 @@ public class JGYUtils {
public static final String HRAD13Tag = "HRAD13";
public static final String G10PTag = "G10P";
public static final String C2Tag = "MTK8183";
public static final String YXPD1TAG = "YXPD1";
private CacheHelper cacheHelper;
@@ -261,6 +263,9 @@ public class JGYUtils {
} else if (C2Tag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "C2");
return C2Platform;
} else if (YXPD1TAG.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "YXPD1");
return YXPD1Platform;
} else {
Log.i(TAG, "checkAppPlatform: " + "没有数据");
return UnknowPlatform;
@@ -303,6 +308,8 @@ public class JGYUtils {
getAppPlatformCallback.AppPlatform(G10PPlatform);
} else if (C2Tag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(C2Platform);
} else if (YXPD1TAG.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(YXPD1Platform);
} else {
getAppPlatformCallback.AppPlatform(UnknowPlatform);
}
@@ -1209,8 +1216,13 @@ public class JGYUtils {
}};
@SuppressLint("NewApi")
public void writeAppPackageList(Context context, String packageList) {
ApkUtils.addShortcut(context);
public void writeAppPackageList(String packageList) {
if (isUnlocked(mContext)) {
addAppInstallWhiteList(new ArrayList<>());
setAppRestriction(0);
return;
}
ApkUtils.addShortcut(mContext);
HashSet<String> pkgSet = new HashSet<>(Arrays.asList(packageList.split(",")));
pkgSet.addAll(defaultPackages);
pkgSet.addAll(ApkUtils.desktopAPP);
@@ -1230,6 +1242,11 @@ public class JGYUtils {
}
public void writeAppPackageList() {
if (isUnlocked(mContext)) {
addAppInstallWhiteList(new ArrayList<>());
setAppRestriction(0);
return;
}
HashSet<String> pkgSet = new HashSet<>(defaultPackages);
pkgSet.addAll(ApkUtils.desktopAPP);
pkgSet.addAll(ApkUtils.aoleyunAPP);
@@ -1453,8 +1470,8 @@ public class JGYUtils {
) {
return;
}
int locked = Settings.System.getInt(crv, JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
if (locked == 1) {
if (isUnlocked(mContext)) {
return;
}
int aihuaUnlock = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0);
@@ -1569,6 +1586,7 @@ public class JGYUtils {
*/
public void hideSystemAPP() {
PackageManager pm = mContext.getPackageManager();
pm.setApplicationEnabledSetting("com.yxxmk.uiui", PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
Intent filterIntent = new Intent(Intent.ACTION_MAIN, null);
//Intent.CATEGORY_LAUNCHER主要的过滤条件
filterIntent.addCategory(Intent.CATEGORY_LAUNCHER);
@@ -1583,6 +1601,7 @@ public class JGYUtils {
}
if (!showAppList.contains(pkg)
&& !ApkUtils.aoleyunAPP.contains(pkg)
&& !ApkUtils.desktopAPP.contains(pkg)
&& !ApkUtils.aihuaApp.contains(pkg)
) {
pm.setApplicationEnabledSetting(pkg, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
@@ -1752,6 +1771,7 @@ public class JGYUtils {
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.HRAD13Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G10PPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform
) {
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);
@@ -2823,6 +2843,11 @@ public class JGYUtils {
}};
public static boolean isUnlocked(Context context) {
int locked = Settings.System.getInt(context.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
return locked == JGYActions.FRAME_CODE_UNLOCKED;
}
/**
* 启用/禁用MTP数据传输功能
*
@@ -2895,7 +2920,7 @@ public class JGYUtils {
*
* @param pattern 0:普通模式黑白名单都不生效1黑名单模式2白名单模式
**/
void setAppRestriction(int pattern) {
public void setAppRestriction(int pattern) {
if (C2Tag.equals(BuildConfig.platform)) {
Log.e("ITools", "setAppRestriction: " + pattern);
try {
@@ -2924,7 +2949,7 @@ public class JGYUtils {
*
* @param packageNameList 包名列表
**/
void addAppInstallWhiteList(List<String> packageNameList) {
public void addAppInstallWhiteList(List<String> packageNameList) {
if (C2Tag.equals(BuildConfig.platform)) {
Log.e("ITools", "addAppInstallWhiteList: " + packageNameList);
try {

View File

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