-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from ginsudev/improvement/latest-grant-full-disk
Updated grant_full_disk_access, concurrency and code improvements
- Loading branch information
Showing
12 changed files
with
133 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
WDBFontOverwrite/MainInterface/ActionButtons.ViewModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// ActionButtons.ViewModel.swift | ||
// WDBFontOverwrite | ||
// | ||
// Created by Noah Little on 9/2/2023. | ||
// | ||
|
||
import UIKit.UIApplication | ||
|
||
extension ActionButtons { | ||
struct ViewModel { | ||
func clearKBCache() { | ||
grant_full_disk_access { error in | ||
if error != nil { | ||
print("can't get disk access") | ||
} else { | ||
_UIKeyboardCache.purge() | ||
} | ||
} | ||
} | ||
|
||
@available(iOS 15, *) | ||
func respringModern() { | ||
grant_full_disk_access { error in | ||
if error != nil { | ||
print("can't get disk access, using backup respring") | ||
respringLegacy() | ||
} else { | ||
xpc_crasher(UnsafeMutablePointer<CChar>(mutating: "com.apple.frontboard.systemappservices")) | ||
} | ||
} | ||
} | ||
|
||
@available(iOS, deprecated: 15) | ||
func respringLegacy() { | ||
let sharedApplication = UIApplication.shared | ||
let windows = sharedApplication.windows | ||
if let window = windows.first { | ||
while true { | ||
window.snapshotView(afterScreenUpdates: false) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.