[Main] Assign vendetta_theme.json to window

This commit is contained in:
Jack Matthews 2023-03-15 02:33:00 -04:00
parent af15e80ccd
commit cbe425108e
No known key found for this signature in database
2 changed files with 7 additions and 1 deletions

View file

@ -1 +1 @@
this.__vendetta_loader={name:"VendettaTweak",features:{loaderConfig:true,devtools:{prop:"__vendetta_rdc",version:"4.27.1"}}};
this.__vendetta_loader={name:"VendettaTweak",features:{loaderConfig:true,devtools:{prop:"__vendetta_rdc",version:"4.27.1"},themes:{prop:"__vendetta_theme"}}};

View file

@ -82,6 +82,12 @@ class LoadHook: ClassHook<RCTCxxBridge> {
os_log("Executing original script", log: vendettaLog, type: .info)
orig.executeApplicationScript(script, url: url, async: false)
if let themeString = try? String(
contentsOf: documentDirectory.appendingPathComponent("vendetta_theme.json"))
{
orig.executeApplicationScript(
"this.__vendetta_theme=\(themeString)".data(using: .utf8)!, url: source, async: false)
}
if vendetta != nil {
os_log("Executing vendetta.js", log: vendettaLog, type: .info)
orig.executeApplicationScript(vendetta!, url: source, async: false)