Skip to content

Commit 6cb6f7c

Browse files
committed
fix restarting on web ui & bump version
1 parent 417d72c commit 6cb6f7c

File tree

5 files changed

+7
-59
lines changed

5 files changed

+7
-59
lines changed

Resources/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
<key>UILaunchStoryboardName</key>
5858
<string>LaunchScreen</string>
5959
<key>CFBundleVersion</key>
60-
<string>0.2.0</string>
60+
<string>0.3.0</string>
6161
<key>CFBundleShortVersionString</key>
62-
<string>0.2.0</string>
62+
<string>0.3.0</string>
6363
<key>LSRequiresIPhoneOS</key>
6464
<true/>
6565
<key>UIDeviceFamily</key>

TweakLoader/UIKit+GuestHooks.m

-45
Original file line numberDiff line numberDiff line change
@@ -167,36 +167,6 @@ void LCOpenWebPage(NSString* webPageUrlString, NSString* originalUrl) {
167167

168168
}
169169

170-
void authenticateUser(void (^completion)(BOOL success, NSError *error)) {
171-
LAContext *context = [[LAContext alloc] init];
172-
NSError *error = nil;
173-
174-
if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:&error]) {
175-
NSString *reason = @"lc.utils.requireAuthentication";
176-
177-
// Evaluate the policy for both biometric and passcode authentication
178-
[context evaluatePolicy:LAPolicyDeviceOwnerAuthentication
179-
localizedReason:reason
180-
reply:^(BOOL success, NSError * _Nullable evaluationError) {
181-
dispatch_async(dispatch_get_main_queue(), ^{
182-
if (success) {
183-
completion(YES, nil);
184-
} else {
185-
completion(NO, evaluationError);
186-
}
187-
});
188-
}];
189-
} else {
190-
dispatch_async(dispatch_get_main_queue(), ^{
191-
if([error code] == LAErrorPasscodeNotSet) {
192-
completion(YES, nil);
193-
} else {
194-
completion(NO, error);
195-
}
196-
});
197-
}
198-
}
199-
200170
void handleLiveContainerLaunch(NSURL* url) {
201171
// If it's not current app, then switch
202172
// check if there are other LCs is running this app
@@ -238,21 +208,6 @@ void handleLiveContainerLaunch(NSURL* url) {
238208

239209
if(!bundle || ([lcAppInfo[@"isHidden"] boolValue] && [NSUserDefaults.gcSharedDefaults boolForKey:@"LCStrictHiding"])) {
240210
LCShowAppNotFoundAlert(bundleName);
241-
} else if ([lcAppInfo[@"isLocked"] boolValue]) {
242-
// need authentication
243-
authenticateUser(^(BOOL success, NSError *error) {
244-
if (success) {
245-
LCShowSwitchAppConfirmation(url, bundleName);
246-
} else {
247-
if ([error.domain isEqualToString:LAErrorDomain]) {
248-
if (error.code != LAErrorUserCancel) {
249-
NSLog(@"[LC] Authentication Error: %@", error.localizedDescription);
250-
}
251-
} else {
252-
NSLog(@"[LC] Authentication Error: %@", error.localizedDescription);
253-
}
254-
}
255-
});
256211
} else {
257212
LCShowSwitchAppConfirmation(url, bundleName);
258213
}

WebServerLib/WebServer.m

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
#import "src/components/LogUtils.h"
44
#import "src/WebServer.h"
5-
#define WebAppLog(x...) [NSClassFromString(@"LogUtils") log:x];
65

76
__attribute__((constructor))
87
static void WebServerConstructor() {
9-
WebAppLog(@"WebServer Library Loaded!");
10-
[[NSClassFromString(@"WebServer") alloc] initServer];
8+
[NSClassFromString(@"LogUtils") log:@"WebServer Library Loaded!"];
9+
[[NSClassFromString(@"WebServer") alloc] initServer];
1110
}
12-

control

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: com.geode.launcher
22
Name: Geode
3-
Version: 0.2.0
3+
Version: 0.3.0
44
Architecture: iphoneos-arm
55
Description: Geode launcher helper for iOS!
66
Maintainer: Firee

src/WebServer.m

+2-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
@implementation WebServer
1414
- (void)initServer {
15-
1615
if ([[Utils getPrefsGC] boolForKey:@"WEB_SERVER"]) {
1716
__weak WebServer* weakSelf = self;
1817
self.webServer = [[GCDWebServer alloc] init];
@@ -31,6 +30,7 @@ - (void)initServer {
3130
infoPlistPath = [[[LCPath bundlePath] URLByAppendingPathComponent:[Utils gdBundleName]] URLByAppendingPathComponent:@"Info.plist"].path;
3231
}
3332
}
33+
//[NSClassFromString(@"WebSharedClass") forceRestart];
3434
NSDictionary* infoDictionary = [NSDictionary dictionaryWithContentsOfFile:infoPlistPath];
3535

3636
NSString* model = [[UIDevice currentDevice] localizedModel];
@@ -83,12 +83,7 @@ - (void)initServer {
8383
[self.webServer addHandlerForMethod:@"POST" path:@"/launch" requestClass:[GCDWebServerRequest class] processBlock:^GCDWebServerResponse*(GCDWebServerRequest* request) {
8484
GCDWebServerDataResponse* response = [GCDWebServerDataResponse responseWithStatusCode:200];
8585
if ([Utils isContainerized]) {
86-
NSString* openURL = [NSString stringWithFormat:@"geode://relaunch"];
87-
NSURL* url = [NSURL URLWithString:openURL];
88-
if ([[NSClassFromString(@"UIApplication") sharedApplication] canOpenURL:url]) {
89-
//[[NSClassFromString(@"UIApplication") sharedApplication] openURL:url options:@{} completionHandler:nil];
90-
return response;
91-
};
86+
[NSClassFromString(@"LCSharedUtils") relaunchApp];
9287
return response;
9388
}
9489
if ([[Utils getPrefsGC] boolForKey:@"MANUAL_REOPEN"] && ![[Utils getPrefs] boolForKey:@"USE_TWEAK"]) {

0 commit comments

Comments
 (0)