From 7a833921ee63e04408d3fc98e02d32ab709f5d63 Mon Sep 17 00:00:00 2001 From: SXX Date: Tue, 10 May 2022 18:11:51 +0800 Subject: [PATCH 1/2] Fix a race condition in GUI when printing. --- arm/iOS/Fugu14App/Fugu14App/ContentView.swift | 4 +++- arm/iOS/jailbreakd/Sources/jailbreakd/UI/ContentView.swift | 6 ++++-- .../KernelExploit/Sources/KernelExploit/offsets.swift | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arm/iOS/Fugu14App/Fugu14App/ContentView.swift b/arm/iOS/Fugu14App/Fugu14App/ContentView.swift index ecb7000..7f2b875 100644 --- a/arm/iOS/Fugu14App/Fugu14App/ContentView.swift +++ b/arm/iOS/Fugu14App/Fugu14App/ContentView.swift @@ -81,7 +81,9 @@ struct ContentView: View { } func print(_ text: String) { - labelText += text + "\n" + DispatchQueue.main.async { + labelText += text + "\n" + } } func doSetup() { diff --git a/arm/iOS/jailbreakd/Sources/jailbreakd/UI/ContentView.swift b/arm/iOS/jailbreakd/Sources/jailbreakd/UI/ContentView.swift index 9726b12..b5a95cb 100644 --- a/arm/iOS/jailbreakd/Sources/jailbreakd/UI/ContentView.swift +++ b/arm/iOS/jailbreakd/Sources/jailbreakd/UI/ContentView.swift @@ -91,8 +91,10 @@ struct ContentView: View { alreadyInstalled = access("/.Fugu14Untether", F_OK) == 0 } - func print(_ text: String, ender: String = "\n") { - labelText += text + ender + private func print(_ text: String, ender: String = "\n") { + DispatchQueue.main.async { + labelText += text + ender + } } func launchServer(uninstall: Bool = false) -> ProcessCommunication? { diff --git a/arm/shared/KernelExploit/Sources/KernelExploit/offsets.swift b/arm/shared/KernelExploit/Sources/KernelExploit/offsets.swift index a39a4a1..c524045 100644 --- a/arm/shared/KernelExploit/Sources/KernelExploit/offsets.swift +++ b/arm/shared/KernelExploit/Sources/KernelExploit/offsets.swift @@ -771,7 +771,7 @@ public struct Offsets { } switch minor { - case 2: fallthrough /* Doesn't work though! */ + case 2: fallthrough case 3: fallthrough case 4: return taskStruct14_4 From 7df1df104ea74a5c3aa0654929f352f383cc4c11 Mon Sep 17 00:00:00 2001 From: SXX Date: Tue, 10 May 2022 18:31:39 +0800 Subject: [PATCH 2/2] fix malfunctioning analyticsd daemon and the battery usage in settings looks to work fine. --- .../Sources/jailbreakd/untether/installUntether.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arm/iOS/jailbreakd/Sources/jailbreakd/untether/installUntether.swift b/arm/iOS/jailbreakd/Sources/jailbreakd/untether/installUntether.swift index 4e6321e..91a5e03 100644 --- a/arm/iOS/jailbreakd/Sources/jailbreakd/untether/installUntether.swift +++ b/arm/iOS/jailbreakd/Sources/jailbreakd/untether/installUntether.swift @@ -37,7 +37,7 @@ func installSlowUntether(mountPath: String, trustcache: String, isUpdate: Bool) throw UntetherInstallError.failedToLocateJailbreakd } - let targetUGID = 264 + let targetUGID = 263 let targetExePath = mountPath + "/System/Library/PrivateFrameworks/CoreAnalytics.framework/Support/analyticsd" let replacementExePath = "/usr/libexec/keybagd" @@ -62,12 +62,12 @@ func installSlowUntether(mountPath: String, trustcache: String, isUpdate: Bool) Logger.print("Creating container files...") - try? FileManager.default.removeItem(atPath: untetherContainerPath) try? FileManager.default.removeItem(atPath: untetherClFolder) + try? FileManager.default.removeItem(atPath: untetherContainerPath) try FileManager.default.createDirectory(atPath: untetherContainerPath, withIntermediateDirectories: true, attributes: [.ownerAccountID: targetUGID, .groupOwnerAccountID: targetUGID]) try FileManager.default.createDirectory(atPath: untetherClFolder + "/Caches/com.apple.dyld", withIntermediateDirectories: true, attributes: [.ownerAccountID: targetUGID, .groupOwnerAccountID: targetUGID]) - try FileManager.default.createSymbolicLink(atPath: untetherContainerPath + "/Library", withDestinationPath: untetherClFolder) + try? FileManager.default.createSymbolicLink(atPath: untetherContainerPath + "/Library", withDestinationPath: untetherClFolder) Logger.print("Writing JS files") try? FileManager.default.createDirectory(atPath: mountPath + "/.Fugu14Untether", withIntermediateDirectories: false, attributes: nil) @@ -109,8 +109,8 @@ func installSlowUntether(mountPath: String, trustcache: String, isUpdate: Bool) var nMasterPasswd = "" for line in lines { if line.starts(with: "_analyticsd") { - nMasterPasswd.append("_analyticsd:*:264:264::0:0:Haxx Daemon:" + untetherContainerPath + ":/usr/bin/false\n") nMasterPasswd.append(line.replacingOccurrences(of: "_analyticsd", with: "_nanalyticsd") + "\n") + nMasterPasswd.append("_analyticsd:*:263:263::0:0:Haxx Daemon:" + untetherContainerPath + ":/usr/bin/false\n") } else { nMasterPasswd.append(line + "\n") } @@ -126,8 +126,9 @@ func installSlowUntether(mountPath: String, trustcache: String, isUpdate: Bool) var nPasswd = "" for line in lines { if line.starts(with: "_analyticsd") { - nPasswd.append("_analyticsd:*:264:264:Haxx Daemon:" + untetherContainerPath + ":/usr/bin/false\n") nPasswd.append(line.replacingOccurrences(of: "_analyticsd", with: "_nanalyticsd") + "\n") + nPasswd.append("_analyticsd:*:263:263:Haxx Daemon:" + untetherContainerPath + ":/usr/bin/false\n") + } else { nPasswd.append(line + "\n") }