From 7af88bca9f4926adaa3b1a45d6a1c4e2acacacc8 Mon Sep 17 00:00:00 2001 From: Eilionoir Tunnicliff Date: Tue, 17 Jan 2023 09:53:04 -0500 Subject: [PATCH 1/2] 2.1.3 - Fix for AppSync Unified installations This should set the home directory to /var/mobile/Documents/PojavLauncher. Not the best solution, so we will recommend using regular sideloading methods. --- Natives/main.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Natives/main.m b/Natives/main.m index 52d928f6d2..0145931974 100644 --- a/Natives/main.m +++ b/Natives/main.m @@ -313,8 +313,12 @@ int main(int argc, char * argv[]) { setenv("BUNDLE_PATH", dirname(argv[0]), 1); setenv("HOME", [NSFileManager.defaultManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] .lastObject.path.stringByDeletingLastPathComponent.UTF8String, 1); - // WARNING: THIS DIRECTS TO /var/mobile/Documents IF INSTALLED WITH APPSYNC UNIFIED - setenv("POJAV_HOME", [NSString stringWithFormat:@"%s/Documents", getenv("HOME")].UTF8String, 1); + if(strcmp(getenv("HOME"), "/var/mobile") == 0) { + [fm createDirectoryAtPath:@"/var/mobile/Documents/PojavLauncher withIntermediateDirectories:NO attributes:nil error:nil]; + setenv("POJAV_HOME", [NSString stringWithFormat:@"%s/Documents/PojavLauncher", getenv("HOME")].UTF8String, 1); + } else { + setenv("POJAV_HOME", [NSString stringWithFormat:@"%s/Documents", getenv("HOME")].UTF8String, 1); + } [fm createDirectoryAtPath:@(getenv("POJAV_HOME")) withIntermediateDirectories:NO attributes:nil error:nil]; From 4c229a247eb25e507ffea903677882289f46083f Mon Sep 17 00:00:00 2001 From: Eilionoir Tunnicliff Date: Tue, 17 Jan 2023 09:59:29 -0500 Subject: [PATCH 2/2] 2.1.3 - No need to have this line --- Natives/main.m | 1 - 1 file changed, 1 deletion(-) diff --git a/Natives/main.m b/Natives/main.m index 0145931974..7ce55c0dfc 100644 --- a/Natives/main.m +++ b/Natives/main.m @@ -314,7 +314,6 @@ int main(int argc, char * argv[]) { setenv("HOME", [NSFileManager.defaultManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] .lastObject.path.stringByDeletingLastPathComponent.UTF8String, 1); if(strcmp(getenv("HOME"), "/var/mobile") == 0) { - [fm createDirectoryAtPath:@"/var/mobile/Documents/PojavLauncher withIntermediateDirectories:NO attributes:nil error:nil]; setenv("POJAV_HOME", [NSString stringWithFormat:@"%s/Documents/PojavLauncher", getenv("HOME")].UTF8String, 1); } else { setenv("POJAV_HOME", [NSString stringWithFormat:@"%s/Documents", getenv("HOME")].UTF8String, 1);