gilshahar7 преди 7 години
родител
ревизия
55ad1cc9b0
променени са 4 файла, в които са добавени 77 реда и са изтрити 0 реда
  1. +12
    -0
      Makefile
  2. +1
    -0
      SpotlightSiri10.plist
  3. +55
    -0
      Tweak.xm
  4. +9
    -0
      control

+ 12
- 0
Makefile Целия файл

@@ -0,0 +1,12 @@
ARCHS = armv7 arm64
DEBUG = 0
include $(THEOS)/makefiles/common.mk

TWEAK_NAME = SpotlightSiri10
SpotlightSiri10_FILES = Tweak.xm
SpotlightSiri10_FRAMEWORKS = UIKit

include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
install.exec "killall -9 SpringBoard"

+ 1
- 0
SpotlightSiri10.plist Целия файл

@@ -0,0 +1 @@
{ Filter = { Bundles = ( "com.apple.springboard" ); }; }

+ 55
- 0
Tweak.xm Целия файл

@@ -0,0 +1,55 @@
#import <substrate.h>
#import <UIKit/UIKit.h>

@interface SPUITextField:UITextField
@end

@interface SPUISearchHeader
@property (retain) SPUITextField * searchField;
@end

@interface SpringBoard
- (void)setNextAssistantRecognitionStrings:(id)arg1;
@end

@interface SBAssistantController
+ (id)sharedInstance;
- (void)handleSiriButtonUpEventFromSource:(int)arg1;
- (_Bool)handleSiriButtonDownEventFromSource:(int)arg1 activationEvent:(int)arg2;
@end

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

- (void)applicationDidFinishLaunching:(id)fp8 {
%orig;
springBoard = self;
}
%end

%hook SPUISearchViewController

- (void)cancelButtonPressed{
SPUISearchHeader *_searchHeader = MSHookIvar<SPUISearchHeader*>(self, "_searchHeader");
SPUITextField *searchField = _searchHeader.searchField;
NSString *searchString = [searchField.text lowercaseString];
if ([searchString hasPrefix:@"siri"]) {
NSString *searchStringWithoutSiri = [searchString
stringByReplacingOccurrencesOfString:@"siri" withString:@""];
if (![[searchStringWithoutSiri stringByReplacingOccurrencesOfString:@" " withString:@""] isEqual:@""]) {
NSArray *myStrings = [NSArray arrayWithObjects:searchStringWithoutSiri, nil];
[springBoard setNextAssistantRecognitionStrings:myStrings];
}
SBAssistantController *assistantController = [%c(SBAssistantController) sharedInstance];
[assistantController handleSiriButtonDownEventFromSource:1 activationEvent:1];
[assistantController handleSiriButtonUpEventFromSource:1];
searchField.text = @"";
}
%orig;
}

%end

+ 9
- 0
control Целия файл

@@ -0,0 +1,9 @@
Package: com.gilshahar7.spotlightsiri10
Name: SpotlightSiri10
Depends: mobilesubstrate
Version: 1.1
Architecture: iphoneos-arm
Description: Use Siri by prefixing Spotlight searches with "Siri" and pressing cancel.
Maintainer: gilshahar7
Author: gilshahar7
Section: Tweaks

Loading…
Отказ
Запис