fix!: make init patch do less, remove unused retained references in utils/functions
This commit is contained in:
parent
87ff29a36a
commit
349cae2b3a
4 changed files with 6 additions and 5 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import './preinit'
|
||||
|
||||
import './patches/prevent-immutablize'
|
||||
import './patches/prevent-freeze'
|
||||
import './patches/proxy'
|
||||
|
||||
import { onModuleFirstRequired, onModuleInitialized } from '@revenge-mod/modules/metro/subscriptions'
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@
|
|||
// Retain reference to the functions so the actual functions can be used later
|
||||
import '@revenge-mod/utils/functions'
|
||||
|
||||
Object.freeze = Object.seal = Object.preventExtensions = o => o
|
||||
// Discord only uses Object.freeze
|
||||
Object.freeze = (o: any) => o
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
// This file is imported before the functions are modified
|
||||
|
||||
export const objectFreeze = Object.freeze
|
||||
export const objectSeal = Object.seal
|
||||
export const objectPreventExtensions = Object.preventExtensions
|
||||
export const objectDefineProperty = Object.defineProperty
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import { objectDefineProperty as defineProperty } from './functions'
|
||||
// Retain reference to original functions
|
||||
import './functions'
|
||||
|
||||
// Heavily inspired by uwu/shelter
|
||||
// https://github.com/uwu/shelter/blob/main/packages/shelter/src/exfiltrate.ts
|
||||
|
||||
const defineProperty = Object.defineProperty
|
||||
// Patch to fix intercepting properties on Object.prototype
|
||||
Object.defineProperty = (target, p, d) => {
|
||||
if (target === Object.prototype && _intercepting.has(p)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue