fix!: make init patch do less, remove unused retained references in utils/functions

This commit is contained in:
PalmDevs 2025-04-27 22:04:03 +07:00
parent 87ff29a36a
commit 349cae2b3a
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA
4 changed files with 6 additions and 5 deletions

View file

@ -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'

View file

@ -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

View file

@ -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

View file

@ -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)) {