rework exploit code to support last 4% of tendies
This commit is contained in:
1 parent
7e60c71c0d
commit
0d0d718459
2 files changed
+47
-11
No files matched your search
@@ -59,13 +59,28 @@ class PosterBoardManager {
|
|||||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
static func getDescriptorsFromTendie(_ url: URL) throws -> URL? {
|
static func getDescriptorsFromTendie(_ url: URL) throws -> [String: [URL]]? {
|
||||||
for dir in try FileManager.default.contentsOfDirectory(at: url, includingPropertiesForKeys: nil, options: .skipsHiddenFiles) {
|
for dir in try FileManager.default.contentsOfDirectory(at: url, includingPropertiesForKeys: nil, options: .skipsHiddenFiles) {
|
||||||
let fileName = dir.lastPathComponent
|
let fileName = dir.lastPathComponent
|
||||||
if fileName.lowercased() == "descriptor" || fileName.lowercased() == "descriptors" {
|
if fileName.lowercased() == "container" {
|
||||||
return dir
|
// container support, find the extensions
|
||||||
|
let extDir = dir.appending(path: "Library/Application Support/PRBPosterExtensionDataStore/61/Extensions")
|
||||||
|
print(extDir.absoluteString)
|
||||||
|
var retList: [String: [URL]] = [:]
|
||||||
|
for ext in try FileManager.default.contentsOfDirectory(at: extDir, includingPropertiesForKeys: nil, options: .skipsHiddenFiles) {
|
||||||
|
let descrDir = ext.appendingPathComponent("descriptors")
|
||||||
|
retList[ext.lastPathComponent] = [descrDir]
|
||||||
|
}
|
||||||
|
return retList
|
||||||
|
}
|
||||||
|
else if fileName.lowercased() == "descriptor" || fileName.lowercased() == "descriptors" || fileName.lowercased() == "ordered-descriptor" || fileName.lowercased() == "ordered-descriptors" { // TODO: Add ordered descriptors
|
||||||
|
return ["com.apple.WallpaperKit.CollectionsPoster": [dir]]
|
||||||
|
}
|
||||||
|
else if fileName.lowercased() == "video-descriptor" || fileName.lowercased() == "video-descriptors" {
|
||||||
|
return ["com.apple.PhotosUIPrivate.PhotosPosterProvider": [dir]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// TODO: Add error handling here
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,13 +143,29 @@ class PosterBoardManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static func applyTendies(_ urls: [URL], appHash: String) throws {
|
static func applyTendies(_ urls: [URL], appHash: String) throws {
|
||||||
let _ = try SymHandler.createDescriptorsSymlink(appHash: appHash)
|
// organize the descriptors into their respective extensions
|
||||||
defer {
|
var extList: [String: [URL]] = [:]
|
||||||
SymHandler.cleanup()
|
var unzippedDirs: [URL: URL] = [:]
|
||||||
}
|
|
||||||
for url in urls {
|
for url in urls {
|
||||||
let unzippedDir = try unzipFile(at: url)
|
let unzippedDir = try unzipFile(at: url)
|
||||||
|
unzippedDirs[url] = unzippedDir
|
||||||
guard let descriptors = try getDescriptorsFromTendie(unzippedDir) else { continue } // TODO: Add error handling
|
guard let descriptors = try getDescriptorsFromTendie(unzippedDir) else { continue } // TODO: Add error handling
|
||||||
|
extList.merge(descriptors) { (first, second) in first + second }
|
||||||
|
}
|
||||||
|
|
||||||
|
defer {
|
||||||
|
SymHandler.cleanup()
|
||||||
|
for url in urls {
|
||||||
|
// clean up all possible files
|
||||||
|
if let unzippedDir = unzippedDirs[url] {
|
||||||
|
try? FileManager.default.removeItem(at: unzippedDir)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ext, descriptorsList) in extList {
|
||||||
|
let _ = try SymHandler.createDescriptorsSymlink(appHash: appHash, ext: ext)
|
||||||
|
for descriptors in descriptorsList {
|
||||||
// create the folder
|
// create the folder
|
||||||
for descr in try FileManager.default.contentsOfDirectory(at: descriptors, includingPropertiesForKeys: nil, options: .skipsHiddenFiles) {
|
for descr in try FileManager.default.contentsOfDirectory(at: descriptors, includingPropertiesForKeys: nil, options: .skipsHiddenFiles) {
|
||||||
if descr.lastPathComponent != "__MACOSX" {
|
if descr.lastPathComponent != "__MACOSX" {
|
||||||
@@ -145,10 +176,14 @@ class PosterBoardManager {
|
|||||||
try FileManager.default.trashItem(at: newURL, resultingItemURL: nil)
|
try FileManager.default.trashItem(at: newURL, resultingItemURL: nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
SymHandler.cleanup()
|
||||||
|
}
|
||||||
|
|
||||||
// clean up the files
|
// clean up
|
||||||
try? FileManager.default.removeItem(at: unzippedDir)
|
for url in urls {
|
||||||
try? FileManager.default.removeItem(at: SymHandler.getDocumentsDirectory().appendingPathComponent(url.lastPathComponent))
|
try? FileManager.default.removeItem(at: SymHandler.getDocumentsDirectory().appendingPathComponent(url.lastPathComponent))
|
||||||
|
try? FileManager.default.removeItem(at: SymHandler.getDocumentsDirectory().appendingPathComponent(url.deletingPathExtension().lastPathComponent))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,9 +35,10 @@ class SymHandler {
|
|||||||
return try createSymlink(to: "/var/mobile/Containers/Data/Application/\(appHash)")
|
return try createSymlink(to: "/var/mobile/Containers/Data/Application/\(appHash)")
|
||||||
}
|
}
|
||||||
|
|
||||||
static func createDescriptorsSymlink(appHash: String) throws -> URL {
|
static func createDescriptorsSymlink(appHash: String, ext: String) throws -> URL {
|
||||||
// create a symlink directly to the descriptors
|
// create a symlink directly to the descriptors
|
||||||
return try createAppSymlink(for: "\(appHash)/Library/Application Support/PRBPosterExtensionDataStore/61/Extensions/com.apple.WallpaperKit.CollectionsPoster/descriptors")
|
print("linking to \(appHash)/Library/Application Support/PRBPosterExtensionDataStore/61/Extensions/\(ext)/descriptors")
|
||||||
|
return try createAppSymlink(for: "\(appHash)/Library/Application Support/PRBPosterExtensionDataStore/61/Extensions/\(ext)/descriptors")
|
||||||
}
|
}
|
||||||
|
|
||||||
static func cleanup() {
|
static func cleanup() {
|
||||||
|
|||||||
Reference in new issue
Block a user