started a few changes for restoreBackup function- nothing there works yet

This commit is contained in:
Micah Gomez 2020-01-21 14:24:15 -08:00
parent 239e898d52
commit 6fdd1123e7
22 changed files with 12 additions and 7 deletions

View file

@ -56,6 +56,8 @@ UIImage *darkLock;
@implementation ViewController @implementation ViewController
//MARK: Handle bools for optional appliances
- (IBAction)tweaksSwitch:(id)sender { - (IBAction)tweaksSwitch:(id)sender {
tweaksEnabled = [sender isOn]; tweaksEnabled = [sender isOn];
@ -80,6 +82,8 @@ UIImage *darkLock;
} }
//MARK: Create backup function
- (IBAction)createBackup:(id)sender { - (IBAction)createBackup:(id)sender {
UIAlertController *createBackupAlert = [UIAlertController alertControllerWithTitle:@"Enter the Backup Name" message:@"Please do not use special symbols. Use only letters and numbers, no spaces." preferredStyle:UIAlertControllerStyleAlert]; UIAlertController *createBackupAlert = [UIAlertController alertControllerWithTitle:@"Enter the Backup Name" message:@"Please do not use special symbols. Use only letters and numbers, no spaces." preferredStyle:UIAlertControllerStyleAlert];
@ -98,8 +102,6 @@ UIImage *darkLock;
else{ else{
NSLog(@"Creating Backup"); NSLog(@"Creating Backup");
//MARK: Create Backup Code
//MARK: Backup preferences //MARK: Backup preferences
if(tweaksEnabled == YES){ if(tweaksEnabled == YES){
_prefsFolderItemsRaw = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/var/mobile/Library/Preferences/" error:nil]; _prefsFolderItemsRaw = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/var/mobile/Library/Preferences/" error:nil];
@ -267,6 +269,7 @@ UIImage *darkLock;
} }
//MARK: Wallpaper selection code //MARK: Wallpaper selection code
-(void)selectWallpaperImageFunc{ -(void)selectWallpaperImageFunc{
UIAlertController *wallpaperSelectionAlert = [UIAlertController alertControllerWithTitle:@"Select Setup Wallpapers" message:@"Choose the wallpapers to apply for both Light and Dark mode on the Home and Lock Screen." preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertController *wallpaperSelectionAlert = [UIAlertController alertControllerWithTitle:@"Select Setup Wallpapers" message:@"Choose the wallpapers to apply for both Light and Dark mode on the Home and Lock Screen." preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction* lightHomeAction = [UIAlertAction actionWithTitle:@"Light Mode Home Screen" UIAlertAction* lightHomeAction = [UIAlertAction actionWithTitle:@"Light Mode Home Screen"
@ -399,8 +402,7 @@ UIImage *darkLock;
[self presentViewController:wallpaperSelectionAlert animated:YES completion:nil]; [self presentViewController:wallpaperSelectionAlert animated:YES completion:nil];
} }
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info{
{
switch (selectedWallpaperStyle) { switch (selectedWallpaperStyle) {
@ -425,21 +427,24 @@ UIImage *darkLock;
[self selectWallpaperImageFunc]; [self selectWallpaperImageFunc];
} }
-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker -(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
{
NSLog(@"picker cancelled"); NSLog(@"picker cancelled");
[picker dismissViewControllerAnimated:YES completion:nil]; [picker dismissViewControllerAnimated:YES completion:nil];
[self selectWallpaperImageFunc]; [self selectWallpaperImageFunc];
} }
//MARK: End wallpaper selection code //MARK: Restore backup function
- (IBAction)restoreBackup:(id)sender { - (IBAction)restoreBackup:(id)sender {
lightHome = [UIImage imageWithContentsOfFile:@"/Library/FlashBack/Backups/3/SBFolder/LockBackgroundThumbnail.jpg"]; lightHome = [UIImage imageWithContentsOfFile:@"/Library/FlashBack/Backups/3/SBFolder/LockBackgroundThumbnail.jpg"];
//darkHome = [UIImage imageWithContentsOfCPBitmapFile:@"/Library/FlashBack/Backups/3/SBFolder/LockBackgrounddark.cpbitmap" flags:kNilOptions];; //darkHome = [UIImage imageWithContentsOfCPBitmapFile:@"/Library/FlashBack/Backups/3/SBFolder/LockBackgrounddark.cpbitmap" flags:kNilOptions];;
//lock screen
setLightAndDarkWallpaperImages(lightHome, lightHome, 1); setLightAndDarkWallpaperImages(lightHome, lightHome, 1);
//home screen
setLightAndDarkWallpaperImages(lightHome, lightHome, 2);
/*if (backupNameSelected == nil){ /*if (backupNameSelected == nil){

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB