From 3e3b7323e70bcef4e098af8fc03b0e4c5f077328 Mon Sep 17 00:00:00 2001 From: Jack Matthews Date: Sat, 13 May 2023 06:31:48 -0400 Subject: [PATCH] [Main] Match Xposed load behavior --- Sources/VendettaTweak/Tweak.x.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/VendettaTweak/Tweak.x.swift b/Sources/VendettaTweak/Tweak.x.swift index 59c935d..75448b3 100644 --- a/Sources/VendettaTweak/Tweak.x.swift +++ b/Sources/VendettaTweak/Tweak.x.swift @@ -31,7 +31,7 @@ class LoadHook: ClassHook { if let patchPath = vendettaPatchesBundle.url(forResource: patch, withExtension: "js") { let patchData = try! Data(contentsOf: patchPath) os_log("Executing %{public}@ patch", log: vendettaLog, type: .debug, patch) - orig.executeApplicationScript(patchData, url: source, async: false) + orig.executeApplicationScript(patchData, url: source, async: true) } } @@ -82,18 +82,18 @@ class LoadHook: ClassHook { group.wait() os_log("Executing original script", log: vendettaLog, type: .info) - orig.executeApplicationScript(script, url: url, async: false) + orig.executeApplicationScript(script, url: url, async: async) if let themeString = try? String( contentsOf: documentDirectory.appendingPathComponent("vendetta_theme.json")) { orig.executeApplicationScript( - "globalThis.__vendetta_theme=\(themeString)".data(using: .utf8)!, url: source, async: false) + "globalThis.__vendetta_theme=\(themeString)".data(using: .utf8)!, url: source, async: async) } if vendetta != nil { os_log("Executing vendetta.js", log: vendettaLog, type: .info) - orig.executeApplicationScript(vendetta!, url: source, async: false) + orig.executeApplicationScript(vendetta!, url: source, async: async) } else { os_log("Unable to fetch vendetta.js", log: vendettaLog, type: .error) }