Skip to content

Commit 04433a9

Browse files
NyaMistyPoomSmartNSExceptional
authored
iOS 15 and rootless support (#44)
Co-authored-by: Thatchapon Unprasert <thatchapon.unp@outlook.com> Co-authored-by: Tanner Bennett <tannerbennett@me.com>
1 parent 07d0ad6 commit 04433a9

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

Interfaces.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ extern SEL show;
6868
- (void)_statusBarTapped:(id)sender type:(NSInteger)type;
6969
@end
7070

71+
@interface _UISheetDetent : NSObject
72+
+ (instancetype)_mediumDetent;
73+
+ (instancetype)_largeDetent;
74+
@end
75+
7176
@interface _UISheetPresentationController : UIPresentationController
7277
@property (setter=_setDetents:) NSArray *_detents;
7378
@property (setter=_setWantsFullScreen:) BOOL _wantsFullScreen;

Tweak.xm

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99

1010
#import "Interfaces.h"
11+
#import <rootless.h>
1112

1213
BOOL initialized = NO;
1314
id manager = nil;
@@ -25,6 +26,7 @@ inline bool isLikelyUIProcess() {
2526

2627
return [executablePath hasPrefix:@"/var/containers/Bundle/Application"] ||
2728
[executablePath hasPrefix:@"/Applications"] ||
29+
[executablePath containsString:@"/procursus/Applications"] ||
2830
[executablePath hasSuffix:@"CoreServices/SpringBoard.app/SpringBoard"];
2931
}
3032

@@ -38,8 +40,8 @@ inline BOOL flexAlreadyLoaded() {
3840
}
3941

4042
%ctor {
41-
NSString *standardPath = @"/Library/MobileSubstrate/DynamicLibraries/libFLEX.dylib";
42-
NSString *reflexPath = @"/Library/MobileSubstrate/DynamicLibraries/libreflex.dylib";
43+
NSString *standardPath = ROOT_PATH_NS(@"/Library/MobileSubstrate/DynamicLibraries/libFLEX.dylib");
44+
NSString *reflexPath = ROOT_PATH_NS(@"/Library/MobileSubstrate/DynamicLibraries/libreflex.dylib");
4345
NSFileManager *disk = NSFileManager.defaultManager;
4446
NSString *libflex = nil;
4547
NSString *libreflex = nil;
@@ -149,7 +151,11 @@ inline BOOL flexAlreadyLoaded() {
149151
self = %orig;
150152
if ([present isKindOfClass:%c(FLEXNavigationController)]) {
151153
// Enable half height sheet
152-
self._presentsAtStandardHalfHeight = YES;
154+
if ([self respondsToSelector:@selector(_presentsAtStandardHalfHeight)]) {
155+
self._presentsAtStandardHalfHeight = YES;
156+
} else {
157+
self._detents = @[[%c(_UISheetDetent) _mediumDetent], [%c(_UISheetDetent) _largeDetent]];
158+
}
153159
// Start fullscreen, 0 for half height
154160
self._indexOfCurrentDetent = 1;
155161
// Don't expand unless dragged up

0 commit comments

Comments
 (0)