revenge-bundle-next/lib/react/src/native/patches.ts
2025-06-03 16:24:58 +07:00

22 lines
703 B
TypeScript

import { byProps } from '@revenge-mod/modules/finders/filters'
import { waitForModules } from '@revenge-mod/modules/finders/wait'
import { after, before } from '@revenge-mod/patcher'
import { ReactNative } from '..'
import type { RunApplicationCallback } from '.'
export const _bra = new Set<RunApplicationCallback>()
export const _ara = new Set<RunApplicationCallback>()
const unsub = waitForModules(byProps('AppRegistry'), () => {
unsub()
before(ReactNative.AppRegistry, 'runApplication', args => {
for (const cb of _bra) cb()
return args
})
after(ReactNative.AppRegistry, 'runApplication', res => {
for (const cb of _ara) cb()
return res
})
})