ふぁいる

This commit is contained in:
straight-tamago
2024-01-26 16:32:38 +09:00
parent 46184fa020
commit 7449682883
5 changed files with 49 additions and 15 deletions

View File

@@ -18,7 +18,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1</string>
<string>1.2</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>

View File

@@ -553,7 +553,7 @@ int find_off_cryptid(const char *filePath) {
}
-(NSString *)IPAPath {
return [NSString stringWithFormat:@"%@/%@_%@_decrypted.ipa", [self docPath], self.appName, self.appVersion];
return [NSString stringWithFormat:@"%@/%@_%@_decrypted.tipa", [self docPath], self.appName, self.appVersion];
}
-(void) createIPAFile:(pid_t)pid {

View File

@@ -1,5 +1,7 @@
#import "TDFileManagerViewController.h"
#import "TDUtils.h"
#import "LSApplicationProxy+AltList.h"
#import <objc/runtime.h>
@implementation TDFileManagerViewController
@@ -83,15 +85,49 @@
return swipeActions;
}
UIWindow *kw2 = NULL;
UIAlertController *doneController2 = NULL;
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *file = self.fileList[indexPath.row];
NSString *path = [docPath() stringByAppendingPathComponent:file];
NSURL *url = [NSURL fileURLWithPath:path];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[url] applicationActivities:nil];
[self presentViewController:activityViewController animated:YES completion:nil];
doneController2 = [UIAlertController alertControllerWithTitle:file message:[NSString stringWithFormat:@"Location:\n%@", path] preferredStyle:UIAlertControllerStyleAlert];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Ok", @"Ok") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[kw2 removeFromSuperview];
kw2.hidden = YES;
}];
[doneController2 addAction:okAction];
UIAlertAction *openAction = [UIAlertAction actionWithTitle:@"Share IPA with Airdrop" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
NSString *filePath = path;
NSDictionary* airdropDictionary;
NSBundle *bundle = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/Sharing.framework"];
[bundle load];
NSString *suf = @"/System/Library/PrivateFrameworks/SharingUI.framework";
if ([[NSFileManager defaultManager] fileExistsAtPath:suf]){
NSBundle *sharingUI = [NSBundle bundleWithPath:suf];
[sharingUI load];
}
NSURL *url = [NSURL fileURLWithPath:filePath];
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];
}
}];
[self presentViewController:sharingView animated:true completion:nil];
}];
[doneController2 addAction:openAction];
[self presentViewController:doneController2 animated:YES completion:nil];
}
@end

View File

@@ -42,4 +42,9 @@ NSArray *decryptedFileList(void);
NSString *docPath(void);
void fetchLatestTrollDecryptVersion(void (^completionHandler)(NSString *version));
void github_fetchLatedVersion(NSString *repo, void (^completionHandler)(NSString *latestVersion));
NSString *trollDecryptVersion(void);
NSString *trollDecryptVersion(void);
@interface SFAirDropSharingViewControllerTV : UIViewController
-(id)initWithSharingItems:(id)arg1;
-(void)setCompletionHandler:(void (^)(NSError *error))arg1;
@end

View File

@@ -3,13 +3,6 @@
#import "LSApplicationProxy+AltList.h"
#import <objc/runtime.h>
@interface SFAirDropSharingViewControllerTV : UIViewController
-(id)initWithSharingItems:(id)arg1;
-(void)setCompletionHandler:(void (^)(NSError *error))arg1;
@end
UIWindow *alertWindow = NULL;
UIWindow *kw = NULL;
UIViewController *root = NULL;
@@ -402,7 +395,7 @@ void github_fetchLatedVersion(NSString *repo, void (^completionHandler)(NSString
}
void fetchLatestTrollDecryptVersion(void (^completionHandler)(NSString *version)) {
github_fetchLatedVersion(@"donato-fiore/TrollDecrypt", completionHandler);
github_fetchLatedVersion(@"straight-tamago/TrollDecrypt-tvOS", completionHandler);
}
NSString *trollDecryptVersion(void) {