瀏覽代碼

v1.1

master
Gil Shahar 5 年之前
父節點
當前提交
7bed4082e1
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 10 行新增7 行删除
  1. +10
    -7
      Tweak.xm

+ 10
- 7
Tweak.xm 查看文件

@@ -6,7 +6,6 @@

@interface SPUISearchHeader
@property (retain) SPUITextField * searchField;
-(void)cancelButtonClicked:(id)arg1;
@end

@interface SpringBoard
@@ -19,6 +18,9 @@
- (_Bool)handleSiriButtonDownEventFromSource:(int)arg1 activationEvent:(int)arg2;
@end

@interface SPUISearchViewController
- (void)cancelButtonPressed;
@end
static SpringBoard *springBoard = nil;
%hook SpringBoard

@@ -28,9 +30,11 @@ static SpringBoard *springBoard = nil;
}
%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];
if ([searchString hasPrefix:@"siri"]) {
@@ -44,9 +48,8 @@ static SpringBoard *springBoard = nil;
[assistantController handleSiriButtonDownEventFromSource:1 activationEvent:1];
[assistantController handleSiriButtonUpEventFromSource:1];
searchField.text = @"";
[self cancelButtonClicked:nil];
}
return %orig(arg1);
%orig;
}

%end
%end

Loading…
取消
儲存