Skip to content

Commit 47117b2

Browse files
committed
Support editing MG upto 18.2b2
1 parent a69a510 commit 47117b2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Sources/ContentView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ Thanks to:
189189
modMGURL = documentsDirectory.appendingPathComponent("ModifiedMobileGestalt.plist", conformingTo: .data)
190190
if !FileManager.default.fileExists(atPath: origMGURL.path) {
191191
let url = URL(filePath: "/var/containers/Shared/SystemGroup/systemgroup.com.apple.mobilegestaltcache/Library/Caches/com.apple.MobileGestalt.plist")
192-
try! FileManager.default.copyItem(at: url, to: origMGURL)
193-
try! FileManager.default.copyItem(at: url, to: modMGURL)
192+
try? FileManager.default.copyItem(at: url, to: origMGURL)
193+
try? FileManager.default.copyItem(at: url, to: modMGURL)
194194
}
195195
_mobileGestalt = State(initialValue: try! NSMutableDictionary(contentsOf: modMGURL, error: ()))
196196

Sources/SparseRestore/Restore.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ struct Restore {
6969

7070
static func createMobileGestalt(file: FileToRestore) -> Backup {
7171
Backup(files: [
72-
Directory(path: "", domain: "SysSharedContainerDomain-systemgroup.com.apple.mobilegestaltcachf"),
73-
Directory(path: "Library", domain: "SysSharedContainerDomain-systemgroup.com.apple.mobilegestaltcachf"),
74-
Directory(path: "Library/Caches", domain: "SysSharedContainerDomain-systemgroup.com.apple.mobilegestaltcachf"),
72+
Directory(path: "", domain: "SysSharedContainerDomain-systemgroup.com.apple.mobilegestaltcache"),
73+
Directory(path: "systemgroup.com.apple.mobilegestaltcache/Library", domain: "SysSharedContainerDomain-"),
74+
Directory(path: "systemgroup.com.apple.mobilegestaltcache/Library/Caches", domain: "SysSharedContainerDomain-"),
7575
ConcreteFile(
76-
path: "Library/Caches/com.apple.MobileGestalt.plist",
77-
domain: "SysSharedContainerDomain-systemgroup.com.apple.mobilegestaltcachf",
76+
path: "systemgroup.com.apple.mobilegestaltcache/Library/Caches/com.apple.MobileGestalt.plist",
77+
domain: "SysSharedContainerDomain-",
7878
contents: file.contents,
7979
owner: file.owner,
8080
group: file.group),
81-
SymbolicLink(path: "", domain: "SysSharedContainerDomain-systemgroup.com.apple.mobilegestaltcache", target: "systemgroup.com.apple.mobilegestaltcachf")
81+
ConcreteFile(path: "", domain: "SysContainerDomain-../../../../../../../../crash_on_purpose", contents: Data())
8282
])
8383
}
8484

0 commit comments

Comments
 (0)