Skip to content

Commit

Permalink
1.7~b1
Browse files Browse the repository at this point in the history
  • Loading branch information
opa334 committed Apr 15, 2019
1 parent bbfc768 commit 0b28128
Show file tree
Hide file tree
Showing 170 changed files with 7,482 additions and 2,712 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.theos/
.DS_Store
packages/
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,28 @@ export NO_DEPENDENCIES ?= 0
export DEBUG_LOGGING ?= 0
export NO_CEPHEI ?= 0
export NO_ROCKETBOOTSTRAP ?= 0
export NO_LIBCOLORPICKER ?= 0
export NO_LIBCSCOLORPICKER ?= 0
export NO_LIBBULLETIN ?= 0

ifeq ($(ROOTLESS),1)
export NO_DEPENDENCIES = 1
endif

ifeq ($(SIMJECT),1)
export NO_DEPENDENCIES = 1
export TARGET = simulator:clang:9.2:8.0
export NO_CEPHEI = 1
export NO_ROCKETBOOTSTRAP = 1
export NO_LIBBULLETIN = 1
export TARGET = simulator:clang:12.1:8.0
export ARCHS = x86_64 i386
else
export TARGET = iphone:clang:11.2:8.0
export ARCHS = arm64 armv7
export TARGET = iphone:clang:12.1.2:8.0
export ARCHS = armv7 armv7s arm64
endif

ifeq ($(NO_DEPENDENCIES),1)
export NO_CEPHEI = 1
export NO_ROCKETBOOTSTRAP = 1
export NO_LIBCOLORPICKER = 1
export NO_LIBCSCOLORPICKER = 1
export NO_LIBBULLETIN = 1
endif

Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/AVActivityButton.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// AVActivityButton.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/AVActivityButton.xm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// AVActivityButton.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
8 changes: 7 additions & 1 deletion MobileSafari/Classes/SPCacheManager.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPCacheManager.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand All @@ -19,6 +19,7 @@
NSURL* _cacheURL;
NSMutableDictionary* _miscPlist;
NSMutableDictionary* _desktopButtonStates;
NSMutableDictionary* _tabStateAdditions;
}

+ (instancetype)sharedInstance;
Expand All @@ -41,4 +42,9 @@
- (void)setDesktopButtonState:(BOOL)state forUUID:(NSUUID*)UUID;
- (BOOL)desktopButtonStateForUUID:(NSUUID*)UUID;

- (void)loadTabStateAdditions;
- (void)saveTabStateAdditions;
- (BOOL)isTabWithUUIDLocked:(NSUUID*)UUID;
- (void)setLocked:(BOOL)locked forTabWithUUID:(NSUUID*)UUID;

@end
78 changes: 75 additions & 3 deletions MobileSafari/Classes/SPCacheManager.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPCacheManager.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -148,7 +148,7 @@ - (void)saveDownloadCache:(NSDictionary*)downloadCache
{
NSURL* downloadCacheURL = [_cacheURL URLByAppendingPathComponent:@"downloads.plist"];

//Create data from pendingDownloads
//Create archived data from pendingDownloads
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:downloadCache];

//Write data to file
Expand Down Expand Up @@ -217,7 +217,11 @@ - (void)setDesktopButtonState:(BOOL)state forUUID:(NSUUID*)UUID
//Get desktop button state for browserController UUID
- (BOOL)desktopButtonStateForUUID:(NSUUID*)UUID
{
[self loadDesktopButtonStates];
if(!_desktopButtonStates)
{
[self loadDesktopButtonStates];
}


if(UUID)
{
Expand All @@ -227,4 +231,72 @@ - (BOOL)desktopButtonStateForUUID:(NSUUID*)UUID
return [[_desktopButtonStates objectForKey:@"Enabled"] boolValue];
}

- (void)loadTabStateAdditions
{
NSURL* tabStateAdditionsURL = [_cacheURL URLByAppendingPathComponent:@"tabStateAdditions.plist"];

//Get data
NSData* data = [NSData dataWithContentsOfURL:tabStateAdditionsURL];

//Unarchive data
_tabStateAdditions = [NSKeyedUnarchiver unarchiveObjectWithData:data];

if(!_tabStateAdditions)
{
_tabStateAdditions = [NSMutableDictionary new];
}
}

- (void)saveTabStateAdditions
{
NSURL* tabStateAdditionsURL = [_cacheURL URLByAppendingPathComponent:@"tabStateAdditions.plist"];

//Get archived data from dictionary
NSData* data = [NSKeyedArchiver archivedDataWithRootObject:_tabStateAdditions];

//Save data to file
[data writeToURL:tabStateAdditionsURL atomically:YES];

[self updateExcludedFromBackup];
}

- (BOOL)isTabWithUUIDLocked:(NSUUID*)UUID
{
if(!_tabStateAdditions)
{
[self loadTabStateAdditions];
}

NSMutableSet* lockedTabs = [_tabStateAdditions objectForKey:@"lockedTabs"];

BOOL locked = [lockedTabs containsObject:UUID];

return locked;
}

- (void)setLocked:(BOOL)locked forTabWithUUID:(NSUUID*)UUID
{
NSMutableSet* lockedTabs = [_tabStateAdditions objectForKey:@"lockedTabs"];

if(!lockedTabs)
{
lockedTabs = [NSMutableSet new];
[_tabStateAdditions setObject:lockedTabs forKey:@"lockedTabs"];
}

if(locked)
{
[lockedTabs addObject:UUID];
}
else
{
[lockedTabs removeObject:UUID];
}

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^
{
[self saveTabStateAdditions];
});
}

