fix(lib): support filtering for 297202

This commit is contained in:
PalmDevs 2025-09-04 01:22:33 +07:00
parent 0c991ae42a
commit 3a57fe820c
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA
4 changed files with 66 additions and 45 deletions

View file

@ -25,8 +25,6 @@ export const [Tokens, TokensModuleId] = lookupModule(withProps('RawColor')) as [
Metro.ModuleID,
]
const OnlyImportTrackerDep = [2]
/**
* If you need to use this ID, unproxify {@link Constants} first.
*
@ -49,10 +47,10 @@ export let Constants: DiscordModules.Constants = proxify(
withDependencies(
loose([
null,
relative.withDependencies(OnlyImportTrackerDep, 1),
relative.withDependencies(OnlyImportTrackerDep, 2),
relative.withDependencies(OnlyImportTrackerDep, 3),
relative.withDependencies(OnlyImportTrackerDep, 4),
relative.withDependencies([2], 1),
relative.withDependencies([2], 2),
relative.withDependencies([2], 3),
relative.withDependencies([2], 4),
]),
),
),

View file

@ -20,27 +20,39 @@ export let Design: Design = proxify(
// ID: 3236
// [3237, 1366, 3238, 3239, 2, ...];
const [module] = lookupModule(
withProps<Design>('TableRow', 'Button').and(
withDependencies(
loose([
null,
null,
null,
relative.withDependencies([2], 1),
2,
null, // 3009
null, // 3010
null, // 3011
null, // 3012
relative.withDependencies([2], 2),
]),
).or(
// TODO(PalmDevs): Remove once stable channel is > 295203 (for 295203 and below)
withProps<Design>('TableRow', 'Button')
.and(
withDependencies(
loose([relative(1), null, relative(2), relative(3), 2]),
loose([
null,
null,
relative.withDependencies(
[ReactNativeModuleId, 2],
1,
),
relative.withDependencies([2], 2),
2,
]),
).or(
// TODO(PalmDevs): Remove once stable channel is > 297201 (for 297201 and below)
withDependencies(
loose([
null,
null,
null,
relative.withDependencies([2], 1),
2,
null, // 3009
null, // 3010
null, // 3011
null, // 3012
relative.withDependencies([2], 2),
]),
),
),
),
),
)
.keyAs('revenge.discord.design.Design'),
{
uninitialized: true,
},

View file

@ -18,12 +18,20 @@ export interface RootNavigationRef {
export let RootNavigationRef: RootNavigationRef = proxify(
() => {
const [module] = lookupModule(
withProps<RootNavigationRef>('getRootNavigationRef').and(
withDependencies([
loose([[], loose([relative(1), relative(2)])]),
2,
]),
),
withProps<RootNavigationRef>('getRootNavigationRef')
.and(
withDependencies([
loose([
relative.withDependencies([], 1),
relative.withDependencies(
loose([relative(1), relative(2)]),
2,
),
]),
2,
]),
)
.keyAs('revenge.discord.modules.mainTabsV2.RootNavigationRef'),
{
uninitialized: true,
},

View file

@ -41,23 +41,26 @@ export let ReactNavigationNative: typeof import('@react-navigation/native') =
export let ReactNavigationStack: typeof import('@react-navigation/stack') =
proxify(
() => {
const firstDep = relative.withDependencies(
loose([[[]], ReactModuleId, ReactJSXRuntimeModuleId]),
1,
)
const [module] = lookupModule(
withProps<typeof ReactNavigationStack>('StackView').and(
withDependencies(
loose([
relative.withDependencies(
loose([
[[]],
ReactModuleId,
ReactJSXRuntimeModuleId,
]),
1,
withProps<typeof ReactNavigationStack>('StackView')
.and(
withDependencies(
loose([firstDep, null, relative(2)]),
).or(
// TODO: Remove once stable channel is > 297201 (for 297201 and below)
withDependencies(
loose([firstDep, null, relative(3)]),
),
null,
relative(3),
]),
),
)
.keyAs(
'revenge.externals.ReactNavigation.ReactNavigationStack',
),
),
{
uninitialized: true,
},