Skip to content

Commit

Permalink
Drop rocketbootstrap, drop Cephei on iOS >=11, switch to libSandy, ad…
Browse files Browse the repository at this point in the history
…d get_webkit.sh script
  • Loading branch information
opa334 committed Aug 2, 2022
1 parent d079555 commit da468ba
Show file tree
Hide file tree
Showing 44 changed files with 269 additions and 807 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.theos/
.DS_Store
packages/
.WebKit
.vscode
16 changes: 2 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,21 @@ export SIMJECT ?= 0
export ROOTLESS ?= 0
export NO_DEPENDENCIES ?= 0
export DEBUG_LOGGING ?= 0
export NO_CEPHEI ?= 0
export NO_ROCKETBOOTSTRAP ?= 0
export NO_LIBCSCOLORPICKER ?= 0

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

ifeq ($(SIMJECT),1)
export NO_CEPHEI = 1
export NO_ROCKETBOOTSTRAP = 1
export TARGET = simulator:clang:14.5:8.0
export ARCHS = x86_64 i386
else
export TARGET = iphone:clang:14.4:8.0
export TARGET = iphone:clang:14.5:8.0
export ARCHS = armv7 armv7s arm64 arm64e
endif

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

Expand All @@ -32,13 +26,7 @@ include $(THEOS)/makefiles/common.mk

include $(THEOS_MAKE_PATH)/tweak.mk

SUBPROJECTS += MobileSafari WebContent

ifeq ($(NO_ROCKETBOOTSTRAP),0)
SUBPROJECTS += SpringBoard
endif

SUBPROJECTS += Preferences
SUBPROJECTS = MobileSafari WebContent SpringBoard Preferences

include $(THEOS_MAKE_PATH)/aggregate.mk

Expand Down
34 changes: 0 additions & 34 deletions MobileSafari/Classes/SPCommunicationManager.h

This file was deleted.

134 changes: 0 additions & 134 deletions MobileSafari/Classes/SPCommunicationManager.mm

This file was deleted.

8 changes: 6 additions & 2 deletions MobileSafari/Classes/SPDownloadBrowserTableViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#import "SPFileBrowserTableViewController.h"
#import "SPFileTableViewCell.h"
#import "SPLocalizationManager.h"
#import "SPCommunicationManager.h"
#import "SPFileManager.h"
#import "../../Shared/SPFile.h"

Expand Down Expand Up @@ -276,6 +275,7 @@ - (void)previewControllerDidDismiss:(QLPreviewController *)controller

- (void)didSelectFile:(SPFile*)file atIndexPath:(NSIndexPath*)indexPath
{
BOOL callSuper = YES;
if([file displaysAsRegularFile])
{
//Only cache one hard link at most
Expand All @@ -299,6 +299,7 @@ - (void)didSelectFile:(SPFile*)file atIndexPath:(NSIndexPath*)indexPath
if(!file.isRegularFile)
{
[openAlert addAction:[self showContentActionForFile:file withIndexPath:indexPath]];
callSuper = NO;
}

if([file isHLSStream])
Expand Down Expand Up @@ -361,7 +362,10 @@ - (void)didSelectFile:(SPFile*)file atIndexPath:(NSIndexPath*)indexPath
[self presentViewController:openAlert animated:YES completion:nil];
}

[super didSelectFile:file atIndexPath:indexPath];
if(callSuper)
{
[super didSelectFile:file atIndexPath:indexPath];
}
}

//Downloads are section 0, files are section 1
Expand Down
16 changes: 6 additions & 10 deletions MobileSafari/Classes/SPDownloadManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#import "SPDownloadInfo.h"
#import "SPLocalizationManager.h"
#import "SPPreferenceManager.h"
#import "SPCommunicationManager.h"
#import "SPCacheManager.h"
#import "SPStatusBarNotification.h"
#import "SPStatusBarNotificationWindow.h"
Expand Down Expand Up @@ -97,7 +96,7 @@ - (instancetype)init

