forked from SnailTheDev/HiddenLock14
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46899a6
commit d32f336
Showing
12 changed files
with
204 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
#import <Foundation/Foundation.h> | ||
#include <UIKit/UIKit.h> | ||
#import <LocalAuthentication/LocalAuthentication.h> | ||
#include <spawn.h> | ||
#import <Cephei/HBPreferences.h> | ||
#import "lib/UICKeyChainStore.m" | ||
|
||
@interface PUAlbumsGadgetViewController : UIViewController | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
#include "HLPRootListController.h" | ||
#import "spawn.h" | ||
|
||
OBWelcomeController *welcomeController; | ||
|
||
@implementation HLPRootListController | ||
|
||
- (instancetype)init { | ||
|
@@ -10,6 +12,8 @@ - (instancetype)init { | |
if (self) { | ||
HBAppearanceSettings *appearanceSettings = [[HBAppearanceSettings alloc] init]; | ||
|
||
self.preferences = [[HBPreferences alloc] initWithIdentifier:@"com.yan.hiddenlockpreferences"]; | ||
|
||
self.applyButton = [[UIBarButtonItem alloc] initWithTitle:@"Apply" style: UIBarButtonItemStylePlain target: self action: @selector(applySettings)]; | ||
self.applyButton.tintColor = [UIColor whiteColor]; | ||
self.navigationItem.rightBarButtonItem= self.applyButton; | ||
|
@@ -63,6 +67,40 @@ - (instancetype)init { | |
return self; | ||
} | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
|
||
if (![[self preferences] objectForKey:@"didPresentWC"]) { | ||
[self setupWelcomeController]; | ||
} | ||
} | ||
|
||
- (void)setupWelcomeController { | ||
welcomeController = [[OBWelcomeController alloc] initWithTitle:@"HiddenLock14" detailText:@"Add Face ID authentication to hidden album in Photos." icon:[UIImage imageWithContentsOfFile:@"/Library/PreferenceBundles/HiddenLockPreferences.bundle/icon.png"]]; | ||
|
||
[welcomeController addBulletedListItemWithTitle:@"FaceID" description:@"Lock the hidden section with an additional layer of security" image:[UIImage imageWithContentsOfFile:@"/Library/PreferenceBundles/HiddenLockPreferences.bundle/face-id.png"]]; | ||
[welcomeController addBulletedListItemWithTitle:@"Item Count" description:@"Set the item count to any number you want!" image:[UIImage imageWithContentsOfFile:@"/Library/PreferenceBundles/HiddenLockPreferences.bundle/[email protected]"]]; | ||
[welcomeController.buttonTray addCaptionText:@"yandevelop"]; | ||
|
||
OBBoldTrayButton* continueButton = [OBBoldTrayButton buttonWithType:1]; | ||
[continueButton addTarget:self action:@selector(dismissWelcomeController) forControlEvents:UIControlEventTouchUpInside]; | ||
[continueButton setTitle:@"Experience it yourself!" forState:UIControlStateNormal]; | ||
[continueButton setClipsToBounds:YES]; | ||
[continueButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | ||
[continueButton.layer setCornerRadius:10]; | ||
continueButton.tintColor = [UIColor colorWithRed:0.34 green:0.83 blue:0.96 alpha:1.0]; | ||
[welcomeController.buttonTray addButton:continueButton]; | ||
|
||
welcomeController.modalPresentationStyle = UIModalPresentationPageSheet; | ||
welcomeController.view.tintColor = [UIColor blackColor];//[UIColor colorWithRed:0.60 green:0.75 blue:0.85 alpha:1.0]; | ||
[self presentViewController:welcomeController animated:YES completion:nil]; | ||
} | ||
|
||
- (void)dismissWelcomeController { | ||
[[self preferences] setBool:YES forKey:@"didPresentWC"]; | ||
[welcomeController dismissViewControllerAnimated:YES completion:nil]; | ||
} | ||
|
||
|
||
- (NSArray *)specifiers { | ||
if (!_specifiers) { | ||
|
@@ -113,15 +151,14 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N | |
} | ||
|
||
- (void)resetPassword:(id)sender { | ||
UIAlertController *rstPwAlert = [UIAlertController alertControllerWithTitle:@"Reset password" message:@"" preferredStyle:UIAlertControllerStyleAlert]; | ||
UIAlertController *rstPwAlert = [UIAlertController alertControllerWithTitle:@"Reset password" message:@"Are you sure you want to reset your password?" preferredStyle:UIAlertControllerStyleAlert]; | ||
UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Cancel" style: UIAlertActionStyleCancel handler:^(UIAlertAction * action) {}]; | ||
UIAlertAction *rstPwAction = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { | ||
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), (CFStringRef)@"com.yan.hiddenlock14/resetPassword", nil, nil, true); | ||
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), (CFStringRef)@"com.yan.hiddenlockpreferences/resetPassword", nil, nil, true); | ||
}]; | ||
UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Cancel" style: UIAlertActionStyleCancel handler:^(UIAlertAction * action {}]; | ||
[rstPwAlert addAction:rstPwAction]; | ||
// declare rootVC / self? | ||
[rootVC presentViewController:rstPwAlert animated:YES completion:nil]; | ||
|
||
[rstPwAlert addAction:cancel]; | ||
[self presentViewController:rstPwAlert animated:YES completion:nil]; | ||
} | ||
@end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,4 @@ | |
<key>NSPrincipalClass</key> | ||
<string>HLPRootListController</string> | ||
</dict> | ||
</plist> | ||
</plist> |
Oops, something went wrong.