mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-26 04:57:54 +00:00
Better, forward-compatible way of looking up NSURLQuarantinePropertiesKey, as suggested by @jakepetroules
This commit is contained in:
1 parent
5a3fd1e12a
commit
591d7d0049
3 files changed
+6
-4
No files matched your search
@@ -9,3 +9,4 @@ FRAMEWORK_VERSION = A
|
||||
INFOPLIST_FILE = Sparkle/Sparkle-Info.plist
|
||||
GCC_PREFIX_HEADER = Sparkle/Sparkle.pch
|
||||
SKIP_INSTALL = YES
|
||||
OTHER_LDFLAGS = -Wl,-U,_NSURLQuarantinePropertiesKey
|
||||
@@ -5,3 +5,4 @@ PRODUCT_NAME = $(FINISH_INSTALL_TOOL_NAME)
|
||||
SKIP_INSTALL = YES
|
||||
GCC_PREFIX_HEADER = Sparkle/Autoupdate/Autoupdate.pch
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
|
||||
OTHER_LDFLAGS = -Wl,-U,_NSURLQuarantinePropertiesKey
|
||||
Vendored
+4
-4
@@ -23,6 +23,10 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 10100
|
||||
extern NSString *const NSURLQuarantinePropertiesKey WEAK_IMPORT_ATTRIBUTE;
|
||||
#endif
|
||||
|
||||
static inline void PerformOnMainThreadSync(dispatch_block_t theBlock)
|
||||
{
|
||||
if ([NSThread isMainThread]) {
|
||||
@@ -565,7 +569,6 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
// *** MUST BE SAFE TO CALL ON NON-MAIN THREAD!
|
||||
|
||||
NSFileManager *manager = [NSFileManager defaultManager];
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9
|
||||
if (&NSURLQuarantinePropertiesKey) {
|
||||
NSURL *rootURL = [NSURL fileURLWithPath:root];
|
||||
[rootURL setResourceValue:[NSNull null] forKey:NSURLQuarantinePropertiesKey error:NULL];
|
||||
@@ -585,7 +588,6 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
NSString *const quarantineAttribute = (NSString*)kLSItemQuarantineProperties;
|
||||
const int removeXAttrOptions = XATTR_NOFOLLOW;
|
||||
|
||||
@@ -609,9 +611,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
options:removeXAttrOptions];
|
||||
}
|
||||
}
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user