diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 5bee445f..b806e3f8 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -178,7 +178,7 @@ 4C7B637D1C0CB55600D7038C /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C7B637A1C0CB55600D7038C /* Sparkle.framework */; }; 4C7B637F1C0CB57300D7038C /* KeePassKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4C7B63791C0CB55600D7038C /* KeePassKit.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 4C7B63801C0CB57300D7038C /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4C7B637A1C0CB55600D7038C /* Sparkle.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - 4C7BD07619FE94C900C7AA5C /* MacPassImages.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4C7BD07519FE94C900C7AA5C /* MacPassImages.xcassets */; }; + 4C7BD07619FE94C900C7AA5C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4C7BD07519FE94C900C7AA5C /* Assets.xcassets */; }; 4C7F8B681A10B68400CCB83D /* WelcomeWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C7F8B6A1A10B68400CCB83D /* WelcomeWindow.xib */; }; 4C80304A1E2FBAA300133E4C /* MPTestKeyMapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C8030491E2FBAA300133E4C /* MPTestKeyMapper.m */; }; 4C82046A1FCDC07800EB24A4 /* MPPickfieldViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C8204681FCDC07800EB24A4 /* MPPickfieldViewController.m */; }; @@ -629,7 +629,7 @@ 4C7B63701C0CB51F00D7038C /* TTTStringTransformers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TTTStringTransformers.m; sourceTree = ""; }; 4C7B63791C0CB55600D7038C /* KeePassKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = KeePassKit.framework; path = Carthage/Build/Mac/KeePassKit.framework; sourceTree = ""; }; 4C7B637A1C0CB55600D7038C /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = Carthage/Build/Mac/Sparkle.framework; sourceTree = ""; }; - 4C7BD07519FE94C900C7AA5C /* MacPassImages.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = MacPassImages.xcassets; sourceTree = ""; }; + 4C7BD07519FE94C900C7AA5C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 4C7F8B691A10B68400CCB83D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/WelcomeWindow.xib; sourceTree = ""; }; 4C7F8B741A10B69300CCB83D /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/WelcomeWindow.strings; sourceTree = ""; }; 4C7F8B761A10B69400CCB83D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/WelcomeWindow.strings"; sourceTree = ""; }; @@ -1406,7 +1406,7 @@ 4C37A84215B8B495005EF8EE /* Model */, 4C37A84115B8B47D005EF8EE /* Delegates */, 4C77E36D15B84A240093A587 /* Supporting Files */, - 4C7BD07519FE94C900C7AA5C /* MacPassImages.xcassets */, + 4C7BD07519FE94C900C7AA5C /* Assets.xcassets */, ); path = MacPass; sourceTree = ""; @@ -1841,7 +1841,7 @@ 4C6D1D25178579570014C5A5 /* 48_FolderTemplate.pdf in Resources */, 4C701CBC178618A000581B88 /* 12_RemoteTemplate.pdf in Resources */, 4CF29BF417879D0000851B60 /* 26_FileSaveTemplate.pdf in Resources */, - 4C7BD07619FE94C900C7AA5C /* MacPassImages.xcassets in Resources */, + 4C7BD07619FE94C900C7AA5C /* Assets.xcassets in Resources */, 4CA182781F96523600DD4A4A /* DuplicateEntryOptionsWindow.xib in Resources */, 4C52A88E1788628B00868229 /* 06_BlockDeviceTemplate.pdf in Resources */, 4C52A88F1788628B00868229 /* 13_KeysTemplate.pdf in Resources */, diff --git a/MacPass/MacPassImages.xcassets/Colors/Active Highlight.colorset/Contents.json b/MacPass/Assets.xcassets/Colors/Active Highlight.colorset/Contents.json similarity index 88% rename from MacPass/MacPassImages.xcassets/Colors/Active Highlight.colorset/Contents.json rename to MacPass/Assets.xcassets/Colors/Active Highlight.colorset/Contents.json index 6336abb6..233c74ee 100644 --- a/MacPass/MacPassImages.xcassets/Colors/Active Highlight.colorset/Contents.json +++ b/MacPass/Assets.xcassets/Colors/Active Highlight.colorset/Contents.json @@ -27,10 +27,10 @@ "color" : { "color-space" : "srgb", "components" : { - "red" : "0.300", + "red" : "0.200", "alpha" : "1.000", - "blue" : "0.300", - "green" : "0.300" + "blue" : "0.200", + "green" : "0.200" } } } diff --git a/MacPass/MacPassImages.xcassets/Colors/Active Shadow.colorset/Contents.json b/MacPass/Assets.xcassets/Colors/Active Shadow.colorset/Contents.json similarity index 88% rename from MacPass/MacPassImages.xcassets/Colors/Active Shadow.colorset/Contents.json rename to MacPass/Assets.xcassets/Colors/Active Shadow.colorset/Contents.json index 6336abb6..233c74ee 100644 --- a/MacPass/MacPassImages.xcassets/Colors/Active Shadow.colorset/Contents.json +++ b/MacPass/Assets.xcassets/Colors/Active Shadow.colorset/Contents.json @@ -27,10 +27,10 @@ "color" : { "color-space" : "srgb", "components" : { - "red" : "0.300", + "red" : "0.200", "alpha" : "1.000", - "blue" : "0.300", - "green" : "0.300" + "blue" : "0.200", + "green" : "0.200" } } } diff --git a/MacPass/MacPassImages.xcassets/Colors/Contents.json b/MacPass/Assets.xcassets/Colors/Contents.json similarity index 100% rename from MacPass/MacPassImages.xcassets/Colors/Contents.json rename to MacPass/Assets.xcassets/Colors/Contents.json diff --git a/MacPass/MacPassImages.xcassets/Colors/Inactive Highlight.colorset/Contents.json b/MacPass/Assets.xcassets/Colors/Inactive Highlight.colorset/Contents.json similarity index 88% rename from MacPass/MacPassImages.xcassets/Colors/Inactive Highlight.colorset/Contents.json rename to MacPass/Assets.xcassets/Colors/Inactive Highlight.colorset/Contents.json index 6336abb6..233c74ee 100644 --- a/MacPass/MacPassImages.xcassets/Colors/Inactive Highlight.colorset/Contents.json +++ b/MacPass/Assets.xcassets/Colors/Inactive Highlight.colorset/Contents.json @@ -27,10 +27,10 @@ "color" : { "color-space" : "srgb", "components" : { - "red" : "0.300", + "red" : "0.200", "alpha" : "1.000", - "blue" : "0.300", - "green" : "0.300" + "blue" : "0.200", + "green" : "0.200" } } } diff --git a/MacPass/MacPassImages.xcassets/Colors/Inactive Shadow.colorset/Contents.json b/MacPass/Assets.xcassets/Colors/Inactive Shadow.colorset/Contents.json similarity index 88% rename from MacPass/MacPassImages.xcassets/Colors/Inactive Shadow.colorset/Contents.json rename to MacPass/Assets.xcassets/Colors/Inactive Shadow.colorset/Contents.json index 6336abb6..233c74ee 100644 --- a/MacPass/MacPassImages.xcassets/Colors/Inactive Shadow.colorset/Contents.json +++ b/MacPass/Assets.xcassets/Colors/Inactive Shadow.colorset/Contents.json @@ -27,10 +27,10 @@ "color" : { "color-space" : "srgb", "components" : { - "red" : "0.300", + "red" : "0.200", "alpha" : "1.000", - "blue" : "0.300", - "green" : "0.300" + "blue" : "0.200", + "green" : "0.200" } } } diff --git a/MacPass/MacPassImages.xcassets/Contents.json b/MacPass/Assets.xcassets/Contents.json similarity index 100% rename from MacPass/MacPassImages.xcassets/Contents.json rename to MacPass/Assets.xcassets/Contents.json diff --git a/MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_128x128.png b/MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_128x128.png similarity index 100% rename from MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_128x128.png rename to MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_128x128.png diff --git a/MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_128x128@2x.png b/MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_128x128@2x.png similarity index 100% rename from MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_128x128@2x.png rename to MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_128x128@2x.png diff --git a/MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_16x16.png b/MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_16x16.png similarity index 100% rename from MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_16x16.png rename to MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_16x16.png diff --git a/MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_16x16@2x.png b/MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_16x16@2x.png similarity index 100% rename from MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_16x16@2x.png rename to MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_16x16@2x.png diff --git a/MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_256x256.png b/MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_256x256.png similarity index 100% rename from MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_256x256.png rename to MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_256x256.png diff --git a/MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_256x256@2x.png b/MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_256x256@2x.png similarity index 100% rename from MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_256x256@2x.png rename to MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_256x256@2x.png diff --git a/MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_32x32.png b/MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_32x32.png similarity index 100% rename from MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_32x32.png rename to MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_32x32.png diff --git a/MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_32x32@2x.png b/MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_32x32@2x.png similarity index 100% rename from MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_32x32@2x.png rename to MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_32x32@2x.png diff --git a/MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_512x512.png b/MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_512x512.png similarity index 100% rename from MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_512x512.png rename to MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_512x512.png diff --git a/MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_512x512@2x.png b/MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_512x512@2x.png similarity index 100% rename from MacPass/MacPassImages.xcassets/FileTypeIcon.iconset/icon_512x512@2x.png rename to MacPass/Assets.xcassets/FileTypeIcon.iconset/icon_512x512@2x.png diff --git a/MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/Contents.json b/MacPass/Assets.xcassets/MacPassAppIcon.appiconset/Contents.json similarity index 100% rename from MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/Contents.json rename to MacPass/Assets.xcassets/MacPassAppIcon.appiconset/Contents.json diff --git a/MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_128x128.png b/MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_128x128.png similarity index 100% rename from MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_128x128.png rename to MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_128x128.png diff --git a/MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_128x128@2x.png b/MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_128x128@2x.png similarity index 100% rename from MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_128x128@2x.png rename to MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_128x128@2x.png diff --git a/MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_16x16.png b/MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_16x16.png similarity index 100% rename from MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_16x16.png rename to MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_16x16.png diff --git a/MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_16x16@2x.png b/MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_16x16@2x.png similarity index 100% rename from MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_16x16@2x.png rename to MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_16x16@2x.png diff --git a/MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_256x256.png b/MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_256x256.png similarity index 100% rename from MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_256x256.png rename to MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_256x256.png diff --git a/MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_256x256@2x.png b/MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_256x256@2x.png similarity index 100% rename from MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_256x256@2x.png rename to MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_256x256@2x.png diff --git a/MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_32x32.png b/MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_32x32.png similarity index 100% rename from MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_32x32.png rename to MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_32x32.png diff --git a/MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_32x32@2x.png b/MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_32x32@2x.png similarity index 100% rename from MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_32x32@2x.png rename to MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_32x32@2x.png diff --git a/MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_512x512.png b/MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_512x512.png similarity index 100% rename from MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_512x512.png rename to MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_512x512.png diff --git a/MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_512x512@2x.png b/MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_512x512@2x.png similarity index 100% rename from MacPass/MacPassImages.xcassets/MacPassAppIcon.appiconset/icon_512x512@2x.png rename to MacPass/Assets.xcassets/MacPassAppIcon.appiconset/icon_512x512@2x.png diff --git a/MacPass/MPAutotypeCommand.m b/MacPass/MPAutotypeCommand.m index 508009c8..01cdfe1b 100644 --- a/MacPass/MPAutotypeCommand.m +++ b/MacPass/MPAutotypeCommand.m @@ -424,8 +424,12 @@ static CGKeyCode kMPNumpadKeyCodes[] = { /* Send the event */ CGEventPost(kCGHIDEventTap, pressKey); + /* TODO: Evaluate postToPid */ + //CGEventPostToPid(0, pressKey); usleep(0.05 * NSEC_PER_MSEC); CGEventPost(kCGHIDEventTap, releaseKey); + /* TODO: Evaluate postToPid */ + //CGEventPostToPid(0, releaseKey); usleep(0.05 * NSEC_PER_MSEC); CFRelease(pressKey); diff --git a/MacPass/MPAutotypePaste.m b/MacPass/MPAutotypePaste.m index bc549c0f..0f01a13a 100644 --- a/MacPass/MPAutotypePaste.m +++ b/MacPass/MPAutotypePaste.m @@ -51,12 +51,11 @@ - (void)execute { if([self.pasteData length] > 0) { - MPPasteBoardController *controller = [MPPasteBoardController defaultController]; - [controller stashObjects]; - [controller copyObjectsWithoutTimeout:@[self.pasteData]]; + [MPPasteBoardController.defaultController stashObjects]; + [MPPasteBoardController.defaultController copyObjectsWithoutTimeout:@[self.pasteData]]; [self sendPasteKeyCode]; - usleep(0.1 * NSEC_PER_MSEC); // on 10.10 we need to wait a bit before restoring the pasteboard contents - [controller restoreObjects]; + usleep(0.2 * NSEC_PER_MSEC); // on 10.10 we need to wait a bit before restoring the pasteboard contents + [MPPasteBoardController.defaultController restoreObjects]; } } diff --git a/MacPass/MPOverlayWindowController.h b/MacPass/MPOverlayWindowController.h index e5083cd0..fd391b40 100644 --- a/MacPass/MPOverlayWindowController.h +++ b/MacPass/MPOverlayWindowController.h @@ -24,7 +24,7 @@ @interface MPOverlayWindowController : NSWindowController -+ (MPOverlayWindowController *)sharedController; +@property (nonatomic, strong, readonly, class) MPOverlayWindowController *sharedController; /** * Displays an overlay HUD style image with the given text, image centered at the given view. diff --git a/MacPass/MPOverlayWindowController.m b/MacPass/MPOverlayWindowController.m index ea2407c5..edf87f21 100644 --- a/MacPass/MPOverlayWindowController.m +++ b/MacPass/MPOverlayWindowController.m @@ -56,13 +56,14 @@ - (void)windowDidLoad { [super windowDidLoad]; - [self.window setStyleMask:NSBorderlessWindowMask]; - [self.window setAlphaValue:0]; - [self.window setOpaque:NO]; - [self.window setHasShadow:YES]; - [[self.textField cell] setBackgroundStyle:NSBackgroundStyleLowered]; - [[self.imageView cell] setBackgroundStyle:NSBackgroundStyleDark]; - [[self.imageView cell] setImageAlignment:NSImageAlignCenter]; + self.window.styleMask = NSBorderlessWindowMask; + self.window.alphaValue = 0; + self.window.opaque = NO; + self.window.hasShadow = YES; + + self.textField.cell.backgroundStyle = NSBackgroundStyleLowered; + self.imageView.cell.backgroundStyle = NSBackgroundStyleDark; + ((NSImageCell *)self.imageView.cell).imageAlignment = NSImageAlignCenter; } - (void)displayOverlayImage:(NSImage *)imageOrNil label:(NSString *)labelOrNil atView:(NSView *)view { diff --git a/MacPass/MPPasteBoardController.m b/MacPass/MPPasteBoardController.m index 38b33123..0cf3baa9 100644 --- a/MacPass/MPPasteBoardController.m +++ b/MacPass/MPPasteBoardController.m @@ -74,6 +74,7 @@ NSString *const MPPasteBoardControllerDidClearClipboard = @"com.hicknhack.macpas for (NSPasteboardItem *item in NSPasteboard.generalPasteboard.pasteboardItems) { NSPasteboardItem *newItem = [[NSPasteboardItem alloc] init]; for (NSString *type in item.types) { + /* mutable copy to ensure actual deep copy */ NSData *data = [[item dataForType:type] mutableCopy]; if (data) { [newItem setData:data forType:type]; @@ -118,26 +119,26 @@ NSString *const MPPasteBoardControllerDidClearClipboard = @"com.hicknhack.macpas NSString *infoText = nil; switch(overlayInfoType) { case MPPasteboardOverlayInfoPassword: - infoImage = [[NSBundle mainBundle] imageForResource:@"00_PasswordTemplate"]; + infoImage = [NSBundle.mainBundle imageForResource:@"00_PasswordTemplate"]; infoText = NSLocalizedString(@"COPIED_PASSWORD", @"Password was copied to the pasteboard"); break; case MPPasteboardOverlayInfoURL: - infoImage = [[NSBundle mainBundle] imageForResource:@"01_PackageNetworkTemplate"]; + infoImage = [NSBundle.mainBundle imageForResource:@"01_PackageNetworkTemplate"]; infoText = NSLocalizedString(@"COPIED_URL", @"URL was copied to the pasteboard"); break; case MPPasteboardOverlayInfoUsername: - infoImage = [[NSBundle mainBundle] imageForResource:@"09_IdentityTemplate"]; + infoImage = [NSBundle.mainBundle imageForResource:@"09_IdentityTemplate"]; infoText = NSLocalizedString(@"COPIED_USERNAME", @"Username was copied to the pasteboard"); break; case MPPasteboardOverlayInfoCustom: - infoImage = [[NSBundle mainBundle] imageForResource:@"00_PasswordTemplate"]; + infoImage = [NSBundle.mainBundle imageForResource:@"00_PasswordTemplate"]; infoText = [NSString stringWithFormat:NSLocalizedString(@"COPIED_FIELD_%@", "Field name that was copied to the pasteboard"), name]; break; } - [[MPOverlayWindowController sharedController] displayOverlayImage:infoImage label:infoText atView:view]; + [MPOverlayWindowController.sharedController displayOverlayImage:infoImage label:infoText atView:view]; } - (void)_clearPasteboardContents {