0

My Tweak is running inside SpringBoard, I want it be able to input text to first responder of the frontmost application.I tried the code below, but it only works for the subviews of SpringBoard, such as the search bar on of home screen, but not any other apps, does anyone know how to do it?

@interface UIKeyboardImpl : NSObject
+(UIKeyboardImpl*)sharedInstance;
-(void)addInputString:(NSString*)string;
@end

void input(const char * text)
{
    UIKeyboardImpl * keyboardImpl = [UIKeyboardImpl sharedInstance];
    [keyboardImpl addInputString:[NSString stringWithUTF8String:text]];
}
Suge
  • 2,808
  • 3
  • 48
  • 79
  • Just an idea, as I don't know if this would work, but maybe you could hook any app using the framework (I presume UIKit) and do the same stuff. – Orph Jan 22 '15 at 18:03
  • Yes, I thought about that.but that way will influence every app, what maybe ill-flavored and untrusted, how do you think? – Suge Jan 23 '15 at 00:58
  • If you want to modify things in the `frontmost application` you'll need to inject your tweak there. Using "com.apple.UIKit" as filter will let you do that. – uroboro Jan 24 '15 at 03:58
  • Yes, I tried that method, but I can't inject `CFMessagePort` to all of the applications, in most of them I can't `CFMessagePortCreateLocal ` a `CFMessagePort`,would you take a look at: :http://stackoverflow.com/questions/28113564/how-to-communicate-between-applications-in-ios?noredirect=1#comment44602939_28113564 – Suge Jan 24 '15 at 05:05

0 Answers0