diff --git a/Natives/LauncherMenuViewController.m b/Natives/LauncherMenuViewController.m index 4f7a83e0..a326ed11 100644 --- a/Natives/LauncherMenuViewController.m +++ b/Natives/LauncherMenuViewController.m @@ -248,13 +248,16 @@ if (isDemo) { // Remove the prefix "Demo." subtitle = localize(@"login.option.demo", nil); + setenv("DEMO_LOCK", "1", 1); setenv("POJAV_GAME_DIR", [NSString stringWithFormat:@"%s/.demo", getenv("POJAV_HOME")].UTF8String, 1); } else if (selected[@"xboxGamertag"] == nil) { subtitle = localize(@"login.option.local", nil); + unsetenv("DEMO_LOCK"); setenv("POJAV_GAME_DIR", [NSString stringWithFormat:@"%s/Library/Application Support/minecraft", getenv("POJAV_HOME")].UTF8String, 1); } else { // Display the Xbox gamertag for online accounts subtitle = selected[@"xboxGamertag"]; + unsetenv("DEMO_LOCK"); setenv("POJAV_GAME_DIR", [NSString stringWithFormat:@"%s/Library/Application Support/minecraft", getenv("POJAV_HOME")].UTF8String, 1); } diff --git a/Natives/authenticator/LocalAuthenticator.m b/Natives/authenticator/LocalAuthenticator.m index e773bf4f..a20e2245 100644 --- a/Natives/authenticator/LocalAuthenticator.m +++ b/Natives/authenticator/LocalAuthenticator.m @@ -6,6 +6,9 @@ self.authData[@"oldusername"] = self.authData[@"username"] = self.authData[@"input"]; self.authData[@"accessToken"] = @"0"; self.authData[@"profileId"] = @"00000000-0000-0000-0000-000000000000"; + if(getenv("DEMO_LOCK")) { + unsetenv("DEMO_LOCK"); + } setenv("POJAV_GAME_DIR", [NSString stringWithFormat:@"%s/Library/Application Support/minecraft", getenv("POJAV_HOME")].UTF8String, 1); callback(nil, [super saveChanges]); } diff --git a/Natives/authenticator/MicrosoftAuthenticator.m b/Natives/authenticator/MicrosoftAuthenticator.m index 230fc51e..840adf61 100644 --- a/Natives/authenticator/MicrosoftAuthenticator.m +++ b/Natives/authenticator/MicrosoftAuthenticator.m @@ -185,6 +185,9 @@ typedef void(^XSTSCallback)(NSString *xsts, NSString *uhs); self.authData[@"profilePicURL"] = [NSString stringWithFormat:@"https://mc-heads.net/head/%@/120", self.authData[@"profileId"]]; self.authData[@"oldusername"] = self.authData[@"username"]; self.authData[@"username"] = response[@"name"]; + if(getenv("DEMO_LOCK")) { + unsetenv("DEMO_LOCK"); + } setenv("POJAV_GAME_DIR", [NSString stringWithFormat:@"%s/Library/Application Support/minecraft", getenv("POJAV_HOME")].UTF8String, 1); callback(nil, [super saveChanges]); } failure:^(NSURLSessionDataTask *task, NSError *error) {