feat: 添加onyx设置重定向并禁用系统应用隐藏
This commit is contained in:
@@ -75,8 +75,8 @@ android {
|
|||||||
minSdkVersion 26
|
minSdkVersion 26
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
|
|
||||||
versionCode 211
|
versionCode 215
|
||||||
versionName "1.6.0920"
|
versionName "1.6.0930"
|
||||||
|
|
||||||
ndk {
|
ndk {
|
||||||
//选择要添加的对应 cpu 类型的 .so 库。
|
//选择要添加的对应 cpu 类型的 .so 库。
|
||||||
|
|||||||
@@ -488,7 +488,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
|
|||||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.seewoPlatform
|
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.seewoPlatform
|
||||||
) {
|
) {
|
||||||
wallpaperManager.setBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.wallpapers_aiudu));
|
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();
|
// wallpaperManager.clear();
|
||||||
} else {
|
} else {
|
||||||
wallpaperManager.setBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.wallpapers));
|
wallpaperManager.setBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.wallpapers));
|
||||||
|
|||||||
@@ -361,6 +361,7 @@ public class LoaderTask implements Runnable {
|
|||||||
this.add("com.ss.android.ugc.aweme");
|
this.add("com.ss.android.ugc.aweme");
|
||||||
this.add("com.tencent.mm");
|
this.add("com.tencent.mm");
|
||||||
this.add("com.google.android.inputmethod.pinyin");
|
this.add("com.google.android.inputmethod.pinyin");
|
||||||
|
this.add("com.onyx");
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|
||||||
@@ -561,6 +562,11 @@ public class LoaderTask implements Runnable {
|
|||||||
ComponentName cn = intent.getComponent();
|
ComponentName cn = intent.getComponent();
|
||||||
targetPkg = cn == null ? intent.getPackage() : cn.getPackageName();
|
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 (allUsers.indexOfValue(c.user) < 0) {
|
||||||
if (c.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) {
|
if (c.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) {
|
||||||
c.markDeleted("Legacy shortcuts are only allowed for current users");
|
c.markDeleted("Legacy shortcuts are only allowed for current users");
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import static com.aoleyun.os.ItemInfoWithIcon.FLAG_DISABLED_SUSPENDED;
|
|||||||
import static com.aoleyun.os.model.AppLaunchTracker.CONTAINER_ALL_APPS;
|
import static com.aoleyun.os.model.AppLaunchTracker.CONTAINER_ALL_APPS;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Process;
|
import android.os.Process;
|
||||||
@@ -109,6 +110,19 @@ public class ItemClickHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Object tag = v.getTag();
|
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) {
|
if (tag instanceof WorkspaceItemInfo) {
|
||||||
String packageName = ((WorkspaceItemInfo) tag).getTargetComponent().getPackageName();
|
String packageName = ((WorkspaceItemInfo) tag).getTargetComponent().getPackageName();
|
||||||
if (is_forbid(v.getContext(), packageName)) {
|
if (is_forbid(v.getContext(), packageName)) {
|
||||||
@@ -405,4 +419,18 @@ public class ItemClickHandler {
|
|||||||
}
|
}
|
||||||
launcher.startActivitySafely(v, intent, item, sourceContainer);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public class JgyUtils {
|
|||||||
} else if (seewoTag.equalsIgnoreCase(platform)) {
|
} else if (seewoTag.equalsIgnoreCase(platform)) {
|
||||||
Log.i(TAG, "checkAppPlatform: " + "seewo");
|
Log.i(TAG, "checkAppPlatform: " + "seewo");
|
||||||
return seewoPlatform;
|
return seewoPlatform;
|
||||||
}else if (Qualcomm_TAG.equalsIgnoreCase(platform)) {
|
} else if (Qualcomm_TAG.equalsIgnoreCase(platform)) {
|
||||||
Log.i(TAG, "checkAppPlatform: " + "QualcommA");
|
Log.i(TAG, "checkAppPlatform: " + "QualcommA");
|
||||||
return QualcommPlatform;
|
return QualcommPlatform;
|
||||||
} else if (DX11_TAG.equalsIgnoreCase(platform)) {
|
} else if (DX11_TAG.equalsIgnoreCase(platform)) {
|
||||||
@@ -313,6 +313,13 @@ public class JgyUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isDisable(Context context, String pkg) {
|
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");
|
String aole_disable_app_list = Settings.Global.getString(context.getContentResolver(), "aole_disable_app_list");
|
||||||
if (TextUtils.isEmpty(aole_disable_app_list)) {
|
if (TextUtils.isEmpty(aole_disable_app_list)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user