diff options
author | Jocelyn Turcotte <jturcotte@woboq.com> | 2015-06-22 14:53:05 +0300 |
---|---|---|
committer | Jocelyn Turcotte <jturcotte@woboq.com> | 2015-06-22 14:55:19 +0300 |
commit | 9797782682c66c2c48265485e5ccd950042e8eb6 (patch) | |
tree | 4a4e25e063b64bf5b40bdfda0c29ed83ccd35a9c /shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt | |
parent | 121577340ac8be79fdbf4332ed71c349469f6157 (diff) |
shell_i: Build the extension with the '-' identity by default
This allows developers to build and run the extension by default.
Official packages bundles will be re-signed after the build, we
The SocketApi prefix can be set at configure time through cmake and
should match the key that will be used to sign the whole .app bundle
(including the embedded FindexSync .appex bundle).
Diffstat (limited to 'shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt')
3 files changed, 15 insertions, 7 deletions
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m index 0ffc7c550..689cf750b 100644 --- a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m +++ b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m @@ -25,7 +25,7 @@ FIFinderSyncController *syncController = [FIFinderSyncController defaultController]; NSBundle *extBundle = [NSBundle bundleForClass:[self class]]; // This was added to the bundle's Info.plist to get it from the build system - NSString *teamIdentifierPrefix = [extBundle objectForInfoDictionaryKey:@"TeamIdentifierPrefix"]; + NSString *socketApiPrefix = [extBundle objectForInfoDictionaryKey:@"SocketApiPrefix"]; NSImage *ok = [extBundle imageForResource:@"ok.icns"]; NSImage *ok_swm = [extBundle imageForResource:@"ok_swm.icns"]; @@ -44,10 +44,18 @@ [syncController setBadgeImage:warning label:@"Ignored" forBadgeIdentifier:@"IGNORE+SWM"]; [syncController setBadgeImage:error label:@"Error" forBadgeIdentifier:@"ERROR+SWM"]; - // The Mach port name needs to be prefixed with the code signing Team ID + // The Mach port name needs to: + // - Be prefixed with the code signing Team ID + // - Then infixed with the sandbox App Group + // - The App Group itself must be a prefix of (or equal to) the application bundle identifier + // We end up in the official signed client with: 9B5WD74GWJ.com.owncloud.desktopclient.socketApi + // With ad-hoc signing (the '-' signing identity) we must drop the Team ID. + // When the code isn't sandboxed (e.g. the OC client or the legacy overlay icon extension) + // the OS doesn't seem to put any restriction on the port name, so we just follow what + // the sandboxed App Extension needs. // https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW24 - NSString *serverName = [[teamIdentifierPrefix stringByAppendingString:[extBundle bundleIdentifier]] - stringByReplacingOccurrencesOfString:@".FinderSyncExt" withString:@".socketApi"]; + NSString *serverName = [socketApiPrefix stringByAppendingString:@".socketApi"]; + // NSLog(@"FinderSync serverName %@", serverName); _syncClientProxy = [[SyncClientProxy alloc] initWithDelegate:self serverName:serverName]; _registeredDirectories = [[NSMutableSet alloc] init]; diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSyncExt.entitlements b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSyncExt.entitlements index 20605791a..5d2a36d31 100644 --- a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSyncExt.entitlements +++ b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSyncExt.entitlements @@ -6,7 +6,7 @@ <true/> <key>com.apple.security.application-groups</key> <array> - <string>$(TeamIdentifierPrefix)$(OC_APPLICATION_REV_DOMAIN)</string> + <string>$(OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX)$(OC_APPLICATION_REV_DOMAIN)</string> </array> </dict> </plist> diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/Info.plist b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/Info.plist index 36fe63e7c..88bb87e91 100644 --- a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/Info.plist +++ b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/Info.plist @@ -2,8 +2,8 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> - <key>TeamIdentifierPrefix</key> - <string>$(TeamIdentifierPrefix)</string> + <key>SocketApiPrefix</key> + <string>$(OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX)$(OC_APPLICATION_REV_DOMAIN)</string> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleDisplayName</key> |