- (void)setUpDefaultDownloadURL
{
if(preferenceManager.customDefaultPathEnabled && preferenceManager.customDefaultPath && preferenceManager.unsandboxSafariEnabled && rocketBootstrapWorks)
if(preferenceManager.customDefaultPathEnabled && preferenceManager.customDefaultPath && [preferenceManager unsandboxSafariEnabled] && libSandyWorks)
{
self.defaultDownloadURL = [fileManager resolveSymlinkForURL:[NSURL fileURLWithPath:[@"/var" stringByAppendingString:preferenceManager.customDefaultPath]]];

Expand All @@ -106,9 +105,9 @@ - (void)setUpDefaultDownloadURL
return;
}
}
else if(!rocketBootstrapWorks || !preferenceManager.unsandboxSafariEnabled)
else if(![preferenceManager unsandboxSafariEnabled] || !libSandyWorks)
{
self.defaultDownloadURL = [NSURL fileURLWithPath:[NSHomeDirectory() stringByAppendingString:@"/Documents/Downloads"]];
self.defaultDownloadURL = [NSURL fileURLWithPath:SANDBOXED_DOWNLOAD_PATH];

if([self createDownloadDirectoryIfNeeded])
{
Expand All @@ -133,11 +132,9 @@ - (BOOL)createDownloadDirectoryIfNeeded

- (void)migrateFromSandbox
{
#ifndef NO_ROCKETBOOTSTRAP
HBLogDebugWeak(@"migrateFromSandbox sandboxed: %d", fileManager.sandboxed);
if(!fileManager.sandboxed)
if([preferenceManager unsandboxSafariEnabled] && libSandyWorks)
{
NSURL* oldDownloadURL = [NSURL fileURLWithPath:OLD_DOWNLOAD_PATH];
NSURL* oldDownloadURL = [NSURL fileURLWithPath:SANDBOXED_DOWNLOAD_PATH];

if([fileManager fileExistsAtURL:oldDownloadURL error:nil])
{
Expand All @@ -155,11 +152,10 @@ - (void)migrateFromSandbox
[fileManager removeItemAtURL:oldDownloadURL error:nil];

sendSimpleAlert([localizationManager localizedSPStringForKey:@"MIGRATION_TITLE"],
[NSString stringWithFormat:[localizationManager localizedSPStringForKey:@"MIGRATION_MESSAGE"], OLD_DOWNLOAD_PATH, self.defaultDownloadURL.path]);
[NSString stringWithFormat:[localizationManager localizedSPStringForKey:@"MIGRATION_MESSAGE"], SANDBOXED_DOWNLOAD_PATH, self.defaultDownloadURL.path]);
}
}
}
#endif
}

- (void)verifyDownloadStorageRevision
Expand Down
5 changes: 1 addition & 4 deletions MobileSafari/Classes/SPFileManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,19 @@ typedef NSString *NSFileAttributeKey;
NSDictionary* _displayNamesForPaths;
}

@property (nonatomic, getter=isSandboxed) BOOL sandboxed;

+ (instancetype)sharedInstance;
#ifndef PREFERENCES
- (void)resetHardLinks;
- (NSURL*)accessibleHardLinkForFileAtURL:(NSURL*)URL;
- (NSString*)applicationDisplayNameForURL:(NSURL*)URL;
#ifndef NO_ROCKETBOOTSTRAP
- (BOOL)_isReadable:(const char*)str;
- (BOOL)_isWritable:(const char*)str;
- (BOOL)isPathReadable:(NSString*)path;
- (BOOL)isURLReadable:(NSURL*)URL;
- (BOOL)isPathWritable:(NSString*)path;
- (BOOL)isURLWritable:(NSURL*)URL;
#endif
#endif
- (void)populateApplicationDisplayNamesForPath;
- (NSArray<SPFile*>*)filesAtURL:(NSURL*)URL error:(NSError**)error;
- (BOOL)fileExistsAtURL:(NSURL*)url error:(NSError**)error;
- (BOOL)isDirectoryAtURL:(NSURL*)url error:(NSError**)error;
Expand Down
Loading

0 comments on commit da468ba

Please sign in to comment.