From c2e9cfc7d62ab37ee76344656ee12a6813bfe59a Mon Sep 17 00:00:00 2001 From: michael starke Date: Tue, 25 Jun 2013 23:15:54 +0200 Subject: [PATCH] Adodopted changes in KeePassLib --- MacPass.xcodeproj/project.pbxproj | 20 ++++++++++++++++++++ MacPass/MPDocument.m | 12 ++++-------- MacPass/MacPass-Info.plist | 2 +- MacPass/de.lproj/Errors.strings | 7 +++++++ MacPass/en.lproj/Errors.strings | 9 +++++++++ MiniKeePassLib | 2 +- 6 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 MacPass/de.lproj/Errors.strings create mode 100644 MacPass/en.lproj/Errors.strings diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index e182d942..334b42f0 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -44,6 +44,7 @@ 4C2724D41778FA0700FD8456 /* NSDate+Packed.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2724D31778FA0700FD8456 /* NSDate+Packed.m */; }; 4C2724D71778FF1A00FD8456 /* NSUUID+KeePassLib.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2724D61778FF1A00FD8456 /* NSUUID+KeePassLib.m */; }; 4C2724DA17790E7C00FD8456 /* NSMutableData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2724D917790E7C00FD8456 /* NSMutableData+Base64.m */; }; + 4C2A6134177A1D5F00C9826C /* KPLErrorCodes.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2A6133177A1D5F00C9826C /* KPLErrorCodes.m */; }; 4C2C4C2C16D3BE3700D49295 /* KdbGroup+MPTreeTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2C4C2B16D3BE3700D49295 /* KdbGroup+MPTreeTools.m */; }; 4C2E381D16D11FF900037A9D /* 03_ServerTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C2E381A16D11FF900037A9D /* 03_ServerTemplate.pdf */; }; 4C2E381E16D11FF900037A9D /* 04_KlipperTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C2E381B16D11FF900037A9D /* 04_KlipperTemplate.pdf */; }; @@ -122,6 +123,7 @@ 4C77E37D15B84A240093A587 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C77E37B15B84A240093A587 /* MainMenu.xib */; }; 4C79DF2A176685870083708F /* HNHRoundedTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C79DF29176685870083708F /* HNHRoundedTextField.m */; }; 4C7E832A172DE2F2002493D8 /* MPPasswordEditViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7E8329172DE2F2002493D8 /* MPPasswordEditViewController.m */; }; + 4C7F35681779DFFB00C57890 /* Errors.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4C7F356A1779DFFB00C57890 /* Errors.strings */; }; 4C80BB6F176DE06F00E5E248 /* HNHScrollDocumentViewAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C80BB6E176DE06F00E5E248 /* HNHScrollDocumentViewAdapter.m */; }; 4C811C8316ECD06E00C4BAC6 /* MPKeyfilePathControlDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C811C8216ECD06E00C4BAC6 /* MPKeyfilePathControlDelegate.m */; }; 4C83814215BF4677001AE468 /* MPDocumentWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C83814115BF4677001AE468 /* MPDocumentWindowController.m */; }; @@ -251,6 +253,8 @@ 4C2724D61778FF1A00FD8456 /* NSUUID+KeePassLib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSUUID+KeePassLib.m"; sourceTree = ""; }; 4C2724D817790E7C00FD8456 /* NSMutableData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableData+Base64.h"; sourceTree = ""; }; 4C2724D917790E7C00FD8456 /* NSMutableData+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableData+Base64.m"; sourceTree = ""; }; + 4C2A6132177A181300C9826C /* KPLErrorCodes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KPLErrorCodes.h; sourceTree = ""; }; + 4C2A6133177A1D5F00C9826C /* KPLErrorCodes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPLErrorCodes.m; sourceTree = ""; }; 4C2C4C2A16D3BE3700D49295 /* KdbGroup+MPTreeTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KdbGroup+MPTreeTools.h"; sourceTree = ""; }; 4C2C4C2B16D3BE3700D49295 /* KdbGroup+MPTreeTools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "KdbGroup+MPTreeTools.m"; sourceTree = ""; }; 4C2E381A16D11FF900037A9D /* 03_ServerTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 03_ServerTemplate.pdf; sourceTree = ""; }; @@ -409,6 +413,8 @@ 4C79DF2F1766941D0083708F /* MPResponderQuery.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPResponderQuery.h; sourceTree = ""; }; 4C7E8328172DE2F2002493D8 /* MPPasswordEditViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordEditViewController.h; sourceTree = ""; }; 4C7E8329172DE2F2002493D8 /* MPPasswordEditViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordEditViewController.m; sourceTree = ""; }; + 4C7F35691779DFFB00C57890 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Errors.strings; sourceTree = ""; }; + 4C7F356B1779DFFF00C57890 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Errors.strings; sourceTree = ""; }; 4C80BB6D176DE06F00E5E248 /* HNHScrollDocumentViewAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHScrollDocumentViewAdapter.h; sourceTree = ""; }; 4C80BB6E176DE06F00E5E248 /* HNHScrollDocumentViewAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHScrollDocumentViewAdapter.m; sourceTree = ""; }; 4C811C8116ECD06E00C4BAC6 /* MPKeyfilePathControlDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPKeyfilePathControlDelegate.h; sourceTree = ""; }; @@ -896,6 +902,8 @@ 4C669B7716760ED100DD0774 /* Salsa20RandomStream.m */, 4C669B7A16760ED100DD0774 /* UUID.h */, 4C669B7B16760ED100DD0774 /* UUID.m */, + 4C2A6132177A181300C9826C /* KPLErrorCodes.h */, + 4C2A6133177A1D5F00C9826C /* KPLErrorCodes.m */, ); path = KeePassLib; sourceTree = ""; @@ -975,6 +983,7 @@ 4C77E36F15B84A240093A587 /* InfoPlist.strings */, 4C77E37215B84A240093A587 /* main.m */, 4C77E37415B84A240093A587 /* MacPass-Prefix.pch */, + 4C7F356A1779DFFB00C57890 /* Errors.strings */, ); name = "Supporting Files"; sourceTree = ""; @@ -1253,6 +1262,7 @@ 4C7714AA176C998F00549F2A /* 43_TrashTemplate.pdf in Resources */, 4C7714AC176C9D4600549F2A /* 99_InfoTemplate.pdf in Resources */, 4CF7805F176E75110032EE71 /* ServerSettings.xib in Resources */, + 4C7F35681779DFFB00C57890 /* Errors.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1411,6 +1421,7 @@ 4C2724D41778FA0700FD8456 /* NSDate+Packed.m in Sources */, 4C2724D71778FF1A00FD8456 /* NSUUID+KeePassLib.m in Sources */, 4C2724DA17790E7C00FD8456 /* NSMutableData+Base64.m in Sources */, + 4C2A6134177A1D5F00C9826C /* KPLErrorCodes.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1476,6 +1487,15 @@ name = MainMenu.xib; sourceTree = ""; }; + 4C7F356A1779DFFB00C57890 /* Errors.strings */ = { + isa = PBXVariantGroup; + children = ( + 4C7F35691779DFFB00C57890 /* en */, + 4C7F356B1779DFFF00C57890 /* de */, + ); + name = Errors.strings; + sourceTree = ""; + }; 4C888C8E16EB6C91003D34A1 /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index e661085d..15ff6340 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -80,16 +80,13 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey"; } - (BOOL)writeToURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError { - @try { - [KdbWriterFactory persist:self.tree file:[url path] withPassword:self.passwordHash]; - } - @catch (NSException *exception) { - NSLog(@"%@", [exception description]); + NSError *error = nil; + [KdbWriterFactory persist:self.tree fileURL:url withPassword:self.passwordHash error:&error]; + if(error) { + NSLog(@"%@", [error localizedDescription]); return NO; } - return YES; - } - (BOOL)readFromURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError { @@ -109,7 +106,6 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey"; self.tree = [KdbReaderFactory load:[[self fileURL] path] withPassword:self.passwordHash]; } @catch (NSException *exception) { - NSLog(@"%@", [exception description]); return NO; } diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index cae8f308..a4c85629 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -48,7 +48,7 @@ CFBundleSignature ???? CFBundleVersion - 1103 + 1121 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright diff --git a/MacPass/de.lproj/Errors.strings b/MacPass/de.lproj/Errors.strings new file mode 100644 index 00000000..74bdd080 --- /dev/null +++ b/MacPass/de.lproj/Errors.strings @@ -0,0 +1,7 @@ +/* + Errors.strings + MacPass + + Created by Michael Starke on 25.06.13. + Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +*/ \ No newline at end of file diff --git a/MacPass/en.lproj/Errors.strings b/MacPass/en.lproj/Errors.strings new file mode 100644 index 00000000..ee042280 --- /dev/null +++ b/MacPass/en.lproj/Errors.strings @@ -0,0 +1,9 @@ +/* + Errors.strings + MacPass + + Created by Michael Starke on 25.06.13. + Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +*/ + +"ERROR_TREE_CLASS_NOT_RECOGNIZED" = "Tree class not regonized"; \ No newline at end of file diff --git a/MiniKeePassLib b/MiniKeePassLib index c0d72ecc..3126a177 160000 --- a/MiniKeePassLib +++ b/MiniKeePassLib @@ -1 +1 @@ -Subproject commit c0d72eccd714294b616f1c1f2b4996388d2262e1 +Subproject commit 3126a1773ac850f9c610550fdd4ca6d308e171c5