@end
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPCommunicationManager.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPCommunicationManager.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPCommunicationManager.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPCommunicationManager.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDirectoryPickerNavigationController.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDirectoryPickerNavigationController.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDirectoryPickerTableViewController.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDirectoryPickerTableViewController.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownload.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownload.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownload.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownload.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadBrowserTableViewController.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadBrowserTableViewController.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownloadInfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadInfo.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownloadInfo.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadInfo.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownloadListFinishedTableViewCell.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadListTableViewCell.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadListTableViewCell.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownloadListTableViewCell.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadListTableViewCell.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownloadListTableViewCell.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadListTableViewCell.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownloadListTableViewController.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadListTableViewController.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownloadListTableViewController.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadListTableViewController.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownloadManager.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadManager.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
22 changes: 13 additions & 9 deletions MobileSafari/Classes/SPDownloadManager.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadManager.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -363,9 +363,14 @@ - (void)removeTemporaryFileForResumeData:(NSData*)resumeData
dlog(@"removeTemporaryFileForResumeData");
dlogDownloadManager();

NSURL* tmpFileURL = [NSURL fileURLWithPath:[self pathForResumeData:resumeData]];
NSString* resumeDataPath = [self pathForResumeData:resumeData];

[fileManager removeItemAtURL:tmpFileURL error:nil];
if(resumeDataPath)
{
NSURL* tmpFileURL = [NSURL fileURLWithPath:resumeDataPath];

[fileManager removeItemAtURL:tmpFileURL error:nil];
}
}

- (void)loadDownloadsFromDisk
Expand Down Expand Up @@ -874,26 +879,25 @@ - (void)presentDirectoryPickerWithDownloadInfo:(SPDownloadInfo*)downloadInfo

- (void)presentPinnedLocationsWithDownloadInfo:(SPDownloadInfo*)downloadInfo
{
//Get pinned location names & paths
NSArray* pinnedLocationNames = [preferenceManager pinnedLocationNames];
NSArray* pinnedLocationPaths = [preferenceManager pinnedLocationPaths];
//Get pinned locations
NSArray* pinnedLocations = preferenceManager.pinnedLocations;

UIAlertController* pinnedLocationAlert = [UIAlertController
alertControllerWithTitle:[localizationManager
localizedSPStringForKey:@"PINNED_LOCATIONS"] message:nil
preferredStyle:UIAlertControllerStyleActionSheet];

for(NSString* name in pinnedLocationNames)
for(NSDictionary* pinnedLocation in pinnedLocations)
{
//Add option for each location
[pinnedLocationAlert addAction:[UIAlertAction actionWithTitle:name
[pinnedLocationAlert addAction:[UIAlertAction actionWithTitle:[pinnedLocation objectForKey:@"name"]
style:UIAlertActionStyleDefault handler:^(UIAlertAction * action)
{
//Get index of tapped action
NSInteger index = [pinnedLocationAlert.actions indexOfObject:action];

//Get URL from index
__block NSURL* pathURL = [NSURL fileURLWithPath:[pinnedLocationPaths objectAtIndex:index]];
__block NSURL* pathURL = [NSURL fileURLWithPath:[pinnedLocations[index] objectForKey:@"path"]];

//Alert for filename
UIAlertController* filenameAlert = [UIAlertController
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownloadNavigationController.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadNavigationController.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownloadNavigationController.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadNavigationController.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownloadTableViewCell.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadTableViewCell.h
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion MobileSafari/Classes/SPDownloadTableViewCell.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDownloadTableViewCell.mm
// (c) 2019 opa334
// (c) 2017 - 2019 opa334

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
Loading

0 comments on commit 0b28128

Please sign in to comment.