From 920dae64610a6dfb394b58d458ddf77b69eba4e0 Mon Sep 17 00:00:00 2001
From: Der_Googler <54764558+DerGoogler@users.noreply.github.com>
Date: Tue, 21 May 2024 12:52:06 +0200
Subject: [PATCH] blacklist core ; ahhh
---
.github/ISSUE_TEMPLATE/mbl.yml | 22 ++++++
.../ViewBlacklistedModulesActivity.tsx | 77 +++++++++++++++++++
.../activitys/fragments/DrawerFragment.tsx | 14 ++++
.../src/components/AntiFeatureListItem.tsx | 5 +-
.../src/components/module/DeviceModule.tsx | 2 +-
.../src/components/module/ExploreModule.tsx | 2 +-
Website/src/locales/antifeatures/en.ts | 16 ++--
Website/src/locales/en.ts | 2 +
Website/src/util/blacklisted-modules.ts | 21 ++++-
9 files changed, 146 insertions(+), 15 deletions(-)
create mode 100644 .github/ISSUE_TEMPLATE/mbl.yml
create mode 100644 Website/src/activitys/ViewBlacklistedModulesActivity.tsx
diff --git a/.github/ISSUE_TEMPLATE/mbl.yml b/.github/ISSUE_TEMPLATE/mbl.yml
new file mode 100644
index 00000000..e6cd1f32
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/mbl.yml
@@ -0,0 +1,22 @@
+name: Module Blacklist Removal
+description: Issue template to request a blacklisted module removal
+title: '[MBL]: '
+body:
+ - type: input
+ id: moduleid
+ attributes:
+ label: Module ID
+ placeholder: mmrl_install_tools
+ validations:
+ required: true
+ - type: textarea
+ id: reason
+ attributes:
+ label: Reason why it should be removed
+ validations:
+ required: true
+ - type: markdown
+ attributes:
+ value: >-
+ This template was generated with [Issue Forms
+ Creator](https://issue-forms-creator.netlify.app)
diff --git a/Website/src/activitys/ViewBlacklistedModulesActivity.tsx b/Website/src/activitys/ViewBlacklistedModulesActivity.tsx
new file mode 100644
index 00000000..b820dbe7
--- /dev/null
+++ b/Website/src/activitys/ViewBlacklistedModulesActivity.tsx
@@ -0,0 +1,77 @@
+import AntiFeatureListItem from "@Components/AntiFeatureListItem";
+import Anchor from "@Components/dapi/Anchor";
+import { Page } from "@Components/onsenui/Page";
+import { Toolbar } from "@Components/onsenui/Toolbar";
+import { useActivity } from "@Hooks/useActivity";
+import { useStrings } from "@Hooks/useStrings";
+import { BlacklistedModule, blacklistedModules } from "@Util/blacklisted-modules";
+import { ExpandLess, ExpandMore } from "@mui/icons-material";
+import { Collapse, List, ListItem, ListItemIcon, ListItemText } from "@mui/material";
+import FlatList from "flatlist-react";
+import React from "react";
+
+interface BlacklistItemProps {
+ module: BlacklistedModule;
+}
+
+function BlacklistItem({ module }: BlacklistItemProps) {
+ const [open, setOpen] = React.useState(false);
+
+ const handleClick = () => {
+ setOpen((prev) => !prev);
+ };
+
+ return (
+ <>
+
+ {open ? : }
+
+
+
+
+
+
+
+ {typeof module.antifeatures === "string" ? (
+
+ ) : (
+ Array.isArray(module.antifeatures) && module.antifeatures.map((anti) => )
+ )}
+
+
+ >
+ );
+}
+
+function ViewBlacklistedModulesActivity() {
+ const { context } = useActivity();
+ const { strings } = useStrings();
+
+ const renderToolbar = () => {
+ return (
+
+
+
+
+ {strings("blacklisted_modules")}
+
+ );
+ };
+
+ return (
+
+
+
+ }
+ renderOnScroll
+ renderWhenEmpty={() => <>>}
+ />
+
+
+
+ );
+}
+
+export default ViewBlacklistedModulesActivity;
diff --git a/Website/src/activitys/fragments/DrawerFragment.tsx b/Website/src/activitys/fragments/DrawerFragment.tsx
index 6cf64b5a..4985c844 100644
--- a/Website/src/activitys/fragments/DrawerFragment.tsx
+++ b/Website/src/activitys/fragments/DrawerFragment.tsx
@@ -17,6 +17,7 @@ import LicensesActivity from "@Activitys/LicensesActivity";
import { SubmitModuleActivity } from "@Activitys/SubmitModuleActivity";
import { os } from "@Native/Os";
import { useTheme } from "@Hooks/useTheme";
+import ViewBlacklistedModulesActivity from "@Activitys/ViewBlacklistedModulesActivity";
type Props = {
renderToolbar: () => JSX.Element;
@@ -68,6 +69,19 @@ export const DrawerFragment = (props: Props) => {
>
+
+ {
+ pushPage({
+ component: ViewBlacklistedModulesActivity,
+ key: "ViewBlacklistedModulesActivity",
+ extra: {},
+ });
+ hide();
+ }}
+ >
+
+
diff --git a/Website/src/components/AntiFeatureListItem.tsx b/Website/src/components/AntiFeatureListItem.tsx
index b6f7da8e..6f9de23e 100644
--- a/Website/src/components/AntiFeatureListItem.tsx
+++ b/Website/src/components/AntiFeatureListItem.tsx
@@ -2,9 +2,10 @@ import { useStrings } from "@Hooks/useStrings";
import ListItem from "@mui/material/ListItem";
import { en_antifeatures } from "./../locales/antifeatures/en";
import React from "react";
-import { ListItemText } from "@mui/material";
+import { ListItemText, SxProps } from "@mui/material";
interface AntiFeatureListItemProps {
+ sx?: SxProps;
type: string;
}
@@ -14,7 +15,7 @@ const AntiFeatureListItem = (props: AntiFeatureListItemProps) => {
if (!find) return null;
return (
-
+
);
diff --git a/Website/src/components/module/DeviceModule.tsx b/Website/src/components/module/DeviceModule.tsx
index b56b1ab5..7790d159 100644
--- a/Website/src/components/module/DeviceModule.tsx
+++ b/Website/src/components/module/DeviceModule.tsx
@@ -63,7 +63,7 @@ const DeviceModule = React.memo((props) => {
const module_config_file = SuFile.exist(format("CONFINDEX"));
const findHardCodedAntifeature = React.useMemo