Skip to content

Commit 3e57ba1

Browse files
authored
Merge pull request #2520 from Molanda/fix_android_bundle_path
[Android] Use CFFIXED_USER_HOME for bundle path
2 parents 0b77b0f + 8970f69 commit 3e57ba1

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)