diff --git a/README.md b/README.md new file mode 100644 index 0000000..6fd4b75 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# VendettaTweak + +A rootful/rootless tweak to inject Vendetta into a Discord IPA. + +## Installation + +When injecting this via [`azule`](https://github.com/Al4ise/Azule/tree/main), use the rootful `deb` files (the ones ending in `arm.deb` NOT `arm64.deb`) diff --git a/Sources/VendettaTweak/Tweak.x.swift b/Sources/VendettaTweak/Tweak.x.swift index 75448b3..e5fa692 100644 --- a/Sources/VendettaTweak/Tweak.x.swift +++ b/Sources/VendettaTweak/Tweak.x.swift @@ -1,6 +1,7 @@ import Orion import VendettaTweakC import os +import Foundation let vendettaLog = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "vendetta") let source = URL(string: "vendetta")! @@ -13,6 +14,20 @@ let vendettaPatchesBundlePath = ? "\(install_prefix)/Library/Application Support/VendettaTweak/VendettaPatches.bundle" : "\(Bundle.main.bundleURL.path)/VendettaPatches.bundle" +class FileManagerLoadHook: ClassHook { + 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") + } + + return orig.containerURLForSecurityApplicationGroupIdentifier(groupIdentifier) + } +} + class LoadHook: ClassHook { func executeApplicationScript(_ script: Data, url: URL, async: Bool) { os_log("executeApplicationScript called!", log: vendettaLog, type: .debug) diff --git a/control b/control index d9a817c..2ba1f85 100644 --- a/control +++ b/control @@ -1,6 +1,6 @@ Package: dev.beefers.vendetta Name: Vendetta -Version: 0.0.1 +Version: 0.0.2 Architecture: iphoneos-arm Description: A mod for Discord's mobile apps. Maintainer: FieryFlames