mirror of
https://github.com/NohamR/TrollDecrypt-tvOS.git
synced 2026-07-11 22:41:37 +00:00
i can't fix
This commit is contained in:
@@ -102,27 +102,16 @@ UIAlertController *doneController2 = NULL;
|
|||||||
|
|
||||||
UIAlertAction *openAction = [UIAlertAction actionWithTitle:@"Share IPA with Airdrop" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
UIAlertAction *openAction = [UIAlertAction actionWithTitle:@"Share IPA with Airdrop" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
||||||
NSString *filePath = path;
|
NSString *filePath = path;
|
||||||
|
NSURL *url = [NSURL fileURLWithPath:filePath];
|
||||||
|
|
||||||
NSBundle *bundle = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/Sharing.framework"];
|
NSBundle *bundle = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/Sharing.framework"];
|
||||||
[bundle load];
|
[bundle load];
|
||||||
|
|
||||||
NSString *suf = @"/System/Library/PrivateFrameworks/SharingUI.framework";
|
NSBundle *sharingUI = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/SharingUI.framework"];
|
||||||
if ([[NSFileManager defaultManager] fileExistsAtPath:suf]){
|
|
||||||
NSBundle *sharingUI = [NSBundle bundleWithPath:suf];
|
|
||||||
[sharingUI load];
|
[sharingUI load];
|
||||||
}
|
|
||||||
|
|
||||||
NSURL *url = [NSURL fileURLWithPath:filePath];
|
|
||||||
|
|
||||||
id sharingView = [[objc_getClass("SFAirDropSharingViewControllerTV") alloc] initWithSharingItems:@[url]];
|
id sharingView = [[objc_getClass("SFAirDropSharingViewControllerTV") alloc] initWithSharingItems:@[url]];
|
||||||
// [sharingView setCompletionHandler:^(NSError *error) {
|
|
||||||
// NSString *sender = airdropDictionary[@"sender"];
|
|
||||||
// if (sender) {
|
|
||||||
// id defaultWorkspace = [objc_getClass("LSApplicationWorkspace") defaultWorkspace];
|
|
||||||
// [defaultWorkspace performSelector:@selector(openApplicationWithBundleID:) withObject:(id)sender];
|
|
||||||
// }
|
|
||||||
// }];
|
|
||||||
[sharingView setCompletionHandler:^(NSError *error) {
|
[sharingView setCompletionHandler:^(NSError *error) {
|
||||||
NSLog(@"complete with error: %@", error);
|
|
||||||
[self dismissViewControllerAnimated:true completion:nil];
|
[self dismissViewControllerAnimated:true completion:nil];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
|||||||
19
TDUtils.m
19
TDUtils.m
@@ -203,29 +203,20 @@ void bfinject_rocknroll(pid_t pid, NSString *appName, NSString *version) {
|
|||||||
|
|
||||||
UIAlertAction *openAction = [UIAlertAction actionWithTitle:@"Share IPA with Airdrop" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
UIAlertAction *openAction = [UIAlertAction actionWithTitle:@"Share IPA with Airdrop" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
||||||
NSString *filePath = [dd IPAPath];
|
NSString *filePath = [dd IPAPath];
|
||||||
NSDictionary* airdropDictionary;
|
NSURL *url = [NSURL fileURLWithPath:filePath];
|
||||||
|
|
||||||
NSBundle *bundle = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/Sharing.framework"];
|
NSBundle *bundle = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/Sharing.framework"];
|
||||||
[bundle load];
|
[bundle load];
|
||||||
|
|
||||||
NSString *suf = @"/System/Library/PrivateFrameworks/SharingUI.framework";
|
NSBundle *sharingUI = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/SharingUI.framework"];
|
||||||
if ([[NSFileManager defaultManager] fileExistsAtPath:suf]){
|
|
||||||
NSBundle *sharingUI = [NSBundle bundleWithPath:suf];
|
|
||||||
[sharingUI load];
|
[sharingUI load];
|
||||||
}
|
|
||||||
|
|
||||||
UIViewController *rvc = [[[UIApplication sharedApplication] keyWindow] rootViewController];
|
|
||||||
NSURL *url = [NSURL fileURLWithPath:filePath];
|
|
||||||
|
|
||||||
id sharingView = [[objc_getClass("SFAirDropSharingViewControllerTV") alloc] initWithSharingItems:@[url]];
|
id sharingView = [[objc_getClass("SFAirDropSharingViewControllerTV") alloc] initWithSharingItems:@[url]];
|
||||||
[sharingView setCompletionHandler:^(NSError *error) {
|
[sharingView setCompletionHandler:^(NSError *error) {
|
||||||
NSString *sender = airdropDictionary[@"sender"];
|
[root dismissViewControllerAnimated:true completion:nil];
|
||||||
if (sender) {
|
|
||||||
id defaultWorkspace = [objc_getClass("LSApplicationWorkspace") defaultWorkspace];
|
|
||||||
[defaultWorkspace performSelector:@selector(openApplicationWithBundleID:) withObject:(id)sender];
|
|
||||||
}
|
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[rvc presentViewController:sharingView animated:true completion:nil];
|
[root presentViewController:sharingView animated:true completion:nil];
|
||||||
}];
|
}];
|
||||||
[doneController addAction:openAction];
|
[doneController addAction:openAction];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user