feat: 添加onyx设置重定向并禁用系统应用隐藏

This commit is contained in:
2026-10-12 15:31:46 +08:00
parent d2c7fdd5a8
commit b3bf7c77f5
5 changed files with 46 additions and 5 deletions

View File

@@ -75,8 +75,8 @@ android {
minSdkVersion 26
targetSdkVersion 28
versionCode 211
versionName "1.6.0920"
versionCode 215
versionName "1.6.0930"
ndk {
//选择要添加的对应 cpu 类型的 .so 库。

View File

@@ -488,7 +488,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.seewoPlatform
) {
wallpaperManager.setBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.wallpapers_aiudu));
// } else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
} else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
// wallpaperManager.clear();
} else {
wallpaperManager.setBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.wallpapers));

View File

@@ -361,6 +361,7 @@ public class LoaderTask implements Runnable {
this.add("com.ss.android.ugc.aweme");
this.add("com.tencent.mm");
this.add("com.google.android.inputmethod.pinyin");
this.add("com.onyx");
}};
@@ -561,6 +562,11 @@ public class LoaderTask implements Runnable {
ComponentName cn = intent.getComponent();
targetPkg = cn == null ? intent.getPackage() : cn.getPackageName();
if (!TextUtils.isEmpty(targetPkg) && SYSTEM_HIDE_APP.contains(targetPkg)) {
c.markDeleted("System hide app removed: " + targetPkg);
continue;
}
if (allUsers.indexOfValue(c.user) < 0) {
if (c.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) {
c.markDeleted("Legacy shortcuts are only allowed for current users");

View File

@@ -23,6 +23,7 @@ import static com.aoleyun.os.ItemInfoWithIcon.FLAG_DISABLED_SUSPENDED;
import static com.aoleyun.os.model.AppLaunchTracker.CONTAINER_ALL_APPS;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Process;
@@ -109,6 +110,19 @@ public class ItemClickHandler {
}
Object tag = v.getTag();
// 点击系统设置时,重定向到 onyx 设置页面
String pkgName = getTagPackageName(tag);
if ("com.android.settings".equals(pkgName)) {
Intent onyxSettingsIntent = new Intent();
onyxSettingsIntent.setComponent(
new ComponentName("com.onyx", "com.onyx.tablet.settings.SettingsActivity"));
onyxSettingsIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
launcher.startActivitySafely(v, onyxSettingsIntent,
tag instanceof ItemInfo ? (ItemInfo) tag : null, sourceContainer);
return;
}
if (tag instanceof WorkspaceItemInfo) {
String packageName = ((WorkspaceItemInfo) tag).getTargetComponent().getPackageName();
if (is_forbid(v.getContext(), packageName)) {
@@ -405,4 +419,18 @@ public class ItemClickHandler {
}
launcher.startActivitySafely(v, intent, item, sourceContainer);
}
/**
* 从点击的 tag 中提取包名,用于判断是否重定向到 onyx 设置页。
*/
private static String getTagPackageName(Object tag) {
if (tag instanceof WorkspaceItemInfo) {
ComponentName cn = ((WorkspaceItemInfo) tag).getTargetComponent();
return cn != null ? cn.getPackageName() : null;
} else if (tag instanceof AppInfo) {
ComponentName cn = ((AppInfo) tag).getTargetComponent();
return cn != null ? cn.getPackageName() : null;
}
return null;
}
}

View File

@@ -127,10 +127,10 @@ public class JgyUtils {
} else if (seewoTag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "seewo");
return seewoPlatform;
}else if (Qualcomm_TAG.equalsIgnoreCase(platform)) {
} else if (Qualcomm_TAG.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "QualcommA");
return QualcommPlatform;
} else if (DX11_TAG.equalsIgnoreCase(platform)) {
} else if (DX11_TAG.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "DX11");
return DX11Platform;
} else if (G12NL_TAG.equalsIgnoreCase(platform)) {
@@ -313,6 +313,13 @@ public class JgyUtils {
}
public static boolean isDisable(Context context, String pkg) {
if (
"org.chromium.chrome".equals(pkg)
|| "com.onyx.appmarket".equals(pkg)
// || "com.onyx.easytransfer".equals(pkg)
) {
return true;
}
String aole_disable_app_list = Settings.Global.getString(context.getContentResolver(), "aole_disable_app_list");
if (TextUtils.isEmpty(aole_disable_app_list)) {
return false;