├── LICENSE ├── Makefile ├── README.md ├── Tweak.xm ├── Unsigncuts.plist ├── control └── unsigncutsprefs ├── Makefile ├── Resources ├── Info.plist ├── Root.plist ├── UnsigncutsBanner.png ├── UnsigncutsSnoolieIcon@2x.png ├── badger@2x.png ├── github@2x.png ├── reddit@2x.png └── twitter.png ├── UnsigncutsRootListController.h ├── UnsigncutsRootListController.m └── layout └── Library └── PreferenceLoader └── Preferences └── UnsigncutsPrefs.plist /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 0xilis 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ARCHS = arm64 arm64e 2 | TARGET = iphone:clang:16.5:15.0 3 | # PREFIX = $(THEOS)/toolchain/Xcode.xctoolchain/usr/bin/ 4 | PREFIX = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ 5 | SYSROOT = $(THEOS)/sdks/iPhoneOS14.5.sdk 6 | # TARGET = simulator:clang:latest:7.0 7 | 8 | include $(THEOS)/makefiles/common.mk 9 | 10 | TWEAK_NAME = Unsigncuts 11 | 12 | Unsigncuts_FILES = Tweak.xm 13 | Unsigncuts_CFLAGS = -fobjc-arc 14 | Unsigncuts_EXTRA_FRAMEWORKS = Cephei 15 | Unsigncuts_USE_SUBSTRATE = 0 16 | Unsigncuts_LOGOS_DEFAULT_GENERATOR = internal 17 | # THEOS_PACKAGE_SCHEME=rootless 18 | 19 | include $(THEOS_MAKE_PATH)/tweak.mk 20 | SUBPROJECTS += unsigncutsprefs 21 | include $(THEOS_MAKE_PATH)/aggregate.mk 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unsigncuts 2 | Import unsigned shortcut files 3 | -------------------------------------------------------------------------------- /Tweak.xm: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | HBPreferences *preferences; 5 | 6 | @interface WFSharingSettings : NSObject 7 | +(BOOL)isPrivateSharingEnabled; 8 | +(BOOL)sharingEnabled; 9 | +(BOOL)shortcutFileSharingEnabled; 10 | +(id)privateSharingDisabledAlertWithShortcutName:(id)arg0 ; 11 | +(id)privateSharingDisabledErrorWithShortcutName:(id)arg0 ; 12 | +(id)sharingDisabledAlertWithShortcutName:(id)arg0 ; 13 | +(id)sharingDisabledAlertWithWorkflowName:(id)arg0 ; 14 | +(id)shortcutFileSharingDisabledAlert; 15 | +(id)shortcutFileSharingDisabledError; 16 | @end 17 | 18 | @interface SFAppleIDClient : NSObject 19 | - (id)myAccountWithError:(id )arg1; 20 | @end 21 | 22 | @interface SFAppleIDValidationRecord : NSObject 23 | @property(retain, nonatomic) NSArray *validatedPhoneHashes; // @synthesize validatedPhoneHashes=_validatedPhoneHashes; 24 | @property(retain, nonatomic) NSArray *validatedEmailHashes; // @synthesize validatedEmailHashes=_validatedEmailHashes; 25 | @property(retain, nonatomic) NSString *altDSID; // @synthesize altDSID=_altDSID; 26 | @end 27 | 28 | @interface SFAppleIDAccount : NSObject 29 | @property(retain, nonatomic) SFAppleIDValidationRecord *validationRecord; // @synthesize validationRecord=_validationRecord; 30 | @property(retain, nonatomic) NSString *altDSID; // @synthesize altDSID=_altDSID; 31 | @end 32 | 33 | @interface WFShortcutSigningContext : NSObject 34 | @property (readonly, copy, nonatomic) NSArray *appleIDCertificateChain; // ivar: _appleIDCertificateChain 35 | @property (readonly, nonatomic) SFAppleIDValidationRecord *appleIDValidationRecord; // ivar: _appleIDValidationRecord 36 | @property (readonly, nonatomic) NSDate *expirationDate; // ivar: _expirationDate 37 | @property (readonly, copy, nonatomic) NSArray *signingCertificateChain; // ivar: _signingCertificateChain 38 | @property (retain, nonatomic) NSData *signingPublicKeySignature; // ivar: _signingPublicKeySignature 39 | @end 40 | 41 | %group unsigncuts 42 | %hook WFShortcutExtractor 43 | -(bool)allowsOldFormatFile { //the main thing that allows this 44 | return YES; 45 | } 46 | %end 47 | %hook WFSharingSettings //note: this value is only accepted for importing now on internal builds of voiceshortcuts (at least when talking about importing) 48 | //however for exporting, it still adds the export shortcut as file option to sharing options so this does still have a use 49 | +(bool)shortcutFileSharingEnabled { 50 | return YES; 51 | } 52 | %end 53 | %end 54 | 55 | %group unsigncutsAllowAnyContact 56 | %hook WFShortcutSigningContext 57 | -(void)validateAppleIDValidationRecordWithCompletion:(void (^)(int, int, int, id))completion { 58 | //the following is a rebuild / reverse engineered of the actual method WorkflowKit has for this 59 | //but no longer check if sha256 phone/email hashes match in contact shared importing, just auto run completion block 60 | //while still respecting isPrivateSharingEnabled, as well as self importing 61 | SFAppleIDAccount* account = [[[%c(SFAppleIDClient) alloc]init]myAccountWithError:nil]; 62 | if ([[account altDSID]isEqualToString:[[self appleIDValidationRecord]altDSID]]) { 63 | //the alt dsid matches with users - assume this is user's shortcut, no need for private sharing enabled 64 | completion(0x1,0x3,0x0,0x0); 65 | } else if ([%c(WFSharingSettings) isPrivateSharingEnabled]) { //respect privatesharingenabled pref 66 | completion(0x1, 0x2, 0x0, 0x0); 67 | } else { 68 | //Skipping AppleID Validation Record due to Private Sharing Disabled 69 | //(AKA: Error) 70 | completion(0x0, 0x2, 0x0, [%c(WFSharingSettings) privateSharingDisabledErrorWithShortcutName:nil]); 71 | } 72 | } 73 | %end 74 | %end 75 | 76 | %ctor { 77 | preferences = [[HBPreferences alloc] initWithIdentifier:@"cum.0xilis.unsigncutsprefs"]; 78 | if ([preferences boolForKey:@"isUnsigncutsEnabled"]) %init(unsigncuts); 79 | if ([preferences boolForKey:@"isAllowAnyContactEnabled"]) %init(unsigncutsAllowAnyContact); 80 | } -------------------------------------------------------------------------------- /Unsigncuts.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Filter 6 | 7 | Bundles 8 | 9 | com.apple.WorkflowKit 10 | com.apple.shortcuts 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Package: cum.0xilis.unsigncuts 2 | Name: Unsigncuts 3 | Author: Snoolie K 4 | Description: Import unsigned shortcut files 5 | Maintainer: Snoolie K 6 | Architecture: iphoneos-arm 7 | Section: Tweaks 8 | Version: 2.0 9 | -------------------------------------------------------------------------------- /unsigncutsprefs/Makefile: -------------------------------------------------------------------------------- 1 | ARCHS = arm64 arm64e 2 | TARGET = iphone:clang:16.5:15.0 3 | # PREFIX = $(THEOS)/toolchain/Xcode.xctoolchain/usr/bin/ 4 | PREFIX = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ 5 | SYSROOT = $(THEOS)/sdks/iPhoneOS14.5.sdk 6 | include $(THEOS)/makefiles/common.mk 7 | 8 | BUNDLE_NAME = UnsigncutsPrefs 9 | 10 | UnsigncutsPrefs_FILES = UnsigncutsRootListController.m 11 | UnsigncutsPrefs_FRAMEWORKS = UIKit 12 | UnsigncutsPrefs_PRIVATE_FRAMEWORKS = Preferences 13 | UnsigncutsPrefs_EXTRA_FRAMEWORKS += Cephei 14 | UnsigncutsPrefs_INSTALL_PATH = /Library/PreferenceBundles 15 | UnsigncutsPrefs_CFLAGS = -fobjc-arc 16 | 17 | include $(THEOS_MAKE_PATH)/bundle.mk 18 | -------------------------------------------------------------------------------- /unsigncutsprefs/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | UnsigncutsPrefs 9 | CFBundleIdentifier 10 | cum.0xilis.unsigncutsprefs 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | NSPrincipalClass 22 | UnsigncutsRootListController 23 | 24 | 25 | -------------------------------------------------------------------------------- /unsigncutsprefs/Resources/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | title 6 | Unsigncuts 7 | items 8 | 9 | 10 | label 11 | Badger 12 | cell 13 | PSGroupCell 14 | 15 | 16 | label 17 | Get Badger for $0.99 on Havoc 18 | cell 19 | PSButtonCell 20 | icon 21 | badger@2x.png 22 | action 23 | buyBadger 24 | 25 | 26 | label 27 | Unsigncuts 28 | cell 29 | PSGroupCell 30 | 31 | 32 | label 33 | 34 | cell 35 | PSStaticTextCell 36 | height 37 | 133 38 | icon 39 | UnsigncutsBanner.png 40 | 41 | 42 | label 43 | Enable Unsigncuts 44 | cell 45 | PSSwitchCell 46 | default 47 | 48 | defaults 49 | cum.0xilis.unsigncutsprefs 50 | key 51 | isUnsigncutsEnabled 52 | PostNotification 53 | cum.0xilis.unsigncuts/ReloadPrefs 54 | id 55 | SWITCH_ID 56 | 57 | 58 | label 59 | Allow Non-Contacts 60 | cell 61 | PSSwitchCell 62 | default 63 | 64 | defaults 65 | cum.0xilis.unsigncutsprefs 66 | key 67 | isAllowAnyContactEnabled 68 | PostNotification 69 | cum.0xilis.unsigncuts/ReloadPrefs 70 | id 71 | SWITCH_ID 72 | 73 | 74 | cell 75 | PSGroupCell 76 | label 77 | Contact 78 | 79 | 80 | cell 81 | PSButtonCell 82 | label 83 | My GitHub 84 | icon 85 | github@2x.png 86 | action 87 | openGitHub 88 | 89 | 90 | cell 91 | PSButtonCell 92 | label 93 | My Reddit 94 | icon 95 | reddit@2x.png 96 | action 97 | openReddit 98 | 99 | 100 | cell 101 | PSButtonCell 102 | label 103 | My Twitter 104 | icon 105 | twitter.png 106 | action 107 | openTwitter 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /unsigncutsprefs/Resources/UnsigncutsBanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xilis/Unsigncuts/f2811d4c9e74818766287ca898036b3ac0b44eb3/unsigncutsprefs/Resources/UnsigncutsBanner.png -------------------------------------------------------------------------------- /unsigncutsprefs/Resources/UnsigncutsSnoolieIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xilis/Unsigncuts/f2811d4c9e74818766287ca898036b3ac0b44eb3/unsigncutsprefs/Resources/UnsigncutsSnoolieIcon@2x.png -------------------------------------------------------------------------------- /unsigncutsprefs/Resources/badger@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xilis/Unsigncuts/f2811d4c9e74818766287ca898036b3ac0b44eb3/unsigncutsprefs/Resources/badger@2x.png -------------------------------------------------------------------------------- /unsigncutsprefs/Resources/github@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xilis/Unsigncuts/f2811d4c9e74818766287ca898036b3ac0b44eb3/unsigncutsprefs/Resources/github@2x.png -------------------------------------------------------------------------------- /unsigncutsprefs/Resources/reddit@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xilis/Unsigncuts/f2811d4c9e74818766287ca898036b3ac0b44eb3/unsigncutsprefs/Resources/reddit@2x.png -------------------------------------------------------------------------------- /unsigncutsprefs/Resources/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xilis/Unsigncuts/f2811d4c9e74818766287ca898036b3ac0b44eb3/unsigncutsprefs/Resources/twitter.png -------------------------------------------------------------------------------- /unsigncutsprefs/UnsigncutsRootListController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface UnsigncutsRootListController : PSListController 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /unsigncutsprefs/UnsigncutsRootListController.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "UnsigncutsRootListController.h" 3 | #include 4 | 5 | @implementation UnsigncutsRootListController 6 | 7 | - (NSArray *)specifiers { 8 | if (!_specifiers) { 9 | _specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self]; 10 | } 11 | 12 | return _specifiers; 13 | } 14 | 15 | -(void)openGitHub { 16 | [[UIApplication sharedApplication] 17 | openURL:[NSURL URLWithString:@"https://github.com/0xilis"] 18 | options:@{} 19 | completionHandler:nil]; 20 | } 21 | 22 | -(void)openTwitter { 23 | [[UIApplication sharedApplication] 24 | openURL:[NSURL URLWithString:@"https://twitter.com/QuickUpdate5"] 25 | options:@{} 26 | completionHandler:nil]; 27 | } 28 | 29 | -(void)openReddit { 30 | [[UIApplication sharedApplication] 31 | openURL:[NSURL URLWithString:@"https://reddit.com/user/0xilis"] 32 | options:@{} 33 | completionHandler:nil]; 34 | } 35 | 36 | -(void)buyBadger { 37 | [[UIApplication sharedApplication] 38 | openURL:[NSURL URLWithString:@"https://havoc.app/package/badger"] 39 | options:@{} 40 | completionHandler:nil]; 41 | } 42 | @end 43 | -------------------------------------------------------------------------------- /unsigncutsprefs/layout/Library/PreferenceLoader/Preferences/UnsigncutsPrefs.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | entry 6 | 7 | bundle 8 | UnsigncutsPrefs 9 | cell 10 | PSLinkCell 11 | detail 12 | UnsigncutsRootListController 13 | icon 14 | UnsigncutsSnoolieIcon@2x.png 15 | isController 16 | 17 | label 18 | Unsigncuts 19 | 20 | 21 | 22 | --------------------------------------------------------------------------------