2025-04-29 18:25:46 +07:00
|
|
|
import { byProps } from '@revenge-mod/modules/finders/filters'
|
2025-05-18 22:24:48 +07:00
|
|
|
import { waitForModules } from '@revenge-mod/modules/finders/wait'
|
|
|
|
|
import type { Metro } from '@revenge-mod/modules/types'
|
2025-04-27 14:45:14 +07:00
|
|
|
|
2025-05-18 22:24:48 +07:00
|
|
|
export let ReactModuleId: Metro.ModuleID
|
|
|
|
|
export let ReactNativeModuleId: Metro.ModuleID
|
|
|
|
|
export let ReactJsxRuntimeModuleId: Metro.ModuleID
|
|
|
|
|
|
|
|
|
|
export let React: typeof import('react')
|
|
|
|
|
export let ReactNative: typeof import('react-native')
|
|
|
|
|
export let ReactJsxRuntime: typeof import('react/jsx-runtime')
|
|
|
|
|
|
|
|
|
|
let RtCount = 0
|
|
|
|
|
|
2025-06-03 16:24:58 +07:00
|
|
|
const unsubRt = waitForModules(
|
|
|
|
|
byProps<typeof React>('useState'),
|
|
|
|
|
(exports, id) => {
|
|
|
|
|
if (RtCount++ === 2) return unsubRt()
|
2025-05-18 22:24:48 +07:00
|
|
|
|
2025-06-03 16:24:58 +07:00
|
|
|
ReactModuleId = id
|
|
|
|
|
React = exports
|
|
|
|
|
},
|
|
|
|
|
)
|
2025-05-18 22:24:48 +07:00
|
|
|
|
2025-06-03 16:24:58 +07:00
|
|
|
const unsubRN = waitForModules(
|
|
|
|
|
byProps<typeof ReactNative>('AppRegistry'),
|
|
|
|
|
(exports, id) => {
|
|
|
|
|
unsubRN()
|
2025-05-18 22:24:48 +07:00
|
|
|
|
2025-06-03 16:24:58 +07:00
|
|
|
ReactNativeModuleId = id
|
|
|
|
|
ReactNative = exports
|
|
|
|
|
},
|
|
|
|
|
)
|
2025-05-18 22:24:48 +07:00
|
|
|
|
|
|
|
|
let RJsxRCount = 0
|
|
|
|
|
|
2025-06-03 16:24:58 +07:00
|
|
|
const unsubRJsxR = waitForModules(
|
|
|
|
|
byProps<typeof ReactJsxRuntime>('jsxs'),
|
|
|
|
|
(exports, id) => {
|
|
|
|
|
if (RJsxRCount++ === 2) return unsubRJsxR()
|
2025-05-18 22:24:48 +07:00
|
|
|
|
2025-06-03 16:24:58 +07:00
|
|
|
ReactJsxRuntimeModuleId = id
|
|
|
|
|
ReactJsxRuntime = exports
|
|
|
|
|
},
|
|
|
|
|
)
|