From 38d64c7cb9340324b6436e45233e1226097af579 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Thu, 29 Aug 2019 17:17:03 +0200 Subject: [PATCH 01/34] Added export localisations step to continous deployment for easier workflow --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index fc4a8b41..ceff130b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,8 @@ before_install: - gem install xcpretty --no-document --quiet after_success: + - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage de -exportLanguage en -exportLanguage es -exportLanguage fr -exportLanguage it -exportLanguage nl -exportLanguage pl -exportLanguage ru -exportLanguage sv-SE -exportLanguage zh-Hans + - zip -9ry Localisations.zip Localisaions - cd ./build/Build/Products/Release - zip -9ry MacPass-continuous.zip MacPass.app - shasum -a 256 MacPass-continuous.zip > MacPass-continuous.zip.sha256 @@ -30,6 +32,7 @@ deploy: api_key: secure: AEb7fgi29S3aXFt5bXz+lq1KHISumny6bf4j06JBC5gUrSs+dW0/tmVFq68XRAqigeOQU31wwv20f7OHiy+GRYDXM2xBsX9ZBQ2IilnaXlDy/mPsNcJJJsZ2gyodi3KnU0rZtTb93me2YyU86H4Na/gtaZZUKjLwCFtGGziExD8= file: + - Localisations.zip - MacPass-continuous.zip - MacPass-continuous.zip.sha256 overwrite: true From 3289ffb2e4bedf05bf2c9dcedb8195ca21135fff Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Thu, 29 Aug 2019 21:06:16 +0200 Subject: [PATCH 02/34] Fixed typo --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ceff130b..14db38df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,9 @@ before_install: - gem install xcpretty --no-document --quiet after_success: - - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage de -exportLanguage en -exportLanguage es -exportLanguage fr -exportLanguage it -exportLanguage nl -exportLanguage pl -exportLanguage ru -exportLanguage sv-SE -exportLanguage zh-Hans - - zip -9ry Localisations.zip Localisaions + # - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage de -exportLanguage en -exportLanguage es -exportLanguage fr -exportLanguage it -exportLanguage nl -exportLanguage pl -exportLanguage ru -exportLanguage sv-SE -exportLanguage zh-Hans + - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage de -exportLanguage en + - zip -9ry Localisations.zip Localisations - cd ./build/Build/Products/Release - zip -9ry MacPass-continuous.zip MacPass.app - shasum -a 256 MacPass-continuous.zip > MacPass-continuous.zip.sha256 From 7de8d0abd5ff2345179ca219d3dc3ab921e70def Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Fri, 30 Aug 2019 10:46:41 +0200 Subject: [PATCH 03/34] re-added missing exported languages --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 14db38df..7d7d89dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,7 @@ before_install: - gem install xcpretty --no-document --quiet after_success: - # - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage de -exportLanguage en -exportLanguage es -exportLanguage fr -exportLanguage it -exportLanguage nl -exportLanguage pl -exportLanguage ru -exportLanguage sv-SE -exportLanguage zh-Hans - - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage de -exportLanguage en + - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage de -exportLanguage en -exportLanguage es -exportLanguage fr -exportLanguage it -exportLanguage nl -exportLanguage pl -exportLanguage ru -exportLanguage sv-SE -exportLanguage zh-Hans - zip -9ry Localisations.zip Localisations - cd ./build/Build/Products/Release - zip -9ry MacPass-continuous.zip MacPass.app From d9322d7544c7fd582bad90da8866b174cd628e94 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Fri, 30 Aug 2019 11:04:20 +0200 Subject: [PATCH 04/34] split localisation export into singel language builds to make them more travis friendly --- .travis.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7d7d89dc..5a17fbd4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,15 @@ before_install: - gem install xcpretty --no-document --quiet after_success: - - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage de -exportLanguage en -exportLanguage es -exportLanguage fr -exportLanguage it -exportLanguage nl -exportLanguage pl -exportLanguage ru -exportLanguage sv-SE -exportLanguage zh-Hans + - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage de + - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage en + - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage es + - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage fr + - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage it + - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage nl + - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage ru + - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage sv-SE + - xcodebuild -project MacPass.xcodeproj -exportLocalizations -localizationPath Localisations -exportLanguage zh-Hans - zip -9ry Localisations.zip Localisations - cd ./build/Build/Products/Release - zip -9ry MacPass-continuous.zip MacPass.app From 05cfb737349b8a2d43fe493233e343e680d8aca5 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Tue, 3 Sep 2019 12:25:01 +0200 Subject: [PATCH 05/34] Updated Icons for exported UTIs --- MacPass/MacPass-Info.plist | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index 9000f370..20edb8a2 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -2,8 +2,6 @@ - NSAppleEventsUsageDescription - MacPass might use AppleEvents to perform Autotype functionality CFBundleDevelopmentRegion en CFBundleDocumentTypes @@ -71,6 +69,8 @@ https://github.com/MacPass/MacPass MPPluginRepositoryURL https://macpassapp.org/data/plugins.json + NSAppleEventsUsageDescription + MacPass might use AppleEvents to perform Autotype functionality NSHumanReadableCopyright Copyright © 2012-2019 HicknHack Software GmbH. All rights reserved. NSMainNibFile @@ -92,6 +92,8 @@ UTTypeDescription KDBX Database + UTTypeIconFile + FileTypeIcon UTTypeIdentifier com.hicknhack.macpass.kdbx UTTypeTagSpecification @@ -109,6 +111,8 @@ UTTypeDescription KDB Database + UTTypeIconFile + FileTypeIcon UTTypeIdentifier com.hicknhack.macpass.kdb UTTypeTagSpecification From eb9d15ffa5080c77fceb0ffc800cfa77098431af Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 9 Sep 2019 11:03:55 +0200 Subject: [PATCH 06/34] Use enter to accept a field in PICKFIELD view --- MacPass/Base.lproj/PickfieldView.xib | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/MacPass/Base.lproj/PickfieldView.xib b/MacPass/Base.lproj/PickfieldView.xib index cc3fe14f..813ee73d 100644 --- a/MacPass/Base.lproj/PickfieldView.xib +++ b/MacPass/Base.lproj/PickfieldView.xib @@ -1,8 +1,8 @@ - + - + @@ -31,6 +31,9 @@ + +DQ + @@ -121,11 +124,11 @@ - + - diff --git a/MacPass/MPAutotypeDoctor.h b/MacPass/MPAutotypeDoctor.h index ea8f537a..55d02a3b 100644 --- a/MacPass/MPAutotypeDoctor.h +++ b/MacPass/MPAutotypeDoctor.h @@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)runChecksAndPresentResults; - (void)openScreenRecordingPreferences; +- (void)requestScreenRecordingPermission; - (void)openAccessibiltyPreferences; - (void)openAutomationPreferences; diff --git a/MacPass/MPAutotypeDoctor.m b/MacPass/MPAutotypeDoctor.m index ba83799f..5ac00a69 100644 --- a/MacPass/MPAutotypeDoctor.m +++ b/MacPass/MPAutotypeDoctor.m @@ -107,6 +107,22 @@ [NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:@"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture"]]; } +- (void)requestScreenRecordingPermission { + /* macos 10.14 and lower do not require screen recording permission to get window titles */ + if(@available(macos 10.15, *)) { + /* + To minimize the intrusion just make a 1px image of the upper left corner + This way there is no real possibilty to access any private data + */ + CGImageRef screenshot = CGWindowListCreateImage( + CGRectMake(0, 0, 1, 1), + kCGWindowListOptionOnScreenOnly, + kCGNullWindowID, + kCGWindowImageDefault); + CFRelease(screenshot); + } +} + - (void)openAutomationPreferences { [NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:@"x-apple.systempreferences:com.apple.preference.security?Privacy_Automation"]]; } diff --git a/MacPass/MPAutotypeDoctorReportViewController.h b/MacPass/MPAutotypeDoctorReportViewController.h index 83d3b9ea..f25e4036 100644 --- a/MacPass/MPAutotypeDoctorReportViewController.h +++ b/MacPass/MPAutotypeDoctorReportViewController.h @@ -17,12 +17,13 @@ NS_ASSUME_NONNULL_BEGIN @property (strong) IBOutlet NSImageView *screenRecordingStatusImageView; @property (strong) IBOutlet NSTextField *screenRecordingStatusTextField; +@property (strong) IBOutlet NSButton *requestScreenRecordingButton; - (IBAction)openAccessibiltyPreferences:(id)sender; - (IBAction)openScreenRecordingPreferences:(id)sender; +- (IBAction)requestScreenRecordingPermissions:(id)sender; - (IBAction)openAutomationPreferences:(id)sender; - @end NS_ASSUME_NONNULL_END diff --git a/MacPass/MPAutotypeDoctorReportViewController.m b/MacPass/MPAutotypeDoctorReportViewController.m index 52440ec1..fd16c3a0 100644 --- a/MacPass/MPAutotypeDoctorReportViewController.m +++ b/MacPass/MPAutotypeDoctorReportViewController.m @@ -29,6 +29,10 @@ [MPAutotypeDoctor.defaultDoctor openScreenRecordingPreferences]; } +- (IBAction)requestScreenRecordingPermissions:(id)sender { + [MPAutotypeDoctor.defaultDoctor requestScreenRecordingPermission]; +} + - (void)openAutomationPreferences:(id)sender { [MPAutotypeDoctor.defaultDoctor openAutomationPreferences]; } @@ -38,7 +42,7 @@ NSError *error; if([MPAutotypeDoctor.defaultDoctor hasAccessibiltyPermissions:&error]) { self.accessibiltyStatusImageView.image = [NSImage imageNamed:NSImageNameStatusAvailable]; - self.accessibiltyStatusTextField.stringValue = NSLocalizedString(@"AUTOTYPE_STATUS_ACCESSIBILTY_PERMISSIONS_OK", "Status lable when no issue were found in accessibilty"); + self.accessibiltyStatusTextField.stringValue = NSLocalizedString(@"AUTOTYPE_STATUS_ACCESSIBILTY_PERMISSIONS_OK", "Status label when no issue were found in accessibilty"); } else { self.accessibiltyStatusImageView.image = [NSImage imageNamed:NSImageNameStatusUnavailable]; @@ -50,10 +54,12 @@ } } if([MPAutotypeDoctor.defaultDoctor hasScreenRecordingPermissions:&error]) { + self.requestScreenRecordingButton.enabled = NO; self.screenRecordingStatusImageView.image = [NSImage imageNamed:NSImageNameStatusAvailable]; - self.screenRecordingStatusTextField.stringValue = NSLocalizedString(@"AUTOTYPE_STATUS_SCREEN_RECORDING_PERMISSIONS_OK", "Status lable when no issue were found in screen recording permissions"); + self.screenRecordingStatusTextField.stringValue = NSLocalizedString(@"AUTOTYPE_STATUS_SCREEN_RECORDING_PERMISSIONS_OK", "Status label when no issue were found in screen recording permissions"); } else { + self.requestScreenRecordingButton.enabled = YES; self.screenRecordingStatusImageView.image = [NSImage imageNamed:NSImageNameStatusUnavailable]; if(error && error.localizedDescription) { self.screenRecordingStatusTextField.stringValue = error.localizedDescription; From f134290c27fef656e16f18488b2694433ff3dddd Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Tue, 17 Sep 2019 13:08:29 +0200 Subject: [PATCH 09/34] wired up button to actually do something --- MacPass/Base.lproj/AutotypeDoctorReportViewController.xib | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MacPass/Base.lproj/AutotypeDoctorReportViewController.xib b/MacPass/Base.lproj/AutotypeDoctorReportViewController.xib index ac3b8b3f..2d7e4ccc 100644 --- a/MacPass/Base.lproj/AutotypeDoctorReportViewController.xib +++ b/MacPass/Base.lproj/AutotypeDoctorReportViewController.xib @@ -83,6 +83,9 @@ + + + From fa58c7e4238eec11260de8ae821e1d87dce180fa Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Tue, 17 Sep 2019 13:55:23 +0200 Subject: [PATCH 10/34] Create FUNDING.yml --- .github/FUNDING.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..95d9fe10 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: https://flattr.com/thing/1550529/mstarkeMacPass-on-GitHub From 00d69d5bad87bac1a983c6fc539b41447ce47970 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Tue, 17 Sep 2019 13:57:32 +0200 Subject: [PATCH 11/34] Update FUNDING.yml --- .github/FUNDING.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 95d9fe10..2d6c9eb5 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,12 +1 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username custom: https://flattr.com/thing/1550529/mstarkeMacPass-on-GitHub From c5ed3c42e6028fbda35412afc0c35c81003147fa Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Wed, 9 Oct 2019 17:31:56 +0200 Subject: [PATCH 12/34] Updated Sparkle to 1.22.0 --- Cartfile | 2 +- Cartfile.resolved | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cartfile b/Cartfile index 03e479cb..d5a059ef 100644 --- a/Cartfile +++ b/Cartfile @@ -1,3 +1,3 @@ -github "sparkle-project/Sparkle" ~> 1.18.1 +github "sparkle-project/Sparkle" ~> 1.22 github "MacPass/KeePassKit" ~> 2.4 github "mstarke/HNHUi" ~> 3.0 diff --git a/Cartfile.resolved b/Cartfile.resolved index 41d6a033..0504ec84 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,4 +1,4 @@ github "MacPass/KeePassKit" "2.4.7" github "mstarke/HNHUi" "3.0" github "robbiehanson/KissXML" "5.2.3" -github "sparkle-project/Sparkle" "1.20.0" +github "sparkle-project/Sparkle" "1.22.0" From 46b6ab39256f56d88626c6ba205836fd0a34ee60 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 28 Oct 2019 14:18:15 +0100 Subject: [PATCH 13/34] Added entitlements file for codesigning --- MacPass.xcodeproj/project.pbxproj | 2 ++ MacPass/MacPass.entitlements | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 MacPass/MacPass.entitlements diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 71208fbd..904c67d3 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -721,6 +721,7 @@ 4C8DEAA11C314D2C00D24C32 /* MPTestAutotypeDelay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPTestAutotypeDelay.m; sourceTree = ""; }; 4C8E889122C223620002C7C8 /* createdTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = createdTemplate.pdf; sourceTree = ""; }; 4C8E889322C227270002C7C8 /* plugins.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = plugins.json; path = Resources/plugins.json; sourceTree = ""; }; + 4C8EAF20236720090025CC00 /* MacPass.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MacPass.entitlements; sourceTree = ""; }; 4C8F0C6C1FCEE98900BE157F /* MPPluginConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPPluginConstants.h; sourceTree = ""; }; 4C8F0C6D1FCEE9B900BE157F /* MPPluginConstants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPPluginConstants.m; sourceTree = ""; }; 4C8F0C6F1FCEF91400BE157F /* MPPickcharsParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPPickcharsParser.h; sourceTree = ""; }; @@ -1512,6 +1513,7 @@ 4C77E36D15B84A240093A587 /* Supporting Files */ = { isa = PBXGroup; children = ( + 4C8EAF20236720090025CC00 /* MacPass.entitlements */, 4C8E889322C227270002C7C8 /* plugins.json */, FA13910A1F9CD9EB0033D256 /* Localizable.stringsdict */, 4C888C8E16EB6C91003D34A1 /* Localizable.strings */, diff --git a/MacPass/MacPass.entitlements b/MacPass/MacPass.entitlements new file mode 100644 index 00000000..1551075c --- /dev/null +++ b/MacPass/MacPass.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.automation.apple-events + + com.apple.security.cs.disable-library-validation + + + From d7b016e5ef19d700844f773d4f87ed1d6bdccc57 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 28 Oct 2019 15:06:15 +0100 Subject: [PATCH 14/34] Bumped to 0.7.10 --- MacPass.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 904c67d3..6152996f 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -2789,7 +2789,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.7.9; + CURRENT_PROJECT_VERSION = 0.7.10; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -2844,7 +2844,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.7.9; + CURRENT_PROJECT_VERSION = 0.7.10; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; From 2beb0335722959eb17b4d175ef5f5224449a0e1e Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 28 Oct 2019 17:03:04 +0100 Subject: [PATCH 15/34] Updated contributors --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 84fc653e..2f3526b4 100644 --- a/README.md +++ b/README.md @@ -105,11 +105,13 @@ The following list might not be complete, please refer to [merged Pull Requests] ### Contributors [ad](mailto:github.mnms@mamber.net), +[Alessandro Vinciguerra](mailto:30745465+Arc676@users.noreply.github.com), [Alex Borisov](mailto:alex@alexborisov.org), [Alex Seeholzer](mailto:seeholzer@gmail.com), [amd](mailto:amd@gurge.com), [Andrew Schleifer](mailto:me@andrewschleifer.name), [AntoineCa](mailto:antoine@carrincazeaux.fr), +[Anton Glezman](mailto:anton@glezman.ru), [Benjamin Steinwender](mailto:b@stbe.at), [binarious](mailto:bieder.martin@googlemail.com), [Can Rau](mailto:cansrau@gmail.com), @@ -118,9 +120,11 @@ The following list might not be complete, please refer to [merged Pull Requests] [Chhom Seng](mailto:chhom.seng@gmail.com), [Christoph Leimbrock](mailto:christoph.leimbrock@gmx.de), [Cory Hutchison](mailto:cjhutchi@users.noreply.github.com), +[César Arratia](mailto:buttcmd@gmail.com), [Daniele Polencic](mailto:daniele.polencic@gmail.com), [darnel](mailto:vojta.j@gmail.com), [Deiwin Sarjas](mailto:deiwin.sarjas@gmail.com), +[Deniz Türkoglu](mailto:denizt@users.noreply.github.com), [Dennis Bolio](mailto:git@bolio.nl), [Dylan Smith](mailto:dylansmith@gmail.com), [eiermaaaan](mailto:37532252+eiermaaaan@users.noreply.github.com), @@ -129,7 +133,7 @@ The following list might not be complete, please refer to [merged Pull Requests] [floriangouy](mailto:florian.gouy@gmail.com), [Francesco Servida](mailto:info@francescoservida.ch), [Frank Enderle](mailto:frank.enderle@anamica.de), -[Frank Kooij](https://github.com/FrankKooij), +[Frank Kooij](mailto:FrankKooij@users.noreply.github.com), [Gaétan Ryckeboer](mailto:gryckeboer@jouve.com), [Geigi](mailto:git@geigi.de), [Henri de Jong](mailto:henridejong@gmail.com), @@ -137,6 +141,7 @@ The following list might not be complete, please refer to [merged Pull Requests] [Jannick Hemelhof](mailto:mister.jannick@gmail.com), [Jefftree](mailto:jeffrey.ying86@live.com), [Jellyfrog](mailto:Jellyfrog@users.noreply.github.com), +[Jesse Reppin](mailto:mail@jessereppin.de), [Joanna Olsen](mailto:jo4flash@gmail.com), [Josh Halstead](mailto:jhalstead85@gmail.com), [Kurt](mailto:kurt@soapbox-software.com), @@ -156,7 +161,7 @@ The following list might not be complete, please refer to [merged Pull Requests] [Nathan Landis](mailto:nathanlandis@gmail.com), [Nathaniel Madura](mailto:nmadura@umich.edu), [neuroine](mailto:d.dzieduch@gmail.com), -[Patrik Thunström](mailto:magebarf@gmail.com), +[Patrik Thunström](mailto:magebarf@gmail.com), [rdoering](mailto:rdoering.info@gmail.com), [remi6397](mailto:remi6397@gmail.com), [Roman Verchikov](mailto:roman-verchikov@users.noreply.github.com), @@ -166,6 +171,7 @@ The following list might not be complete, please refer to [merged Pull Requests] [thesoundofom](mailto:45923716+thesoundofom@users.noreply.github.com), [Thom](mailto:thomscode@gmail.com), [Thorsten Jacoby](mailto:tjacoby@gmail.com), +[Veit-Hendrik Schlenker](mailto:git@vhschlenker.de), [Volcyy](mailto:Volcyy@users.noreply.github.com), [Yonatan Mittlefehldt](mailto:yono@toojuice.com), [Zero King](mailto:l2dy@icloud.com), From 3817bf503f39771faf3cdc8ad774db3ea01bc1f4 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Wed, 30 Oct 2019 10:14:37 +0100 Subject: [PATCH 16/34] Fixed re-setting of url copy or open after each application launch (fixes #989) --- MacPass/MPSettingsHelper.m | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/MacPass/MPSettingsHelper.m b/MacPass/MPSettingsHelper.m index 336e001b..dfe4d04d 100644 --- a/MacPass/MPSettingsHelper.m +++ b/MacPass/MPSettingsHelper.m @@ -102,7 +102,7 @@ NSString *const kMPDepricatedSettingsKeyAutotypeHideAccessibiltyWarning = @"Au @implementation MPSettingsHelper + (void)setupDefaults { - [[NSUserDefaults standardUserDefaults] registerDefaults:[self _standardDefaults]]; + [NSUserDefaults.standardUserDefaults registerDefaults:[self _standardDefaults]]; } + (void)migrateDefaults { @@ -193,7 +193,7 @@ NSString *const kMPDepricatedSettingsKeyAutotypeHideAccessibiltyWarning = @"Au + (void)_removeDeprecatedValues { /* Clear old style values */ for(NSString *key in [self _deprecatedSettingsKeys]) { - [[NSUserDefaults standardUserDefaults] removeObjectForKey:key]; + [NSUserDefaults.standardUserDefaults removeObjectForKey:key]; } } @@ -224,10 +224,18 @@ NSString *const kMPDepricatedSettingsKeyAutotypeHideAccessibiltyWarning = @"Au } + (void)_migrateURLDoubleClickPreferences { - /* Default was NO so if the key was not set, we also get NO, which is what we want */ - BOOL openURL = [[NSUserDefaults standardUserDefaults] boolForKey:kMPDeprecatedSettingsKeyDoubleClickURLToLaunch]; - if(NO == openURL) { - [[NSUserDefaults standardUserDefaults] setInteger:MPDoubleClickURLActionOpen forKey:kMPSettingsKeyDoubleClickURLAction]; + /* + Default was NO so if the key was not set the correct action now should be MPDoubleClickURLActionCopy + But MPDoubleClickURLActionCopy is the default we cannot simply add this value. + Hence we chose to only migrate a changed default and let the "old" default silenty be updated + This is a worth trade-off since the other solution will always re-set the default + */ + if(nil == [NSUserDefaults.standardUserDefaults objectForKey:kMPDeprecatedSettingsKeyDoubleClickURLToLaunch]) { + return; // the value was not set, do nothing since we cannot determine what to do + } + /* only update the settings if the defaults return an explicit set value */ + if([NSUserDefaults.standardUserDefaults boolForKey:kMPDeprecatedSettingsKeyDoubleClickURLToLaunch]) { + [NSUserDefaults.standardUserDefaults setInteger:MPDoubleClickURLActionOpen forKey:kMPSettingsKeyDoubleClickURLAction]; } } From 21a5b5d6bb326f4b83d8485abd94db57596a1887 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Wed, 30 Oct 2019 10:29:23 +0100 Subject: [PATCH 17/34] Using class properties --- MacPass/MPSettingsHelper.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/MacPass/MPSettingsHelper.m b/MacPass/MPSettingsHelper.m index dfe4d04d..63dea553 100644 --- a/MacPass/MPSettingsHelper.m +++ b/MacPass/MPSettingsHelper.m @@ -206,7 +206,7 @@ NSString *const kMPDepricatedSettingsKeyAutotypeHideAccessibiltyWarning = @"Au this was changed in 0.6. to parent.title */ - NSData *descriptorData = [[NSUserDefaults standardUserDefaults] dataForKey:kMPSettingsKeyEntryTableSortDescriptors]; + NSData *descriptorData = [NSUserDefaults.standardUserDefaults dataForKey:kMPSettingsKeyEntryTableSortDescriptors]; if(!descriptorData) { return; // No user defaults } @@ -217,7 +217,7 @@ NSString *const kMPDepricatedSettingsKeyAutotypeHideAccessibiltyWarning = @"Au if(descriptor.selector == @selector(compare:) || [descriptor.key isEqualToString:@"timeInfo.modificationDate"] || [descriptor.key isEqualToString:@"parent.name"] ) { - [[NSUserDefaults standardUserDefaults] removeObjectForKey:kMPSettingsKeyEntryTableSortDescriptors]; + [NSUserDefaults.standardUserDefaults removeObjectForKey:kMPSettingsKeyEntryTableSortDescriptors]; break; } } @@ -241,11 +241,11 @@ NSString *const kMPDepricatedSettingsKeyAutotypeHideAccessibiltyWarning = @"Au + (void)_migrateEntrySearchFlags { /* Entry filters are now stored as archivd search context not just flags */ - NSInteger flags = [[NSUserDefaults standardUserDefaults] integerForKey:kMPDeprecatedSettingsKeyEntrySearchFilterMode]; + NSInteger flags = [NSUserDefaults.standardUserDefaults integerForKey:kMPDeprecatedSettingsKeyEntrySearchFilterMode]; if(flags != 0) { MPEntrySearchContext *context = [[MPEntrySearchContext alloc] initWithString:nil flags:flags]; NSData *contextData = [NSKeyedArchiver archivedDataWithRootObject:context]; - [[NSUserDefaults standardUserDefaults] setObject:contextData forKey:kMPSettingsKeyEntrySearchFilterContext]; + [NSUserDefaults.standardUserDefaults setObject:contextData forKey:kMPSettingsKeyEntrySearchFilterContext]; } } @@ -254,7 +254,7 @@ NSString *const kMPDepricatedSettingsKeyAutotypeHideAccessibiltyWarning = @"Au Database file paths was stored as plain text in keyfile mapping. We only need to store the key file url in plain text, thus hashing the path is sufficent */ - NSDictionary *currentMapping = [[NSUserDefaults standardUserDefaults] dictionaryForKey:kMPSettingsKeyRememeberdKeysForDatabases]; + NSDictionary *currentMapping = [NSUserDefaults.standardUserDefaults dictionaryForKey:kMPSettingsKeyRememeberdKeysForDatabases]; if(!currentMapping) { return; } @@ -276,7 +276,7 @@ NSString *const kMPDepricatedSettingsKeyAutotypeHideAccessibiltyWarning = @"Au } } if(didHash) { - [[NSUserDefaults standardUserDefaults] setObject:hashedDict forKey:kMPSettingsKeyRememeberdKeysForDatabases]; + [NSUserDefaults.standardUserDefaults setObject:hashedDict forKey:kMPSettingsKeyRememeberdKeysForDatabases]; } } From 6897f9e51c5e346582f17df2481b1a747828047d Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Wed, 30 Oct 2019 14:50:46 +0100 Subject: [PATCH 18/34] Added Github sponsorship details --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 2d6c9eb5..123f33d8 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1,2 @@ +github: mstarke custom: https://flattr.com/thing/1550529/mstarkeMacPass-on-GitHub From 631741d30b87abb8040a7974a8361c5278b27cdf Mon Sep 17 00:00:00 2001 From: Oleksandr Yakubchyk Date: Wed, 30 Oct 2019 17:02:06 +0200 Subject: [PATCH 19/34] Fixed #945 Cancel search mode while the search field is empty (#946) --- MacPass/MPToolbarDelegate.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MacPass/MPToolbarDelegate.m b/MacPass/MPToolbarDelegate.m index 098ef5b0..372758b0 100644 --- a/MacPass/MPToolbarDelegate.m +++ b/MacPass/MPToolbarDelegate.m @@ -244,6 +244,12 @@ NSString *const MPToolbarItemAutotype = @"TOOLBAR_AUTOTYPE"; [[NSApp targetForAction:@selector(focusEntries:) to:nil from:self] focusEntries:self]; }); } + if(commandSelector == @selector(cancel:) && control == self.searchField) { + dispatch_async(dispatch_get_main_queue(), ^{ + NSSearchFieldCell *cell = self.searchField.cell; + [[NSApp targetForAction:cell.cancelButtonCell.action to:nil from:self] exitSearch:nil]; + }); + } return NO; } From 264866dff00769f3c24730a70a5f2e6288c71e0d Mon Sep 17 00:00:00 2001 From: Anton Glezman Date: Fri, 1 Nov 2019 16:43:39 +0300 Subject: [PATCH 20/34] Fixed missed localizations (#990) Thank you very much! --- MacPass.xcodeproj/project.pbxproj | 4 ++-- .../AutotypeDoctorReportViewController.strings | 14 ++++++++++---- MacPass/ru.lproj/Localizable.strings | 15 ++++++++++++--- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 6152996f..110ef535 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -956,9 +956,9 @@ 7837112B22553B1D009BD28D /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/AutotypeBuilderView.strings; sourceTree = ""; }; 7837112D225540D1009BD28D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PluginRepositoryBrowserView.xib; sourceTree = ""; }; 78371130225540D8009BD28D /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/PluginRepositoryBrowserView.strings; sourceTree = ""; }; + 78C093DB236A18560008577C /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/AutotypeDoctorReportViewController.strings; sourceTree = ""; }; 78E1F8AF22E3A3DF00E738AE /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/IntegrationPreferences.strings; sourceTree = ""; }; 78E1F8B122E3A5D600E738AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/AutotypeDoctorReportViewController.xib; sourceTree = ""; }; - 78E1F8B422E3A5DB00E738AE /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/AutotypeDoctorReportViewController.strings; sourceTree = ""; }; 78E1F8B822E3B06700E738AE /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/PickcharsView.strings; sourceTree = ""; }; 78E1F8BA22E3B0B700E738AE /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/PickfieldView.strings; sourceTree = ""; }; 78E1F8BC22E3B12300E738AE /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/OpenPanelAccessoryView.strings; sourceTree = ""; }; @@ -2653,10 +2653,10 @@ isa = PBXVariantGroup; children = ( 78E1F8B122E3A5D600E738AE /* Base */, - 78E1F8B422E3A5DB00E738AE /* ru */, 4C1888CF230FBC080054A38F /* de */, 71FF7A27230FEF6B002F488F /* it */, ABE8662F2316617500201125 /* zh-Hans */, + 78C093DB236A18560008577C /* ru */, ); name = AutotypeDoctorReportViewController.xib; sourceTree = ""; diff --git a/MacPass/ru.lproj/AutotypeDoctorReportViewController.strings b/MacPass/ru.lproj/AutotypeDoctorReportViewController.strings index 83dbcfc2..5e482fb5 100644 --- a/MacPass/ru.lproj/AutotypeDoctorReportViewController.strings +++ b/MacPass/ru.lproj/AutotypeDoctorReportViewController.strings @@ -1,8 +1,12 @@ + +/* Class = "NSButtonCell"; title = "Request Permissions…"; ObjectID = "1Nx-Cg-TCn"; */ +"1Nx-Cg-TCn.title" = "Запросить разрешения…"; + /* Class = "NSTextFieldCell"; title = "MacPass will send key press events to the system when Autotype or Global Autotype is executed. Since macOS 10.14 Mojave this is only possible, if Accessibility permissions are granted to the application."; ObjectID = "6GI-KJ-Xue"; */ "6GI-KJ-Xue.title" = "MacPass будет отправлять события нажатия клавиш в систему при выполнении Автоввода или Глобального Автоввода. Начиная с macOS 10.14 Mojave это возможно только в том случае, если приложению разрешено управление копьютером через универсальный доступ."; -/* Class = "NSTextFieldCell"; title = "MacPass will read every window title when Global Autotype is executed to find a match. Since macOS 10.15 Catalina it is not possible to read any window title, if the user has not granted permissions to record the screen. If you are running macOS 10.15 or higher, MacPass will try to capture the left top most pixel on your screen to initate a request to record the screen. This pixel will not be stored and processed in any way."; ObjectID = "7of-1z-Nfk"; */ -"7of-1z-Nfk.title" = "MacPass будет читать заголовки окон чтобы найти совпадения при выполнении Глобального Автоввода. Начиная с macOS 10.15 Catalina невозможно прочитать заголовок окна, если пользователь не предоставил разрешения на запись экрана. Если вы используете MacOS 10.15 или выше, MacPass попытается захватить левый верхний пиксель на вашем экране, чтобы инициировать запрос на запись экрана. Этот пиксель не будет сохранен и обработан каким-либо образом."; +/* Class = "NSTextFieldCell"; title = "MacPass will read every window title when Global Autotype is executed to find a match. Since macOS 10.15 Catalina it is not possible to read any window title, if the user has not granted permissions to record the screen. If you are running macOS 10.15 or higher, MacPass will check if it can read every window title of currently visible windows. This test will not read the actual title. The titles aren't stored or processed in any way."; ObjectID = "7of-1z-Nfk"; */ +"7of-1z-Nfk.title" = "MacPass будет читать заголовки окон чтобы найти совпадения при выполнении Глобального Автоввода. Начиная с macOS 10.15 Catalina невозможно прочитать заголовок окна, если пользователь не предоставил разрешения на запись экрана. Если вы используете MacOS 10.15 или выше, MacPass проверит, возможно ли получить заголовки видимых окон. Заголовки не сохраняются и не обрабатываются каким-либо образом."; /* Class = "NSButtonCell"; title = "Open Accessibilty Preferences…"; ObjectID = "8m1-vs-pd5"; */ "8m1-vs-pd5.title" = "Открыть настройки универсального доступа…"; @@ -10,9 +14,11 @@ /* Class = "NSTextFieldCell"; title = "Screen Recording"; ObjectID = "9gr-mz-2I4"; */ "9gr-mz-2I4.title" = "Запись экрана"; +/* Class = "NSTextFieldCell"; title = "To request Screen Recording permissions, MacPass will try to capture a 1 by 1 Pixel sized screenshot of the top left part of your screen. The data is not stored nor processed in any way."; ObjectID = "Mhg-rd-1hK"; */ +"Mhg-rd-1hK.title" = "Чтобы запросить разрешения на запись экрана, MacPass попытается сделать снимок экрана размером 1 на 1 пиксель в верхней левой части экрана. Эти данные не хранятся и не обрабатываются каким-либо образом."; + /* Class = "NSTextFieldCell"; title = "Accessibility"; ObjectID = "aIL-8W-63g"; */ "aIL-8W-63g.title" = "Универсальный доступ"; -/* Class = "NSButtonCell"; title = "Open Screen Sharing Preferences…"; ObjectID = "lgB-Ys-L9R"; */ +/* Class = "NSButtonCell"; title = "Open Screen Recording Preferences…"; ObjectID = "lgB-Ys-L9R"; */ "lgB-Ys-L9R.title" = "Открыть настройки безопасности…"; - diff --git a/MacPass/ru.lproj/Localizable.strings b/MacPass/ru.lproj/Localizable.strings index 610053d4..abc6ed0d 100644 --- a/MacPass/ru.lproj/Localizable.strings +++ b/MacPass/ru.lproj/Localizable.strings @@ -316,13 +316,19 @@ "DRAG_GROUP" = "Перетащить группу"; /* Action name for duplicating entries */ -"DUPLICATE_ENTRIES_%ld" = "Дублирующиеся записи %ld"; +"DUPLICATE_ENTRIES_ACTION_NAME" = "Дублировать Записи"; /* Menu item to directly diplicate an entry */ -"DUPLICATE_ENTRY" = "Скопировать Запись"; +"DUPLICATE_ENTRY" = "Дублировать Запись"; /* Menu item to duplicate an entry with options how to duplicate. Will present a dialog. */ -"DUPLICATE_ENTRY_WITH_OPTIONS" = "Скопировать Запись…"; +"DUPLICATE_ENTRY_WITH_OPTIONS" = "Дублировать Запись…"; + +/* Menu item to directly diplicate a group */ +"DUPLICATE_GROUP" = "Дублировать Группу"; + +/* Action name for duplicating groups */ +"DUPLICATE_GROUPS_ACTION_NAME" = "Дублировать Группу"; /* Menu item in the database outline context menu to change the template group Menu item on the add entry context menu to edit template groups */ @@ -696,6 +702,9 @@ /* Action button in Notification to show the Autotype Doctor */ "SHOW_AUTOTYPE_DOCTOR" = "Показать помощник автоввода"; +/* Menu item to show the entries group in the outline view */ +"SHOW_GROUP_IN_OUTLINE" = "Показать группу"; + /* Menu item to show the history of the selected entry Toolbar item to toggle history display */ "SHOW_HISTORY" = "Показать историю"; From f1033c100679cefd93a6380d87c24c047183295f Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Wed, 30 Oct 2019 16:04:34 +0100 Subject: [PATCH 21/34] Use properties --- MacPass/MPToolbarDelegate.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MacPass/MPToolbarDelegate.m b/MacPass/MPToolbarDelegate.m index 372758b0..0cd055e3 100644 --- a/MacPass/MPToolbarDelegate.m +++ b/MacPass/MPToolbarDelegate.m @@ -300,7 +300,7 @@ NSString *const MPToolbarItemAutotype = @"TOOLBAR_AUTOTYPE"; [menu addItem:item]; [menu addItem:[NSMenuItem separatorItem]]; - + item = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"RECENT_SEARCHES", @"Recent searches menu item") action:NULL keyEquivalent:@""]; item.tag = NSSearchFieldRecentsTitleMenuItemTag; [menu addItem:item]; @@ -341,7 +341,7 @@ NSString *const MPToolbarItemAutotype = @"TOOLBAR_AUTOTYPE"; } - (void)_didExitSearch:(NSNotification *)notification { - [self.searchField setStringValue:@""]; + self.searchField.stringValue = @""; NSWindow *window = [self.searchField window]; /* Resign first responder form search field only if it was the first responder */ if(window.firstResponder == [self.searchField currentEditor]) { From e8a6af086c54a27506de0335a10ad11621524f6f Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Wed, 30 Oct 2019 16:38:29 +0100 Subject: [PATCH 22/34] Using cancelOperation: since this is called by pressing the Esc key. --- MacPass/MPToolbarDelegate.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/MacPass/MPToolbarDelegate.m b/MacPass/MPToolbarDelegate.m index 0cd055e3..ea214ed6 100644 --- a/MacPass/MPToolbarDelegate.m +++ b/MacPass/MPToolbarDelegate.m @@ -238,16 +238,18 @@ NSString *const MPToolbarItemAutotype = @"TOOLBAR_AUTOTYPE"; #pragma mark - NSSearchFieldDelegate - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector { + if(control != self.searchField) { + return NO; + } if(commandSelector == @selector(insertNewline:) || commandSelector == @selector(moveDown:)) { /* Dispatch the focus loss since doing it now will break recent search storage */ dispatch_async(dispatch_get_main_queue(), ^{ [[NSApp targetForAction:@selector(focusEntries:) to:nil from:self] focusEntries:self]; }); } - if(commandSelector == @selector(cancel:) && control == self.searchField) { + if(commandSelector == @selector(cancelOperation:) ) { dispatch_async(dispatch_get_main_queue(), ^{ - NSSearchFieldCell *cell = self.searchField.cell; - [[NSApp targetForAction:cell.cancelButtonCell.action to:nil from:self] exitSearch:nil]; + [[NSApp targetForAction:@selector(exitSearch:) to:nil from:self] exitSearch:nil]; }); } return NO; From 11bea5fa32d5bb181b488acb01c221a9e7863378 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Fri, 1 Nov 2019 15:24:31 +0100 Subject: [PATCH 23/34] Removed magic numbers --- MacPass/MPContextButton.h | 6 ++++++ MacPass/MPContextButton.m | 29 +++++++++++++++++------------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/MacPass/MPContextButton.h b/MacPass/MPContextButton.h index 521e897e..d118e5b1 100644 --- a/MacPass/MPContextButton.h +++ b/MacPass/MPContextButton.h @@ -24,6 +24,12 @@ @interface MPContextButton : NSSegmentedControl +typedef NS_ENUM(NSUInteger, MPContextButtonSegment) { + MPContextButtonSegmentButton, + MPContextButtonSegmentContextButton, + MPContextButtonSegmentCount // do not use +}; + @property (nonatomic, strong) NSMenu *contextMenu; - (void)setImage:(NSImage *)image; diff --git a/MacPass/MPContextButton.m b/MacPass/MPContextButton.m index 0d092156..c09e989f 100644 --- a/MacPass/MPContextButton.m +++ b/MacPass/MPContextButton.m @@ -53,14 +53,14 @@ self.focusRingType = NSFocusRingTypeNone; self.segmentStyle = NSSegmentStyleTexturedSquare; - self.segmentCount = 2; + self.segmentCount = MPContextButtonSegmentCount; cell.trackingMode = NSSegmentSwitchTrackingMomentary; - [cell setWidth:31 forSegment:0]; - [cell setWidth:17 forSegment:1]; + [cell setWidth:31 forSegment:MPContextButtonSegmentButton]; + [cell setWidth:17 forSegment:MPContextButtonSegmentContextButton]; cell.trackingMode = NSSegmentSwitchTrackingMomentary; NSImage *contextTriangle = [NSBundle.mainBundle imageForResource:@"contextTriangleTemplate"]; - [self setImage:contextTriangle forSegment:1]; + [self setImage:contextTriangle forSegment:MPContextButtonSegmentContextButton]; cell.contextMenuAction = @selector(showContextMenu:); cell.contextMenuTarget = self; @@ -76,42 +76,42 @@ Block the segment setter to prevent accidental settings */ - (void)setImage:(NSImage *)image forSegment:(NSInteger)segment { - if(segment < 2) { + if(segment < MPContextButtonSegmentCount) { [super setImage:image forSegment:segment]; } } - (void)setSegmentCount:(NSInteger)count { - if(count == 2) { + if(count == MPContextButtonSegmentCount) { super.segmentCount = count; } } - (void)setImage:(NSImage *)image { - [self setImage:image forSegment:0]; + [self setImage:image forSegment:MPContextButtonSegmentButton]; } - (void)showContextMenu:(id)sender { NSPoint point = self.frame.origin; - point.x = [self.cell widthForSegment:0]; + point.x = [self.cell widthForSegment:MPContextButtonSegmentButton]; point.y = NSHeight(self.frame) + 3; [_contextMenu popUpMenuPositioningItem:nil atLocation:point inView:self]; } - (void)setControlSize:(NSControlSize)controlSize { - NSImageRep *rep = [[self imageForSegment:0] bestRepresentationForRect:NSMakeRect(0, 0, 100, 100) context:nil hints:nil]; + NSImageRep *rep = [[self imageForSegment:MPContextButtonSegmentButton] bestRepresentationForRect:NSMakeRect(0, 0, 100, 100) context:nil hints:nil]; CGFloat scale = rep.size.width / rep.size.height; switch (controlSize) { case NSRegularControlSize: - [self imageForSegment:0].size = NSMakeSize(16 * scale, 16); + [self imageForSegment:MPContextButtonSegmentButton].size = NSMakeSize(16 * scale, 16); break; case NSSmallControlSize: - [self imageForSegment:0].size = NSMakeSize(14 * scale, 14); + [self imageForSegment:MPContextButtonSegmentButton].size = NSMakeSize(14 * scale, 14); break; case NSMiniControlSize: - [self imageForSegment:0].size = NSMakeSize(8 * scale, 8); + [self imageForSegment:MPContextButtonSegmentButton].size = NSMakeSize(8 * scale, 8); default: break; @@ -123,4 +123,9 @@ return super.controlSize; } +- (void)_updateContextButtonState { + BOOL hasContextMenu = (self.contextMenu != nil); + [self setEnabled:hasContextMenu forSegment:MPContextButtonSegmentContextButton]; +} + @end From c7bdce46ff8f791ffb1bf00f722a17bb6c6767b1 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Fri, 1 Nov 2019 16:07:37 +0100 Subject: [PATCH 24/34] first stab at a automated release --- scripts/prepare_release.sh | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 scripts/prepare_release.sh diff --git a/scripts/prepare_release.sh b/scripts/prepare_release.sh new file mode 100755 index 00000000..5e14d851 --- /dev/null +++ b/scripts/prepare_release.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +POSITIONAL=() +while [[ $# -gt 0 ]] +do +key="$1" + +case $key in + -s|--sign) + IDENTITY="$2" + shift # past argument + shift # past value + ;; + -u|--username) + USERNAME="$2" + shift # past argument + shift # past value + ;; + -p|--password) + PASSWORD="$2" + shift # past argument + shift # past value + ;; + -e|--entitlements) + ENTITLEMENTS="$2" + shift # past argument + shift # past value + ;; + *) # unknown option + POSITIONAL+=("$1") # save it in an array for later + shift # past argument + ;; +esac +done + +set -- "${POSITIONAL[@]}" # restore positional parameters + +if [[ -z "${IDENTITY}" ]]; then + echo "Missing identity" + exit -1 +fi +if [[ -z "${ENTITLEMENTS}" ]]; then + echo "Missing entitlements" + exit -1 +fi +if [[ -z "${USERNAME}" ]]; then + echo "Missing username" + exit -1 +fi +if [[ -z "${PASSWORD}" ]]; then + echo "Missing password" + exit -1 +fi + +BUILD_FOLDER="${TMPDIR}" +APP_BUNDLE=MacPass.app +APP_BUNDLE_ZIP="${APP_BUNDLE}".zip +cd .. +xcodebuild build -configuration Release -project MacPass.xcodeproj -scheme MacPass CODE_SIGNING_REQUIRED=NO -derivedDataPath "${BUILD_FOLDER}" +cd "${BUILD_FOLDER}" +echo codesign --sign "${IDENTITY}" --options runtime --deep --force --entitlements "${ENTITLEMENTS}" "${APP_BUNDLE}" +echo ditto -c -k --keepParent "${APP_BUNDLE}" "${APP_BUNDLE_ZIP}" +xcrun altool --notarize-app --primary-bundle-id "com.hicknhacksoftware.MacPass.zip" --username "${USERNAME}" --password "${PASSWORD}" --file "${APP_BUNDLE_ZIP}" +#xcrun stapler staple "${APP_BUNDLE}" From b87e20ca7ea53bff3fa12691c2a3d17104e06516 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 4 Nov 2019 10:38:45 +0100 Subject: [PATCH 25/34] prepare release now works --- scripts/prepare_release.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/prepare_release.sh b/scripts/prepare_release.sh index 5e14d851..74c1db6e 100755 --- a/scripts/prepare_release.sh +++ b/scripts/prepare_release.sh @@ -52,13 +52,20 @@ if [[ -z "${PASSWORD}" ]]; then exit -1 fi -BUILD_FOLDER="${TMPDIR}" +DERIVED_DATA_FOLDER="${TMPDIR}" +BUILD_FOLDER="${DERIVED_DATA_FOLDER}"/Build/Products/Release APP_BUNDLE=MacPass.app APP_BUNDLE_ZIP="${APP_BUNDLE}".zip cd .. -xcodebuild build -configuration Release -project MacPass.xcodeproj -scheme MacPass CODE_SIGNING_REQUIRED=NO -derivedDataPath "${BUILD_FOLDER}" +echo "Building..." +xcodebuild build -configuration Release -project MacPass.xcodeproj -scheme MacPass CODE_SIGNING_REQUIRED=NO -derivedDataPath "${DERIVED_DATA_FOLDER}" cd "${BUILD_FOLDER}" -echo codesign --sign "${IDENTITY}" --options runtime --deep --force --entitlements "${ENTITLEMENTS}" "${APP_BUNDLE}" -echo ditto -c -k --keepParent "${APP_BUNDLE}" "${APP_BUNDLE_ZIP}" +echo "" +echo "Signing..." +codesign --sign "${IDENTITY}" --options runtime --deep --force --entitlements "${ENTITLEMENTS}" "${APP_BUNDLE}" +echo "" +echo "Archiving..." +ditto -c -k --keepParent "${APP_BUNDLE}" "${APP_BUNDLE_ZIP}" +echo "Requesting Notarization..." xcrun altool --notarize-app --primary-bundle-id "com.hicknhacksoftware.MacPass.zip" --username "${USERNAME}" --password "${PASSWORD}" --file "${APP_BUNDLE_ZIP}" #xcrun stapler staple "${APP_BUNDLE}" From 3639913e6d3fd1b6349b59e562c055d5f0eeba4a Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 4 Nov 2019 12:38:34 +0100 Subject: [PATCH 26/34] Re-added english localization for Info.plist since it seems to break on macOS 10.15 --- MacPass.xcodeproj/project.pbxproj | 2 ++ MacPass/en.lproj/InfoPlist.strings | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 MacPass/en.lproj/InfoPlist.strings diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 110ef535..becea07d 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -734,6 +734,7 @@ 4C97CCEF1FA727DC00E58F8C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; 4C9BFFF91FD19B5400264B16 /* MPPrettyPasswordTransformer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPPrettyPasswordTransformer.h; sourceTree = ""; }; 4C9BFFFA1FD19B5400264B16 /* MPPrettyPasswordTransformer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPPrettyPasswordTransformer.m; sourceTree = ""; }; + 4C9FE47423703DA50096A5EA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 4CA08D9E17A831B200A6544B /* MPAddEntryContextMenuDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAddEntryContextMenuDelegate.h; sourceTree = ""; }; 4CA08D9F17A831B200A6544B /* MPAddEntryContextMenuDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAddEntryContextMenuDelegate.m; sourceTree = ""; }; 4CA0B2EC15BCADAC00654E32 /* PreferencesWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PreferencesWindow.xib; sourceTree = ""; }; @@ -2369,6 +2370,7 @@ 4C4161151F50333C003BC0AF /* es */, FAA9109A1F9A95A500F7CB90 /* pl */, 6A74B07C2076F4B60049BC29 /* sv-SE */, + 4C9FE47423703DA50096A5EA /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/MacPass/en.lproj/InfoPlist.strings b/MacPass/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..7a34a796 --- /dev/null +++ b/MacPass/en.lproj/InfoPlist.strings @@ -0,0 +1,18 @@ +/* Bundle name */ +"CFBundleName" = "MacPass"; + +/* (No Comment) */ +"KDB Database" = "KDB Database"; + +/* (No Comment) */ +"KDBX Database" = "KDBX Database"; + +/* (No Comment) */ +"MacPass Plugin" = "MacPass Plugin"; + +/* (No Comment) */ +"NSHumanReadableCopyright" = "Copyright ©2012-2019 HicknHack Software GmbH. All rights reserved."; + +/* (No Comment) */ +"XML" = "XML"; + From ba538d05af5c5e6f62c195ac4d99d7faad3c0bc2 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 4 Nov 2019 15:45:34 +0100 Subject: [PATCH 27/34] note to use xmllint to check for notarization status --- scripts/prepare_release.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/prepare_release.sh b/scripts/prepare_release.sh index 74c1db6e..45758e43 100755 --- a/scripts/prepare_release.sh +++ b/scripts/prepare_release.sh @@ -69,3 +69,4 @@ ditto -c -k --keepParent "${APP_BUNDLE}" "${APP_BUNDLE_ZIP}" echo "Requesting Notarization..." xcrun altool --notarize-app --primary-bundle-id "com.hicknhacksoftware.MacPass.zip" --username "${USERNAME}" --password "${PASSWORD}" --file "${APP_BUNDLE_ZIP}" #xcrun stapler staple "${APP_BUNDLE}" +#xmllint --xpath "/plist/dict/key[contains(text(),'success-message')]::following-sibling" status.xml \ No newline at end of file From f10735f96fb11428cf714e11c90ce64cfdf73e07 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 4 Nov 2019 15:47:54 +0100 Subject: [PATCH 28/34] Changed screen recording detection to use "at least one window name should be present) --- MacPass/MPAutotypeDoctor.m | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/MacPass/MPAutotypeDoctor.m b/MacPass/MPAutotypeDoctor.m index 5ac00a69..cf1e3dbb 100644 --- a/MacPass/MPAutotypeDoctor.m +++ b/MacPass/MPAutotypeDoctor.m @@ -73,12 +73,9 @@ if(windowName) { numberOfWindowsWithName++; } - else { - break; //breaking early, numberOfWindowsWithName not increased - } } CFRelease(windowList); - BOOL canRecordScreen = (numberOfWindows == numberOfWindowsWithName); + BOOL canRecordScreen = (numberOfWindows == 0) || (numberOfWindowsWithName > 0); if(!canRecordScreen && error) { *error = [NSError errorInDomain:MPAutotypeErrorDomain withCode:MPErrorAutotypeIsMissingScreenRecordingPermissions description:NSLocalizedString(@"ERROR_NO_PERMISSION_TO_RECORD_SCREEN", "Error description for missing screen recording permissions")]; } From b6a7240534ce606426ef83c57719692eae48f823 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 4 Nov 2019 15:48:36 +0100 Subject: [PATCH 29/34] Bumped version. Ensure versioning is always done after Info.plist was copied. --- MacPass.xcodeproj/project.pbxproj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index becea07d..55b04f20 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -1995,13 +1995,15 @@ files = ( ); inputPaths = ( + "${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}", + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = Versioning; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "git=`sh /etc/profile; which git`\n#branch_name=`$git symbolic-ref HEAD | sed -e 's,refs/heads/\\\\(.*\\\\),\\\\1,'`\nbranch_name=`$git rev-parse --abbrev-ref HEAD`\n#simple_branch_name=`$git rev-parse --abbrev-ref HEAD`\ngit_count=`$git rev-list $branch_name |wc -l | sed 's/^ *//;s/ *$//'`\n\nbuild_number=\"${git_count}0\"\nif [ $CONFIGURATION != \"Release\" ] || [ $branch_name != \"master\" ]; then\nbuild_number+=\"-$branch_name\"\nfi\nif [ \"$CI\" = \"true\" ]; then\nbuild_date=`date +\"%Y%m%d%H%m%S\"`\nbuild_number=\"$build_date-continuous\"\nfi\n\nplist=\"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"\ndsym_plist=\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist\"\n\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $build_number\" \"$plist\"\nif [ -f \"$DSYM_INFO_PLIST\" ] ; then\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $build_number\" \"$dsym_plist\"\nfi\n"; + shellScript = "git=`sh /etc/profile; which git`\nbranch_name=`$git rev-parse --abbrev-ref HEAD`\ngit_count=`$git rev-list $branch_name |wc -l | sed 's/^ *//;s/ *$//'`\n\nbuild_number=\"${git_count}0\"\nif [ $CONFIGURATION != \"Release\" ] || [ $branch_name != \"master\" ]; then\nbuild_number+=\"-$branch_name\"\nfi\nif [ \"$CI\" = \"true\" ]; then\nbuild_date=`date +\"%Y%m%d%H%m%S\"`\nbuild_number=\"$build_date-continuous\"\nfi\n\nplist=\"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"\ndsym_plist=\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist\"\n\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $build_number\" \"$plist\"\nif [ -f \"$DSYM_INFO_PLIST\" ] ; then\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $build_number\" \"$dsym_plist\"\nfi\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -2791,7 +2793,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.7.10; + CURRENT_PROJECT_VERSION = 0.7.11; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -2846,7 +2848,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.7.10; + CURRENT_PROJECT_VERSION = 0.7.11; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; From ff72632b3ba2a554a104bf8ec9ca7bbea86b0bbc Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 4 Nov 2019 16:08:24 +0100 Subject: [PATCH 30/34] Do show info when no recent documents are present in Welcome Window (fixes #996) --- MacPass/MPWelcomeViewController.m | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/MacPass/MPWelcomeViewController.m b/MacPass/MPWelcomeViewController.m index 3f8ab5b0..37fa4dda 100644 --- a/MacPass/MPWelcomeViewController.m +++ b/MacPass/MPWelcomeViewController.m @@ -7,6 +7,7 @@ // #import "MPWelcomeViewController.h" +#import "MPConstants.h" @interface MPWelcomeViewController () @@ -26,17 +27,32 @@ } - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { - return NSDocumentController.sharedDocumentController.recentDocumentURLs.count; + return MAX(1, NSDocumentController.sharedDocumentController.recentDocumentURLs.count); } - (nullable NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row { NSTableCellView *view = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self]; - NSURL *url = NSDocumentController.sharedDocumentController.recentDocumentURLs[row]; - view.textField.stringValue = url.lastPathComponent; - view.imageView.image = [NSWorkspace.sharedWorkspace iconForFile:url.path]; + NSArray *recentURLS = NSDocumentController.sharedDocumentController.recentDocumentURLs; + if(row > -1 && row < recentURLS.count) { + NSURL *url = recentURLS[row]; + view.textField.enabled = YES; + view.imageView.enabled = YES; + view.textField.stringValue = url.lastPathComponent; + view.imageView.image = [NSWorkspace.sharedWorkspace iconForFile:url.path]; + } + else { + view.textField.enabled = NO; + view.imageView.enabled = NO; + view.textField.stringValue = NSLocalizedString(@"WELCOME_WINDOW_NO_RECENT_DOCUMENTS", "Text displayed when no recent documents can be displayed in"); + view.imageView.image = [NSWorkspace.sharedWorkspace iconForFileType:MPKdbxDocumentUTI]; + } return view; } +- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row { + return (NSDocumentController.sharedDocumentController.recentDocumentURLs.count > 0); +} + - (IBAction)openRecentURL:(id)sender { NSInteger clicked = self.tableView.clickedRow; NSArray *recentURLS = NSDocumentController.sharedDocumentController.recentDocumentURLs; From 0a7fcc415ca783d214af6fbd518af6e6300ca985 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 4 Nov 2019 16:11:44 +0100 Subject: [PATCH 31/34] Disabled currently unused context button for add fields button (fixes #995) --- MacPass/MPEntryInspectorViewController.m | 1 + 1 file changed, 1 insertion(+) diff --git a/MacPass/MPEntryInspectorViewController.m b/MacPass/MPEntryInspectorViewController.m index ec49f3b2..35c2d43e 100644 --- a/MacPass/MPEntryInspectorViewController.m +++ b/MacPass/MPEntryInspectorViewController.m @@ -557,6 +557,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) { NSMenu *customFieldMenu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"ADD_CUSTOM_FIELD_CONTEXT_MENU", @"Menu displayed for adding special custom keys")]; customFieldMenu.delegate = _addCustomFieldContextMenuDelegate; self.addCustomFieldButton.contextMenu = customFieldMenu; + [self.addCustomFieldButton setEnabled:NO forSegment:MPContextButtonSegmentContextButton]; } #pragma mark - From 16cdd4dd4fc06bc629a7b291240412619b96ffb7 Mon Sep 17 00:00:00 2001 From: Anton Glezman Date: Thu, 7 Nov 2019 22:43:24 +0300 Subject: [PATCH 32/34] Fixed overlay window image color (#999) * Fixed overlay window image color * Fixed color property --- MacPass/MPOverlayWindowController.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MacPass/MPOverlayWindowController.m b/MacPass/MPOverlayWindowController.m index edf87f21..87397121 100644 --- a/MacPass/MPOverlayWindowController.m +++ b/MacPass/MPOverlayWindowController.m @@ -60,10 +60,14 @@ self.window.alphaValue = 0; self.window.opaque = NO; self.window.hasShadow = YES; + self.window.backgroundColor = NSColor.clearColor; self.textField.cell.backgroundStyle = NSBackgroundStyleLowered; - self.imageView.cell.backgroundStyle = NSBackgroundStyleDark; + self.imageView.cell.backgroundStyle = NSBackgroundStyleEmphasized; ((NSImageCell *)self.imageView.cell).imageAlignment = NSImageAlignCenter; + if (@available(macOS 10.14, *)) { + self.imageView.contentTintColor = NSColor.textColor; + } } - (void)displayOverlayImage:(NSImage *)imageOrNil label:(NSString *)labelOrNil atView:(NSView *)view { From 9b77790ddcbb4e61615f0c479f801479f07f5293 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Fri, 22 Nov 2019 16:30:21 +0100 Subject: [PATCH 33/34] Use blog based api instead of block one to track down macOS 10.15 bug --- MacPass/MPPathControl.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MacPass/MPPathControl.m b/MacPass/MPPathControl.m index 77018ac3..fe5c8d5f 100644 --- a/MacPass/MPPathControl.m +++ b/MacPass/MPPathControl.m @@ -47,10 +47,11 @@ if([self.delegate respondsToSelector:@selector(pathControl:willDisplayOpenPanel:)]) { [self.delegate pathControl:self willDisplayOpenPanel:panel]; } - NSModalResponse result = [panel runModal]; - if(result == NSModalResponseOK) { - self.URL = panel.URLs.firstObject; - } + [panel beginWithCompletionHandler:^(NSModalResponse result) { + if(result == NSModalResponseOK) { + self.URL = panel.URLs.firstObject; + } + }]; } - (void)pathControl:(NSPathControl *)pathControl willPopUpMenu:(NSMenu *)menu { From 09a7a15141002b1d692d744a956c5cd7353d239d Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Wed, 27 Nov 2019 12:02:45 +0100 Subject: [PATCH 34/34] Altered screen recording check to Craig Hockenberry's solution --- MacPass/MPAutotypeDoctor.m | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/MacPass/MPAutotypeDoctor.m b/MacPass/MPAutotypeDoctor.m index cf1e3dbb..7da4e576 100644 --- a/MacPass/MPAutotypeDoctor.m +++ b/MacPass/MPAutotypeDoctor.m @@ -63,19 +63,41 @@ - (BOOL)hasScreenRecordingPermissions:(NSError *__autoreleasing*)error { /* macos 10.14 and lower do not require screen recording permission to get window titles */ - if (@available(macOS 10.15, *)) { + + /* + Solution is heavily inspired by Craig Hockenberry's + https://stackoverflow.com/questions/56597221/detecting-screen-recording-settings-on-macos-catalina/58985069#58985069 + */ + if(@available(macOS 10.15, *)) { CFArrayRef windowList = CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly, kCGNullWindowID); NSUInteger numberOfWindows = CFArrayGetCount(windowList); - NSUInteger numberOfWindowsWithName = 0; + BOOL canRecordScreen = NO; for(int idx = 0; idx < numberOfWindows; idx++) { NSDictionary *windowInfo = (NSDictionary *)CFArrayGetValueAtIndex(windowList, idx); + NSNumber *ownerPid = windowInfo[(id)kCGWindowOwnerPID]; + /* + Skip over our own windows + */ + if(ownerPid.intValue == NSProcessInfo.processInfo.processIdentifier) { + continue; + } + /* + Skip applications we aren't allowed to access anyway + */ + NSRunningApplication *ownerApp = [NSRunningApplication runningApplicationWithProcessIdentifier:ownerPid.intValue]; + if(!ownerApp) { + continue; + } NSString *windowName = windowInfo[(id)kCGWindowName]; if(windowName) { - numberOfWindowsWithName++; + if([ownerApp.executableURL.lastPathComponent isEqualToString:@"Dock"]) { + continue; + } + canRecordScreen = YES; + break; } } CFRelease(windowList); - BOOL canRecordScreen = (numberOfWindows == 0) || (numberOfWindowsWithName > 0); if(!canRecordScreen && error) { *error = [NSError errorInDomain:MPAutotypeErrorDomain withCode:MPErrorAutotypeIsMissingScreenRecordingPermissions description:NSLocalizedString(@"ERROR_NO_PERMISSION_TO_RECORD_SCREEN", "Error description for missing screen recording permissions")]; }