Skip to content

Commit 8970f69

Browse files
committed
Configure main bundle to use CFFIXED_USER_HOME for Android
1 parent f62c026 commit 8970f69

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

CoreFoundation/PlugIn.subproj/CFBundle_Executable.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,20 @@ static CFURLRef _CFBundleCopyBundleURLForExecutablePath(CFStringRef str) {
310310
CFIndex buffLen;
311311
CFURLRef url = NULL;
312312
CFStringRef outstr;
313+
314+
#if TARGET_OS_ANDROID
315+
const char *fixedUserHome = __CFgetenv("CFFIXED_USER_HOME");
316+
if (fixedUserHome) {
317+
outstr = CFStringCreateWithCString(kCFAllocatorSystemDefault, fixedUserHome, kCFStringEncodingUTF8);
318+
if (outstr) {
319+
url = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, outstr, PLATFORM_PATH_STYLE, true);
320+
CFRelease(outstr);
321+
if (url) {
322+
return url;
323+
}
324+
}
325+
}
326+
#endif
313327

314328
buffLen = CFStringGetLength(str);
315329
if (buffLen > CFMaxPathSize) buffLen = CFMaxPathSize;

0 commit comments

Comments
 (0)