chore: suggested changes
This commit is contained in:
parent
7a64e54dfe
commit
533aeeeb51
1 changed files with 11 additions and 10 deletions
|
|
@ -6,24 +6,25 @@ let vendettaLog = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "ven
|
|||
let source = URL(string: "vendetta")!
|
||||
|
||||
let install_prefix = String(cString: get_install_prefix())
|
||||
let isJailbroken = FileManager.default.fileExists(atPath: "\(install_prefix)/Library/Application Support/VendettaTweak/VendettaPatches.bundle")
|
||||
|
||||
let vendettaPatchesBundlePath =
|
||||
FileManager.default.fileExists(
|
||||
atPath: "\(install_prefix)/Library/Application Support/VendettaTweak/VendettaPatches.bundle")
|
||||
? "\(install_prefix)/Library/Application Support/VendettaTweak/VendettaPatches.bundle"
|
||||
: "\(Bundle.main.bundleURL.path)/VendettaPatches.bundle"
|
||||
let vendettaPatchesBundlePath = if isJailbroken {
|
||||
"\(install_prefix)/Library/Application Support/VendettaTweak/VendettaPatches.bundle"
|
||||
} else {
|
||||
"\(Bundle.main.bundleURL.path)/VendettaPatches.bundle"
|
||||
}
|
||||
|
||||
class FileManagerLoadHook: ClassHook<FileManager> {
|
||||
func containerURLForSecurityApplicationGroupIdentifier(_ groupIdentifier: NSString?) -> URL? {
|
||||
os_log("containerURLForSecurityApplicationGroupIdentifier called! %{public}@ groupIdentifier", log: vendettaLog, type: .debug, groupIdentifier ?? "nil")
|
||||
|
||||
if groupIdentifier != nil {
|
||||
let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
|
||||
let lastPath = paths.last!
|
||||
return lastPath.appendingPathComponent("AppGroup")
|
||||
if (isJailbroken) {
|
||||
return orig.containerURLForSecurityApplicationGroupIdentifier(groupIdentifier)
|
||||
}
|
||||
|
||||
return orig.containerURLForSecurityApplicationGroupIdentifier(groupIdentifier)
|
||||
let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
|
||||
let lastPath = paths.last!
|
||||
return lastPath.appendingPathComponent("AppGroup")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue