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(() => { - return blacklistedModules[id]?.antifeatures || []; + return blacklistedModules.find((mod) => mod.id === id)?.antifeatures || []; }, [id]); return ( diff --git a/Website/src/components/module/ExploreModule.tsx b/Website/src/components/module/ExploreModule.tsx index b52fd949..bb952f8d 100644 --- a/Website/src/components/module/ExploreModule.tsx +++ b/Website/src/components/module/ExploreModule.tsx @@ -32,7 +32,7 @@ const ExploreModule = React.memo((props) => { const formatLastUpdate = useFormatDate(timestamp ? timestamp : versions[versions.length - 1].timestamp); const findHardCodedAntifeature = React.useMemo(() => { - return [...(track.antifeatures || []), ...(blacklistedModules[id]?.antifeatures || [])]; + return [...(track.antifeatures || []), ...(blacklistedModules.find((mod) => mod.id === id)?.antifeatures || [])]; }, [id, track.antifeatures]); const handleOpenModule = () => { diff --git a/Website/src/locales/antifeatures/en.ts b/Website/src/locales/antifeatures/en.ts index ca6ae248..18673a50 100644 --- a/Website/src/locales/antifeatures/en.ts +++ b/Website/src/locales/antifeatures/en.ts @@ -7,12 +7,12 @@ export const en_antifeatures = [ { id: "KnownVuln", name: "Known Vulnerability", - desc: "This app contains a known security vulnerability", + desc: "This module contains a known security vulnerability", }, { id: "NSFW", name: "NSFW", - desc: "This app contains content that should not be publicized or visible everywhere", + desc: "This module contains content that should not be publicized or visible everywhere", }, { id: "NoSourceSince", @@ -22,27 +22,27 @@ export const en_antifeatures = [ { id: "NonFreeAdd", name: "Non-Free Addons", - desc: "This app promotes non-free add-ons", + desc: "This module promotes non-free add-ons", }, { id: "NonFreeAssets", name: "Non-Free Assets", - desc: "This app contains non-free assets", + desc: "This module contains non-free assets", }, { id: "NonFreeDep", name: "Non-Free Dependencies", - desc: "This app depends on other non-free apps", + desc: "This module depends on other non-free modules", }, { id: "NonFreeNet", name: "Non-Free Network Services", - desc: "This app promotes or depends entirely on a non-changeable or non-free network service", + desc: "This module promotes or depends entirely on a non-changeable or non-free network service", }, { id: "Tracking", name: "Tracking", - desc: "This app tracks and reports your activity", + desc: "This module tracks and reports your activity", }, { id: "UpstreamNonFree", @@ -52,6 +52,6 @@ export const en_antifeatures = [ { id: "Obfuscation", name: "Obfuscation", - desc: "The app source code is may obfuscated, making it difficult to understand, audit, or modify.", + desc: "The module source code is may obfuscated, making it difficult to understand, audit, or modify.", }, ]; diff --git a/Website/src/locales/en.ts b/Website/src/locales/en.ts index 53ae76b7..8806f6b6 100644 --- a/Website/src/locales/en.ts +++ b/Website/src/locales/en.ts @@ -135,4 +135,6 @@ export const en = { print_errors: "Print errors", print_errors_desc: "Prints terminal and MMRL Install Tools error to the console", + + blacklisted_modules: "Blacklisted modules", }; diff --git a/Website/src/util/blacklisted-modules.ts b/Website/src/util/blacklisted-modules.ts index 3152ff3f..390c42eb 100644 --- a/Website/src/util/blacklisted-modules.ts +++ b/Website/src/util/blacklisted-modules.ts @@ -1,6 +1,21 @@ -export const blacklistedModules = { - zygisksu: { +export interface BlacklistedModule { + id: string; + source: string; + hidden: boolean; + antifeatures: Track["antifeatures"]; +} + +export const blacklistedModules: BlacklistedModule[] = [ + { + id: "zygisksu", + source: "https://github.com/Dr-TSNG/ZygiskNext", hidden: false, antifeatures: ["Obfuscation", "NoSourceSince"], }, -}; + { + id: "ATWEAKER", + source: "https://github.com/C0d3h01/AndroidTweaker", + hidden: false, + antifeatures: ["NoSourceSince"], + }, +];