diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Contents.json b/FlashBack/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d6..4a89182 100644 --- a/FlashBack/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/FlashBack/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,93 +1,111 @@ { "images" : [ { - "idiom" : "iphone", "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", "scale" : "3x" }, { - "idiom" : "ipad", "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x-1.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x-1.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x-1.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", "scale" : "2x" }, { - "idiom" : "ios-marketing", "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "ItunesArtwork@2x.png", "scale" : "1x" } ], diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..b378f47 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png new file mode 100644 index 0000000..ba91fb8 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..ba91fb8 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..4e06e41 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..acfeba8 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png new file mode 100644 index 0000000..a504fe4 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..a504fe4 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..ae981d9 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..ba91fb8 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png new file mode 100644 index 0000000..c6795b2 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..c6795b2 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..a43cab8 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..a43cab8 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..37beea7 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..3ea848e Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..26c711c Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..1248111 Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/FlashBack/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png b/FlashBack/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png new file mode 100644 index 0000000..ea3e4df Binary files /dev/null and b/FlashBack/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png differ diff --git a/FlashBack/Assets.xcassets/bgimage.imageset/Contents.json b/FlashBack/Assets.xcassets/bgimage.imageset/Contents.json index 8b263be..8a05f36 100644 --- a/FlashBack/Assets.xcassets/bgimage.imageset/Contents.json +++ b/FlashBack/Assets.xcassets/bgimage.imageset/Contents.json @@ -7,10 +7,12 @@ }, { "idiom" : "universal", + "filename" : "bgimage-1.png", "scale" : "2x" }, { "idiom" : "universal", + "filename" : "bgimage-2.png", "scale" : "3x" } ], diff --git a/FlashBack/Assets.xcassets/bgimage.imageset/bgimage-1.png b/FlashBack/Assets.xcassets/bgimage.imageset/bgimage-1.png new file mode 100644 index 0000000..e74680e Binary files /dev/null and b/FlashBack/Assets.xcassets/bgimage.imageset/bgimage-1.png differ diff --git a/FlashBack/Assets.xcassets/bgimage.imageset/bgimage-2.png b/FlashBack/Assets.xcassets/bgimage.imageset/bgimage-2.png new file mode 100644 index 0000000..e74680e Binary files /dev/null and b/FlashBack/Assets.xcassets/bgimage.imageset/bgimage-2.png differ diff --git a/FlashBack/Base.lproj/Main.storyboard b/FlashBack/Base.lproj/Main.storyboard index 521bfff..a6fcb7e 100644 --- a/FlashBack/Base.lproj/Main.storyboard +++ b/FlashBack/Base.lproj/Main.storyboard @@ -18,32 +18,40 @@ - + - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -134,10 +184,10 @@ - + - + diff --git a/FlashBack/ViewController.m b/FlashBack/ViewController.m index 3e6fd58..cb0f7f5 100644 --- a/FlashBack/ViewController.m +++ b/FlashBack/ViewController.m @@ -43,12 +43,6 @@ NSString *backupNameSelected; else{ NSLog(@"Backup name is good!"); - /*NSString *content = @"Put this in a file please."; - NSData *fileContents = [content dataUsingEncoding:NSUTF8StringEncoding]; - [[NSFileManager defaultManager] createFileAtPath:@"/Applications/test.txt" - contents:fileContents - attributes:nil];*/ - NSLog(@"Running NSTask"); NSTask *createTask = [[NSTask alloc] init]; @@ -59,7 +53,7 @@ NSString *backupNameSelected; UIAlertController * finishedCreateAlert= [UIAlertController alertControllerWithTitle:@"Backup Creation Completed" - message:@"The backup will appear once you repoen the app." + message:@"The backup has been successfully created" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* ok = [UIAlertAction @@ -68,7 +62,8 @@ NSString *backupNameSelected; handler:^(UIAlertAction * action) { - + _backupFolderArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/Library/FlashBack/Backups/" error:nil]; + [self->selectedBackupPickerView reloadAllComponents]; [finishedCreateAlert dismissViewControllerAnimated:YES completion:nil]; @@ -170,7 +165,7 @@ NSString *backupNameSelected; if (backupNameSelected == nil){ - UIAlertController * selectBackupAlert= [UIAlertController + UIAlertController * updateBackupAlert= [UIAlertController alertControllerWithTitle:@"Select a Backup!" message:@"Scroll through the list then let it settle on an item to select the backup." preferredStyle:UIAlertControllerStyleAlert]; @@ -180,13 +175,13 @@ NSString *backupNameSelected; style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { - [selectBackupAlert dismissViewControllerAnimated:YES completion:nil]; + [updateBackupAlert dismissViewControllerAnimated:YES completion:nil]; }]; - [selectBackupAlert addAction:ok]; + [updateBackupAlert addAction:ok]; - [self presentViewController:selectBackupAlert animated:YES completion:nil]; + [self presentViewController:updateBackupAlert animated:YES completion:nil]; } else{ @@ -217,6 +212,27 @@ NSString *backupNameSelected; [createTask launch]; [createTask waitUntilExit]; + UIAlertController * finishedUpdateAlert= [UIAlertController + alertControllerWithTitle:@"Backup Update Completed" + message:@"The backup has been successfully updated" + preferredStyle:UIAlertControllerStyleAlert]; + + UIAlertAction* ok = [UIAlertAction + actionWithTitle:@"OK" + style:UIAlertActionStyleDefault + handler:^(UIAlertAction * action) + { + + _backupFolderArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/Library/FlashBack/Backups/" error:nil]; + [self->selectedBackupPickerView reloadAllComponents]; + + [finishedUpdateAlert dismissViewControllerAnimated:YES completion:nil]; + + }]; + [finishedUpdateAlert addAction:ok]; + + [self presentViewController:finishedUpdateAlert animated:YES completion:nil]; + }]; UIAlertAction* cancel = [UIAlertAction @@ -263,7 +279,7 @@ NSString *backupNameSelected; UIAlertController * packageBackupAlert= [UIAlertController alertControllerWithTitle:@"Package Backup" - message:@"This will package the selected backup." + message:@"This will package the selected backup to a DEB file." preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* ok = [UIAlertAction @@ -284,7 +300,7 @@ NSString *backupNameSelected; UIAlertController * finishedPackageAlert= [UIAlertController alertControllerWithTitle:@"Packaging Complete" - message:@"The package can be found in [/User/Documents/FlashBack/GeneratedPackages/]." + message:@"The package can be found in [/User/Documents/FlashBack/FlashBackDEBs/]." preferredStyle:UIAlertControllerStyleAlert]; @@ -319,92 +335,11 @@ NSString *backupNameSelected; } } - -- (IBAction)unpackageBackup:(id)sender { - - if (backupNameSelected == nil){ - - UIAlertController * selectBackupAlert= [UIAlertController - 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]; - - [self presentViewController:selectBackupAlert animated:YES completion:nil]; - - } - else{ - - UIAlertController * unpackageBackupAlert= [UIAlertController - alertControllerWithTitle:@"Unpackage Imported Backups" - message:@"This will importall backups in [/User/Documents/FlashBack/Unpackage/]." - preferredStyle:UIAlertControllerStyleAlert]; - - UIAlertAction* ok = [UIAlertAction - actionWithTitle:@"OK" - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) - { - - //RUN RESTORE SCRIPT - - NSTask *packageTask = [[NSTask alloc] init]; - [packageTask setLaunchPath:@"/bin/bash"]; - [packageTask setArguments:@[ @"FBUnpackage"]]; - [packageTask launch]; - [packageTask waitUntilExit]; - - UIAlertController * finishedUnpackageAlert= [UIAlertController - alertControllerWithTitle:@"Import Complete" - message:@"Repoen the app to view imported backups." - preferredStyle:UIAlertControllerStyleAlert]; - - UIAlertAction* ok = [UIAlertAction - actionWithTitle:@"ok" - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) - { - [finishedUnpackageAlert dismissViewControllerAnimated:YES completion:nil]; - - }]; - - [finishedUnpackageAlert addAction:ok]; - - [self presentViewController:finishedUnpackageAlert animated:YES completion:nil]; - - }]; - UIAlertAction* cancel = [UIAlertAction - actionWithTitle:@"Cancel" - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) - { - [unpackageBackupAlert dismissViewControllerAnimated:YES completion:nil]; - - }]; - - [unpackageBackupAlert addAction:cancel]; - [unpackageBackupAlert addAction:ok]; - - [self presentViewController:unpackageBackupAlert animated:YES completion:nil]; - } -} - - - (IBAction)helpMenu:(id)sender { UIAlertController * tutorialAlert= [UIAlertController alertControllerWithTitle:@"Help" - message:@"Create Backup: This will prompt you to enter a name for the backup which will be displayed in the box above.\n\nRestore: This will revert your settings, wallpaper, and Icon Layout to the selected setup.\n\nUpdate: This will overwrite the selected backup to cleanly update it.\n\nPackage:This will generate a package in ZIP format for you to share or back up for later.\n\nUnpackage: This will install the aforementioned ZIP packages to be used by FlashBack.\n\nDelete: This will delete the selected backup. These backups cannot be recovered!" + message:@"Create Backup: This will prompt you to enter a name for the backup which will be displayed in the box above.\n\nRestore: This will revert your settings, wallpaper, and Icon Layout to the selected setup.\n\nUpdate: This will overwrite the selected backup to cleanly update it.\n\nPackage: This will generate a package in ZIP format for you to share or back up for later.\n\nUnpackage: This will install the aforementioned ZIP packages to be used by FlashBack.\n\nDelete: This will delete the selected backup. These backups cannot be recovered!" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* ok = [UIAlertAction @@ -417,7 +352,7 @@ NSString *backupNameSelected; UIAlertController * infoAlert= [UIAlertController alertControllerWithTitle:@"Known issues" - message:@"Scrolling through the picker view with no backups will crash the app.\n\nChanges to the list of backups are not reflected until the app is relaunched.\n\nIf a backup is not properly selected, and a button is pressed, it may cause the app to crash." + message:@"\nScrolling through the picker view with no backups will crash the app.\n" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* okay = [UIAlertAction @@ -430,7 +365,7 @@ NSString *backupNameSelected; UIAlertController * contactAlert= [UIAlertController alertControllerWithTitle:@"Contact Me" - message:@"You can contact my via Twitter or Email\n\n@micahpgomez\n\nmpg13@micahpgomez.dev\n\nhttps://www.micahpgomez.dev" + message:@"\nYou can contact my via Twitter or Email\n\n@micahpgomez\n\nmpg13@micahpgomez.dev\n\nhttps://www.micahpgomez.dev" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* okey = [UIAlertAction @@ -507,6 +442,29 @@ NSString *backupNameSelected; [deleteTask launch]; [deleteTask waitUntilExit]; + UIAlertController * deleteFinishedAlert= [UIAlertController + alertControllerWithTitle:@"Backup Deleted" + message:@"The backup has been deleted successfully" + preferredStyle:UIAlertControllerStyleAlert]; + + UIAlertAction* okey = [UIAlertAction + actionWithTitle:@"ok" + style:UIAlertActionStyleDefault + handler:^(UIAlertAction * action) + { + + _backupFolderArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/Library/FlashBack/Backups/" error:nil]; + [self->selectedBackupPickerView reloadAllComponents]; + + [deleteFinishedAlert dismissViewControllerAnimated:YES completion:nil]; + + }]; + + [deleteFinishedAlert addAction:okey]; + + [self presentViewController:deleteFinishedAlert animated:YES completion:nil]; + + [deleteBackupAlert dismissViewControllerAnimated:YES completion:nil]; }]; @@ -525,10 +483,10 @@ NSString *backupNameSelected; [self presentViewController:deleteBackupAlert animated:YES completion:nil]; + + } - - - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. @@ -542,6 +500,30 @@ NSString *backupNameSelected; -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{ + + //NEED TO FIGURE OUT HOW TO CHECK FOR EMPTY LIST + 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; @@ -558,7 +540,7 @@ NSString *backupNameSelected; selectedBackupImage.image = [UIImage imageWithData:data]; NSLog(@"%@", backupNameSelected); - + } } -(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{