├── .gitignore ├── LICENSE ├── Makefile ├── PIPreferences.h ├── PIPreferences.m ├── PIStatusBarIcon.h ├── PIStatusBarIcon.m ├── PasswordAlertDelegate.h ├── PasswordAlertDelegate.xm ├── ProtectiPlus.plist ├── README.md ├── Tweak.xmi ├── Version.h ├── WelcomeAlertDelegate.h ├── WelcomeAlertDelegate.m ├── compatibility ├── ccquick.h └── ccquick.mm ├── helpers.h ├── helpers.mm ├── hooks ├── activate_app_switcher.xm ├── bypass_passcode_and_half_slide_unlock.xm ├── control_center.xm ├── deprecated_indicate_pending_notification.xm ├── edit_icon.xm ├── hide_app_icon.xm ├── launch_app.xm ├── notification.xm ├── notification_center.xm ├── open_folders.xm ├── siri.xm ├── spotlight.xm └── switch_app.xm ├── layout ├── DEBIAN │ └── control └── System │ └── Library │ └── Frameworks │ └── UIKit.framework │ ├── Black_protecti.png │ ├── Black_protecti@2x.png │ ├── LockScreen_protecti.png │ └── LockScreen_protecti@2x.png ├── prefs.h ├── protectidap ├── Makefile ├── ProtectiDAP.plist └── Tweak.xm ├── protectiplusflipswitch ├── FSSwitchDataSource.h ├── FSSwitchPanel.h ├── FSSwitchState.h ├── Makefile ├── Resources │ └── Info.plist └── Switch.x ├── protectiplussettings ├── Makefile ├── ProtectiPlusSettings.mm ├── Resources │ ├── About.plist │ ├── Advance.plist │ ├── Bypass System Passcode.plist │ ├── Choose Gestures.plist │ ├── Disable Open Folders.plist │ ├── Half Slide Unlock.plist │ ├── Hide App Icons.plist │ ├── Indicate Missing Notifications.plist │ ├── Info.plist │ ├── Password.plist │ ├── Photos Access.plist │ ├── Protected Actions.plist │ ├── Protected App Notifications.plist │ ├── ProtectiPlusSettings.plist │ ├── ProtectiPlusSettings.png │ ├── ProtectiPlusSettings@2x.png │ ├── Tutorial.plist │ ├── Unprotected App Notifications.plist │ ├── Vibrate & Icon.plist │ ├── en.lproj │ │ ├── About.strings │ │ ├── Advance.strings │ │ ├── Bypass System Passcode.strings │ │ ├── Disable Open Folders.strings │ │ ├── Half Slide Unlock.strings │ │ ├── Hide App Icons.strings │ │ ├── Localizable.strings │ │ ├── Password.strings │ │ ├── Photos Access.strings │ │ ├── Protected Actions.strings │ │ ├── Protected App Notifications.strings │ │ ├── ProtectiPlusSettings.strings │ │ ├── Tutorial.strings │ │ └── Vibrate & Icon.strings │ ├── public_key.der │ └── zh_CN.lproj │ │ ├── About.strings │ │ ├── Advance.strings │ │ ├── Bypass System Passcode.strings │ │ ├── Choose Gestures.strings │ │ ├── Disable Open Folders.strings │ │ ├── Half Slide Unlock.strings │ │ ├── Hide App Icons.strings │ │ ├── Localizable.strings │ │ ├── Password.strings │ │ ├── Photos Access.strings │ │ ├── Protected Actions.strings │ │ ├── Protected App Notifications.strings │ │ ├── ProtectiPlusSettings.strings │ │ ├── Tutorial.strings │ │ ├── Unprotected App Notifications.strings │ │ └── Vibrate & Icon.strings └── entry.plist ├── protectiplustoggleforactivator ├── Makefile ├── Tweak.xm ├── layout │ ├── DEBIAN │ │ └── control │ └── Library │ │ └── Activator │ │ └── Listeners │ │ ├── com.gviridis.protectiplustoggleforactivator_disable │ │ ├── Icon-small.png │ │ ├── Icon-small@2x.png │ │ └── Info.plist │ │ ├── com.gviridis.protectiplustoggleforactivator_enable │ │ ├── Icon-small.png │ │ ├── Icon-small@2x.png │ │ └── Info.plist │ │ └── com.gviridis.protectiplustoggleforactivator_toggle │ │ ├── Icon-small.png │ │ ├── Icon-small@2x.png │ │ └── Info.plist └── protectiplustoggleforactivator.plist ├── protectiplustoggleforquickdo ├── Action.m ├── Makefile ├── layout │ ├── DEBIAN │ │ └── control │ └── Library │ │ └── QuickDo │ │ └── Actions │ │ ├── com.gviridis.protectiplustoggleforquickdo_disable │ │ ├── Icon-small.png │ │ ├── Icon-small@2x.png │ │ └── Info.plist │ │ ├── com.gviridis.protectiplustoggleforquickdo_enable │ │ ├── Icon-small.png │ │ ├── Icon-small@2x.png │ │ └── Info.plist │ │ └── com.gviridis.protectiplustoggleforquickdo_toggle │ │ ├── Icon-small.png │ │ ├── Icon-small@2x.png │ │ └── Info.plist └── protectiplustoggleforquickdo.plist └── states.h /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .theos/ 3 | theos 4 | _/ 5 | *.deb 6 | obj/ 7 | 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Chen Guo (guoc) 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 | export ARCHS=armv7 arm64 2 | 3 | include $(THEOS)/makefiles/common.mk 4 | 5 | TWEAK_NAME = ProtectiPlus 6 | ProtectiPlus_FILES = Tweak.xmi helpers.mm WelcomeAlertDelegate.m PIPreferences.m PasswordAlertDelegate.xm PIStatusBarIcon.m compatibility/ccquick.mm 7 | #ProtectiPlus_CFLAGS = -Qunused-arguments 8 | ProtectiPlus_FRAMEWORKS = UIKit AudioToolBox Security 9 | ProtectiPlus_LIBRARIES = MobileGestalt cephei 10 | ProtectiPlus_LDFLAGS += -Wl,-segalign,4000 11 | 12 | include $(THEOS_MAKE_PATH)/tweak.mk 13 | 14 | after-install:: 15 | install.exec "killall -9 SpringBoard" 16 | SUBPROJECTS += protectiplussettings 17 | SUBPROJECTS += protectiplustoggleforactivator 18 | SUBPROJECTS += protectiplustoggleforquickdo 19 | SUBPROJECTS += protectiplusflipswitch 20 | SUBPROJECTS += protectidap 21 | include $(THEOS_MAKE_PATH)/aggregate.mk 22 | -------------------------------------------------------------------------------- /PIPreferences.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | static NSString *const kPIPreferencesDomain = @"com.gviridis.protectiplus"; 4 | static NSString *const kPIPreferencesProtectedAppsDomain = @"com.gviridis.protectiplus.protectedapps"; 5 | static NSString *const kPIPreferencesHiddenAppsDomain = @"com.gviridis.protectiplus.hiddenapps"; 6 | static NSString *const kPIPreferencesEnabledKey = @"Enabled"; 7 | 8 | static NSString *const kPIPreferencesEnableHalfSlideUnlockKey = @"enableHalfSlideUnlock"; 9 | static NSString *const kPIPreferencesEnableBypassSystemPasscodeKey = @"enableBypassSystemPasscode"; 10 | static NSString *const kPIPreferencesEnableVibrateKey = @"enableVibrate"; 11 | static NSString *const kPIPreferencesEnableStatusBarIconKey = @"enableStatusBarIcon"; 12 | static NSString *const kPIPreferencesEnableTurnOnBacklighWhenReceiveNewNotificationsKey = @"enableTurnOnBacklighWhenReceiveNewNotifications"; 13 | static NSString *const kPIPreferencesEnableVibrateNotificationsKey = @"enableVibrateNotifications"; 14 | static NSString *const kPIPreferencesAllowAccessNotificationCenterKey = @"allowAccessNotificationCenter"; 15 | static NSString *const kPIPreferencesAllowAccessControlCenterKey = @"allowAccessControlCenter"; 16 | static NSString *const kPIPreferencesEnableHideAppIconsKey = @"enableHideAppIcons"; 17 | static NSString *const kPIPreferencesEnableIndicateMissingNotificationKey = @"enableIndicateMissingNotification"; 18 | static NSString *const kPIPreferencesMissingNotificationIndicatorStyleKey = @"missingNotificationIndicatorStyle"; 19 | static NSString *const kPIPreferencesHalfSlideUnlock_MinDistanceKey = @"halfSlideUnlock_MinDistance"; 20 | static NSString *const kPIPreferencesHalfSlideUnlock_MaxDistanceKey = @"halfSlideUnlock_MaxDistance"; 21 | static NSString *const kPIPreferencesNoLoadSettingsWhenEnableKey = @"noLoadSettingsWhenEnable"; 22 | 23 | static NSString *const kPIPreferencesDisableAccessPhotos = @"disableAccessPhotos"; 24 | 25 | static NSString *const kPIPreferencesNoNotificationsForProtectedAppsKey = @"noNotificationsForProtectedApps"; 26 | static NSString *const kPIPreferencesNoNotificationTitleForProtectedAppsKey = @"noNotificationTitleForProtectedApps"; 27 | static NSString *const kPIPreferencesNoNotificationMessageForProtectedAppsKey = @"noNotificationMessageForProtectedApps"; 28 | static NSString *const kPIPreferencesNoNotificationSoundForProtectedAppsKey = @"noNotificationSoundForProtectedApps"; 29 | 30 | static NSString *const kPIPreferencesNoNotificationsForUnprotectedAppsKey = @"noNotificationsForUnprotectedApps"; 31 | static NSString *const kPIPreferencesNoNotificationTitleForUnprotectedAppsKey = @"noNotificationTitleForUnprotectedApps"; 32 | static NSString *const kPIPreferencesNoNotificationMessageForUnprotectedAppsKey = @"noNotificationMessageForUnprotectedApps"; 33 | static NSString *const kPIPreferencesNoNotificationSoundForUnprotectedAppsKey = @"noNotificationSoundForUnprotectedApps"; 34 | 35 | static NSString *const kPIPreferencesAutoEnableKey = @"autoEnable"; 36 | 37 | static NSString *const kPIPreferencesEnablePasswordKey = @"enablePassword"; 38 | static NSString *const kPIPreferencesPasswordKey = @"password"; 39 | static NSString *const kPIPreferencesHidePasswordAlertMessageKey = @"hidePasswordAlertMessage"; 40 | 41 | static NSString *const kPIPreferencesDisabledFoldersKey = @"disabledFolders"; 42 | 43 | /********************************************* Hidden Options ****************************************************************/ 44 | static NSString *const kPIPreferencesDisableActivateAppSliderKey = @"disableActivateAppSlider"; 45 | static NSString *const kPIPreferencesEnableEditIconsKey = @"enableEditIcons"; 46 | /*****************************************************************************************************************************/ 47 | 48 | typedef enum MissingNotificationIndicatorStyle : NSUInteger { 49 | kNone = 0, 50 | kTapped, 51 | kShadow, 52 | kGlow 53 | } MissingNotificationIndicatorStyle; 54 | 55 | @interface PIPreferences: HBPreferences 56 | 57 | + (void)updatePreferences; 58 | + (void)resetPreferences; 59 | 60 | #pragma mark Singleton Methods 61 | + (id)sharedPreferences; 62 | + (id)allocWithZone:(NSZone *)zone; 63 | - (id)copyWithZone:(NSZone *)zone; 64 | - (id)retain; 65 | - (unsigned)retainCount; 66 | - (oneway void)release; 67 | - (id)autorelease; 68 | - (id)init; 69 | - (void)dealloc; 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /PIPreferences.m: -------------------------------------------------------------------------------- 1 | #import "PIPreferences.h" 2 | 3 | #define PREF_VALUES @{ \ 4 | kPIPreferencesEnableHalfSlideUnlockKey: @NO, \ 5 | kPIPreferencesEnableBypassSystemPasscodeKey: @NO, \ 6 | kPIPreferencesEnableVibrateKey: @NO, \ 7 | kPIPreferencesEnableStatusBarIconKey: @YES, \ 8 | kPIPreferencesEnableTurnOnBacklighWhenReceiveNewNotificationsKey: @NO, \ 9 | kPIPreferencesEnableVibrateNotificationsKey: @NO, \ 10 | kPIPreferencesAllowAccessNotificationCenterKey: @NO, \ 11 | kPIPreferencesAllowAccessControlCenterKey: @NO, \ 12 | kPIPreferencesEnableHideAppIconsKey: @NO, \ 13 | kPIPreferencesEnableIndicateMissingNotificationKey: @NO, \ 14 | kPIPreferencesMissingNotificationIndicatorStyleKey: [NSNumber numberWithInt: kTapped], \ 15 | kPIPreferencesHalfSlideUnlock_MinDistanceKey: @0.2, \ 16 | kPIPreferencesHalfSlideUnlock_MaxDistanceKey: @0.33, \ 17 | \ 18 | kPIPreferencesNoNotificationsForProtectedAppsKey: @NO, \ 19 | kPIPreferencesNoNotificationTitleForProtectedAppsKey: @YES, \ 20 | kPIPreferencesNoNotificationMessageForProtectedAppsKey: @YES, \ 21 | kPIPreferencesNoNotificationSoundForProtectedAppsKey: @NO, \ 22 | \ 23 | kPIPreferencesNoNotificationsForUnprotectedAppsKey: @NO, \ 24 | kPIPreferencesNoNotificationTitleForUnprotectedAppsKey: @NO, \ 25 | kPIPreferencesNoNotificationMessageForUnprotectedAppsKey: @YES, \ 26 | kPIPreferencesNoNotificationSoundForUnprotectedAppsKey: @NO, \ 27 | \ 28 | kPIPreferencesAutoEnableKey: @NO, \ 29 | \ 30 | kPIPreferencesEnablePasswordKey: @NO, \ 31 | kPIPreferencesPasswordKey: @"", \ 32 | \ 33 | kPIPreferencesDisableAccessPhotos: @NO, \ 34 | \ 35 | kPIPreferencesDisableActivateAppSliderKey: @NO \ 36 | } 37 | 38 | 39 | // http://www.galloway.me.uk/tutorials/singleton-classes/ 40 | // http://sharedinstance.net/2014/11/settings-the-right-way/ 41 | 42 | static HBPreferences *sharedPreferences = nil; 43 | 44 | @implementation PIPreferences 45 | 46 | + (void)updatePreferences { 47 | // http://sharedinstance.net/2014/11/settings-the-right-way/ 48 | 49 | NSDictionary *protectedApps = [NSDictionary dictionaryWithContentsOfFile:[[[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES)[0] stringByAppendingPathComponent:@"Preferences"] stringByAppendingPathComponent:kPIPreferencesProtectedAppsDomain] stringByAppendingPathExtension:@"plist"]]; 50 | NSDictionary *hiddenApps = [NSDictionary dictionaryWithContentsOfFile:[[[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES)[0] stringByAppendingPathComponent:@"Preferences"] stringByAppendingPathComponent:kPIPreferencesHiddenAppsDomain] stringByAppendingPathExtension:@"plist"]]; 51 | [protectedApps enumerateKeysAndObjectsUsingBlock:^(id key, id object, BOOL *stop) { 52 | [PIPreferences.sharedPreferences setObject:object forKey: key]; 53 | }]; 54 | [hiddenApps enumerateKeysAndObjectsUsingBlock:^(id key, id object, BOOL *stop) { 55 | [PIPreferences.sharedPreferences setObject:object forKey: key]; 56 | }]; 57 | } 58 | 59 | + (void)resetPreferences { 60 | CFPreferencesSetMultiple(nil, (CFArrayRef)[PREF_VALUES allKeys], (CFStringRef)kPIPreferencesDomain, CFSTR("mobile"), kCFPreferencesCurrentHost ); 61 | [[self sharedPreferences] synchronize]; 62 | } 63 | 64 | #pragma mark Singleton Methods 65 | + (id)sharedPreferences { 66 | @synchronized(self) { 67 | if(sharedPreferences == nil) 68 | sharedPreferences = [[super allocWithZone:NULL] init]; 69 | } 70 | return sharedPreferences; 71 | } 72 | + (id)allocWithZone:(NSZone *)zone { 73 | return [[self sharedPreferences] retain]; 74 | } 75 | - (id)copyWithZone:(NSZone *)zone { 76 | return self; 77 | } 78 | - (id)retain { 79 | return self; 80 | } 81 | - (unsigned)retainCount { 82 | return UINT_MAX; //denotes an object that cannot be released 83 | } 84 | - (oneway void)release { 85 | // never release 86 | } 87 | - (id)autorelease { 88 | return self; 89 | } 90 | - (id)init { 91 | self = (PIPreferences *)[[HBPreferences alloc] initWithIdentifier:kPIPreferencesDomain]; 92 | [self registerDefaults:PREF_VALUES]; 93 | return self; 94 | } 95 | - (void)dealloc { 96 | // Should never be called, but just here for clarity really. 97 | [super dealloc]; 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /PIStatusBarIcon.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface PIStatusBarIcon : NSObject 4 | 5 | + (void)addStatusBarItemIfNecessary; 6 | + (void)removeStatusBarItem; 7 | 8 | @property (nonatomic, retain) LSStatusBarItem *statusBarItem; 9 | + (PIStatusBarIcon *)sharedInstance; 10 | - (PIStatusBarIcon *)init; 11 | - (void)delayedInit; 12 | - (void)showIcon; 13 | - (void)hideIcon; 14 | @end 15 | -------------------------------------------------------------------------------- /PIStatusBarIcon.m: -------------------------------------------------------------------------------- 1 | #import "PIStatusBarIcon.h" 2 | 3 | #import "prefs.h" 4 | #import "PIPreferences.h" 5 | 6 | @implementation PIStatusBarIcon 7 | 8 | @synthesize statusBarItem = _statusBarItem; 9 | 10 | + (void)addStatusBarItemIfNecessary { 11 | if (StatusBarIcon_IsEnabled) 12 | { 13 | [[PIStatusBarIcon sharedInstance] showIcon]; 14 | } 15 | } 16 | 17 | + (void)removeStatusBarItem { 18 | [[PIStatusBarIcon sharedInstance] hideIcon]; 19 | } 20 | 21 | + (PIStatusBarIcon *)sharedInstance { 22 | static PIStatusBarIcon* PIStatusBarIcon_sharedInst = nil; 23 | @synchronized(self) { 24 | if (PIStatusBarIcon_sharedInst == nil) { 25 | PIStatusBarIcon_sharedInst = [[PIStatusBarIcon alloc] init]; 26 | } 27 | } 28 | return PIStatusBarIcon_sharedInst; 29 | } 30 | 31 | - (PIStatusBarIcon *)init { 32 | [self performSelector:@selector(delayedInit) withObject:nil afterDelay:0]; 33 | return self; 34 | } 35 | 36 | - (void)delayedInit{ 37 | self.statusBarItem = [[NSClassFromString(@"LSStatusBarItem") alloc] initWithIdentifier: @"com.gviridis.protectiplus" alignment: StatusBarAlignmentLeft]; 38 | _statusBarItem.imageName = @"protecti"; 39 | } 40 | 41 | - (void)showIcon { 42 | self.statusBarItem.visible = YES; 43 | } 44 | 45 | - (void)hideIcon { 46 | self.statusBarItem.visible = NO; 47 | } 48 | @end 49 | -------------------------------------------------------------------------------- /PasswordAlertDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface PasswordAlertDelegate : NSObject 4 | @property (retain) UIAlertView *alertView; 5 | - (void)showAlert; 6 | - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string; 7 | @end 8 | -------------------------------------------------------------------------------- /PasswordAlertDelegate.xm: -------------------------------------------------------------------------------- 1 | #import "PasswordAlertDelegate.h" 2 | 3 | #import 4 | 5 | #import "prefs.h" 6 | #import "PIPreferences.h" 7 | 8 | #define LOCAL(key) [bundle localizedStringForKey:key value:key table:nil] 9 | 10 | void _disableProtectiPlusWithoutPassword(); 11 | 12 | %subclass PasswordAlertDelegate : NSObject 13 | 14 | %new 15 | - (UIAlertView *)alertView { 16 | return objc_getAssociatedObject(self, @selector(alertView)); 17 | } 18 | 19 | %new 20 | - (void)setAlertView: (UIAlertView *)value { 21 | objc_setAssociatedObject(self, @selector(alertView), value, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 22 | } 23 | 24 | %new 25 | - (void)showAlert { 26 | NSBundle *bundle = [NSBundle bundleWithPath:@"/Library/PreferenceBundles/ProtectiPlusSettings.bundle"]; 27 | NSString *alertTitle = HidePasswordAlertMessage_IsEnabled ? @"" : LOCAL(@"PASSWORD_ALERT_TITLE"); 28 | NSString *alertMessage = HidePasswordAlertMessage_IsEnabled ? @"" : LOCAL(@"PASSWORD_ALERT_MESSAGE"); 29 | self.alertView = [[[UIAlertView alloc] initWithTitle:alertTitle message:alertMessage delegate:self cancelButtonTitle:LOCAL(@"PASSWORD_ALERT_DISMISS") otherButtonTitles:nil] autorelease]; 30 | self.alertView.alertViewStyle = UIAlertViewStyleSecureTextInput; 31 | 32 | NSString * password = GetValueOf_Password; 33 | if (![[password stringByTrimmingCharactersInSet:[NSCharacterSet decimalDigitCharacterSet]] isEqualToString:@""]) 34 | { //说明包含非数字 使用默认键盘 35 | [[self.alertView textFieldAtIndex:0] setKeyboardType:UIKeyboardTypeDefault]; 36 | } 37 | else 38 | { 39 | [[self.alertView textFieldAtIndex:0] setKeyboardType:UIKeyboardTypeNumberPad]; 40 | } 41 | 42 | [[self.alertView textFieldAtIndex:0] setDelegate:self]; 43 | 44 | [self.alertView show]; 45 | } 46 | 47 | %new 48 | - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { 49 | if ([[textField.text stringByReplacingCharactersInRange:range withString:string] isEqualToString:GetValueOf_Password]) 50 | { 51 | // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 52 | _disableProtectiPlusWithoutPassword(); 53 | // }); 54 | 55 | [self.alertView dismissWithClickedButtonIndex:0 animated:YES]; 56 | 57 | textField.text = @""; 58 | } 59 | return YES; 60 | } 61 | 62 | %end 63 | -------------------------------------------------------------------------------- /ProtectiPlus.plist: -------------------------------------------------------------------------------- 1 | { 2 | Filter = { 3 | Bundles = ( 4 | "com.apple.springboard", 5 | ); 6 | }; 7 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Protecti 2 | protect privacy in an elegant way 3 | 4 | This is a tweak for jailbroken iOS devices. 5 | 6 | [Theos](http://iphonedevwiki.net/index.php/Theos/Setup) is required to build. 7 | 8 | More information: http://cydia.saurik.com/package/org.thebigboss.protectiplus3/ -------------------------------------------------------------------------------- /Tweak.xmi: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import 5 | #import 6 | #import 7 | #import 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | 19 | #import 20 | 21 | #import "version.h" 22 | #import "compatibility/ccquick.h" 23 | #import "helpers.h" 24 | #import "prefs.h" 25 | #import "states.h" 26 | #import "PasswordAlertDelegate.h" 27 | #import "PIPreferences.h" 28 | #import "PIStatusBarIcon.h" 29 | #import "WelcomeAlertDelegate.h" 30 | 31 | static BOOL global_Enable; 32 | static BOOL global_NotJustRespring = NO; 33 | static BOOL global_OnceUnlockSuccessfully = NO; 34 | static BOOL global_HalfSlideUnlock_DeviceHasSystemPasscodeSet; //Get value in global_HalfSlideUnlock_DeviceHasSystemPasscodeSet SBDeviceLockController - (BOOL)deviceHasPasscodeSet 35 | static NSDictionary *global_IconState; 36 | static NSDate *global_EnableTime; 37 | 38 | void _enableProtectiPlus(); 39 | void enableProtectiPlus(CFNotificationCenterRef center,void *observer,CFStringRef name,const void *object,CFDictionaryRef userInfo); 40 | void _disableProtectiPlusWithoutPassword(); 41 | void _disableProtectiPlus(); 42 | void disableProtectiPlus(CFNotificationCenterRef center,void *observer,CFStringRef name,const void *object,CFDictionaryRef userInfo); 43 | void toggleProtectiPlus(CFNotificationCenterRef center,void *observer,CFStringRef name,const void *object,CFDictionaryRef userInfo); 44 | void updatePreferences(CFNotificationCenterRef center,void *observer,CFStringRef name,const void *object,CFDictionaryRef userInfo); 45 | void resetPreferences(CFNotificationCenterRef center,void *observer,CFStringRef name,const void *object,CFDictionaryRef userInfo); 46 | 47 | #include "hooks/activate_app_switcher.xm" 48 | #include "hooks/bypass_passcode_and_half_slide_unlock.xm" 49 | #include "hooks/control_center.xm" 50 | #include "hooks/edit_icon.xm" 51 | #include "hooks/hide_app_icon.xm" 52 | #include "hooks/launch_app.xm" 53 | #include "hooks/notification_center.xm" 54 | #include "hooks/notification.xm" 55 | #include "hooks/open_folders.xm" 56 | #include "hooks/siri.xm" 57 | #include "hooks/spotlight.xm" 58 | #include "hooks/switch_app.xm" 59 | 60 | 61 | /* Toggle Functions */ 62 | 63 | void _enableProtectiPlus() { 64 | if (global_Enable) //Enabled already 65 | return; 66 | 67 | if (IS_IOS_OR_NEWER(iOS_9_0)) { 68 | updateSpotlight_ios9(); 69 | } 70 | 71 | cacheAndModifyTagePrefsSwipeSideEnabledIfNecessary(); 72 | 73 | [PIStatusBarIcon addStatusBarItemIfNecessary]; 74 | 75 | vibrateIfNecessary(); 76 | 77 | if (IS_IOS_OR_NEWER(iOS_9_0)) { 78 | // TODO refreshNotificationCenter() is not working on iOS 9 79 | } else { 80 | if (AllowAccessNotificationCenter_IsEnabled) { 81 | refreshNotificationCenter(); 82 | } 83 | } 84 | 85 | if (HideAppIcons_IsEnabled) { 86 | SBIconModel *iconModel = [(SBIconController *)[objc_getClass("SBIconController") sharedInstance] model]; 87 | global_IconState = [[iconModel iconState] retain]; 88 | } 89 | 90 | global_Enable = YES; 91 | 92 | if (HideAppIcons_IsEnabled) { 93 | iconsVisibilityChanged(); 94 | } 95 | 96 | global_EnableTime = [[NSDate alloc] init]; 97 | 98 | if ([[objc_getClass("SBUserAgent") sharedUserAgent] deviceIsLocked]) { 99 | killApplicationUnderLockScreenIfNecessary(); 100 | } else { 101 | exitForegroundApplicationIfNecessary(); 102 | } 103 | 104 | updateIconBadgeView(); 105 | 106 | // [[%c(SBIconController) sharedInstance] noteIconStateChangedExternally]; // clean icons badge 107 | 108 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ 109 | removeProtectedOrHiddenAppsInAppSwitcher(); 110 | 111 | if (HideAppIcons_IsEnabled) { 112 | saveStateObjectForKey(global_IconState, @"iconState"); 113 | } 114 | saveStateObjectForKey(global_EnableTime, @"enableTime"); 115 | saveStateObjectForKey([NSNumber numberWithBool:global_Enable], @"enable"); 116 | }); 117 | } 118 | 119 | void enableProtectiPlus(CFNotificationCenterRef center,void *observer,CFStringRef name,const void *object,CFDictionaryRef userInfo) { 120 | _enableProtectiPlus(); 121 | } 122 | 123 | void _disableProtectiPlusWithoutPassword() { 124 | if (IS_IOS_OR_NEWER(iOS_9_0)) { 125 | updateSpotlight_ios9(); 126 | } 127 | 128 | restoreTagePrefsSwipeSideEnabledIfNecessaryWithDelay(0.0); 129 | 130 | [PIStatusBarIcon removeStatusBarItem]; 131 | 132 | vibrateIfNecessary(); 133 | 134 | if (IS_IOS_OR_NEWER(iOS_9_0)) { 135 | // TODO refreshNotificationCenter() is not working on iOS 9 136 | } else { 137 | if (AllowAccessNotificationCenter_IsEnabled) { 138 | refreshNotificationCenter(); 139 | } 140 | } 141 | 142 | global_Enable = NO; 143 | 144 | if (HideAppIcons_IsEnabled) { 145 | iconsVisibilityChanged(); 146 | if (!global_IconState) { 147 | global_IconState = getStateObjectForKey(@"iconState"); 148 | } 149 | [global_IconState writeToFile:[[[objc_getClass("SBDefaultIconModelStore") sharedInstance] currentIconStateURL] path] atomically:YES]; 150 | iconsVisibilityChanged(); 151 | // [[%c(SBIconController) sharedInstance] noteIconStateChangedExternally]; 152 | } 153 | 154 | global_EnableTime = nil; 155 | 156 | updateIconBadgeView(); 157 | 158 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 159 | saveStateObjectForKey([NSNull null], @"enableTime"); 160 | saveStateObjectForKey([NSNumber numberWithBool:global_Enable], @"enable"); 161 | }); 162 | } 163 | 164 | void _disableProtectiPlus() { 165 | if (!global_Enable) { //Disabled already 166 | return; 167 | } 168 | 169 | if ( 170 | EnablePassword_IsEnabled && ![GetValueOf_Password isEqualToString:@""] 171 | && 172 | ( 173 | ( 174 | global_HalfSlideUnlock_DeviceHasSystemPasscodeSet 175 | && 176 | ( 177 | !BypassSystemPasscode_IsEnabled 178 | || 179 | (BypassSystemPasscode_IsEnabled && global_OnceUnlockSuccessfully) 180 | ) 181 | ) 182 | || 183 | !global_HalfSlideUnlock_DeviceHasSystemPasscodeSet 184 | ) 185 | ) { 186 | PasswordAlertDelegate *passwordDelegate = [[%c(PasswordAlertDelegate) alloc] init]; 187 | [passwordDelegate showAlert]; 188 | } else { 189 | _disableProtectiPlusWithoutPassword(); 190 | } 191 | } 192 | 193 | void disableProtectiPlus(CFNotificationCenterRef center,void *observer,CFStringRef name,const void *object,CFDictionaryRef userInfo) { 194 | _disableProtectiPlus(); 195 | } 196 | 197 | void toggleProtectiPlus(CFNotificationCenterRef center,void *observer,CFStringRef name,const void *object,CFDictionaryRef userInfo) { 198 | NSLog(@"Toggle Protecti %d", global_Enable); 199 | if (global_Enable) { 200 | _disableProtectiPlus(); 201 | } else { 202 | _enableProtectiPlus(); 203 | } 204 | } 205 | 206 | /* End Of Toggle Functions */ 207 | 208 | 209 | %hook SBLockScreenManager 210 | 211 | - (void)_finishUIUnlockFromSource:(int)arg1 withOptions:(id)arg2 { 212 | %orig; 213 | 214 | /* Deprecated Indicate Missing Notification 215 | if (IndicateMissingNotification_IsEnabled && !global_Enable) { 216 | setPendingNotificationApplicationIconIndicatorInRootFolder(); 217 | } 218 | */ 219 | 220 | if (!global_NotJustRespring) { // Just respring 221 | global_NotJustRespring = YES; 222 | if (HideAppIcons_IsEnabled) { 223 | iconsVisibilityChanged(); 224 | } 225 | } else { 226 | 227 | } 228 | 229 | if (![getStateObjectForKey(@"hasInstalled") boolValue]) { 230 | saveStateObjectForKey([NSNumber numberWithBool:YES], @"hasInstalled"); 231 | WelcomeAlertDelegate *welcomeDelegate = [[WelcomeAlertDelegate alloc] init]; 232 | [welcomeDelegate showAlert]; 233 | } 234 | } 235 | 236 | %end 237 | 238 | 239 | void updatePreferences(CFNotificationCenterRef center,void *observer,CFStringRef name,const void *object,CFDictionaryRef userInfo) { 240 | 241 | [PIPreferences updatePreferences]; 242 | } 243 | 244 | void resetPreferences(CFNotificationCenterRef center,void *observer,CFStringRef name,const void *object,CFDictionaryRef userInfo) { 245 | 246 | [PIPreferences resetPreferences]; 247 | } 248 | 249 | %ctor { 250 | %init; 251 | if (IS_IOS_OR_NEWER(iOS_9_0)) { 252 | %init(iOS_9); 253 | } else { 254 | %init(iOS_8); 255 | } 256 | 257 | dlopen("/Library/MobileSubstrate/DynamicLibraries/IconSupport.dylib", RTLD_NOW); 258 | [[objc_getClass("ISIconSupport") sharedInstance] addExtension:@"com.gviridis.protectiplus"]; 259 | 260 | CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),NULL,&enableProtectiPlus,CFSTR("com.gviridis.protectiplus/Enable"),NULL,0); 261 | CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),NULL,&disableProtectiPlus,CFSTR("com.gviridis.protectiplus/Disable"),NULL,0); 262 | CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),NULL,&toggleProtectiPlus,CFSTR("com.gviridis.protectiplus/Toggle"),NULL,0); 263 | CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),NULL,&updatePreferences,CFSTR("com.gviridis.protectiplus/UpdatePreferences"),NULL,0); 264 | CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),NULL,&resetPreferences,CFSTR("com.gviridis.protectiplus/ResetPreferences"),NULL,0); 265 | CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),NULL,&handleSystemPasscodeChange,CFSTR("com.gviridis.protectiplus/SystemPasscodeChanged"),NULL,0); 266 | 267 | notify_post("com.gviridis.protectiplus/UpdatePreferences"); 268 | 269 | if ([[NSFileManager defaultManager]fileExistsAtPath:@kPreferencesStatePath]) { 270 | global_Enable = [getStateObjectForKey(@"enable") boolValue]; 271 | global_IconState = getStateObjectForKey(@"iconState"); 272 | global_EnableTime = getStateObjectForKey(@"enableTime"); 273 | /* Deprecated Indicate Missing Notification 274 | global_PendingNotifications = getStateObjectForKey(@"pendingNotifications"); 275 | */ 276 | } 277 | 278 | /* Deprecated Auto Enable 279 | if (AutoEnable_IsEnabled) { 280 | _enableProtectiPlus(); 281 | } 282 | */ 283 | } 284 | -------------------------------------------------------------------------------- /Version.h: -------------------------------------------------------------------------------- 1 | /** 2 | * CoreFoundation Version Header 3 | * 4 | * by HASHBANG Productions 5 | * WTFPL 6 | * 7 | * 2.0 478.23 8 | * 2.1 478.26 9 | * 2.2 478.29 10 | * 3.0 478.47 11 | * 3.1 478.52 12 | * 3.2 478.61 13 | * 4.0 550.32 14 | * 4.1 550.38 15 | * 4.2 550.52 16 | * 4.3 550.58 17 | * 5.0 675.00 18 | * 5.1 690.10 19 | * 6.x 793.00 20 | * 7.0 847.20 21 | * 7.0.3 847.21 22 | * 7.1 847.26 23 | * 8.0 1140.10 24 | * 8.1 1141.14 25 | * 8.2 1142.16 26 | * 8.3 1144.17 27 | * 8.4 1145.15 28 | * 9.0 1240.10 29 | */ 30 | 31 | /** 32 | * iOS 2.0 - 4.2 are defined in CoreFoundation/CFBase.h. The format prior to 33 | * 4.0 is kCFCoreFoundationVersionNumber_iPhoneOS_X_Y. 4.0 and newer have the 34 | * format kCFCoreFoundationVersionNumber_iOS_X_Y. 35 | */ 36 | 37 | #import 38 | 39 | /** 40 | * The weird thing about those #defines is that some newer ones don't exist in 41 | * newer SDKs. Let's define version numbers all the way up to the latest. 42 | */ 43 | 44 | #ifndef kCFCoreFoundationVersionNumber_iOS_4_3 45 | #define kCFCoreFoundationVersionNumber_iOS_4_3 550.58 46 | #endif 47 | 48 | #ifndef kCFCoreFoundationVersionNumber_iOS_5_0 49 | #define kCFCoreFoundationVersionNumber_iOS_5_0 675.00 50 | #endif 51 | 52 | #ifndef kCFCoreFoundationVersionNumber_iOS_5_1 53 | #define kCFCoreFoundationVersionNumber_iOS_5_1 690.10 54 | #endif 55 | 56 | #ifndef kCFCoreFoundationVersionNumber_iOS_6_0 57 | #define kCFCoreFoundationVersionNumber_iOS_6_0 793.00 58 | #endif 59 | 60 | #ifndef kCFCoreFoundationVersionNumber_iOS_6_1 61 | #define kCFCoreFoundationVersionNumber_iOS_6_1 793.00 62 | #endif 63 | 64 | #ifndef kCFCoreFoundationVersionNumber_iOS_7_0 65 | #define kCFCoreFoundationVersionNumber_iOS_7_0 847.20 66 | #endif 67 | 68 | #ifndef kCFCoreFoundationVersionNumber_iOS_7_0_3 69 | #define kCFCoreFoundationVersionNumber_iOS_7_0_3 847.21 70 | #endif 71 | 72 | #ifndef kCFCoreFoundationVersionNumber_iOS_7_1 73 | #define kCFCoreFoundationVersionNumber_iOS_7_1 847.26 74 | #endif 75 | 76 | #ifndef kCFCoreFoundationVersionNumber_iOS_8_0 77 | #define kCFCoreFoundationVersionNumber_iOS_8_0 1140.10 78 | #endif 79 | 80 | #ifndef kCFCoreFoundationVersionNumber_iOS_8_1 81 | #define kCFCoreFoundationVersionNumber_iOS_8_1 1141.14 82 | #endif 83 | 84 | #ifndef kCFCoreFoundationVersionNumber_iOS_8_2 85 | #define kCFCoreFoundationVersionNumber_iOS_8_2 1142.16 86 | #endif 87 | 88 | #ifndef kCFCoreFoundationVersionNumber_iOS_8_3 89 | #define kCFCoreFoundationVersionNumber_iOS_8_3 1144.17 90 | #endif 91 | 92 | #ifndef kCFCoreFoundationVersionNumber_iOS_8_4 93 | #define kCFCoreFoundationVersionNumber_iOS_8_4 1145.15 94 | #endif 95 | 96 | #ifndef kCFCoreFoundationVersionNumber_iOS_9_0 97 | #define kCFCoreFoundationVersionNumber_iOS_9_0 1240.10 98 | #endif 99 | 100 | #ifndef kCFCoreFoundationVersionNumber10_10 101 | #define kCFCoreFoundationVersionNumber10_10 1151.16 102 | #endif 103 | 104 | /** 105 | * Let's also define some useful functions to check which firmware the user is 106 | * on. (Note that feature detection is highly recommended where possible) 107 | */ 108 | 109 | #define IS_IOS_OR_OLDER(version) (kCFCoreFoundationVersionNumber <= kCFCoreFoundationVersionNumber_##version) 110 | #define IS_IOS_OR_NEWER(version) (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_##version) 111 | #define IS_IOS_BETWEEN(start, end) (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_##start && kCFCoreFoundationVersionNumber <= kCFCoreFoundationVersionNumber_##end) 112 | 113 | /** 114 | * And let's make equivalent macros for OS X so it doesn't feel lonely. 115 | */ 116 | 117 | #define IS_OSX_OR_OLDER (kCFCoreFoundationVersionNumber <= kCFCoreFoundationVersionNumber##version) 118 | #define IS_OSX_OR_NEWER(version) (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber##version) 119 | #define IS_OSX_BETWEEN(start, end) (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber##start && kCFCoreFoundationVersionNumber <= kCFCoreFoundationVersionNumber##end) 120 | -------------------------------------------------------------------------------- /WelcomeAlertDelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef _WelcomeAlertDelegate_h 2 | #define _WelcomeAlertDelegate_h 3 | 4 | #import 5 | 6 | @interface WelcomeAlertDelegate : NSObject 7 | - (void)showAlert; 8 | @end 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /WelcomeAlertDelegate.m: -------------------------------------------------------------------------------- 1 | #import "WelcomeAlertDelegate.h" 2 | #import "states.h" 3 | #import 4 | 5 | #define LOCAL(key) [bundle localizedStringForKey:key value:key table:nil] 6 | 7 | @implementation WelcomeAlertDelegate 8 | - (void)showAlert { 9 | NSBundle *bundle = [NSBundle bundleWithPath:@"/Library/PreferenceBundles/ProtectiPlusSettings.bundle"]; 10 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:LOCAL(@"WELCOME_TITLE") message:LOCAL(@"WELCOME_MESSAGE") delegate:self cancelButtonTitle:LOCAL(@"WELCOME_DISMISS") otherButtonTitles:LOCAL(@"WELCOME_SETTINGS"), nil]; 11 | 12 | [alertView show]; 13 | } 14 | 15 | - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)index { 16 | if (index == 1) { 17 | [[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"prefs:root=Protecti+&path=Tutorial"]]; 18 | } 19 | } 20 | @end 21 | -------------------------------------------------------------------------------- /compatibility/ccquick.h: -------------------------------------------------------------------------------- 1 | /* Compitable With CCQuick */ 2 | 3 | BOOL ccquickIsInstalled(); 4 | BOOL ccquickChangeSpotlightToLockDeviceIsSet(); 5 | -------------------------------------------------------------------------------- /compatibility/ccquick.mm: -------------------------------------------------------------------------------- 1 | /* Compitable With CCQuick */ 2 | 3 | #import "ccquick.h" 4 | 5 | #define kCCQuickDylibPath "/Library/MobileSubstrate/DynamicLibraries/CCQuick.dylib" 6 | #define kCCQuickSettingsFilePath "/var/mobile/Library/Preferences/com.cunstuck.CCQuick.plist" 7 | 8 | BOOL ccquickIsInstalled() { 9 | return [[NSFileManager defaultManager]fileExistsAtPath:@kCCQuickDylibPath]; 10 | } 11 | 12 | BOOL ccquickChangeSpotlightToLockDeviceIsSet() { 13 | if ([[NSFileManager defaultManager] fileExistsAtPath:@kCCQuickSettingsFilePath]) { 14 | if ([[[NSDictionary dictionaryWithContentsOfFile:@kCCQuickSettingsFilePath] objectForKey:@"isSpotLock"] boolValue]) { 15 | return YES; 16 | } else { 17 | return NO; 18 | } 19 | } else { 20 | return NO; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /helpers.h: -------------------------------------------------------------------------------- 1 | #import 2 | #include 3 | 4 | void refreshNotificationCenter(); 5 | void iconsVisibilityChanged(); 6 | void vibrateIfNecessary(); 7 | void updateIconBadgeView(); 8 | void removeProtectedOrHiddenAppsInAppSwitcher(); 9 | void killApplicationUnderLockScreenIfNecessary(); 10 | void exitForegroundApplicationIfNecessary(); 11 | void killApplicationByAppID(NSString *appID); 12 | void updateSpotlight_ios9(); 13 | BOOL appIdentifierIsInProtectedAppsList(NSString *appIdentifier); 14 | BOOL appIdentifierIsInHiddenAppsList(NSString *appIdentifier); 15 | 16 | /************* Compatible with Tage **************/ // From SimpleReach 17 | BOOL tageIsInstalled(); 18 | int readTagePrefsSwipeSideEnabled(); 19 | void cacheAndModifyTagePrefsSwipeSideEnabledIfNecessary(); 20 | void restoreTagePrefsSwipeSideEnabledIfNecessaryWithDelay(CGFloat delay); 21 | -------------------------------------------------------------------------------- /helpers.mm: -------------------------------------------------------------------------------- 1 | #import "helpers.h" 2 | 3 | #include 4 | 5 | #import "version.h" 6 | #include "prefs.h" 7 | 8 | #import "PIPreferences.h" 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | #import 19 | #import 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | 28 | static BOOL global_NoVibrateWhenEnable = NO; 29 | 30 | void refreshNotificationCenter() { 31 | if (IS_IOS_OR_NEWER(iOS_9_0)) { 32 | // TODO crash on iOS 9, so just return. 33 | return; 34 | } 35 | SBNotificationCenterViewController *viewController = (SBNotificationCenterViewController *)[[objc_getClass("SBNotificationCenterController") sharedInstance] viewController]; 36 | SBNotificationsAllModeViewController *allModeViewController = MSHookIvar(viewController, "_allModeViewController"); 37 | if (allModeViewController) { 38 | SBBulletinViewController *allModeBulletinViewController = MSHookIvar(allModeViewController, "_bulletinViewController"); 39 | if (allModeBulletinViewController) { 40 | [allModeBulletinViewController setTableViewNeedsReload]; 41 | } 42 | } 43 | } 44 | 45 | void iconsVisibilityChanged() { 46 | SBIconModel *iconModel = [(SBIconController *)[objc_getClass("SBIconController") sharedInstance] model]; 47 | NSSet *_hiddenIconTags = MSHookIvar(iconModel, "_hiddenIconTags"); 48 | NSSet *_visibleIconTags = MSHookIvar(iconModel, "_visibleIconTags"); 49 | if (_hiddenIconTags!=nil && _visibleIconTags!=nil) { 50 | NSMutableSet *hiddenIconTags = [NSMutableSet setWithSet:_hiddenIconTags]; 51 | NSMutableSet *visibleIconTags = [NSMutableSet setWithSet:_visibleIconTags]; 52 | [iconModel setVisibilityOfIconsWithVisibleTags:visibleIconTags hiddenTags:hiddenIconTags]; 53 | [iconModel layout]; 54 | } 55 | } 56 | 57 | void vibrateIfNecessary() { 58 | if (Vibrate_IsEnabled && !global_NoVibrateWhenEnable) 59 | { 60 | AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 61 | } 62 | } 63 | 64 | void updateIconBadgeView() { 65 | SBIconViewMap *iconViewMap = [UIDevice.currentDevice.systemVersion floatValue] >= 9.2 ? 66 | [[NSClassFromString(@"SBIconController") sharedInstance] homescreenIconViewMap] : 67 | [objc_getClass("SBIconViewMap") homescreenMap]; 68 | SBIconModel *iconModel = [iconViewMap iconModel]; 69 | NSSet *allApplicationIcons = [iconModel _applicationIcons]; 70 | for (SBApplicationIcon *icon in allApplicationIcons) { 71 | [icon noteBadgeDidChange]; 72 | } 73 | } 74 | 75 | void removeProtectedOrHiddenAppsInAppSwitcher() { 76 | SBAppSwitcherModel *appSwitcherModel = (SBAppSwitcherModel *)[objc_getClass("SBAppSwitcherModel") sharedInstance]; 77 | // recents is an array of SBDisplayLayout in iOS 8, or an array of SBDisplayItem in iOS 9 78 | NSArray *recents = [appSwitcherModel _recentsFromPrefs]; 79 | 80 | for (id recent in recents) { 81 | SBDisplayItem *displayItem = nil; 82 | if (IS_IOS_OR_NEWER(iOS_9_0)) { 83 | displayItem = recent; 84 | } else { 85 | displayItem = ((SBDisplayLayout *)recent).displayItems[0]; 86 | } 87 | NSString *appIdentifier = displayItem.displayIdentifier; 88 | if (appIdentifierIsInProtectedAppsList(appIdentifier) || appIdentifierIsInHiddenAppsList(appIdentifier)) { 89 | [appSwitcherModel remove: recent]; 90 | } 91 | } 92 | [appSwitcherModel _saveRecents]; 93 | } 94 | 95 | void killApplicationUnderLockScreenIfNecessary() { 96 | NSString *foregroundAppID = [[objc_getClass("SBUserAgent") sharedUserAgent] foregroundApplicationDisplayID]; 97 | if (appIdentifierIsInProtectedAppsList(foregroundAppID)) { 98 | killApplicationByAppID(foregroundAppID); 99 | } else { 100 | 101 | } 102 | } 103 | 104 | void exitForegroundApplicationIfNecessary() { 105 | NSString *foregroundAppID = [[objc_getClass("SBUserAgent") sharedUserAgent] foregroundApplicationDisplayID]; 106 | if (foregroundAppID && appIdentifierIsInProtectedAppsList(foregroundAppID)) { 107 | [[objc_getClass("SBUIController") sharedInstance] clickedMenuButton]; 108 | // [(SBUIController *)[%c(SBUIController) sharedInstance] _handleButtonEventToSuspendDisplays:YES displayWasSuspendedOut:NULL]; 109 | if (![foregroundAppID isEqualToString:@"com.saurik.Cydia"]) { 110 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ 111 | sleep(1); 112 | killApplicationByAppID(foregroundAppID); 113 | }); 114 | } 115 | } 116 | } 117 | 118 | void killApplicationByAppID(NSString *appID) { 119 | SBApplication *foregroundApp = nil; 120 | if (IS_IOS_OR_NEWER(iOS_9_0)) { 121 | foregroundApp = [[objc_getClass("SBApplicationController") sharedInstance] applicationWithBundleIdentifier:appID]; 122 | } else { 123 | foregroundApp = [[objc_getClass("SBApplicationController") sharedInstance] applicationWithDisplayIdentifier:appID]; 124 | } 125 | int foregroundAppPID = [foregroundApp pid]; 126 | if (foregroundAppPID) { 127 | system([[@"kill -9 " stringByAppendingFormat:@"%d", foregroundAppPID] cStringUsingEncoding:NSASCIIStringEncoding]); 128 | } else { 129 | 130 | } 131 | } 132 | 133 | void updateSpotlight_ios9() { 134 | if (!IS_IOS_OR_NEWER(iOS_9_0)) { 135 | return; 136 | } 137 | [[objc_getClass("SPUISearchModel") sharedInstance ] performSelector: @selector(postSearchAgentClearedResultsToDelegate)]; 138 | [[objc_getClass("SPUISearchViewController") sharedInstance ] performSelector: @selector(_updateTableContents)]; 139 | } 140 | 141 | BOOL appIdentifierIsInProtectedAppsList(NSString *appIdentifier) { 142 | return [[PIPreferences.sharedPreferences objectForKey:[@"ProtectedApp_" stringByAppendingString:(appIdentifier?:@"")]] boolValue]; 143 | } 144 | 145 | BOOL appIdentifierIsInHiddenAppsList(NSString *appIdentifier) { 146 | return [[PIPreferences.sharedPreferences objectForKey:[@"HiddenApp_" stringByAppendingString:(appIdentifier?:@"")]] boolValue]; 147 | } 148 | 149 | /************* Compatible with Tage **************/ 150 | 151 | #define TAGE_DOMAIN "com.clezz.tage" 152 | #define TAGE_PREF(method, key, defaultValue) (!CFPreferencesCopyAppValue(CFSTR(key), CFSTR(TAGE_DOMAIN)) ? (defaultValue) : [(id)CFPreferencesCopyAppValue(CFSTR(key), CFSTR(TAGE_DOMAIN)) method]) 153 | 154 | NSString *const TageDylibPath = @"/Library/MobileSubstrate/DynamicLibraries/Tage.dylib"; 155 | int const tagePrefsSwipeSideEnabledDefaultValue = 1; 156 | static int tagePrefsSwipeSideEnabled = -1; 157 | static BOOL tagePrefsSwipeSideEnabledCaching = NO; 158 | 159 | BOOL tageIsInstalled() { 160 | return [[NSFileManager defaultManager]fileExistsAtPath:TageDylibPath]; 161 | } 162 | 163 | int readTagePrefsSwipeSideEnabled() { 164 | CFPreferencesAppSynchronize(CFSTR(TAGE_DOMAIN)); 165 | return TAGE_PREF(intValue, "SwipeSideEnabled", tagePrefsSwipeSideEnabledDefaultValue); 166 | } 167 | 168 | void writeTagePrefsSwipeSideEnabled(int value) { 169 | NSNumber *number = [NSNumber numberWithInt: value]; 170 | CFPreferencesSetAppValue (CFSTR("SwipeSideEnabled"), number, CFSTR(TAGE_DOMAIN)); 171 | CFPreferencesAppSynchronize(CFSTR(TAGE_DOMAIN)); 172 | notify_post("com.clezz.tage.preferences-changed"); 173 | } 174 | 175 | void cacheAndModifyTagePrefsSwipeSideEnabledIfNecessary() { 176 | if (!tagePrefsSwipeSideEnabledCaching && tageIsInstalled()) { 177 | tagePrefsSwipeSideEnabled = readTagePrefsSwipeSideEnabled(); 178 | tagePrefsSwipeSideEnabledCaching = YES; 179 | writeTagePrefsSwipeSideEnabled(0); 180 | } 181 | } 182 | 183 | void restoreTagePrefsSwipeSideEnabledIfNecessaryWithDelay(CGFloat delay) { 184 | if (tagePrefsSwipeSideEnabledCaching && tageIsInstalled()) { 185 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ 186 | if (tagePrefsSwipeSideEnabledCaching) { 187 | tagePrefsSwipeSideEnabledCaching = NO; 188 | writeTagePrefsSwipeSideEnabled(tagePrefsSwipeSideEnabled); 189 | } 190 | }); 191 | } 192 | } 193 | -------------------------------------------------------------------------------- /hooks/activate_app_switcher.xm: -------------------------------------------------------------------------------- 1 | /******************** Hidden option: Disable activate App Slider when Protecti+ is enabled **********************/ 2 | 3 | %hook SBUIController 4 | 5 | %group iOS_8 6 | - (BOOL)_activateAppSwitcher { 7 | if (global_Enable && DisableActivateAppSlider_IsEnabled) { 8 | return NO; 9 | } else { 10 | return %orig; 11 | } 12 | } 13 | %end 14 | 15 | %group iOS_9 16 | - (_Bool)_appSwitcherForcePressSystemGestureShouldBegin:(id)arg1 { 17 | if (global_Enable && DisableActivateAppSlider_IsEnabled) { 18 | return NO; 19 | } else { 20 | return %orig; 21 | } 22 | } 23 | - (_Bool)_appSwitcherSystemGestureShouldBegin:(id)arg1 { 24 | if (global_Enable && DisableActivateAppSlider_IsEnabled) { 25 | return NO; 26 | } else { 27 | return %orig; 28 | } 29 | } 30 | %end 31 | 32 | %end 33 | 34 | /****************************************************************************************************************/ 35 | -------------------------------------------------------------------------------- /hooks/bypass_passcode_and_half_slide_unlock.xm: -------------------------------------------------------------------------------- 1 | extern BOOL global_HalfSlideUnlock_DeviceHasSystemPasscodeSet; 2 | 3 | static NSString *global_slfe; 4 | static BOOL global_HalfSlideUnlock_SlideToRightRange; // Init in SBLockScreenViewController - (void)lockScreenViewWillEndDraggingWithPercentScrolled:(CGFloat)arg1 percentScrolledVelocity:(CGFloat)arg2 targetScrollPercentage:(CGFloat)arg3 5 | static BOOL global_DisplayTurnedOnToUnlock = NO; 6 | 7 | void handleSystemPasscodeChange(CFNotificationCenterRef center,void *observer,CFStringRef name,const void *object,CFDictionaryRef userInfo) { 8 | global_slfe = nil; 9 | global_OnceUnlockSuccessfully = NO; 10 | } 11 | 12 | 13 | 14 | %hook SBLockScreenViewController 15 | 16 | -(void)_handleDisplayTurnedOn:(id)arg1 { 17 | %orig; 18 | global_DisplayTurnedOnToUnlock = YES; 19 | } 20 | 21 | %end 22 | 23 | 24 | 25 | %hook SBLockScreenViewController 26 | 27 | %group iOS_8 28 | - (_Bool)wantsPasscodeLockForUIUnlockFromSource:(int)arg1 withOptions:(id)arg2 { 29 | BOOL r = %orig; 30 | if (BypassSystemPasscode_IsEnabled && global_slfe && [[%c(SBDeviceLockController) sharedController] deviceHasPasscodeSet]) { 31 | return NO; 32 | } else { 33 | return r; 34 | } 35 | } 36 | %end 37 | 38 | %group iOS_9 39 | - (_Bool)isPasscodeLockVisible { 40 | // this method is also available in ios8 41 | BOOL r = %orig; 42 | if (BypassSystemPasscode_IsEnabled && global_slfe && [[%c(SBDeviceLockController) sharedController] deviceHasPasscodeSet]) { 43 | return NO; 44 | } else { 45 | return r; 46 | } 47 | } 48 | %end 49 | 50 | %end 51 | 52 | 53 | 54 | %hook SBLockScreenManager 55 | 56 | - (void)unlockUIFromSource:(int)arg1 withOptions:(id)arg2 { 57 | if (BypassSystemPasscode_IsEnabled && global_slfe && [[%c(SBDeviceLockController) sharedController] deviceHasPasscodeSet]) { 58 | [[%c(MCPasscodeManager) sharedManager] unlockDeviceWithPasscode:global_slfe outError:NULL]; 59 | } 60 | global_DisplayTurnedOnToUnlock = NO; 61 | %orig; 62 | } 63 | 64 | %end 65 | 66 | 67 | 68 | %hook SBDeviceLockController 69 | 70 | - (BOOL)isPasscodeLocked { 71 | BOOL r = %orig; 72 | if (!BypassSystemPasscode_IsEnabled) { 73 | return r; 74 | } else { 75 | if (global_OnceUnlockSuccessfully) { 76 | if (global_DisplayTurnedOnToUnlock) { 77 | return NO; 78 | } else { 79 | return r; 80 | } 81 | } else { 82 | return r; 83 | } 84 | } 85 | } 86 | 87 | %end 88 | 89 | 90 | 91 | %hook SBLockScreenManager 92 | 93 | - (BOOL)attemptUnlockWithPasscode:(id)passcode { 94 | if (!BypassSystemPasscode_IsEnabled) 95 | return %orig; 96 | 97 | BOOL r = %orig(passcode); 98 | if (r && passcode != nil && [passcode isKindOfClass: [NSString class]]) { 99 | global_slfe = [[NSString stringWithString:passcode] retain]; 100 | global_OnceUnlockSuccessfully = YES; 101 | } else { 102 | global_OnceUnlockSuccessfully = NO; 103 | } 104 | return r; 105 | } 106 | 107 | - (void)remoteLock:(BOOL)arg1 { 108 | if (arg1) { 109 | if (global_slfe) { 110 | [global_slfe release]; 111 | global_slfe = nil; 112 | } 113 | global_OnceUnlockSuccessfully = NO; 114 | } 115 | %orig(arg1); 116 | } 117 | 118 | %end 119 | 120 | 121 | 122 | %hook SBLockScreenViewController 123 | 124 | - (void)lockScreenViewWillEndDraggingWithPercentScrolled:(CGFloat)arg1 percentScrolledVelocity:(CGFloat)arg2 targetScrollPercentage:(CGFloat)arg3 { 125 | if (!HalfSlideUnlock_IsEnabled) { 126 | %orig; 127 | } else { 128 | if (arg1 > GetValueOf_HalfSlideUnlock_MinDistance && arg1 < GetValueOf_HalfSlideUnlock_MaxDistance) { 129 | global_HalfSlideUnlock_SlideToRightRange = YES; 130 | } else { 131 | global_HalfSlideUnlock_SlideToRightRange = NO; 132 | } 133 | } 134 | } 135 | 136 | - (void)lockScreenViewDidScrollWithNewScrollPercentage:(CGFloat)arg1 tracking:(BOOL)arg2 { 137 | %orig; 138 | if (arg1 >= 1.0) { 139 | if (!HalfSlideUnlock_IsEnabled) { 140 | return; 141 | } else { 142 | if (global_HalfSlideUnlock_SlideToRightRange) { 143 | _disableProtectiPlus(); 144 | } else { 145 | _enableProtectiPlus(); 146 | } 147 | } 148 | } else { 149 | 150 | } 151 | } 152 | 153 | %end 154 | 155 | 156 | 157 | %hook SBLockScreenSettings 158 | 159 | - (CGFloat) lockToUnlockSlideCompletionPercentage { 160 | if (!HalfSlideUnlock_IsEnabled) { 161 | return %orig; 162 | } else { 163 | CGFloat r = %orig; 164 | if (HalfSlideUnlock_IsEnabled) { 165 | if (GetValueOf_HalfSlideUnlock_MinDistance >= GetValueOf_HalfSlideUnlock_MaxDistance) { 166 | return r; 167 | } else { 168 | return (GetValueOf_HalfSlideUnlock_MinDistance < r ? GetValueOf_HalfSlideUnlock_MinDistance : r)/2; 169 | } 170 | } else { 171 | return r; 172 | } 173 | } 174 | } 175 | 176 | %end 177 | 178 | 179 | 180 | %hook SBDeviceLockController 181 | 182 | - (BOOL)deviceHasPasscodeSet { 183 | if (global_Enable) { 184 | [PIStatusBarIcon addStatusBarItemIfNecessary]; // this is a btw 185 | } 186 | BOOL r = %orig; 187 | global_HalfSlideUnlock_DeviceHasSystemPasscodeSet = r; 188 | return r; 189 | } 190 | 191 | %end 192 | -------------------------------------------------------------------------------- /hooks/control_center.xm: -------------------------------------------------------------------------------- 1 | // Disable control center pull up 2 | 3 | %group iOS_8 4 | %hook SBUIController 5 | - (void)_showControlCenterGestureBeganWithLocation:(struct CGPoint)arg1 { 6 | if (!AllowAccessControlCenter_IsEnabled && global_Enable) { 7 | return; 8 | } else { 9 | %orig; 10 | } 11 | } 12 | %end 13 | %end 14 | 15 | 16 | %group iOS_9 17 | %hook SBControlCenterController 18 | - (void)_handleShowControlCenterGesture:(id)arg1 { 19 | if (!AllowAccessControlCenter_IsEnabled && global_Enable) { 20 | return; 21 | } else { 22 | %orig; 23 | } 24 | } 25 | %end 26 | %end 27 | -------------------------------------------------------------------------------- /hooks/deprecated_indicate_pending_notification.xm: -------------------------------------------------------------------------------- 1 | static NSMutableArray *global_PendingNotifications; 2 | 3 | void addAndSavePendingNotificationAppID(NSString *appID) { 4 | if (!global_PendingNotifications) { 5 | global_PendingNotifications = [[NSMutableArray alloc] init]; 6 | } 7 | if (appID && ![global_PendingNotifications containsObject:appID]) { 8 | [global_PendingNotifications addObject:appID]; 9 | saveStateObjectForKey(global_PendingNotifications, @"pendingNotifications"); 10 | } 11 | } 12 | 13 | void indicateIconView(SBIconView *iconView) { 14 | CALayer *layer; 15 | switch (GetValueOf_MissingNotificationIndicatorStyle) { 16 | case kNone: 17 | break; 18 | case kTapped: 19 | [iconView setHighlighted:YES]; 20 | break; 21 | case kShadow: 22 | layer = [iconView layer]; 23 | layer.shadowColor = [[UIColor blackColor] CGColor]; 24 | layer.shadowOffset = CGSizeMake(0, 3); 25 | layer.shadowOpacity = 0.4; 26 | layer.shadowRadius = 3.0f; 27 | break; 28 | case kGlow: 29 | layer = [iconView layer]; 30 | layer.shadowColor = [[UIColor whiteColor] CGColor]; 31 | layer.shadowOffset = CGSizeMake(0, -3); 32 | layer.shadowOpacity = 0.4; 33 | layer.shadowRadius = 3.0f; 34 | break; 35 | default: 36 | break; 37 | } 38 | } 39 | 40 | void setPendingNotificationApplicationIconIndicatorInFolder(SBFolder *folder) { 41 | if (!global_PendingNotifications) { 42 | global_PendingNotifications = getStateObjectForKey(@"pendingNotifications"); 43 | } 44 | 45 | SBIconViewMap *homescreen = [%c(SBIconViewMap) homescreenMap]; // for get iconview 46 | SBIconModel *iconModel = [homescreen iconModel]; // for get icon 47 | NSSet *allSubfolderIcons = [folder folderIcons]; 48 | 49 | for (NSString *identifier in global_PendingNotifications) { 50 | SBIcon *icon = [iconModel applicationIconForBundleIdentifier:identifier]; 51 | if ([folder listContainingIcon:icon]) { 52 | SBIconView *iconView = [homescreen mappedIconViewForIcon:icon]; 53 | indicateIconView(iconView); 54 | } else { 55 | for (SBFolderIcon *folder in allSubfolderIcons) { 56 | if ([folder.folder listContainingIcon:icon]) { 57 | indicateIconView([homescreen mappedIconViewForIcon:folder]); 58 | } else { 59 | 60 | } 61 | } 62 | } 63 | } 64 | } 65 | 66 | void setPendingNotificationApplicationIconIndicatorInRootFolder() { 67 | if (!global_PendingNotifications) { 68 | global_PendingNotifications = getStateObjectForKey(@"pendingNotifications"); 69 | } 70 | 71 | SBFolder *rootFolder = (SBFolder *)[[[%c(SBIconViewMap) homescreenMap] iconModel] rootFolder]; 72 | 73 | setPendingNotificationApplicationIconIndicatorInFolder(rootFolder); 74 | } 75 | 76 | 77 | //%hook SBIconController 78 | // 79 | //- (void)_closeFolderController:(id)arg1 animated:(BOOL)arg2 withCompletion:(id)arg3 { 80 | // %orig; 81 | // if (IndicateMissingNotification_IsEnabled && !global_Enable) { 82 | // setPendingNotificationApplicationIconIndicatorInRootFolder(); 83 | // } else { 84 | // 85 | // } 86 | //} 87 | // 88 | //%end 89 | 90 | 91 | //%hook SBFolderController 92 | // 93 | //- (void)folderView:(id)arg1 currentPageIndexDidChange:(int)arg2 { 94 | // %orig; 95 | // if (IndicateMissingNotification_IsEnabled && !global_Enable) { 96 | // setPendingNotificationApplicationIconIndicatorInFolder([arg1 folder]); 97 | // } else { 98 | // 99 | // } 100 | //} 101 | // 102 | //%end 103 | -------------------------------------------------------------------------------- /hooks/edit_icon.xm: -------------------------------------------------------------------------------- 1 | %hook SBIconController 2 | 3 | // Disable uninstall 4 | - (BOOL)allowsUninstall { 5 | BOOL r = %orig; 6 | if (global_Enable && !EnableEditIcons_IsEnabled) { 7 | return NO; 8 | } else { 9 | return r; 10 | } 11 | } 12 | 13 | %end 14 | 15 | 16 | %hook SBIconView 17 | 18 | // Disable editing icon 19 | - (void)setIsEditing:(BOOL)arg1 animated:(BOOL)arg2 { 20 | if (global_Enable && !EnableEditIcons_IsEnabled && arg1) { 21 | return; 22 | } else { 23 | return %orig; 24 | } 25 | } 26 | 27 | // Disable move icon 28 | - (void)touchesMoved:(NSArray *)touches withEvent:(UIEvent *)event { 29 | if (global_Enable && !EnableEditIcons_IsEnabled) { 30 | return; 31 | } else { 32 | %orig; 33 | } 34 | } 35 | 36 | %end 37 | -------------------------------------------------------------------------------- /hooks/hide_app_icon.xm: -------------------------------------------------------------------------------- 1 | %hook SBIconModel 2 | 3 | - (BOOL)isIconVisible:(SBIcon *)icon { 4 | BOOL r = %orig; 5 | if (HideAppIcons_IsEnabled && global_Enable && appIdentifierIsInHiddenAppsList([icon applicationBundleID])) { 6 | return NO; 7 | } 8 | return r; 9 | } 10 | 11 | %end 12 | -------------------------------------------------------------------------------- /hooks/launch_app.xm: -------------------------------------------------------------------------------- 1 | /********************* Try to disable launch by LastApp and open link in AppStore ******************************/ 2 | /************* Accidentally found the way to disable launch apps in general way. It seems well. ****************/ 3 | 4 | #import 5 | #import 6 | 7 | @interface SBAppToAppWorkspaceTransaction 8 | @property(readonly, retain, nonatomic) SBWorkspaceTransitionRequest *transitionRequest; 9 | @end 10 | 11 | %group iOS_8 12 | %hook SBAppToAppWorkspaceTransaction 13 | - (id)initWithAlertManager:(id)alertManager from:(id)from to:(id)to withResult:(id)result { 14 | if (global_Enable && appIdentifierIsInProtectedAppsList([to displayIdentifier])) { 15 | return nil; 16 | } else { 17 | return %orig; 18 | } 19 | } 20 | %end 21 | %end 22 | 23 | %group iOS_9 24 | %hook SBMainWorkspace 25 | - (_Bool)_setCurrentTransactionForRequest:(id)request fallbackProvider:(id)arg2 { 26 | if (![request isKindOfClass:[%c(SBWorkspaceTransitionRequest) class]]) { 27 | return %orig; 28 | } 29 | NSSet *activatingApps = ((SBWorkspaceTransitionRequest *)request).activatingApps; 30 | SBApplication *app = ((SBWorkspaceApplication *)[activatingApps anyObject]).application; 31 | if (global_Enable && appIdentifierIsInProtectedAppsList([app bundleIdentifier])) { 32 | return NO; 33 | } else { 34 | return %orig; 35 | } 36 | } 37 | %end 38 | %end 39 | 40 | /****************************************************************************************************************/ 41 | 42 | 43 | %hook SBApplication 44 | 45 | // Disable launch from tapping 46 | - (BOOL)icon:(id)icon launchFromLocation:(int)location context:(id)context { 47 | if (!global_Enable) { 48 | BOOL r = %orig; 49 | /* Deprecated Indicate Missing Notification 50 | [global_PendingNotifications removeObject:[arg1 applicationBundleID]]; 51 | saveStateObjectForKey(global_PendingNotifications, @"pendingNotifications"); 52 | */ 53 | return r; 54 | } else { 55 | if (appIdentifierIsInProtectedAppsList([self bundleIdentifier])) { 56 | return NO; 57 | } else { 58 | return %orig; 59 | } 60 | } 61 | } 62 | 63 | %end 64 | 65 | 66 | %hook SBUIController 67 | 68 | %group iOS_8 69 | - (void)activateApplicationAnimatedFromIcon:(id)arg1 fromLocation:(int)arg2 { 70 | if (!global_Enable) { 71 | return %orig; 72 | } else { 73 | if (appIdentifierIsInProtectedAppsList([arg1 bundleIdentifier])) { 74 | return; 75 | } else { 76 | return %orig; 77 | } 78 | } 79 | } 80 | - (void)activateApplicationAnimated:(id)arg1 { 81 | if (!global_Enable) { 82 | return %orig; 83 | } else { 84 | if (appIdentifierIsInProtectedAppsList([arg1 bundleIdentifier])) { 85 | return; 86 | } else { 87 | return %orig; 88 | } 89 | } 90 | } 91 | %end 92 | 93 | %group iOS_9 94 | - (void)activateApplication:(id)arg1 fromIcon:(id)arg2 location:(int)arg3 { 95 | if (!global_Enable) { 96 | return %orig; 97 | } else { 98 | if (appIdentifierIsInProtectedAppsList([arg1 bundleIdentifier])) { 99 | return; 100 | } else { 101 | return %orig; 102 | } 103 | } 104 | } 105 | - (void)activateApplication:(id)arg1 { 106 | if (!global_Enable) { 107 | return %orig; 108 | } else { 109 | if (appIdentifierIsInProtectedAppsList([arg1 bundleIdentifier])) { 110 | return; 111 | } else { 112 | return %orig; 113 | } 114 | } 115 | } 116 | %end 117 | 118 | %end 119 | 120 | 121 | %hook SpringBoard 122 | 123 | - (void)_openURLCore:(id)core display:(id)display animating:(BOOL)animating sender:(id)sender activationSettings:(id)settings withResult:(id)result { 124 | if (!global_Enable) { 125 | return %orig; 126 | } else { 127 | if (appIdentifierIsInProtectedAppsList([(SBApplication *)display displayIdentifier])) { 128 | return; 129 | } else { 130 | return %orig; 131 | } 132 | } 133 | } 134 | 135 | %end 136 | 137 | 138 | %hook SBCCQuickLaunchSectionController 139 | 140 | - (void)_activateAppWithBundleId:(id)arg1 url:(id)arg2 { 141 | if (!global_Enable) { 142 | return %orig; 143 | } else { 144 | if (appIdentifierIsInProtectedAppsList(arg1)) { 145 | return; 146 | } else { 147 | return %orig; 148 | } 149 | } 150 | } 151 | 152 | %end 153 | 154 | 155 | %hook SBUserAgent 156 | 157 | - (BOOL)canLaunchFromBulletinWithURL:(id)arg1 bundleID:(id)arg2 { 158 | if (!global_Enable) { 159 | return %orig; 160 | } else { 161 | if (appIdentifierIsInProtectedAppsList(arg2)) { 162 | return NO; 163 | } else { 164 | return %orig; 165 | } 166 | } 167 | } 168 | 169 | %end 170 | 171 | 172 | %hook SpringBoard 173 | 174 | // Disable launch from InstaLauncher 175 | - (_Bool)launchApplicationWithIdentifier:(id)arg1 suspended:(_Bool)arg2 { 176 | if (!global_Enable) { 177 | return %orig; 178 | } else { 179 | if (appIdentifierIsInProtectedAppsList(arg1)) { 180 | return NO; 181 | } else { 182 | return %orig; 183 | } 184 | } 185 | } 186 | 187 | %end 188 | -------------------------------------------------------------------------------- /hooks/notification.xm: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | void turnOnBacklightIfNecessary(); 5 | 6 | %hook SBBulletinBannerController 7 | 8 | // Disable banner notification. 9 | - (void)observer:(id)observer addBulletin:(id)bulletin forFeed:(unsigned)feed playLightsAndSirens:(BOOL)sirens withReply:(id)reply { 10 | if (global_Enable) { 11 | turnOnBacklightIfNecessary(); 12 | /* Deprecated Indicate Missing Notification 13 | if (IndicateMissingNotification_IsEnabled && global_Enable) { 14 | addAndSavePendingNotificationAppID([(BBBulletin *)arg2 sectionID]); 15 | } else { 16 | 17 | } 18 | */ 19 | if (appIdentifierIsInProtectedAppsList([(BBBulletin *)bulletin sectionID])) { 20 | if (NoNotificationsForProtectedApps_IsEnabled) { 21 | return; 22 | } else { 23 | return %orig; 24 | } 25 | } else { //Unprotected 26 | if (NoNotificationsForUnprotectedApps_IsEnabled) { 27 | return; 28 | } else { 29 | return %orig; 30 | } 31 | } 32 | } else { 33 | return %orig; 34 | } 35 | } 36 | 37 | %end 38 | 39 | 40 | %hook SBBulletinModalController 41 | 42 | // Disable alert notification 43 | - (void)observer:(id)observer addBulletin:(id)bulletin forFeed:(unsigned)feed playLightsAndSirens:(BOOL)sirens withReply:(id)reply { 44 | if (global_Enable) { 45 | turnOnBacklightIfNecessary(); 46 | /* Deprecated Indicate Missing Notification 47 | if (IndicateMissingNotification_IsEnabled && global_Enable) { 48 | addAndSavePendingNotificationAppID([(BBBulletin *)arg2 sectionID]); 49 | } else { 50 | 51 | } 52 | */ 53 | if (appIdentifierIsInProtectedAppsList([(BBBulletin *)bulletin sectionID])) { 54 | if (NoNotificationsForProtectedApps_IsEnabled) { 55 | return; 56 | } else { 57 | return %orig; 58 | } 59 | } else { //Unprotected 60 | if (NoNotificationsForUnprotectedApps_IsEnabled) { 61 | return; 62 | } else { 63 | return %orig; 64 | } 65 | } 66 | } else { 67 | return %orig; 68 | } 69 | } 70 | 71 | %end 72 | 73 | 74 | %hook SBIconController 75 | 76 | // Disable badge change 77 | - (BOOL)iconViewDisplaysBadges:(id)arg1 { 78 | SBIcon *icon = MSHookIvar(arg1, "_icon"); 79 | 80 | if (global_Enable && appIdentifierIsInProtectedAppsList([icon applicationBundleID])) { 81 | return NO; 82 | } else { 83 | return %orig; 84 | } 85 | } 86 | 87 | %end 88 | 89 | 90 | %hook SBLockScreenNotificationListController 91 | 92 | // Disable lock screen notification 93 | - (void)observer:(id)observer addBulletin:(id)bulletin forFeed:(unsigned)feed playLightsAndSirens:(BOOL)sirens withReply:(id)reply { 94 | if (global_Enable) { 95 | turnOnBacklightIfNecessary(); 96 | /* Deprecated Indicate Missing Notification 97 | if (IndicateMissingNotification_IsEnabled && global_Enable) { 98 | addAndSavePendingNotificationAppID([(BBBulletin *)arg2 sectionID]); 99 | } else { 100 | 101 | } 102 | */ 103 | if (appIdentifierIsInProtectedAppsList([(BBBulletin *)bulletin sectionID])) { 104 | if (NoNotificationsForProtectedApps_IsEnabled) { 105 | return; 106 | } else { 107 | return %orig; 108 | } 109 | } else { //Unprotected 110 | if (NoNotificationsForUnprotectedApps_IsEnabled) { 111 | return; 112 | } else { 113 | return %orig; 114 | } 115 | } 116 | } else { 117 | %orig; 118 | } 119 | } 120 | 121 | %end 122 | 123 | /* 124 | %hook SBBulletinSoundController 125 | 126 | // Disable sound notification 127 | - (void)observer:(id)arg1 addBulletin:(id)arg2 forFeed:(unsigned int)arg3 { 128 | if (global_Enable) { 129 | turnOnBacklightIfNecessary(); 130 | vibrateNotificationIfNecessary(); 131 | if (IndicateMissingNotification_IsEnabled && global_Enable) { 132 | addAndSavePendingNotificationAppID([(BBBulletin *)arg2 sectionID]); 133 | } else { 134 | 135 | } 136 | } else { 137 | %orig; 138 | } 139 | return; 140 | } 141 | 142 | %end*/ 143 | 144 | 145 | %hook BBBulletin 146 | 147 | - (NSString *)title { 148 | NSString *r = %orig; 149 | if (global_Enable) { 150 | if (appIdentifierIsInProtectedAppsList([self sectionID])) { 151 | if (NoNotificationTitleForProtectedApps_IsEnabled) { 152 | return r==nil ? r : @""; 153 | } else { 154 | return r; 155 | } 156 | } else { 157 | if (NoNotificationTitleForUnprotectedApps_IsEnabled) { 158 | return r==nil ? r : @""; 159 | } else { 160 | return r; 161 | } 162 | 163 | } 164 | } else { 165 | return r; 166 | } 167 | } 168 | 169 | - (NSString *)subtitle { 170 | NSString *r = %orig; 171 | if (global_Enable) { 172 | if (appIdentifierIsInProtectedAppsList([self sectionID])) { 173 | if (NoNotificationTitleForProtectedApps_IsEnabled) { 174 | return r==nil ? r : @""; 175 | } else { 176 | return r; 177 | } 178 | } else { 179 | if (NoNotificationTitleForUnprotectedApps_IsEnabled) { 180 | return r==nil ? r : @""; 181 | } else { 182 | return r; 183 | } 184 | } 185 | } else { 186 | return r; 187 | } 188 | } 189 | 190 | - (NSString *)message { 191 | NSString *r = %orig; 192 | if (global_Enable) { 193 | if (appIdentifierIsInProtectedAppsList([self sectionID])) { 194 | if (NoNotificationMessageForProtectedApps_IsEnabled) { 195 | return r==nil ? r : @""; 196 | } else { 197 | return r; 198 | } 199 | } else { 200 | if (NoNotificationMessageForUnprotectedApps_IsEnabled) { 201 | return r==nil ? r : @""; 202 | } else { 203 | return r; 204 | } 205 | } 206 | } else { 207 | return r; 208 | } 209 | } 210 | 211 | - (BBSound *)sound { 212 | if (global_Enable) { 213 | if (appIdentifierIsInProtectedAppsList([self sectionID])) { 214 | if (NoNotificationSoundForProtectedApps_IsEnabled) { 215 | return nil; 216 | } else { 217 | return %orig; 218 | } 219 | } else { 220 | if (NoNotificationSoundForUnprotectedApps_IsEnabled) { 221 | return nil; 222 | } else { 223 | return %orig; 224 | } 225 | } 226 | } else { 227 | return %orig; 228 | } 229 | } 230 | 231 | - (BBAttachments *)attachments { 232 | if (global_Enable && appIdentifierIsInProtectedAppsList([self sectionID])) { 233 | return nil; 234 | } else { 235 | return %orig; 236 | } 237 | } 238 | 239 | %end 240 | 241 | 242 | %hook SBBulletinAlertHandlerRegistry 243 | 244 | - (id)alertHandlersForSection:(id)arg1 { 245 | if (!global_Enable) { 246 | return %orig; 247 | } else { 248 | if (appIdentifierIsInProtectedAppsList(arg1)) { 249 | return nil; 250 | } else { 251 | return %orig; 252 | } 253 | } 254 | } 255 | 256 | %end 257 | 258 | 259 | %hook SBIcon 260 | 261 | // No effect for Disable badge change, but can used to save pending notifications. 262 | - (void)setBadge:(id)arg1 { 263 | if (global_Enable) { 264 | /* delete this line cause no backligh when receive badge notification (only badge, not banner, alert etc.) */ 265 | /* turnOnBacklightIfNecessary(); */ 266 | 267 | /* Deprecated Indicate Missing Notification 268 | if (IndicateMissingNotification_IsEnabled && global_Enable) { 269 | addAndSavePendingNotificationAppID([self applicationBundleID]); 270 | } else { 271 | 272 | } 273 | */ 274 | return %orig(nil); 275 | } else { 276 | return %orig(arg1); 277 | } 278 | } 279 | 280 | %end 281 | 282 | 283 | void vibrateNotificationIfNecessary() { 284 | if (global_Enable && VibrateNotifications_IsEnabled) { 285 | AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 286 | } 287 | } 288 | 289 | /* Backligh for new messages */ 290 | void turnOnBacklightIfNecessary() { 291 | if (TurnOnBacklighWhenReceiveNewNotifications_IsEnabled && global_Enable) { 292 | [[objc_getClass("SBBacklightController") sharedInstance] resetLockScreenIdleTimer]; 293 | [[objc_getClass("SBBacklightController") sharedInstance] turnOnScreenFullyWithBacklightSource:0]; 294 | } else { 295 | 296 | } 297 | } 298 | -------------------------------------------------------------------------------- /hooks/notification_center.xm: -------------------------------------------------------------------------------- 1 | // Disable notification center pull down 2 | 3 | %group iOS_8 4 | %hook SBUIController 5 | - (void)_showNotificationsGestureBeganWithLocation:(struct CGPoint)arg1 { 6 | if (global_Enable) { 7 | if (AllowAccessNotificationCenter_IsEnabled) { 8 | return %orig; 9 | } else { 10 | return; 11 | } 12 | } else { 13 | return %orig; 14 | } 15 | } 16 | %end 17 | %end 18 | 19 | %group iOS_9 20 | %hook SBNotificationCenterController 21 | - (void)_handleShowNotificationCenterGesture:(id)arg1 { 22 | if (global_Enable) { 23 | if (AllowAccessNotificationCenter_IsEnabled) { 24 | return %orig; 25 | } else { 26 | return; 27 | } 28 | } else { 29 | return %orig; 30 | } 31 | } 32 | %end 33 | %end 34 | -------------------------------------------------------------------------------- /hooks/open_folders.xm: -------------------------------------------------------------------------------- 1 | %hook SBIconController 2 | 3 | - (void)openFolder:(SBFolder *)arg1 animated:(BOOL)arg2 { 4 | if (GetValueOf_DisabledFolders && global_Enable) 5 | { 6 | NSArray *folders = [GetValueOf_DisabledFolders componentsSeparatedByString:@";"]; 7 | if ([folders containsObject:[arg1 displayName]]) 8 | { 9 | return; 10 | } 11 | else 12 | { 13 | return %orig; 14 | } 15 | } 16 | else 17 | { 18 | return %orig; 19 | } 20 | } 21 | 22 | %end 23 | -------------------------------------------------------------------------------- /hooks/siri.xm: -------------------------------------------------------------------------------- 1 | %hook SBAssistantController 2 | 3 | // Disable Siri 4 | + (BOOL)shouldEnterAssistant { 5 | BOOL r = %orig; 6 | if (global_Enable) 7 | return NO; 8 | else 9 | return r; 10 | } 11 | 12 | %end 13 | -------------------------------------------------------------------------------- /hooks/spotlight.xm: -------------------------------------------------------------------------------- 1 | // Disable spotlight search 2 | 3 | %hook SBSearchScrollView 4 | - (BOOL)gestureRecognizerShouldBegin:(id)arg1 { 5 | BOOL r = %orig; 6 | if (global_Enable) { 7 | if (ccquickChangeSpotlightToLockDeviceIsSet()) { 8 | return r; 9 | } else { 10 | return NO; 11 | } 12 | } else { 13 | return r; 14 | } 15 | } 16 | %end 17 | 18 | %group iOS_9 19 | %hook SPUISearchViewController 20 | - (void)setTableViewShown:(BOOL)arg1 { 21 | if (global_Enable) { 22 | return %orig(NO); 23 | } else { 24 | return %orig; 25 | } 26 | } 27 | %end 28 | %end 29 | -------------------------------------------------------------------------------- /hooks/switch_app.xm: -------------------------------------------------------------------------------- 1 | %hook SBUIController 2 | 3 | // Disable swipe between apps. 4 | 5 | %group iOS_8 6 | - (_Bool)allowSystemGestureType:(unsigned long long)arg1 atLocation:(struct CGPoint)arg2 { 7 | // http://iphonedevwiki.net/index.php/SBGestureRecognizer 8 | if (global_Enable && arg1 == 1<<2) { 9 | return NO; 10 | } else { 11 | return %orig; 12 | } 13 | } 14 | %end 15 | 16 | %group iOS_9 17 | - (void)_handleSwitchAppGesture:(id)arg1 { 18 | if (!global_Enable) { 19 | return %orig; 20 | } 21 | if (tageIsInstalled() && readTagePrefsSwipeSideEnabled()) { 22 | // Nothing special is done here. 23 | // In this case, Tage's settings are cached and restored in 24 | // _enableProtectiPlus and _disableProtectiPlusWithoutPassword 25 | // by calling following functions, 26 | // void cacheAndModifyTagePrefsSwipeSideEnabledIfNecessary(); 27 | // void restoreTagePrefsSwipeSideEnabledIfNecessaryWithDelay(CGFloat delay); 28 | return %orig; 29 | } 30 | return; 31 | } 32 | %end 33 | 34 | %end 35 | -------------------------------------------------------------------------------- /layout/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Package: org.thebigboss.protectiplus3 2 | Conflicts: org.thebigboss.protectiplus 3 | Depends: firmware (>= 8.0), mobilesubstrate (>= 0.9.5000), preferenceloader (>= 2.2.2), applist, libactivator, com.chpwn.iconsupport, libstatusbar, ws.hbang.common (>= 1.2) 4 | Name: Protecti+ 5 | Version: 1.11 6 | Architecture: iphoneos-arm 7 | Description: Protect privacy in an elegant way. 8 | Author: gviridis 9 | Section: Tweaks 10 | -------------------------------------------------------------------------------- /layout/System/Library/Frameworks/UIKit.framework/Black_protecti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/layout/System/Library/Frameworks/UIKit.framework/Black_protecti.png -------------------------------------------------------------------------------- /layout/System/Library/Frameworks/UIKit.framework/Black_protecti@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/layout/System/Library/Frameworks/UIKit.framework/Black_protecti@2x.png -------------------------------------------------------------------------------- /layout/System/Library/Frameworks/UIKit.framework/LockScreen_protecti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/layout/System/Library/Frameworks/UIKit.framework/LockScreen_protecti.png -------------------------------------------------------------------------------- /layout/System/Library/Frameworks/UIKit.framework/LockScreen_protecti@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/layout/System/Library/Frameworks/UIKit.framework/LockScreen_protecti@2x.png -------------------------------------------------------------------------------- /prefs.h: -------------------------------------------------------------------------------- 1 | #ifndef _prefs_h 2 | #define _prefs_h 3 | 4 | #import "PIPreferences.h" 5 | 6 | #define kPreferencesPath "/var/mobile/Library/Preferences/com.gviridis.protectiplus.plist" 7 | #define kPreferencesKeyPath "/var/mobile/Library/Preferences/com.gviridis.protectiplus.key" 8 | 9 | #define HalfSlideUnlock_IsEnabled \ 10 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableHalfSlideUnlockKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableHalfSlideUnlockKey] boolValue] : NO) 11 | #define BypassSystemPasscode_IsEnabled \ 12 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableBypassSystemPasscodeKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableBypassSystemPasscodeKey] boolValue] : NO) 13 | #define Vibrate_IsEnabled \ 14 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableVibrateKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableVibrateKey] boolValue] : NO) 15 | #define StatusBarIcon_IsEnabled \ 16 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableStatusBarIconKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableStatusBarIconKey] boolValue] : YES) 17 | #define TurnOnBacklighWhenReceiveNewNotifications_IsEnabled \ 18 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableTurnOnBacklighWhenReceiveNewNotificationsKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableTurnOnBacklighWhenReceiveNewNotificationsKey] boolValue] : NO) 19 | #define VibrateNotifications_IsEnabled \ 20 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableVibrateNotificationsKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableVibrateNotificationsKey] boolValue] : NO) 21 | #define AllowAccessNotificationCenter_IsEnabled \ 22 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesAllowAccessNotificationCenterKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesAllowAccessNotificationCenterKey] boolValue] : NO) 23 | #define AllowAccessControlCenter_IsEnabled \ 24 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesAllowAccessControlCenterKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesAllowAccessControlCenterKey] boolValue] : NO) 25 | #define HideAppIcons_IsEnabled \ 26 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableHideAppIconsKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableHideAppIconsKey] boolValue] : NO) 27 | #define IndicateMissingNotification_IsEnabled \ 28 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableIndicateMissingNotificationKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableIndicateMissingNotificationKey] boolValue] : NO) 29 | #define GetValueOf_MissingNotificationIndicatorStyle \ 30 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesMissingNotificationIndicatorStyleKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesMissingNotificationIndicatorStyleKey] integerValue] : kTapped) 31 | #define GetValueOf_HalfSlideUnlock_MinDistance \ 32 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesHalfSlideUnlock_MinDistanceKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesHalfSlideUnlock_MinDistanceKey] floatValue] : 0.2) 33 | #define GetValueOf_HalfSlideUnlock_MaxDistance \ 34 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesHalfSlideUnlock_MaxDistanceKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesHalfSlideUnlock_MaxDistanceKey] floatValue] : 0.33) 35 | #define NoLoadSettingsWhenEnable_IsEnabled \ 36 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoLoadSettingsWhenEnableKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoLoadSettingsWhenEnableKey] boolValue] : NO) 37 | 38 | #define NoNotificationsForProtectedApps_IsEnabled \ 39 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationsForProtectedAppsKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationsForProtectedAppsKey] boolValue] : NO) 40 | #define NoNotificationTitleForProtectedApps_IsEnabled \ 41 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationTitleForProtectedAppsKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationTitleForProtectedAppsKey] boolValue] : YES) 42 | #define NoNotificationMessageForProtectedApps_IsEnabled \ 43 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationMessageForProtectedAppsKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationMessageForProtectedAppsKey] boolValue] : YES) 44 | #define NoNotificationSoundForProtectedApps_IsEnabled \ 45 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationSoundForProtectedAppsKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationSoundForProtectedAppsKey] boolValue] : NO) 46 | 47 | #define NoNotificationsForUnprotectedApps_IsEnabled \ 48 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationsForUnprotectedAppsKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationsForUnprotectedAppsKey] boolValue] : NO) 49 | #define NoNotificationTitleForUnprotectedApps_IsEnabled \ 50 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationTitleForUnprotectedAppsKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationTitleForUnprotectedAppsKey] boolValue] : NO) 51 | #define NoNotificationMessageForUnprotectedApps_IsEnabled \ 52 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationMessageForUnprotectedAppsKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationMessageForUnprotectedAppsKey] boolValue] : YES) 53 | #define NoNotificationSoundForUnprotectedApps_IsEnabled \ 54 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationSoundForUnprotectedAppsKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesNoNotificationSoundForUnprotectedAppsKey] boolValue] : NO) 55 | 56 | #define AutoEnable_IsEnabled \ 57 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesAutoEnableKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesAutoEnableKey] boolValue] : NO) 58 | 59 | #define EnablePassword_IsEnabled \ 60 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnablePasswordKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnablePasswordKey] boolValue] : NO) 61 | #define GetValueOf_Password \ 62 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesPasswordKey] ? : @"") 63 | #define HidePasswordAlertMessage_IsEnabled \ 64 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesHidePasswordAlertMessageKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesHidePasswordAlertMessageKey] boolValue] : NO) 65 | 66 | #define GetValueOf_DisabledFolders \ 67 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesDisabledFoldersKey] ? : nil) 68 | 69 | /* Options cross dylibs, another method is applied to get their preference value */ 70 | #define DisableAccessPhotos_IsEnabled \ 71 | ([[NSDictionary dictionaryWithContentsOfFile:@kPreferencesPath][kPIPreferencesDisableAccessPhotos] boolValue]) // Default value is NO. 72 | 73 | /********************************************* Hidden Options ****************************************************************/ 74 | #define DisableActivateAppSlider_IsEnabled \ 75 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesDisableActivateAppSliderKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesDisableActivateAppSliderKey] boolValue] : NO) 76 | #define EnableEditIcons_IsEnabled \ 77 | ([PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableEditIconsKey] ? [[PIPreferences.sharedPreferences objectForKey:kPIPreferencesEnableEditIconsKey] boolValue] : NO) 78 | /*****************************************************************************************************************************/ 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /protectidap/Makefile: -------------------------------------------------------------------------------- 1 | export ARCHS=armv7 arm64 2 | 3 | include $(THEOS)/makefiles/common.mk 4 | 5 | TWEAK_NAME = ProtectiDAP 6 | ProtectiDAP_FILES = Tweak.xm 7 | ProtectiDAP_LDFLAGS += -Wl,-segalign,4000 8 | 9 | include $(THEOS_MAKE_PATH)/tweak.mk 10 | 11 | after-install:: 12 | install.exec "killall -9 SpringBoard" 13 | -------------------------------------------------------------------------------- /protectidap/ProtectiDAP.plist: -------------------------------------------------------------------------------- 1 | { Filter = { Bundles = ( "com.apple.UIKit" ); }; } 2 | -------------------------------------------------------------------------------- /protectidap/Tweak.xm: -------------------------------------------------------------------------------- 1 | #import 2 | #include "../states.h" 3 | #include "../prefs.h" 4 | 5 | #import 6 | #import 7 | 8 | 9 | 10 | %hook MCProfileConnection 11 | 12 | - (_Bool)changePasscodeFrom:(id)arg1 to:(id)arg2 outError:(id *)arg3 { 13 | BOOL r = %orig; 14 | notify_post("com.gviridis.protectiplus/SystemPasscodeChanged"); 15 | return r; 16 | } 17 | 18 | %end 19 | 20 | 21 | 22 | %hook UIImagePickerController 23 | 24 | + (BOOL)isSourceTypeAvailable:(UIImagePickerControllerSourceType)sourceType { 25 | if (![getStateObjectForKey(@"enable") boolValue] || !DisableAccessPhotos_IsEnabled) { 26 | return %orig; 27 | } 28 | if (sourceType != UIImagePickerControllerSourceTypePhotoLibrary && sourceType != UIImagePickerControllerSourceTypeSavedPhotosAlbum) { 29 | return %orig; 30 | } 31 | return NO; 32 | } 33 | 34 | %end 35 | 36 | 37 | 38 | %hook ALAssetsLibrary 39 | 40 | + (ALAuthorizationStatus)authorizationStatus { 41 | ALAuthorizationStatus r = %orig; 42 | if (![getStateObjectForKey(@"enable") boolValue] || !DisableAccessPhotos_IsEnabled) { 43 | return r; 44 | } 45 | return ALAuthorizationStatusDenied; 46 | } 47 | 48 | /* Prevent TweetBot access last photo taken */ 49 | - (void)enumerateGroupsWithTypes:(ALAssetsGroupType)types usingBlock:(ALAssetsLibraryGroupsEnumerationResultsBlock)enumerationBlock failureBlock:(ALAssetsLibraryAccessFailureBlock)failureBlock { 50 | if (![getStateObjectForKey(@"enable") boolValue] || !DisableAccessPhotos_IsEnabled) { 51 | return %orig; 52 | } 53 | failureBlock(nil); 54 | } 55 | 56 | %end 57 | 58 | 59 | 60 | %hook PHPhotoLibrary 61 | 62 | + (PHAuthorizationStatus)authorizationStatus { 63 | PHAuthorizationStatus r = %orig; 64 | if (![getStateObjectForKey(@"enable") boolValue] || !DisableAccessPhotos_IsEnabled) { 65 | return r; 66 | } 67 | return PHAuthorizationStatusDenied; 68 | } 69 | 70 | %end 71 | 72 | 73 | 74 | %hook CAMCameraView 75 | 76 | - (BOOL)_shouldEnableImageWell { 77 | if (![getStateObjectForKey(@"enable") boolValue] || !DisableAccessPhotos_IsEnabled) { 78 | return %orig; 79 | } 80 | return NO; 81 | } 82 | 83 | - (BOOL)_shouldHideImageWellForMode:(int)arg1 { 84 | if (![getStateObjectForKey(@"enable") boolValue] || !DisableAccessPhotos_IsEnabled) { 85 | return %orig; 86 | } 87 | return YES; 88 | } 89 | 90 | %end 91 | 92 | 93 | 94 | @interface PSListController 95 | - (id)table; 96 | - (int)indexForIndexPath:(id)arg1; 97 | - (id)specifierAtIndex:(int)arg1; 98 | @end 99 | @interface PrefsListController : PSListController 100 | @end 101 | 102 | %hook PrefsListController 103 | 104 | - (void)tableView:(id)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 105 | if (![getStateObjectForKey(@"enable") boolValue] || !DisableAccessPhotos_IsEnabled) { 106 | return %orig; 107 | } 108 | id specifier = [self specifierAtIndex: [self indexForIndexPath: indexPath]]; 109 | if (![[specifier identifier] isEqualToString: @"Wallpaper"]) { 110 | return %orig; 111 | } 112 | [[self table] deselectRowAtIndexPath:indexPath animated:YES]; 113 | } 114 | 115 | %end 116 | -------------------------------------------------------------------------------- /protectiplusflipswitch/FSSwitchDataSource.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "FSSwitchState.h" 3 | 4 | @protocol FSSwitchDataSource 5 | @optional 6 | 7 | - (FSSwitchState)stateForSwitchIdentifier:(NSString *)switchIdentifier; 8 | // Gets the current state of the switch. 9 | // Must override if building a settings-like switch. 10 | // Return FSSwitchStateIndeterminate if switch is loading 11 | // By default returns FSSwitchStateIndeterminate 12 | 13 | - (void)applyState:(FSSwitchState)newState forSwitchIdentifier:(NSString *)switchIdentifier; 14 | // Sets the new state of the switch 15 | // Must override if building a settings-like switch. 16 | // By default calls through to applyActionForSwitchIdentifier: if newState is different from the current state 17 | 18 | - (void)applyActionForSwitchIdentifier:(NSString *)switchIdentifier; 19 | // Runs the default action for the switch. 20 | // Must override if building an action-like switch. 21 | // By default calls through to applyState:forSwitchIdentifier: if state is not indeterminate 22 | 23 | - (NSString *)titleForSwitchIdentifier:(NSString *)switchIdentifier; 24 | // Returns the localized title for the switch. 25 | // By default reads the CFBundleDisplayName out of the switch's bundle. 26 | 27 | - (BOOL)shouldShowSwitchIdentifier:(NSString *)switchIdentifier; 28 | // Returns wether the switch should be shown. 29 | // By default returns YES or the value from GraphicsServices for the capability specified in the "required-capability-key" of the switch's bundle 30 | // E.g. You would detect if the device has the required capability (3G, flash etc) 31 | 32 | - (id)glyphImageDescriptorOfState:(FSSwitchState)switchState size:(CGFloat)size scale:(CGFloat)scale forSwitchIdentifier:(NSString *)switchIdentifier; 33 | // Provide an image descriptor that best displays at the requested size and scale 34 | // By default looks through the bundle to find a glyph image 35 | 36 | - (NSBundle *)bundleForSwitchIdentifier:(NSString *)switchIdentifier; 37 | // Provides a bundle to look for localizations/images in 38 | // By default returns the bundle for the current class 39 | 40 | - (void)switchWasRegisteredForIdentifier:(NSString *)switchIdentifier; 41 | // Called when switch is first registered 42 | 43 | - (void)switchWasUnregisteredForIdentifier:(NSString *)switchIdentifier; 44 | // Called when switch is unregistered 45 | 46 | - (BOOL)hasAlternateActionForSwitchIdentifier:(NSString *)switchIdentifier; 47 | // Gets whether the switch supports an alternate or "hold" action 48 | // By default queries if switch responds to applyAlternateActionForSwitchIdentifier: or if it has a "alternate-action-url" key set 49 | 50 | - (void)applyAlternateActionForSwitchIdentifier:(NSString *)switchIdentifier; 51 | // Applies the alternate or "hold" action 52 | // By default launches the URL stored in the "alternate-action-url" key of the switch's bundle 53 | 54 | @end -------------------------------------------------------------------------------- /protectiplusflipswitch/FSSwitchPanel.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "FSSwitchState.h" 3 | 4 | @interface FSSwitchPanel : NSObject 5 | 6 | + (FSSwitchPanel *)sharedPanel; 7 | 8 | @property (nonatomic, readonly, copy) NSArray *switchIdentifiers; 9 | // Returns a list of identifying all switches installed on the device 10 | 11 | - (NSString *)titleForSwitchIdentifier:(NSString *)switchIdentifier; 12 | // Returns the localized title for a specific switch 13 | 14 | - (UIButton *)buttonForSwitchIdentifier:(NSString *)switchIdentifier usingTemplate:(NSBundle *)templateBundle; 15 | // Returns a UIButton for a specific switch 16 | // The button automatically updates its style based on the user interaction and switch state changes, applies the standard action when pressed, and applies the alternate action when held 17 | 18 | - (UIImage *)imageOfSwitchState:(FSSwitchState)state controlState:(UIControlState)controlState forSwitchIdentifier:(NSString *)switchIdentifier usingTemplate:(NSBundle *)templateBundle; 19 | - (UIImage *)imageOfSwitchState:(FSSwitchState)state controlState:(UIControlState)controlState scale:(CGFloat)scale forSwitchIdentifier:(NSString *)switchIdentifier usingTemplate:(NSBundle *)templateBundle; 20 | // Returns an image representing how a specific switch would look in a particular state when styled with the provided template 21 | 22 | - (id)glyphImageDescriptorOfState:(FSSwitchState)switchState size:(CGFloat)size scale:(CGFloat)scale forSwitchIdentifier:(NSString *)switchIdentifier; 23 | // Returns the raw glyph identifier as retrieved from the backing FSSwitch instance 24 | 25 | - (FSSwitchState)stateForSwitchIdentifier:(NSString *)switchIdentifier; 26 | // Returns the current state of a particualr switch 27 | - (void)setState:(FSSwitchState)state forSwitchIdentifier:(NSString *)switchIdentifier; 28 | // Updates the state of a particular switch. If the switch accepts the change it will send a state change 29 | - (void)applyActionForSwitchIdentifier:(NSString *)switchIdentifier; 30 | // Applies the default action of a particular switch 31 | 32 | - (BOOL)hasAlternateActionForSwitchIdentifier:(NSString *)switchIdentifier; 33 | // Queries whether a switch supports an alternate action. This is often triggered by a hold gesture 34 | - (void)applyAlternateActionForSwitchIdentifier:(NSString *)switchIdentifier; 35 | // Apply the alternate action of a particular switch 36 | 37 | - (void)openURLAsAlternateAction:(NSURL *)url; 38 | // Helper method to open a particular URL as if it were launched from an alternate action 39 | 40 | @end 41 | 42 | @protocol FSSwitchDataSource; 43 | 44 | @interface FSSwitchPanel (SpringBoard) 45 | - (void)registerDataSource:(id)dataSource forSwitchIdentifier:(NSString *)switchIdentifier; 46 | // Registers a switch implementation for a specific identifier. Bundlee in /Library/Switches will have their principal class automatically loaded 47 | - (void)unregisterSwitchIdentifier:(NSString *)switchIdentifier; 48 | // Unregisters a switch 49 | - (void)stateDidChangeForSwitchIdentifier:(NSString *)switchIdentifier; 50 | // Informs the system when a switch changes its state. This will trigger any switch buttons to update their style 51 | @end 52 | 53 | extern NSString * const FSSwitchPanelSwitchesChangedNotification; 54 | 55 | extern NSString * const FSSwitchPanelSwitchStateChangedNotification; 56 | extern NSString * const FSSwitchPanelSwitchIdentifierKey; 57 | 58 | extern NSString * const FSSwitchPanelSwitchWillOpenURLNotification; 59 | -------------------------------------------------------------------------------- /protectiplusflipswitch/FSSwitchState.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | typedef enum { 4 | FSSwitchStateOff = 0, 5 | FSSwitchStateOn = 1, 6 | FSSwitchStateIndeterminate = -1 7 | } FSSwitchState; 8 | 9 | extern NSString *NSStringFromFSSwitchState(FSSwitchState state); 10 | extern FSSwitchState FSSwitchStateFromNSString(NSString *stateString); 11 | -------------------------------------------------------------------------------- /protectiplusflipswitch/Makefile: -------------------------------------------------------------------------------- 1 | export ARCHS=armv7 arm64 2 | include $(THEOS)/makefiles/common.mk 3 | 4 | BUNDLE_NAME = ProtectiPlusFlipSwitch 5 | ProtectiPlusFlipSwitch_FILES = Switch.x 6 | ProtectiPlusFlipSwitch_FRAMEWORKS = UIKit 7 | ProtectiPlusFlipSwitch_LIBRARIES = flipswitch 8 | ProtectiPlusFlipSwitch_INSTALL_PATH = /Library/Switches 9 | ProtectiPlusFlipSwitch_LDFLAGS += -Wl,-segalign,4000 10 | 11 | include $(THEOS_MAKE_PATH)/bundle.mk 12 | -------------------------------------------------------------------------------- /protectiplusflipswitch/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ProtectiPlusFlipSwitch 9 | CFBundleIdentifier 10 | @PACKAGENAME@@ 11 | CFBundleDisplayName 12 | ProtectiPlusFlipSwitch 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | DTPlatformName 24 | iphoneos 25 | MinimumOSVersion 26 | 3.0 27 | NSPrincipalClass 28 | ProtectiPlusFlipSwitchSwitch 29 | alternate-action-url 30 | prefs: 31 | 32 | -------------------------------------------------------------------------------- /protectiplusflipswitch/Switch.x: -------------------------------------------------------------------------------- 1 | #import "FSSwitchDataSource.h" 2 | #import "FSSwitchPanel.h" 3 | 4 | #import 5 | #include "../states.h" 6 | 7 | @interface ProtectiPlusFlipSwitchSwitch : NSObject 8 | @end 9 | 10 | @implementation ProtectiPlusFlipSwitchSwitch 11 | 12 | - (FSSwitchState)stateForSwitchIdentifier:(NSString *)switchIdentifier 13 | { 14 | NSNumber *valueObj = [[NSDictionary dictionaryWithContentsOfFile:@kPreferencesStatePath] objectForKey:@"enable"]; 15 | if (valueObj) { 16 | if ([valueObj boolValue]) { 17 | return FSSwitchStateOn; 18 | } else { 19 | return FSSwitchStateOff; 20 | } 21 | } else { 22 | return FSSwitchStateIndeterminate; 23 | } 24 | } 25 | 26 | - (void)applyState:(FSSwitchState)newState forSwitchIdentifier:(NSString *)switchIdentifier 27 | { 28 | if (newState == FSSwitchStateIndeterminate) 29 | return; 30 | if (newState == FSSwitchStateOn) { 31 | EnableProtectiPlus; 32 | return; 33 | } 34 | if (newState == FSSwitchStateOff) { 35 | DisableProtectiPlus; 36 | return; 37 | } 38 | } 39 | 40 | - (NSString *)titleForSwitchIdentifier:(NSString *)switchIdentifier 41 | { 42 | return @"Protecti+"; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /protectiplussettings/Makefile: -------------------------------------------------------------------------------- 1 | export ARCHS=armv7 arm64 2 | include $(THEOS)/makefiles/common.mk 3 | 4 | BUNDLE_NAME = ProtectiPlusSettings 5 | ProtectiPlusSettings_FILES = ProtectiPlusSettings.mm ../PIPreferences.m 6 | ProtectiPlusSettings_INSTALL_PATH = /Library/PreferenceBundles 7 | ProtectiPlusSettings_LIBRARIES = applist MobileGestalt cephei 8 | ProtectiPlusSettings_FRAMEWORKS = UIKit Security 9 | ProtectiPlusSettings_PRIVATE_FRAMEWORKS = Preferences 10 | ProtectiPlusSettings_LDFLAGS += -Wl,-segalign,4000 11 | 12 | include $(THEOS_MAKE_PATH)/bundle.mk 13 | 14 | internal-stage:: 15 | $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END) 16 | $(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/ProtectiPlusSettings.plist$(ECHO_END) 17 | -------------------------------------------------------------------------------- /protectiplussettings/ProtectiPlusSettings.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | //#import 4 | #import 5 | #import 6 | //#import 7 | #import 8 | #import 9 | #import 10 | #import "../states.h" 11 | #import "../prefs.h" 12 | 13 | #define LOCAL(key) [bundle localizedStringForKey:key value:key table:nil] 14 | 15 | @interface ProtectiPlusSettingsListController: PSListController { 16 | } 17 | @end 18 | 19 | @implementation ProtectiPlusSettingsListController 20 | - (id)specifiers { 21 | if(_specifiers == nil) { 22 | if (!([[[NSDictionary dictionaryWithContentsOfFile:@kPreferencesStatePath] objectForKey:@"enable"] boolValue] && NoLoadSettingsWhenEnable_IsEnabled)) 23 | _specifiers = [[self loadSpecifiersFromPlistName:@"ProtectiPlusSettings" target:self] retain]; 24 | } 25 | return _specifiers; 26 | } 27 | 28 | -(void)setEnable:(id)enabled forSpecifier:(PSSpecifier*)spec { 29 | if ([enabled boolValue]) { 30 | notify_post("com.gviridis.protectiplus/Enable"); 31 | } else { 32 | notify_post("com.gviridis.protectiplus/Disable"); 33 | } 34 | } 35 | 36 | - (id)getEnabled { 37 | return getStateObjectForKey(@"enable"); 38 | } 39 | 40 | -(void)restoreDefaults { 41 | notify_post("com.gviridis.protectiplus/Disable"); 42 | notify_post("com.gviridis.protectiplus/ResetPreferences"); 43 | sleep(3); 44 | system("rm -f /var/mobile/Library/Preferences/com.gviridis.protectiplus.plist"); 45 | system("rm -f /var/mobile/Library/Preferences/com.gviridis.protectiplus.state.plist"); 46 | system("rm -f /var/mobile/Library/Preferences/com.gviridis.protectiplus.protectedapps.plist"); 47 | system("rm -f /var/mobile/Library/Preferences/com.gviridis.protectiplus.hiddenapps.plist"); 48 | } 49 | @end 50 | 51 | 52 | 53 | @interface ProtectiPlusSettingsListControllerForTutorial: PSListController { 54 | } 55 | @end 56 | 57 | @implementation ProtectiPlusSettingsListControllerForTutorial 58 | 59 | @end 60 | 61 | 62 | 63 | //@interface ProtectiPlusSettingsListControllerForProtectedMode: PSListController { 64 | //} 65 | //@end 66 | // 67 | //@implementation ProtectiPlusSettingsListControllerForProtectedMode 68 | // 69 | //@end 70 | 71 | 72 | 73 | @interface ProtectiPlusSettingsListControllerForChooseGestures: PSListController { 74 | } 75 | @end 76 | 77 | @implementation ProtectiPlusSettingsListControllerForChooseGestures 78 | 79 | @end 80 | 81 | 82 | 83 | @interface ProtectiPlusSettingsListControllerForProtectedAppNotifications: PSListController { 84 | } 85 | @end 86 | 87 | @implementation ProtectiPlusSettingsListControllerForProtectedAppNotifications 88 | - (id)specifiers { 89 | if(_specifiers == nil) { 90 | _specifiers = [[self loadSpecifiersFromPlistName:@"Protected App Notifications" target:self] retain]; 91 | } 92 | return _specifiers; 93 | } 94 | @end 95 | 96 | 97 | 98 | @interface ProtectiPlusSettingsListControllerForProtectedActions: PSListController { 99 | } 100 | @end 101 | 102 | @implementation ProtectiPlusSettingsListControllerForProtectedActions 103 | - (id)specifiers { 104 | if(_specifiers == nil) { 105 | _specifiers = [[self loadSpecifiersFromPlistName:@"Protected Actions" target:self] retain]; 106 | } 107 | return _specifiers; 108 | } 109 | @end 110 | 111 | 112 | 113 | @interface ProtectiPlusSettingsListControllerForHideAppIcons: PSListController { 114 | } 115 | @end 116 | 117 | @implementation ProtectiPlusSettingsListControllerForHideAppIcons 118 | 119 | @end 120 | 121 | 122 | 123 | //@interface ProtectiPlusSettingsListControllerForUnprotectedMode: PSListController { 124 | //} 125 | //@end 126 | // 127 | //@implementation ProtectiPlusSettingsListControllerForUnprotectedMode 128 | // 129 | //@end 130 | 131 | 132 | 133 | @interface ProtectiPlusSettingsListControllerForUnprotectedAppNotifications: PSListController { 134 | } 135 | @end 136 | 137 | @implementation ProtectiPlusSettingsListControllerForUnprotectedAppNotifications 138 | - (id)specifiers { 139 | if(_specifiers == nil) { 140 | _specifiers = [[self loadSpecifiersFromPlistName:@"Unprotected App Notifications" target:self] retain]; 141 | } 142 | return _specifiers; 143 | } 144 | @end 145 | 146 | 147 | 148 | @interface ProtectiPlusSettingsListControllerForIndicateMissingNotifications: PSListController { 149 | } 150 | @end 151 | 152 | @implementation ProtectiPlusSettingsListControllerForIndicateMissingNotifications 153 | 154 | @end 155 | 156 | 157 | 158 | @interface ProtectiPlusSettingsListControllerForVibrateAndIcon: PSListController { 159 | } 160 | @end 161 | 162 | @implementation ProtectiPlusSettingsListControllerForVibrateAndIcon 163 | - (id)specifiers { 164 | if(_specifiers == nil) { 165 | _specifiers = [[self loadSpecifiersFromPlistName:@"Vibrate & Icon" target:self] retain]; 166 | } 167 | return _specifiers; 168 | } 169 | @end 170 | 171 | 172 | /******************************** Advance *********************************/ 173 | 174 | 175 | @interface ProtectiPlusSettingsListControllerForAdvance: PSListController { 176 | } 177 | @end 178 | 179 | @implementation ProtectiPlusSettingsListControllerForAdvance 180 | - (id)specifiers { 181 | if(_specifiers == nil) { 182 | _specifiers = [[self loadSpecifiersFromPlistName:@"Advance" target:self] retain]; 183 | } 184 | return _specifiers; 185 | } 186 | @end 187 | 188 | 189 | 190 | @interface ProtectiPlusSettingsListControllerForPassword: PSListController { 191 | } 192 | @end 193 | 194 | @implementation ProtectiPlusSettingsListControllerForPassword 195 | 196 | @end 197 | 198 | 199 | 200 | @interface ProtectiPlusSettingsListControllerForBypassSystemPasscode: PSListController { 201 | } 202 | @end 203 | 204 | @implementation ProtectiPlusSettingsListControllerForBypassSystemPasscode 205 | 206 | @end 207 | 208 | 209 | 210 | @interface ProtectiPlusSettingsListControllerForDisableOpenFolders: PSListController { 211 | } 212 | @end 213 | 214 | @implementation ProtectiPlusSettingsListControllerForDisableOpenFolders 215 | 216 | @end 217 | 218 | 219 | 220 | @interface ProtectiPlusSettingsListControllerForHalfSlideUnlock: PSListController { 221 | } 222 | @end 223 | 224 | @implementation ProtectiPlusSettingsListControllerForHalfSlideUnlock 225 | 226 | @end 227 | 228 | 229 | 230 | @interface ProtectiPlusSettingsListControllerForPhotosAccess: PSListController { 231 | } 232 | @end 233 | 234 | @implementation ProtectiPlusSettingsListControllerForPhotosAccess 235 | // http://iphonedevwiki.net/index.php/PreferenceBundles#Loading_Preferences_into_sandboxed.2Funsandboxed_processes_in_iOS_8 236 | - (id)readPreferenceValue:(PSSpecifier *)specifier { 237 | NSDictionary *prefs = [NSDictionary dictionaryWithContentsOfFile:@kPreferencesPath]; 238 | if (!prefs[specifier.properties[@"key"]]) { 239 | return specifier.properties[@"default"]; 240 | } 241 | return prefs[specifier.properties[@"key"]]; 242 | } 243 | - (void)setPreferenceValue:(id)value specifier:(PSSpecifier*)specifier { 244 | NSMutableDictionary *defaults = [NSMutableDictionary dictionary]; 245 | [defaults addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile:@kPreferencesPath]]; 246 | [defaults setObject:value forKey:specifier.properties[@"key"]]; 247 | [defaults writeToFile:@kPreferencesPath atomically:YES]; 248 | CFStringRef toPost = (CFStringRef)specifier.properties[@"PostNotification"]; 249 | if(toPost) CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), toPost, NULL, NULL, YES); 250 | } 251 | @end 252 | 253 | 254 | 255 | 256 | /******************************** About *********************************/ 257 | 258 | 259 | @interface ProtectiPlusSettingsListControllerForAbout: PSListController { 260 | } 261 | @end 262 | 263 | @implementation ProtectiPlusSettingsListControllerForAbout 264 | - (id)specifiers { 265 | if(_specifiers == nil) { 266 | _specifiers = [[self loadSpecifiersFromPlistName:@"About" target:self] retain]; 267 | } 268 | return _specifiers; 269 | } 270 | 271 | - (NSString *) statusForSpecifier: (PSSpecifier *) specifier { 272 | return @"[[:"; 273 | } 274 | 275 | -(void)respring { 276 | system("killall -9 SpringBoard"); 277 | } 278 | 279 | - (void)contactWithAuthor { 280 | // [[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"cydia://package/com.gviridis.protectiplus"]]; 281 | [[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"cydia://package/org.thebigboss.protecti"]]; 282 | } 283 | 284 | - (void)openQuestionsAndAnswers { 285 | NSBundle *bundle = [NSBundle bundleWithPath:@"/Library/PreferenceBundles/ProtectiPlusSettings.bundle"]; 286 | [[UIApplication sharedApplication] openURL: [NSURL URLWithString:LOCAL(@"http://gviridis.com/protectiplus/questions_and_answers.html.en")]]; 287 | } 288 | 289 | @end 290 | 291 | // vim:ft=objc 292 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/About.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | footerText 11 | Jigsoar icons - handcrafted by Benjamin Humphrey for Jigsoar 12 | 13 | 14 | cell 15 | PSGroupCell 16 | footerText 17 | CONTACT_AUTHOR_FOOTERTEXT 18 | 19 | 20 | cell 21 | PSListItemCell 22 | action 23 | contactWithAuthor 24 | label 25 | Email Author 26 | 27 | 28 | title 29 | About 30 | 31 | 32 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Advance.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | footerText 11 | ADVANCE_FOOTERTEXT 12 | 13 | 14 | cell 15 | PSGroupCell 16 | 17 | 18 | cell 19 | PSLinkCell 20 | label 21 | Password 22 | detail 23 | ProtectiPlusSettingsListControllerForPassword 24 | 25 | 26 | cell 27 | PSLinkCell 28 | label 29 | Bypass System Passcode 30 | detail 31 | ProtectiPlusSettingsListControllerForBypassSystemPasscode 32 | 33 | 34 | cell 35 | PSLinkCell 36 | label 37 | Disable Open Folders 38 | detail 39 | ProtectiPlusSettingsListControllerForDisableOpenFolders 40 | 41 | 42 | cell 43 | PSLinkCell 44 | label 45 | Hide App Icons 46 | detail 47 | ProtectiPlusSettingsListControllerForHideAppIcons 48 | 49 | 50 | cell 51 | PSLinkCell 52 | label 53 | Half Slide Unlock 54 | detail 55 | ProtectiPlusSettingsListControllerForHalfSlideUnlock 56 | 57 | 58 | cell 59 | PSLinkCell 60 | label 61 | Photos Access 62 | detail 63 | ProtectiPlusSettingsListControllerForPhotosAccess 64 | 65 | 66 | cell 67 | PSGroupCell 68 | footerText 69 | NO_LOAD_PROTECTIPLUS_SETTINGS_FOOTERTEXT 70 | 71 | 72 | cell 73 | PSSwitchCell 74 | default 75 | 76 | defaults 77 | com.gviridis.protectiplus 78 | key 79 | noLoadSettingsWhenEnable 80 | label 81 | No Load Protecti+ Settings 82 | 83 | 84 | title 85 | Advance 86 | 87 | 88 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Bypass System Passcode.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | footerText 11 | BYPASS_SYSTEM_PASSCODE_FOOTERTEXT 12 | 13 | 14 | cell 15 | PSSwitchCell 16 | default 17 | 18 | defaults 19 | com.gviridis.protectiplus 20 | key 21 | enableBypassSystemPasscode 22 | label 23 | Bypass System Passcode 24 | 25 | 26 | title 27 | Bypass System Passcode 28 | 29 | 30 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Choose Gestures.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSLinkCell 10 | label 11 | Enable/Disable Protecti+ 12 | isController 13 | 14 | bundle 15 | LibActivator 16 | activatorListener 17 | com.gviridis.protectiplustoggleforactivator_toggle 18 | 19 | 20 | cell 21 | PSLinkCell 22 | label 23 | Enable Protecti+ 24 | isController 25 | 26 | bundle 27 | LibActivator 28 | activatorListener 29 | com.gviridis.protectiplustoggleforactivator_enable 30 | 31 | 32 | cell 33 | PSLinkCell 34 | label 35 | Disable Protecti+ 36 | isController 37 | 38 | bundle 39 | LibActivator 40 | activatorListener 41 | com.gviridis.protectiplustoggleforactivator_disable 42 | 43 | 44 | title 45 | Choose Gestures 46 | 47 | 48 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Disable Open Folders.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | footerText 11 | DISABLE_OPEN_FOLDERS_FOOTERTEXT 12 | 13 | 14 | cell 15 | PSEditTextCell 16 | default 17 | 18 | defaults 19 | com.gviridis.protectiplus 20 | key 21 | disabledFolders 22 | label 23 | Disabled Folders 24 | 25 | 26 | title 27 | Disable Open Folders 28 | 29 | 30 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Half Slide Unlock.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | footerText 11 | HALF_SLIDE_UNLOCK_FOOTER 12 | 13 | 14 | cell 15 | PSGroupCell 16 | 17 | 18 | cell 19 | PSSwitchCell 20 | default 21 | 22 | defaults 23 | com.gviridis.protectiplus 24 | key 25 | enableHalfSlideUnlock 26 | label 27 | Enable 28 | 29 | 30 | cell 31 | PSGroupCell 32 | footerText 33 | Minimum Half Slide Distance 34 | 35 | 36 | cell 37 | PSSliderCell 38 | default 39 | 0.2 40 | min 41 | 0.1 42 | max 43 | 0.9 44 | showValue 45 | 46 | defaults 47 | com.gviridis.protectiplus 48 | key 49 | halfSlideUnlock_MinDistance 50 | label 51 | Minimum Half Slide Distance 52 | 53 | 54 | cell 55 | PSGroupCell 56 | footerText 57 | Maximum Half Slide Distance 58 | 59 | 60 | cell 61 | PSSliderCell 62 | default 63 | 0.33 64 | min 65 | 0.15 66 | max 67 | 0.95 68 | showValue 69 | 70 | defaults 71 | com.gviridis.protectiplus 72 | key 73 | halfSlideUnlock_MaxDistance 74 | label 75 | Maximum Half Slide Distance 76 | 77 | 78 | cell 79 | PSGroupCell 80 | footerText 81 | HALF_SLIDE_UNLOCK_NOTICE 82 | 83 | 84 | title 85 | Half Slide Unlock 86 | 87 | 88 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Hide App Icons.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSSwitchCell 10 | default 11 | 12 | defaults 13 | com.gviridis.protectiplus 14 | key 15 | enableHideAppIcons 16 | label 17 | Enable 18 | 19 | 20 | cell 21 | PSGroupCell 22 | footerText 23 | CHOOSE_HIDDEN_APP_ICONS_FOOTERTEXT 24 | 25 | 26 | cell 27 | PSLinkCell 28 | bundle 29 | AppList 30 | isController 31 | 1 32 | label 33 | Choose Hidden App Icons 34 | ALChangeNotification 35 | com.gviridis.protectiplus/UpdatePreferences 36 | ALSettingsKeyPrefix 37 | HiddenApp_ 38 | ALSettingsPath 39 | /var/mobile/Library/Preferences/com.gviridis.protectiplus.hiddenapps.plist 40 | ALSingleEnabledMode 41 | 42 | 43 | 44 | title 45 | Hide App Icons 46 | 47 | 48 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Indicate Missing Notifications.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | footerText 11 | Missing notifications in protected mode will be indicated by highlighting corresponding App icons on Home Screen. 12 | 13 | 14 | cell 15 | PSSwitchCell 16 | default 17 | 18 | defaults 19 | com.gviridis.protectiplus 20 | key 21 | enableIndicateMissingNotification 22 | label 23 | Indicate Missing Notifications 24 | 25 | 26 | cell 27 | PSLinkListCell 28 | label 29 | Indicator Style 30 | detail 31 | PSListItemsController 32 | default 33 | 1 34 | key 35 | missingNotificationIndicatorStyle 36 | defaults 37 | com.gviridis.protectiplus 38 | validValues 39 | 40 | 1 41 | 2 42 | 3 43 | 44 | validTitles 45 | 46 | Tapped 47 | Shadow 48 | Glow 49 | 50 | 51 | 52 | title 53 | Notifications 54 | 55 | 56 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ProtectiPlusSettings 9 | CFBundleIdentifier 10 | com.gviridis.protectiplussettings 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | DTPlatformName 22 | iphoneos 23 | MinimumOSVersion 24 | 3.0 25 | NSPrincipalClass 26 | ProtectiPlusSettingsListController 27 | 28 | 29 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Password.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | footerText 11 | ENABLEPASSWORD_FOOTERTEXT 12 | 13 | 14 | cell 15 | PSSwitchCell 16 | default 17 | 18 | defaults 19 | com.gviridis.protectiplus 20 | key 21 | enablePassword 22 | label 23 | Enable Password 24 | 25 | 26 | cell 27 | PSGroupCell 28 | footerText 29 | PASSWORD_FOOTERTEXT 30 | 31 | 32 | cell 33 | PSSecureEditTextCell 34 | default 35 | 36 | defaults 37 | com.gviridis.protectiplus 38 | key 39 | password 40 | label 41 | Password 42 | 43 | 44 | cell 45 | PSGroupCell 46 | 47 | 48 | cell 49 | PSSwitchCell 50 | default 51 | 52 | defaults 53 | com.gviridis.protectiplus 54 | key 55 | hidePasswordAlertMessage 56 | label 57 | Hide Password Alert Message 58 | 59 | 60 | title 61 | Password 62 | 63 | 64 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Photos Access.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | footerText 11 | PHOTOS_ACCESS_FOOTERTEXT 12 | 13 | 14 | cell 15 | PSSwitchCell 16 | default 17 | 18 | defaults 19 | com.gviridis.protectiplus 20 | key 21 | disableAccessPhotos 22 | label 23 | Disable Apps Access Photos 24 | get 25 | readPreferenceValue: 26 | set 27 | setPreferenceValue:specifier: 28 | 29 | 30 | title 31 | Photos Access 32 | 33 | 34 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Protected Actions.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | footerText 11 | PROTECTED_ACTIONS_FOOTERTEXT 12 | 13 | 14 | cell 15 | PSGroupCell 16 | footerText 17 | ACCESS_NOTIFICATION_CENTER_FOOTERTEXT 18 | 19 | 20 | cell 21 | PSSwitchCell 22 | default 23 | 24 | defaults 25 | com.gviridis.protectiplus 26 | key 27 | allowAccessNotificationCenter 28 | label 29 | Access Notification Center 30 | 31 | 32 | cell 33 | PSGroupCell 34 | footerText 35 | ACCESS_CONTROL_CENTER_FOOTERTEXT 36 | 37 | 38 | cell 39 | PSSwitchCell 40 | default 41 | 42 | defaults 43 | com.gviridis.protectiplus 44 | key 45 | allowAccessControlCenter 46 | label 47 | Access Control Center 48 | 49 | 50 | title 51 | Protected Actions 52 | 53 | 54 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Protected App Notifications.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | footerText 11 | CUSTOMIZE_NOTIFICATION_FOOTERTEXT 12 | 13 | 14 | cell 15 | PSSwitchCell 16 | default 17 | 18 | defaults 19 | com.gviridis.protectiplus 20 | key 21 | noNotificationsForProtectedApps 22 | label 23 | No Notifications 24 | 25 | 26 | cell 27 | PSSwitchCell 28 | default 29 | 30 | defaults 31 | com.gviridis.protectiplus 32 | key 33 | noNotificationTitleForProtectedApps 34 | label 35 | No Notification Title 36 | 37 | 38 | cell 39 | PSSwitchCell 40 | default 41 | 42 | defaults 43 | com.gviridis.protectiplus 44 | key 45 | noNotificationMessageForProtectedApps 46 | label 47 | No Notification Message 48 | 49 | 50 | cell 51 | PSGroupCell 52 | 53 | 54 | cell 55 | PSSwitchCell 56 | default 57 | 58 | defaults 59 | com.gviridis.protectiplus 60 | key 61 | noNotificationSoundForProtectedApps 62 | label 63 | No Notification Sound 64 | 65 | 66 | cell 67 | PSGroupCell 68 | footerText 69 | BACKLIGHT_FOOTERTEXT 70 | 71 | 72 | cell 73 | PSSwitchCell 74 | default 75 | 76 | defaults 77 | com.gviridis.protectiplus 78 | key 79 | enableTurnOnBacklighWhenReceiveNewNotifications 80 | label 81 | Backlight for New Notifications 82 | 83 | 84 | title 85 | Protected App Notifications 86 | 87 | 88 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/ProtectiPlusSettings.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSLinkCell 10 | label 11 | Tutorial 12 | detail 13 | ProtectiPlusSettingsListControllerForTutorial 14 | 15 | 16 | cell 17 | PSGroupCell 18 | 19 | 20 | cell 21 | PSSwitchCell 22 | default 23 | 24 | defaults 25 | com.gviridis.protectiplus.state 26 | set 27 | setEnable:forSpecifier: 28 | key 29 | enable 30 | get 31 | getEnabled 32 | label 33 | Enable 34 | 35 | 36 | cell 37 | PSGroupCell 38 | 39 | 40 | cell 41 | PSLinkCell 42 | bundle 43 | AppList 44 | isController 45 | 1 46 | label 47 | Choose Protected Apps 48 | ALChangeNotification 49 | com.gviridis.protectiplus/UpdatePreferences 50 | ALSettingsKeyPrefix 51 | ProtectedApp_ 52 | ALSettingsPath 53 | /var/mobile/Library/Preferences/com.gviridis.protectiplus.protectedapps.plist 54 | ALSingleEnabledMode 55 | 56 | 57 | 58 | cell 59 | PSLinkCell 60 | label 61 | Choose Gestures 62 | detail 63 | ProtectiPlusSettingsListControllerForChooseGestures 64 | 65 | 66 | cell 67 | PSGroupCell 68 | 69 | 70 | cell 71 | PSLinkCell 72 | label 73 | Protected App Notifications 74 | detail 75 | ProtectiPlusSettingsListControllerForProtectedAppNotifications 76 | 77 | 78 | cell 79 | PSLinkCell 80 | label 81 | Unprotected App Notifications 82 | detail 83 | ProtectiPlusSettingsListControllerForUnprotectedAppNotifications 84 | 85 | 86 | cell 87 | PSLinkCell 88 | label 89 | Protected Actions 90 | detail 91 | ProtectiPlusSettingsListControllerForProtectedActions 92 | 93 | 94 | cell 95 | PSGroupCell 96 | 97 | 98 | cell 99 | PSLinkCell 100 | label 101 | Vibrate & Icon 102 | detail 103 | ProtectiPlusSettingsListControllerForVibrateAndIcon 104 | 105 | 106 | cell 107 | PSLinkCell 108 | label 109 | Advance 110 | detail 111 | ProtectiPlusSettingsListControllerForAdvance 112 | 113 | 114 | cell 115 | PSGroupCell 116 | 117 | 118 | cell 119 | PSButtonCell 120 | defaults 121 | com.gviridis.protectiplus.state 122 | action 123 | restoreDefaults 124 | label 125 | Restore Defaults 126 | confirmation 127 | 128 | title 129 | RESTORE_DEFAULTS_CONFIRMATION_TITLE 130 | prompt 131 | RESTORE_DEFAULTS_CONFIRMATION_PROMPT 132 | okTitle 133 | Ok 134 | cancelTitle 135 | Cancel 136 | 137 | 138 | 139 | cell 140 | PSGroupCell 141 | 142 | 143 | cell 144 | PSLinkCell 145 | label 146 | About 147 | detail 148 | ProtectiPlusSettingsListControllerForAbout 149 | 150 | 151 | title 152 | Protecti+ 153 | 154 | 155 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/ProtectiPlusSettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplussettings/Resources/ProtectiPlusSettings.png -------------------------------------------------------------------------------- /protectiplussettings/Resources/ProtectiPlusSettings@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplussettings/Resources/ProtectiPlusSettings@2x.png -------------------------------------------------------------------------------- /protectiplussettings/Resources/Tutorial.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | footerText 11 | STEP_ONE 12 | 13 | 14 | cell 15 | PSGroupCell 16 | 17 | 18 | cell 19 | PSLinkCell 20 | bundle 21 | AppList 22 | isController 23 | 1 24 | label 25 | Choose Protected Apps 26 | ALChangeNotification 27 | com.gviridis.protectiplus/UpdatePreferences 28 | ALSettingsKeyPrefix 29 | ProtectedApp_ 30 | ALSettingsPath 31 | /var/mobile/Library/Preferences/com.gviridis.protectiplus.plist 32 | ALSingleEnabledMode 33 | 34 | 35 | 36 | cell 37 | PSGroupCell 38 | footerText 39 | STEP_TWO 40 | 41 | 42 | cell 43 | PSGroupCell 44 | 45 | 46 | cell 47 | PSLinkCell 48 | label 49 | Choose Gestures 50 | detail 51 | ProtectiPlusSettingsListControllerForChooseGestures 52 | 53 | 54 | cell 55 | PSGroupCell 56 | footerText 57 | STEP_THREE 58 | 59 | 60 | cell 61 | PSGroupCell 62 | footerText 63 | STEP_NOW 64 | 65 | 66 | cell 67 | PSGroupCell 68 | footerText 69 | STEP_MORE 70 | 71 | 72 | title 73 | Tutorial 74 | 75 | 76 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Unprotected App Notifications.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSSwitchCell 10 | default 11 | 12 | defaults 13 | com.gviridis.protectiplus 14 | key 15 | noNotificationsForUnprotectedApps 16 | label 17 | No Notifications 18 | 19 | 20 | cell 21 | PSSwitchCell 22 | default 23 | 24 | defaults 25 | com.gviridis.protectiplus 26 | key 27 | noNotificationTitleForUnprotectedApps 28 | label 29 | No Notification Title 30 | 31 | 32 | cell 33 | PSSwitchCell 34 | default 35 | 36 | defaults 37 | com.gviridis.protectiplus 38 | key 39 | noNotificationMessageForUnprotectedApps 40 | label 41 | No Notification Message 42 | 43 | 44 | cell 45 | PSSwitchCell 46 | default 47 | 48 | defaults 49 | com.gviridis.protectiplus 50 | key 51 | noNotificationSoundForUnprotectedApps 52 | label 53 | No Notification Sound 54 | 55 | 56 | title 57 | Unprotected App Notifications 58 | 59 | 60 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/Vibrate & Icon.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | footerText 11 | VIBRATE_FOOTERTEXT 12 | 13 | 14 | cell 15 | PSSwitchCell 16 | default 17 | 18 | defaults 19 | com.gviridis.protectiplus 20 | key 21 | enableVibrate 22 | label 23 | Vibrate 24 | 25 | 26 | cell 27 | PSGroupCell 28 | footerText 29 | STATUS_BAR_ICON_FOOTERTEXT 30 | 31 | 32 | cell 33 | PSSwitchCell 34 | default 35 | 36 | defaults 37 | com.gviridis.protectiplus 38 | key 39 | enableStatusBarIcon 40 | label 41 | Status Bar Icon 42 | 43 | 44 | title 45 | Vibrate & Icon 46 | 47 | 48 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/About.strings: -------------------------------------------------------------------------------- 1 | "REGISTER_STATUS_FOOTERTEXT" = "If unregistered, Protecti+ may not be able to be turned on, but other features works. 2 | Register requires Internet access. 3 | Tap Respring(reboot) button below to register if Internet is available."; 4 | "REGISTER_STATUS_CONFIRMATION_TITLE" = "Respring?"; 5 | "REGISTER_STATUS_CONFIRMATION_PROMPT" = "Similar to reboot but quicker."; 6 | "QUESTIONS_AND_ANSWERS_FOOTERTEXT" = "Open Q&A in Safari"; 7 | "CONTACT_AUTHOR_FOOTERTEXT" = "Follow the link and tap Author gviridis to email me. 8 | Any questions are welcome."; -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/Advance.strings: -------------------------------------------------------------------------------- 1 | "ADVANCE_FOOTERTEXT" = "Before you change these settings, make sure you know how to enter Safe Mode, because maybe you will not be able to disable Protecti+ and come back."; 2 | "AUTO_ENABLE_FOOTERTEXT" = "Auto enable Protecti+ when device is locked."; 3 | "NO_LOAD_PROTECTIPLUS_SETTINGS_FOOTERTEXT" = "Turn on to disable loading Protecti+ settings when Protecti+ enabled. 4 | NOTICE: 5 | Make sure you can turn off Protecti+ by gesture before you enable this feature."; 6 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/Bypass System Passcode.strings: -------------------------------------------------------------------------------- 1 | "BYPASS_SYSTEM_PASSCODE_FOOTERTEXT" = "Protecti+ depends on Mobile Substrate, so anyone can disable Protecti+ entirely by holding down Volume Up as device boots. To protect your privacy, you may prefer set system passcode in Application Settings -> General -> Passcode Lock. However, it is so boring to enter passcode every time. Now, you can enable Bypass Passcode to avoid doing this and just let Protecti+ protect your device. This feature is implemented carefully, every time you reboot device you have to enter passcode at the first time, and remote lock by Find My iPhone also causes the need to input passcode."; -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/Disable Open Folders.strings: -------------------------------------------------------------------------------- 1 | "DISABLE_OPEN_FOLDERS_FOOTERTEXT" = "Folder Names separated by semicolon. e.g. \"FolderName1;FolderName2;FolderName3\" (no quotation marks, no space after semicolon)"; 2 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/Half Slide Unlock.strings: -------------------------------------------------------------------------------- 1 | "HALF_SLIDE_UNLOCK_FOOTER" = "This is a special way to enable/disable Protecti+. 2 | It depends on your unlock action - swipe action distance on screen."; 3 | "HALF_SLIDE_UNLOCK_NOTICE" = "NOTICE: 4 | Always unlock with Protecti+ enabled if set Minimum Slide Distance MORE THAN Maximum Slide Distance. Make sure you know how to disable Protecti+ before do this."; -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/Hide App Icons.strings: -------------------------------------------------------------------------------- 1 | "CHOOSE_HIDDEN_APP_ICONS_FOOTERTEXT" = "Hide these Apps' icons on Home Screen when Protecti+ enabled."; -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "WELCOME_TITLE" = "Thanks for installing Protecti+"; 2 | "WELCOME_MESSAGE" = "Click Tutorial for a simple setup now or find it in Settings app later."; 3 | "WELCOME_DISMISS" = "Later"; 4 | "WELCOME_SETTINGS" = "Tutorial"; 5 | "PASSWORD_ALERT_TITLE" = "Protecti+"; 6 | "PASSWORD_ALERT_MESSAGE" = "Please input password"; 7 | "PASSWORD_ALERT_DISMISS" = "Cancel"; 8 | "NEED_REGISTER_FOOTERTEXT" = "Please check Register Status in About."; 9 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/Password.strings: -------------------------------------------------------------------------------- 1 | "ENABLEPASSWORD_FOOTERTEXT" = "Turn on to require password when disable Protecti+."; 2 | "PASSWORD_FOOTERTEXT" = "If password only includes numbers, input password keyboard will be number pad."; -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/Photos Access.strings: -------------------------------------------------------------------------------- 1 | "PHOTOS_ACCESS_FOOTERTEXT" = "Turn ON this to DISABLE apps access your photos when Protecti+ enabled. 2 | 3 | NOTICE: Apps may have accessed and saved photos before Protecti+ enabled."; 4 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/Protected Actions.strings: -------------------------------------------------------------------------------- 1 | "PROTECTED_ACTIONS_FOOTERTEXT" = "When Protecti+ is enabled, these actions will be invalid: 2 | 3 | - Launch Protected Apps From Icons (in home screen or Control Center) and URL. 4 | - Edit App Icons (Move or Delete) 5 | - Swipe Down to Show Search iPhone 6 | - Hold Down Menu Button to Call Siri 7 | - Swipe left or right between apps 8 | 9 | App Switcher is valid, but will quit protected applications when launch app switcher. 10 | 11 | Lock Screen Camera is also valid, but only photos taken after enable Protecti+ can be accessed."; 12 | "ACCESS_NOTIFICATION_CENTER_FOOTERTEXT" = "Allow access Notification Center when Protecti+ is enabled."; 13 | "ACCESS_CONTROL_CENTER_FOOTERTEXT" = "Allow access Control Center when Protecti+ is enabled."; 14 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/Protected App Notifications.strings: -------------------------------------------------------------------------------- 1 | "CUSTOMIZE_NOTIFICATION_FOOTERTEXT" = "These settings work on alert, banner and lockscreen notifications when Protecti+ enabled. 2 | App icon badges will always be hidden when Protecti+ is enabled."; 3 | "BACKLIGHT_FOOTERTEXT" = "Turn on screen with backlight to indicate new notifications if you set No Notifications."; -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/ProtectiPlusSettings.strings: -------------------------------------------------------------------------------- 1 | "RESTORE_DEFAULTS_CONFIRMATION_TITLE" = "Restore Defaults?"; 2 | "RESTORE_DEFAULTS_CONFIRMATION_PROMPT" = "Needs three seconds. \nRestart Settings if no effect."; 3 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/Tutorial.strings: -------------------------------------------------------------------------------- 1 | "STEP_ONE" = "Step 1: Choose the apps you want to protect."; 2 | "STEP_TWO" = "Step 2: Choose a gesture used to enable or disable Protecti+."; 3 | "STEP_THREE" = "Step 3: Before you make the gesture to enable Protecti+, don't forget you can disable Protecti+ by the same gesture. 4 | NOTICE: if you choose Settings as protected app, you will exit this tutorial and can not come back. Don't worry. Just make the same gesture and then tap Settings."; 5 | "STEP_NOW" = "Now, use the gesture you set up and go see what's changed."; 6 | "STEP_MORE" = "More features and details, Settings -> Protecti+."; 7 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/en.lproj/Vibrate & Icon.strings: -------------------------------------------------------------------------------- 1 | "VIBRATE_FOOTERTEXT" = "Vibrate when enable/disable Protecti+ 2 | Settings Sounds Vibrate required"; 3 | "STATUS_BAR_ICON_FOOTERTEXT" = "Status bar icon when enable Protecti+ 4 | It is a tiny black/white dot. 5 | The icon file is located at /System/Library/Frameworks/UIKit.framework/"; -------------------------------------------------------------------------------- /protectiplussettings/Resources/public_key.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplussettings/Resources/public_key.der -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/About.strings: -------------------------------------------------------------------------------- 1 | "Register Status" = "注册状态"; 2 | "REGISTER_STATUS_FOOTERTEXT" = "如果未注册,Protecti+可能无法开启,其它功能正常。 3 | 注册需要联网完成。 4 | 如果网络可用,请点击下面的Respring(重启)按钮完成注册。"; 5 | "REGISTER_STATUS_CONFIRMATION_TITLE" = "Respring?"; 6 | "REGISTER_STATUS_CONFIRMATION_PROMPT" = "Respring类似于重启,但是比重启快。"; 7 | "Cancel" = "取消"; 8 | "QUESTIONS_AND_ANSWERS_FOOTERTEXT" = "在Safari中打开常见问题"; 9 | "Q & A" = "常见问题"; 10 | "CONTACT_AUTHOR_FOOTERTEXT" = "点击后在打开的Cydia页面中点击作者gviridis给我发送邮件。 11 | 欢迎任何问题和建议。"; 12 | "Email Author" = "联系作者"; -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Advance.strings: -------------------------------------------------------------------------------- 1 | "ADVANCE_FOOTERTEXT" = "修改这些设置之前,请确保您了解如何进入安全模式,因为您有可能无法关闭Protecti+并回来修改这些设置。 2 | 关于 -> 常见问题 获取更多细节。"; 3 | "AUTO_ENABLE_FOOTERTEXT" = "锁定屏幕时自动开启Protecti+。"; 4 | "Auto Enable" = "锁屏自动启用"; 5 | "Password" = "密码"; 6 | "Bypass System Passcode" = "绕过系统密码"; 7 | "Disable Open Folders" = "禁止打开文件夹"; 8 | "Hide App Icons" = "隐藏应用图标"; 9 | "Half Slide Unlock" = "半滑动解锁"; 10 | "Photos Access" = "访问照片库"; 11 | "NO_LOAD_PROTECTIPLUS_SETTINGS_FOOTERTEXT" = "如果启用该选项,开启Protecti+后将不加载Protecti+的设置选项。 12 | 注意: 13 | 启用该选项之前请确保您能够通过手势关闭Protecti+。"; 14 | "No Load Protecti+ Settings" = "禁止加载Protecti+设置选项"; 15 | "Advance" = "高级设置"; -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Bypass System Passcode.strings: -------------------------------------------------------------------------------- 1 | "BYPASS_SYSTEM_PASSCODE_FOOTERTEXT" = "Protecti+依赖于Mobile Substrate,所以任何人都可以通过在设备启动时长按音量增加键进入安全模式,从而彻底地禁用Protecti+。为了保护您的隐私,您可能会在设置->通用->密码锁定中设置系统密码。然而,频繁地输入密码是一件很烦人的事情。现在,通过Protecti+,您可以启用绕过密码功能,从而避免这样的事情。既保证了安全模式下有系统密码保护,又避免了正常情况下频繁地输入密码,仅仅是让Protecti+来保护您的隐私。该功能的实现很谨慎,每次重启设备后您都需要输入一次密码;通过“查找我的 iPhone”激活锁定也会要求输入密码。"; 2 | "Bypass System Passcode" = "绕过系统密码"; -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Choose Gestures.strings: -------------------------------------------------------------------------------- 1 | "Enable/Disable Protecti+" = "开启或者关闭Protecti+"; 2 | "Enable Protecti+" = "开启Protecti+"; 3 | "Disable Protecti+" = "关闭Protecti+"; 4 | "Choose Gestures" = "选择手势"; -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Disable Open Folders.strings: -------------------------------------------------------------------------------- 1 | "DISABLE_OPEN_FOLDERS_FOOTERTEXT" = "请用英文分号分割文件夹名称 例如:“文件夹1;文件夹2;文件夹3”(请去掉引号,分号后无空格)。"; 2 | "Disabled Folders" = "禁止打开的文件夹"; 3 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Half Slide Unlock.strings: -------------------------------------------------------------------------------- 1 | "HALF_SLIDE_UNLOCK_FOOTER" = "这是一种特别的开启/关闭Protecti+的方法。 2 | 该方法判断滑动解锁时手指在屏幕上的横向移动距离,如果在有效范围内,则解锁屏幕并关闭Protecti+;如果不在有效范围内,则解锁屏幕并开启Protecti+。"; 3 | "Enable" = "启用"; 4 | "Minimum Half Slide Distance" = "半滑动最小有效距离"; 5 | "Maximum Half Slide Distance" = "半滑动最大有效距离"; 6 | "HALF_SLIDE_UNLOCK_NOTICE" = "注意: 7 | 您可以将半滑动最小有效距离设置为大于半滑动最大有效距离的值,这样无论怎样滑动解锁都会开启Protecti+,实现了解锁自动开启Protecti+的效果。在做此修改之前,请确保您了解如何关闭Protecti+。"; 8 | "Half Slide Unlock" = "半滑动解锁"; -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Hide App Icons.strings: -------------------------------------------------------------------------------- 1 | "Enable" = "启用"; 2 | "CHOOSE_HIDDEN_APP_ICONS_FOOTERTEXT" = "开启Protecti+后,被选择的应用将不会在主屏幕上显示图标。"; 3 | "Choose Hidden App Icons" = "选择需要隐藏图标的应用"; 4 | "Hide App Icons" = "隐藏应用图标"; -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "WELCOME_TITLE" = "感谢您选择Protecti+"; 2 | "WELCOME_MESSAGE" = "快速设置或者稍后在“设置”应用中进行配置。"; 3 | "WELCOME_DISMISS" = "稍后"; 4 | "WELCOME_SETTINGS" = "快速设置"; 5 | "http://gviridis.com/protectiplus/questions_and_answers.html.en" = "http://gviridis.com/protectiplus/questions_and_answers.html.cn"; 6 | "PASSWORD_ALERT_TITLE" = "Protecti+"; 7 | "PASSWORD_ALERT_MESSAGE" = "请输入密码"; 8 | "PASSWORD_ALERT_DISMISS" = "取消"; 9 | "Registered" = "已注册"; 10 | "Unregistered" = "未注册"; 11 | "NEED_REGISTER_FOOTERTEXT" = "请在Protecti+设置->关于中检查注册状态。"; 12 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Password.strings: -------------------------------------------------------------------------------- 1 | "ENABLEPASSWORD_FOOTERTEXT" = "禁用Protecti+时需要输入密码。"; 2 | "Enable Password" = "启用密码"; 3 | "PASSWORD_FOOTERTEXT" = "如果密码只包括数字,密码输入键盘将会采用数字键盘。"; 4 | "Password" = "密码"; 5 | "Hide Password Alert Message" = "隐藏密码输入界面提示信息"; 6 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Photos Access.strings: -------------------------------------------------------------------------------- 1 | "PHOTOS_ACCESS_FOOTERTEXT" = "启用该选项,开启Protecti+时将禁止应用程序访问您的照片库。 2 | 3 | 注意:在开启Protecti+之前,某些应用程序可能已经访问并保存了照片。"; 4 | "Disable Apps Access Photos" = "禁止应用程序访问照片库"; 5 | "Photos Access" = "访问照片库"; 6 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Protected Actions.strings: -------------------------------------------------------------------------------- 1 | "PROTECTED_ACTIONS_FOOTERTEXT" = "开启Protecti+时,下列操作将会被禁止: 2 | 3 | - 通过点击图标或链接运行被保护的应用 4 | - 移动或者删除主屏幕图标 5 | - 下滑打开搜索栏 6 | - 长按主屏幕按钮打开Siri 7 | - 左右推送来切换应用程序 8 | 9 | 多任务栏仍然可以打开,但是打开时会关闭被保护的程序。 10 | 11 | 锁屏相机仍然可以打开,但是只能访问开启Protecti+之后的照片。"; 12 | "ACCESS_NOTIFICATION_CENTER_FOOTERTEXT" = "允许在开启Protecti+的情况下打开通知中心。"; 13 | "Access Notification Center" = "允许打开通知中心"; 14 | "ACCESS_CONTROL_CENTER_FOOTERTEXT" = "允许在开启Protecti+的情况下打开控制中心。"; 15 | "Access Control Center" = "允许打开控制中心"; 16 | "Protected Actions" = "受保护的操作"; -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Protected App Notifications.strings: -------------------------------------------------------------------------------- 1 | "CUSTOMIZE_NOTIFICATION_FOOTERTEXT" = "开启Protecti+时,这些设置对提醒通知、横幅通知和锁屏通知有效。 2 | 开启Protecti+时,应用程序图标标记总是不显示。"; 3 | "No Notifications" = "不显示通知"; 4 | "No Notification Title" = "不显示通知标题"; 5 | "No Notification Message" = "不显示通知内容"; 6 | "No Notification Sound" = "不发出通知声音提醒"; 7 | "BACKLIGHT_FOOTERTEXT" = "如果设置了不显示通知,开启该选项会在收到新消息时点亮屏幕。"; 8 | "Backlight for New Notifications" = "收到新消息时点亮屏幕"; 9 | "Protected App Notifications" = "受保护应用的通知"; -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/ProtectiPlusSettings.strings: -------------------------------------------------------------------------------- 1 | "Tutorial" = "快速设置"; 2 | "Enable" = "启用"; 3 | "Choose Protected Apps" = "选择要保护的应用"; 4 | "Choose Gestures" = "选择手势"; 5 | "Protected App Notifications" = "受保护应用的通知"; 6 | "Unprotected App Notifications" = "不受保护应用的通知"; 7 | "Protected Actions" = "受保护的操作"; 8 | "Vibrate & Icon" = "振动和图标"; 9 | "Advance" = "高级设置"; 10 | "Restore Defaults" = "恢复默认值"; 11 | "RESTORE_DEFAULTS_CONFIRMATION_TITLE" = "恢复默认值?"; 12 | "RESTORE_DEFAULTS_CONFIRMATION_PROMPT" = "需要三秒,如果无效请关闭设置然后重新打开。"; 13 | "Cancel" = "取消"; 14 | "About" = "关于"; 15 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Tutorial.strings: -------------------------------------------------------------------------------- 1 | "STEP_ONE" = "第一步:选择需要保护的应用"; 2 | "Choose Protected Apps" = "选择要保护的应用"; 3 | "STEP_TWO" = "第二步:选择一个手势用来开启或者关闭Protecti+。"; 4 | "Choose Gestures" = "选择手势"; 5 | "STEP_THREE" = "第三步:在做手势之前,请记住,关闭Protecti+也用这个手势。 6 | 注意:如果当前应用是被保护的应用,通过手势启用Protecti+之后将无法返回这里。不要担心,使用相同的手势关闭Protecti+即可。"; 7 | "STEP_NOW" = "现在,使用刚刚设置的手势,看看设备和之前有什么不同。"; 8 | "STEP_MORE" = "更多功能,设置 -> Protecti+。"; 9 | "Tutorial" = "快速设置"; 10 | -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Unprotected App Notifications.strings: -------------------------------------------------------------------------------- 1 | "No Notifications" = "不显示通知"; 2 | "No Notification Title" = "不显示通知标题"; 3 | "No Notification Message" = "不显示通知内容"; 4 | "No Notification Sound" = "不发出通知声音提醒"; 5 | "Unprotected App Notifications" = "不受保护应用的通知"; -------------------------------------------------------------------------------- /protectiplussettings/Resources/zh_CN.lproj/Vibrate & Icon.strings: -------------------------------------------------------------------------------- 1 | "VIBRATE_FOOTERTEXT" = "开启或者关闭Protecti+时振动 2 | 设置->声音->振动 需要开启"; 3 | "Vibrate" = "振动"; 4 | "STATUS_BAR_ICON_FOOTERTEXT" = "开启Protecti+时显示状态栏图标 5 | 这个图标是一个非常小的黑白点 6 | 图标文件位于/System/Library/Frameworks/UIKit.framework/"; 7 | "Status Bar Icon" = "状态栏图标"; 8 | "Vibrate & Icon" = "振动和图标"; -------------------------------------------------------------------------------- /protectiplussettings/entry.plist: -------------------------------------------------------------------------------- 1 | { 2 | entry = { 3 | bundle = ProtectiPlusSettings; 4 | cell = PSLinkCell; 5 | icon = "ProtectiPlusSettings.png"; 6 | detail = "ProtectiPlusSettingsListController"; 7 | isController = 1; 8 | label = "Protecti+"; 9 | }; 10 | } -------------------------------------------------------------------------------- /protectiplustoggleforactivator/Makefile: -------------------------------------------------------------------------------- 1 | ARCHS=armv7 arm64 2 | 3 | include $(THEOS)/makefiles/common.mk 4 | 5 | TWEAK_NAME = protectiplustoggleforactivator 6 | protectiplustoggleforactivator_FILES = Tweak.xm 7 | protectiplustoggleforactivator_LIBRARIES = activator 8 | protectiplustoggleforactivator_LDFLAGS += -Wl,-segalign,4000 9 | 10 | include $(THEOS_MAKE_PATH)/tweak.mk 11 | -------------------------------------------------------------------------------- /protectiplustoggleforactivator/Tweak.xm: -------------------------------------------------------------------------------- 1 | #import 2 | #import "../states.h" 3 | #import 4 | #include 5 | 6 | @interface ProtectiLAListener_Toggle : NSObject { } 7 | @end 8 | 9 | @implementation ProtectiLAListener_Toggle 10 | 11 | - (void)activator:(LAActivator *)activator receiveEvent:(LAEvent *)event 12 | { 13 | ToggleProtectiPlus; 14 | [event setHandled:YES]; // To prevent the default OS implementation 15 | } 16 | 17 | - (void)activator:(LAActivator *)activator abortEvent:(LAEvent *)event 18 | { 19 | // Dismiss your plugin 20 | } 21 | 22 | + (void)load 23 | { 24 | [[LAActivator sharedInstance] registerListener:[self new] forName:@"com.gviridis.protectiplustoggleforactivator_toggle"]; 25 | } 26 | 27 | @end 28 | 29 | 30 | 31 | @interface ProtectiLAListener_Enable : NSObject { } 32 | @end 33 | 34 | @implementation ProtectiLAListener_Enable 35 | 36 | - (void)activator:(LAActivator *)activator receiveEvent:(LAEvent *)event 37 | { 38 | EnableProtectiPlus; 39 | [event setHandled:YES]; // To prevent the default OS implementation 40 | } 41 | 42 | - (void)activator:(LAActivator *)activator abortEvent:(LAEvent *)event 43 | { 44 | // Dismiss your plugin 45 | } 46 | 47 | + (void)load 48 | { 49 | [[LAActivator sharedInstance] registerListener:[self new] forName:@"com.gviridis.protectiplustoggleforactivator_enable"]; 50 | } 51 | 52 | @end 53 | 54 | 55 | 56 | @interface ProtectiLAListener_Disable : NSObject { } 57 | @end 58 | 59 | @implementation ProtectiLAListener_Disable 60 | 61 | - (void)activator:(LAActivator *)activator receiveEvent:(LAEvent *)event 62 | { 63 | DisableProtectiPlus; 64 | [event setHandled:YES]; // To prevent the default OS implementation 65 | } 66 | 67 | - (void)activator:(LAActivator *)activator abortEvent:(LAEvent *)event 68 | { 69 | // Dismiss your plugin 70 | } 71 | 72 | + (void)load 73 | { 74 | [[LAActivator sharedInstance] registerListener:[self new] forName:@"com.gviridis.protectiplustoggleforactivator_disable"]; 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /protectiplustoggleforactivator/layout/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Package: com.gviridis.protectiplustoggleforactivator 2 | Name: protectiplustoggleforactivator 3 | Depends: mobilesubstrate 4 | Version: 1.0.0 5 | Architecture: iphoneos-arm 6 | Description: Protecti+ toggle for Activator 7 | Maintainer: gviridis 8 | Author: gviridis 9 | Section: Tweaks 10 | -------------------------------------------------------------------------------- /protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_disable/Icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_disable/Icon-small.png -------------------------------------------------------------------------------- /protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_disable/Icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_disable/Icon-small@2x.png -------------------------------------------------------------------------------- /protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_disable/Info.plist: -------------------------------------------------------------------------------- 1 | { 2 | group = "Protecti+"; 3 | title = "Disable Protecti+"; 4 | description = "Disable Protecti+ for Activator"; 5 | "compatible-modes" = ( 6 | springboard, 7 | application, 8 | lockscreen, 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_enable/Icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_enable/Icon-small.png -------------------------------------------------------------------------------- /protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_enable/Icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_enable/Icon-small@2x.png -------------------------------------------------------------------------------- /protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_enable/Info.plist: -------------------------------------------------------------------------------- 1 | { 2 | group = "Protecti+"; 3 | title = "Enable Protecti+"; 4 | description = "Enable Protecti+ for Activator"; 5 | "compatible-modes" = ( 6 | springboard, 7 | application, 8 | lockscreen, 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_toggle/Icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_toggle/Icon-small.png -------------------------------------------------------------------------------- /protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_toggle/Icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_toggle/Icon-small@2x.png -------------------------------------------------------------------------------- /protectiplustoggleforactivator/layout/Library/Activator/Listeners/com.gviridis.protectiplustoggleforactivator_toggle/Info.plist: -------------------------------------------------------------------------------- 1 | { 2 | group = "Protecti+"; 3 | title = "Enable/Disable Protecti+"; 4 | description = "Enable/Disable Protecti+ for Activator"; 5 | "compatible-modes" = ( 6 | springboard, 7 | application, 8 | lockscreen, 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /protectiplustoggleforactivator/protectiplustoggleforactivator.plist: -------------------------------------------------------------------------------- 1 | { Filter = { Bundles = ( "com.apple.springboard" ); }; } 2 | -------------------------------------------------------------------------------- /protectiplustoggleforquickdo/Action.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "../states.h" 3 | #import 4 | #include 5 | 6 | @interface ProtectiQDAction_Toggle : NSObject { } 7 | @end 8 | 9 | @implementation ProtectiQDAction_Toggle 10 | 11 | - (void)quickdo:(LibQuickDo *)quickdo handleAction:(QDGesture *)gesture 12 | { 13 | ToggleProtectiPlus; 14 | [gesture setHandled:YES]; // To prevent the default OS implementation 15 | } 16 | 17 | + (void)load 18 | { 19 | [[LibQuickDo sharedInstance] addAction:[self new] name:@"com.gviridis.protectiplustoggleforquickdo_toggle"]; 20 | } 21 | 22 | @end 23 | 24 | 25 | 26 | @interface ProtectiQDAction_Enable : NSObject { } 27 | @end 28 | 29 | @implementation ProtectiQDAction_Enable 30 | 31 | - (void)quickdo:(LibQuickDo *)quickdo handleAction:(QDGesture *)gesture 32 | { 33 | EnableProtectiPlus; 34 | [gesture setHandled:YES]; // To prevent the default OS implementation 35 | } 36 | 37 | + (void)load 38 | { 39 | [[LibQuickDo sharedInstance] addAction:[self new] name:@"com.gviridis.protectiplustoggleforquickdo_enable"]; 40 | } 41 | 42 | @end 43 | 44 | 45 | 46 | @interface ProtectiQDAction_Disable : NSObject { } 47 | @end 48 | 49 | @implementation ProtectiQDAction_Disable 50 | 51 | - (void)quickdo:(LibQuickDo *)quickdo handleAction:(QDGesture *)gesture 52 | { 53 | DisableProtectiPlus; 54 | [gesture setHandled:YES]; // To prevent the default OS implementation 55 | } 56 | 57 | + (void)load 58 | { 59 | [[LibQuickDo sharedInstance] addAction:[self new] name:@"com.gviridis.protectiplustoggleforquickdo_disable"]; 60 | } 61 | 62 | @end 63 | 64 | -------------------------------------------------------------------------------- /protectiplustoggleforquickdo/Makefile: -------------------------------------------------------------------------------- 1 | export ARCHS=armv7 arm64 2 | 3 | include $(THEOS)/makefiles/common.mk 4 | 5 | TWEAK_NAME = protectiplustoggleforquickdo 6 | protectiplustoggleforquickdo_FILES = Action.m 7 | protectiplustoggleforquickdo_LIBRARIES = quickdo 8 | protectiplustoggleforquickdo_LDFLAGS += -Wl,-segalign,4000 9 | 10 | include $(THEOS_MAKE_PATH)/tweak.mk 11 | -------------------------------------------------------------------------------- /protectiplustoggleforquickdo/layout/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Package: com.gviridis.protectiplustoggleforquickdo 2 | Name: Protecti+ Toggle For QuickDo 3 | Depends: mobilesubstrate, com.clezz.quickdo (>= 3.8) 4 | Architecture: iphoneos-arm 5 | Description: Protecti+ toggle for QuickDo 6 | Maintainer: gviridis 7 | Author: gviridis 8 | Section: Tweaks 9 | -------------------------------------------------------------------------------- /protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_disable/Icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_disable/Icon-small.png -------------------------------------------------------------------------------- /protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_disable/Icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_disable/Icon-small@2x.png -------------------------------------------------------------------------------- /protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_disable/Info.plist: -------------------------------------------------------------------------------- 1 | { 2 | title = "Disable Protecti+"; 3 | description = "Disable Protecti+ for QuickDo"; 4 | } -------------------------------------------------------------------------------- /protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_enable/Icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_enable/Icon-small.png -------------------------------------------------------------------------------- /protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_enable/Icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_enable/Icon-small@2x.png -------------------------------------------------------------------------------- /protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_enable/Info.plist: -------------------------------------------------------------------------------- 1 | { 2 | title = "Enable Protecti+"; 3 | description = "Enable Protecti+ for QuickDo"; 4 | } -------------------------------------------------------------------------------- /protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_toggle/Icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_toggle/Icon-small.png -------------------------------------------------------------------------------- /protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_toggle/Icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guoc/protecti/f12a0c6509ccb93d25508a1d6378d929a1334453/protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_toggle/Icon-small@2x.png -------------------------------------------------------------------------------- /protectiplustoggleforquickdo/layout/Library/QuickDo/Actions/com.gviridis.protectiplustoggleforquickdo_toggle/Info.plist: -------------------------------------------------------------------------------- 1 | { 2 | title = "Enable/Disable Protecti+"; 3 | description = "Enable/Disable Protecti+ for QuickDo"; 4 | } -------------------------------------------------------------------------------- /protectiplustoggleforquickdo/protectiplustoggleforquickdo.plist: -------------------------------------------------------------------------------- 1 | { Filter = { Bundles = ( "com.apple.springboard" ); }; } 2 | -------------------------------------------------------------------------------- /states.h: -------------------------------------------------------------------------------- 1 | #ifndef _states_h 2 | #define _states_h 3 | 4 | #import 5 | #define kPreferencesStatePath "/var/mobile/Library/Preferences/com.gviridis.protectiplus.state.plist" 6 | #define EnableProtectiPlus notify_post("com.gviridis.protectiplus/Enable") 7 | #define DisableProtectiPlus notify_post("com.gviridis.protectiplus/Disable") 8 | #define ToggleProtectiPlus notify_post("com.gviridis.protectiplus/Toggle") 9 | 10 | id getStateObjectForKey(id key) { 11 | NSMutableDictionary *stateDict = [NSMutableDictionary dictionaryWithContentsOfFile:@kPreferencesStatePath]; 12 | return [stateDict objectForKey:key]; 13 | } 14 | 15 | void saveStateObjectForKey(id stateObj, id key) { 16 | NSMutableDictionary *stateDict = [NSMutableDictionary dictionaryWithContentsOfFile:@kPreferencesStatePath]; 17 | if (!stateDict) 18 | stateDict = [NSMutableDictionary dictionary]; 19 | [stateDict setObject:(stateObj?:[NSNull null]) forKey:key]; 20 | [stateDict writeToFile:@kPreferencesStatePath atomically:YES]; 21 | } 22 | 23 | #endif 24 | --------------------------------------------------------------------------------