From 36a20e148d74e029097ee6728ec9d443b9a2f022 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 28 Feb 2011 18:35:50 -0800 Subject: [PATCH] Add cydia.setPasteboard*() for clipboard access. --- MobileCydia.mm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MobileCydia.mm b/MobileCydia.mm index 2f6d8a05..1e5e0f69 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4214,6 +4214,10 @@ static NSMutableSet *Diversions_; return @"setNavigationBarStyle"; else if (selector == @selector(setNavigationBarTintRed:green:blue:alpha:)) return @"setNavigationBarTintColor"; + else if (selector == @selector(setPasteboardString:)) + return @"setPasteboardString"; + else if (selector == @selector(setPasteboardURL:)) + return @"setPasteboardURL"; else if (selector == @selector(setToken:)) return @"setToken"; else if (selector == @selector(setViewportWidth:)) @@ -4457,6 +4461,14 @@ static NSMutableSet *Diversions_; [indirect_ performSelectorOnMainThread:@selector(setNavigationBarTintColor:) withObject:color waitUntilDone:NO]; } +- (void) setPasteboardString:(NSString *)value { + [[objc_getClass("UIPasteboard") generalPasteboard] setString:value]; +} + +- (void) setPasteboardURL:(NSString *)value { + [[objc_getClass("UIPasteboard") generalPasteboard] setURL:[NSURL URLWithString:value]]; +} + - (void) _setToken:(NSString *)token { Token_ = token; -- 2.45.2