mirror of
https://github.com/khanhduytran0/aintuitweaks.git
synced 2026-06-01 03:21:34 +02:00
42 lines
889 B
Plaintext
42 lines
889 B
Plaintext
@import Foundation;
|
|
|
|
@interface SBContinuitySessionSystemEventMonitor : NSObject
|
|
- (BOOL)isUILocked;
|
|
- (void)_setUILocked:(BOOL)locked;
|
|
@end
|
|
|
|
%group Hook_SpringBoard_iOS18
|
|
%hook _SBContinuitySessionStateMachine
|
|
- (void)_moveToInvalidStateForReasons:(NSArray *)reasons postToDelegate:(BOOL)post {
|
|
for (NSString *reason in reasons) {
|
|
if ([reason hasPrefix:@"block."]) {
|
|
return;
|
|
}
|
|
}
|
|
%orig(reasons, post);
|
|
}
|
|
%end
|
|
|
|
%hook SBContinuitySessionSystemEventMonitor
|
|
- (void)_setUILocked:(BOOL)locked {
|
|
%orig(YES);
|
|
}
|
|
|
|
- (BOOL)isUILocked {
|
|
if (!%orig()) {
|
|
[self _setUILocked:YES];
|
|
}
|
|
return YES;
|
|
}
|
|
%end
|
|
%end
|
|
|
|
%ctor {
|
|
NSString *processName = NSProcessInfo.processInfo.processName;
|
|
if (@available(iOS 18.0, *)) {
|
|
if ([processName isEqualToString:@"SpringBoard"]) {
|
|
%init(Hook_SpringBoard_iOS18);
|
|
}
|
|
}
|
|
}
|