diff --git a/FlashBack.xcodeproj/xcuserdata/aaron.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/FlashBack.xcodeproj/xcuserdata/aaron.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
index 22e8364..60717c1 100644
--- a/FlashBack.xcodeproj/xcuserdata/aaron.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ b/FlashBack.xcodeproj/xcuserdata/aaron.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -3,22 +3,4 @@
uuid = "9B71B754-8EF4-4B21-944A-011F70D1E639"
type = "1"
version = "2.0">
-
-
-
-
-
-
diff --git a/FlashBack.xcworkspace/xcuserdata/aaron.xcuserdatad/UserInterfaceState.xcuserstate b/FlashBack.xcworkspace/xcuserdata/aaron.xcuserdatad/UserInterfaceState.xcuserstate
index 61ecb84..056f5c6 100644
Binary files a/FlashBack.xcworkspace/xcuserdata/aaron.xcuserdatad/UserInterfaceState.xcuserstate and b/FlashBack.xcworkspace/xcuserdata/aaron.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/FlashBack/AppDelegate.m b/FlashBack/AppDelegate.m
index b443db5..706c1b5 100755
--- a/FlashBack/AppDelegate.m
+++ b/FlashBack/AppDelegate.m
@@ -20,6 +20,23 @@
// Override point for customization after application launch.
[application _setBackgroundStyle:UIBackgroundStyleExtraDarkBlur];
+ UIColor *barBackground = [UIColor colorWithWhite:0 alpha:0.3];
+ if (@available(iOS 13.0, *)) {
+ UIBarAppearance *barAppearance = [[UIBarAppearance alloc] init];
+ [barAppearance configureWithDefaultBackground];
+ barAppearance.backgroundColor = barBackground;
+
+ [UINavigationBar appearance].standardAppearance = [[UINavigationBarAppearance alloc] initWithBarAppearance:barAppearance];
+ [UINavigationBar appearance].scrollEdgeAppearance = [UINavigationBar appearance].standardAppearance;
+ [UINavigationBar appearance].overrideUserInterfaceStyle = UIUserInterfaceStyleDark;
+
+ [UITabBar appearance].standardAppearance = [[UITabBarAppearance alloc] initWithBarAppearance:barAppearance];
+ [UITabBar appearance].overrideUserInterfaceStyle = UIUserInterfaceStyleDark;
+ } else {
+ [UINavigationBar appearance].backgroundColor = barBackground;
+ [UITabBar appearance].backgroundColor = barBackground;
+ }
+
_window.backgroundColor = [UIColor clearColor];
return YES;
diff --git a/FlashBack/Base.lproj/Main.storyboard b/FlashBack/Base.lproj/Main.storyboard
index 83432ca..d8075a3 100644
--- a/FlashBack/Base.lproj/Main.storyboard
+++ b/FlashBack/Base.lproj/Main.storyboard
@@ -1,6 +1,6 @@
-
+
@@ -12,91 +12,108 @@
-
-
+
+
-
+
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
-
-
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -104,11 +121,11 @@
-
-
+
+
-
+
-
+
@@ -127,21 +144,19 @@
-
+
-
+
-
-
-
-
+
+
-
+
-
+
@@ -160,20 +175,20 @@
-
+
-
+
-
-
+
+
-
+
-
+
@@ -192,10 +207,9 @@
-
-
+
+
-
@@ -205,20 +219,20 @@
-
-
+
+
-
+
-
+
-
-
-
+
+
-
+
-
+
@@ -274,7 +288,7 @@
-
+
@@ -295,15 +309,15 @@
-
-
+
+
-
+
-
+
@@ -313,7 +327,7 @@
-
+
@@ -335,15 +349,15 @@
-
-
+
+
-
+
-
+
@@ -353,7 +367,7 @@
-
+
@@ -377,15 +391,15 @@
-
-
+
+
-
+
-
+
@@ -431,47 +445,37 @@
-
+
-
+
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
-
+
-
-
+
@@ -483,17 +487,9 @@
-
-
+
+
-
-
-
-
-
-
-
-
@@ -511,14 +507,14 @@
-
+
-
+
-
+
@@ -535,24 +531,16 @@
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
-
-
-
-
-
+
-
-
+
+
-
-
-
-
-
+
+
+
@@ -700,5 +677,4 @@
-
diff --git a/FlashBack/Info.plist b/FlashBack/Info.plist
index 0d292e6..3c5da5e 100755
--- a/FlashBack/Info.plist
+++ b/FlashBack/Info.plist
@@ -2,6 +2,8 @@
+ UIUserInterfaceStyle
+ UIUserInterfaceStyleDark
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
diff --git a/FlashBack/InfoTableViewController.m b/FlashBack/InfoTableViewController.m
index 36075c1..bba5873 100644
--- a/FlashBack/InfoTableViewController.m
+++ b/FlashBack/InfoTableViewController.m
@@ -17,16 +17,6 @@
@implementation InfoTableViewController
-
-//- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
-// // Override point for customization after application launch.
-// [application _setBackgroundStyle:UIBackgroundStyleExtraDarkBlur];
-//
-// _cel.backgroundColor = [UIColor clearColor];
-//
-// return YES;
-//}
-
- (IBAction)tweaksSwitch:(id)sender {
tweaksEnabled = [sender isOn];
@@ -52,10 +42,10 @@
[super viewWillAppear:animated];
[self.micahImageView sd_setImageWithURL:[NSURL URLWithString:@"https://pbs.twimg.com/profile_images/1212132374059704320/qqFaZi2a_400x400.jpg"]
- placeholderImage:[UIImage imageNamed:nil]];
+ placeholderImage:nil];
[self.aaronImageView sd_setImageWithURL:[NSURL URLWithString:@"https://pbs.twimg.com/profile_images/1195388235335254016/6DAkWcSq_400x400.jpg"]
- placeholderImage:[UIImage imageNamed:nil]];
+ placeholderImage:nil];
}
@@ -66,39 +56,30 @@
return [NSURL URLWithString:[NSString stringWithFormat:@"twitterrific:///profile?screen_name=%@", userName]];
} else if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tweetings://"]]) {
return [NSURL URLWithString:[NSString stringWithFormat:@"tweetings:///user?screen_name=%@", userName]];
- } else if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"twitter://"]]) {
- return [NSURL URLWithString:[NSString stringWithFormat:@"https://mobile.twitter.com/%@", userName]];
- } else {
- return [NSURL URLWithString:[NSString stringWithFormat:@"https://mobile.twitter.com/%@", userName]];
}
+ return [NSURL URLWithString:[NSString stringWithFormat:@"https://mobile.twitter.com/%@", userName]];
}
-- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section
-{
+- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section {
UITableViewHeaderFooterView *footer = (UITableViewHeaderFooterView *)view;
footer.textLabel.textAlignment = NSTextAlignmentCenter;
}
-
-(void)micahTwitterProfile{
- [[UIApplication sharedApplication] openURL:[InfoTableViewController openTwitterProfile:@"MicahPGomez"]];
+ [[UIApplication sharedApplication] openURL:[InfoTableViewController openTwitterProfile:@"MicahPGomez"]];
}
-(void)aaronTwitterProfile{
[[UIApplication sharedApplication] openURL:[InfoTableViewController openTwitterProfile:@"23Aaron_"]];
}
-
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
-
+
if (indexPath.section == 0 && indexPath.row == 0) {
[self micahTwitterProfile];
- }
-
- else if (indexPath.section == 0 && indexPath.row == 1) {
+ } else if (indexPath.section == 0 && indexPath.row == 1) {
[self aaronTwitterProfile];
}
-
}
@end
diff --git a/FlashBack/SpecialButton.h b/FlashBack/SpecialButton.h
new file mode 100644
index 0000000..8d8ee81
--- /dev/null
+++ b/FlashBack/SpecialButton.h
@@ -0,0 +1,17 @@
+//
+// SpecialButton.h
+// FlashBack
+//
+// Created by Aaron KJ on 2/2/20.
+// Copyright © 2020 Micah Gomez. All rights reserved.
+//
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SpecialButton : UIButton
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/FlashBack/SpecialButton.m b/FlashBack/SpecialButton.m
new file mode 100644
index 0000000..c81d97f
--- /dev/null
+++ b/FlashBack/SpecialButton.m
@@ -0,0 +1,38 @@
+//
+// SpecialButton.m
+// FlashBack
+//
+// Created by Aaron KJ and AYDEN PANHIZYEHN on 2/2/20.
+// Copyright © 2020 Micah Gomez. All rights reserved.
+//
+
+#import "SpecialButton.h"
+
+@implementation SpecialButton
+
+- (instancetype)initWithCoder:(NSCoder *)coder {
+ self = [super initWithCoder:coder];
+ if (self) [self commonInit];
+ return self;
+}
+
+- (instancetype)initWithFrame:(CGRect)frame {
+ self = [super initWithFrame:frame];
+ if (self) [self commonInit];
+ return self;
+}
+
+- (void)commonInit {
+ UIVisualEffectView *blurView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]];
+ blurView.userInteractionEnabled = NO;
+ blurView.clipsToBounds = YES;
+ blurView.layer.cornerRadius = 15;
+ if (@available(iOS 13.0, *)) {
+ blurView.layer.cornerCurve = kCACornerCurveContinuous;
+ }
+ blurView.frame = self.bounds;
+ blurView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+ [self insertSubview:blurView atIndex:0];
+}
+
+@end
diff --git a/FlashBack/SpecialTableViewCell.h b/FlashBack/SpecialTableViewCell.h
new file mode 100644
index 0000000..50d573f
--- /dev/null
+++ b/FlashBack/SpecialTableViewCell.h
@@ -0,0 +1,17 @@
+//
+// SpecialTableViewCell.h
+// FlashBack
+//
+// Created by Aaron KJ on 2/2/20.
+// Copyright © 2020 Micah Gomez. All rights reserved.
+//
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SpecialTableViewCell : UITableViewCell
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/FlashBack/SpecialTableViewCell.m b/FlashBack/SpecialTableViewCell.m
new file mode 100644
index 0000000..2aa5700
--- /dev/null
+++ b/FlashBack/SpecialTableViewCell.m
@@ -0,0 +1,28 @@
+//
+// SpecialTableViewCell.m
+// FlashBack
+//
+// Created by Aaron KJ on 2/2/20.
+// Copyright © 2020 Micah Gomez. All rights reserved.
+//
+
+#import "SpecialTableViewCell.h"
+
+@implementation SpecialTableViewCell
+
+- (void)awakeFromNib {
+ [super awakeFromNib];
+ // Initialization code
+
+ self.backgroundColor = [UIColor clearColor];
+
+ UIView *selectionView = [[UIView alloc] init];
+ selectionView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.1];
+ self.selectedBackgroundView = selectionView;
+
+ UIVisualEffectView *blurView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]];
+ blurView.userInteractionEnabled = NO;
+ self.backgroundView = blurView;
+}
+
+@end
diff --git a/FlashBack/UIAlertAction+Common.h b/FlashBack/UIAlertAction+Common.h
new file mode 100644
index 0000000..71651c6
--- /dev/null
+++ b/FlashBack/UIAlertAction+Common.h
@@ -0,0 +1,19 @@
+//
+// UIAlertAction+Common.h
+// FlashBack
+//
+// Created by Aaron KJ on 2/2/20.
+// Copyright © 2020 Micah Gomez. All rights reserved.
+//
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface UIAlertAction (Common)
++ (UIAlertAction *)okAction;
++ (UIAlertAction *)okActionWithHandler:(void (^)(UIAlertAction *action))handler;
++ (UIAlertAction *)cancelAction;
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/FlashBack/UIAlertAction+Common.m b/FlashBack/UIAlertAction+Common.m
new file mode 100644
index 0000000..d0c6004
--- /dev/null
+++ b/FlashBack/UIAlertAction+Common.m
@@ -0,0 +1,25 @@
+//
+// UIAlertAction+Common.m
+// FlashBack
+//
+// Created by Aaron KJ on 2/2/20.
+// Copyright © 2020 Micah Gomez. All rights reserved.
+//
+
+#import "UIAlertAction+Common.h"
+
+@implementation UIAlertAction (Common)
+
++ (UIAlertAction *)okAction {
+ return [self okActionWithHandler:nil];
+}
+
++ (UIAlertAction *)okActionWithHandler:(void (^)(UIAlertAction *action))handler {
+ return [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:handler];
+}
+
++ (UIAlertAction *)cancelAction {
+ return [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
+}
+
+@end
diff --git a/FlashBack/ViewController.m b/FlashBack/ViewController.m
index 684747a..7b69b00 100755
--- a/FlashBack/ViewController.m
+++ b/FlashBack/ViewController.m
@@ -12,6 +12,7 @@
#include "NSTask.h"
#import "UIImage+Private.h"
#import "UIBackgroundStyle.h"
+#import "UIAlertAction+Common.h"
#import "UINavigationItem+LargeAccessoryView.h"
#import "globalVars.h"
@@ -32,7 +33,7 @@ NSString *backupNameSelected;
textField.placeholder = @"Backup Name";
textField.secureTextEntry = NO;
}];
- UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+ UIAlertAction *confirmAction = [UIAlertAction okActionWithHandler:^(UIAlertAction * _Nonnull action) {
NSLog(@"Backup name is :%@", [[createBackupAlert textFields][0] text]);
NSString *newBackupName=[[createBackupAlert textFields][0] text];
@@ -55,10 +56,7 @@ NSString *backupNameSelected;
message:@"The backup has been successfully created"
preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction* ok = [UIAlertAction
- actionWithTitle:@"OK"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
+ UIAlertAction* ok = [UIAlertAction okActionWithHandler:^(UIAlertAction * action)
{
_backupFolderArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/Library/FlashBack/Backups/" error:nil];
@@ -78,14 +76,9 @@ NSString *backupNameSelected;
waitpid(pid, &status, WEXITED);*/
}
-
-
}];
[createBackupAlert addAction:confirmAction];
- UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
- NSLog(@"Canelled");
- }];
- [createBackupAlert addAction:cancelAction];
+ [createBackupAlert addAction:[UIAlertAction cancelAction]];
[self presentViewController:createBackupAlert animated:YES completion:nil];
}
@@ -98,16 +91,7 @@ NSString *backupNameSelected;
message:@"Scroll through the list then let it settle on an item to select the backup."
preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction* ok = [UIAlertAction
- actionWithTitle:@"ok"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
- {
- [selectBackupAlert dismissViewControllerAnimated:YES completion:nil];
-
- }];
-
- [selectBackupAlert addAction:ok];
+ [selectBackupAlert addAction:[UIAlertAction okAction]];
[self presentViewController:selectBackupAlert animated:YES completion:nil];
@@ -119,10 +103,7 @@ NSString *backupNameSelected;
message:@"Your device will revert to the selected backup! Please wait for your device to respring."
preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction* ok = [UIAlertAction
- actionWithTitle:@"OK"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
+ UIAlertAction* ok = [UIAlertAction okActionWithHandler:^(UIAlertAction * action)
{
//RUN RESTORE SCRIPT
@@ -141,17 +122,9 @@ NSString *backupNameSelected;
[restoreBackupAlert dismissViewControllerAnimated:YES completion:nil];
}];
- UIAlertAction* cancel = [UIAlertAction
- actionWithTitle:@"Cancel"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
- {
- [restoreBackupAlert dismissViewControllerAnimated:YES completion:nil];
-
- }];
- [restoreBackupAlert addAction:cancel];
[restoreBackupAlert addAction:ok];
+ [restoreBackupAlert addAction:[UIAlertAction cancelAction]];
[self presentViewController:restoreBackupAlert animated:YES completion:nil];
}
@@ -165,17 +138,8 @@ NSString *backupNameSelected;
alertControllerWithTitle:@"Select a Backup!"
message:@"Scroll through the list then let it settle on an item to select the backup."
preferredStyle:UIAlertControllerStyleAlert];
-
- UIAlertAction* ok = [UIAlertAction
- actionWithTitle:@"ok"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
- {
- [updateBackupAlert dismissViewControllerAnimated:YES completion:nil];
-
- }];
-
- [updateBackupAlert addAction:ok];
+
+ [updateBackupAlert addAction:[UIAlertAction okAction]];
[self presentViewController:updateBackupAlert animated:YES completion:nil];
@@ -187,10 +151,7 @@ NSString *backupNameSelected;
message:@"The selected backup will be overwritten! Please wait until the completion pop-up appears"
preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction* ok = [UIAlertAction
- actionWithTitle:@"OK"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
+ UIAlertAction* ok = [UIAlertAction okActionWithHandler:^(UIAlertAction * action)
{
@@ -213,17 +174,11 @@ NSString *backupNameSelected;
message:@"The backup has been successfully updated"
preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction* ok = [UIAlertAction
- actionWithTitle:@"OK"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
+ UIAlertAction* ok = [UIAlertAction okActionWithHandler:^(UIAlertAction * action)
{
_backupFolderArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/Library/FlashBack/Backups/" error:nil];
[self->selectedBackupPickerView reloadAllComponents];
-
- [finishedUpdateAlert dismissViewControllerAnimated:YES completion:nil];
-
}];
[finishedUpdateAlert addAction:ok];
@@ -231,14 +186,7 @@ NSString *backupNameSelected;
}];
- UIAlertAction* cancel = [UIAlertAction
- actionWithTitle:@"Cancel"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
- {
- [updateBackupAlert dismissViewControllerAnimated:YES completion:nil];
-
- }];
+ UIAlertAction* cancel = [UIAlertAction cancelAction];
[updateBackupAlert addAction:cancel];
[updateBackupAlert addAction:ok];
@@ -257,17 +205,7 @@ NSString *backupNameSelected;
alertControllerWithTitle:@"Select a Backup!"
message:@"Scroll through the list then let it settle on an item to select the backup."
preferredStyle:UIAlertControllerStyleAlert];
-
- UIAlertAction* ok = [UIAlertAction
- actionWithTitle:@"ok"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
- {
- [selectBackupAlert dismissViewControllerAnimated:YES completion:nil];
-
- }];
-
- [selectBackupAlert addAction:ok];
+ [selectBackupAlert addAction:[UIAlertAction okAction]];
[self presentViewController:selectBackupAlert animated:YES completion:nil];
@@ -279,10 +217,7 @@ NSString *backupNameSelected;
message:@"This will package the selected backup to a DEB file."
preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction* ok = [UIAlertAction
- actionWithTitle:@"OK"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
+ UIAlertAction* ok = [UIAlertAction okActionWithHandler:^(UIAlertAction * action)
{
UIAlertController * packageBackupWait= [UIAlertController
@@ -305,14 +240,7 @@ NSString *backupNameSelected;
[packageBackupWait dismissViewControllerAnimated:YES completion:nil];
}];
- UIAlertAction* cancel = [UIAlertAction
- actionWithTitle:@"Cancel"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
- {
- [packageBackupAlert dismissViewControllerAnimated:YES completion:nil];
-
- }];
+ UIAlertAction* cancel = [UIAlertAction cancelAction];
[packageBackupAlert addAction:cancel];
[packageBackupAlert addAction:ok];
@@ -328,16 +256,7 @@ NSString *backupNameSelected;
message:@"The free trial of FlashBack doesn't allow backing up setups to DEBs. Purchase the full version on PackIX for $1.50 for this!"
preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction* ok = [UIAlertAction
- actionWithTitle:@"ok"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
- {
- [noBackupDEBAlert dismissViewControllerAnimated:YES completion:nil];
-
- }];
-
- [noBackupDEBAlert addAction:ok];
+ [noBackupDEBAlert addAction:[UIAlertAction okAction]];
[self presentViewController:noBackupDEBAlert animated:YES completion:nil];
@@ -353,16 +272,7 @@ NSString *backupNameSelected;
message:@"Scroll through the list then let it settle on an item to select the backup."
preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction* ok = [UIAlertAction
- actionWithTitle:@"ok"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
- {
- [selectBackupAlert dismissViewControllerAnimated:YES completion:nil];
-
- }];
-
- [selectBackupAlert addAction:ok];
+ [selectBackupAlert addAction:[UIAlertAction okAction]];
[self presentViewController:selectBackupAlert animated:YES completion:nil];
@@ -373,10 +283,7 @@ NSString *backupNameSelected;
message:@"The selected backup will be deleted!"
preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction* ok = [UIAlertAction
- actionWithTitle:@"OK"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
+ UIAlertAction* ok = [UIAlertAction okActionWithHandler:^(UIAlertAction * action)
{
NSTask *deleteTask = [[NSTask alloc] init];
@@ -390,10 +297,7 @@ NSString *backupNameSelected;
message:@"The backup has been deleted successfully"
preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction* okey = [UIAlertAction
- actionWithTitle:@"ok"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
+ UIAlertAction* okey = [UIAlertAction okActionWithHandler:^(UIAlertAction * action)
{
_backupFolderArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/Library/FlashBack/Backups/" error:nil];
@@ -406,28 +310,12 @@ NSString *backupNameSelected;
[deleteFinishedAlert addAction:okey];
[self presentViewController:deleteFinishedAlert animated:YES completion:nil];
-
-
-
- [deleteBackupAlert dismissViewControllerAnimated:YES completion:nil];
}];
- UIAlertAction* cancel = [UIAlertAction
- actionWithTitle:@"Cancel"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
- {
-
- [deleteBackupAlert dismissViewControllerAnimated:YES completion:nil];
-
- }];
- [deleteBackupAlert addAction:cancel];
[deleteBackupAlert addAction:ok];
+ [deleteBackupAlert addAction:[UIAlertAction cancelAction]];
[self presentViewController:deleteBackupAlert animated:YES completion:nil];
-
-
-
}
@@ -439,31 +327,14 @@ NSString *backupNameSelected;
- (void)viewDidLoad {
[super viewDidLoad];
-
- if (@available(iOS 13.0, *)) {
- API_AVAILABLE(ios(13.0))
- UIView *statusBar = [[UIView alloc]initWithFrame:[UIApplication sharedApplication].keyWindow.windowScene.statusBarManager.statusBarFrame];
- statusBar.backgroundColor = [UIColor darkTextColor];
- [[UIApplication sharedApplication].keyWindow addSubview:statusBar];
- } else {
- UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
- if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
-
- statusBar.backgroundColor = [UIColor darkTextColor];
- }
- }
-
UIButton *createBackupButton = [UIButton buttonWithType:UIButtonTypeSystem];
-
- self.navigationItem._largeTitleAccessoryView = createBackupButton;
-
[createBackupButton addTarget:self action:@selector(createBackup:) forControlEvents:UIControlEventTouchUpInside];
-
- UIImage *btnImage = [UIImage imageNamed:@"create"];
- [createBackupButton setImage:btnImage forState:UIControlStateNormal];
+ [createBackupButton setImage:[UIImage imageNamed:@"create"] forState:UIControlStateNormal];
+ self.navigationItem._largeTitleAccessoryView = createBackupButton;
// Do any additional setup after loading the view.
+
selectedBackupPickerView.delegate=self;
selectedBackupPickerView.dataSource=self;
@@ -473,100 +344,45 @@ NSString *backupNameSelected;
// MARK: DRM From @Kushdabush, commenting out for testing
//pulled from https://github.com/DomienF/kushy-drm/blob/master/Tweak.xm
-
- UIAlertController * failedDRMAlert= [UIAlertController
- alertControllerWithTitle:@"FlashBack appears to be pirated :("
- message:@"For your own safety, download FlashBack from the official source! If you're seeing this, then it means that whoever is distributing this copy is either sharing a ripped version that is potentially dangerous, or they have forgotten to remove this warning for yours, and their own protection."
- preferredStyle:UIAlertControllerStyleAlert];
-
- UIAlertAction* failedDRMOk = [UIAlertAction
- actionWithTitle:@"OK"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
- {
- [failedDRMAlert dismissViewControllerAnimated:YES completion:nil];
- //exit(0);
- }];
-
- UIAlertController * trialNoticeAlert= [UIAlertController
- alertControllerWithTitle:@"Trial Notice"
- message:@"Thanks for checking out FlashBack! This trial allows you to give FlashBack a test run allowing for one backup. You can use that backup as a checkpoint to revert to after making changes."
- preferredStyle:UIAlertControllerStyleAlert];
-
- UIAlertAction* trialOk = [UIAlertAction
- actionWithTitle:@"ok"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
- {
- [trialNoticeAlert dismissViewControllerAnimated:YES completion:nil];
- }];
-
- [failedDRMAlert addAction:failedDRMOk];
- [trialNoticeAlert addAction:trialOk];
-
+
if ([[NSFileManager defaultManager] fileExistsAtPath:@"/var/lib/dpkg/info/com.mpg13.flashback.list"]){
NSLog(@"FlashBack DRM Passed");
trial = NO;
- }
- else{
- if ([[NSFileManager defaultManager] fileExistsAtPath:@"/var/lib/dpkg/info/com.mpg13.flashbackfree.list"]){
- NSLog(@"FlashBack Trial Mode");
- trial = YES;
- dispatch_async(dispatch_get_main_queue(), ^ {
- [self presentViewController:trialNoticeAlert animated:YES completion:nil];
- });
- }
- else{
- NSLog(@"DRM failed");
- dispatch_async(dispatch_get_main_queue(), ^ {
- [self presentViewController:failedDRMAlert animated:YES completion:nil];
- });
- }
+ } else {
+ NSLog(@"DRM failed");
+
+ UIAlertController * failedDRMAlert = [UIAlertController
+ alertControllerWithTitle:@"FlashBack appears to be pirated :("
+ message:@"For your own safety, download FlashBack from the official source! If you're seeing this, then it means that whoever is distributing this copy is either sharing a ripped version that is potentially dangerous, or they have forgotten to remove this warning for yours, and their own protection."
+ preferredStyle:UIAlertControllerStyleAlert];
+ [failedDRMAlert addAction:[UIAlertAction okAction]];
+
+ dispatch_async(dispatch_get_main_queue(), ^ {
+ [self presentViewController:failedDRMAlert animated:YES completion:nil];
+ });
}
trial = NO;
}
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
+ if (_backupFolderArray == nil) return;
- if (_backupFolderArray == nil){
-
- UIAlertController * emptyArrayAlert= [UIAlertController
- alertControllerWithTitle:@"Let's start by making a backup!"
- message:@"Press 'Create Backup (+)' to get started!"
- preferredStyle:UIAlertControllerStyleAlert];
-
- UIAlertAction* ok = [UIAlertAction
- actionWithTitle:@"ok"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
- {
- [emptyArrayAlert dismissViewControllerAnimated:YES completion:nil];
-
- }];
-
- [emptyArrayAlert addAction:ok];
-
- [self presentViewController:emptyArrayAlert animated:YES completion:nil];
-
- }
- else{
- backupNameSelected = [_backupFolderArray objectAtIndex:row];
- selectedBackupText.text=backupNameSelected;
-
- selectedBackupURL = [NSMutableString stringWithString: @"/Library/FlashBack/Backups/"];
- [selectedBackupURL appendString: backupNameSelected];
-
- selectedBackupImageURL=selectedBackupURL;
-
- [selectedBackupImageURL appendString: @"/SBFolder/LockBackgroundThumbnail.jpg"];
- NSLog(@"%@", selectedBackupImageURL);
- NSURL *url = [NSURL fileURLWithPath:selectedBackupImageURL];
- NSData *data = [NSData dataWithContentsOfURL:url];
- selectedBackupImage.image = [UIImage imageWithData:data];
-
- NSLog(@"%@", backupNameSelected);
- }
+ backupNameSelected = [_backupFolderArray objectAtIndex:row];
+ selectedBackupText.text=backupNameSelected;
+
+ selectedBackupURL = [NSMutableString stringWithString: @"/Library/FlashBack/Backups/"];
+ [selectedBackupURL appendString: backupNameSelected];
+
+ selectedBackupImageURL=selectedBackupURL;
+
+ [selectedBackupImageURL appendString: @"/SBFolder/LockBackgroundThumbnail.jpg"];
+ NSLog(@"%@", selectedBackupImageURL);
+ NSURL *url = [NSURL fileURLWithPath:selectedBackupImageURL];
+ NSData *data = [NSData dataWithContentsOfURL:url];
+ selectedBackupImage.image = [UIImage imageWithData:data];
+
+ NSLog(@"%@", backupNameSelected);
}
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{