-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed Xcode 15 compatibility by bumping deployment target to 10.13
- Loading branch information
Showing
18 changed files
with
296 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
github "MacPass/KissXML" "933f04fe5ad95c2be07ec0c2f801e140007f20fa" | ||
github "MacPass/KissXML" "503fc012b73a4507965019720cbf1c157e849657" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
github "MacPass/KissXML" "933f04fe5ad95c2be07ec0c2f801e140007f20fa" | ||
github "MacPass/KissXML" "503fc012b73a4507965019720cbf1c157e849657" |
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
KeePassKit.xcodeproj/xcshareddata/xcschemes/KeePassKit iOS.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
KeePassKit.xcodeproj/xcshareddata/xcschemes/KeePassKit macOS.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
KeePassKit.xcodeproj/xcshareddata/xcschemes/KeePassKit tvOS.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
KeePassKit.xcodeproj/xcshareddata/xcschemes/KeePassKit watchOS.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// | ||
// KPKSynchronizationChangesItem.h | ||
// KeePassKit | ||
// | ||
// Created by Michael Starke on 05.10.22. | ||
// Copyright © 2022 HicknHack Software GmbH. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
typedef NS_ENUM(NSUInteger, KPKSynchronizationChangeType) { | ||
KPKSynchronizationChangeTypeAddedNode, | ||
KPKSynchronizationChangeTypeRemovedNode, | ||
KPKSynchronizationChangeTypeMovedNode, | ||
KPKSynchronizationChangeTypeChangedNodeAttribute, // Node attributes have changed | ||
KPKSynchronizationChangeTypeAddedNodeAttribute, // Node attributes where added - valid only for entries | ||
KPKSynchronizationChangeTypeRemovedNodeAttribute, // Node attributes where removed - valid only for entries | ||
KPKSynchronizationChangeTypeAddedIcon, | ||
KPKSynchronizationChangeTypeRemovedIcon, | ||
KPKSynchronizationChangeTypeChangedIcon, | ||
KPKSynchronizationChangeTypeChangedMetaData, // Any changes in inner settings e.g. Templates, Recycle Bin, History, Name, Color | ||
}; | ||
|
||
@class KPKNode; | ||
@class KPKGroup; | ||
@class KPKAttribute; | ||
|
||
@interface KPKSynchronizationChangesItem : NSObject | ||
|
||
@property (readonly) KPKSynchronizationChangeType changeType; | ||
|
||
@property (readonly, copy) NSUUID *uuid; // the uuid of the affected node | ||
|
||
+ (instancetype)itemWithChangedAttributeKey:(NSString *)key localValue:(NSString *)localValue remoteValue:(NSString *)remoteValue; | ||
+ (instancetype)itemWithAddedNode:(KPKNode *)node parent:(KPKGroup *)group; | ||
+ (instancetype)itemWithRemovedNode:(KPKNode *)node; | ||
|
||
- (instancetype)init NS_UNAVAILABLE; | ||
|
||
@end | ||
|
||
@interface KPKSynchronizationAttributeChangesItem : KPKSynchronizationChangesItem | ||
|
||
@property (readonly, copy) NSString *key; | ||
@property (readonly, copy) NSString *localValue; | ||
@property (readonly, copy) NSString *remoteValue; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// KPKSynchronizationChangesItem.m | ||
// KeePassKit | ||
// | ||
// Created by Michael Starke on 05.10.22. | ||
// Copyright © 2022 HicknHack Software GmbH. All rights reserved. | ||
// | ||
|
||
#import "KPKSynchronizationChangesItem.h" | ||
|
||
@implementation KPKSynchronizationChangesItem | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// KPKSynchronizationChangesStore.h | ||
// KeePassKit | ||
// | ||
// Created by Michael Starke on 02.10.22. | ||
// Copyright © 2022 HicknHack Software GmbH. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@class KPKGroup; | ||
@class KPKNode; | ||
@class KPKAttribute; | ||
@class KPKSynchronizationChangesItem; | ||
|
||
@interface KPKSynchronizationChangesStore : NSObject | ||
|
||
@property (readonly, copy, nonatomic) NSArray<KPKSynchronizationChangesItem *> *allChanges; | ||
|
||
@property (readonly, copy, nonatomic) NSArray<KPKSynchronizationChangesItem *> *addedNodes; | ||
@property (readonly, copy, nonatomic) NSArray<KPKSynchronizationChangesItem *> *removedNodes; | ||
|
||
- (NSArray<KPKSynchronizationChangesItem *> *)changesForUUID:(NSUUID *)uuid; | ||
// icons | ||
// metadata | ||
// attributes | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// | ||
// KPKSynchronizationChangesStore.m | ||
// KeePassKit | ||
// | ||
// Created by Michael Starke on 02.10.22. | ||
// Copyright © 2022 HicknHack Software GmbH. All rights reserved. | ||
// | ||
|
||
#import "KPKSynchronizationChangesStore.h" | ||
#import "KPKSynchronizationChangesStore_Private.h" | ||
#import "KPKSynchronizationChangesItem.h" | ||
|
||
@implementation KPKSynchronizationChangesStore | ||
|
||
@dynamic addedNodes; | ||
@dynamic removedNodes; | ||
@dynamic allChanges; | ||
|
||
- (instancetype)init { | ||
self = [super init]; | ||
if(self) { | ||
self.mutableChanges = [[NSMutableArray alloc] init]; | ||
self.recordingChanges = NO; | ||
} | ||
return self; | ||
} | ||
|
||
- (void)_beginRecordingChanges { | ||
[self.mutableChanges removeAllObjects]; | ||
self.recordingChanges = YES; | ||
} | ||
|
||
- (void)_endRecordingChanges { | ||
self.recordingChanges = NO; | ||
} | ||
|
||
- (void)_addChange:(KPKSynchronizationChangesItem *)changeItem { | ||
NSAssert(self.isRecordingChanges, @"Change recording is only possible while in active recording"); | ||
[self.mutableChanges addObject:changeItem]; | ||
} | ||
|
||
- (NSArray<KPKSynchronizationChangesItem *> *)allChanges { | ||
NSAssert(!self.isRecordingChanges, @"Cannot access changes while actively recording them"); | ||
return [self.mutableChanges copy]; | ||
} | ||
|
||
- (NSArray<KPKSynchronizationChangesItem *> *)addedNodes { | ||
NSAssert(!self.isRecordingChanges, @"Cannot access changes while actively recording them"); | ||
NSPredicate *addedNodesPredicate = [NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) { | ||
KPKSynchronizationChangesItem *item = (KPKSynchronizationChangesItem *)evaluatedObject; | ||
return (item.changeType == KPKSynchronizationChangeTypeAddedNode); | ||
|
||
}]; | ||
return [self.mutableChanges filteredArrayUsingPredicate:addedNodesPredicate]; | ||
} | ||
|
||
- (NSArray<KPKSynchronizationChangesItem *> *)removedNodes { | ||
NSAssert(!self.isRecordingChanges, @"Cannot access changes while actively recording them"); | ||
NSPredicate *addedNodesPredicate = [NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) { | ||
KPKSynchronizationChangesItem *item = (KPKSynchronizationChangesItem *)evaluatedObject; | ||
return (item.changeType == KPKSynchronizationChangeTypeRemovedNode); | ||
|
||
}]; | ||
return [self.mutableChanges filteredArrayUsingPredicate:addedNodesPredicate]; | ||
} | ||
|
||
- (NSArray<KPKSynchronizationChangesItem *> *)changesForUUID:(NSUUID *)uuid { | ||
NSAssert(!self.isRecordingChanges, @"Cannot access changes while actively recording them"); | ||
NSPredicate *addedNodesPredicate = [NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) { | ||
KPKSynchronizationChangesItem *item = (KPKSynchronizationChangesItem *)evaluatedObject; | ||
return ([item.uuid isEqual:uuid]); | ||
}]; | ||
return [self.mutableChanges filteredArrayUsingPredicate:addedNodesPredicate]; | ||
|
||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// KPKSynchronizationChangesStore+Private.h | ||
// KeePassKit | ||
// | ||
// Created by Michael Starke on 05.10.22. | ||
// Copyright © 2022 HicknHack Software GmbH. All rights reserved. | ||
// | ||
|
||
#import <KeePassKit/KeePassKit.h> | ||
#import "KPKSynchronizationChangesStore.h" | ||
#import "KPKSynchronizationChangesItem.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface KPKSynchronizationChangesStore () | ||
|
||
@property (strong) NSMutableArray *mutableChanges; | ||
@property (assign, getter=isRecordingChanges) BOOL recordingChanges; | ||
|
||
- (void)_beginRecordingChanges; | ||
- (void)_endRecordingChanges; | ||
- (void)_addChange:(KPKSynchronizationChangesItem *)changeItem; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters