Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Fix a race condition in GUI when printing and fix malfunctioning analyticsd daemon. #242

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion arm/iOS/Fugu14App/Fugu14App/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ struct ContentView: View {
}

func print(_ text: String) {
labelText += text + "\n"
DispatchQueue.main.async {
labelText += text + "\n"
}
}

func doSetup() {
Expand Down
6 changes: 4 additions & 2 deletions arm/iOS/jailbreakd/Sources/jailbreakd/UI/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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)
Expand Down Expand Up @@ -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")
}
Expand All @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down