Skip to content

Commit df28468

Browse files
committed
Remove contentious wokrarounds
1 parent 25131e8 commit df28468

File tree

3 files changed

+0
-18
lines changed

3 files changed

+0
-18
lines changed

CoreFoundation/PlugIn.subproj/CFBundle_Main.c

-8
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,12 @@ static CFBundleRef _CFBundleGetMainBundleAlreadyLocked(void) {
7979
CFStringRef str = NULL;
8080
CFURLRef executableURL = NULL, bundleURL = NULL;
8181
_initedMainBundle = true;
82-
#if DEPLOYMENT_TARGET_ANDROID
83-
const char *bundlePath = getenv("CFFIXED_USER_HOME") ?: getenv("TMPDIR") ?: "/data/local/tmp";
84-
CFStringRef bundleRef = CFStringCreateWithFileSystemRepresentation(kCFAllocatorNull, bundlePath);
85-
bundleURL = CFRetain(CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, bundleRef,
86-
PLATFORM_PATH_STYLE, false));
87-
CFRelease(bundleRef);
88-
#else
8982
processPath = _CFProcessPath();
9083
if (processPath) {
9184
str = CFStringCreateWithFileSystemRepresentation(kCFAllocatorSystemDefault, processPath);
9285
if (!executableURL) executableURL = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, str, PLATFORM_PATH_STYLE, false);
9386
}
9487
if (executableURL) bundleURL = _CFBundleCopyBundleURLForExecutableURL(executableURL);
95-
#endif
9688
if (bundleURL) {
9789
// make sure that main bundle has executable path
9890
//??? what if we are not the main executable in the bundle?

CoreFoundation/Preferences.subproj/CFPreferences.c

-4
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,7 @@ static CFURLRef _CFPreferencesURLForStandardDomainWithSafetyLevel(CFStringRef do
440440
CFURLRef theURL = NULL;
441441
CFAllocatorRef prefAlloc = __CFPreferencesAllocator();
442442
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_WINDOWS
443-
#if DEPLOYMENT_TARGET_ANDROID
444-
CFURLRef prefDir = CFBundleCopyBundleURL(CFBundleGetMainBundle());
445-
#else
446443
CFURLRef prefDir = _preferencesDirectoryForUserHostSafetyLevel(userName, hostName, safeLevel);
447-
#endif
448444
CFStringRef appName;
449445
CFStringRef fileName;
450446
Boolean mustFreeAppName = false;

Foundation/Bundle.swift

-6
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,9 @@ open class Bundle: NSObject {
5353
self.init(path: url.path)
5454
}
5555

56-
#if os(Android)
57-
public convenience init(for aClass: AnyClass) {
58-
self.init(path: Bundle.main.bundlePath)!
59-
}
60-
#else
6156
public init(for aClass: AnyClass) {
6257
NSUnimplemented()
6358
}
64-
#endif
6559

6660
public init?(identifier: String) {
6761
super.init()

0 commit comments

Comments
 (0)