|
|
|
|
|
|
|
|
|
|
|
|
|
|
@interface SPUISearchHeader |
|
|
@interface SPUISearchHeader |
|
|
@property (retain) SPUITextField * searchField; |
|
|
@property (retain) SPUITextField * searchField; |
|
|
-(void)cancelButtonClicked:(id)arg1; |
|
|
|
|
|
@end |
|
|
@end |
|
|
|
|
|
|
|
|
@interface SpringBoard |
|
|
@interface SpringBoard |
|
|
|
|
|
|
|
|
- (_Bool)handleSiriButtonDownEventFromSource:(int)arg1 activationEvent:(int)arg2; |
|
|
- (_Bool)handleSiriButtonDownEventFromSource:(int)arg1 activationEvent:(int)arg2; |
|
|
@end |
|
|
@end |
|
|
|
|
|
|
|
|
|
|
|
@interface SPUISearchViewController |
|
|
|
|
|
- (void)cancelButtonPressed; |
|
|
|
|
|
@end |
|
|
static SpringBoard *springBoard = nil; |
|
|
static SpringBoard *springBoard = nil; |
|
|
%hook SpringBoard |
|
|
%hook SpringBoard |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
%end |
|
|
%end |
|
|
|
|
|
|
|
|
%hook SPUISearchHeader |
|
|
|
|
|
-(BOOL)textFieldShouldReturn:(id)arg1{ |
|
|
|
|
|
SPUITextField *searchField = self.searchField; |
|
|
|
|
|
|
|
|
%hook SPUISearchViewController |
|
|
|
|
|
|
|
|
|
|
|
- (void)cancelButtonPressed{ |
|
|
|
|
|
SPUISearchHeader *_searchHeader = MSHookIvar<SPUISearchHeader*>(self, "_searchHeader"); |
|
|
|
|
|
SPUITextField *searchField = _searchHeader.searchField; |
|
|
|
|
|
|
|
|
NSString *searchString = [searchField.text lowercaseString]; |
|
|
NSString *searchString = [searchField.text lowercaseString]; |
|
|
if ([searchString hasPrefix:@"siri"]) { |
|
|
if ([searchString hasPrefix:@"siri"]) { |
|
|
|
|
|
|
|
|
[assistantController handleSiriButtonDownEventFromSource:1 activationEvent:1]; |
|
|
[assistantController handleSiriButtonDownEventFromSource:1 activationEvent:1]; |
|
|
[assistantController handleSiriButtonUpEventFromSource:1]; |
|
|
[assistantController handleSiriButtonUpEventFromSource:1]; |
|
|
searchField.text = @""; |
|
|
searchField.text = @""; |
|
|
[self cancelButtonClicked:nil]; |
|
|
|
|
|
} |
|
|
} |
|
|
return %orig(arg1); |
|
|
|
|
|
|
|
|
%orig; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
%end |
|
|
|
|
|
|
|
|
%end |