mirror of
https://github.com/ZaidElkurdi/AssistantPlus.git
synced 2025-01-22 11:28:31 +00:00
-Text commands working
This commit is contained in:
parent
dac72ed852
commit
68e5181dd6
@ -1 +1 @@
|
||||
31
|
||||
51
|
@ -1,26 +0,0 @@
|
||||
//
|
||||
// AssistantPlugin.h
|
||||
//
|
||||
//
|
||||
// Created by Zaid Elkurdi on 3/12/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import "AssistantPlusHeaders.h"
|
||||
|
||||
@interface APPlugin : NSObject <APPluginManager>
|
||||
|
||||
@property (strong, nonatomic) NSString *pluginName;
|
||||
@property (strong, nonatomic) NSString *pluginFilePath;
|
||||
@property (strong, nonatomic) id<APPlugin> pluginClass;
|
||||
|
||||
- (id)initWithFilePath:(NSURL*)filePath andName:(NSString*)name;
|
||||
|
||||
- (BOOL)handleSpeech:(NSString*)text forSession:(APSession*)session;
|
||||
|
||||
/// Register a command class
|
||||
-(BOOL)registerCommand:(Class)cls;
|
||||
/// Register a snippet class
|
||||
-(BOOL)registerSnippet:(Class)cls;
|
||||
|
||||
@end
|
Binary file not shown.
@ -1,6 +1,13 @@
|
||||
#import "APSession.h"
|
||||
#import "APPluginManager.h"
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "assistantpluspluginmanager/AssistantPlusHeaders.h"
|
||||
#import "assistantpluspluginmanager/AssistantHeaders.h"
|
||||
#import "assistantpluspluginmanager/APPluginManager.h"
|
||||
#import "assistantpluspluginmanager/APSession.h"
|
||||
#import <libobjcipc/objcipc.h>
|
||||
|
||||
@interface APSBPluginManager : NSObject
|
||||
+ (id)getSharedManager;
|
||||
@end
|
||||
|
||||
@protocol SAAceSerializable <NSObject>
|
||||
@end
|
||||
@ -21,139 +28,132 @@
|
||||
@end
|
||||
|
||||
static BOOL defaultHandling = YES;
|
||||
static AFConnection *currConnection;
|
||||
//static AFConnection *currConnection;
|
||||
|
||||
static APPluginManager *pluginManager;
|
||||
|
||||
%ctor {
|
||||
NSLog(@"Ctor called!");
|
||||
pluginManager = [[APPluginManager sharedManager] retain];
|
||||
}
|
||||
|
||||
%hook AFUISiriSession
|
||||
- (AFConnection * )_connection { %log; AFConnection * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (NSString * )debugDescription { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (NSString * )description { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (void)setEyesFree:(bool )eyesFree { %log; %orig; }
|
||||
- (bool )isEyesFree { %log; bool r = %orig; NSLog(@" = %d", r); return r; }
|
||||
- (unsigned long long )hash { %log; unsigned long long r = %orig; NSLog(@" = %llu", r); return r; }
|
||||
+ (unsigned long long)availabilityState { %log; unsigned long long r = %orig; NSLog(@" = %llu", r); return r; }
|
||||
+ (void)beginMonitoringSiriAvailability { %log; %orig; }
|
||||
+ (id)effectiveCoreLocationBundle { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (void)didChangeDialogPhase:(id)arg1 { %log; %orig; }
|
||||
- (void)handleRequestUpdateViewsCommand:(id)arg1 { %log; %orig; }
|
||||
- (void)handleUnlockDeviceCommand:(id)arg1 { %log; %orig; }
|
||||
- (bool)hasActiveRequest { %log; bool r = %orig; NSLog(@" = %d", r); return r; }
|
||||
- (void)outputVoiceDidChange:(id)arg1 { %log; %orig; }
|
||||
- (void)performAceCommand:(id)arg1 forRequestUpdateViewsCommand:(id)arg2 afterDelay:(double)arg3 { %log; %orig; }
|
||||
- (void)performBlockWithDelegate:(id)arg1 { %log; %orig; }
|
||||
- (void)performTransitionForEvent:(long long)arg1 { %log; %orig; }
|
||||
- (id)preparedSpeechRequestWithRequestOptions:(id)arg1 { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (void)requestContextWithCompletion:(id)arg1 { %log; %orig; }
|
||||
- (void)requestDidFinishWithError:(id)arg1 { %log; %orig; }
|
||||
- (void)requestWillStart { %log; %orig; }
|
||||
- (void)siriNetworkAvailabilityDidChange:(id)arg1 { %log; %orig; }
|
||||
- (void)startContinuityRequestWithInfo:(id)arg1 { %log; %orig; }
|
||||
- (void)startDirectActionRequestWithString:(id)arg1 appID:(id)arg2 withMessagesContext:(id)arg3 { %log; %orig; }
|
||||
- (void)startRequestWithBlock:(id)arg1 { %log; %orig; }
|
||||
- (void)startRequestWithFinalOptions:(id)arg1 { %log; %orig; }
|
||||
- (void)startRequestWithText:(id)arg1 { %log; %orig; }
|
||||
- (void)startSpeechPronunciationRequestWithContext:(id)arg1 options:(id)arg2 { %log; %orig; }
|
||||
|
||||
- (void)startSpeechRequestWithOptions:(id)arg1 {
|
||||
%log;
|
||||
%orig;
|
||||
}
|
||||
|
||||
- (void)startSpeechRequestWithSpeechFileAtURL:(id)arg1 { %log; %orig; }
|
||||
- (long long)_state { %log; long long r = %orig; NSLog(@" = %lld", r); return r; }
|
||||
- (id)_stateMachine { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (void)_voiceOverStatusDidChange:(id)arg1 { %log; %orig; }
|
||||
- (void)assistantConnection:(id)arg1 didChangeAudioSessionID:(unsigned int)arg2 { %log; %orig; }
|
||||
- (void)assistantConnection:(id)arg1 didFinishAcousticIDRequestWithSuccess:(bool)arg2 { %log; %orig; }
|
||||
- (void)assistantConnection:(id)arg1 openURL:(id)arg2 completion:(id)arg3 { %log; %orig; }
|
||||
- (void)assistantConnection:(id)arg1 receivedCommand:(id)arg2 { %log; %orig; }
|
||||
- (void)assistantConnection:(id)arg1 requestFailedWithError:(id)arg2 requestClass:(id)arg3 { %log; %orig; }
|
||||
- (void)assistantConnection:(id)arg1 shouldSpeak:(bool)arg2 { %log; %orig; }
|
||||
- (void)assistantConnection:(id)arg1 speechRecognized:(id)arg2 { %log; %orig; }
|
||||
- (void)assistantConnection:(id)arg1 speechRecognizedPartialResult:(id)arg2 { %log; %orig; }
|
||||
- (void)assistantConnection:(id)arg1 speechRecordingDidBeginOnAVRecordRoute:(id)arg2 { %log; %orig; }
|
||||
- (void)assistantConnection:(id)arg1 speechRecordingDidChangeAVRecordRoute:(id)arg2 { %log; %orig; }
|
||||
- (void)assistantConnection:(id)arg1 speechRecordingDidFail:(id)arg2 { %log; %orig; }
|
||||
- (void)assistantConnectionDidChangeAudioRecordingPower:(id)arg1 { %log; %orig; }
|
||||
- (void)assistantConnectionDidDetectMusic:(id)arg1 { %log; %orig; }
|
||||
- (void)assistantConnectionDismissAssistant:(id)arg1 { %log; %orig; }
|
||||
- (void)assistantConnectionRequestFinished:(id)arg1 { %log; %orig; }
|
||||
- (void)assistantConnectionRequestWillStart:(id)arg1 { %log; %orig; }
|
||||
- (void)assistantConnectionSpeechRecordingDidCancel:(id)arg1 { %log; %orig; }
|
||||
- (void)assistantConnectionSpeechRecordingDidEnd:(id)arg1 { %log; %orig; }
|
||||
- (void)assistantConnectionSpeechRecordingWillBegin:(id)arg1 { %log; %orig; }
|
||||
- (void)cancelSpeechRequest { %log; %orig; }
|
||||
- (void)clearContext { %log; %orig; }
|
||||
- (void)dealloc { %log; %orig; }
|
||||
- (id)delegate { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (void)end { %log; %orig; }
|
||||
- (void)forceAudioSessionActive { %log; %orig; }
|
||||
- (id)initWithConnection:(id)arg1 delegateQueue:(id)arg2 { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (bool)isListening { %log; bool r = %orig; NSLog(@" = %d", r); return r; }
|
||||
- (bool)isPreventingActivationGesture { %log; bool r = %orig; NSLog(@" = %d", r); return r; }
|
||||
- (id)localDataSource { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (id)localDelegate { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (void)performAceCommand:(id)arg1 conflictHandler:(id)arg2 { %log; %orig; }
|
||||
- (void)performAceCommand:(id)arg1 { %log; %orig; }
|
||||
- (void)preheat { %log; %orig; }
|
||||
- (void)recordMetrics:(id)arg1 { %log; %orig; }
|
||||
- (float)recordingPowerLevel { %log; float r = %orig; NSLog(@" = %f", r); return r; }
|
||||
- (void)requestDidPresent { %log; %orig; }
|
||||
- (void)resetContext { %log; %orig; }
|
||||
- (void)resultDidChangeForAceCommand:(id)arg1 { %log; %orig; }
|
||||
- (void)rollbackClearContext { %log; %orig; }
|
||||
- (void)sendReplyCommand:(id)arg1 { %log; %orig; }
|
||||
- (void)setAlertContext { %log; %orig; }
|
||||
- (void)setApplicationContext { %log; %orig; }
|
||||
- (void)setDelegate:(id)arg1 { %log; %orig; }
|
||||
- (void)setIsStark:(bool)arg1 { %log; %orig; }
|
||||
- (void)setLocalDataSource:(id)arg1 { %log; %orig; }
|
||||
- (void)setLocalDelegate:(id)arg1 { %log; %orig; }
|
||||
- (void)setLockState:(unsigned long long)arg1 { %log; %orig; }
|
||||
- (void)setOverriddenApplicationContext:(id)arg1 withSMSContext:(id)arg2 { %log; %orig; }
|
||||
- (id)speechSynthesis { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (void)speechSynthesisWillStartSpeaking:(id)arg1 { %log; %orig; }
|
||||
- (void)startCorrectedRequestWithText:(id)arg1 correctionIdentifier:(id)arg2 { %log; %orig; }
|
||||
- (void)startRequestWithOptions:(id)arg1 { %log; %orig; }
|
||||
- (id)stateMachine:(id)arg1 descriptionForEvent:(long long)arg2 { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (void)stateMachine:(id)arg1 didTransitionFromState:(long long)arg2 forEvent:(long long)arg3 { %log; %orig; }
|
||||
- (void)stopRecordingSpeech { %log; %orig; }
|
||||
- (void)stopRequestWithOptions:(id)arg1 { %log; %orig; }
|
||||
- (void)telephonyRequestCompleted { %log; %orig; }
|
||||
- (id)underlyingConnection { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (void)updateRequestOptions:(id)arg1 { %log; %orig; }
|
||||
%end
|
||||
//%hook AFUISiriSession
|
||||
//- (AFConnection * )_connection { %log; AFConnection * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (NSString * )debugDescription { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (NSString * )description { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (void)setEyesFree:(bool )eyesFree { %log; %orig; }
|
||||
//- (bool )isEyesFree { %log; bool r = %orig; NSLog(@" = %d", r); return r; }
|
||||
//- (unsigned long long )hash { %log; unsigned long long r = %orig; NSLog(@" = %llu", r); return r; }
|
||||
//+ (unsigned long long)availabilityState { %log; unsigned long long r = %orig; NSLog(@" = %llu", r); return r; }
|
||||
//+ (void)beginMonitoringSiriAvailability { %log; %orig; }
|
||||
//+ (id)effectiveCoreLocationBundle { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (void)didChangeDialogPhase:(id)arg1 { %log; %orig; }
|
||||
//- (void)handleRequestUpdateViewsCommand:(id)arg1 { %log; %orig; }
|
||||
//- (void)handleUnlockDeviceCommand:(id)arg1 { %log; %orig; }
|
||||
//- (bool)hasActiveRequest { %log; bool r = %orig; NSLog(@" = %d", r); return r; }
|
||||
//- (void)outputVoiceDidChange:(id)arg1 { %log; %orig; }
|
||||
//- (void)performAceCommand:(id)arg1 forRequestUpdateViewsCommand:(id)arg2 afterDelay:(double)arg3 { %log; %orig; }
|
||||
//- (void)performBlockWithDelegate:(id)arg1 { %log; %orig; }
|
||||
//- (void)performTransitionForEvent:(long long)arg1 { %log; %orig; }
|
||||
//- (id)preparedSpeechRequestWithRequestOptions:(id)arg1 { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (void)requestContextWithCompletion:(id)arg1 { %log; %orig; }
|
||||
//- (void)requestDidFinishWithError:(id)arg1 { %log; %orig; }
|
||||
//- (void)requestWillStart { %log; %orig; }
|
||||
//- (void)siriNetworkAvailabilityDidChange:(id)arg1 { %log; %orig; }
|
||||
//- (void)startContinuityRequestWithInfo:(id)arg1 { %log; %orig; }
|
||||
//- (void)startDirectActionRequestWithString:(id)arg1 appID:(id)arg2 withMessagesContext:(id)arg3 { %log; %orig; }
|
||||
//- (void)startRequestWithBlock:(id)arg1 { %log; %orig; }
|
||||
//- (void)startRequestWithFinalOptions:(id)arg1 { %log; %orig; }
|
||||
//- (void)startRequestWithText:(id)arg1 { %log; %orig; }
|
||||
//- (void)startSpeechPronunciationRequestWithContext:(id)arg1 options:(id)arg2 { %log; %orig; }
|
||||
//
|
||||
//- (void)startSpeechRequestWithOptions:(id)arg1 {
|
||||
// %log;
|
||||
// %orig;
|
||||
//}
|
||||
//
|
||||
//- (void)startSpeechRequestWithSpeechFileAtURL:(id)arg1 { %log; %orig; }
|
||||
//- (long long)_state { %log; long long r = %orig; NSLog(@" = %lld", r); return r; }
|
||||
//- (id)_stateMachine { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (void)_voiceOverStatusDidChange:(id)arg1 { %log; %orig; }
|
||||
//- (void)assistantConnection:(id)arg1 didChangeAudioSessionID:(unsigned int)arg2 { %log; %orig; }
|
||||
//- (void)assistantConnection:(id)arg1 didFinishAcousticIDRequestWithSuccess:(bool)arg2 { %log; %orig; }
|
||||
//- (void)assistantConnection:(id)arg1 openURL:(id)arg2 completion:(id)arg3 { %log; %orig; }
|
||||
//- (void)assistantConnection:(id)arg1 receivedCommand:(id)arg2 { %log; %orig; }
|
||||
//- (void)assistantConnection:(id)arg1 requestFailedWithError:(id)arg2 requestClass:(id)arg3 { %log; %orig; }
|
||||
//- (void)assistantConnection:(id)arg1 shouldSpeak:(bool)arg2 { %log; %orig; }
|
||||
//- (void)assistantConnection:(id)arg1 speechRecognized:(id)arg2 { %log; %orig; }
|
||||
//- (void)assistantConnection:(id)arg1 speechRecognizedPartialResult:(id)arg2 { %log; %orig; }
|
||||
//- (void)assistantConnection:(id)arg1 speechRecordingDidBeginOnAVRecordRoute:(id)arg2 { %log; %orig; }
|
||||
//- (void)assistantConnection:(id)arg1 speechRecordingDidChangeAVRecordRoute:(id)arg2 { %log; %orig; }
|
||||
//- (void)assistantConnection:(id)arg1 speechRecordingDidFail:(id)arg2 { %log; %orig; }
|
||||
//- (void)assistantConnectionDidChangeAudioRecordingPower:(id)arg1 { %log; %orig; }
|
||||
//- (void)assistantConnectionDidDetectMusic:(id)arg1 { %log; %orig; }
|
||||
//- (void)assistantConnectionDismissAssistant:(id)arg1 { %log; %orig; }
|
||||
//- (void)assistantConnectionRequestFinished:(id)arg1 { %log; %orig; }
|
||||
//- (void)assistantConnectionRequestWillStart:(id)arg1 { %log; %orig; }
|
||||
//- (void)assistantConnectionSpeechRecordingDidCancel:(id)arg1 { %log; %orig; }
|
||||
//- (void)assistantConnectionSpeechRecordingDidEnd:(id)arg1 { %log; %orig; }
|
||||
//- (void)assistantConnectionSpeechRecordingWillBegin:(id)arg1 { %log; %orig; }
|
||||
//- (void)cancelSpeechRequest { %log; %orig; }
|
||||
//- (void)clearContext { %log; %orig; }
|
||||
//- (void)dealloc { %log; %orig; }
|
||||
//- (id)delegate { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (void)end { %log; %orig; }
|
||||
//- (void)forceAudioSessionActive { %log; %orig; }
|
||||
//- (id)initWithConnection:(id)arg1 delegateQueue:(id)arg2 { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (bool)isListening { %log; bool r = %orig; NSLog(@" = %d", r); return r; }
|
||||
//- (bool)isPreventingActivationGesture { %log; bool r = %orig; NSLog(@" = %d", r); return r; }
|
||||
//- (id)localDataSource { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (id)localDelegate { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (void)performAceCommand:(id)arg1 conflictHandler:(id)arg2 { %log; %orig; }
|
||||
//- (void)performAceCommand:(id)arg1 { %log; %orig; }
|
||||
//- (void)preheat { %log; %orig; }
|
||||
//- (void)recordMetrics:(id)arg1 { %log; %orig; }
|
||||
//- (float)recordingPowerLevel { %log; float r = %orig; NSLog(@" = %f", r); return r; }
|
||||
//- (void)requestDidPresent { %log; %orig; }
|
||||
//- (void)resetContext { %log; %orig; }
|
||||
//- (void)resultDidChangeForAceCommand:(id)arg1 { %log; %orig; }
|
||||
//- (void)rollbackClearContext { %log; %orig; }
|
||||
//- (void)sendReplyCommand:(id)arg1 { %log; %orig; }
|
||||
//- (void)setAlertContext { %log; %orig; }
|
||||
//- (void)setApplicationContext { %log; %orig; }
|
||||
//- (void)setDelegate:(id)arg1 { %log; %orig; }
|
||||
//- (void)setIsStark:(bool)arg1 { %log; %orig; }
|
||||
//- (void)setLocalDataSource:(id)arg1 { %log; %orig; }
|
||||
//- (void)setLocalDelegate:(id)arg1 { %log; %orig; }
|
||||
//- (void)setLockState:(unsigned long long)arg1 { %log; %orig; }
|
||||
//- (void)setOverriddenApplicationContext:(id)arg1 withSMSContext:(id)arg2 { %log; %orig; }
|
||||
//- (id)speechSynthesis { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (void)speechSynthesisWillStartSpeaking:(id)arg1 { %log; %orig; }
|
||||
//- (void)startCorrectedRequestWithText:(id)arg1 correctionIdentifier:(id)arg2 { %log; %orig; }
|
||||
//- (void)startRequestWithOptions:(id)arg1 { %log; %orig; }
|
||||
//- (id)stateMachine:(id)arg1 descriptionForEvent:(long long)arg2 { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (void)stateMachine:(id)arg1 didTransitionFromState:(long long)arg2 forEvent:(long long)arg3 { %log; %orig; }
|
||||
//- (void)stopRecordingSpeech { %log; %orig; }
|
||||
//- (void)stopRequestWithOptions:(id)arg1 { %log; %orig; }
|
||||
//- (void)telephonyRequestCompleted { %log; %orig; }
|
||||
//- (id)underlyingConnection { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (void)updateRequestOptions:(id)arg1 { %log; %orig; }
|
||||
//%end
|
||||
|
||||
|
||||
%hook SAAceView
|
||||
+ (id)aceViewWithDictionary:(id)arg1 context:(id)arg2 { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
+ (id)aceView { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (void)setViewId:(NSString *)viewId { %log; %orig; }
|
||||
- (NSString *)viewId { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (void)setSpeakableText:(NSString *)speakableText { %log; %orig; }
|
||||
- (NSString *)speakableText { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (void)setListenAfterSpeaking:(NSNumber *)listenAfterSpeaking { %log; %orig; }
|
||||
- (NSNumber *)listenAfterSpeaking { %log; NSNumber * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (void)setDeferredRendering:(BOOL )deferredRendering { %log; %orig; }
|
||||
- (BOOL )deferredRendering { %log; BOOL r = %orig; NSLog(@" = %d", r); return r; }
|
||||
- (void)setContext:(id)context { %log; %orig; }
|
||||
- (id)context { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (id)encodedClassName { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (id)groupIdentifier { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (NSString *)debugDescription { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (NSString *)description { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
%end
|
||||
|
||||
%hook SiriUIPluginManager
|
||||
|
||||
- (id)disambiguationItemForListItem:(id)arg1 disambiguationKey:(id)arg2 { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
- (id)speakableProviderForObject:(id)arg1 { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//%hook SAAceView
|
||||
//+ (id)aceViewWithDictionary:(id)arg1 context:(id)arg2 { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//+ (id)aceView { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (void)setViewId:(NSString *)viewId { %log; %orig; }
|
||||
//- (NSString *)viewId { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (void)setSpeakableText:(NSString *)speakableText { %log; %orig; }
|
||||
//- (NSString *)speakableText { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (void)setListenAfterSpeaking:(NSNumber *)listenAfterSpeaking { %log; %orig; }
|
||||
//- (NSNumber *)listenAfterSpeaking { %log; NSNumber * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (void)setDeferredRendering:(BOOL )deferredRendering { %log; %orig; }
|
||||
//- (BOOL )deferredRendering { %log; BOOL r = %orig; NSLog(@" = %d", r); return r; }
|
||||
//- (void)setContext:(id)context { %log; %orig; }
|
||||
//- (id)context { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (id)encodedClassName { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (id)groupIdentifier { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (NSString *)debugDescription { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (NSString *)description { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//%end
|
||||
//
|
||||
//%hook SiriUIPluginManager
|
||||
//
|
||||
//- (id)disambiguationItemForListItem:(id)arg1 disambiguationKey:(id)arg2 { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
//- (id)speakableProviderForObject:(id)arg1 { %log; id r = %orig; NSLog(@" = %@", r); return r; }
|
||||
|
||||
//- (id)transcriptItemForObject:(AceObject*)arg1 {
|
||||
// NSLog(@"ARG1 is: %@", arg1);
|
||||
@ -171,7 +171,7 @@ static APPluginManager *pluginManager;
|
||||
// // return r;
|
||||
//}
|
||||
|
||||
%end
|
||||
//%end
|
||||
|
||||
|
||||
//%hook SiriUITranscriptItem
|
||||
@ -319,18 +319,15 @@ static APPluginManager *pluginManager;
|
||||
|
||||
- (void)startRequestWithText:(NSString*)text {
|
||||
NSLog(@"text is %@", text);
|
||||
if ([[text lowercaseString] isEqualToString:@"hello"]) {
|
||||
NSLog(@"FOUND IT!");
|
||||
} else {
|
||||
NSLog(@"didn't find it!");
|
||||
}
|
||||
NSLog(@"Here!!!");
|
||||
APSession *currSession = [APSession sessionWithRefId:nil andConnection:self];
|
||||
NSLog(@"Here! with %@", pluginManager);
|
||||
APPluginManager *pluginManager = [%c(APSBPluginManager) getSharedManager];
|
||||
NSLog(@"Retrieved: %@", pluginManager);
|
||||
if ([pluginManager handleCommand:text withSession:currSession]) {
|
||||
NSLog(@"Handling!");
|
||||
} else {
|
||||
NSLog(@"Default!");
|
||||
%orig;
|
||||
}
|
||||
}
|
||||
|
||||
@ -367,19 +364,19 @@ static APPluginManager *pluginManager;
|
||||
|
||||
NSLog(@"Query: %@", phraseBuilder);
|
||||
|
||||
AFConnection *connection;
|
||||
object_getInstanceVariable(self, "_connection", (void **)&connection);
|
||||
currConnection = connection;
|
||||
|
||||
APSession *currSession = [APSession sessionWithRefId:nil andConnection:currConnection];
|
||||
|
||||
if ([pluginManager handleCommand:phraseBuilder withSession:currSession]) {
|
||||
defaultHandling = NO;
|
||||
NSLog(@"Handling with plugin!");
|
||||
} else {
|
||||
defaultHandling = NO;
|
||||
NSLog(@"Going to default!");
|
||||
}
|
||||
// AFConnection *connection;
|
||||
// object_getInstanceVariable(self, "_connection", (void **)&connection);
|
||||
// currConnection = connection;
|
||||
//
|
||||
// APSession *currSession = [APSession sessionWithRefId:nil andConnection:currConnection];
|
||||
//
|
||||
// if ([pluginManager handleCommand:phraseBuilder withSession:currSession]) {
|
||||
// defaultHandling = NO;
|
||||
// NSLog(@"Handling with plugin!");
|
||||
// } else {
|
||||
// defaultHandling = NO;
|
||||
// NSLog(@"Going to default!");
|
||||
// }
|
||||
}
|
||||
|
||||
- (void)requestDidFinish{ %log; %orig; }
|
||||
|
@ -6,7 +6,6 @@
|
||||
//
|
||||
//
|
||||
|
||||
#import "APSession.h"
|
||||
#import "AssistantHeaders.h"
|
||||
|
||||
#ifndef _AssistantPlusHeaders_h
|
||||
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.springboard.launchapplications</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
@ -6,12 +6,15 @@ export SDKVERSION=8.1
|
||||
|
||||
TWEAK_NAME = Assistant+
|
||||
|
||||
Assistant+_FILES = AssistantHooks.xm APSession.xm APPluginManager.mm APPlugin.m
|
||||
Assistant+_FILES = AssistantHooks.xm assistantpluspluginmanager/APSession.xm
|
||||
|
||||
Assistant+_FRAMEWORKS = Foundation UIKit CoreFoundation Accounts CoreLocation
|
||||
Assistant+_PRIVATE_FRAMEWORKS = AssistantServices SAObjects
|
||||
Assistant+_CODESIGN_FLAGS = -SEntitlements.plist
|
||||
Assistant+_LIBRARIES=substrate objcipc
|
||||
|
||||
include $(THEOS_MAKE_PATH)/tweak.mk
|
||||
|
||||
after-install::
|
||||
install.exec "killall -9 SpringBoard"
|
||||
SUBPROJECTS += assistantpluspluginmanager
|
||||
include $(THEOS_MAKE_PATH)/aggregate.mk
|
||||
|
@ -6,5 +6,5 @@ Description: Framework for Siri Extensions
|
||||
Maintainer: Zaid Elkurdi
|
||||
Author: Zaid Elkurdi
|
||||
Section: Tweaks
|
||||
Version: 0.0.1-31
|
||||
Installed-Size: 204
|
||||
Version: 0.0.1-51
|
||||
Installed-Size: 276
|
||||
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
||||
{ Filter = { Bundles = ( "com.apple.springboard" ); }; }
|
37
assistant+/assistantpluspluginmanager/APPlugin.h
Normal file
37
assistant+/assistantpluspluginmanager/APPlugin.h
Normal file
@ -0,0 +1,37 @@
|
||||
//
|
||||
// AssistantPlugin.h
|
||||
//
|
||||
//
|
||||
// Created by Zaid Elkurdi on 3/12/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import "AssistantPlusHeaders.h"
|
||||
|
||||
@interface APPlugin : NSObject <APPluginManager> {
|
||||
NSBundle *bundle;
|
||||
BOOL isInitialized;
|
||||
|
||||
NSString *name;
|
||||
NSString *displayName;
|
||||
NSString *bundleName;
|
||||
NSString *pluginDescription;
|
||||
NSString *author;
|
||||
NSString *identifier;
|
||||
NSMutableArray *commands;
|
||||
NSMutableSet *snippets;
|
||||
NSString *pluginName;
|
||||
NSString *pluginFilePath;
|
||||
id<APPlugin> pluginClass;
|
||||
}
|
||||
-(NSString*)displayName;
|
||||
- (id)initWithFilePath:(NSURL*)filePath andName:(NSString*)name;
|
||||
|
||||
- (BOOL)handleSpeech:(NSString*)text forSession:(APSession*)session;
|
||||
|
||||
/// Register a command class
|
||||
-(BOOL)registerCommand:(Class)cls;
|
||||
/// Register a snippet class
|
||||
-(BOOL)registerSnippet:(Class)cls;
|
||||
|
||||
@end
|
@ -8,76 +8,76 @@
|
||||
|
||||
#import "APPlugin.h"
|
||||
|
||||
@interface APPlugin()
|
||||
@property (strong, nonatomic) NSBundle *bundle;
|
||||
@property (nonatomic) BOOL isInitialized;
|
||||
|
||||
@property (strong, nonatomic) NSString *name;
|
||||
@property (strong, nonatomic) NSString *displayName;
|
||||
@property (strong, nonatomic) NSString *bundleName;
|
||||
@property (strong, nonatomic) NSString *pluginDescription;
|
||||
@property (strong, nonatomic) NSString *author;
|
||||
@property (strong, nonatomic) NSString *identifier;
|
||||
|
||||
@property (strong, nonatomic) NSMutableArray *commands;
|
||||
@property (strong, nonatomic) NSMutableSet *snippets;
|
||||
|
||||
@end
|
||||
|
||||
@implementation APPlugin
|
||||
|
||||
- (id)initWithFilePath:(NSURL*)filePath andName:(NSString*)name {
|
||||
- (id)initWithFilePath:(NSURL*)filePath andName:(NSString*)fileName {
|
||||
if ((self = [super init])) {
|
||||
self.bundle = [[NSBundle bundleWithURL:filePath] retain];
|
||||
if (!self.bundle) {
|
||||
NSLog(@"Failed to open extension bundle %@ (%@)!", name, filePath);
|
||||
|
||||
commands = [[NSMutableArray alloc] init];
|
||||
snippets = [[NSMutableSet alloc] init];
|
||||
|
||||
NSLog(@"Commnds just created: %@", commands);
|
||||
|
||||
bundle = [[NSBundle bundleWithURL:filePath] retain];
|
||||
if (!bundle) {
|
||||
NSLog(@"Failed to open extension bundle %@ (%@)!", fileName, filePath);
|
||||
[self release];
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (![self.bundle load]) {
|
||||
if (![bundle load]) {
|
||||
NSLog(@"Failed to load extension bundle %@ (wrong CFBundleExecutable? Missing? Not signed?)!", name);
|
||||
[self release];
|
||||
return nil;
|
||||
} else {
|
||||
NSLog(@"Loaded bundle!");
|
||||
}
|
||||
|
||||
//load principal class
|
||||
Class principal = [self.bundle principalClass];
|
||||
Class principal = [bundle principalClass];
|
||||
if (!principal) {
|
||||
NSLog(@"Plugin %@ doesn't provide a NSPrincipalClass!", name);
|
||||
NSLog(@"Plugin %@ doesn't provide a NSPrincipalClass!", fileName);
|
||||
[self release];
|
||||
return nil;
|
||||
} else {
|
||||
NSLog(@"has principal!");
|
||||
}
|
||||
|
||||
self.pluginClass = [[principal alloc] initWithSystem:self];
|
||||
if (!self.pluginClass) {
|
||||
NSLog(@"Failed to initialize NSPrincipalClass from plugin %@!", name);
|
||||
pluginClass = [[principal alloc] initWithSystem:self];
|
||||
if (!pluginClass) {
|
||||
NSLog(@"Failed to initialize NSPrincipalClass from plugin %@!", fileName);
|
||||
[self release];
|
||||
return nil;
|
||||
} else {
|
||||
NSLog(@"has pluginClass!");
|
||||
}
|
||||
|
||||
self.commands = [[NSMutableArray alloc] init];
|
||||
self.snippets = [[NSMutableSet alloc] init];
|
||||
|
||||
// get extension info
|
||||
self.displayName = [[[_bundle infoDictionary] objectForKey:@"APPluginName"] copy];
|
||||
if (!self.displayName) {
|
||||
self.displayName = name;
|
||||
}
|
||||
displayName = @"FuckerShit";
|
||||
// displayName = [[[_bundle infoDictionary] objectForKey:@"APPluginName"] copy];
|
||||
// if (!displayName) {
|
||||
// displayName = name;
|
||||
// }
|
||||
|
||||
self.author = [[self.bundle objectForInfoDictionaryKey:@"PluginAuthor"] copy];
|
||||
self.pluginDescription = [[self.bundle objectForInfoDictionaryKey:@"PluginDescription"] copy];
|
||||
self.identifier = [[self.bundle objectForInfoDictionaryKey:@"CFBundleIdentifier"] copy];
|
||||
author = [[bundle objectForInfoDictionaryKey:@"PluginAuthor"] copy];
|
||||
pluginDescription = [[bundle objectForInfoDictionaryKey:@"PluginDescription"] copy];
|
||||
identifier = [[bundle objectForInfoDictionaryKey:@"CFBundleIdentifier"] copy];
|
||||
pluginName = fileName;
|
||||
|
||||
self.bundleName = [name copy];
|
||||
self.isInitialized = YES;
|
||||
bundleName = [name copy];
|
||||
isInitialized = YES;
|
||||
}
|
||||
|
||||
NSLog(@"Loaded Plugin: %@", self);
|
||||
return self;
|
||||
}
|
||||
|
||||
-(NSString*)displayName {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
- (BOOL)handleSpeech:(NSString*)text forSession:(APSession*)currSession {
|
||||
for (NSObject<APPluginCommand>* cmd in self.commands) {
|
||||
for (NSObject<APPluginCommand>* cmd in commands) {
|
||||
if ([cmd respondsToSelector:@selector(handleSpeech:session:)]) {
|
||||
if ([cmd handleSpeech:text session:currSession]) {
|
||||
return YES;
|
||||
@ -93,7 +93,7 @@
|
||||
#pragma mark - Snippet Presentation
|
||||
|
||||
-(NSObject<APPluginSnippet>*)allocSnippet:(NSString*)snippetClass properties:(NSDictionary *)props {
|
||||
if ([self.snippets containsObject:snippetClass]) {
|
||||
if ([snippets containsObject:snippetClass]) {
|
||||
NSObject<APPluginSnippet>* snip = [NSClassFromString(snippetClass) alloc];
|
||||
|
||||
id initRes = nil;
|
||||
@ -142,10 +142,11 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
[self.commands addObject:inst];
|
||||
|
||||
[commands addObject:inst];
|
||||
[inst release];
|
||||
|
||||
NSLog(@"Registered Command %@", className);
|
||||
NSLog(@"Registered Command %@, commands is now: %@", className, commands);
|
||||
|
||||
return YES;
|
||||
}
|
||||
@ -158,8 +159,8 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
NSLog(@"Registered snippet %@", className);
|
||||
[self.snippets addObject:className];
|
||||
NSLog(@"Registered snippet %@, snippets is now %@", className, snippets);
|
||||
[snippets addObject:className];
|
||||
|
||||
return YES;
|
||||
}
|
@ -8,7 +8,9 @@
|
||||
|
||||
#import "APSession.h"
|
||||
|
||||
@interface APPluginManager : NSObject
|
||||
@interface APPluginManager : NSObject {
|
||||
NSMutableArray *plugins;
|
||||
}
|
||||
+ (id)sharedManager;
|
||||
- (BOOL)loadPlugins;
|
||||
- (BOOL)handleCommand:(NSString*)command withSession:(APSession*)currSession;
|
@ -11,9 +11,7 @@
|
||||
|
||||
#define PLUGIN_PATH "/Library/AssistantPlusPlugins/"
|
||||
|
||||
@implementation APPluginManager {
|
||||
NSMutableArray *plugins;
|
||||
}
|
||||
@implementation APPluginManager
|
||||
|
||||
+ (id)sharedManager {
|
||||
static APPluginManager *sharedManager = nil;
|
||||
@ -31,7 +29,7 @@
|
||||
}
|
||||
|
||||
- (BOOL)loadPlugins {
|
||||
plugins = [[[[NSMutableArray alloc] init] retain] autorelease];
|
||||
plugins = [[NSMutableArray alloc] init];
|
||||
|
||||
NSURL *directoryPath = [NSURL URLWithString:@PLUGIN_PATH];
|
||||
|
||||
@ -48,10 +46,11 @@
|
||||
NSString *name = [[[fileURL absoluteString] lastPathComponent] stringByDeletingPathExtension];
|
||||
|
||||
NSLog(@"Loading %@ at %@", name, fileURL);
|
||||
APPlugin *currPlugin = [[[APPlugin alloc] initWithFilePath:fileURL andName:name] autorelease];
|
||||
APPlugin *currPlugin = [[APPlugin alloc] initWithFilePath:fileURL andName:name];
|
||||
|
||||
if (currPlugin != nil) {
|
||||
[plugins addObject:currPlugin];
|
||||
//Need to release currPlugin?
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,11 +58,14 @@
|
||||
}
|
||||
|
||||
- (BOOL)handleCommand:(NSString*)command withSession:(APSession*)currSession {
|
||||
[currSession sendSnippetWithText:@"Shit!"];
|
||||
NSLog(@"Looking for command to handle: %@", command);
|
||||
NSLog(@"There are currently %lu plugins registered: %@", (unsigned long)plugins.count, plugins);
|
||||
for (APPlugin *currPlugin in plugins) {
|
||||
NSLog(@"Currently on: %@:%@", currPlugin, [currPlugin displayName]);
|
||||
if ([currPlugin handleSpeech:command forSession:currSession]) {
|
||||
NSLog(@"%@ is handling command: %@", currPlugin.pluginName, command);
|
||||
NSLog(@"%@ is handling command: %@", [currPlugin displayName], command);
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
return NO;
|
181
assistant+/assistantpluspluginmanager/AssistantHeaders.h
Normal file
181
assistant+/assistantpluspluginmanager/AssistantHeaders.h
Normal file
@ -0,0 +1,181 @@
|
||||
//
|
||||
// AssistantHeaders.h
|
||||
//
|
||||
//
|
||||
// Created by Zaid Elkurdi on 3/7/15.
|
||||
//
|
||||
|
||||
#ifndef _AssistantHeaders_h
|
||||
#define _AssistantHeaders_h
|
||||
|
||||
@interface AceObject : NSObject
|
||||
@property(copy, nonatomic) NSString *refId;
|
||||
@property(copy, nonatomic) NSString *aceId;
|
||||
+ (id)aceObjectWithDictionary:(id)arg1 context:(id)arg2;
|
||||
@end
|
||||
|
||||
|
||||
@interface SiriUISnippetViewController : UIViewController
|
||||
@property(retain) AceObject * aceObject;
|
||||
-(void)siriWillActivateFromSource:(long long)arg1;
|
||||
-(void)siriDidDeactivate;
|
||||
-(void)wasAddedToTranscript;
|
||||
-(AceObject *)aceObject;
|
||||
-(void)setAceObject:(AceObject*)arg1;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@interface SiriUITranscriptItem : NSObject {
|
||||
// AceObject *_aceObject;
|
||||
// NSUUID *_itemIdentifier;
|
||||
UIViewController *_viewController;
|
||||
}
|
||||
|
||||
@property(retain) AceObject * aceObject;
|
||||
@property(copy) id itemIdentifier;
|
||||
@property(retain) UIViewController* viewController;
|
||||
|
||||
+ (id)transcriptItemWithAceObject:(id)arg1;
|
||||
|
||||
- (id)aceObject;
|
||||
- (id)description;
|
||||
- (id)initWithAceObject:(AceObject*)arg1;
|
||||
- (id)itemIdentifier;
|
||||
- (void)setAceObject:(AceObject*)arg1;
|
||||
- (void)setItemIdentifier:(id)arg1;
|
||||
- (void)setViewController:(UIViewController*)arg1;
|
||||
- (id)viewController;
|
||||
|
||||
@end
|
||||
|
||||
@protocol SiriUISnippetPlugin <NSObject>
|
||||
@optional
|
||||
-(id)viewControllerForSnippet:(id)arg1;
|
||||
-(id)viewControllerForSnippet:(id)arg1 error:(id*)arg2;
|
||||
-(id)viewControllerForAceObject:(id)arg1;
|
||||
-(id)disambiguationItemForListItem:(id)arg1 disambiguationKey:(id)arg2;
|
||||
-(id)speakableNamespaceProviderForAceObject:(id)arg1;
|
||||
@end
|
||||
|
||||
|
||||
/// Type representing one Siri class description as NSMutableDictionary
|
||||
//typedef NSMutableDictionary SOObject;
|
||||
|
||||
//#ifdef SC_PRIVATE
|
||||
//# import "SiriObjects_private.h"
|
||||
//# define SC_SUPER(cls) cls
|
||||
//#else
|
||||
//# define SC_SUPER(cls) NSObject
|
||||
//#endif
|
||||
|
||||
/// Type representing a concrete SiriObject
|
||||
@protocol SOAceObject <NSObject>
|
||||
@required
|
||||
/// Class name beginning with SA, e.g. SATest
|
||||
- (id)encodedClassName;
|
||||
/// Group identifier, e.g. com.company.ace
|
||||
- (id)groupIdentifier;
|
||||
@end
|
||||
|
||||
/// Any object (NSMutableDictionary)
|
||||
typedef NSMutableDictionary SOObject;
|
||||
/// Root object (NSMutableDictionary)
|
||||
typedef SOObject SOAceObject;
|
||||
|
||||
@protocol AFSpeechDelegate <NSObject>
|
||||
@end
|
||||
|
||||
@protocol AFAssistantUIService <NSObject>
|
||||
@end
|
||||
|
||||
@interface CDUnknownBlockType : NSObject
|
||||
@end
|
||||
|
||||
@interface AFConnection : NSObject
|
||||
@property(nonatomic, weak) id <AFSpeechDelegate> speechDelegate;
|
||||
@property(nonatomic, weak) id <AFAssistantUIService> delegate;
|
||||
- (void)_doCommand:(id)arg1 reply:(id)arg2;
|
||||
- (void)sendReplyCommand:(id)arg1;
|
||||
- (void)_willCompleteRequest;
|
||||
- (void)_tellDelegateRequestFinished;
|
||||
@end
|
||||
|
||||
@interface SABaseCommand : AceObject
|
||||
@property(copy, nonatomic) NSString *refId;
|
||||
@property(copy, nonatomic) NSString *aceId;
|
||||
@end
|
||||
|
||||
@interface SABaseClientBoundCommand : SABaseCommand
|
||||
@property(copy, nonatomic) NSArray *callbacks;
|
||||
@property(copy, nonatomic) NSString *appId;
|
||||
@end
|
||||
|
||||
@interface SAUIAddViews : SABaseClientBoundCommand
|
||||
@property(nonatomic) BOOL scrollToTop;
|
||||
@property(copy, nonatomic) NSString *displayTarget;
|
||||
@property(copy, nonatomic) NSString *dialogPhase;
|
||||
@property(copy, nonatomic) NSArray *views;
|
||||
@property(nonatomic) BOOL temporary;
|
||||
+ (id)addViewsWithDictionary:(id)arg1 context:(id)arg2;
|
||||
+ (id)addViews;
|
||||
- (BOOL)requiresResponse;
|
||||
- (id)encodedClassName;
|
||||
- (id)groupIdentifier;
|
||||
@end
|
||||
|
||||
@interface SAAceView : AceObject
|
||||
@property(copy, nonatomic) NSString *speakableText;
|
||||
@end
|
||||
|
||||
@interface SAUIAssistantUtteranceView : SAAceView
|
||||
@property(copy, nonatomic) NSString *text;
|
||||
@property(copy, nonatomic) NSString *dialogIdentifier;
|
||||
+ (id)assistantUtteranceViewWithDictionary:(id)arg1 context:(id)arg2;
|
||||
+ (id)assistantUtteranceView;
|
||||
- (id)encodedClassName;
|
||||
- (id)groupIdentifier;
|
||||
@end
|
||||
|
||||
@interface SASRecognition : AceObject
|
||||
@property(nonatomic) int sentenceConfidence;
|
||||
@property(copy, nonatomic) NSArray *phrases;
|
||||
@end
|
||||
|
||||
@interface SASSpeechRecognized : SABaseClientBoundCommand
|
||||
@property(retain, nonatomic) SASRecognition *recognition;
|
||||
@end
|
||||
|
||||
@interface AFSpeechToken : NSObject
|
||||
@property(copy, nonatomic) NSString *text;
|
||||
@end
|
||||
|
||||
@interface AFSpeechInterpretation : NSObject
|
||||
@property(copy, nonatomic) NSArray *tokens;
|
||||
@end
|
||||
|
||||
@interface AFSpeechPhrase : NSObject
|
||||
@property(copy, nonatomic) NSArray *interpretations;
|
||||
@end
|
||||
|
||||
@interface SASInterpretation : AceObject
|
||||
@property(copy, nonatomic) NSArray *tokens;
|
||||
@end
|
||||
|
||||
@protocol SiriUIViewController <NSObject>
|
||||
@property (nonatomic,retain) AceObject * aceObject;
|
||||
@optional
|
||||
-(double)desiredHeightForWidth:(double)arg1;
|
||||
-(double)desiredHeight;
|
||||
-(id)navigationTitle;
|
||||
-(void)transcriptViewControllerTappedOutsideEditingView;
|
||||
|
||||
@required
|
||||
-(void)siriWillActivateFromSource:(long long)arg1;
|
||||
-(void)siriDidDeactivate;
|
||||
-(void)wasAddedToTranscript;
|
||||
-(AceObject *)aceObject;
|
||||
-(void)setAceObject:(AceObject*)arg1;
|
||||
@end
|
||||
|
||||
#endif
|
71
assistant+/assistantpluspluginmanager/AssistantPlusHeaders.h
Normal file
71
assistant+/assistantpluspluginmanager/AssistantPlusHeaders.h
Normal file
@ -0,0 +1,71 @@
|
||||
//
|
||||
// AssistantPlusHeaders.h
|
||||
//
|
||||
//
|
||||
// Created by Zaid Elkurdi on 3/12/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import "APSession.h"
|
||||
#import "AssistantHeaders.h"
|
||||
|
||||
#ifndef _AssistantPlusHeaders_h
|
||||
#define _AssistantPlusHeaders_h
|
||||
|
||||
@protocol APPluginManager <NSObject>
|
||||
@required
|
||||
/// Register a command class
|
||||
-(BOOL)registerCommand:(Class)cls;
|
||||
/// Register a snippet class
|
||||
-(BOOL)registerSnippet:(Class)cls;
|
||||
|
||||
|
||||
-(NSString*)localizedString:(NSString*)text;
|
||||
|
||||
-(NSString*)systemVersion;
|
||||
@end
|
||||
|
||||
@protocol APPluginSnippet <SiriUIViewController>
|
||||
@optional
|
||||
/// Initializes a snippet by properties
|
||||
-(id)initWithProperties:(NSDictionary*)props;
|
||||
/// Initializes a snippet by properties and system
|
||||
-(id)initWithProperties:(NSDictionary*)props system:(id<APPluginManager>)system;
|
||||
/// Returns a view representing snippet, can be self if the conforming class is already UIView
|
||||
|
||||
@end
|
||||
|
||||
@interface APPluginSnippetViewController : UIViewController <APPluginSnippet>
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/** Protocol specifying methods of an extension class handling commands.
|
||||
Classes conforming to this protocol are initialized just after loading bundle and will remain in memory.
|
||||
Don't forget you really should prefix your class with some shortcut, e.g. K3AAwesomeCommand!
|
||||
*/
|
||||
@protocol APPluginCommand <NSObject>
|
||||
@optional
|
||||
|
||||
-(BOOL)handleSpeech:(NSString*)text session:(APSession*)session;
|
||||
-(id)initWithSystem:(id<APPluginManager>)manager;
|
||||
|
||||
-(void)assistantDismissed;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/// Protocol specifying methods of the extension's principal class
|
||||
@protocol APPlugin <NSObject>
|
||||
|
||||
@required
|
||||
/// The first method which is called on your class, system is where you register commands and snippets
|
||||
-(id)initWithSystem:(id<APPluginManager>)system;
|
||||
|
||||
@optional
|
||||
|
||||
-(void)assistantDismissed; //clean up
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
@ -0,0 +1 @@
|
||||
{ Filter = { Bundles = ( "com.apple.springboard" ); }; }
|
10
assistant+/assistantpluspluginmanager/Makefile
Normal file
10
assistant+/assistantpluspluginmanager/Makefile
Normal file
@ -0,0 +1,10 @@
|
||||
include theos/makefiles/common.mk
|
||||
|
||||
TWEAK_NAME = AssistantPlusPluginManager
|
||||
AssistantPlusPluginManager_FILES = Tweak.xm APSession.xm APPluginManager.mm APPlugin.m
|
||||
AssistantPlusPluginManager_LIBRARIES=substrate objcipc
|
||||
|
||||
include $(THEOS_MAKE_PATH)/tweak.mk
|
||||
|
||||
after-install::
|
||||
install.exec "killall -9 SpringBoard"
|
38
assistant+/assistantpluspluginmanager/SBAPPluginManager.xcworkspace/contents.xcworkspacedata
generated
Normal file
38
assistant+/assistantpluspluginmanager/SBAPPluginManager.xcworkspace/contents.xcworkspacedata
generated
Normal file
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "container:APPlugin.h">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "container:APPlugin.m">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "container:APPluginManager.h">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "container:APPluginManager.mm">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "container:APPluginSnippetViewController.xm">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "container:APSession.h">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "container:APSession.xm">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "container:AssistantHeaders.h">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "container:AssistantPlusHeaders.h">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "container:Makefile">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "container:Tweak.xm"
|
||||
assignedFileDataType = "public.objective-c-source">
|
||||
</FileRef>
|
||||
</Workspace>
|
Binary file not shown.
23
assistant+/assistantpluspluginmanager/Tweak.xm
Normal file
23
assistant+/assistantpluspluginmanager/Tweak.xm
Normal file
@ -0,0 +1,23 @@
|
||||
#import "AssistantPlusHeaders.h"
|
||||
#import "APPluginManager.h"
|
||||
#import <libobjcipc/objcipc.h>
|
||||
|
||||
static APPluginManager *pluginManager;
|
||||
|
||||
static inline __attribute__((constructor)) void init() {
|
||||
NSLog(@"Creating AssistantPlusSBPluginManager!");
|
||||
pluginManager = [APPluginManager sharedManager];
|
||||
|
||||
NSLog(@"Registed for messages!");
|
||||
[OBJCIPC registerIncomingMessageFromAppHandlerForMessageName:@"AssistantPlus.Query" handler:^NSDictionary *(NSDictionary *message) {
|
||||
NSLog(@"Message: %@", message);
|
||||
return @{@"Hello" : @"Sucker!"};
|
||||
}];
|
||||
}
|
||||
|
||||
%subclass APSBPluginManager : NSObject
|
||||
%new
|
||||
+ (APPluginManager*)getSharedManager {
|
||||
return pluginManager;
|
||||
}
|
||||
%end
|
0
assistant+/assistantpluspluginmanager/obj/.stamp
Normal file
0
assistant+/assistantpluspluginmanager/obj/.stamp
Normal file
@ -0,0 +1,13 @@
|
||||
obj/APPlugin.m.d5906e1e.md obj/APPlugin.m.d5906e1e.o: APPlugin.m \
|
||||
/Users/Zaid/Programming/Assistant2/assistant+/theos/Prefix.pch \
|
||||
APPlugin.h AssistantPlusHeaders.h APSession.h AssistantHeaders.h
|
||||
|
||||
/Users/Zaid/Programming/Assistant2/assistant+/theos/Prefix.pch:
|
||||
|
||||
APPlugin.h:
|
||||
|
||||
AssistantPlusHeaders.h:
|
||||
|
||||
APSession.h:
|
||||
|
||||
AssistantHeaders.h:
|
BIN
assistant+/assistantpluspluginmanager/obj/APPlugin.m.d5906e1e.o
Normal file
BIN
assistant+/assistantpluspluginmanager/obj/APPlugin.m.d5906e1e.o
Normal file
Binary file not shown.
@ -0,0 +1,17 @@
|
||||
obj/APPluginManager.mm.d5906e1e.md obj/APPluginManager.mm.d5906e1e.o: \
|
||||
APPluginManager.mm \
|
||||
/Users/Zaid/Programming/Assistant2/assistant+/theos/Prefix.pch \
|
||||
APPluginManager.h APSession.h AssistantHeaders.h APPlugin.h \
|
||||
AssistantPlusHeaders.h
|
||||
|
||||
/Users/Zaid/Programming/Assistant2/assistant+/theos/Prefix.pch:
|
||||
|
||||
APPluginManager.h:
|
||||
|
||||
APSession.h:
|
||||
|
||||
AssistantHeaders.h:
|
||||
|
||||
APPlugin.h:
|
||||
|
||||
AssistantPlusHeaders.h:
|
Binary file not shown.
Binary file not shown.
BIN
assistant+/assistantpluspluginmanager/obj/AssistantPlusPluginManager.dylib
Executable file
BIN
assistant+/assistantpluspluginmanager/obj/AssistantPlusPluginManager.dylib
Executable file
Binary file not shown.
BIN
assistant+/assistantpluspluginmanager/obj/Tweak.xm.d5906e1e.o
Normal file
BIN
assistant+/assistantpluspluginmanager/obj/Tweak.xm.d5906e1e.o
Normal file
Binary file not shown.
1
assistant+/assistantpluspluginmanager/theos
Symbolic link
1
assistant+/assistantpluspluginmanager/theos
Symbolic link
@ -0,0 +1 @@
|
||||
/opt/theos
|
Binary file not shown.
Binary file not shown.
0
assistant+/obj/assistantpluspluginmanager/.stamp
Normal file
0
assistant+/obj/assistantpluspluginmanager/.stamp
Normal file
Binary file not shown.
@ -1 +1 @@
|
||||
5
|
||||
9
|
@ -18,6 +18,15 @@
|
||||
}
|
||||
|
||||
-(BOOL)handleSpeech:(NSString*)text session:(APSession*)session {
|
||||
if ([[text lowercaseString] rangeOfString:@"hello"].location != NSNotFound) {
|
||||
[session sendSnippetWithText:@"Fuck!"];
|
||||
} else if ([[text lowercaseString] rangeOfString:@"test"].location != NSNotFound) {
|
||||
[session sendSnippetWithText:@"Shit!"];
|
||||
} else {
|
||||
[session sendSnippetWithText:@"Bitch!"];
|
||||
}
|
||||
|
||||
return YES;
|
||||
// logging useful during development
|
||||
NSLog(@">> APHelloSnippetCommands handleSpeech: %@", text);
|
||||
|
||||
|
@ -6,5 +6,5 @@ Description: Displays a custom snippet in response to "Hello"
|
||||
Maintainer: Zaid Elkurdi
|
||||
Author: Zaid Elkurdi
|
||||
Section: Addons (AssistantPlus)
|
||||
Version: 0.0.1-5
|
||||
Version: 0.0.1-9
|
||||
Installed-Size: 140
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user