Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJocelyn Turcotte <jturcotte@woboq.com>2015-06-22 14:53:05 +0300
committerJocelyn Turcotte <jturcotte@woboq.com>2015-06-22 14:55:19 +0300
commit9797782682c66c2c48265485e5ccd950042e8eb6 (patch)
tree4a4e25e063b64bf5b40bdfda0c29ed83ccd35a9c /shell_integration/MacOSX
parent121577340ac8be79fdbf4332ed71c349469f6157 (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')
-rw-r--r--shell_integration/MacOSX/CMakeLists.txt9
-rw-r--r--shell_integration/MacOSX/OwnCloudFinder/ContentManager.m6
-rw-r--r--shell_integration/MacOSX/OwnCloudFinder/FinderHook.m4
-rw-r--r--shell_integration/MacOSX/OwnCloudFinder/Info.plist2
-rw-r--r--shell_integration/MacOSX/OwnCloudFinder/MenuManager.m4
-rw-r--r--shell_integration/MacOSX/OwnCloudFinder/OwnCloudFinder.xcodeproj/project.pbxproj4
-rw-r--r--shell_integration/MacOSX/OwnCloudFinder/RequestManager.h4
-rw-r--r--shell_integration/MacOSX/OwnCloudFinder/RequestManager.m17
-rw-r--r--shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m16
-rw-r--r--shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSyncExt.entitlements2
-rw-r--r--shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/Info.plist4
-rw-r--r--shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.pbxproj14
12 files changed, 52 insertions, 34 deletions
diff --git a/shell_integration/MacOSX/CMakeLists.txt b/shell_integration/MacOSX/CMakeLists.txt
index d36647fbf..b7d602ad3 100644
--- a/shell_integration/MacOSX/CMakeLists.txt
+++ b/shell_integration/MacOSX/CMakeLists.txt
@@ -1,9 +1,11 @@
if(APPLE)
add_custom_target( legacy_mac_overlayplugin ALL
- xcodebuild -workspace ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/OwnCloud.xcworkspace
- -scheme SyncStateFinder.osax -configuration Release SYMROOT=${CMAKE_CURRENT_BINARY_DIR}
- COMMENT building Legacy Mac Overlay icons)
+ xcodebuild -workspace ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/OwnCloud.xcworkspace
+ -scheme SyncStateFinder.osax -configuration Release SYMROOT=${CMAKE_CURRENT_BINARY_DIR}
+ OC_APPLICATION_REV_DOMAIN=${APPLICATION_REV_DOMAIN}
+ OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX=${SOCKETAPI_TEAM_IDENTIFIER_PREFIX}
+ COMMENT building Legacy Mac Overlay icons)
# The bundle identifier and application group need to have compatible values with the client
# to be able to open a Mach port across the extension's sandbox boundary.
@@ -14,6 +16,7 @@ add_custom_target( mac_overlayplugin ALL
-target FinderSyncExt -configuration Release SYMROOT=${CMAKE_CURRENT_BINARY_DIR}
OC_APPLICATION_NAME=${APPLICATION_NAME}
OC_APPLICATION_REV_DOMAIN=${APPLICATION_REV_DOMAIN}
+ OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX=${SOCKETAPI_TEAM_IDENTIFIER_PREFIX}
COMMENT building Mac Overlay icons)
INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Release/SyncStateFinder.osax/Contents
diff --git a/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m b/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m
index 73f017beb..e6bbc450e 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m
+++ b/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m
@@ -142,7 +142,7 @@ static OwnCloudFinderContentManager* sharedInstance = nil;
}
NSString* normalizedPath = [path decomposedStringWithCanonicalMapping];
- if (![[RequestManager sharedInstance] isRegisteredPath:normalizedPath isDirectory:isDir]) {
+ if (![[OwnCloudFinderRequestManager sharedInstance] isRegisteredPath:normalizedPath isDirectory:isDir]) {
return [NSNumber numberWithInt:0];
}
@@ -154,7 +154,7 @@ static OwnCloudFinderContentManager* sharedInstance = nil;
// Set 0 into the cache, meaning "don't have an icon, but already requested it"
[_fileNamesCache setObject:result forKey:normalizedPath];
// start the async call
- [[RequestManager sharedInstance] askForIcon:normalizedPath isDirectory:isDir];
+ [[OwnCloudFinderRequestManager sharedInstance] askForIcon:normalizedPath isDirectory:isDir];
}
if ([result intValue] == 0) {
// Show the old state while we wait for the new one
@@ -223,7 +223,7 @@ static OwnCloudFinderContentManager* sharedInstance = nil;
}
MenuManager* menuManager = [MenuManager sharedInstance];
- RequestManager* requestManager = [RequestManager sharedInstance];
+ OwnCloudFinderRequestManager* requestManager = [OwnCloudFinderRequestManager sharedInstance];
if ([[window className] isEqualToString:@"TBrowserWindow"])
{
diff --git a/shell_integration/MacOSX/OwnCloudFinder/FinderHook.m b/shell_integration/MacOSX/OwnCloudFinder/FinderHook.m
index 788c16e86..dfb6197e6 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/FinderHook.m
+++ b/shell_integration/MacOSX/OwnCloudFinder/FinderHook.m
@@ -51,7 +51,7 @@ static BOOL installed = NO;
// NSLog(@"SyncStateFinder: installing SyncState Shell extension");
- [RequestManager sharedInstance];
+ [OwnCloudFinderRequestManager sharedInstance];
// Icons
[self hookMethod:@selector(drawImage:) inClass:@"IKImageBrowserCell" toCallToTheNewMethod:@selector(OCIconOverlayHandlers_IKImageBrowserCell_drawImage:)]; // 10.7 & 10.8 & 10.9 (Icon View arrange by name)
@@ -99,7 +99,7 @@ static BOOL installed = NO;
[[IconCache sharedInstance] dealloc];
- [[RequestManager sharedInstance] dealloc];
+ [[OwnCloudFinderRequestManager sharedInstance] dealloc];
// Icons
[self hookMethod:@selector(OCIconOverlayHandlers_drawImage:) inClass:@"TIconViewCell" toCallToTheNewMethod:@selector(drawImage:)]; // 10.7 & 10.8 & 10.9
diff --git a/shell_integration/MacOSX/OwnCloudFinder/Info.plist b/shell_integration/MacOSX/OwnCloudFinder/Info.plist
index a274600e1..f64f59a8c 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/Info.plist
+++ b/shell_integration/MacOSX/OwnCloudFinder/Info.plist
@@ -2,6 +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>SocketApiPrefix</key>
+ <string>$(OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX)$(OC_APPLICATION_REV_DOMAIN)</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
diff --git a/shell_integration/MacOSX/OwnCloudFinder/MenuManager.m b/shell_integration/MacOSX/OwnCloudFinder/MenuManager.m
index 740b34e29..1fd9e0a53 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/MenuManager.m
+++ b/shell_integration/MacOSX/OwnCloudFinder/MenuManager.m
@@ -73,7 +73,7 @@ static MenuManager* sharedInstance = nil;
- (void)addItemsToMenu:(TContextMenu*)menu forFiles:(NSArray*)files
{
- RequestManager *requestManager = [RequestManager sharedInstance];
+ OwnCloudFinderRequestManager *requestManager = [OwnCloudFinderRequestManager sharedInstance];
NSString *shareItemTitle = [requestManager shareItemTitle];
if (!shareItemTitle || shareItemTitle.length == 0) {
return;
@@ -157,7 +157,7 @@ static MenuManager* sharedInstance = nil;
- (void)menuItemClicked:(id)param
{
- [[RequestManager sharedInstance] menuItemClicked:[param representedObject]];
+ [[OwnCloudFinderRequestManager sharedInstance] menuItemClicked:[param representedObject]];
}
- (NSArray*)pathsForNodes:(const struct TFENodeVector*)nodes
diff --git a/shell_integration/MacOSX/OwnCloudFinder/OwnCloudFinder.xcodeproj/project.pbxproj b/shell_integration/MacOSX/OwnCloudFinder/OwnCloudFinder.xcodeproj/project.pbxproj
index d23f22971..1ef53506d 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/OwnCloudFinder.xcodeproj/project.pbxproj
+++ b/shell_integration/MacOSX/OwnCloudFinder/OwnCloudFinder.xcodeproj/project.pbxproj
@@ -285,6 +285,8 @@
GCC_OPTIMIZATION_LEVEL = 0;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Bundles";
+ OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient;
+ OC_TEAM_IDENTIFIER_PREFIX = "";
PRODUCT_NAME = SyncStateFinder;
WRAPPER_EXTENSION = bundle;
};
@@ -302,6 +304,8 @@
GCC_MODEL_TUNING = G5;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Bundles";
+ OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient;
+ OC_TEAM_IDENTIFIER_PREFIX = "";
PRODUCT_NAME = SyncStateFinder;
WRAPPER_EXTENSION = bundle;
};
diff --git a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.h b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.h
index 136e4fd26..f3924fac6 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.h
+++ b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.h
@@ -16,7 +16,7 @@
#import "RequestManager.h"
#import "SyncClientProxy.h"
-@interface RequestManager : NSObject <SyncClientProxyDelegate>
+@interface OwnCloudFinderRequestManager : NSObject <SyncClientProxyDelegate>
{
SyncClientProxy *_syncClientProxy;
@@ -29,7 +29,7 @@
@property (nonatomic, retain) NSString* filterFolder;
-+ (RequestManager*)sharedInstance;
++ (OwnCloudFinderRequestManager*)sharedInstance;
- (BOOL)isRegisteredPath:(NSString*)path isDirectory:(BOOL)isDir;
- (void)askForIcon:(NSString*)path isDirectory:(BOOL)isDir;
diff --git a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m
index ba450f423..79be861cf 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m
+++ b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m
@@ -16,19 +16,22 @@
#import "IconCache.h"
#import "RequestManager.h"
-#define READ_TAG 2422
+static OwnCloudFinderRequestManager* sharedInstance = nil;
-static RequestManager* sharedInstance = nil;
-
-@implementation RequestManager
+@implementation OwnCloudFinderRequestManager
- (id)init
{
if ((self = [super init]))
{
// For the sake of allowing both the legacy and the FinderSync extensions to work with the same
- // client build, use the same server name including the Team ID even though we won't be signing the bundle.
- NSString *serverName = @"9B5WD74GWJ.com.owncloud.desktopclient.socketApi";
+ // client build, use the same server name including the Team ID even though we won't be sandboxed.
+ NSBundle *extBundle = [NSBundle bundleForClass:[self class]];
+ // This was added to the bundle's Info.plist to get it from the build system
+ NSString *socketApiPrefix = [extBundle objectForInfoDictionaryKey:@"SocketApiPrefix"];
+ NSString *serverName = [socketApiPrefix stringByAppendingString:@".socketApi"];
+ // NSLog(@"OwnCloudFinderRequestManager serverName %@", serverName);
+
_syncClientProxy = [[SyncClientProxy alloc] initWithDelegate:self serverName:serverName];
_registeredPathes = [[NSMutableDictionary alloc] init];
@@ -53,7 +56,7 @@ static RequestManager* sharedInstance = nil;
[super dealloc];
}
-+ (RequestManager*)sharedInstance
++ (OwnCloudFinderRequestManager*)sharedInstance
{
@synchronized(self)
{
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>
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.pbxproj b/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.pbxproj
index 80ac3abf7..709298637 100644
--- a/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.pbxproj
+++ b/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.pbxproj
@@ -312,8 +312,7 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CODE_SIGN_IDENTITY = "Developer ID Application";
- "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
+ CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
@@ -362,8 +361,7 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CODE_SIGN_IDENTITY = "Developer ID Application";
- "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
+ CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
@@ -405,8 +403,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = FinderSyncExt/FinderSyncExt.entitlements;
- CODE_SIGN_IDENTITY = "Developer ID Application";
- "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
+ CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
@@ -432,6 +429,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
OC_APPLICATION_NAME = ownCloud;
OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient;
+ OC_TEAM_IDENTIFIER_PREFIX = "";
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -458,8 +456,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = FinderSyncExt/FinderSyncExt.entitlements;
- CODE_SIGN_IDENTITY = "Developer ID Application";
- "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
+ CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
@@ -479,6 +476,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
OC_APPLICATION_NAME = ownCloud;
OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient;
+ OC_TEAM_IDENTIFIER_PREFIX = "";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SDKROOT = macosx;