From f1ba456474a85cbc291bdb320a16721bd6108483 Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Thu, 23 Jan 2025 01:45:06 +0700 Subject: [PATCH 1/2] feat: support 263+ clients --- src/entry.ts | 1 + src/lib/ui/settings/index.tsx | 2 - src/lib/ui/settings/patches/panel.tsx | 72 --------------------------- src/metro/internals/modules.ts | 2 +- 4 files changed, 2 insertions(+), 75 deletions(-) delete mode 100644 src/lib/ui/settings/patches/panel.tsx diff --git a/src/entry.ts b/src/entry.ts index 6b8af88..73eabcf 100644 --- a/src/entry.ts +++ b/src/entry.ts @@ -66,6 +66,7 @@ if (typeof globalThis.__r !== "undefined") { _requireFunc = function patchedRequire(a: number) { // Initializing index.ts(x) if (a === 0) { + if (window.modules instanceof Map) window.modules = Object.fromEntries(window.modules); onceIndexRequired(v); _requireFunc = v; } else return v(a); diff --git a/src/lib/ui/settings/index.tsx b/src/lib/ui/settings/index.tsx index 37bb0fd..364a34b 100644 --- a/src/lib/ui/settings/index.tsx +++ b/src/lib/ui/settings/index.tsx @@ -2,7 +2,6 @@ import { lazy } from "react"; import type { ImageURISource } from "react-native"; -import { patchPanelUI } from "./patches/panel"; import { patchTabsUI } from "./patches/tabs"; export interface RowConfig { @@ -32,7 +31,6 @@ export function registerSection(section: { name: string; items: RowConfig[]; }) export function patchSettings() { const unpatches = new Array<() => boolean>; - patchPanelUI(unpatches); patchTabsUI(unpatches); return () => unpatches.forEach(u => u()); diff --git a/src/lib/ui/settings/patches/panel.tsx b/src/lib/ui/settings/patches/panel.tsx deleted file mode 100644 index 34671f6..0000000 --- a/src/lib/ui/settings/patches/panel.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { after } from "@lib/api/patcher"; -import { findInReactTree } from "@lib/utils"; -import { i18n, NavigationNative } from "@metro/common"; -import { LegacyFormDivider,LegacyFormIcon, LegacyFormRow, LegacyFormSection } from "@metro/common/components"; -import { findByNameLazy } from "@metro/wrappers"; -import { registeredSections } from "@ui/settings"; - -import { CustomPageRenderer, wrapOnPress } from "./shared"; -import { Strings } from "@core/i18n"; - -function SettingsSection() { - const navigation = NavigationNative.useNavigation(); - - return <> - {Object.keys(registeredSections).map(sect => registeredSections[sect].length > 0 && ( - - { /** Is usePredicate here safe? */} - {registeredSections[sect].filter(r => r.usePredicate?.() ?? true).map((row, i, arr) => ( - <> - } - trailing={} - onPress={wrapOnPress(row.onPress, navigation, row.render, row.title())} - /> - {i !== arr.length - 1 && } - - ))} - - ))} - ; -} - -export function patchPanelUI(unpatches: (() => void | boolean)[]) { - unpatches.push(after("default", findByNameLazy("getScreens", false), (_a, screens) => ({ - ...screens, - VendettaCustomPage: { - title: Strings.BUNNY, - render: () => - }, - BUNNY_CUSTOM_PAGE: { - title: Strings.BUNNY, - render: () => - } - }))); - - const unpatch = after("default", findByNameLazy("UserSettingsOverviewWrapper", false), (_a, ret) => { - const UserSettingsOverview = findInReactTree(ret.props.children, n => n.type?.name === "UserSettingsOverview"); - - unpatches.push(after("renderSupportAndAcknowledgements", UserSettingsOverview.type.prototype, (_args, { props: { children } }) => { - const index = children.findIndex((c: any) => c?.type?.name === "UploadLogsButton"); - if (index !== -1) children.splice(index, 1); - })); - - unpatches.push(after("render", UserSettingsOverview.type.prototype, (_args, res) => { - const titles = [i18n.Messages.BILLING_SETTINGS, i18n.Messages.PREMIUM_SETTINGS]; - - const sections = findInReactTree( - res.props.children, - n => n?.children?.[1]?.type === LegacyFormSection - )?.children || res.props.children; - - if (sections) { - const index = sections.findIndex((c: any) => titles.includes(c?.props.label)); - sections.splice(-~index || 4, 0, ); - } - })); - }, true); - - unpatches.push(unpatch); -} - diff --git a/src/metro/internals/modules.ts b/src/metro/internals/modules.ts index 0b4cdf4..3265512 100644 --- a/src/metro/internals/modules.ts +++ b/src/metro/internals/modules.ts @@ -6,7 +6,7 @@ import { ModuleFlags, ModulesMapInternal } from "./enums"; const { before, instead } = require("spitroast"); export const metroModules: Metro.ModuleList = window.modules; -const metroRequire: Metro.Require = window.__r; +const metroRequire = (id: string | number) => window.__r(+id); // eslint-disable-next-line func-call-spacing const moduleSubscriptions = new Map void>>(); From 086d7c5464aa6eaa8230fc692347f574bd8bf317 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 22 Jan 2025 18:46:59 +0000 Subject: [PATCH 2/2] chore: Release 1.6.0-dev.1 [skip ci] # [1.6.0-dev.1](https://github.com/revenge-mod/revenge-bundle/compare/v1.5.4...v1.6.0-dev.1) (2025-01-22) ### Features * support 263+ clients ([f1ba456](https://github.com/revenge-mod/revenge-bundle/commit/f1ba456474a85cbc291bdb320a16721bd6108483)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d922a2f..b485af8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.6.0-dev.1](https://github.com/revenge-mod/revenge-bundle/compare/v1.5.4...v1.6.0-dev.1) (2025-01-22) + + +### Features + +* support 263+ clients ([f1ba456](https://github.com/revenge-mod/revenge-bundle/commit/f1ba456474a85cbc291bdb320a16721bd6108483)) + ## [1.5.4](https://github.com/revenge-mod/revenge-bundle/compare/v1.5.3...v1.5.4) (2024-12-26)