Permalink
Browse files

Updated for further compatibility with MAS 1Pwd

* Altered defaults write command to work with new bundle ID and key
* Added Configuration group to project to pull settings from Quicksilver
  • Loading branch information...
pjrobertson committed Dec 10, 2011
1 parent 407f6e3 commit 86e83c0be191529c6aafc7b228525486982ea610
View
@@ -0,0 +1,3 @@
+[submodule "JSONKit"]
+ path = JSONKit
+ url = git://github.com/johnezang/JSONKit.git
View
@@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>2.3.3</string>
<key>CFBundleVersion</key>
- <string>2F7</string>
+ <string>308</string>
<key>QSActions</key>
<dict>
<key>goAndFill</key>
Submodule JSONKit added at e3f901
@@ -55,7 +55,16 @@
BBF581820B1D9DC3003CFF55 /* OnePasswordSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnePasswordSource.h; sourceTree = "<group>"; };
BBF581830B1D9DC3003CFF55 /* OnePasswordSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnePasswordSource.m; sourceTree = "<group>"; };
CD0117CB13CCBDDF00409D70 /* YAJL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = YAJL.framework; sourceTree = "<group>"; };
+ CD5013A5149382260022F5E1 /* Common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = "<group>"; };
+ CD5013A6149382260022F5E1 /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
+ CD5013A7149382260022F5E1 /* Developer.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Developer.xcconfig; sourceTree = "<group>"; };
+ CD5013A8149382260022F5E1 /* QSPlugIn.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = QSPlugIn.xcconfig; sourceTree = "<group>"; };
+ CD5013A9149382260022F5E1 /* QSPlugIn_Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = QSPlugIn_Debug.xcconfig; sourceTree = "<group>"; };
+ CD5013AA149382260022F5E1 /* QSPlugIn_Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = QSPlugIn_Release.xcconfig; sourceTree = "<group>"; };
+ CD5013AB149382260022F5E1 /* Quicksilver.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Quicksilver.pch; sourceTree = "<group>"; };
+ CD5013AC149382260022F5E1 /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
CDDDB3341158B11100D1674E /* RevealIn1Pwd.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.scpt; path = RevealIn1Pwd.scpt; sourceTree = "<group>"; };
+ CDF8E28714928A4F005B1E49 /* OnePasswordDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnePasswordDefines.h; sourceTree = "<group>"; };
DD92D38A0106425D02CA0E72 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
E1EAB045068128A200774DFF /* OnePassword.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnePassword.m; sourceTree = "<group>"; };
E1EAB047068128A800774DFF /* OnePassword.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnePassword.h; sourceTree = "<group>"; };
@@ -79,6 +88,7 @@
0259C574FE90428111CA0C5A /* OnePassword */ = {
isa = PBXGroup;
children = (
+ CD5013A4149382260022F5E1 /* Configuration */,
32DBCF9E0370C38000C91783 /* Classes */,
32DBCF9F0370C38200C91783 /* Other Sources */,
0259C582FE90428111CA0C5A /* Resources */,
@@ -127,6 +137,7 @@
E1EAB045068128A200774DFF /* OnePassword.m */,
BBF581820B1D9DC3003CFF55 /* OnePasswordSource.h */,
BBF581830B1D9DC3003CFF55 /* OnePasswordSource.m */,
+ CDF8E28714928A4F005B1E49 /* OnePasswordDefines.h */,
);
name = Classes;
sourceTree = "<group>";
@@ -139,6 +150,22 @@
name = "Other Sources";
sourceTree = "<group>";
};
+ CD5013A4149382260022F5E1 /* Configuration */ = {
+ isa = PBXGroup;
+ children = (
+ CD5013A5149382260022F5E1 /* Common.xcconfig */,
+ CD5013A6149382260022F5E1 /* Debug.xcconfig */,
+ CD5013A7149382260022F5E1 /* Developer.xcconfig */,
+ CD5013A8149382260022F5E1 /* QSPlugIn.xcconfig */,
+ CD5013A9149382260022F5E1 /* QSPlugIn_Debug.xcconfig */,
+ CD5013AA149382260022F5E1 /* QSPlugIn_Release.xcconfig */,
+ CD5013AB149382260022F5E1 /* Quicksilver.pch */,
+ CD5013AC149382260022F5E1 /* Release.xcconfig */,
+ );
+ name = Configuration;
+ path = ../../QS/Quicksilver/Quicksilver/Configuration;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -239,6 +266,7 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = OnePassword_Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = NS_BLOCK_ASSERTIONS;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -266,6 +294,7 @@
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = OnePassword_Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = NS_BLOCK_ASSERTIONS;
INFOPLIST_FILE = Info.plist;
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
OTHER_LDFLAGS = "-bundle";
@@ -70,8 +70,8 @@
endingColumnNumber = "9223372036854775807"
startingLineNumber = "41"
endingLineNumber = "41"
- landmarkName = "-init"
- landmarkType = "5">
+ landmarkName = "@implementation OnePasswordSource"
+ landmarkType = "3">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "Yes"
@@ -98,8 +98,8 @@
endingColumnNumber = "9223372036854775807"
startingLineNumber = "141"
endingLineNumber = "141"
- landmarkName = "-objectsForEntry:"
- landmarkType = "5">
+ landmarkName = "@implementation OnePasswordSource"
+ landmarkType = "3">
</FileBreakpoint>
</FileBreakpoints>
</Bucket>
@@ -34,7 +34,7 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Release"
+ buildConfiguration = "Development"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
View
@@ -24,6 +24,9 @@
#import "OnePasswordAction.h"
#import <QSCore/QSObject_FileHandling.h>
+#import "OnePasswordSource.h"
+#import "OnePasswordDefines.h"
+
@implementation OnePasswordAction
@@ -108,8 +111,16 @@ - (QSObject *)goAndFill:(QSObject *)dObject with:(QSObject *)iObject {
}
- (QSObject *)viewInOnePwd:(QSObject *)dObject {
- // setup the terminal command
- NSString *command = [NSString stringWithFormat:@"defaults write ws.agile.1Password findUUID %@", [dObject identifier]];
+
+ // setup the terminal command
+ NSString *command;
+ if ([[[OnePasswordSource sharedInstance] bundleID] isEqualToString:kOnePasswordMASBundleID]) {
+ command = [NSString stringWithFormat:@"defaults write %@ selectedObjects -array %@", kOnePasswordMASBundleID, [dObject identifier]];
+ }
+ else {
+ command = [NSString stringWithFormat:@"defaults write %@ findUUID %@", kOnePasswordOldBundleID, [dObject identifier]];
+
+ }
NSLog(@"command: %@",command);
// load the script from a resource by fetching its URL from within our bundle
NSString *path=[[NSBundle bundleForClass:[self class]] pathForResource:@"RevealIn1Pwd" ofType:@"scpt"];
View
@@ -0,0 +1,19 @@
+// Keychain location defines
+#define kOldKeychainLocation @"~/Library/Application Support/1Password/1Password.agilekeychain"
+#define kNewMASKeychainLocation @"~/Library/Containers/com.agilebits.onepassword-osx-helper/Data/Documents/1Password.agilekeychain"
+#define kDropboxLocation @"~/Dropbox/1Password.agilekeychain"
+
+// QSObject type defines
+#define QS1PasswordForm @"QS1PasswordForm"
+#define QS1PasswordSecureNote @"QS1PasswordSecureNote"
+#define QS1PasswordIdentity @"QS1PasswordIdentity"
+#define QS1PasswordSoftwareLicense @"QS1PasswordSoftwareLicense"
+#define QS1PasswordOnlineService @"QS1PasswordOnlineService"
+#define QS1PasswordWalletItem @"QS1PasswordWalletItem"
+
+// JSON defines
+#define kItemType @"type"
+
+// OnePassword Bundle IDs
+#define kOnePasswordMASBundleID @"com.agilebits.onepassword-osx"
+#define kOnePasswordOldBundleID @"ws.agile.1Password"
View
@@ -23,24 +23,6 @@
#import <QSCore/QSObjectSource.h>
-// Keychain location defines
-#define kOldKeychainLocation @"~/Library/Application Support/1Password/1Password.agilekeychain"
-#define kNewMASKeychainLocation @"~/Library/Containers/com.agilebits.onepassword-osx-helper/Data/Documents/1Password.agilekeychain"
-#define kDropboxLocation @"~/Dropbox/1Password.agilekeychain"
-
-// QSObject type defines
-#define QS1PasswordForm @"QS1PasswordForm"
-#define QS1PasswordSecureNote @"QS1PasswordSecureNote"
-#define QS1PasswordIdentity @"QS1PasswordIdentity"
-#define QS1PasswordSoftwareLicense @"QS1PasswordSoftwareLicense"
-#define QS1PasswordOnlineService @"QS1PasswordOnlineService"
-#define QS1PasswordWalletItem @"QS1PasswordWalletItem"
-
-// JSON defines
-#define kItemType @"type"
-
-
-
@interface OnePasswordSource : QSObjectSource
{
@@ -51,6 +33,7 @@
@property (retain) NSString *bundleID;
@property (retain) NSString *keychainPath;
@property (retain) NSImage *onePasswordImage;
-@end
++(id)sharedInstance;
+@end
View
@@ -22,6 +22,7 @@
//
#import "OnePasswordSource.h"
+#import "OnepasswordDefines.h"
#import <YAJL/YAJL.h>
#import <QSCore/QSObject.h>
@@ -37,18 +38,21 @@ -(void)dealloc {
[super dealloc];
}
--(id)sharedInstance {
-
+static id _sharedInstance;
+
++ (id)sharedInstance {
+ if (!_sharedInstance) _sharedInstance = [[[self class] allocWithZone:[self zone]] init];
+ return _sharedInstance;
}
-(id)init {
if (self = [super init]) {
OSStatus result = LSFindApplicationForInfo (kLSUnknownCreator,CFSTR("com.agilebits.onepassword-osx"),NULL,nil,nil);
if (result == noErr) {
- [self setBundleID:@"com.agilebits.onepassword-osx"];
+ [self setBundleID:kOnePasswordMASBundleID];
}
else {
- [self setBundleID:@"ws.agile.1Password"];
+ [self setBundleID:kOnePasswordOldBundleID];
}
// NSLog(@"1Password Bundle ID: %@",[self bundleID]);
View
Binary file not shown.
1 yajl
Submodule yajl added at e2d080

0 comments on commit 86e83c0

Please sign in to comment.