Interims update

This commit is contained in:
michael starke
2016-06-16 19:22:02 +02:00
parent f3f0d27a3f
commit 7a09cb9588
5 changed files with 31 additions and 77 deletions

View File

@@ -151,6 +151,8 @@
4C77E37315B84A240093A587 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C77E37215B84A240093A587 /* main.m */; };
4C77E37A15B84A240093A587 /* MPAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C77E37915B84A240093A587 /* MPAppDelegate.m */; };
4C77E37D15B84A240093A587 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C77E37B15B84A240093A587 /* MainMenu.xib */; };
4C7931031D0F053900A511E8 /* MPTestNodeDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7931021D0F053900A511E8 /* MPTestNodeDelegate.m */; };
4C7931061D0F0B0800A511E8 /* MPNodeDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7931051D0F0B0800A511E8 /* MPNodeDelegate.m */; };
4C7ABA4817BAEC6700FF5799 /* 15_ScannerTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C7ABA4317BAEC6700FF5799 /* 15_ScannerTemplate.pdf */; };
4C7ABA4917BAEC6700FF5799 /* 16_BrowserTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C7ABA4417BAEC6700FF5799 /* 16_BrowserTemplate.pdf */; };
4C7ABA4A17BAEC6700FF5799 /* 17_CDRomTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C7ABA4517BAEC6700FF5799 /* 17_CDRomTemplate.pdf */; };
@@ -514,6 +516,9 @@
4C77E37415B84A240093A587 /* MacPass-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MacPass-Prefix.pch"; sourceTree = "<group>"; };
4C77E37815B84A240093A587 /* MPAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPAppDelegate.h; sourceTree = "<group>"; };
4C77E37915B84A240093A587 /* MPAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPAppDelegate.m; sourceTree = "<group>"; };
4C7931021D0F053900A511E8 /* MPTestNodeDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPTestNodeDelegate.m; sourceTree = "<group>"; };
4C7931041D0F0B0800A511E8 /* MPNodeDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPNodeDelegate.h; sourceTree = "<group>"; };
4C7931051D0F0B0800A511E8 /* MPNodeDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPNodeDelegate.m; sourceTree = "<group>"; };
4C7ABA4317BAEC6700FF5799 /* 15_ScannerTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 15_ScannerTemplate.pdf; sourceTree = "<group>"; };
4C7ABA4417BAEC6700FF5799 /* 16_BrowserTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 16_BrowserTemplate.pdf; sourceTree = "<group>"; };
4C7ABA4517BAEC6700FF5799 /* 17_CDRomTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 17_CDRomTemplate.pdf; sourceTree = "<group>"; };
@@ -943,6 +948,8 @@
4CA0F3EC1A3074B50067C0E5 /* MPWindowTitleComboBoxDelegate.m */,
4CE501321BBC47F500FB819D /* MPTagsTokenFieldDelegate.h */,
4CE501331BBC47F500FB819D /* MPTagsTokenFieldDelegate.m */,
4C7931041D0F0B0800A511E8 /* MPNodeDelegate.h */,
4C7931051D0F0B0800A511E8 /* MPNodeDelegate.m */,
);
name = Delegates;
sourceTree = "<group>";
@@ -980,6 +987,7 @@
4C45FB2F178E0CE20010007D /* MPTestDocument.m */,
4C6BC65F1A36717E00BDDF3D /* MPDatabaseSearch.m */,
4CCCD83F1C8E02FE002B77B6 /* MPTextEntryProxy.m */,
4C7931021D0F053900A511E8 /* MPTestNodeDelegate.m */,
4C45FB1F178E09ED0010007D /* Supporting Files */,
);
path = MacPassTests;
@@ -1664,6 +1672,7 @@
files = (
4C45FB2D178E0BCB0010007D /* MPDatabaseLoading.m in Sources */,
4C8DEAA21C314D2C00D24C32 /* MPTestAutotypeDelay.m in Sources */,
4C7931031D0F053900A511E8 /* MPTestNodeDelegate.m in Sources */,
4C45FB30178E0CE20010007D /* MPTestDocument.m in Sources */,
4CCCD8401C8E02FE002B77B6 /* MPTextEntryProxy.m in Sources */,
4C6BC6601A36717E00BDDF3D /* MPDatabaseSearch.m in Sources */,
@@ -1678,6 +1687,7 @@
4CD034AC1BFE113B003C002C /* MPPluginManager.m in Sources */,
4C77E37315B84A240093A587 /* main.m in Sources */,
4CBA2ABA17074C07006D8139 /* MPSettingsHelper.m in Sources */,
4C7931061D0F0B0800A511E8 /* MPNodeDelegate.m in Sources */,
4C77E37A15B84A240093A587 /* MPAppDelegate.m in Sources */,
4C37A84015B8B474005EF8EE /* MPOutlineDataSource.m in Sources */,
4CA0B2F915BCAF6700654E32 /* MPGeneralSettingsController.m in Sources */,
@@ -2169,7 +2179,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -2210,7 +2220,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;

View File

@@ -448,7 +448,7 @@
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="82" secondAttribute="trailing" constant="20" symbolic="YES" id="4df-0Y-ggz"/>
<constraint firstItem="82" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="3" secondAttribute="leading" constant="20" symbolic="YES" id="zU6-5h-Swa"/>
</constraints>
<point key="canvasLocation" x="19.5" y="144.5"/>
<point key="canvasLocation" x="494.5" y="-467.5"/>
</view>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="4" customClass="HNHUIScrollDocumentViewAdapter">
<rect key="frame" x="0.0" y="0.0" width="252" height="457"/>
@@ -681,7 +681,7 @@
<constraint firstItem="0U8-TS-giU" firstAttribute="leading" secondItem="4" secondAttribute="leading" constant="20" id="kLH-Bj-C5m"/>
<constraint firstItem="57" firstAttribute="top" secondItem="59" secondAttribute="bottom" constant="8" symbolic="YES" id="lYe-am-xJx"/>
</constraints>
<point key="canvasLocation" x="355" y="-371.5"/>
<point key="canvasLocation" x="142" y="-483.5"/>
</customView>
<view translatesAutoresizingMaskIntoConstraints="NO" id="zv7-wE-Bmg" customClass="HNHUIScrollDocumentViewAdapter">
<rect key="frame" x="0.0" y="0.0" width="301" height="424"/>
@@ -930,7 +930,7 @@
<constraint firstAttribute="trailing" secondItem="45R-v4-ywl" secondAttribute="trailing" constant="20" symbolic="YES" id="uUm-S5-cxM"/>
<constraint firstAttribute="trailing" secondItem="z03-zW-GN3" secondAttribute="trailing" constant="20" symbolic="YES" id="wiq-pY-TG8"/>
</constraints>
<point key="canvasLocation" x="19.5" y="-388"/>
<point key="canvasLocation" x="-205.5" y="-500"/>
</view>
</objects>
<resources>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9532"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="MPContextBarViewController">
@@ -223,6 +223,7 @@
</connections>
</tabViewItem>
</tabViewItems>
<point key="canvasLocation" x="157" y="476"/>
</tabView>
</objects>
</document>

View File

@@ -438,14 +438,14 @@ static NSString *kMPContentBindingString3 = @"content.%@.%@.%@";
[self.enableAutotypeCheckButton bind:NSValueBinding
toObject:self.entryController
withKeyPath:[NSString stringWithFormat:kMPContentBindingString2, NSStringFromSelector(@selector(autotype)), NSStringFromSelector(@selector(isEnabled))] options:nil];
withKeyPath:[NSString stringWithFormat:kMPContentBindingString2, NSStringFromSelector(@selector(autotype)), NSStringFromSelector(@selector(enabled))] options:nil];
[self.obfuscateAutotypeCheckButton bind:NSValueBinding
toObject:self.entryController
withKeyPath:[NSString stringWithFormat:kMPContentBindingString2, NSStringFromSelector(@selector(autotype)), NSStringFromSelector(@selector(obfuscateDataTransfer))]
options:nil];
[self.customEntrySequenceTextField bind:NSEnabledBinding
toObject:self.entryController
withKeyPath:[NSString stringWithFormat:kMPContentBindingString2, NSStringFromSelector(@selector(autotype)), NSStringFromSelector(@selector(isEnabled))]
withKeyPath:[NSString stringWithFormat:kMPContentBindingString2, NSStringFromSelector(@selector(autotype)), NSStringFromSelector(@selector(enabled))]
options:nil];
[self.customEntrySequenceTextField bind:NSValueBinding
toObject:self.entryController

View File

@@ -9,93 +9,36 @@
#import "MPEntryProxy.h"
#import <KeePassKit/KeePassKit.h>
@interface MPSubEntryProxy : NSProxy
@property (weak) MPEntryProxy *entryProxy;
@property (nonatomic, readonly) id target;
- (instancetype)initWithEntryProxy:(MPEntryProxy *)entryProxy;
@end
@implementation MPSubEntryProxy
- (instancetype)initWithEntryProxy:(MPEntryProxy *)entryProxy {
_entryProxy = entryProxy;
return self;
}
- (id)target {
return nil;
}
@end
@interface MPAutotypeProxy : MPSubEntryProxy
@end
@implementation MPAutotypeProxy
- (id)target {
return self.entryProxy.entry.autotype;
}
@end
@interface MPTimeInfoProxy : MPSubEntryProxy
@end
@implementation MPTimeInfoProxy
- (id)target {
return self.entryProxy.entry.timeInfo;
}
@end
#pragma mark -
@interface MPEntryProxy ()
@property (strong) KPKEntry *entry;
@property (strong) KPKEntry *changedEntry;
@property BOOL firstModification;
@end
@implementation MPEntryProxy
- (NSSet *)mutatingSelectors {
static NSSet *set;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
set = [NSSet setWithArray:@[ [NSValue valueWithPointer:@selector(addCustomAttribute:)],
[NSValue valueWithPointer:@selector(removeCustomAttribute:)],
[NSValue valueWithPointer:@selector(addBinary:)],
[NSValue valueWithPointer:@selector(removeBinary:)],
[NSValue valueWithPointer:@selector(addAssociation:)],
[NSValue valueWithPointer:@selector(removeAssociation:)] ]];
});
return set;
}
- (instancetype)initWithEntry:(KPKEntry *)entry {
if(!entry) {
@throw [NSException exceptionWithName:NSInvalidArgumentException reason:nil userInfo:nil];
}
_entry = entry;
_firstModification = NO;
return self;
}
- (void)forwardInvocation:(NSInvocation *)invocation {
NSString *seletor = NSStringFromSelector(invocation.selector);
if([[self mutatingSelectors] containsObject:[NSValue valueWithPointer:invocation.selector]]) {
NSLog(@"Mutation detected.");
}
if([seletor hasPrefix:@"set"]) {
NSLog(@"forwardInvocation: setter detected");
if(invocation.selector == @selector(touchModified)) {
if(self.firstModification) {
[self.entry pushHistory];
self.firstModification = YES;
}
NSLog(@"Possible mutation detected. Creating backup!");
}
invocation.target = self.entry;
[invocation invoke];
}
- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel {