From fa85da3f823355a422a3d5cebf11c839721bd40d Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Sat, 12 Dec 2020 14:00:33 +0100 Subject: [PATCH] Removed custom OTP entry category since KeePassKit now has all we need --- MacPass.xcodeproj/project.pbxproj | 6 ----- MacPass/KPKEntry+OTP.h | 19 -------------- MacPass/KPKEntry+OTP.m | 25 ------------------- MacPass/MPAddCustomFieldContextMenuDelegate.m | 1 - MacPass/MPEntryInspectorViewController.m | 2 -- MacPass/MPTOTPViewController.m | 4 +-- 6 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 MacPass/KPKEntry+OTP.h delete mode 100644 MacPass/KPKEntry+OTP.m diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index cf262cfa..1f3e0483 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -239,7 +239,6 @@ 4CAD748C15B889B700104512 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CAD748B15B889B700104512 /* Security.framework */; }; 4CAD748E15B88AC100104512 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CAD748D15B88AC100104512 /* libz.dylib */; }; 4CAD8AA622CF397B0090B2DD /* MPAutotypeDoctorReportViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAD8AA422CF397B0090B2DD /* MPAutotypeDoctorReportViewController.m */; }; - 4CB11241256EB77900204D1B /* KPKEntry+OTP.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CB11240256EB77900204D1B /* KPKEntry+OTP.m */; }; 4CB33F861EAF54A000C9341E /* KPKNode+MPIsHistory.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CB33F851EAF54A000C9341E /* KPKNode+MPIsHistory.m */; }; 4CB9339916D3A0DD00A13B5D /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 4CB9339716D3A0DD00A13B5D /* Credits.rtf */; }; 4CBA2ABA17074C07006D8139 /* MPSettingsHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CBA2AB917074C07006D8139 /* MPSettingsHelper.m */; }; @@ -801,8 +800,6 @@ 4CAD748D15B88AC100104512 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 4CAD8AA322CF397B0090B2DD /* MPAutotypeDoctorReportViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPAutotypeDoctorReportViewController.h; sourceTree = ""; }; 4CAD8AA422CF397B0090B2DD /* MPAutotypeDoctorReportViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPAutotypeDoctorReportViewController.m; sourceTree = ""; }; - 4CB1123F256EB77900204D1B /* KPKEntry+OTP.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "KPKEntry+OTP.h"; sourceTree = ""; }; - 4CB11240256EB77900204D1B /* KPKEntry+OTP.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "KPKEntry+OTP.m"; sourceTree = ""; }; 4CB33F841EAF54A000C9341E /* KPKNode+MPIsHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KPKNode+MPIsHistory.h"; sourceTree = ""; }; 4CB33F851EAF54A000C9341E /* KPKNode+MPIsHistory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "KPKNode+MPIsHistory.m"; sourceTree = ""; }; 4CB63A6018986530002DEC4C /* MPFlagsHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPFlagsHelper.h; sourceTree = ""; }; @@ -1213,8 +1210,6 @@ 4C0949581FD6B89B004F2971 /* NSUserNotification+MPAdditions.m */, 4C6BF0742559BD4800E5812A /* KPKBinary+MacPassAddtions.h */, 4C6BF0752559BD4800E5812A /* KPKBinary+MacPassAddtions.m */, - 4CB1123F256EB77900204D1B /* KPKEntry+OTP.h */, - 4CB11240256EB77900204D1B /* KPKEntry+OTP.m */, 4C35663E25824C0A00CAB95B /* NSImage+MPQRCode.h */, 4C35663F25824C0A00CAB95B /* NSImage+MPQRCode.m */, ); @@ -2218,7 +2213,6 @@ 4CE298EB1795FC2A00DF7BDB /* MPEntryContextMenuDelegate.m in Sources */, 4CCCE8011D75CA48006AA951 /* MPArrayController.m in Sources */, 4CC0D2CE17974A47000B4BDA /* MPCustomFieldTableViewDelegate.m in Sources */, - 4CB11241256EB77900204D1B /* KPKEntry+OTP.m in Sources */, 4CC0D2D117974A5A000B4BDA /* MPAttachmentTableViewDelegate.m in Sources */, 4C26C33F18D8C92100CF1A1C /* MPTemporaryFileStorage.m in Sources */, 4C663D411D6D91A900CB6237 /* MPNumberFormatter.m in Sources */, diff --git a/MacPass/KPKEntry+OTP.h b/MacPass/KPKEntry+OTP.h deleted file mode 100644 index c465ed8c..00000000 --- a/MacPass/KPKEntry+OTP.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// KPKEntry+OTP.h -// MacPass -// -// Created by Michael Starke on 25.11.20. -// Copyright © 2020 HicknHack Software GmbH. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface KPKEntry (OTP) - -@property (readonly, assign, nonatomic) BOOL hasTOTP; - -@end - -NS_ASSUME_NONNULL_END diff --git a/MacPass/KPKEntry+OTP.m b/MacPass/KPKEntry+OTP.m deleted file mode 100644 index e19011bb..00000000 --- a/MacPass/KPKEntry+OTP.m +++ /dev/null @@ -1,25 +0,0 @@ -// -// KPKEntry+OTP.m -// MacPass -// -// Created by Michael Starke on 25.11.20. -// Copyright © 2020 HicknHack Software GmbH. All rights reserved. -// - -#import "KPKEntry+OTP.h" - -@implementation KPKEntry (OTP) - -+ (NSSet *)keyPathsForValuesAffectingHasTOTP { - return [NSSet setWithObject:NSStringFromSelector(@selector(attributes))]; -} - -- (BOOL)hasTOTP { - BOOL hasURLKey = [self hasAttributeWithKey:kKPKAttributeKeyOTPOAuthURL]; - BOOL hasSeedKey = [self hasAttributeWithKey:kKPKAttributeKeyTimeOTPSeed]; - BOOL hasSettingsKey = [self hasAttributeWithKey:kKPKAttributeKeyTimeOTPSettings]; - - return(hasURLKey || (hasSeedKey && hasSettingsKey)); -} - -@end diff --git a/MacPass/MPAddCustomFieldContextMenuDelegate.m b/MacPass/MPAddCustomFieldContextMenuDelegate.m index 97983a2d..ddf96f3d 100644 --- a/MacPass/MPAddCustomFieldContextMenuDelegate.m +++ b/MacPass/MPAddCustomFieldContextMenuDelegate.m @@ -23,7 +23,6 @@ #import "MPAddCustomFieldContextMenuDelegate.h" #import "KeePassKit/KeePassKit.h" -#import "KPKEntry+OTP.h" /* HmacOtp-Secret (the UTF-8 representation of the value is the secret), diff --git a/MacPass/MPEntryInspectorViewController.m b/MacPass/MPEntryInspectorViewController.m index e5ac9b02..c68240fe 100644 --- a/MacPass/MPEntryInspectorViewController.m +++ b/MacPass/MPEntryInspectorViewController.m @@ -49,8 +49,6 @@ #import "MPArrayController.h" -#import "KPKEntry+OTP.h" - #import "KeePassKit/KeePassKit.h" #import "HNHUi/HNHUi.h" diff --git a/MacPass/MPTOTPViewController.m b/MacPass/MPTOTPViewController.m index e98b83e5..ae3807b9 100644 --- a/MacPass/MPTOTPViewController.m +++ b/MacPass/MPTOTPViewController.m @@ -8,8 +8,6 @@ #import "MPTOTPViewController.h" -#import "KPKEntry+OTP.h" - #import @interface MPTOTPViewController () @@ -45,7 +43,7 @@ - (void)_updateDisplay { KPKEntry *entry = (KPKEntry *)self.representedObject; - BOOL showTOTP = entry.hasTOTP; + BOOL showTOTP = entry.hasTimeOTP; self.view.hidden = !showTOTP; if(showTOTP) { self.remainingTimeProgressIndicator.indeterminate = YES;