Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d429044f64 | ||
|
|
b38e8d9ea6 | ||
|
|
c928b1ca2c | ||
|
|
553a14dced | ||
|
|
8b8d727ee0 | ||
|
|
4cdeab4256 | ||
|
|
bc3aa3255e | ||
|
|
f2fdca6a03 | ||
|
|
647235616e | ||
|
|
b0b6dcc56b | ||
|
|
918a240dba | ||
|
|
830dcb45ff | ||
|
|
7be9884075 | ||
|
|
5ca0d954bb | ||
|
|
02d69261df | ||
|
|
fc60460935 | ||
|
|
559e11b16e | ||
|
|
0a72809b02 | ||
|
|
8c71ed0081 | ||
|
|
3e19a026ba | ||
|
|
8fa3c6c75d | ||
|
|
217cf56d94 | ||
|
|
6f37f28a4c | ||
|
|
3b7d2dc08e | ||
|
|
5e9af44736 | ||
|
|
be33a29fa0 | ||
|
|
29ed22d0b7 |
3
.gitignore
vendored
@@ -28,3 +28,6 @@ Press/MasterPassword_PressKit/MasterPassword_pressrelease_*.pdf
|
|||||||
# IPA
|
# IPA
|
||||||
/sendipa/*
|
/sendipa/*
|
||||||
!/sendipa/sendipa.conf
|
!/sendipa/sendipa.conf
|
||||||
|
|
||||||
|
# Java
|
||||||
|
MasterPassword/Java/**/target
|
||||||
|
|||||||
2
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -2,7 +2,9 @@
|
|||||||
<profile version="1.0" is_locked="false">
|
<profile version="1.0" is_locked="false">
|
||||||
<option name="myName" value="Project Default" />
|
<option name="myName" value="Project Default" />
|
||||||
<option name="myLocal" value="false" />
|
<option name="myLocal" value="false" />
|
||||||
|
<inspection_tool class="FunctionImplicitDeclarationInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="LossyEncoding" enabled="true" level="WARNING" enabled_by_default="true" />
|
<inspection_tool class="LossyEncoding" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="MethodIsLaterInTheScope" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="OCUnusedMethodInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="OCUnusedMethodInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="UnusedLocalVariable" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="UnusedLocalVariable" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
</profile>
|
</profile>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>BuildMachineOSBuild</key>
|
<key>BuildMachineOSBuild</key>
|
||||||
<string>11C74</string>
|
<string>11E53</string>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>English</string>
|
<string>English</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.1.3</string>
|
<string>1.1.5</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleSupportedPlatforms</key>
|
<key>CFBundleSupportedPlatforms</key>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<string>iPhoneOS</string>
|
<string>iPhoneOS</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>0101.03.00</string>
|
<string>0101.05.00</string>
|
||||||
<key>CrashlyticsAPIKey</key>
|
<key>CrashlyticsAPIKey</key>
|
||||||
<string>0d10c90776f5ef5acd01ddbeaca9a6cba4814560</string>
|
<string>0d10c90776f5ef5acd01ddbeaca9a6cba4814560</string>
|
||||||
<key>DTCompiler</key>
|
<key>DTCompiler</key>
|
||||||
|
|||||||
2
External/Pearl
vendored
2
External/iCloudStoreManager
vendored
@@ -7,12 +7,20 @@
|
|||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
93D390BC6AE7A1C9B91A3668 /* MPKey.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39E81EFABC6085AC8AE69 /* MPKey.m */; };
|
||||||
|
93D392B30CE6C58A9A905E0A /* MPAlgorithmV0.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3938863322199C3E7E2E3 /* MPAlgorithmV0.m */; };
|
||||||
|
93D394744B5485303B326ECB /* MPAlgorithm.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39B0DF5E3C56355186738 /* MPAlgorithm.m */; };
|
||||||
|
93D39DC7A7282137B08C8D82 /* MPAlgorithmV1.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39E9D7B9005211E7D5262 /* MPAlgorithmV1.m */; };
|
||||||
DA04E33E14B1E70400ECA4F3 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA04E33D14B1E70400ECA4F3 /* MobileCoreServices.framework */; };
|
DA04E33E14B1E70400ECA4F3 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA04E33D14B1E70400ECA4F3 /* MobileCoreServices.framework */; };
|
||||||
DA0A1D0515690A9A0092735D /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = DA0A1D0315690A9A0092735D /* Default.png */; };
|
DA0A1D0515690A9A0092735D /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = DA0A1D0315690A9A0092735D /* Default.png */; };
|
||||||
DA0A1D0615690A9A0092735D /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA0A1D0415690A9A0092735D /* Default@2x.png */; };
|
DA0A1D0615690A9A0092735D /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA0A1D0415690A9A0092735D /* Default@2x.png */; };
|
||||||
DA0A1D1515690AF40092735D /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA0A1D1315690AF30092735D /* Icon-72@2x.png */; };
|
DA0A1D1515690AF40092735D /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA0A1D1315690AF30092735D /* Icon-72@2x.png */; };
|
||||||
DA0A1D1615690AF40092735D /* Icon-Small-50@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA0A1D1415690AF40092735D /* Icon-Small-50@2x.png */; };
|
DA0A1D1615690AF40092735D /* Icon-Small-50@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA0A1D1415690AF40092735D /* Icon-Small-50@2x.png */; };
|
||||||
DA0E07961577FE490008A67E /* MPEntities.m in Sources */ = {isa = PBXBuildFile; fileRef = DA0E07951577FE490008A67E /* MPEntities.m */; };
|
DA0E07961577FE490008A67E /* MPEntities.m in Sources */ = {isa = PBXBuildFile; fileRef = DA0E07951577FE490008A67E /* MPEntities.m */; };
|
||||||
|
DA0F9F3315B55397007ED9BC /* MPUserEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = DA0F9F3215B55397007ED9BC /* MPUserEntity.m */; };
|
||||||
|
DA0F9F3615B55397007ED9BC /* MPElementGeneratedEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = DA0F9F3515B55397007ED9BC /* MPElementGeneratedEntity.m */; };
|
||||||
|
DA0F9F3915B55397007ED9BC /* MPElementStoredEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = DA0F9F3815B55397007ED9BC /* MPElementStoredEntity.m */; };
|
||||||
|
DA0F9F3C15B55397007ED9BC /* MPElementEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = DA0F9F3B15B55397007ED9BC /* MPElementEntity.m */; };
|
||||||
DA30E9CE15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DA30E9CB15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h */; };
|
DA30E9CE15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DA30E9CB15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h */; };
|
||||||
DA30E9CF15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = DA30E9CC15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m */; };
|
DA30E9CF15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = DA30E9CC15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m */; };
|
||||||
DA30E9D015722ECA00A68B4C /* Pearl.m in Sources */ = {isa = PBXBuildFile; fileRef = DA30E9CD15722ECA00A68B4C /* Pearl.m */; };
|
DA30E9D015722ECA00A68B4C /* Pearl.m in Sources */ = {isa = PBXBuildFile; fileRef = DA30E9CD15722ECA00A68B4C /* Pearl.m */; };
|
||||||
@@ -25,16 +33,14 @@
|
|||||||
DA3EF17D15A47744003ABF4E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; };
|
DA3EF17D15A47744003ABF4E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; };
|
||||||
DA3EF18315A47744003ABF4E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA3EF18115A47744003ABF4E /* InfoPlist.strings */; };
|
DA3EF18315A47744003ABF4E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA3EF18115A47744003ABF4E /* InfoPlist.strings */; };
|
||||||
DA3EF18615A47744003ABF4E /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA3EF18515A47744003ABF4E /* Tests.m */; };
|
DA3EF18615A47744003ABF4E /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA3EF18515A47744003ABF4E /* Tests.m */; };
|
||||||
DA40C2611586099D0079CE6E /* MPUserEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = DA40C2601586099D0079CE6E /* MPUserEntity.m */; };
|
|
||||||
DA40C2641586099E0079CE6E /* MPElementEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = DA40C2631586099E0079CE6E /* MPElementEntity.m */; };
|
|
||||||
DA40C2671586099E0079CE6E /* MPElementGeneratedEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = DA40C2661586099E0079CE6E /* MPElementGeneratedEntity.m */; };
|
|
||||||
DA40C26A1586099E0079CE6E /* MPElementStoredEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = DA40C2691586099E0079CE6E /* MPElementStoredEntity.m */; };
|
|
||||||
DA4425CC1557BED40052177D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; };
|
DA4425CC1557BED40052177D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; };
|
||||||
DA4426001557BF260052177D /* UbiquityStoreManager.h in Headers */ = {isa = PBXBuildFile; fileRef = DA4425F11557BF260052177D /* UbiquityStoreManager.h */; };
|
DA4426001557BF260052177D /* UbiquityStoreManager.h in Headers */ = {isa = PBXBuildFile; fileRef = DA4425F11557BF260052177D /* UbiquityStoreManager.h */; };
|
||||||
DA4426011557BF260052177D /* UbiquityStoreManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4425F21557BF260052177D /* UbiquityStoreManager.m */; };
|
DA4426011557BF260052177D /* UbiquityStoreManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4425F21557BF260052177D /* UbiquityStoreManager.m */; };
|
||||||
DA4426081557C1990052177D /* MPAppDelegate_Shared.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4426051557C1990052177D /* MPAppDelegate_Shared.m */; };
|
DA4426081557C1990052177D /* MPAppDelegate_Shared.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4426051557C1990052177D /* MPAppDelegate_Shared.m */; };
|
||||||
DA4426091557C1990052177D /* MPAppDelegate_Store.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4426071557C1990052177D /* MPAppDelegate_Store.m */; };
|
DA4426091557C1990052177D /* MPAppDelegate_Store.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4426071557C1990052177D /* MPAppDelegate_Store.m */; };
|
||||||
DA44260A1557D9E40052177D /* libiCloudStoreManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA4425CB1557BED40052177D /* libiCloudStoreManager.a */; };
|
DA44260A1557D9E40052177D /* libiCloudStoreManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA4425CB1557BED40052177D /* libiCloudStoreManager.a */; };
|
||||||
|
DA46826F15AB843200FB09E7 /* tip_basic_black_bottom_right.png in Resources */ = {isa = PBXBuildFile; fileRef = DA46826D15AB843200FB09E7 /* tip_basic_black_bottom_right.png */; };
|
||||||
|
DA46827015AB843200FB09E7 /* tip_basic_black_bottom_right@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA46826E15AB843200FB09E7 /* tip_basic_black_bottom_right@2x.png */; };
|
||||||
DA4DA1D91564471A00F6F596 /* libjrswizzle.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAC6326C148680650075AEA5 /* libjrswizzle.a */; };
|
DA4DA1D91564471A00F6F596 /* libjrswizzle.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAC6326C148680650075AEA5 /* libjrswizzle.a */; };
|
||||||
DA4DA1DA1564471F00F6F596 /* libuicolor-utilities.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAC6325D1486805C0075AEA5 /* libuicolor-utilities.a */; };
|
DA4DA1DA1564471F00F6F596 /* libuicolor-utilities.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAC6325D1486805C0075AEA5 /* libuicolor-utilities.a */; };
|
||||||
DA4DA1DB1564475E00F6F596 /* libscryptenc-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA79A9BB1557DB6F00BAA07A /* libscryptenc-ios.a */; };
|
DA4DA1DB1564475E00F6F596 /* libscryptenc-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA79A9BB1557DB6F00BAA07A /* libscryptenc-ios.a */; };
|
||||||
@@ -102,7 +108,6 @@
|
|||||||
DAB8D46815036BCF00CED3BC /* MPTypeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DAB8D45115036BCF00CED3BC /* MPTypeViewController.m */; };
|
DAB8D46815036BCF00CED3BC /* MPTypeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DAB8D45115036BCF00CED3BC /* MPTypeViewController.m */; };
|
||||||
DAB8D46915036BCF00CED3BC /* MPUnlockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DAB8D45315036BCF00CED3BC /* MPUnlockViewController.m */; };
|
DAB8D46915036BCF00CED3BC /* MPUnlockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DAB8D45315036BCF00CED3BC /* MPUnlockViewController.m */; };
|
||||||
DAB8D46A15036BCF00CED3BC /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = DAB8D45415036BCF00CED3BC /* Settings.bundle */; };
|
DAB8D46A15036BCF00CED3BC /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = DAB8D45415036BCF00CED3BC /* Settings.bundle */; };
|
||||||
DAB8D46C15036BCF00CED3BC /* MPTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = DAB8D45615036BCF00CED3BC /* MPTypes.m */; };
|
|
||||||
DAB8D6FA15036BF600CED3BC /* ui_background.png in Resources */ = {isa = PBXBuildFile; fileRef = DAB8D47115036BF600CED3BC /* ui_background.png */; };
|
DAB8D6FA15036BF600CED3BC /* ui_background.png in Resources */ = {isa = PBXBuildFile; fileRef = DAB8D47115036BF600CED3BC /* ui_background.png */; };
|
||||||
DAB8D6FB15036BF600CED3BC /* ui_background@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DAB8D47215036BF600CED3BC /* ui_background@2x.png */; };
|
DAB8D6FB15036BF600CED3BC /* ui_background@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DAB8D47215036BF600CED3BC /* ui_background@2x.png */; };
|
||||||
DAB8D6FC15036BF600CED3BC /* ui_box_checked.png in Resources */ = {isa = PBXBuildFile; fileRef = DAB8D47315036BF600CED3BC /* ui_box_checked.png */; };
|
DAB8D6FC15036BF600CED3BC /* ui_box_checked.png in Resources */ = {isa = PBXBuildFile; fileRef = DAB8D47315036BF600CED3BC /* ui_box_checked.png */; };
|
||||||
@@ -675,6 +680,7 @@
|
|||||||
DAB8D93915036BF700CED3BC /* logo-bare.png in Resources */ = {isa = PBXBuildFile; fileRef = DAB8D6B615036BF600CED3BC /* logo-bare.png */; };
|
DAB8D93915036BF700CED3BC /* logo-bare.png in Resources */ = {isa = PBXBuildFile; fileRef = DAB8D6B615036BF600CED3BC /* logo-bare.png */; };
|
||||||
DAB8D97C1503718B00CED3BC /* jquery-1.6.1.min.js in Resources */ = {isa = PBXBuildFile; fileRef = DAB8D6AB15036BF600CED3BC /* jquery-1.6.1.min.js */; };
|
DAB8D97C1503718B00CED3BC /* jquery-1.6.1.min.js in Resources */ = {isa = PBXBuildFile; fileRef = DAB8D6AB15036BF600CED3BC /* jquery-1.6.1.min.js */; };
|
||||||
DABB981615100B4000B05417 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DABB981515100B4000B05417 /* SystemConfiguration.framework */; };
|
DABB981615100B4000B05417 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DABB981515100B4000B05417 /* SystemConfiguration.framework */; };
|
||||||
|
DAC4149215C53C48007A716E /* dictionary.lst in Resources */ = {isa = PBXBuildFile; fileRef = DAC4149115C53C48007A716E /* dictionary.lst */; };
|
||||||
DAC6325E1486805C0075AEA5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; };
|
DAC6325E1486805C0075AEA5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; };
|
||||||
DAC6326D148680650075AEA5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; };
|
DAC6326D148680650075AEA5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; };
|
||||||
DAC6327B1486809A0075AEA5 /* JRSwizzle.h in Headers */ = {isa = PBXBuildFile; fileRef = DAC632791486809A0075AEA5 /* JRSwizzle.h */; };
|
DAC6327B1486809A0075AEA5 /* JRSwizzle.h in Headers */ = {isa = PBXBuildFile; fileRef = DAC632791486809A0075AEA5 /* JRSwizzle.h */; };
|
||||||
@@ -885,6 +891,14 @@
|
|||||||
/* End PBXContainerItemProxy section */
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
|
93D3938863322199C3E7E2E3 /* MPAlgorithmV0.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAlgorithmV0.m; sourceTree = "<group>"; };
|
||||||
|
93D398E394E311C545E0A057 /* MPAlgorithm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAlgorithm.h; sourceTree = "<group>"; };
|
||||||
|
93D39AAB616A652A4847E4CF /* MPAlgorithmV0.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAlgorithmV0.h; sourceTree = "<group>"; };
|
||||||
|
93D39B0DF5E3C56355186738 /* MPAlgorithm.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAlgorithm.m; sourceTree = "<group>"; };
|
||||||
|
93D39C68AFA48A13015E4FAC /* MPKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPKey.h; sourceTree = "<group>"; };
|
||||||
|
93D39D0EF77FEC36EA0FB334 /* MPAlgorithmV1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAlgorithmV1.h; sourceTree = "<group>"; };
|
||||||
|
93D39E81EFABC6085AC8AE69 /* MPKey.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPKey.m; sourceTree = "<group>"; };
|
||||||
|
93D39E9D7B9005211E7D5262 /* MPAlgorithmV1.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAlgorithmV1.m; sourceTree = "<group>"; };
|
||||||
DA04E33D14B1E70400ECA4F3 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
|
DA04E33D14B1E70400ECA4F3 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
|
||||||
DA0A1D0315690A9A0092735D /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = Resources/Default.png; sourceTree = SOURCE_ROOT; };
|
DA0A1D0315690A9A0092735D /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = Resources/Default.png; sourceTree = SOURCE_ROOT; };
|
||||||
DA0A1D0415690A9A0092735D /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "Resources/Default@2x.png"; sourceTree = SOURCE_ROOT; };
|
DA0A1D0415690A9A0092735D /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "Resources/Default@2x.png"; sourceTree = SOURCE_ROOT; };
|
||||||
@@ -898,6 +912,14 @@
|
|||||||
DA0A1D1415690AF40092735D /* Icon-Small-50@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-Small-50@2x.png"; sourceTree = "<group>"; };
|
DA0A1D1415690AF40092735D /* Icon-Small-50@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-Small-50@2x.png"; sourceTree = "<group>"; };
|
||||||
DA0E07941577FE490008A67E /* MPEntities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPEntities.h; sourceTree = "<group>"; };
|
DA0E07941577FE490008A67E /* MPEntities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPEntities.h; sourceTree = "<group>"; };
|
||||||
DA0E07951577FE490008A67E /* MPEntities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPEntities.m; sourceTree = "<group>"; };
|
DA0E07951577FE490008A67E /* MPEntities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPEntities.m; sourceTree = "<group>"; };
|
||||||
|
DA0F9F3115B55397007ED9BC /* MPUserEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPUserEntity.h; sourceTree = "<group>"; };
|
||||||
|
DA0F9F3215B55397007ED9BC /* MPUserEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPUserEntity.m; sourceTree = "<group>"; };
|
||||||
|
DA0F9F3415B55397007ED9BC /* MPElementGeneratedEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPElementGeneratedEntity.h; sourceTree = "<group>"; };
|
||||||
|
DA0F9F3515B55397007ED9BC /* MPElementGeneratedEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPElementGeneratedEntity.m; sourceTree = "<group>"; };
|
||||||
|
DA0F9F3715B55397007ED9BC /* MPElementStoredEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPElementStoredEntity.h; sourceTree = "<group>"; };
|
||||||
|
DA0F9F3815B55397007ED9BC /* MPElementStoredEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPElementStoredEntity.m; sourceTree = "<group>"; };
|
||||||
|
DA0F9F3A15B55397007ED9BC /* MPElementEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPElementEntity.h; sourceTree = "<group>"; };
|
||||||
|
DA0F9F3B15B55397007ED9BC /* MPElementEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPElementEntity.m; sourceTree = "<group>"; };
|
||||||
DA30E9CB15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+PearlMutableInfo.h"; sourceTree = "<group>"; };
|
DA30E9CB15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+PearlMutableInfo.h"; sourceTree = "<group>"; };
|
||||||
DA30E9CC15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+PearlMutableInfo.m"; sourceTree = "<group>"; };
|
DA30E9CC15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+PearlMutableInfo.m"; sourceTree = "<group>"; };
|
||||||
DA30E9CD15722ECA00A68B4C /* Pearl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Pearl.m; sourceTree = "<group>"; };
|
DA30E9CD15722ECA00A68B4C /* Pearl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Pearl.m; sourceTree = "<group>"; };
|
||||||
@@ -912,14 +934,6 @@
|
|||||||
DA3EF18415A47744003ABF4E /* Tests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Tests.h; sourceTree = "<group>"; };
|
DA3EF18415A47744003ABF4E /* Tests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Tests.h; sourceTree = "<group>"; };
|
||||||
DA3EF18515A47744003ABF4E /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
|
DA3EF18515A47744003ABF4E /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
|
||||||
DA3EF18715A47744003ABF4E /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
|
DA3EF18715A47744003ABF4E /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
|
||||||
DA40C25F1586099D0079CE6E /* MPUserEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPUserEntity.h; sourceTree = "<group>"; };
|
|
||||||
DA40C2601586099D0079CE6E /* MPUserEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPUserEntity.m; sourceTree = "<group>"; };
|
|
||||||
DA40C2621586099E0079CE6E /* MPElementEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPElementEntity.h; sourceTree = "<group>"; };
|
|
||||||
DA40C2631586099E0079CE6E /* MPElementEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPElementEntity.m; sourceTree = "<group>"; };
|
|
||||||
DA40C2651586099E0079CE6E /* MPElementGeneratedEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPElementGeneratedEntity.h; sourceTree = "<group>"; };
|
|
||||||
DA40C2661586099E0079CE6E /* MPElementGeneratedEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPElementGeneratedEntity.m; sourceTree = "<group>"; };
|
|
||||||
DA40C2681586099E0079CE6E /* MPElementStoredEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPElementStoredEntity.h; sourceTree = "<group>"; };
|
|
||||||
DA40C2691586099E0079CE6E /* MPElementStoredEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPElementStoredEntity.m; sourceTree = "<group>"; };
|
|
||||||
DA4425CB1557BED40052177D /* libiCloudStoreManager.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libiCloudStoreManager.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
DA4425CB1557BED40052177D /* libiCloudStoreManager.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libiCloudStoreManager.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
DA4425F11557BF260052177D /* UbiquityStoreManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UbiquityStoreManager.h; sourceTree = "<group>"; };
|
DA4425F11557BF260052177D /* UbiquityStoreManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UbiquityStoreManager.h; sourceTree = "<group>"; };
|
||||||
DA4425F21557BF260052177D /* UbiquityStoreManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UbiquityStoreManager.m; sourceTree = "<group>"; };
|
DA4425F21557BF260052177D /* UbiquityStoreManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UbiquityStoreManager.m; sourceTree = "<group>"; };
|
||||||
@@ -927,6 +941,9 @@
|
|||||||
DA4426051557C1990052177D /* MPAppDelegate_Shared.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAppDelegate_Shared.m; sourceTree = "<group>"; };
|
DA4426051557C1990052177D /* MPAppDelegate_Shared.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAppDelegate_Shared.m; sourceTree = "<group>"; };
|
||||||
DA4426061557C1990052177D /* MPAppDelegate_Store.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAppDelegate_Store.h; sourceTree = "<group>"; };
|
DA4426061557C1990052177D /* MPAppDelegate_Store.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAppDelegate_Store.h; sourceTree = "<group>"; };
|
||||||
DA4426071557C1990052177D /* MPAppDelegate_Store.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAppDelegate_Store.m; sourceTree = "<group>"; };
|
DA4426071557C1990052177D /* MPAppDelegate_Store.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAppDelegate_Store.m; sourceTree = "<group>"; };
|
||||||
|
DA46826C15AB48F100FB09E7 /* MasterPassword 2.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "MasterPassword 2.xcdatamodel"; sourceTree = "<group>"; };
|
||||||
|
DA46826D15AB843200FB09E7 /* tip_basic_black_bottom_right.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tip_basic_black_bottom_right.png; sourceTree = "<group>"; };
|
||||||
|
DA46826E15AB843200FB09E7 /* tip_basic_black_bottom_right@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tip_basic_black_bottom_right@2x.png"; sourceTree = "<group>"; };
|
||||||
DA5BFA44147E415C00F98B1E /* MasterPassword.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MasterPassword.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
DA5BFA44147E415C00F98B1E /* MasterPassword.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MasterPassword.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
DA5BFA48147E415C00F98B1E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
DA5BFA48147E415C00F98B1E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||||
DA5BFA4A147E415C00F98B1E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
DA5BFA4A147E415C00F98B1E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||||
@@ -982,7 +999,7 @@
|
|||||||
DA95D5CE14DF0691008D1B94 /* IASKSpecifierValuesView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKSpecifierValuesView.xib; sourceTree = "<group>"; };
|
DA95D5CE14DF0691008D1B94 /* IASKSpecifierValuesView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKSpecifierValuesView.xib; sourceTree = "<group>"; };
|
||||||
DA95D5F014DF0B1E008D1B94 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
|
DA95D5F014DF0B1E008D1B94 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
|
||||||
DAAC35DD156BD77D00C5FD93 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
|
DAAC35DD156BD77D00C5FD93 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
|
||||||
DAB8D43D15036BCF00CED3BC /* MasterPassword.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MasterPassword.xcdatamodel; sourceTree = "<group>"; };
|
DAB8D43D15036BCF00CED3BC /* MasterPassword 1.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "MasterPassword 1.xcdatamodel"; sourceTree = "<group>"; };
|
||||||
DAB8D44015036BCF00CED3BC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
DAB8D44015036BCF00CED3BC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||||
DAB8D44115036BCF00CED3BC /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
DAB8D44115036BCF00CED3BC /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||||
DAB8D44215036BCF00CED3BC /* MainStoryboard_iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard_iPhone.storyboard; sourceTree = "<group>"; };
|
DAB8D44215036BCF00CED3BC /* MainStoryboard_iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard_iPhone.storyboard; sourceTree = "<group>"; };
|
||||||
@@ -1004,7 +1021,6 @@
|
|||||||
DAB8D45215036BCF00CED3BC /* MPUnlockViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPUnlockViewController.h; sourceTree = "<group>"; };
|
DAB8D45215036BCF00CED3BC /* MPUnlockViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPUnlockViewController.h; sourceTree = "<group>"; };
|
||||||
DAB8D45315036BCF00CED3BC /* MPUnlockViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPUnlockViewController.m; sourceTree = "<group>"; };
|
DAB8D45315036BCF00CED3BC /* MPUnlockViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPUnlockViewController.m; sourceTree = "<group>"; };
|
||||||
DAB8D45415036BCF00CED3BC /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; };
|
DAB8D45415036BCF00CED3BC /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; };
|
||||||
DAB8D45615036BCF00CED3BC /* MPTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPTypes.m; sourceTree = "<group>"; };
|
|
||||||
DAB8D45915036BCF00CED3BC /* MPTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPTypes.h; sourceTree = "<group>"; };
|
DAB8D45915036BCF00CED3BC /* MPTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPTypes.h; sourceTree = "<group>"; };
|
||||||
DAB8D47115036BF600CED3BC /* ui_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ui_background.png; sourceTree = "<group>"; };
|
DAB8D47115036BF600CED3BC /* ui_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ui_background.png; sourceTree = "<group>"; };
|
||||||
DAB8D47215036BF600CED3BC /* ui_background@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ui_background@2x.png"; sourceTree = "<group>"; };
|
DAB8D47215036BF600CED3BC /* ui_background@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ui_background@2x.png"; sourceTree = "<group>"; };
|
||||||
@@ -1647,6 +1663,7 @@
|
|||||||
DABB980D150FF40100B05417 /* SendToMac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SendToMac.h; sourceTree = "<group>"; };
|
DABB980D150FF40100B05417 /* SendToMac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SendToMac.h; sourceTree = "<group>"; };
|
||||||
DABB980E150FF40100B05417 /* SendToMac.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SendToMac.m; sourceTree = "<group>"; };
|
DABB980E150FF40100B05417 /* SendToMac.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SendToMac.m; sourceTree = "<group>"; };
|
||||||
DABB981515100B4000B05417 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
DABB981515100B4000B05417 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
||||||
|
DAC4149115C53C48007A716E /* dictionary.lst */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dictionary.lst; sourceTree = "<group>"; };
|
||||||
DAC6325D1486805C0075AEA5 /* libuicolor-utilities.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libuicolor-utilities.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
DAC6325D1486805C0075AEA5 /* libuicolor-utilities.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libuicolor-utilities.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
DAC6326C148680650075AEA5 /* libjrswizzle.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjrswizzle.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
DAC6326C148680650075AEA5 /* libjrswizzle.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjrswizzle.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
DAC632791486809A0075AEA5 /* JRSwizzle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JRSwizzle.h; path = External/Pearl/External/jrswizzle/JRSwizzle.h; sourceTree = SOURCE_ROOT; };
|
DAC632791486809A0075AEA5 /* JRSwizzle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JRSwizzle.h; path = External/Pearl/External/jrswizzle/JRSwizzle.h; sourceTree = SOURCE_ROOT; };
|
||||||
@@ -1994,17 +2011,25 @@
|
|||||||
DA5BFA50147E415C00F98B1E /* MasterPassword */ = {
|
DA5BFA50147E415C00F98B1E /* MasterPassword */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
DA40C2681586099E0079CE6E /* MPElementStoredEntity.h */,
|
93D39D0EF77FEC36EA0FB334 /* MPAlgorithmV1.h */,
|
||||||
DA40C2691586099E0079CE6E /* MPElementStoredEntity.m */,
|
93D39E9D7B9005211E7D5262 /* MPAlgorithmV1.m */,
|
||||||
DA40C2651586099E0079CE6E /* MPElementGeneratedEntity.h */,
|
93D39B0DF5E3C56355186738 /* MPAlgorithm.m */,
|
||||||
DA40C2661586099E0079CE6E /* MPElementGeneratedEntity.m */,
|
93D39C68AFA48A13015E4FAC /* MPKey.h */,
|
||||||
DA40C2621586099E0079CE6E /* MPElementEntity.h */,
|
93D39E81EFABC6085AC8AE69 /* MPKey.m */,
|
||||||
DA40C2631586099E0079CE6E /* MPElementEntity.m */,
|
93D39AAB616A652A4847E4CF /* MPAlgorithmV0.h */,
|
||||||
DA40C25F1586099D0079CE6E /* MPUserEntity.h */,
|
93D3938863322199C3E7E2E3 /* MPAlgorithmV0.m */,
|
||||||
DA40C2601586099D0079CE6E /* MPUserEntity.m */,
|
93D398E394E311C545E0A057 /* MPAlgorithm.h */,
|
||||||
DA0E07941577FE490008A67E /* MPEntities.h */,
|
DA0E07941577FE490008A67E /* MPEntities.h */,
|
||||||
DA0E07951577FE490008A67E /* MPEntities.m */,
|
DA0E07951577FE490008A67E /* MPEntities.m */,
|
||||||
DAB8D43C15036BCF00CED3BC /* MasterPassword.xcdatamodeld */,
|
DAB8D43C15036BCF00CED3BC /* MasterPassword.xcdatamodeld */,
|
||||||
|
DA0F9F3115B55397007ED9BC /* MPUserEntity.h */,
|
||||||
|
DA0F9F3215B55397007ED9BC /* MPUserEntity.m */,
|
||||||
|
DA0F9F3415B55397007ED9BC /* MPElementGeneratedEntity.h */,
|
||||||
|
DA0F9F3515B55397007ED9BC /* MPElementGeneratedEntity.m */,
|
||||||
|
DA0F9F3715B55397007ED9BC /* MPElementStoredEntity.h */,
|
||||||
|
DA0F9F3A15B55397007ED9BC /* MPElementEntity.h */,
|
||||||
|
DA0F9F3B15B55397007ED9BC /* MPElementEntity.m */,
|
||||||
|
DA0F9F3815B55397007ED9BC /* MPElementStoredEntity.m */,
|
||||||
DA600C2415054F3A008E9AB6 /* MPAppDelegate_Key.h */,
|
DA600C2415054F3A008E9AB6 /* MPAppDelegate_Key.h */,
|
||||||
DA600C2315054F3A008E9AB6 /* MPAppDelegate_Key.m */,
|
DA600C2315054F3A008E9AB6 /* MPAppDelegate_Key.m */,
|
||||||
DA4426041557C1990052177D /* MPAppDelegate_Shared.h */,
|
DA4426041557C1990052177D /* MPAppDelegate_Shared.h */,
|
||||||
@@ -2014,7 +2039,6 @@
|
|||||||
DA600C2615056427008E9AB6 /* MPConfig.h */,
|
DA600C2615056427008E9AB6 /* MPConfig.h */,
|
||||||
DA600C2715056427008E9AB6 /* MPConfig.m */,
|
DA600C2715056427008E9AB6 /* MPConfig.m */,
|
||||||
DAB8D45915036BCF00CED3BC /* MPTypes.h */,
|
DAB8D45915036BCF00CED3BC /* MPTypes.h */,
|
||||||
DAB8D45615036BCF00CED3BC /* MPTypes.m */,
|
|
||||||
DAB8D43E15036BCF00CED3BC /* iOS */,
|
DAB8D43E15036BCF00CED3BC /* iOS */,
|
||||||
);
|
);
|
||||||
path = MasterPassword;
|
path = MasterPassword;
|
||||||
@@ -2193,6 +2217,7 @@
|
|||||||
DAB8D46F15036BF600CED3BC /* Resources */ = {
|
DAB8D46F15036BF600CED3BC /* Resources */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
DAC4149115C53C48007A716E /* dictionary.lst */,
|
||||||
DA902BD01576CA4A00C38161 /* keypad.png */,
|
DA902BD01576CA4A00C38161 /* keypad.png */,
|
||||||
DA902B931576C0FB00C38161 /* Avatars */,
|
DA902B931576C0FB00C38161 /* Avatars */,
|
||||||
DAB8D47015036BF600CED3BC /* Automaton */,
|
DAB8D47015036BF600CED3BC /* Automaton */,
|
||||||
@@ -2832,6 +2857,8 @@
|
|||||||
DAB8D6B715036BF600CED3BC /* Tooltips */ = {
|
DAB8D6B715036BF600CED3BC /* Tooltips */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
DA46826D15AB843200FB09E7 /* tip_basic_black_bottom_right.png */,
|
||||||
|
DA46826E15AB843200FB09E7 /* tip_basic_black_bottom_right@2x.png */,
|
||||||
DACABB8E1572B769008BA211 /* tip_basic_black_top.png */,
|
DACABB8E1572B769008BA211 /* tip_basic_black_top.png */,
|
||||||
DACABB8F1572B769008BA211 /* tip_basic_black_top@2x.png */,
|
DACABB8F1572B769008BA211 /* tip_basic_black_top@2x.png */,
|
||||||
DACABB8A1572A4A4008BA211 /* tip_basic_black_top_right.png */,
|
DACABB8A1572A4A4008BA211 /* tip_basic_black_top_right.png */,
|
||||||
@@ -4148,6 +4175,9 @@
|
|||||||
DAE4C98C157E63BE00EFE047 /* avatar-17@2x.png in Resources */,
|
DAE4C98C157E63BE00EFE047 /* avatar-17@2x.png in Resources */,
|
||||||
DAE4C98D157E63BE00EFE047 /* avatar-18.png in Resources */,
|
DAE4C98D157E63BE00EFE047 /* avatar-18.png in Resources */,
|
||||||
DAE4C98E157E63BE00EFE047 /* avatar-18@2x.png in Resources */,
|
DAE4C98E157E63BE00EFE047 /* avatar-18@2x.png in Resources */,
|
||||||
|
DA46826F15AB843200FB09E7 /* tip_basic_black_bottom_right.png in Resources */,
|
||||||
|
DA46827015AB843200FB09E7 /* tip_basic_black_bottom_right@2x.png in Resources */,
|
||||||
|
DAC4149215C53C48007A716E /* dictionary.lst in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -4229,17 +4259,20 @@
|
|||||||
DAB8D46715036BCF00CED3BC /* MPSearchDelegate.m in Sources */,
|
DAB8D46715036BCF00CED3BC /* MPSearchDelegate.m in Sources */,
|
||||||
DAB8D46815036BCF00CED3BC /* MPTypeViewController.m in Sources */,
|
DAB8D46815036BCF00CED3BC /* MPTypeViewController.m in Sources */,
|
||||||
DAB8D46915036BCF00CED3BC /* MPUnlockViewController.m in Sources */,
|
DAB8D46915036BCF00CED3BC /* MPUnlockViewController.m in Sources */,
|
||||||
DAB8D46C15036BCF00CED3BC /* MPTypes.m in Sources */,
|
|
||||||
DA600C2515054F3A008E9AB6 /* MPAppDelegate_Key.m in Sources */,
|
DA600C2515054F3A008E9AB6 /* MPAppDelegate_Key.m in Sources */,
|
||||||
DA600C2815056428008E9AB6 /* MPConfig.m in Sources */,
|
DA600C2815056428008E9AB6 /* MPConfig.m in Sources */,
|
||||||
DA4426081557C1990052177D /* MPAppDelegate_Shared.m in Sources */,
|
DA4426081557C1990052177D /* MPAppDelegate_Shared.m in Sources */,
|
||||||
DA4426091557C1990052177D /* MPAppDelegate_Store.m in Sources */,
|
DA4426091557C1990052177D /* MPAppDelegate_Store.m in Sources */,
|
||||||
DA0E07961577FE490008A67E /* MPEntities.m in Sources */,
|
DA0E07961577FE490008A67E /* MPEntities.m in Sources */,
|
||||||
DAC728CA157C247B00889EF2 /* MPPreferencesViewController.m in Sources */,
|
DAC728CA157C247B00889EF2 /* MPPreferencesViewController.m in Sources */,
|
||||||
DA40C2611586099D0079CE6E /* MPUserEntity.m in Sources */,
|
93D392B30CE6C58A9A905E0A /* MPAlgorithmV0.m in Sources */,
|
||||||
DA40C2641586099E0079CE6E /* MPElementEntity.m in Sources */,
|
93D390BC6AE7A1C9B91A3668 /* MPKey.m in Sources */,
|
||||||
DA40C2671586099E0079CE6E /* MPElementGeneratedEntity.m in Sources */,
|
93D394744B5485303B326ECB /* MPAlgorithm.m in Sources */,
|
||||||
DA40C26A1586099E0079CE6E /* MPElementStoredEntity.m in Sources */,
|
93D39DC7A7282137B08C8D82 /* MPAlgorithmV1.m in Sources */,
|
||||||
|
DA0F9F3315B55397007ED9BC /* MPUserEntity.m in Sources */,
|
||||||
|
DA0F9F3615B55397007ED9BC /* MPElementGeneratedEntity.m in Sources */,
|
||||||
|
DA0F9F3915B55397007ED9BC /* MPElementStoredEntity.m in Sources */,
|
||||||
|
DA0F9F3C15B55397007ED9BC /* MPElementEntity.m in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -4961,6 +4994,7 @@
|
|||||||
DA3EF18B15A47744003ABF4E /* AppStore */,
|
DA3EF18B15A47744003ABF4E /* AppStore */,
|
||||||
);
|
);
|
||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = AdHoc;
|
||||||
};
|
};
|
||||||
DA4425D31557BED40052177D /* Build configuration list for PBXNativeTarget "iCloudStoreManager" */ = {
|
DA4425D31557BED40052177D /* Build configuration list for PBXNativeTarget "iCloudStoreManager" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
@@ -5058,9 +5092,10 @@
|
|||||||
DAB8D43C15036BCF00CED3BC /* MasterPassword.xcdatamodeld */ = {
|
DAB8D43C15036BCF00CED3BC /* MasterPassword.xcdatamodeld */ = {
|
||||||
isa = XCVersionGroup;
|
isa = XCVersionGroup;
|
||||||
children = (
|
children = (
|
||||||
DAB8D43D15036BCF00CED3BC /* MasterPassword.xcdatamodel */,
|
DA46826C15AB48F100FB09E7 /* MasterPassword 2.xcdatamodel */,
|
||||||
|
DAB8D43D15036BCF00CED3BC /* MasterPassword 1.xcdatamodel */,
|
||||||
);
|
);
|
||||||
currentVersion = DAB8D43D15036BCF00CED3BC /* MasterPassword.xcdatamodel */;
|
currentVersion = DA46826C15AB48F100FB09E7 /* MasterPassword 2.xcdatamodel */;
|
||||||
path = MasterPassword.xcdatamodeld;
|
path = MasterPassword.xcdatamodeld;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
versionGroupType = wrapper.xcdatamodel;
|
versionGroupType = wrapper.xcdatamodel;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
buildImplicitDependencies = "YES">
|
buildImplicitDependencies = "YES">
|
||||||
<BuildActionEntries>
|
<BuildActionEntries>
|
||||||
<BuildActionEntry
|
<BuildActionEntry
|
||||||
buildForTesting = "NO"
|
buildForTesting = "YES"
|
||||||
buildForRunning = "YES"
|
buildForRunning = "YES"
|
||||||
buildForProfiling = "YES"
|
buildForProfiling = "YES"
|
||||||
buildForArchiving = "YES"
|
buildForArchiving = "YES"
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>MPElementGeneratedEntity</key>
|
|
||||||
<dict>
|
|
||||||
<key>Maximum Security Password</key>
|
|
||||||
<array>
|
|
||||||
<string>anoxxxxxxxxxxxxxxxxx</string>
|
|
||||||
<string>axxxxxxxxxxxxxxxxxno</string>
|
|
||||||
</array>
|
|
||||||
<key>Long Password</key>
|
|
||||||
<array>
|
|
||||||
<string>CvcvnoCvcvCvcv</string>
|
|
||||||
<string>CvcvCvcvnoCvcv</string>
|
|
||||||
<string>CvcvCvcvCvcvno</string>
|
|
||||||
<string>CvccnoCvcvCvcv</string>
|
|
||||||
<string>CvccCvcvnoCvcv</string>
|
|
||||||
<string>CvccCvcvCvcvno</string>
|
|
||||||
<string>CvcvnoCvccCvcv</string>
|
|
||||||
<string>CvcvCvccnoCvcv</string>
|
|
||||||
<string>CvcvCvccCvcvno</string>
|
|
||||||
<string>CvcvnoCvcvCvcc</string>
|
|
||||||
<string>CvcvCvcvnoCvcc</string>
|
|
||||||
<string>CvcvCvcvCvccno</string>
|
|
||||||
<string>CvccnoCvccCvcv</string>
|
|
||||||
<string>CvccCvccnoCvcv</string>
|
|
||||||
<string>CvccCvccCvcvno</string>
|
|
||||||
<string>CvcvnoCvccCvcc</string>
|
|
||||||
<string>CvcvCvccnoCvcc</string>
|
|
||||||
<string>CvcvCvccCvccno</string>
|
|
||||||
<string>CvccnoCvcvCvcc</string>
|
|
||||||
<string>CvccCvcvnoCvcc</string>
|
|
||||||
<string>CvccCvcvCvccno</string>
|
|
||||||
</array>
|
|
||||||
<key>Medium Password</key>
|
|
||||||
<array>
|
|
||||||
<string>CvcnoCvc</string>
|
|
||||||
<string>CvcCvcno</string>
|
|
||||||
</array>
|
|
||||||
<key>Short Password</key>
|
|
||||||
<array>
|
|
||||||
<string>Cvcn</string>
|
|
||||||
</array>
|
|
||||||
<key>Basic Password</key>
|
|
||||||
<array>
|
|
||||||
<string>aaanaaan</string>
|
|
||||||
<string>aannaaan</string>
|
|
||||||
<string>aaannaaa</string>
|
|
||||||
</array>
|
|
||||||
<key>PIN</key>
|
|
||||||
<array>
|
|
||||||
<string>nnnn</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
<key>MPCharacterClasses</key>
|
|
||||||
<dict>
|
|
||||||
<key>V</key>
|
|
||||||
<string>AEIOU</string>
|
|
||||||
<key>C</key>
|
|
||||||
<string>BCDFGHJKLMNPQRSTVWXYZ</string>
|
|
||||||
<key>v</key>
|
|
||||||
<string>aeiou</string>
|
|
||||||
<key>c</key>
|
|
||||||
<string>bcdfghjklmnpqrstvwxyz</string>
|
|
||||||
<key>A</key>
|
|
||||||
<string>AEIOUBCDFGHJKLMNPQRSTVWXYZ</string>
|
|
||||||
<key>a</key>
|
|
||||||
<string>AEIOUaeiouBCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz</string>
|
|
||||||
<key>n</key>
|
|
||||||
<string>0123456789</string>
|
|
||||||
<key>o</key>
|
|
||||||
<string>@&%?,=[]_:-+*$#!'^~;()/.</string>
|
|
||||||
<key>x</key>
|
|
||||||
<string>AEIOUaeiouBCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz0123456789!@#$%^&*()</string>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#Generated by Maven
|
|
||||||
#Wed Jul 04 23:49:38 CEST 2012
|
|
||||||
version=GIT-SNAPSHOT
|
|
||||||
groupId=com.lyndir.lhunath.masterpassword
|
|
||||||
artifactId=masterpassword-algorithm
|
|
||||||
@@ -18,7 +18,8 @@ package com.lyndir.lhunath.masterpassword;
|
|||||||
import com.google.common.io.LineReader;
|
import com.google.common.io.LineReader;
|
||||||
import com.lyndir.lhunath.opal.system.logging.Logger;
|
import com.lyndir.lhunath.opal.system.logging.Logger;
|
||||||
import com.lyndir.lhunath.opal.system.util.ConversionUtils;
|
import com.lyndir.lhunath.opal.system.util.ConversionUtils;
|
||||||
import java.io.*;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
|
||||||
@@ -30,14 +31,19 @@ import java.util.Arrays;
|
|||||||
public class CLI {
|
public class CLI {
|
||||||
|
|
||||||
static final Logger logger = Logger.get( CLI.class );
|
static final Logger logger = Logger.get( CLI.class );
|
||||||
|
private static final String ENV_USERNAME = "MP_USERNAME";
|
||||||
|
private static final String ENV_PASSWORD = "MP_PASSWORD";
|
||||||
|
|
||||||
public static void main(final String[] args)
|
public static void main(final String[] args)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
InputStream in = System.in;
|
String userName, masterPassword, siteName = null;
|
||||||
|
|
||||||
|
/* Environment. */
|
||||||
|
userName = System.getenv().get( ENV_USERNAME );
|
||||||
|
masterPassword = System.getenv().get( ENV_PASSWORD );
|
||||||
|
|
||||||
/* Arguments. */
|
/* Arguments. */
|
||||||
String userName = null, siteName = null;
|
|
||||||
int counter = 1;
|
int counter = 1;
|
||||||
MPElementType type = MPElementType.GeneratedLong;
|
MPElementType type = MPElementType.GeneratedLong;
|
||||||
boolean typeArg = false, counterArg = false, userNameArg = false;
|
boolean typeArg = false, counterArg = false, userNameArg = false;
|
||||||
@@ -72,6 +78,7 @@ public class CLI {
|
|||||||
System.out.println( "[options] [site name]" );
|
System.out.println( "[options] [site name]" );
|
||||||
System.out.println();
|
System.out.println();
|
||||||
System.out.println( "Available options:" );
|
System.out.println( "Available options:" );
|
||||||
|
|
||||||
System.out.println( "\t-t | --type [site password type]" );
|
System.out.println( "\t-t | --type [site password type]" );
|
||||||
System.out.format( "\t\tDefault: %s. The password type to use for this site.\n", type.getName() );
|
System.out.format( "\t\tDefault: %s. The password type to use for this site.\n", type.getName() );
|
||||||
System.out.println( "\t\tUse 'list' to see the available types." );
|
System.out.println( "\t\tUse 'list' to see the available types." );
|
||||||
@@ -83,26 +90,44 @@ public class CLI {
|
|||||||
|
|
||||||
System.out.println();
|
System.out.println();
|
||||||
System.out.println( "\t-u | --username [user's name]" );
|
System.out.println( "\t-u | --username [user's name]" );
|
||||||
System.out.println( "\t\tDefault: asked. The name of the current user." );
|
System.out.println( "\t\tDefault: asked. The name of the user." );
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
System.out.println( "Available environment variables:" );
|
||||||
|
|
||||||
|
System.out.format( "\t%s\n", ENV_USERNAME );
|
||||||
|
System.out.println( "\t\tThe name of the user." );
|
||||||
|
|
||||||
|
System.out.format( "\t%s\n", ENV_PASSWORD );
|
||||||
|
System.out.println( "\t\tThe master password of the user." );
|
||||||
|
|
||||||
System.out.println();
|
System.out.println();
|
||||||
return;
|
return;
|
||||||
} else
|
} else
|
||||||
siteName = arg;
|
siteName = arg;
|
||||||
LineReader lineReader = new LineReader( new InputStreamReader( System.in ) );
|
|
||||||
|
InputStreamReader inReader = new InputStreamReader( System.in );
|
||||||
|
try {
|
||||||
|
LineReader lineReader = new LineReader( inReader );
|
||||||
if (siteName == null) {
|
if (siteName == null) {
|
||||||
System.out.print( "Site name: " );
|
System.err.format( "Site name: " );
|
||||||
siteName = lineReader.readLine();
|
siteName = lineReader.readLine();
|
||||||
}
|
}
|
||||||
if (userName == null) {
|
if (userName == null) {
|
||||||
System.out.print( "User's name: " );
|
System.err.format( "User's name: " );
|
||||||
userName = lineReader.readLine();
|
userName = lineReader.readLine();
|
||||||
}
|
}
|
||||||
System.out.print( "User's master password: " );
|
if (masterPassword == null) {
|
||||||
String masterPassword = lineReader.readLine();
|
System.err.format( "%s's master password: ", userName );
|
||||||
|
masterPassword = lineReader.readLine();
|
||||||
|
}
|
||||||
|
|
||||||
String sitePassword = MasterPassword.generateContent( type, siteName, MasterPassword.keyForPassword( masterPassword, userName ),
|
byte[] masterKey = MasterPassword.keyForPassword( masterPassword, userName );
|
||||||
counter );
|
String sitePassword = MasterPassword.generateContent( type, siteName, masterKey, counter );
|
||||||
System.out.println( sitePassword );
|
System.out.println( sitePassword );
|
||||||
}
|
}
|
||||||
|
finally {
|
||||||
|
inReader.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
#Generated by Maven
|
|
||||||
#Wed Jul 04 23:49:39 CEST 2012
|
|
||||||
version=GIT-SNAPSHOT
|
|
||||||
groupId=com.lyndir.lhunath.masterpassword
|
|
||||||
artifactId=masterpassword-cli
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
cd "${BASH_SOURCE[0]%/*}"
|
|
||||||
java -jar masterpassword-cli-GIT-SNAPSHOT.jar "$@"
|
|
||||||
44
MasterPassword/MPAlgorithm.h
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/**
|
||||||
|
* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com)
|
||||||
|
*
|
||||||
|
* See the enclosed file LICENSE for license information (LGPLv3). If you did
|
||||||
|
* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*
|
||||||
|
* @author Maarten Billemont <lhunath@lyndir.com>
|
||||||
|
* @license http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
//
|
||||||
|
// MPAlgorithm
|
||||||
|
//
|
||||||
|
// Created by Maarten Billemont on 16/07/12.
|
||||||
|
// Copyright 2012 lhunath (Maarten Billemont). All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MPKey.h"
|
||||||
|
#import "MPElementGeneratedEntity.h"
|
||||||
|
|
||||||
|
#define MPAlgorithmDefaultVersion 1
|
||||||
|
#define MPAlgorithmDefault MPAlgorithmForVersion(MPAlgorithmDefaultVersion)
|
||||||
|
|
||||||
|
@protocol MPAlgorithm<NSObject>
|
||||||
|
|
||||||
|
@required
|
||||||
|
- (NSUInteger)version;
|
||||||
|
- (BOOL)migrateElement:(MPElementEntity *)element explicit:(BOOL)explicit;
|
||||||
|
|
||||||
|
- (MPKey *)keyForPassword:(NSString *)password ofUserNamed:(NSString *)userName;
|
||||||
|
- (MPKey *)keyFromKeyData:(NSData *)keyData;
|
||||||
|
- (NSData *)keyIDForKeyData:(NSData *)keyData;
|
||||||
|
|
||||||
|
- (NSString *)nameOfType:(MPElementType)type;
|
||||||
|
- (NSString *)shortNameOfType:(MPElementType)type;
|
||||||
|
- (NSString *)classNameOfType:(MPElementType)type;
|
||||||
|
- (Class)classOfType:(MPElementType)type;
|
||||||
|
|
||||||
|
- (NSString *)generateContentForElement:(MPElementGeneratedEntity *)element usingKey:(MPKey *)key;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
id<MPAlgorithm> MPAlgorithmForVersion(NSUInteger version);
|
||||||
|
id<MPAlgorithm> MPAlgorithmDefaultForBundleVersion(NSString *bundleVersion);
|
||||||
42
MasterPassword/MPAlgorithm.m
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/**
|
||||||
|
* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com)
|
||||||
|
*
|
||||||
|
* See the enclosed file LICENSE for license information (LGPLv3). If you did
|
||||||
|
* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*
|
||||||
|
* @author Maarten Billemont <lhunath@lyndir.com>
|
||||||
|
* @license http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
//
|
||||||
|
// MPAlgorithm
|
||||||
|
//
|
||||||
|
// Created by Maarten Billemont on 16/07/12.
|
||||||
|
// Copyright 2012 lhunath (Maarten Billemont). All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MPAlgorithm.h"
|
||||||
|
#import "MPEntities.h"
|
||||||
|
|
||||||
|
id<MPAlgorithm> MPAlgorithmForVersion(NSUInteger version) {
|
||||||
|
|
||||||
|
static NSMutableDictionary *versionToAlgorithm = nil;
|
||||||
|
if (!versionToAlgorithm)
|
||||||
|
versionToAlgorithm = [NSMutableDictionary dictionary];
|
||||||
|
|
||||||
|
id<MPAlgorithm> algorithm = [versionToAlgorithm objectForKey:PearlUnsignedInteger(version)];
|
||||||
|
if (!algorithm)
|
||||||
|
if ((algorithm = [NSClassFromString(PearlString(@"MPAlgorithmV%u", version)) new]))
|
||||||
|
[versionToAlgorithm setObject:algorithm forKey:PearlUnsignedInteger(version)];
|
||||||
|
|
||||||
|
return algorithm;
|
||||||
|
}
|
||||||
|
|
||||||
|
id<MPAlgorithm> MPAlgorithmDefaultForBundleVersion(NSString *bundleVersion) {
|
||||||
|
|
||||||
|
if (PearlCFBundleVersionCompare(bundleVersion, @"1.3") == NSOrderedAscending)
|
||||||
|
// Pre-1.3
|
||||||
|
return MPAlgorithmForVersion(0);
|
||||||
|
|
||||||
|
return MPAlgorithmDefault;
|
||||||
|
}
|
||||||
21
MasterPassword/MPAlgorithmV0.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/**
|
||||||
|
* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com)
|
||||||
|
*
|
||||||
|
* See the enclosed file LICENSE for license information (LGPLv3). If you did
|
||||||
|
* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*
|
||||||
|
* @author Maarten Billemont <lhunath@lyndir.com>
|
||||||
|
* @license http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
//
|
||||||
|
// MPAlgorithmV0
|
||||||
|
//
|
||||||
|
// Created by Maarten Billemont on 16/07/12.
|
||||||
|
// Copyright 2012 lhunath (Maarten Billemont). All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MPAlgorithm.h"
|
||||||
|
|
||||||
|
@interface MPAlgorithmV0 : NSObject <MPAlgorithm>
|
||||||
|
@end
|
||||||
@@ -1,54 +1,83 @@
|
|||||||
|
/**
|
||||||
|
* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com)
|
||||||
|
*
|
||||||
|
* See the enclosed file LICENSE for license information (LGPLv3). If you did
|
||||||
|
* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*
|
||||||
|
* @author Maarten Billemont <lhunath@lyndir.com>
|
||||||
|
* @license http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*/
|
||||||
|
|
||||||
//
|
//
|
||||||
// MPTypes.m
|
// MPAlgorithmV0
|
||||||
// MasterPassword
|
|
||||||
//
|
//
|
||||||
// Created by Maarten Billemont on 02/01/12.
|
// Created by Maarten Billemont on 16/07/12.
|
||||||
// Copyright (c) 2012 Lyndir. All rights reserved.
|
// Copyright 2012 lhunath (Maarten Billemont). All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#import "MPAlgorithmV0.h"
|
||||||
#import "MPEntities.h"
|
#import "MPEntities.h"
|
||||||
|
|
||||||
|
|
||||||
#define MP_N 32768
|
#define MP_N 32768
|
||||||
#define MP_r 8
|
#define MP_r 8
|
||||||
#define MP_p 2
|
#define MP_p 2
|
||||||
#define MP_dkLen 64
|
#define MP_dkLen 64
|
||||||
#define MP_hash PearlHashSHA256
|
#define MP_hash PearlHashSHA256
|
||||||
|
|
||||||
NSData *keyForPassword(NSString *password, NSString *username) {
|
@implementation MPAlgorithmV0
|
||||||
|
|
||||||
uint32_t nusernameLength = htonl(username.length);
|
- (NSUInteger)version {
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)migrateElement:(MPElementEntity *)element explicit:(BOOL)explicit {
|
||||||
|
|
||||||
|
if (element.version != [self version] - 1)
|
||||||
|
// Only migrate from previous version.
|
||||||
|
return NO;
|
||||||
|
|
||||||
|
if (!explicit) {
|
||||||
|
// This migration requires explicit permission.
|
||||||
|
element.requiresExplicitMigration = YES;
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply migration.
|
||||||
|
element.requiresExplicitMigration = NO;
|
||||||
|
element.version = [self version];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (MPKey *)keyForPassword:(NSString *)password ofUserNamed:(NSString *)userName {
|
||||||
|
|
||||||
|
uint32_t nuserNameLength = htonl(userName.length);
|
||||||
NSDate *start = [NSDate date];
|
NSDate *start = [NSDate date];
|
||||||
NSData *key = [PearlSCrypt deriveKeyWithLength:MP_dkLen fromPassword:[password dataUsingEncoding:NSUTF8StringEncoding]
|
NSData *keyData = [PearlSCrypt deriveKeyWithLength:MP_dkLen fromPassword:[password dataUsingEncoding:NSUTF8StringEncoding]
|
||||||
usingSalt:[NSData dataByConcatenatingDatas:
|
usingSalt:[NSData dataByConcatenatingDatas:
|
||||||
[@"com.lyndir.masterpassword" dataUsingEncoding:NSUTF8StringEncoding],
|
[@"com.lyndir.masterpassword" dataUsingEncoding:NSUTF8StringEncoding],
|
||||||
[NSData dataWithBytes:&nusernameLength
|
[NSData dataWithBytes:&nuserNameLength
|
||||||
length:sizeof(nusernameLength)],
|
length:sizeof(nuserNameLength)],
|
||||||
[username dataUsingEncoding:NSUTF8StringEncoding],
|
[userName dataUsingEncoding:NSUTF8StringEncoding],
|
||||||
nil] N:MP_N r:MP_r p:MP_p];
|
nil] N:MP_N r:MP_r p:MP_p];
|
||||||
|
|
||||||
trc(@"User: %@, password: %@ derives to key ID: %@ (took %0.2fs)", username, password, [keyIDForKey(key) encodeHex], -[start timeIntervalSinceNow]);
|
MPKey *key = [self keyFromKeyData:keyData];
|
||||||
|
trc(@"User: %@, password: %@ derives to key ID: %@ (took %0.2fs)", userName, password, [key.keyID encodeHex], -[start timeIntervalSinceNow]);
|
||||||
|
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (MPKey *)keyFromKeyData:(NSData *)keyData {
|
||||||
|
|
||||||
NSData *subkeyForKey(NSData *key, NSUInteger subkeyLength) {
|
return [[MPKey alloc] initWithKeyData:keyData algorithm:self];
|
||||||
|
|
||||||
return [key subdataWithRange:NSMakeRange(0, MIN(subkeyLength, key.length))];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSData *)keyIDForKeyData:(NSData *)keyData {
|
||||||
|
|
||||||
NSData *keyIDForPassword(NSString *password, NSString *username) {
|
return [keyData hashWith:MP_hash];
|
||||||
|
|
||||||
return keyIDForKey(keyForPassword(password, username));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NSData *keyIDForKey(NSData *key) {
|
- (NSString *)nameOfType:(MPElementType)type {
|
||||||
|
|
||||||
return [key hashWith:MP_hash];
|
|
||||||
}
|
|
||||||
|
|
||||||
NSString *NSStringFromMPElementType(MPElementType type) {
|
|
||||||
|
|
||||||
if (!type)
|
if (!type)
|
||||||
return nil;
|
return nil;
|
||||||
@@ -77,13 +106,12 @@ NSString *NSStringFromMPElementType(MPElementType type) {
|
|||||||
|
|
||||||
case MPElementTypeStoredDevicePrivate:
|
case MPElementTypeStoredDevicePrivate:
|
||||||
return @"Device Private Password";
|
return @"Device Private Password";
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
Throw(@"Type not supported: %d", type);
|
Throw(@"Type not supported: %d", type);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
NSString *NSStringShortFromMPElementType(MPElementType type) {
|
- (NSString *)shortNameOfType:(MPElementType)type {
|
||||||
|
|
||||||
if (!type)
|
if (!type)
|
||||||
return nil;
|
return nil;
|
||||||
@@ -112,13 +140,17 @@ NSString *NSStringShortFromMPElementType(MPElementType type) {
|
|||||||
|
|
||||||
case MPElementTypeStoredDevicePrivate:
|
case MPElementTypeStoredDevicePrivate:
|
||||||
return @"Device";
|
return @"Device";
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
Throw(@"Type not supported: %d", type);
|
Throw(@"Type not supported: %d", type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *)classNameOfType:(MPElementType)type {
|
||||||
|
|
||||||
|
return NSStringFromClass([self classOfType:type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Class ClassFromMPElementType(MPElementType type) {
|
- (Class)classOfType:(MPElementType)type {
|
||||||
|
|
||||||
if (!type)
|
if (!type)
|
||||||
return nil;
|
return nil;
|
||||||
@@ -147,63 +179,56 @@ Class ClassFromMPElementType(MPElementType type) {
|
|||||||
|
|
||||||
case MPElementTypeStoredDevicePrivate:
|
case MPElementTypeStoredDevicePrivate:
|
||||||
return [MPElementStoredEntity class];
|
return [MPElementStoredEntity class];
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
Throw(@"Type not supported: %d", type);
|
Throw(@"Type not supported: %d", type);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
NSString *ClassNameFromMPElementType(MPElementType type) {
|
- (NSString *)generateContentForElement:(MPElementGeneratedEntity *)element usingKey:(MPKey *)key {
|
||||||
|
|
||||||
return NSStringFromClass(ClassFromMPElementType(type));
|
|
||||||
}
|
|
||||||
|
|
||||||
static NSDictionary *MPTypes_ciphers = nil;
|
static NSDictionary *MPTypes_ciphers = nil;
|
||||||
|
|
||||||
NSString *MPCalculateContent(MPElementType type, NSString *name, NSData *key, uint32_t counter) {
|
if (!element)
|
||||||
|
return nil;
|
||||||
|
|
||||||
if (!(type & MPElementTypeClassGenerated)) {
|
if (!(element.type & MPElementTypeClassGenerated)) {
|
||||||
err(@"Incorrect type (is not MPElementTypeClassGenerated): %d, for: %@", type, name);
|
err(@"Incorrect type (is not MPElementTypeClassGenerated): %@, for: %@", [self nameOfType:element.type], element.name);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
if (!name.length) {
|
if (!element.name.length) {
|
||||||
err(@"Missing name.");
|
err(@"Missing name.");
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
if (!key.length) {
|
if (!key.keyData.length) {
|
||||||
err(@"Missing key.");
|
err(@"Missing key.");
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
if (!counter)
|
|
||||||
// Counter unset, go into OTP mode.
|
|
||||||
// Get the UNIX timestamp of the start of the interval of 5 minutes that the current time is in.
|
|
||||||
counter = ((uint32_t)([[NSDate date] timeIntervalSince1970] / 300)) * 300;
|
|
||||||
|
|
||||||
if (MPTypes_ciphers == nil)
|
if (MPTypes_ciphers == nil)
|
||||||
MPTypes_ciphers = [NSDictionary dictionaryWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"ciphers"
|
MPTypes_ciphers = [NSDictionary dictionaryWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"ciphers"
|
||||||
withExtension:@"plist"]];
|
withExtension:@"plist"]];
|
||||||
|
|
||||||
// Determine the seed whose bytes will be used for calculating a password
|
// Determine the seed whose bytes will be used for calculating a password
|
||||||
uint32_t ncounter = htonl(counter), nnameLength = htonl(name.length);
|
uint32_t ncounter = htonl(element.counter), nnameLength = htonl(element.name.length);
|
||||||
NSData *counterBytes = [NSData dataWithBytes:&ncounter length:sizeof(ncounter)];
|
NSData *counterBytes = [NSData dataWithBytes:&ncounter length:sizeof(ncounter)];
|
||||||
NSData *nameLengthBytes = [NSData dataWithBytes:&nnameLength length:sizeof(nnameLength)];
|
NSData *nameLengthBytes = [NSData dataWithBytes:&nnameLength length:sizeof(nnameLength)];
|
||||||
trc(@"seed from: hmac-sha256(%@, 'com.lyndir.masterpassword' | %@ | %@ | %@)", [key encodeBase64], [nameLengthBytes encodeHex], name, [counterBytes encodeHex]);
|
trc(@"seed from: hmac-sha256(%@, 'com.lyndir.masterpassword' | %@ | %@ | %@)", [key.keyData encodeBase64], [nameLengthBytes encodeHex], element.name, [counterBytes encodeHex]);
|
||||||
NSData *seed = [[NSData dataByConcatenatingDatas:
|
NSData *seed = [[NSData dataByConcatenatingDatas:
|
||||||
[@"com.lyndir.masterpassword" dataUsingEncoding:NSUTF8StringEncoding],
|
[@"com.lyndir.masterpassword" dataUsingEncoding:NSUTF8StringEncoding],
|
||||||
nameLengthBytes,
|
nameLengthBytes,
|
||||||
[name dataUsingEncoding:NSUTF8StringEncoding],
|
[element.name dataUsingEncoding:NSUTF8StringEncoding],
|
||||||
counterBytes,
|
counterBytes,
|
||||||
nil]
|
nil]
|
||||||
hmacWith:PearlHashSHA256 key:key];
|
hmacWith:PearlHashSHA256 key:key.keyData];
|
||||||
trc(@"seed is: %@", [seed encodeBase64]);
|
trc(@"seed is: %@", [seed encodeBase64]);
|
||||||
const char *seedBytes = seed.bytes;
|
const char *seedBytes = seed.bytes;
|
||||||
|
|
||||||
// Determine the cipher from the first seed byte.
|
// Determine the cipher from the first seed byte.
|
||||||
assert([seed length]);
|
assert([seed length]);
|
||||||
NSArray *typeCiphers = [[MPTypes_ciphers valueForKey:ClassNameFromMPElementType(type)]
|
NSArray *typeCiphers = [[MPTypes_ciphers valueForKey:[self classNameOfType:element.type]]
|
||||||
valueForKey:NSStringFromMPElementType(type)];
|
valueForKey:[self nameOfType:element.type]];
|
||||||
NSString *cipher = [typeCiphers objectAtIndex:htons(seedBytes[0]) % [typeCiphers count]];
|
NSString *cipher = [typeCiphers objectAtIndex:htons(seedBytes[0]) % [typeCiphers count]];
|
||||||
trc(@"type %d, ciphers: %@, selected: %@", type, typeCiphers, cipher);
|
trc(@"type %@, ciphers: %@, selected: %@", [self nameOfType:element.type], typeCiphers, cipher);
|
||||||
|
|
||||||
// Encode the content, character by character, using subsequent seed bytes and the cipher.
|
// Encode the content, character by character, using subsequent seed bytes and the cipher.
|
||||||
assert([seed length] >= [cipher length] + 1);
|
assert([seed length] >= [cipher length] + 1);
|
||||||
@@ -221,3 +246,5 @@ NSString *MPCalculateContent(MPElementType type, NSString *name, NSData *key, ui
|
|||||||
|
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
22
MasterPassword/MPAlgorithmV1.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/**
|
||||||
|
* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com)
|
||||||
|
*
|
||||||
|
* See the enclosed file LICENSE for license information (LGPLv3). If you did
|
||||||
|
* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*
|
||||||
|
* @author Maarten Billemont <lhunath@lyndir.com>
|
||||||
|
* @license http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
//
|
||||||
|
// MPAlgorithmV1
|
||||||
|
//
|
||||||
|
// Created by Maarten Billemont on 17/07/12.
|
||||||
|
// Copyright 2012 lhunath (Maarten Billemont). All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MPAlgorithmV0.h"
|
||||||
|
|
||||||
|
|
||||||
|
@interface MPAlgorithmV1 : MPAlgorithmV0
|
||||||
|
@end
|
||||||
113
MasterPassword/MPAlgorithmV1.m
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
/**
|
||||||
|
* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com)
|
||||||
|
*
|
||||||
|
* See the enclosed file LICENSE for license information (LGPLv3). If you did
|
||||||
|
* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*
|
||||||
|
* @author Maarten Billemont <lhunath@lyndir.com>
|
||||||
|
* @license http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
//
|
||||||
|
// MPAlgorithmV1
|
||||||
|
//
|
||||||
|
// Created by Maarten Billemont on 17/07/12.
|
||||||
|
// Copyright 2012 lhunath (Maarten Billemont). All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MPAlgorithmV1.h"
|
||||||
|
#import "MPEntities.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation MPAlgorithmV1
|
||||||
|
|
||||||
|
- (NSUInteger)version {
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)migrateElement:(MPElementEntity *)element explicit:(BOOL)explicit {
|
||||||
|
|
||||||
|
if (element.version != [self version] - 1)
|
||||||
|
// Only migrate from previous version.
|
||||||
|
return NO;
|
||||||
|
|
||||||
|
if (!explicit) {
|
||||||
|
if (element.type & MPElementTypeClassGenerated) {
|
||||||
|
// This migration requires explicit permission for types of the generated class.
|
||||||
|
element.requiresExplicitMigration = YES;
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply migration.
|
||||||
|
element.requiresExplicitMigration = NO;
|
||||||
|
element.version = [self version];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)generateContentForElement:(MPElementGeneratedEntity *)element usingKey:(MPKey *)key {
|
||||||
|
|
||||||
|
static NSDictionary *MPTypes_ciphers = nil;
|
||||||
|
|
||||||
|
if (!element)
|
||||||
|
return nil;
|
||||||
|
|
||||||
|
if (!(element.type & MPElementTypeClassGenerated)) {
|
||||||
|
err(@"Incorrect type (is not MPElementTypeClassGenerated): %@, for: %@", [self nameOfType:element.type], element.name);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
if (!element.name.length) {
|
||||||
|
err(@"Missing name.");
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
if (!key.keyData.length) {
|
||||||
|
err(@"Missing key.");
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (MPTypes_ciphers == nil)
|
||||||
|
MPTypes_ciphers = [NSDictionary dictionaryWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"ciphers"
|
||||||
|
withExtension:@"plist"]];
|
||||||
|
|
||||||
|
// Determine the seed whose bytes will be used for calculating a password
|
||||||
|
uint32_t ncounter = htonl(element.counter), nnameLength = htonl(element.name.length);
|
||||||
|
NSData *counterBytes = [NSData dataWithBytes:&ncounter length:sizeof(ncounter)];
|
||||||
|
NSData *nameLengthBytes = [NSData dataWithBytes:&nnameLength length:sizeof(nnameLength)];
|
||||||
|
trc(@"seed from: hmac-sha256(%@, 'com.lyndir.masterpassword' | %@ | %@ | %@)", [key.keyData encodeBase64], [nameLengthBytes encodeHex], element.name, [counterBytes encodeHex]);
|
||||||
|
NSData *seed = [[NSData dataByConcatenatingDatas:
|
||||||
|
[@"com.lyndir.masterpassword" dataUsingEncoding:NSUTF8StringEncoding],
|
||||||
|
nameLengthBytes,
|
||||||
|
[element.name dataUsingEncoding:NSUTF8StringEncoding],
|
||||||
|
counterBytes,
|
||||||
|
nil]
|
||||||
|
hmacWith:PearlHashSHA256 key:key.keyData];
|
||||||
|
trc(@"seed is: %@", [seed encodeBase64]);
|
||||||
|
const unsigned char *seedBytes = seed.bytes;
|
||||||
|
|
||||||
|
// Determine the cipher from the first seed byte.
|
||||||
|
assert([seed length]);
|
||||||
|
NSArray *typeCiphers = [[MPTypes_ciphers valueForKey:[self classNameOfType:element.type]]
|
||||||
|
valueForKey:[self nameOfType:element.type]];
|
||||||
|
NSString *cipher = [typeCiphers objectAtIndex:seedBytes[0] % [typeCiphers count]];
|
||||||
|
trc(@"type %@, ciphers: %@, selected: %@", [self nameOfType:element.type], typeCiphers, cipher);
|
||||||
|
|
||||||
|
// Encode the content, character by character, using subsequent seed bytes and the cipher.
|
||||||
|
assert([seed length] >= [cipher length] + 1);
|
||||||
|
NSMutableString *content = [NSMutableString stringWithCapacity:[cipher length]];
|
||||||
|
for (NSUInteger c = 0; c < [cipher length]; ++c) {
|
||||||
|
uint16_t keyByte = seedBytes[c + 1];
|
||||||
|
NSString *cipherClass = [cipher substringWithRange:NSMakeRange(c, 1)];
|
||||||
|
NSString *cipherClassCharacters = [[MPTypes_ciphers valueForKey:@"MPCharacterClasses"] valueForKey:cipherClass];
|
||||||
|
NSString *character = [cipherClassCharacters substringWithRange:NSMakeRange(keyByte % [cipherClassCharacters length],
|
||||||
|
1)];
|
||||||
|
|
||||||
|
trc(@"class %@ has characters: %@, index: %u, selected: %@", cipherClass, cipherClassCharacters, keyByte, character);
|
||||||
|
[content appendString:character];
|
||||||
|
}
|
||||||
|
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -23,10 +23,10 @@ static NSDictionary *keyQuery(MPUserEntity *user) {
|
|||||||
matches:nil];
|
matches:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSData *)loadSavedKeyFor:(MPUserEntity *)user {
|
- (MPKey *)loadSavedKeyFor:(MPUserEntity *)user {
|
||||||
|
|
||||||
NSData *key = [PearlKeyChain dataOfItemForQuery:keyQuery(user)];
|
NSData *keyData = [PearlKeyChain dataOfItemForQuery:keyQuery(user)];
|
||||||
if (key)
|
if (keyData)
|
||||||
inf(@"Found key in keychain for: %@", user.userID);
|
inf(@"Found key in keychain for: %@", user.userID);
|
||||||
|
|
||||||
else {
|
else {
|
||||||
@@ -34,22 +34,22 @@ static NSDictionary *keyQuery(MPUserEntity *user) {
|
|||||||
inf(@"No key found in keychain for: %@", user.userID);
|
inf(@"No key found in keychain for: %@", user.userID);
|
||||||
}
|
}
|
||||||
|
|
||||||
return key;
|
return [MPAlgorithmDefault keyFromKeyData:keyData];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)storeSavedKeyFor:(MPUserEntity *)user {
|
- (void)storeSavedKeyFor:(MPUserEntity *)user {
|
||||||
|
|
||||||
if (user.saveKey) {
|
if (user.saveKey) {
|
||||||
NSData *existingKey = [PearlKeyChain dataOfItemForQuery:keyQuery(user)];
|
NSData *existingKeyData = [PearlKeyChain dataOfItemForQuery:keyQuery(user)];
|
||||||
|
|
||||||
if (![existingKey isEqualToData:self.key]) {
|
if (![existingKeyData isEqualToData:self.key.keyData]) {
|
||||||
inf(@"Saving key in keychain for: %@", user.userID);
|
inf(@"Saving key in keychain for: %@", user.userID);
|
||||||
|
|
||||||
[PearlKeyChain addOrUpdateItemForQuery:keyQuery(user)
|
[PearlKeyChain addOrUpdateItemForQuery:keyQuery(user)
|
||||||
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
self.key, (__bridge id)kSecValueData,
|
self.key.keyData, (__bridge id)kSecValueData,
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
kSecAttrAccessibleWhenUnlockedThisDeviceOnly, (__bridge id)kSecAttrAccessible,
|
(__bridge id)kSecAttrAccessibleWhenUnlockedThisDeviceOnly, (__bridge id)kSecAttrAccessible,
|
||||||
#endif
|
#endif
|
||||||
nil]];
|
nil]];
|
||||||
}
|
}
|
||||||
@@ -87,13 +87,13 @@ static NSDictionary *keyQuery(MPUserEntity *user) {
|
|||||||
|
|
||||||
- (BOOL)signInAsUser:(MPUserEntity *)user usingMasterPassword:(NSString *)password {
|
- (BOOL)signInAsUser:(MPUserEntity *)user usingMasterPassword:(NSString *)password {
|
||||||
|
|
||||||
NSData *tryKey = nil;
|
MPKey *tryKey = nil;
|
||||||
|
|
||||||
// Method 1: When the user has no keyID set, set a new key from the given master password.
|
// Method 1: When the user has no keyID set, set a new key from the given master password.
|
||||||
if (!user.keyID) {
|
if (!user.keyID) {
|
||||||
if ([password length])
|
if ([password length])
|
||||||
if ((tryKey = keyForPassword(password, user.name))) {
|
if ((tryKey = [MPAlgorithmDefault keyForPassword:password ofUserNamed:user.name])) {
|
||||||
user.keyID = keyIDForKey(tryKey);
|
user.keyID = tryKey.keyID;
|
||||||
[[MPAppDelegate_Shared get] saveContext];
|
[[MPAppDelegate_Shared get] saveContext];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ static NSDictionary *keyQuery(MPUserEntity *user) {
|
|||||||
if (!tryKey) {
|
if (!tryKey) {
|
||||||
// Key should be saved in keychain. Load it.
|
// Key should be saved in keychain. Load it.
|
||||||
if ((tryKey = [self loadSavedKeyFor:user]))
|
if ((tryKey = [self loadSavedKeyFor:user]))
|
||||||
if (![user.keyID isEqual:keyIDForKey(tryKey)]) {
|
if (![user.keyID isEqual:tryKey.keyID]) {
|
||||||
// Loaded password doesn't match user's keyID. Forget saved password: it is incorrect.
|
// Loaded password doesn't match user's keyID. Forget saved password: it is incorrect.
|
||||||
inf(@"Saved password doesn't match keyID for: %@", user.userID);
|
inf(@"Saved password doesn't match keyID for: %@", user.userID);
|
||||||
|
|
||||||
@@ -119,8 +119,8 @@ static NSDictionary *keyQuery(MPUserEntity *user) {
|
|||||||
// Method 3: Check the given master password string.
|
// Method 3: Check the given master password string.
|
||||||
if (!tryKey) {
|
if (!tryKey) {
|
||||||
if ([password length])
|
if ([password length])
|
||||||
if ((tryKey = keyForPassword(password, user.name)))
|
if ((tryKey = [MPAlgorithmDefault keyForPassword:password ofUserNamed:user.name]))
|
||||||
if (![user.keyID isEqual:keyIDForKey(tryKey)]) {
|
if (![user.keyID isEqual:tryKey.keyID]) {
|
||||||
inf(@"Key derived from password doesn't match keyID for: %@", user.userID);
|
inf(@"Key derived from password doesn't match keyID for: %@", user.userID);
|
||||||
|
|
||||||
tryKey = nil;
|
tryKey = nil;
|
||||||
@@ -142,7 +142,7 @@ static NSDictionary *keyQuery(MPUserEntity *user) {
|
|||||||
}
|
}
|
||||||
inf(@"Logged in: %@", user.userID);
|
inf(@"Logged in: %@", user.userID);
|
||||||
|
|
||||||
if (![self.key isEqualToData:tryKey]) {
|
if (![self.key isEqualToKey:tryKey]) {
|
||||||
self.key = tryKey;
|
self.key = tryKey;
|
||||||
[self storeSavedKeyFor:user];
|
[self storeSavedKeyFor:user];
|
||||||
}
|
}
|
||||||
@@ -160,6 +160,7 @@ static NSDictionary *keyQuery(MPUserEntity *user) {
|
|||||||
|
|
||||||
user.lastUsed = [NSDate date];
|
user.lastUsed = [NSDate date];
|
||||||
self.activeUser = user;
|
self.activeUser = user;
|
||||||
|
self.activeUser.requiresExplicitMigration = NO;
|
||||||
[[MPAppDelegate_Shared get] saveContext];
|
[[MPAppDelegate_Shared get] saveContext];
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPNotificationSignedIn object:self];
|
[[NSNotificationCenter defaultCenter] postNotificationName:MPNotificationSignedIn object:self];
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
@property (strong, nonatomic) MPUserEntity *activeUser;
|
@property (strong, nonatomic) MPUserEntity *activeUser;
|
||||||
@property (strong, nonatomic) NSData *key;
|
@property (strong, nonatomic) MPKey *key;
|
||||||
|
|
||||||
+ (MPAppDelegate_Shared *)get;
|
+ (MPAppDelegate_Shared *)get;
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ typedef enum {
|
|||||||
|
|
||||||
@interface MPAppDelegate_Shared (Store)<UbiquityStoreManagerDelegate>
|
@interface MPAppDelegate_Shared (Store)<UbiquityStoreManagerDelegate>
|
||||||
|
|
||||||
+ (NSManagedObjectContext *)managedObjectContext;
|
+ (NSManagedObjectContext *)managedObjectContextIfReady;
|
||||||
+ (NSManagedObjectModel *)managedObjectModel;
|
+ (NSManagedObjectModel *)managedObjectModel;
|
||||||
- (NSManagedObjectContext *)managedObjectContext;
|
- (NSManagedObjectContext *)managedObjectContextIfReady;
|
||||||
- (NSManagedObjectModel *)managedObjectModel;
|
- (NSManagedObjectModel *)managedObjectModel;
|
||||||
|
|
||||||
- (UbiquityStoreManager *)storeManager;
|
- (UbiquityStoreManager *)storeManager;
|
||||||
|
|||||||
@@ -13,9 +13,9 @@
|
|||||||
|
|
||||||
#pragma mark - Core Data setup
|
#pragma mark - Core Data setup
|
||||||
|
|
||||||
+ (NSManagedObjectContext *)managedObjectContext {
|
+ (NSManagedObjectContext *)managedObjectContextIfReady {
|
||||||
|
|
||||||
return [[self get] managedObjectContext];
|
return [[self get] managedObjectContextIfReady];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSManagedObjectModel *)managedObjectModel {
|
+ (NSManagedObjectModel *)managedObjectModel {
|
||||||
@@ -33,7 +33,10 @@
|
|||||||
return managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
|
return managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSManagedObjectContext *)managedObjectContext {
|
- (NSManagedObjectContext *)managedObjectContextIfReady {
|
||||||
|
|
||||||
|
if (![self storeManager].isReady)
|
||||||
|
return nil;
|
||||||
|
|
||||||
static NSManagedObjectContext *managedObjectContext = nil;
|
static NSManagedObjectContext *managedObjectContext = nil;
|
||||||
if (managedObjectContext)
|
if (managedObjectContext)
|
||||||
@@ -41,25 +44,14 @@
|
|||||||
|
|
||||||
managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
|
managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
|
||||||
[managedObjectContext performBlockAndWait:^{
|
[managedObjectContext performBlockAndWait:^{
|
||||||
managedObjectContext.persistentStoreCoordinator = [self persistentStoreCoordinator];
|
|
||||||
managedObjectContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy;
|
managedObjectContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy;
|
||||||
|
managedObjectContext.persistentStoreCoordinator = [self storeManager].persistentStoreCoordinator;
|
||||||
|
managedObjectContext.undoManager = [NSUndoManager new];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
return managedObjectContext;
|
return managedObjectContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
|
|
||||||
|
|
||||||
// Start loading the store.
|
|
||||||
[self storeManager];
|
|
||||||
|
|
||||||
// Wait until the storeManager is ready.
|
|
||||||
while (![self storeManager].isReady)
|
|
||||||
[NSThread sleepForTimeInterval:0.1];
|
|
||||||
|
|
||||||
return [self storeManager].persistentStoreCoordinator;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (UbiquityStoreManager *)storeManager {
|
- (UbiquityStoreManager *)storeManager {
|
||||||
|
|
||||||
static UbiquityStoreManager *storeManager = nil;
|
static UbiquityStoreManager *storeManager = nil;
|
||||||
@@ -112,10 +104,10 @@
|
|||||||
|
|
||||||
- (void)saveContext {
|
- (void)saveContext {
|
||||||
|
|
||||||
[self.managedObjectContext performBlock:^{
|
[self.managedObjectContextIfReady performBlock:^{
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
if ([self.managedObjectContext hasChanges])
|
if ([self.managedObjectContextIfReady hasChanges])
|
||||||
if (![self.managedObjectContext save:&error])
|
if (![self.managedObjectContextIfReady save:&error])
|
||||||
err(@"While saving context: %@", error);
|
err(@"While saving context: %@", error);
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
@@ -124,7 +116,7 @@
|
|||||||
|
|
||||||
- (NSManagedObjectContext *)managedObjectContextForUbiquityStoreManager:(UbiquityStoreManager *)usm {
|
- (NSManagedObjectContext *)managedObjectContextForUbiquityStoreManager:(UbiquityStoreManager *)usm {
|
||||||
|
|
||||||
return self.managedObjectContext;
|
return self.managedObjectContextIfReady;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)ubiquityStoreManager:(UbiquityStoreManager *)manager log:(NSString *)message {
|
- (void)ubiquityStoreManager:(UbiquityStoreManager *)manager log:(NSString *)message {
|
||||||
@@ -142,7 +134,8 @@
|
|||||||
[TestFlight passCheckpoint:iCloudEnabled? MPCheckpointCloudEnabled: MPCheckpointCloudDisabled];
|
[TestFlight passCheckpoint:iCloudEnabled? MPCheckpointCloudEnabled: MPCheckpointCloudDisabled];
|
||||||
#endif
|
#endif
|
||||||
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointCloud
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointCloud
|
||||||
attributes:[NSDictionary dictionaryWithObject:iCloudEnabled? @"YES": @"NO" forKey:@"enabled"]];
|
attributes:[NSDictionary dictionaryWithObject:iCloudEnabled? @"YES": @"NO"
|
||||||
|
forKey:@"enabled"]];
|
||||||
|
|
||||||
[MPConfig get].iCloud = [NSNumber numberWithBool:iCloudEnabled];
|
[MPConfig get].iCloud = [NSNumber numberWithBool:iCloudEnabled];
|
||||||
}
|
}
|
||||||
@@ -168,13 +161,11 @@
|
|||||||
#ifdef TESTFLIGHT_SDK_VERSION
|
#ifdef TESTFLIGHT_SDK_VERSION
|
||||||
[TestFlight passCheckpoint:MPCheckpointLocalStoreIncompatible];
|
[TestFlight passCheckpoint:MPCheckpointLocalStoreIncompatible];
|
||||||
#endif
|
#endif
|
||||||
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointLocalStoreIncompatible
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointLocalStoreIncompatible attributes:nil];
|
||||||
attributes:nil];
|
|
||||||
manager.hardResetEnabled = YES;
|
manager.hardResetEnabled = YES;
|
||||||
[manager hardResetLocalStorage];
|
[manager hardResetLocalStorage];
|
||||||
|
|
||||||
[NSException raise:NSGenericException format:@"Local store was reset, application must be restarted to use it."];
|
Throw(@"Local store was reset, application must be restarted to use it.");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
case UbiquityStoreManagerErrorCauseOpenCloudStore: {
|
case UbiquityStoreManagerErrorCauseOpenCloudStore: {
|
||||||
wrn(@"iCloud store could not be opened, resetting it.");
|
wrn(@"iCloud store could not be opened, resetting it.");
|
||||||
@@ -182,8 +173,7 @@
|
|||||||
#ifdef TESTFLIGHT_SDK_VERSION
|
#ifdef TESTFLIGHT_SDK_VERSION
|
||||||
[TestFlight passCheckpoint:MPCheckpointCloudStoreIncompatible];
|
[TestFlight passCheckpoint:MPCheckpointCloudStoreIncompatible];
|
||||||
#endif
|
#endif
|
||||||
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointCloudStoreIncompatible
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointCloudStoreIncompatible attributes:nil];
|
||||||
attributes:nil];
|
|
||||||
manager.hardResetEnabled = YES;
|
manager.hardResetEnabled = YES;
|
||||||
[manager hardResetCloudStorage];
|
[manager hardResetCloudStorage];
|
||||||
break;
|
break;
|
||||||
@@ -199,17 +189,15 @@
|
|||||||
inf(@"Importing sites.");
|
inf(@"Importing sites.");
|
||||||
|
|
||||||
static NSRegularExpression *headerPattern, *sitePattern;
|
static NSRegularExpression *headerPattern, *sitePattern;
|
||||||
__autoreleasing NSError *error;
|
__block NSError *error = nil;
|
||||||
if (!headerPattern) {
|
if (!headerPattern) {
|
||||||
headerPattern = [[NSRegularExpression alloc]
|
headerPattern = [[NSRegularExpression alloc] initWithPattern:@"^#[[:space:]]*([^:]+): (.*)"
|
||||||
initWithPattern:@"^#[[:space:]]*([^:]+): (.*)"
|
|
||||||
options:0 error:&error];
|
options:0 error:&error];
|
||||||
if (error)
|
if (error)
|
||||||
err(@"Error loading the header pattern: %@", error);
|
err(@"Error loading the header pattern: %@", error);
|
||||||
}
|
}
|
||||||
if (!sitePattern) {
|
if (!sitePattern) {
|
||||||
sitePattern = [[NSRegularExpression alloc]
|
sitePattern = [[NSRegularExpression alloc] initWithPattern:@"^([^[:space:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:digit:]]+)(:[[:digit:]]+)?[[:space:]]+([^\t]+)\t(.*)"
|
||||||
initWithPattern:@"^([^[:space:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([^\t]+)\t(.*)"
|
|
||||||
options:0 error:&error];
|
options:0 error:&error];
|
||||||
if (error)
|
if (error)
|
||||||
err(@"Error loading the site pattern: %@", error);
|
err(@"Error loading the site pattern: %@", error);
|
||||||
@@ -217,9 +205,9 @@
|
|||||||
if (!headerPattern || !sitePattern)
|
if (!headerPattern || !sitePattern)
|
||||||
return MPImportResultInternalError;
|
return MPImportResultInternalError;
|
||||||
|
|
||||||
NSData *key = nil;
|
MPKey *key = nil;
|
||||||
NSString *keyIDHex = nil, *userName = nil;
|
__block MPUserEntity *user = nil;
|
||||||
MPUserEntity *user = nil;
|
NSString *bundleVersion = nil, *keyIDHex = nil, *userName = nil;
|
||||||
BOOL headerStarted = NO, headerEnded = NO, clearText = NO;
|
BOOL headerStarted = NO, headerEnded = NO, clearText = NO;
|
||||||
NSArray *importedSiteLines = [importedSitesString componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];
|
NSArray *importedSiteLines = [importedSitesString componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];
|
||||||
NSMutableSet *elementsToDelete = [NSMutableSet set];
|
NSMutableSet *elementsToDelete = [NSMutableSet set];
|
||||||
@@ -251,16 +239,29 @@
|
|||||||
NSString *headerValue = [importedSiteLine substringWithRange:[headerElements rangeAtIndex:2]];
|
NSString *headerValue = [importedSiteLine substringWithRange:[headerElements rangeAtIndex:2]];
|
||||||
if ([headerName isEqualToString:@"User Name"]) {
|
if ([headerName isEqualToString:@"User Name"]) {
|
||||||
userName = headerValue;
|
userName = headerValue;
|
||||||
key = keyForPassword(password, userName);
|
|
||||||
|
|
||||||
NSFetchRequest *userFetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([MPUserEntity class])];
|
NSFetchRequest *userFetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([MPUserEntity class])];
|
||||||
userFetchRequest.predicate = [NSPredicate predicateWithFormat:@"name == %@", userName];
|
userFetchRequest.predicate = [NSPredicate predicateWithFormat:@"name == %@", userName];
|
||||||
user = [[self.managedObjectContext executeFetchRequest:fetchRequest error:&error] lastObject];
|
__block NSArray *users = nil;
|
||||||
|
[self.managedObjectContextIfReady performBlockAndWait:^{
|
||||||
|
users = [self.managedObjectContextIfReady executeFetchRequest:userFetchRequest error:&error];
|
||||||
|
}];
|
||||||
|
if (!users) {
|
||||||
|
err(@"While looking for user: %@, error: %@", userName, error);
|
||||||
|
return MPImportResultInternalError;
|
||||||
}
|
}
|
||||||
if ([headerName isEqualToString:@"Key ID"]) {
|
if ([users count] > 1) {
|
||||||
if (![(keyIDHex = headerValue) isEqualToString:[keyIDForKey(key) encodeHex]])
|
err(@"While looking for user: %@, found more than one: %u", userName, [users count]);
|
||||||
return MPImportResultInvalidPassword;
|
return MPImportResultInternalError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
user = [users count]? [users lastObject]: nil;
|
||||||
|
dbg(@"Found user: %@", [user debugDescription]);
|
||||||
|
}
|
||||||
|
if ([headerName isEqualToString:@"Key ID"])
|
||||||
|
keyIDHex = headerValue;
|
||||||
|
if ([headerName isEqualToString:@"Version"])
|
||||||
|
bundleVersion = headerValue;
|
||||||
if ([headerName isEqualToString:@"Passwords"]) {
|
if ([headerName isEqualToString:@"Passwords"]) {
|
||||||
if ([headerValue isEqualToString:@"VISIBLE"])
|
if ([headerValue isEqualToString:@"VISIBLE"])
|
||||||
clearText = YES;
|
clearText = YES;
|
||||||
@@ -272,6 +273,11 @@
|
|||||||
continue;
|
continue;
|
||||||
if (!keyIDHex || ![userName length])
|
if (!keyIDHex || ![userName length])
|
||||||
return MPImportResultMalformedInput;
|
return MPImportResultMalformedInput;
|
||||||
|
if (!key) {
|
||||||
|
key = [MPAlgorithmDefaultForBundleVersion(bundleVersion) keyForPassword:password ofUserNamed:userName];
|
||||||
|
if (![keyIDHex isEqualToString:[key.keyID encodeHex]])
|
||||||
|
return MPImportResultInvalidPassword;
|
||||||
|
}
|
||||||
if (![importedSiteLine length])
|
if (![importedSiteLine length])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -285,22 +291,26 @@
|
|||||||
NSString *lastUsed = [importedSiteLine substringWithRange:[siteElements rangeAtIndex:1]];
|
NSString *lastUsed = [importedSiteLine substringWithRange:[siteElements rangeAtIndex:1]];
|
||||||
NSString *uses = [importedSiteLine substringWithRange:[siteElements rangeAtIndex:2]];
|
NSString *uses = [importedSiteLine substringWithRange:[siteElements rangeAtIndex:2]];
|
||||||
NSString *type = [importedSiteLine substringWithRange:[siteElements rangeAtIndex:3]];
|
NSString *type = [importedSiteLine substringWithRange:[siteElements rangeAtIndex:3]];
|
||||||
NSString *name = [importedSiteLine substringWithRange:[siteElements rangeAtIndex:4]];
|
NSString *version = [importedSiteLine substringWithRange:[siteElements rangeAtIndex:4]];
|
||||||
NSString *exportContent = [importedSiteLine substringWithRange:[siteElements rangeAtIndex:5]];
|
NSString *name = [importedSiteLine substringWithRange:[siteElements rangeAtIndex:5]];
|
||||||
|
NSString *exportContent = [importedSiteLine substringWithRange:[siteElements rangeAtIndex:6]];
|
||||||
|
|
||||||
// Find existing site.
|
// Find existing site.
|
||||||
if (user) {
|
if (user) {
|
||||||
fetchRequest.predicate = [NSPredicate predicateWithFormat:@"name == %@ AND user == %@", name, user];
|
fetchRequest.predicate = [NSPredicate predicateWithFormat:@"name == %@ AND user == %@", name, user];
|
||||||
NSArray *existingSites = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error];
|
__block NSArray *existingSites = nil;
|
||||||
if (error)
|
[self.managedObjectContextIfReady performBlockAndWait:^{
|
||||||
err(@"Couldn't search existing sites: %@", error);
|
existingSites = [self.managedObjectContextIfReady executeFetchRequest:fetchRequest error:&error];
|
||||||
|
}];
|
||||||
if (!existingSites) {
|
if (!existingSites) {
|
||||||
err(@"Lookup of existing sites failed for site: %@, user: %@", name, user.userID);
|
err(@"Lookup of existing sites failed for site: %@, user: %@, error: %@", name, user.userID, error);
|
||||||
return MPImportResultInternalError;
|
return MPImportResultInternalError;
|
||||||
}
|
} else
|
||||||
|
if (existingSites.count)
|
||||||
|
dbg(@"Existing sites: %@", existingSites);
|
||||||
|
|
||||||
[elementsToDelete addObjectsFromArray:existingSites];
|
[elementsToDelete addObjectsFromArray:existingSites];
|
||||||
[importedSiteElements addObject:[NSArray arrayWithObjects:lastUsed, uses, type, name, exportContent, nil]];
|
[importedSiteElements addObject:[NSArray arrayWithObjects:lastUsed, uses, type, version, name, exportContent, nil]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,52 +323,75 @@
|
|||||||
return MPImportResultCancelled;
|
return MPImportResultCancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL success = NO;
|
||||||
|
[self.managedObjectContextIfReady.undoManager beginUndoGrouping];
|
||||||
|
@try {
|
||||||
|
|
||||||
// Delete existing sites.
|
// Delete existing sites.
|
||||||
|
if (elementsToDelete.count)
|
||||||
|
[self.managedObjectContextIfReady performBlockAndWait:^{
|
||||||
[elementsToDelete enumerateObjectsUsingBlock:^(id obj, BOOL *stop) {
|
[elementsToDelete enumerateObjectsUsingBlock:^(id obj, BOOL *stop) {
|
||||||
inf(@"Deleting site: %@, it will be replaced by an imported site.", [obj name]);
|
inf(@"Deleting site: %@, it will be replaced by an imported site.", [obj name]);
|
||||||
[self.managedObjectContext deleteObject:obj];
|
dbg(@"Deleted Element: %@", [obj debugDescription]);
|
||||||
|
[self.managedObjectContextIfReady deleteObject:obj];
|
||||||
|
}];
|
||||||
}];
|
}];
|
||||||
[self saveContext];
|
|
||||||
|
|
||||||
// Import new sites.
|
// Import new sites.
|
||||||
if (!user) {
|
if (!user) {
|
||||||
|
[self.managedObjectContextIfReady performBlockAndWait:^{
|
||||||
user = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([MPUserEntity class])
|
user = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([MPUserEntity class])
|
||||||
inManagedObjectContext:self.managedObjectContext];
|
inManagedObjectContext:self.managedObjectContextIfReady];
|
||||||
user.name = userName;
|
user.name = userName;
|
||||||
user.keyID = [keyIDHex decodeHex];
|
user.keyID = [keyIDHex decodeHex];
|
||||||
|
}];
|
||||||
|
dbg(@"Created User: %@", [user debugDescription]);
|
||||||
}
|
}
|
||||||
for (NSArray *siteElements in importedSiteElements) {
|
for (NSArray *siteElements in importedSiteElements) {
|
||||||
NSDate *lastUsed = [[NSDateFormatter rfc3339DateFormatter] dateFromString:[siteElements objectAtIndex:0]];
|
NSDate *lastUsed = [[NSDateFormatter rfc3339DateFormatter] dateFromString:[siteElements objectAtIndex:0]];
|
||||||
NSUInteger uses = (unsigned)[[siteElements objectAtIndex:1] integerValue];
|
NSUInteger uses = (unsigned)[[siteElements objectAtIndex:1] integerValue];
|
||||||
MPElementType type = (MPElementType)[[siteElements objectAtIndex:2] integerValue];
|
MPElementType type = (MPElementType)[[siteElements objectAtIndex:2] integerValue];
|
||||||
NSString *name = [siteElements objectAtIndex:3];
|
NSUInteger version = (unsigned)[[siteElements objectAtIndex:3] integerValue];
|
||||||
NSString *exportContent = [siteElements objectAtIndex:4];
|
NSString *name = [siteElements objectAtIndex:4];
|
||||||
|
NSString *exportContent = [siteElements objectAtIndex:5];
|
||||||
|
|
||||||
// Create new site.
|
// Create new site.
|
||||||
MPElementEntity *element = [NSEntityDescription insertNewObjectForEntityForName:ClassNameFromMPElementType(type)
|
[self.managedObjectContextIfReady performBlockAndWait:^{
|
||||||
inManagedObjectContext:self.managedObjectContext];
|
MPElementEntity *element = [NSEntityDescription insertNewObjectForEntityForName:[key.algorithm classNameOfType:type]
|
||||||
|
inManagedObjectContext:self.managedObjectContextIfReady];
|
||||||
element.name = name;
|
element.name = name;
|
||||||
element.user = user;
|
element.user = user;
|
||||||
element.type = type;
|
element.type = type;
|
||||||
element.uses = uses;
|
element.uses = uses;
|
||||||
element.lastUsed = lastUsed;
|
element.lastUsed = lastUsed;
|
||||||
if ([exportContent length])
|
element.version = version;
|
||||||
|
if ([exportContent length]) {
|
||||||
if (clearText)
|
if (clearText)
|
||||||
[element importClearTextContent:exportContent usingKey:key];
|
[element importClearTextContent:exportContent usingKey:key];
|
||||||
else
|
else
|
||||||
[element importProtectedContent:exportContent];
|
[element importProtectedContent:exportContent];
|
||||||
}
|
}
|
||||||
[self saveContext];
|
dbg(@"Created Element: %@", [element debugDescription]);
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
[self saveContext];
|
||||||
|
success = YES;
|
||||||
inf(@"Import completed successfully.");
|
inf(@"Import completed successfully.");
|
||||||
#ifdef TESTFLIGHT_SDK_VERSION
|
#ifdef TESTFLIGHT_SDK_VERSION
|
||||||
[TestFlight passCheckpoint:MPCheckpointSitesImported];
|
[TestFlight passCheckpoint:MPCheckpointSitesImported];
|
||||||
#endif
|
#endif
|
||||||
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointSitesImported
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointSitesImported attributes:nil];
|
||||||
attributes:nil];
|
|
||||||
|
|
||||||
return MPImportResultSuccess;
|
return MPImportResultSuccess;
|
||||||
}
|
}
|
||||||
|
@finally {
|
||||||
|
[self.managedObjectContextIfReady.undoManager endUndoGrouping];
|
||||||
|
|
||||||
|
if (!success)
|
||||||
|
[self.managedObjectContextIfReady.undoManager undoNestedGroup];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (NSString *)exportSitesShowingPasswords:(BOOL)showPasswords {
|
- (NSString *)exportSitesShowingPasswords:(BOOL)showPasswords {
|
||||||
|
|
||||||
@@ -391,6 +424,7 @@
|
|||||||
NSDate *lastUsed = element.lastUsed;
|
NSDate *lastUsed = element.lastUsed;
|
||||||
NSUInteger uses = element.uses;
|
NSUInteger uses = element.uses;
|
||||||
MPElementType type = element.type;
|
MPElementType type = element.type;
|
||||||
|
NSUInteger version = element.version;
|
||||||
NSString *name = element.name;
|
NSString *name = element.name;
|
||||||
NSString *content = nil;
|
NSString *content = nil;
|
||||||
|
|
||||||
@@ -403,8 +437,9 @@
|
|||||||
content = element.exportContent;
|
content = element.exportContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
[export appendFormat:@"%@ %8d %8d %20s\t%@\n",
|
[export appendFormat:@"%@ %8d %8s %20s\t%@\n",
|
||||||
[[NSDateFormatter rfc3339DateFormatter] stringFromDate:lastUsed], uses, type, [name cStringUsingEncoding:NSUTF8StringEncoding], content
|
[[NSDateFormatter rfc3339DateFormatter] stringFromDate:lastUsed], uses,
|
||||||
|
[PearlString(@"%u:%u", type, version) UTF8String], [name UTF8String], content
|
||||||
? content: @""];
|
? content: @""];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// MPElementEntity.h
|
// MPElementEntity.h
|
||||||
// MasterPassword-iOS
|
// MasterPassword-iOS
|
||||||
//
|
//
|
||||||
// Created by Maarten Billemont on 11/06/12.
|
// Created by Maarten Billemont on 17/07/12.
|
||||||
// Copyright (c) 2012 Lyndir. All rights reserved.
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
@@ -16,8 +16,11 @@
|
|||||||
@property (nonatomic, retain) id content;
|
@property (nonatomic, retain) id content;
|
||||||
@property (nonatomic, retain) NSDate * lastUsed;
|
@property (nonatomic, retain) NSDate * lastUsed;
|
||||||
@property (nonatomic, retain) NSString * name;
|
@property (nonatomic, retain) NSString * name;
|
||||||
|
@property (nonatomic, retain) NSNumber * requiresExplicitMigration_;
|
||||||
@property (nonatomic, retain) NSNumber * type_;
|
@property (nonatomic, retain) NSNumber * type_;
|
||||||
|
@property (nonatomic, retain) NSString * userName;
|
||||||
@property (nonatomic, retain) NSNumber * uses_;
|
@property (nonatomic, retain) NSNumber * uses_;
|
||||||
|
@property (nonatomic, retain) NSNumber * version_;
|
||||||
@property (nonatomic, retain) MPUserEntity *user;
|
@property (nonatomic, retain) MPUserEntity *user;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// MPElementEntity.m
|
// MPElementEntity.m
|
||||||
// MasterPassword-iOS
|
// MasterPassword-iOS
|
||||||
//
|
//
|
||||||
// Created by Maarten Billemont on 11/06/12.
|
// Created by Maarten Billemont on 17/07/12.
|
||||||
// Copyright (c) 2012 Lyndir. All rights reserved.
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
@@ -15,8 +15,11 @@
|
|||||||
@dynamic content;
|
@dynamic content;
|
||||||
@dynamic lastUsed;
|
@dynamic lastUsed;
|
||||||
@dynamic name;
|
@dynamic name;
|
||||||
|
@dynamic requiresExplicitMigration_;
|
||||||
@dynamic type_;
|
@dynamic type_;
|
||||||
|
@dynamic userName;
|
||||||
@dynamic uses_;
|
@dynamic uses_;
|
||||||
|
@dynamic version_;
|
||||||
@dynamic user;
|
@dynamic user;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// MPElementGeneratedEntity.h
|
// MPElementGeneratedEntity.h
|
||||||
// MasterPassword-iOS
|
// MasterPassword-iOS
|
||||||
//
|
//
|
||||||
// Created by Maarten Billemont on 11/06/12.
|
// Created by Maarten Billemont on 17/07/12.
|
||||||
// Copyright (c) 2012 Lyndir. All rights reserved.
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// MPElementGeneratedEntity.m
|
// MPElementGeneratedEntity.m
|
||||||
// MasterPassword-iOS
|
// MasterPassword-iOS
|
||||||
//
|
//
|
||||||
// Created by Maarten Billemont on 11/06/12.
|
// Created by Maarten Billemont on 17/07/12.
|
||||||
// Copyright (c) 2012 Lyndir. All rights reserved.
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// MPElementStoredEntity.h
|
// MPElementStoredEntity.h
|
||||||
// MasterPassword-iOS
|
// MasterPassword-iOS
|
||||||
//
|
//
|
||||||
// Created by Maarten Billemont on 11/06/12.
|
// Created by Maarten Billemont on 17/07/12.
|
||||||
// Copyright (c) 2012 Lyndir. All rights reserved.
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// MPElementStoredEntity.m
|
// MPElementStoredEntity.m
|
||||||
// MasterPassword-iOS
|
// MasterPassword-iOS
|
||||||
//
|
//
|
||||||
// Created by Maarten Billemont on 11/06/12.
|
// Created by Maarten Billemont on 17/07/12.
|
||||||
// Copyright (c) 2012 Lyndir. All rights reserved.
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|||||||
@@ -11,18 +11,27 @@
|
|||||||
#import "MPElementStoredEntity.h"
|
#import "MPElementStoredEntity.h"
|
||||||
#import "MPElementGeneratedEntity.h"
|
#import "MPElementGeneratedEntity.h"
|
||||||
#import "MPUserEntity.h"
|
#import "MPUserEntity.h"
|
||||||
|
#import "MPAlgorithm.h"
|
||||||
|
|
||||||
#define MPAvatarCount 19
|
#define MPAvatarCount 19
|
||||||
|
|
||||||
@interface MPElementEntity (MP)
|
@interface MPElementEntity (MP)
|
||||||
|
|
||||||
@property (assign) MPElementType type;
|
@property (assign) MPElementType type;
|
||||||
|
@property (readonly) NSString *typeName;
|
||||||
|
@property (readonly) NSString *typeShortName;
|
||||||
|
@property (readonly) NSString *typeClassName;
|
||||||
|
@property (readonly) Class typeClass;
|
||||||
@property (assign) NSUInteger uses;
|
@property (assign) NSUInteger uses;
|
||||||
|
@property (assign) NSUInteger version;
|
||||||
|
@property (assign) BOOL requiresExplicitMigration;
|
||||||
|
@property (readonly) id<MPAlgorithm> algorithm;
|
||||||
|
|
||||||
- (NSUInteger)use;
|
- (NSUInteger)use;
|
||||||
- (NSString *)exportContent;
|
- (NSString *)exportContent;
|
||||||
- (void)importProtectedContent:(NSString *)protectedContent;
|
- (void)importProtectedContent:(NSString *)protectedContent;
|
||||||
- (void)importClearTextContent:(NSString *)clearContent usingKey:(NSData *)key;
|
- (void)importClearTextContent:(NSString *)clearContent usingKey:(MPKey *)key;
|
||||||
|
- (BOOL)migrateExplicitly:(BOOL)explicit;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -37,6 +46,7 @@
|
|||||||
@property (assign) NSUInteger avatar;
|
@property (assign) NSUInteger avatar;
|
||||||
@property (assign) BOOL saveKey;
|
@property (assign) BOOL saveKey;
|
||||||
@property (assign) MPElementType defaultType;
|
@property (assign) MPElementType defaultType;
|
||||||
|
@property (assign) BOOL requiresExplicitMigration;
|
||||||
@property (readonly) NSString *userID;
|
@property (readonly) NSString *userID;
|
||||||
|
|
||||||
+ (NSString *)idFor:(NSString *)userName;
|
+ (NSString *)idFor:(NSString *)userName;
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
|
|
||||||
#import "MPEntities.h"
|
#import "MPEntities.h"
|
||||||
#import "MPAppDelegate.h"
|
#import "MPAppDelegate.h"
|
||||||
#import "MPAppDelegate_Key.h"
|
|
||||||
#import "MPUserEntity.h"
|
|
||||||
|
|
||||||
@implementation MPElementEntity (MP)
|
@implementation MPElementEntity (MP)
|
||||||
|
|
||||||
@@ -23,6 +21,26 @@
|
|||||||
self.type_ = PearlUnsignedInteger(aType);
|
self.type_ = PearlUnsignedInteger(aType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *)typeName {
|
||||||
|
|
||||||
|
return [self.algorithm nameOfType:self.type];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)typeShortName {
|
||||||
|
|
||||||
|
return [self.algorithm shortNameOfType:self.type];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)typeClassName {
|
||||||
|
|
||||||
|
return [self.algorithm classNameOfType:self.type];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (Class)typeClass {
|
||||||
|
|
||||||
|
return [self.algorithm classOfType:self.type];
|
||||||
|
}
|
||||||
|
|
||||||
- (NSUInteger)uses {
|
- (NSUInteger)uses {
|
||||||
|
|
||||||
return [self.uses_ unsignedIntegerValue];
|
return [self.uses_ unsignedIntegerValue];
|
||||||
@@ -33,6 +51,30 @@
|
|||||||
self.uses_ = PearlUnsignedInteger(anUses);
|
self.uses_ = PearlUnsignedInteger(anUses);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSUInteger)version {
|
||||||
|
|
||||||
|
return [self.version_ unsignedIntegerValue];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setVersion:(NSUInteger)version {
|
||||||
|
|
||||||
|
self.version_ = PearlUnsignedInteger(version);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)requiresExplicitMigration {
|
||||||
|
|
||||||
|
return [self.requiresExplicitMigration_ boolValue];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setRequiresExplicitMigration:(BOOL)requiresExplicitMigration {
|
||||||
|
|
||||||
|
self.requiresExplicitMigration_ = PearlBool(requiresExplicitMigration);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id<MPAlgorithm>)algorithm {
|
||||||
|
|
||||||
|
return MPAlgorithmForVersion(self.version);
|
||||||
|
}
|
||||||
|
|
||||||
- (NSUInteger)use {
|
- (NSUInteger)use {
|
||||||
|
|
||||||
@@ -54,7 +96,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)importClearTextContent:(NSString *)content usingKey:(NSData *)key {
|
- (void)importClearTextContent:(NSString *)clearContent usingKey:(MPKey *)key {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,8 +107,22 @@
|
|||||||
|
|
||||||
- (NSString *)debugDescription {
|
- (NSString *)debugDescription {
|
||||||
|
|
||||||
return PearlString(@"{%@: name=%@, user=%@, type=%d, uses=%d, lastUsed=%@}",
|
return PearlString(@"{%@: name=%@, user=%@, type=%d, uses=%d, lastUsed=%@, version=%d, userName=%@, requiresExplicitMigration=%d}",
|
||||||
NSStringFromClass([self class]), self.name, self.user.name, self.type, self.uses, self.lastUsed);
|
NSStringFromClass([self class]), self.name, self.user.name, self.type, self.uses, self.lastUsed, self.version,
|
||||||
|
self.userName, self.requiresExplicitMigration);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)migrateExplicitly:(BOOL)explicit {
|
||||||
|
|
||||||
|
while (self.version < MPAlgorithmDefaultVersion)
|
||||||
|
if ([MPAlgorithmForVersion(self.version + 1) migrateElement:self explicit:explicit])
|
||||||
|
inf(@"%@ migration to version: %d succeeded for element: %@", explicit? @"Explicit": @"Automatic", self.version + 1, self);
|
||||||
|
else {
|
||||||
|
wrn(@"%@ migration to version: %d failed for element: %@", explicit? @"Explicit": @"Automatic", self.version + 1, self);
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -85,6 +141,10 @@
|
|||||||
|
|
||||||
- (id)content {
|
- (id)content {
|
||||||
|
|
||||||
|
MPKey *key = [MPAppDelegate get].key;
|
||||||
|
if (!key)
|
||||||
|
return nil;
|
||||||
|
|
||||||
if (!(self.type & MPElementTypeClassGenerated)) {
|
if (!(self.type & MPElementTypeClassGenerated)) {
|
||||||
err(@"Corrupt element: %@, type: %d is not in MPElementTypeClassGenerated", self.name, self.type);
|
err(@"Corrupt element: %@, type: %d is not in MPElementTypeClassGenerated", self.name, self.type);
|
||||||
return nil;
|
return nil;
|
||||||
@@ -93,7 +153,7 @@
|
|||||||
if (![self.name length])
|
if (![self.name length])
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
return MPCalculateContent(self.type, self.name, [MPAppDelegate get].key, self.counter);
|
return [self.algorithm generateContentForElement:self usingKey:key];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -112,18 +172,26 @@
|
|||||||
|
|
||||||
- (id)content {
|
- (id)content {
|
||||||
|
|
||||||
return [self contentUsingKey:[MPAppDelegate get].key];
|
MPKey *key = [MPAppDelegate get].key;
|
||||||
|
if (!key)
|
||||||
|
return nil;
|
||||||
|
|
||||||
|
return [self contentUsingKey:key];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setContent:(id)content {
|
- (void)setContent:(id)content {
|
||||||
|
|
||||||
[self setContent:content usingKey:[MPAppDelegate get].key];
|
MPKey *key = [MPAppDelegate get].key;
|
||||||
|
if (!key)
|
||||||
|
return;
|
||||||
|
|
||||||
|
[self setContent:content usingKey:key];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)contentUsingKey:(NSData *)key {
|
- (id)contentUsingKey:(MPKey *)key {
|
||||||
|
|
||||||
assert(self.type & MPElementTypeClassStored);
|
assert(self.type & MPElementTypeClassStored);
|
||||||
assert([keyIDForKey(key) isEqualToData:self.user.keyID]);
|
assert([key.keyID isEqualToData:self.user.keyID]);
|
||||||
|
|
||||||
NSData *encryptedContent;
|
NSData *encryptedContent;
|
||||||
if (self.type & MPElementFeatureDevicePrivate)
|
if (self.type & MPElementFeatureDevicePrivate)
|
||||||
@@ -131,23 +199,27 @@
|
|||||||
else
|
else
|
||||||
encryptedContent = self.contentObject;
|
encryptedContent = self.contentObject;
|
||||||
|
|
||||||
NSData *decryptedContent = [encryptedContent decryptWithSymmetricKey:subkeyForKey(key, PearlCryptKeySize) padding:YES];
|
NSData *decryptedContent = nil;
|
||||||
|
if ([encryptedContent length])
|
||||||
|
decryptedContent = [encryptedContent decryptWithSymmetricKey:[key subKeyOfLength:PearlCryptKeySize].keyData padding:YES];
|
||||||
|
|
||||||
return [[NSString alloc] initWithBytes:decryptedContent.bytes length:decryptedContent.length encoding:NSUTF8StringEncoding];
|
return [[NSString alloc] initWithBytes:decryptedContent.bytes length:decryptedContent.length encoding:NSUTF8StringEncoding];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setContent:(id)content usingKey:(NSData *)key {
|
- (void)setContent:(id)content usingKey:(MPKey *)key {
|
||||||
|
|
||||||
assert(self.type & MPElementTypeClassStored);
|
assert(self.type & MPElementTypeClassStored);
|
||||||
assert([keyIDForKey(key) isEqualToData:self.user.keyID]);
|
assert([key.keyID isEqualToData:self.user.keyID]);
|
||||||
|
|
||||||
NSData *encryptedContent = [[content description] encryptWithSymmetricKey:subkeyForKey(key, PearlCryptKeySize) padding:YES];
|
NSData *encryptedContent = [[content description] encryptWithSymmetricKey:[key subKeyOfLength:PearlCryptKeySize].keyData padding:YES];
|
||||||
|
|
||||||
if (self.type & MPElementFeatureDevicePrivate) {
|
if (self.type & MPElementFeatureDevicePrivate) {
|
||||||
[PearlKeyChain addOrUpdateItemForQuery:[MPElementStoredEntity queryForDevicePrivateElementNamed:self.name]
|
[PearlKeyChain addOrUpdateItemForQuery:[MPElementStoredEntity queryForDevicePrivateElementNamed:self.name]
|
||||||
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
encryptedContent, (__bridge id)kSecValueData,
|
encryptedContent, (__bridge id)kSecValueData,
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
kSecAttrAccessibleWhenUnlockedThisDeviceOnly, (__bridge id)kSecAttrAccessible,
|
(__bridge id)kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
|
||||||
|
(__bridge id)kSecAttrAccessible,
|
||||||
#endif
|
#endif
|
||||||
nil]];
|
nil]];
|
||||||
self.contentObject = nil;
|
self.contentObject = nil;
|
||||||
@@ -165,7 +237,7 @@
|
|||||||
self.contentObject = [protectedContent decodeBase64];
|
self.contentObject = [protectedContent decodeBase64];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)importClearTextContent:(NSString *)clearContent usingKey:(NSData *)key {
|
- (void)importClearTextContent:(NSString *)clearContent usingKey:(MPKey *)key {
|
||||||
|
|
||||||
[self setContent:clearContent usingKey:key];
|
[self setContent:clearContent usingKey:key];
|
||||||
}
|
}
|
||||||
@@ -199,17 +271,26 @@
|
|||||||
return (MPElementType)[self.defaultType_ unsignedIntegerValue];
|
return (MPElementType)[self.defaultType_ unsignedIntegerValue];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)userID {
|
|
||||||
|
|
||||||
return [MPUserEntity idFor:self.name];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
- (void)setDefaultType:(MPElementType)aDefaultType {
|
- (void)setDefaultType:(MPElementType)aDefaultType {
|
||||||
|
|
||||||
self.defaultType_ = PearlUnsignedInteger(aDefaultType);
|
self.defaultType_ = PearlUnsignedInteger(aDefaultType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)requiresExplicitMigration {
|
||||||
|
|
||||||
|
return [self.requiresExplicitMigration_ boolValue];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setRequiresExplicitMigration:(BOOL)requiresExplicitMigration {
|
||||||
|
|
||||||
|
self.requiresExplicitMigration_ = PearlBool(requiresExplicitMigration);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)userID {
|
||||||
|
|
||||||
|
return [MPUserEntity idFor:self.name];
|
||||||
|
}
|
||||||
|
|
||||||
+ (NSString *)idFor:(NSString *)userName {
|
+ (NSString *)idFor:(NSString *)userName {
|
||||||
|
|
||||||
return [[userName hashWith:PearlHashSHA1] encodeHex];
|
return [[userName hashWith:PearlHashSHA1] encodeHex];
|
||||||
|
|||||||
33
MasterPassword/MPKey.h
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/**
|
||||||
|
* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com)
|
||||||
|
*
|
||||||
|
* See the enclosed file LICENSE for license information (LGPLv3). If you did
|
||||||
|
* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*
|
||||||
|
* @author Maarten Billemont <lhunath@lyndir.com>
|
||||||
|
* @license http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
//
|
||||||
|
// MPKey
|
||||||
|
//
|
||||||
|
// Created by Maarten Billemont on 16/07/12.
|
||||||
|
// Copyright 2012 lhunath (Maarten Billemont). All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@protocol MPAlgorithm;
|
||||||
|
|
||||||
|
|
||||||
|
@interface MPKey : NSObject
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, strong) id<MPAlgorithm> algorithm;
|
||||||
|
@property (nonatomic, readonly, strong) NSData *keyData;
|
||||||
|
@property (nonatomic, readonly, strong) NSData *keyID;
|
||||||
|
|
||||||
|
- (id)initWithKeyData:(NSData *)keyData algorithm:(id<MPAlgorithm>)algorithm;
|
||||||
|
- (MPKey *)subKeyOfLength:(NSUInteger)subKeyLength;
|
||||||
|
- (BOOL)isEqualToKey:(MPKey *)key;
|
||||||
|
|
||||||
|
@end
|
||||||
66
MasterPassword/MPKey.m
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
/**
|
||||||
|
* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com)
|
||||||
|
*
|
||||||
|
* See the enclosed file LICENSE for license information (LGPLv3). If you did
|
||||||
|
* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*
|
||||||
|
* @author Maarten Billemont <lhunath@lyndir.com>
|
||||||
|
* @license http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
//
|
||||||
|
// MPKey
|
||||||
|
//
|
||||||
|
// Created by Maarten Billemont on 16/07/12.
|
||||||
|
// Copyright 2012 lhunath (Maarten Billemont). All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MPKey.h"
|
||||||
|
#import "MPAlgorithm.h"
|
||||||
|
|
||||||
|
|
||||||
|
@interface MPKey ()
|
||||||
|
|
||||||
|
@property (nonatomic, readwrite, strong) id<MPAlgorithm> algorithm;
|
||||||
|
@property (nonatomic, readwrite, strong) NSData *keyData;
|
||||||
|
@property (nonatomic, readwrite, strong) NSData *keyID;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation MPKey
|
||||||
|
@synthesize algorithm = _algorithm, keyData = _keyData, keyID = _keyID;
|
||||||
|
|
||||||
|
- (id)initWithKeyData:(NSData *)keyData algorithm:(id<MPAlgorithm>)algorithm {
|
||||||
|
|
||||||
|
if (!(self = [super init]))
|
||||||
|
return nil;
|
||||||
|
|
||||||
|
self.keyData = keyData;
|
||||||
|
self.algorithm = algorithm;
|
||||||
|
self.keyID = [self.algorithm keyIDForKeyData:keyData];
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (MPKey *)subKeyOfLength:(NSUInteger)subKeyLength {
|
||||||
|
|
||||||
|
NSData *subKeyData = [self.keyData subdataWithRange:NSMakeRange(0, MIN(subKeyLength, self.keyData.length))];
|
||||||
|
|
||||||
|
return [self.algorithm keyFromKeyData:subKeyData];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isEqualToKey:(MPKey *)key {
|
||||||
|
|
||||||
|
return [self.keyID isEqualToData:key.keyID];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isEqual:(id)object {
|
||||||
|
|
||||||
|
if (![object isKindOfClass:[MPKey class]])
|
||||||
|
return NO;
|
||||||
|
|
||||||
|
return [self isEqualToKey:object];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -6,9 +6,7 @@
|
|||||||
// Copyright (c) 2012 Lyndir. All rights reserved.
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import "MPKey.h"
|
||||||
|
|
||||||
#define MPPersistentStoreDidChangeNotification @"MPPersistentStoreDidChange"
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
MPElementContentTypePassword,
|
MPElementContentTypePassword,
|
||||||
@@ -45,10 +43,13 @@ typedef enum {
|
|||||||
#define MPCheckpointAction @"MPCheckpointAction"
|
#define MPCheckpointAction @"MPCheckpointAction"
|
||||||
#define MPCheckpointHelpChapter @"MPCheckpointHelpChapter"
|
#define MPCheckpointHelpChapter @"MPCheckpointHelpChapter"
|
||||||
#define MPCheckpointCopyToPasteboard @"MPCheckpointCopyToPasteboard"
|
#define MPCheckpointCopyToPasteboard @"MPCheckpointCopyToPasteboard"
|
||||||
|
#define MPCheckpointCopyUserNameToPasteboard @"MPCheckpointCopyUserNameToPasteboard"
|
||||||
#define MPCheckpointResetPasswordCounter @"MPCheckpointResetPasswordCounter"
|
#define MPCheckpointResetPasswordCounter @"MPCheckpointResetPasswordCounter"
|
||||||
#define MPCheckpointIncrementPasswordCounter @"MPCheckpointIncrementPasswordCounter"
|
#define MPCheckpointIncrementPasswordCounter @"MPCheckpointIncrementPasswordCounter"
|
||||||
#define MPCheckpointEditPassword @"MPCheckpointEditPassword"
|
#define MPCheckpointEditPassword @"MPCheckpointEditPassword"
|
||||||
|
#define MPCheckpointEditUserName @"MPCheckpointEditUserName"
|
||||||
#define MPCheckpointCloseAlert @"MPCheckpointCloseAlert"
|
#define MPCheckpointCloseAlert @"MPCheckpointCloseAlert"
|
||||||
|
#define MPCheckpointCloseOutdatedAlert @"MPCheckpointCloseOutdatedAlert"
|
||||||
#define MPCheckpointUseType @"MPCheckpointUseType"
|
#define MPCheckpointUseType @"MPCheckpointUseType"
|
||||||
#define MPCheckpointDeleteElement @"MPCheckpointDeleteElement"
|
#define MPCheckpointDeleteElement @"MPCheckpointDeleteElement"
|
||||||
#define MPCheckpointCancelSearch @"MPCheckpointCancelSearch"
|
#define MPCheckpointCancelSearch @"MPCheckpointCancelSearch"
|
||||||
@@ -70,19 +71,9 @@ typedef enum {
|
|||||||
#define MPCheckpointCloudDisabled @"MPCheckpointCloudDisabled"
|
#define MPCheckpointCloudDisabled @"MPCheckpointCloudDisabled"
|
||||||
#define MPCheckpointSitesImported @"MPCheckpointSitesImported"
|
#define MPCheckpointSitesImported @"MPCheckpointSitesImported"
|
||||||
#define MPCheckpointSitesExported @"MPCheckpointSitesExported"
|
#define MPCheckpointSitesExported @"MPCheckpointSitesExported"
|
||||||
|
#define MPCheckpointExplicitMigration @"MPCheckpointExplicitMigration"
|
||||||
|
|
||||||
#define MPNotificationStoreUpdated @"MPNotificationStoreUpdated"
|
|
||||||
#define MPNotificationSignedIn @"MPNotificationKeySet"
|
#define MPNotificationSignedIn @"MPNotificationKeySet"
|
||||||
#define MPNotificationSignedOut @"MPNotificationKeyUnset"
|
#define MPNotificationSignedOut @"MPNotificationKeyUnset"
|
||||||
#define MPNotificationKeyForgotten @"MPNotificationKeyForgotten"
|
#define MPNotificationKeyForgotten @"MPNotificationKeyForgotten"
|
||||||
#define MPNotificationElementUsed @"MPNotificationElementUsed"
|
#define MPNotificationElementUpdated @"MPNotificationElementUpdated"
|
||||||
|
|
||||||
NSData *keyForPassword(NSString *password, NSString *username);
|
|
||||||
NSData *subkeyForKey(NSData *key, NSUInteger subkeyLength);
|
|
||||||
NSData *keyIDForPassword(NSString *password, NSString *username);
|
|
||||||
NSData *keyIDForKey(NSData *key);
|
|
||||||
NSString *NSStringFromMPElementType(MPElementType type);
|
|
||||||
NSString *NSStringShortFromMPElementType(MPElementType type);
|
|
||||||
NSString *ClassNameFromMPElementType(MPElementType type);
|
|
||||||
Class ClassFromMPElementType(MPElementType type);
|
|
||||||
NSString *MPCalculateContent(MPElementType type, NSString *name, NSData *key, uint32_t counter);
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// MPUserEntity.h
|
// MPUserEntity.h
|
||||||
// MasterPassword-iOS
|
// MasterPassword-iOS
|
||||||
//
|
//
|
||||||
// Created by Maarten Billemont on 11/06/12.
|
// Created by Maarten Billemont on 17/07/12.
|
||||||
// Copyright (c) 2012 Lyndir. All rights reserved.
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
@@ -14,11 +14,12 @@
|
|||||||
@interface MPUserEntity : NSManagedObject
|
@interface MPUserEntity : NSManagedObject
|
||||||
|
|
||||||
@property (nonatomic, retain) NSNumber * avatar_;
|
@property (nonatomic, retain) NSNumber * avatar_;
|
||||||
|
@property (nonatomic, retain) NSNumber * defaultType_;
|
||||||
@property (nonatomic, retain) NSData * keyID;
|
@property (nonatomic, retain) NSData * keyID;
|
||||||
@property (nonatomic, retain) NSDate * lastUsed;
|
@property (nonatomic, retain) NSDate * lastUsed;
|
||||||
@property (nonatomic, retain) NSString * name;
|
@property (nonatomic, retain) NSString * name;
|
||||||
@property (nonatomic, retain) NSNumber * saveKey_;
|
@property (nonatomic, retain) NSNumber * saveKey_;
|
||||||
@property (nonatomic, retain) NSNumber * defaultType_;
|
@property (nonatomic, retain) NSNumber * requiresExplicitMigration_;
|
||||||
@property (nonatomic, retain) NSSet *elements;
|
@property (nonatomic, retain) NSSet *elements;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// MPUserEntity.m
|
// MPUserEntity.m
|
||||||
// MasterPassword-iOS
|
// MasterPassword-iOS
|
||||||
//
|
//
|
||||||
// Created by Maarten Billemont on 11/06/12.
|
// Created by Maarten Billemont on 17/07/12.
|
||||||
// Copyright (c) 2012 Lyndir. All rights reserved.
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
@@ -13,11 +13,12 @@
|
|||||||
@implementation MPUserEntity
|
@implementation MPUserEntity
|
||||||
|
|
||||||
@dynamic avatar_;
|
@dynamic avatar_;
|
||||||
|
@dynamic defaultType_;
|
||||||
@dynamic keyID;
|
@dynamic keyID;
|
||||||
@dynamic lastUsed;
|
@dynamic lastUsed;
|
||||||
@dynamic name;
|
@dynamic name;
|
||||||
@dynamic saveKey_;
|
@dynamic saveKey_;
|
||||||
@dynamic defaultType_;
|
@dynamic requiresExplicitMigration_;
|
||||||
@dynamic elements;
|
@dynamic elements;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>_XCCurrentVersionName</key>
|
<key>_XCCurrentVersionName</key>
|
||||||
<string>MasterPassword.xcdatamodel</string>
|
<string>MasterPassword 2.xcdatamodel</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<model name="" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1487" systemVersion="12A269" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
|
||||||
|
<entity name="MPElementEntity" representedClassName="MPElementEntity" isAbstract="YES" syncable="YES">
|
||||||
|
<attribute name="content" optional="YES" transient="YES" attributeType="Transformable" syncable="YES"/>
|
||||||
|
<attribute name="lastUsed" attributeType="Date" indexed="YES" syncable="YES"/>
|
||||||
|
<attribute name="name" attributeType="String" minValueString="1" indexed="YES" syncable="YES"/>
|
||||||
|
<attribute name="requiresExplicitMigration_" attributeType="Boolean" defaultValueString="NO">
|
||||||
|
<userInfo/>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="type_" attributeType="Integer 16" defaultValueString="17" syncable="YES"/>
|
||||||
|
<attribute name="userName" optional="YES" attributeType="String" syncable="YES"/>
|
||||||
|
<attribute name="uses_" attributeType="Integer 16" defaultValueString="0" indexed="YES" syncable="YES"/>
|
||||||
|
<attribute name="version_" attributeType="Integer 16" minValueString="0" defaultValueString="0" syncable="YES"/>
|
||||||
|
<relationship name="user" minCount="1" maxCount="1" deletionRule="Nullify" destinationEntity="MPUserEntity" inverseName="elements" inverseEntity="MPUserEntity" syncable="YES"/>
|
||||||
|
</entity>
|
||||||
|
<entity name="MPElementGeneratedEntity" representedClassName="MPElementGeneratedEntity" parentEntity="MPElementEntity" syncable="YES">
|
||||||
|
<attribute name="counter_" optional="YES" attributeType="Integer 32" defaultValueString="1" syncable="YES"/>
|
||||||
|
</entity>
|
||||||
|
<entity name="MPElementStoredEntity" representedClassName="MPElementStoredEntity" parentEntity="MPElementEntity" syncable="YES">
|
||||||
|
<attribute name="contentObject" optional="YES" attributeType="Transformable" storedInTruthFile="YES" syncable="YES"/>
|
||||||
|
</entity>
|
||||||
|
<entity name="MPUserEntity" representedClassName="MPUserEntity" syncable="YES">
|
||||||
|
<attribute name="avatar_" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
|
||||||
|
<attribute name="defaultType_" attributeType="Integer 16" defaultValueString="17" syncable="YES"/>
|
||||||
|
<attribute name="keyID" optional="YES" attributeType="Binary" syncable="YES"/>
|
||||||
|
<attribute name="lastUsed" optional="YES" attributeType="Date" syncable="YES"/>
|
||||||
|
<attribute name="name" attributeType="String" syncable="YES"/>
|
||||||
|
<attribute name="requiresExplicitMigration_" transient="YES" attributeType="Boolean" defaultValueString="NO" syncable="YES"/>
|
||||||
|
<attribute name="saveKey_" attributeType="Boolean" defaultValueString="NO">
|
||||||
|
<userInfo/>
|
||||||
|
</attribute>
|
||||||
|
<relationship name="elements" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="MPElementEntity" inverseName="user" inverseEntity="MPElementEntity" syncable="YES"/>
|
||||||
|
</entity>
|
||||||
|
<elements>
|
||||||
|
<element name="MPElementEntity" positionX="160" positionY="192" width="128" height="180"/>
|
||||||
|
<element name="MPElementGeneratedEntity" positionX="160" positionY="192" width="128" height="60"/>
|
||||||
|
<element name="MPElementStoredEntity" positionX="160" positionY="192" width="128" height="60"/>
|
||||||
|
<element name="MPUserEntity" positionX="160" positionY="192" width="128" height="150"/>
|
||||||
|
</elements>
|
||||||
|
</model>
|
||||||
@@ -18,6 +18,6 @@
|
|||||||
- (void)showGuide;
|
- (void)showGuide;
|
||||||
|
|
||||||
- (void)export;
|
- (void)export;
|
||||||
- (void)changeMasterPasswordFor:(MPUserEntity *)user;
|
- (void)changeMasterPasswordFor:(MPUserEntity *)user didResetBlock:(void(^)(void))didReset;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
[MPiOSConfig get];
|
[MPiOSConfig get];
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
[PearlLogger get].autoprintLevel = PearlLogLevelDebug;
|
[PearlLogger get].printLevel = PearlLogLevelDebug;
|
||||||
//[NSClassFromString(@"WebView") performSelector:NSSelectorFromString(@"_enableRemoteInspector")];
|
//[NSClassFromString(@"WebView") performSelector:NSSelectorFromString(@"_enableRemoteInspector")];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -49,16 +49,14 @@
|
|||||||
[[[NSBundle mainBundle] mutableInfoDictionary] setObject:@"Master Password" forKey:@"CFBundleDisplayName"];
|
[[[NSBundle mainBundle] mutableInfoDictionary] setObject:@"Master Password" forKey:@"CFBundleDisplayName"];
|
||||||
[[[NSBundle mainBundle] mutableLocalizedInfoDictionary] setObject:@"Master Password" forKey:@"CFBundleDisplayName"];
|
[[[NSBundle mainBundle] mutableLocalizedInfoDictionary] setObject:@"Master Password" forKey:@"CFBundleDisplayName"];
|
||||||
|
|
||||||
|
#ifdef ADHOC
|
||||||
@try {
|
@try {
|
||||||
NSString *testFlightToken = [self testFlightToken];
|
NSString *testFlightToken = [self testFlightToken];
|
||||||
if ([testFlightToken length]) {
|
if ([testFlightToken length]) {
|
||||||
inf(@"Initializing TestFlight");
|
inf(@"Initializing TestFlight");
|
||||||
[TestFlight addCustomEnvironmentInformation:@"Anonymous" forKey:@"username"];
|
[TestFlight addCustomEnvironmentInformation:@"Anonymous" forKey:@"username"];
|
||||||
#ifdef ADHOC
|
|
||||||
[TestFlight setDeviceIdentifier:[(id)[UIDevice currentDevice] uniqueIdentifier]];
|
[TestFlight setDeviceIdentifier:[(id)[UIDevice currentDevice] uniqueIdentifier]];
|
||||||
#else
|
// [TestFlight setDeviceIdentifier:[PearlKeyChain deviceIdentifier]];
|
||||||
[TestFlight setDeviceIdentifier:[PearlKeyChain deviceIdentifier]];
|
|
||||||
#endif
|
|
||||||
[TestFlight setOptions:[NSDictionary dictionaryWithObjectsAndKeys:
|
[TestFlight setOptions:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
[NSNumber numberWithBool:NO], @"logToConsole",
|
[NSNumber numberWithBool:NO], @"logToConsole",
|
||||||
[NSNumber numberWithBool:NO], @"logToSTDERR",
|
[NSNumber numberWithBool:NO], @"logToSTDERR",
|
||||||
@@ -74,11 +72,14 @@
|
|||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}];
|
}];
|
||||||
|
TFLog(@"TestFlight (%@) initialized for: %@ v%@.", //
|
||||||
|
TESTFLIGHT_SDK_VERSION, [PearlInfoPlist get].CFBundleName, [PearlInfoPlist get].CFBundleVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@catch (id exception) {
|
@catch (id exception) {
|
||||||
err(@"TestFlight: %@", exception);
|
err(@"TestFlight: %@", exception);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
@try {
|
@try {
|
||||||
NSString *crashlyticsAPIKey = [self crashlyticsAPIKey];
|
NSString *crashlyticsAPIKey = [self crashlyticsAPIKey];
|
||||||
if ([crashlyticsAPIKey length]) {
|
if ([crashlyticsAPIKey length]) {
|
||||||
@@ -99,6 +100,8 @@
|
|||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}];
|
}];
|
||||||
|
CLSLog(@"Crashlytics (%@) initialized for: %@ v%@.", //
|
||||||
|
[Crashlytics sharedInstance].version, [PearlInfoPlist get].CFBundleName, [PearlInfoPlist get].CFBundleVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@catch (id exception) {
|
@catch (id exception) {
|
||||||
@@ -111,12 +114,12 @@
|
|||||||
[[LocalyticsSession sharedLocalyticsSession] startSession:localyticsKey];
|
[[LocalyticsSession sharedLocalyticsSession] startSession:localyticsKey];
|
||||||
[[PearlLogger get] registerListener:^BOOL(PearlLogMessage *message) {
|
[[PearlLogger get] registerListener:^BOOL(PearlLogMessage *message) {
|
||||||
if (message.level >= PearlLogLevelWarn)
|
if (message.level >= PearlLogLevelWarn)
|
||||||
[[LocalyticsSession sharedLocalyticsSession] tagEvent:@"Problem" attributes:
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:@"Problem"
|
||||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
attributes:[NSDictionary
|
||||||
[message levelDescription],
|
dictionaryWithObjectsAndKeys:
|
||||||
@"level",
|
[NSString stringWithCString:PearlLogLevelStr(message.level)
|
||||||
message.message,
|
encoding:NSASCIIStringEncoding], @"level",
|
||||||
@"message",
|
message.message, @"message",
|
||||||
nil]];
|
nil]];
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
@@ -282,14 +285,18 @@
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
|
||||||
|
|
||||||
|
wrn(@"Received memory warning.");
|
||||||
|
|
||||||
|
[super applicationDidReceiveMemoryWarning:application];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||||
|
|
||||||
inf(@"Re-activated");
|
inf(@"Re-activated");
|
||||||
[[MPAppDelegate get] checkConfig];
|
[[MPAppDelegate get] checkConfig];
|
||||||
|
|
||||||
if ([[MPiOSConfig get].showQuickStart boolValue])
|
|
||||||
[self showGuide];
|
|
||||||
|
|
||||||
[TestFlight passCheckpoint:MPCheckpointActivated];
|
[TestFlight passCheckpoint:MPCheckpointActivated];
|
||||||
|
|
||||||
[super applicationDidBecomeActive:application];
|
[super applicationDidBecomeActive:application];
|
||||||
@@ -341,8 +348,8 @@
|
|||||||
if ([[MPConfig get].iCloud boolValue] != [self.storeManager iCloudEnabled])
|
if ([[MPConfig get].iCloud boolValue] != [self.storeManager iCloudEnabled])
|
||||||
[self.storeManager useiCloudStore:[[MPConfig get].iCloud boolValue] alertUser:YES];
|
[self.storeManager useiCloudStore:[[MPConfig get].iCloud boolValue] alertUser:YES];
|
||||||
if ([[MPiOSConfig get].sendInfo boolValue]) {
|
if ([[MPiOSConfig get].sendInfo boolValue]) {
|
||||||
if ([PearlLogger get].autoprintLevel > PearlLogLevelInfo)
|
if ([PearlLogger get].printLevel > PearlLogLevelInfo)
|
||||||
[PearlLogger get].autoprintLevel = PearlLogLevelInfo;
|
[PearlLogger get].printLevel = PearlLogLevelInfo;
|
||||||
|
|
||||||
[[Crashlytics sharedInstance] setBoolValue:[[MPConfig get].rememberLogin boolValue] forKey:@"rememberLogin"];
|
[[Crashlytics sharedInstance] setBoolValue:[[MPConfig get].rememberLogin boolValue] forKey:@"rememberLogin"];
|
||||||
[[Crashlytics sharedInstance] setBoolValue:[[MPConfig get].iCloud boolValue] forKey:@"iCloud"];
|
[[Crashlytics sharedInstance] setBoolValue:[[MPConfig get].iCloud boolValue] forKey:@"iCloud"];
|
||||||
@@ -385,11 +392,14 @@
|
|||||||
? @"YES": @"NO", @"showQuickStart",
|
? @"YES": @"NO", @"showQuickStart",
|
||||||
[[PearlConfig get].firstRun boolValue]
|
[[PearlConfig get].firstRun boolValue]
|
||||||
? @"YES": @"NO", @"firstRun",
|
? @"YES": @"NO", @"firstRun",
|
||||||
[[PearlConfig get].launchCount description], @"launchCount",
|
[[PearlConfig get].launchCount description],
|
||||||
|
@"launchCount",
|
||||||
[[PearlConfig get].askForReviews boolValue]
|
[[PearlConfig get].askForReviews boolValue]
|
||||||
? @"YES": @"NO", @"askForReviews",
|
? @"YES": @"NO", @"askForReviews",
|
||||||
[[PearlConfig get].reviewAfterLaunches description], @"reviewAfterLaunches",
|
[[PearlConfig get].reviewAfterLaunches description],
|
||||||
[PearlConfig get].reviewedVersion, @"reviewedVersion",
|
@"reviewAfterLaunches",
|
||||||
|
[PearlConfig get].reviewedVersion,
|
||||||
|
@"reviewedVersion",
|
||||||
nil]];
|
nil]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -434,8 +444,7 @@
|
|||||||
@"Your device is not yet set up for sending mail.\n"
|
@"Your device is not yet set up for sending mail.\n"
|
||||||
@"Close Master Password, go into Settings and add a Mail account."
|
@"Close Master Password, go into Settings and add a Mail account."
|
||||||
viewStyle:UIAlertViewStyleDefault
|
viewStyle:UIAlertViewStyleDefault
|
||||||
initAlert:nil tappedButtonBlock:nil
|
initAlert:nil tappedButtonBlock:nil cancelTitle:[PearlStrings get].commonButtonOkay
|
||||||
cancelTitle:[PearlStrings get].commonButtonOkay
|
|
||||||
otherTitles:nil];
|
otherTitles:nil];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -462,7 +471,7 @@
|
|||||||
[PearlInfoPlist get].CFBundleVersion);
|
[PearlInfoPlist get].CFBundleVersion);
|
||||||
|
|
||||||
NSDateFormatter *exportDateFormatter = [NSDateFormatter new];
|
NSDateFormatter *exportDateFormatter = [NSDateFormatter new];
|
||||||
[exportDateFormatter setDateFormat:@"yyyy'-'MM'-'DD"];
|
[exportDateFormatter setDateFormat:@"yyyy'-'MM'-'dd"];
|
||||||
|
|
||||||
MFMailComposeViewController *composer = [MFMailComposeViewController new];
|
MFMailComposeViewController *composer = [MFMailComposeViewController new];
|
||||||
[composer setMailComposeDelegate:self];
|
[composer setMailComposeDelegate:self];
|
||||||
@@ -476,7 +485,7 @@
|
|||||||
[self.window.rootViewController presentModalViewController:composer animated:YES];
|
[self.window.rootViewController presentModalViewController:composer animated:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)changeMasterPasswordFor:(MPUserEntity *)user {
|
- (void)changeMasterPasswordFor:(MPUserEntity *)user didResetBlock:(void (^)(void))didReset {
|
||||||
|
|
||||||
[PearlAlert showAlertWithTitle:@"Changing Master Password"
|
[PearlAlert showAlertWithTitle:@"Changing Master Password"
|
||||||
message:
|
message:
|
||||||
@@ -493,9 +502,11 @@
|
|||||||
[self forgetSavedKeyFor:user];
|
[self forgetSavedKeyFor:user];
|
||||||
[self signOutAnimated:YES];
|
[self signOutAnimated:YES];
|
||||||
|
|
||||||
|
if (didReset)
|
||||||
|
didReset();
|
||||||
|
|
||||||
[TestFlight passCheckpoint:MPCheckpointChangeMP];
|
[TestFlight passCheckpoint:MPCheckpointChangeMP];
|
||||||
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointChangeMP
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointChangeMP attributes:nil];
|
||||||
attributes:nil];
|
|
||||||
}
|
}
|
||||||
cancelTitle:[PearlStrings get].commonButtonAbort
|
cancelTitle:[PearlStrings get].commonButtonAbort
|
||||||
otherTitles:[PearlStrings get].commonButtonContinue, nil];
|
otherTitles:[PearlStrings get].commonButtonContinue, nil];
|
||||||
|
|||||||
@@ -11,11 +11,11 @@
|
|||||||
#import "MPElementEntity.h"
|
#import "MPElementEntity.h"
|
||||||
#import "MPSearchDelegate.h"
|
#import "MPSearchDelegate.h"
|
||||||
|
|
||||||
@interface MPMainViewController : UIViewController<MPTypeDelegate, UITextFieldDelegate, MPSearchResultsDelegate, UIWebViewDelegate, MFMailComposeViewControllerDelegate>
|
@interface MPMainViewController : UIViewController<MPTypeDelegate, UITextFieldDelegate, MPSearchResultsDelegate, UIWebViewDelegate, MFMailComposeViewControllerDelegate, UIGestureRecognizerDelegate>
|
||||||
|
|
||||||
|
@property (nonatomic, assign) BOOL userNameHidden;
|
||||||
@property (strong, nonatomic) MPElementEntity *activeElement;
|
@property (strong, nonatomic) MPElementEntity *activeElement;
|
||||||
@property (strong, nonatomic) IBOutlet MPSearchDelegate *searchDelegate;
|
@property (strong, nonatomic) IBOutlet MPSearchDelegate *searchDelegate;
|
||||||
@property (strong, nonatomic) IBOutlet UILongPressGestureRecognizer *resetPasswordCounterGesture;
|
|
||||||
@property (weak, nonatomic) IBOutlet UITextField *contentField;
|
@property (weak, nonatomic) IBOutlet UITextField *contentField;
|
||||||
@property (weak, nonatomic) IBOutlet UIButton *typeButton;
|
@property (weak, nonatomic) IBOutlet UIButton *typeButton;
|
||||||
@property (weak, nonatomic) IBOutlet UIWebView *helpView;
|
@property (weak, nonatomic) IBOutlet UIWebView *helpView;
|
||||||
@@ -23,28 +23,47 @@
|
|||||||
@property (weak, nonatomic) IBOutlet UILabel *passwordCounter;
|
@property (weak, nonatomic) IBOutlet UILabel *passwordCounter;
|
||||||
@property (weak, nonatomic) IBOutlet UIButton *passwordIncrementer;
|
@property (weak, nonatomic) IBOutlet UIButton *passwordIncrementer;
|
||||||
@property (weak, nonatomic) IBOutlet UIButton *passwordEdit;
|
@property (weak, nonatomic) IBOutlet UIButton *passwordEdit;
|
||||||
|
@property (weak, nonatomic) IBOutlet UIButton *passwordUpgrade;
|
||||||
@property (weak, nonatomic) IBOutlet UIView *contentContainer;
|
@property (weak, nonatomic) IBOutlet UIView *contentContainer;
|
||||||
|
@property (weak, nonatomic) IBOutlet UIView *displayContainer;
|
||||||
@property (weak, nonatomic) IBOutlet UIView *helpContainer;
|
@property (weak, nonatomic) IBOutlet UIView *helpContainer;
|
||||||
@property (weak, nonatomic) IBOutlet UIView *contentTipContainer;
|
@property (weak, nonatomic) IBOutlet UIView *contentTipContainer;
|
||||||
|
@property (weak, nonatomic) IBOutlet UIView *userNameTipContainer;
|
||||||
@property (weak, nonatomic) IBOutlet UIView *alertContainer;
|
@property (weak, nonatomic) IBOutlet UIView *alertContainer;
|
||||||
@property (weak, nonatomic) IBOutlet UILabel *alertTitle;
|
@property (weak, nonatomic) IBOutlet UILabel *alertTitle;
|
||||||
@property (weak, nonatomic) IBOutlet UITextView *alertBody;
|
@property (weak, nonatomic) IBOutlet UITextView *alertBody;
|
||||||
@property (weak, nonatomic) IBOutlet UILabel *contentTipBody;
|
@property (weak, nonatomic) IBOutlet UILabel *contentTipBody;
|
||||||
@property (weak, nonatomic) IBOutlet UIImageView *contentTipEditIcon;
|
@property (weak, nonatomic) IBOutlet UILabel *userNameTipBody;
|
||||||
|
@property (weak, nonatomic) IBOutlet UIImageView *toolTipEditIcon;
|
||||||
@property (weak, nonatomic) IBOutlet UIView *searchTipContainer;
|
@property (weak, nonatomic) IBOutlet UIView *searchTipContainer;
|
||||||
@property (weak, nonatomic) IBOutlet UIView *actionsTipContainer;
|
@property (weak, nonatomic) IBOutlet UIView *actionsTipContainer;
|
||||||
@property (weak, nonatomic) IBOutlet UIView *typeTipContainer;
|
@property (weak, nonatomic) IBOutlet UIView *typeTipContainer;
|
||||||
|
@property (weak, nonatomic) IBOutlet UIView *toolTipContainer;
|
||||||
|
@property (weak, nonatomic) IBOutlet UILabel *toolTipBody;
|
||||||
|
@property (weak, nonatomic) IBOutlet UIView *userNameContainer;
|
||||||
|
@property (weak, nonatomic) IBOutlet UITextField *userNameField;
|
||||||
|
@property (weak, nonatomic) IBOutlet UIButton *passwordUser;
|
||||||
|
@property (weak, nonatomic) IBOutlet UIView *outdatedAlertContainer;
|
||||||
|
@property (weak, nonatomic) IBOutlet UIImageView *outdatedAlertBack;
|
||||||
|
@property (weak, nonatomic) IBOutlet UIButton *outdatedAlertCloseButton;
|
||||||
|
|
||||||
|
|
||||||
@property (copy) void (^contentTipCleanup)(BOOL finished);
|
@property (copy) void (^contentTipCleanup)(BOOL finished);
|
||||||
|
@property (copy) void (^toolTipCleanup)(BOOL finished);
|
||||||
|
|
||||||
- (IBAction)copyContent;
|
- (IBAction)copyContent;
|
||||||
- (IBAction)incrementPasswordCounter;
|
- (IBAction)incrementPasswordCounter;
|
||||||
- (IBAction)resetPasswordCounter:(UILongPressGestureRecognizer *)sender;
|
- (IBAction)resetPasswordCounter:(UILongPressGestureRecognizer *)sender;
|
||||||
|
- (IBAction)editUserName:(UILongPressGestureRecognizer *)sender;
|
||||||
- (IBAction)editPassword;
|
- (IBAction)editPassword;
|
||||||
- (IBAction)closeAlert;
|
- (IBAction)closeAlert;
|
||||||
|
- (IBAction)upgradePassword;
|
||||||
- (IBAction)action:(UIBarButtonItem *)sender;
|
- (IBAction)action:(UIBarButtonItem *)sender;
|
||||||
|
- (IBAction)toggleUser;
|
||||||
|
- (IBAction)searchOutdatedElements;
|
||||||
|
- (IBAction)closeOutdatedAlert;
|
||||||
|
- (IBAction)infoOutdatedAlert;
|
||||||
|
|
||||||
- (BOOL)isHelpVisible;
|
|
||||||
- (void)toggleHelpAnimated:(BOOL)animated;
|
- (void)toggleHelpAnimated:(BOOL)animated;
|
||||||
- (void)setHelpHidden:(BOOL)hidden animated:(BOOL)animated;
|
- (void)setHelpHidden:(BOOL)hidden animated:(BOOL)animated;
|
||||||
- (void)setHelpChapter:(NSString *)chapter;
|
- (void)setHelpChapter:(NSString *)chapter;
|
||||||
|
|||||||
@@ -13,17 +13,8 @@
|
|||||||
#import "LocalyticsSession.h"
|
#import "LocalyticsSession.h"
|
||||||
|
|
||||||
|
|
||||||
@interface MPMainViewController (Private)
|
|
||||||
|
|
||||||
- (void)updateAnimated:(BOOL)animated;
|
|
||||||
- (void)showContentTip:(NSString *)message withIcon:(UIImageView *)icon;
|
|
||||||
- (void)showAlertWithTitle:(NSString *)title message:(NSString *)message;
|
|
||||||
- (void)changeElementWithWarning:(NSString *)warning do:(void (^)(void))task;
|
|
||||||
- (void)changeElementWithoutWarningDo:(void (^)(void))task;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation MPMainViewController
|
@implementation MPMainViewController
|
||||||
|
@synthesize userNameHidden = _userNameHidden;
|
||||||
@synthesize activeElement = _activeElement;
|
@synthesize activeElement = _activeElement;
|
||||||
@synthesize searchDelegate = _searchDelegate;
|
@synthesize searchDelegate = _searchDelegate;
|
||||||
@synthesize typeButton = _typeButton;
|
@synthesize typeButton = _typeButton;
|
||||||
@@ -32,20 +23,31 @@
|
|||||||
@synthesize passwordCounter = _passwordCounter;
|
@synthesize passwordCounter = _passwordCounter;
|
||||||
@synthesize passwordIncrementer = _passwordIncrementer;
|
@synthesize passwordIncrementer = _passwordIncrementer;
|
||||||
@synthesize passwordEdit = _passwordEdit;
|
@synthesize passwordEdit = _passwordEdit;
|
||||||
|
@synthesize passwordUpgrade = _passwordUpgrade;
|
||||||
@synthesize contentContainer = _contentContainer;
|
@synthesize contentContainer = _contentContainer;
|
||||||
|
@synthesize displayContainer = _displayContainer;
|
||||||
@synthesize helpContainer = _helpContainer;
|
@synthesize helpContainer = _helpContainer;
|
||||||
@synthesize contentTipContainer = _copiedContainer;
|
@synthesize contentTipContainer = _copiedContainer;
|
||||||
|
@synthesize userNameTipContainer = _userNameTipContainer;
|
||||||
@synthesize alertContainer = _alertContainer;
|
@synthesize alertContainer = _alertContainer;
|
||||||
@synthesize alertTitle = _alertTitle;
|
@synthesize alertTitle = _alertTitle;
|
||||||
@synthesize alertBody = _alertBody;
|
@synthesize alertBody = _alertBody;
|
||||||
@synthesize contentTipBody = _contentTipBody;
|
@synthesize contentTipBody = _contentTipBody;
|
||||||
@synthesize contentTipEditIcon = _contentTipEditIcon;
|
@synthesize userNameTipBody = _userNameTipBody;
|
||||||
|
@synthesize toolTipEditIcon = _contentTipEditIcon;
|
||||||
@synthesize searchTipContainer = _searchTipContainer;
|
@synthesize searchTipContainer = _searchTipContainer;
|
||||||
@synthesize actionsTipContainer = _actionsTipContainer;
|
@synthesize actionsTipContainer = _actionsTipContainer;
|
||||||
@synthesize typeTipContainer = _typeTipContainer;
|
@synthesize typeTipContainer = _typeTipContainer;
|
||||||
@synthesize resetPasswordCounterGesture = _resetPasswordCounterGesture;
|
@synthesize toolTipContainer = _toolTipContainer;
|
||||||
|
@synthesize toolTipBody = _toolTipBody;
|
||||||
|
@synthesize userNameContainer = _userNameContainer;
|
||||||
|
@synthesize userNameField = _userNameField;
|
||||||
|
@synthesize passwordUser = _passwordUser;
|
||||||
|
@synthesize outdatedAlertContainer = _outdatedAlertContainer;
|
||||||
|
@synthesize outdatedAlertBack = _outdatedAlertBack;
|
||||||
|
@synthesize outdatedAlertCloseButton = _outdatedAlertCloseButton;
|
||||||
@synthesize contentField = _contentField;
|
@synthesize contentField = _contentField;
|
||||||
@synthesize contentTipCleanup;
|
@synthesize contentTipCleanup = _contentTipCleanup, toolTipCleanup = _toolTipCleanup;
|
||||||
|
|
||||||
#pragma mark - View lifecycle
|
#pragma mark - View lifecycle
|
||||||
|
|
||||||
@@ -56,7 +58,8 @@
|
|||||||
|
|
||||||
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
|
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
|
||||||
|
|
||||||
[self setHelpHidden:![self isHelpVisible] animated:NO];
|
[self updateHelpHiddenAnimated:NO];
|
||||||
|
[self updateUserHiddenAnimated:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -77,15 +80,37 @@
|
|||||||
self.searchDisplayController.searchResultsDelegate = self.searchDelegate;
|
self.searchDisplayController.searchResultsDelegate = self.searchDelegate;
|
||||||
self.searchDisplayController.searchResultsDataSource = self.searchDelegate;
|
self.searchDisplayController.searchResultsDataSource = self.searchDelegate;
|
||||||
|
|
||||||
self.resetPasswordCounterGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(resetPasswordCounter:)];
|
[self.passwordIncrementer addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self
|
||||||
[self.passwordIncrementer addGestureRecognizer:self.resetPasswordCounterGesture];
|
action:@selector(resetPasswordCounter:)]];
|
||||||
|
[self.userNameContainer addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self
|
||||||
|
action:@selector(editUserName:)]];
|
||||||
|
[self.userNameContainer addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(copyUserName:)]];
|
||||||
|
[self.outdatedAlertBack addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
|
||||||
|
action:@selector(infoOutdatedAlert)]];
|
||||||
|
|
||||||
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"ui_background"]];
|
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"ui_background"]];
|
||||||
|
|
||||||
self.contentField.font = [UIFont fontWithName:@"Exo-Black" size:self.contentField.font.pointSize];
|
self.contentField.font = [UIFont fontWithName:@"Exo-Black" size:self.contentField.font.pointSize];
|
||||||
|
|
||||||
self.alertBody.text = nil;
|
self.alertBody.text = nil;
|
||||||
self.contentTipEditIcon.hidden = YES;
|
self.toolTipEditIcon.hidden = YES;
|
||||||
|
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidEnterBackgroundNotification object:self queue:nil
|
||||||
|
usingBlock:^(NSNotification *note) {
|
||||||
|
[MPAppDelegate get].activeUser.requiresExplicitMigration = NO;
|
||||||
|
}];
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserverForName:MPNotificationElementUpdated object:nil queue:nil
|
||||||
|
usingBlock:^void(NSNotification *note) {
|
||||||
|
if (self.activeElement.type & MPElementTypeClassStored
|
||||||
|
&& ![[self.activeElement.content description] length])
|
||||||
|
[self showToolTip:@"Tap to set a password." withIcon:self.toolTipEditIcon];
|
||||||
|
if (self.activeElement.requiresExplicitMigration)
|
||||||
|
[self showToolTip:@"Password outdated. Tap to upgrade it." withIcon:nil];
|
||||||
|
}];
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserverForName:MPNotificationSignedOut object:nil queue:nil
|
||||||
|
usingBlock:^void(NSNotification *note) {
|
||||||
|
self.activeElement = nil;
|
||||||
|
}];
|
||||||
|
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
}
|
}
|
||||||
@@ -95,18 +120,20 @@
|
|||||||
inf(@"Main will appear.");
|
inf(@"Main will appear.");
|
||||||
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:animated? UIStatusBarAnimationSlide: UIStatusBarAnimationNone];
|
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:animated? UIStatusBarAnimationSlide: UIStatusBarAnimationNone];
|
||||||
|
|
||||||
if (![MPAppDelegate get].activeUser)
|
if ([[MPiOSConfig get].showQuickStart boolValue])
|
||||||
[self.navigationController presentViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"MPUnlockViewController"]
|
[[MPAppDelegate get] showGuide];
|
||||||
animated:animated completion:nil];
|
|
||||||
if (self.activeElement.user != [MPAppDelegate get].activeUser)
|
if (self.activeElement.user != [MPAppDelegate get].activeUser)
|
||||||
self.activeElement = nil;
|
self.activeElement = nil;
|
||||||
self.searchDisplayController.searchBar.text = nil;
|
self.searchDisplayController.searchBar.text = nil;
|
||||||
|
|
||||||
|
self.alertContainer.alpha = 0;
|
||||||
|
self.outdatedAlertContainer.alpha = 0;
|
||||||
self.searchTipContainer.alpha = 0;
|
self.searchTipContainer.alpha = 0;
|
||||||
self.actionsTipContainer.alpha = 0;
|
self.actionsTipContainer.alpha = 0;
|
||||||
self.typeTipContainer.alpha = 0;
|
self.typeTipContainer.alpha = 0;
|
||||||
|
self.toolTipContainer.alpha = 0;
|
||||||
|
|
||||||
[self setHelpHidden:[[MPiOSConfig get].helpHidden boolValue] animated:animated];
|
|
||||||
[self updateAnimated:animated];
|
[self updateAnimated:animated];
|
||||||
|
|
||||||
[super viewWillAppear:animated];
|
[super viewWillAppear:animated];
|
||||||
@@ -114,11 +141,17 @@
|
|||||||
|
|
||||||
- (void)viewDidAppear:(BOOL)animated {
|
- (void)viewDidAppear:(BOOL)animated {
|
||||||
|
|
||||||
if ([[MPiOSConfig get].firstRun boolValue])
|
if (![MPAppDelegate get].activeUser)
|
||||||
|
[self.navigationController presentViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"MPUnlockViewController"]
|
||||||
|
animated:animated completion:nil];
|
||||||
|
|
||||||
|
if (![[MPiOSConfig get].actionsTipShown boolValue])
|
||||||
[UIView animateWithDuration:animated? 0.3f: 0 animations:^{
|
[UIView animateWithDuration:animated? 0.3f: 0 animations:^{
|
||||||
self.actionsTipContainer.alpha = 1;
|
self.actionsTipContainer.alpha = 1;
|
||||||
} completion:^(BOOL finished) {
|
} completion:^(BOOL finished) {
|
||||||
if (finished) {
|
if (finished) {
|
||||||
|
[MPiOSConfig get].actionsTipShown = PearlBool(YES);
|
||||||
|
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
[UIView animateWithDuration:0.2f animations:^{
|
[UIView animateWithDuration:0.2f animations:^{
|
||||||
self.actionsTipContainer.alpha = 0;
|
self.actionsTipContainer.alpha = 0;
|
||||||
@@ -132,6 +165,33 @@
|
|||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
if ([MPAppDelegate get].activeUser)
|
||||||
|
[[MPAppDelegate get].managedObjectContextIfReady performBlock:^void() {
|
||||||
|
NSError *error = nil;
|
||||||
|
NSFetchRequest *migrationRequest = [NSFetchRequest
|
||||||
|
fetchRequestWithEntityName:NSStringFromClass([MPElementEntity class])];
|
||||||
|
migrationRequest.predicate = [NSPredicate predicateWithFormat:@"version_ < %d", MPAlgorithmDefaultVersion];
|
||||||
|
NSArray *migrationElements = [[MPAppDelegate get].managedObjectContextIfReady executeFetchRequest:migrationRequest
|
||||||
|
error:&error];
|
||||||
|
if (!migrationElements) {
|
||||||
|
err(@"While looking for elements to migrate: %@", error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL didRequireExplicitMigration = [MPAppDelegate_Shared get].activeUser.requiresExplicitMigration;
|
||||||
|
if (didRequireExplicitMigration)
|
||||||
|
[MPAppDelegate_Shared get].activeUser.requiresExplicitMigration = NO;
|
||||||
|
for (MPElementEntity *migrationElement in migrationElements)
|
||||||
|
if (![migrationElement migrateExplicitly:NO])
|
||||||
|
[MPAppDelegate_Shared get].activeUser.requiresExplicitMigration = YES;
|
||||||
|
|
||||||
|
if (!didRequireExplicitMigration && [MPAppDelegate_Shared get].activeUser.requiresExplicitMigration)
|
||||||
|
[UIView animateWithDuration:0.3f animations:^{
|
||||||
|
self.outdatedAlertContainer.alpha = 1;
|
||||||
|
}];
|
||||||
|
|
||||||
|
}];
|
||||||
|
|
||||||
[super viewDidAppear:animated];
|
[super viewDidAppear:animated];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,6 +210,7 @@
|
|||||||
[self setPasswordCounter:nil];
|
[self setPasswordCounter:nil];
|
||||||
[self setPasswordIncrementer:nil];
|
[self setPasswordIncrementer:nil];
|
||||||
[self setPasswordEdit:nil];
|
[self setPasswordEdit:nil];
|
||||||
|
[self setPasswordUpgrade:nil];
|
||||||
[self setContentContainer:nil];
|
[self setContentContainer:nil];
|
||||||
[self setHelpContainer:nil];
|
[self setHelpContainer:nil];
|
||||||
[self setContentTipContainer:nil];
|
[self setContentTipContainer:nil];
|
||||||
@@ -157,12 +218,21 @@
|
|||||||
[self setAlertTitle:nil];
|
[self setAlertTitle:nil];
|
||||||
[self setAlertBody:nil];
|
[self setAlertBody:nil];
|
||||||
[self setContentTipBody:nil];
|
[self setContentTipBody:nil];
|
||||||
[self setContentTipEditIcon:nil];
|
[self setToolTipEditIcon:nil];
|
||||||
[self setSearchTipContainer:nil];
|
[self setSearchTipContainer:nil];
|
||||||
[self setActionsTipContainer:nil];
|
[self setActionsTipContainer:nil];
|
||||||
[self setTypeTipContainer:nil];
|
[self setTypeTipContainer:nil];
|
||||||
[self setSearchDelegate:nil];
|
[self setToolTipContainer:nil];
|
||||||
[self setResetPasswordCounterGesture:nil];
|
[self setToolTipBody:nil];
|
||||||
|
[self setDisplayContainer:nil];
|
||||||
|
[self setUserNameField:nil];
|
||||||
|
[self setUserNameTipContainer:nil];
|
||||||
|
[self setUserNameTipBody:nil];
|
||||||
|
[self setUserNameContainer:nil];
|
||||||
|
[self setPasswordUser:nil];
|
||||||
|
[self setOutdatedAlertContainer:nil];
|
||||||
|
[self setOutdatedAlertCloseButton:nil];
|
||||||
|
[self setOutdatedAlertBack:nil];
|
||||||
[super viewDidUnload];
|
[super viewDidUnload];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,21 +246,39 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
[self setHelpChapter:self.activeElement? @"2": @"1"];
|
[self setHelpChapter:self.activeElement? @"2": @"1"];
|
||||||
|
[self updateHelpHiddenAnimated:NO];
|
||||||
|
|
||||||
|
self.passwordCounter.alpha = 0;
|
||||||
|
self.passwordIncrementer.alpha = 0;
|
||||||
|
self.passwordEdit.alpha = 0;
|
||||||
|
self.passwordUpgrade.alpha = 0;
|
||||||
|
self.passwordUser.alpha = 0;
|
||||||
|
|
||||||
|
if (self.activeElement)
|
||||||
|
self.passwordUser.alpha = 0.5f;
|
||||||
|
|
||||||
|
if (self.activeElement.requiresExplicitMigration)
|
||||||
|
self.passwordUpgrade.alpha = 0.5f;
|
||||||
|
|
||||||
|
else {
|
||||||
|
if (self.activeElement.type & MPElementTypeClassGenerated) {
|
||||||
|
self.passwordCounter.alpha = 0.5f;
|
||||||
|
self.passwordIncrementer.alpha = 0.5f;
|
||||||
|
} else
|
||||||
|
if (self.activeElement.type & MPElementTypeClassStored)
|
||||||
|
self.passwordEdit.alpha = 0.5f;
|
||||||
|
}
|
||||||
|
|
||||||
self.siteName.text = self.activeElement.name;
|
self.siteName.text = self.activeElement.name;
|
||||||
|
|
||||||
self.passwordCounter.alpha = self.activeElement.type & MPElementTypeClassGenerated? 0.5f: 0;
|
self.typeButton.alpha = self.activeElement? 1: 0;
|
||||||
self.passwordIncrementer.alpha = self.activeElement.type & MPElementTypeClassGenerated? 0.5f: 0;
|
[self.typeButton setTitle:self.activeElement.typeName
|
||||||
self.passwordEdit.alpha = self.activeElement.type & MPElementTypeClassStored? 0.5f: 0;
|
|
||||||
|
|
||||||
[self.typeButton setTitle:NSStringFromMPElementType(self.activeElement.type)
|
|
||||||
forState:UIControlStateNormal];
|
forState:UIControlStateNormal];
|
||||||
self.typeButton.alpha = NSStringFromMPElementType(self.activeElement.type).length? 1: 0;
|
|
||||||
|
|
||||||
self.contentField.enabled = NO;
|
|
||||||
|
|
||||||
if ([self.activeElement isKindOfClass:[MPElementGeneratedEntity class]])
|
if ([self.activeElement isKindOfClass:[MPElementGeneratedEntity class]])
|
||||||
self.passwordCounter.text = PearlString(@"%u", ((MPElementGeneratedEntity *)self.activeElement).counter);
|
self.passwordCounter.text = PearlString(@"%u", ((MPElementGeneratedEntity *)self.activeElement).counter);
|
||||||
|
|
||||||
|
self.contentField.enabled = NO;
|
||||||
self.contentField.text = @"";
|
self.contentField.text = @"";
|
||||||
if (self.activeElement.name && ![self.activeElement isDeleted])
|
if (self.activeElement.name && ![self.activeElement isDeleted])
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
|
||||||
@@ -200,33 +288,71 @@
|
|||||||
self.contentField.text = description;
|
self.contentField.text = description;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)isHelpVisible {
|
self.userNameField.enabled = NO;
|
||||||
|
self.userNameField.text = self.activeElement.userName;
|
||||||
return self.helpContainer.frame.origin.y == 216;
|
self.userNameHidden = !self.activeElement || ([[MPiOSConfig get].userNameHidden boolValue] && (self.activeElement.userName
|
||||||
|
== nil));
|
||||||
|
[self updateUserHiddenAnimated:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)toggleHelpAnimated:(BOOL)animated {
|
- (void)toggleHelpAnimated:(BOOL)animated {
|
||||||
|
|
||||||
[self setHelpHidden:[self isHelpVisible] animated:animated];
|
[self setHelpHidden:![[MPiOSConfig get].helpHidden boolValue] animated:animated];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setHelpHidden:(BOOL)hidden animated:(BOOL)animated {
|
- (void)setHelpHidden:(BOOL)hidden animated:(BOOL)animated {
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
[MPiOSConfig get].helpHidden = PearlBool(hidden);
|
||||||
[UIView animateWithDuration:animated? 0.3f: 0 animations:^{
|
[self updateHelpHiddenAnimated:animated];
|
||||||
if (hidden) {
|
|
||||||
self.contentContainer.frame = CGRectSetHeight(self.contentContainer.frame, self.view.bounds.size.height - 44);
|
|
||||||
self.helpContainer.frame = CGRectSetY(self.helpContainer.frame, self.view.bounds.size.height);
|
|
||||||
[MPiOSConfig get].helpHidden = [NSNumber numberWithBool:YES];
|
|
||||||
} else {
|
|
||||||
self.contentContainer.frame = CGRectSetHeight(self.contentContainer.frame, 175);
|
|
||||||
self.helpContainer.frame = CGRectSetY(self.helpContainer.frame, 216);
|
|
||||||
[MPiOSConfig get].helpHidden = [NSNumber numberWithBool:NO];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)updateHelpHiddenAnimated:(BOOL)animated {
|
||||||
|
|
||||||
|
if (animated) {
|
||||||
|
[UIView animateWithDuration:0.3f animations:^{
|
||||||
|
[self updateHelpHiddenAnimated:NO];
|
||||||
}];
|
}];
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([[MPiOSConfig get].helpHidden boolValue]) {
|
||||||
|
self.contentContainer.frame = CGRectSetHeight(self.contentContainer.frame, self.view.bounds.size.height - 44 /* search bar */);
|
||||||
|
self.helpContainer.frame = CGRectSetY(self.helpContainer.frame,
|
||||||
|
self.view.bounds.size.height + 20 /* view moves up a bit when search appears. */);
|
||||||
|
} else {
|
||||||
|
self.contentContainer.frame = CGRectSetHeight(self.contentContainer.frame, 225);
|
||||||
|
self.helpContainer.frame = CGRectSetY(self.helpContainer.frame, 266);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (IBAction)toggleUser {
|
||||||
|
|
||||||
|
[self toggleUserAnimated:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)toggleUserAnimated:(BOOL)animated {
|
||||||
|
|
||||||
|
[MPiOSConfig get].userNameHidden = PearlBool(!self.userNameHidden);
|
||||||
|
self.userNameHidden = [[MPiOSConfig get].userNameHidden boolValue];
|
||||||
|
[self updateUserHiddenAnimated:animated];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)updateUserHiddenAnimated:(BOOL)animated {
|
||||||
|
|
||||||
|
if (animated) {
|
||||||
|
[UIView animateWithDuration:0.3f animations:^{
|
||||||
|
[self updateUserHiddenAnimated:NO];
|
||||||
|
}];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (self.userNameHidden) {
|
||||||
|
self.displayContainer.frame = CGRectSetHeight(self.displayContainer.frame, 87);
|
||||||
|
} else {
|
||||||
|
self.displayContainer.frame = CGRectSetHeight(self.displayContainer.frame, 137);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setHelpChapter:(NSString *)chapter {
|
- (void)setHelpChapter:(NSString *)chapter {
|
||||||
@@ -243,7 +369,7 @@
|
|||||||
- (void)webViewDidFinishLoad:(UIWebView *)webView {
|
- (void)webViewDidFinishLoad:(UIWebView *)webView {
|
||||||
|
|
||||||
NSString *error = [self.helpView stringByEvaluatingJavaScriptFromString:
|
NSString *error = [self.helpView stringByEvaluatingJavaScriptFromString:
|
||||||
PearlString(@"setClass('%@');", ClassNameFromMPElementType(self.activeElement.type))];
|
PearlString(@"setClass('%@');", self.activeElement.typeClassName)];
|
||||||
if (error.length)
|
if (error.length)
|
||||||
err(@"helpView.setClass: %@", error);
|
err(@"helpView.setClass: %@", error);
|
||||||
}
|
}
|
||||||
@@ -276,6 +402,54 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)showUserNameTip:(NSString *)message {
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
self.userNameTipBody.text = message;
|
||||||
|
|
||||||
|
[UIView animateWithDuration:0.3f animations:^{
|
||||||
|
self.userNameTipContainer.alpha = 1;
|
||||||
|
} completion:^(BOOL finished) {
|
||||||
|
if (finished) {
|
||||||
|
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC);
|
||||||
|
dispatch_after(popTime, dispatch_get_main_queue(), ^(void) {
|
||||||
|
[UIView animateWithDuration:0.2f animations:^{
|
||||||
|
self.userNameTipContainer.alpha = 0;
|
||||||
|
}];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)showToolTip:(NSString *)message withIcon:(UIImageView *)icon {
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
if (self.toolTipCleanup)
|
||||||
|
self.toolTipCleanup(NO);
|
||||||
|
|
||||||
|
self.toolTipBody.text = message;
|
||||||
|
self.toolTipCleanup = ^(BOOL finished) {
|
||||||
|
icon.hidden = YES;
|
||||||
|
self.toolTipCleanup = nil;
|
||||||
|
};
|
||||||
|
|
||||||
|
icon.hidden = NO;
|
||||||
|
[UIView animateWithDuration:0.3f animations:^{
|
||||||
|
self.toolTipContainer.alpha = 1;
|
||||||
|
} completion:^(BOOL finished) {
|
||||||
|
if (finished) {
|
||||||
|
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC);
|
||||||
|
dispatch_after(popTime, dispatch_get_main_queue(), ^(void) {
|
||||||
|
[UIView animateWithDuration:0.2f animations:^{
|
||||||
|
self.toolTipContainer.alpha = 0;
|
||||||
|
} completion:self.toolTipCleanup];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
- (void)showAlertWithTitle:(NSString *)title message:(NSString *)message {
|
- (void)showAlertWithTitle:(NSString *)title message:(NSString *)message {
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
@@ -308,7 +482,28 @@
|
|||||||
[TestFlight passCheckpoint:MPCheckpointCopyToPasteboard];
|
[TestFlight passCheckpoint:MPCheckpointCopyToPasteboard];
|
||||||
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointCopyToPasteboard
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointCopyToPasteboard
|
||||||
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
NSStringFromMPElementType(self.activeElement.type), @"type",
|
self.activeElement.typeName, @"type",
|
||||||
|
PearlUnsignedInteger(self.activeElement.version),
|
||||||
|
@"version",
|
||||||
|
nil]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (IBAction)copyUserName:(UITapGestureRecognizer *)sender {
|
||||||
|
|
||||||
|
if (!self.activeElement.userName)
|
||||||
|
return;
|
||||||
|
|
||||||
|
inf(@"Copying user name for: %@", self.activeElement.name);
|
||||||
|
[UIPasteboard generalPasteboard].string = [self.activeElement.content description];
|
||||||
|
|
||||||
|
[self showUserNameTip:@"Copied!"];
|
||||||
|
|
||||||
|
[TestFlight passCheckpoint:MPCheckpointCopyUserNameToPasteboard];
|
||||||
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointCopyUserNameToPasteboard
|
||||||
|
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
|
self.activeElement.typeName, @"type",
|
||||||
|
PearlUnsignedInteger(self.activeElement.version),
|
||||||
|
@"version",
|
||||||
nil]];
|
nil]];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,7 +525,10 @@
|
|||||||
[TestFlight passCheckpoint:MPCheckpointIncrementPasswordCounter];
|
[TestFlight passCheckpoint:MPCheckpointIncrementPasswordCounter];
|
||||||
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointIncrementPasswordCounter
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointIncrementPasswordCounter
|
||||||
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
NSStringFromMPElementType(self.activeElement.type), @"type",
|
self.activeElement.typeName,
|
||||||
|
@"type",
|
||||||
|
PearlUnsignedInteger(self.activeElement.version),
|
||||||
|
@"version",
|
||||||
nil]];
|
nil]];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
@@ -358,11 +556,35 @@
|
|||||||
[TestFlight passCheckpoint:MPCheckpointResetPasswordCounter];
|
[TestFlight passCheckpoint:MPCheckpointResetPasswordCounter];
|
||||||
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointResetPasswordCounter
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointResetPasswordCounter
|
||||||
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
NSStringFromMPElementType(self.activeElement.type), @"type",
|
self.activeElement.typeName,
|
||||||
|
@"type",
|
||||||
|
PearlUnsignedInteger(self.activeElement.version),
|
||||||
|
@"version",
|
||||||
nil]];
|
nil]];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (IBAction)editUserName:(UILongPressGestureRecognizer *)sender {
|
||||||
|
|
||||||
|
if (sender.state != UIGestureRecognizerStateBegan)
|
||||||
|
// Only fire when the gesture was first detected.
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!self.activeElement)
|
||||||
|
return;
|
||||||
|
|
||||||
|
self.userNameField.enabled = YES;
|
||||||
|
[self.userNameField becomeFirstResponder];
|
||||||
|
|
||||||
|
[TestFlight passCheckpoint:MPCheckpointEditUserName];
|
||||||
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointEditUserName attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
|
self.activeElement.typeName,
|
||||||
|
@"type",
|
||||||
|
PearlUnsignedInteger(self.activeElement.version),
|
||||||
|
@"version",
|
||||||
|
nil]];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)changeElementWithWarning:(NSString *)warning do:(void (^)(void))task; {
|
- (void)changeElementWithWarning:(NSString *)warning do:(void (^)(void))task; {
|
||||||
|
|
||||||
[PearlAlert showAlertWithTitle:@"Password Change" message:warning viewStyle:UIAlertViewStyleDefault
|
[PearlAlert showAlertWithTitle:@"Password Change" message:warning viewStyle:UIAlertViewStyleDefault
|
||||||
@@ -403,12 +625,45 @@
|
|||||||
[TestFlight passCheckpoint:MPCheckpointEditPassword];
|
[TestFlight passCheckpoint:MPCheckpointEditPassword];
|
||||||
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointEditPassword
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointEditPassword
|
||||||
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
NSStringFromMPElementType(
|
self.activeElement.typeName, @"type",
|
||||||
self.activeElement.type), @"type",
|
PearlUnsignedInteger(self.activeElement.version),
|
||||||
|
@"version",
|
||||||
nil]];
|
nil]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (IBAction)upgradePassword {
|
||||||
|
|
||||||
|
[self changeElementWithWarning:
|
||||||
|
self.activeElement.type & MPElementTypeClassGenerated?
|
||||||
|
@"You are upgrading the site.\n\n"
|
||||||
|
@"This upgrade improves the site's compatibility with the latest version of Master Password.\n\n"
|
||||||
|
@"Your password will change and you will need to update your site's account."
|
||||||
|
:
|
||||||
|
@"You are upgrading the site.\n\n"
|
||||||
|
@"This upgrade improves the site's compatibility with the latest version of Master Password."
|
||||||
|
do:^{
|
||||||
|
inf(@"Explicitly migrating element: %@", self.activeElement);
|
||||||
|
[self.activeElement migrateExplicitly:YES];
|
||||||
|
|
||||||
|
[TestFlight passCheckpoint:MPCheckpointExplicitMigration];
|
||||||
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointExplicitMigration
|
||||||
|
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
|
self.activeElement.typeName,
|
||||||
|
@"type",
|
||||||
|
PearlUnsignedInteger(self.activeElement.version),
|
||||||
|
@"version",
|
||||||
|
nil]];
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (IBAction)searchOutdatedElements {
|
||||||
|
|
||||||
|
self.searchDisplayController.searchBar.selectedScopeButtonIndex = MPSearchScopeOutdated;
|
||||||
|
self.searchDisplayController.searchBar.searchResultsButtonSelected = YES;
|
||||||
|
[self.searchDisplayController.searchBar becomeFirstResponder];
|
||||||
|
}
|
||||||
|
|
||||||
- (IBAction)closeAlert {
|
- (IBAction)closeAlert {
|
||||||
|
|
||||||
[UIView animateWithDuration:0.3f animations:^{
|
[UIView animateWithDuration:0.3f animations:^{
|
||||||
@@ -421,9 +676,27 @@
|
|||||||
[TestFlight passCheckpoint:MPCheckpointCloseAlert];
|
[TestFlight passCheckpoint:MPCheckpointCloseAlert];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (IBAction)closeOutdatedAlert {
|
||||||
|
|
||||||
|
[UIView animateWithDuration:0.3f animations:^{
|
||||||
|
self.outdatedAlertContainer.alpha = 0;
|
||||||
|
}];
|
||||||
|
|
||||||
|
[TestFlight passCheckpoint:MPCheckpointCloseOutdatedAlert];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (IBAction)infoOutdatedAlert {
|
||||||
|
|
||||||
|
[self setHelpChapter:@"outdated"];
|
||||||
|
[self setHelpHidden:NO animated:YES];
|
||||||
|
[self closeOutdatedAlert];
|
||||||
|
[MPAppDelegate get].activeUser.requiresExplicitMigration = NO;
|
||||||
|
}
|
||||||
|
|
||||||
- (IBAction)action:(id)sender {
|
- (IBAction)action:(id)sender {
|
||||||
|
|
||||||
[PearlSheet showSheetWithTitle:nil message:nil viewStyle:UIActionSheetStyleAutomatic
|
[PearlSheet showSheetWithTitle:nil message:nil viewStyle:UIActionSheetStyleAutomatic
|
||||||
|
initSheet:nil
|
||||||
tappedButtonBlock:^(UIActionSheet *sheet, NSInteger buttonIndex) {
|
tappedButtonBlock:^(UIActionSheet *sheet, NSInteger buttonIndex) {
|
||||||
if (buttonIndex == [sheet cancelButtonIndex])
|
if (buttonIndex == [sheet cancelButtonIndex])
|
||||||
return;
|
return;
|
||||||
@@ -481,7 +754,8 @@
|
|||||||
MFMailComposeViewController *composer = [MFMailComposeViewController new];
|
MFMailComposeViewController *composer = [MFMailComposeViewController new];
|
||||||
[composer setMailComposeDelegate:self];
|
[composer setMailComposeDelegate:self];
|
||||||
[composer setToRecipients:[NSArray arrayWithObject:@"Master Password Development <masterpassword@lyndir.com>"]];
|
[composer setToRecipients:[NSArray arrayWithObject:@"Master Password Development <masterpassword@lyndir.com>"]];
|
||||||
[composer setSubject:PearlString(@"Feedback for Master Password [%@]", [[PearlKeyChain deviceIdentifier] stringByDeletingMatchesOf:@"-.*"])];
|
[composer setSubject:PearlString(@"Feedback for Master Password [%@]",
|
||||||
|
[[PearlKeyChain deviceIdentifier] stringByDeletingMatchesOf:@"-.*"])];
|
||||||
[composer setMessageBody:
|
[composer setMessageBody:
|
||||||
PearlString(
|
PearlString(
|
||||||
@"\n\n\n"
|
@"\n\n\n"
|
||||||
@@ -494,7 +768,8 @@
|
|||||||
isHTML:NO];
|
isHTML:NO];
|
||||||
|
|
||||||
if (buttonIndex_ == [alert_ firstOtherButtonIndex]) {
|
if (buttonIndex_ == [alert_ firstOtherButtonIndex]) {
|
||||||
PearlLogLevel logLevel = [[MPiOSConfig get].sendInfo boolValue]? PearlLogLevelDebug: PearlLogLevelInfo;
|
PearlLogLevel logLevel = [[MPiOSConfig get].sendInfo boolValue]? PearlLogLevelDebug
|
||||||
|
: PearlLogLevelInfo;
|
||||||
[composer addAttachmentData:[[[PearlLogger get] formatMessagesWithLevel:logLevel] dataUsingEncoding:NSUTF8StringEncoding]
|
[composer addAttachmentData:[[[PearlLogger get] formatMessagesWithLevel:logLevel] dataUsingEncoding:NSUTF8StringEncoding]
|
||||||
mimeType:@"text/plain"
|
mimeType:@"text/plain"
|
||||||
fileName:PearlString(@"%@-%@.log",
|
fileName:PearlString(@"%@-%@.log",
|
||||||
@@ -515,12 +790,18 @@
|
|||||||
[[MPAppDelegate get] signOutAnimated:YES];
|
[[MPAppDelegate get] signOutAnimated:YES];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default: {
|
||||||
|
wrn(@"Unsupported action: %u", buttonIndex - [sheet firstOtherButtonIndex]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestFlight passCheckpoint:MPCheckpointAction];
|
[TestFlight passCheckpoint:MPCheckpointAction];
|
||||||
}
|
}
|
||||||
cancelTitle:[PearlStrings get].commonButtonCancel destructiveTitle:nil otherTitles:
|
cancelTitle:[PearlStrings get].commonButtonCancel destructiveTitle:nil otherTitles:
|
||||||
[self isHelpVisible]? @"Hide Help": @"Show Help", @"FAQ", @"Tutorial", @"Preferences", @"Feedback", @"Sign Out", nil];
|
[[MPiOSConfig get].helpHidden boolValue]? @"Show Help": @"Hide Help", @"FAQ", @"Tutorial", @"Preferences", @"Feedback", @"Sign Out",
|
||||||
|
nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result
|
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result
|
||||||
@@ -547,25 +828,25 @@
|
|||||||
@"You will need to update your account's old password to the new one."
|
@"You will need to update your account's old password to the new one."
|
||||||
do:^{
|
do:^{
|
||||||
// Update password type.
|
// Update password type.
|
||||||
if (ClassFromMPElementType(type) != ClassFromMPElementType(self.activeElement.type))
|
if ([self.activeElement.algorithm classOfType:type] != self.activeElement.typeClass)
|
||||||
// Type requires a different class of element. Recreate the element.
|
// Type requires a different class of element. Recreate the element.
|
||||||
[[MPAppDelegate managedObjectContext] performBlockAndWait:^{
|
[[MPAppDelegate managedObjectContextIfReady] performBlockAndWait:^{
|
||||||
MPElementEntity *newElement = [NSEntityDescription insertNewObjectForEntityForName:ClassNameFromMPElementType(
|
MPElementEntity *newElement = [NSEntityDescription insertNewObjectForEntityForName:[self.activeElement.algorithm classNameOfType:type]
|
||||||
type)
|
inManagedObjectContext:[MPAppDelegate managedObjectContextIfReady]];
|
||||||
inManagedObjectContext:[MPAppDelegate managedObjectContext]];
|
|
||||||
newElement.name = self.activeElement.name;
|
newElement.name = self.activeElement.name;
|
||||||
newElement.user = self.activeElement.user;
|
newElement.user = self.activeElement.user;
|
||||||
newElement.uses = self.activeElement.uses;
|
newElement.uses = self.activeElement.uses;
|
||||||
newElement.lastUsed = self.activeElement.lastUsed;
|
newElement.lastUsed = self.activeElement.lastUsed;
|
||||||
|
newElement.version = self.activeElement.version;
|
||||||
|
|
||||||
[[MPAppDelegate managedObjectContext] deleteObject:self.activeElement];
|
[[MPAppDelegate managedObjectContextIfReady] deleteObject:self.activeElement];
|
||||||
self.activeElement = newElement;
|
self.activeElement = newElement;
|
||||||
}];
|
}];
|
||||||
|
|
||||||
self.activeElement.type = type;
|
self.activeElement.type = type;
|
||||||
|
|
||||||
if (type & MPElementTypeClassStored && ![[self.activeElement.content description] length])
|
[[NSNotificationCenter defaultCenter] postNotificationName:MPNotificationElementUpdated
|
||||||
[self showContentTip:@"Tap to set a password." withIcon:self.contentTipEditIcon];
|
object:self.activeElement];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -586,12 +867,15 @@
|
|||||||
self.activeElement.name, self.activeElement.name)];
|
self.activeElement.name, self.activeElement.name)];
|
||||||
[[MPAppDelegate get] saveContext];
|
[[MPAppDelegate get] saveContext];
|
||||||
|
|
||||||
if ([[MPiOSConfig get].firstRun boolValue])
|
if (![[MPiOSConfig get].typeTipShown boolValue])
|
||||||
[UIView animateWithDuration:0.5f animations:^{
|
[UIView animateWithDuration:0.5f animations:^{
|
||||||
self.typeTipContainer.alpha = 1;
|
self.typeTipContainer.alpha = 1;
|
||||||
} completion:^(BOOL finished) {
|
} completion:^(BOOL finished) {
|
||||||
if (finished) {
|
if (finished) {
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
[MPiOSConfig get].typeTipShown = PearlBool(YES);
|
||||||
|
|
||||||
|
dispatch_after(
|
||||||
|
dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
[UIView animateWithDuration:0.2f animations:^{
|
[UIView animateWithDuration:0.2f animations:^{
|
||||||
self.typeTipContainer.alpha = 0;
|
self.typeTipContainer.alpha = 0;
|
||||||
}];
|
}];
|
||||||
@@ -599,17 +883,19 @@
|
|||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self.searchDisplayController setActive:NO animated:YES];
|
[[NSNotificationCenter defaultCenter] postNotificationName:MPNotificationElementUpdated object:self.activeElement];
|
||||||
self.searchDisplayController.searchBar.text = self.activeElement.name;
|
[TestFlight passCheckpoint:PearlString(MPCheckpointUseType @"_%@", self.activeElement.typeShortName)];
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPNotificationElementUsed object:self.activeElement];
|
|
||||||
[TestFlight passCheckpoint:PearlString(MPCheckpointUseType @"_%@", NSStringFromMPElementType(self.activeElement.type))];
|
|
||||||
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointUseType attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointUseType attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
NSStringFromMPElementType(
|
self.activeElement.typeName,
|
||||||
self.activeElement.type), @"type",
|
@"type",
|
||||||
|
PearlUnsignedInteger(self.activeElement.version),
|
||||||
|
@"version",
|
||||||
nil]];
|
nil]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[self.searchDisplayController setActive:NO animated:YES];
|
||||||
|
self.searchDisplayController.searchBar.text = self.activeElement.name;
|
||||||
|
|
||||||
[self updateAnimated:YES];
|
[self updateAnimated:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -617,6 +903,8 @@
|
|||||||
|
|
||||||
if (textField == self.contentField)
|
if (textField == self.contentField)
|
||||||
[self.contentField resignFirstResponder];
|
[self.contentField resignFirstResponder];
|
||||||
|
if (textField == self.userNameField)
|
||||||
|
[self.userNameField resignFirstResponder];
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
@@ -637,13 +925,32 @@
|
|||||||
((MPElementStoredEntity *)self.activeElement).content = self.contentField.text;
|
((MPElementStoredEntity *)self.activeElement).content = self.contentField.text;
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (textField == self.userNameField) {
|
||||||
|
self.userNameField.enabled = NO;
|
||||||
|
if (![[MPiOSConfig get].userNameTipShown boolValue]) {
|
||||||
|
[self showUserNameTip:@"Tap to copy or hold to edit."];
|
||||||
|
[MPiOSConfig get].userNameTipShown = PearlBool(YES);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([self.userNameField.text length])
|
||||||
|
self.activeElement.userName = self.userNameField.text;
|
||||||
|
else
|
||||||
|
self.activeElement.userName = nil;
|
||||||
|
|
||||||
|
[[MPAppDelegate get] saveContext];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
|
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
|
||||||
navigationType:(UIWebViewNavigationType)navigationType {
|
navigationType:(UIWebViewNavigationType)navigationType {
|
||||||
|
|
||||||
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
|
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
|
||||||
inf(@"External link: %@", [request URL]);
|
if ([[[request URL] query] isEqualToString:@"outdated"]) {
|
||||||
|
[self searchOutdatedElements];
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
[TestFlight passCheckpoint:MPCheckpointExternalLink];
|
[TestFlight passCheckpoint:MPCheckpointExternalLink];
|
||||||
|
|
||||||
[[UIApplication sharedApplication] openURL:[request URL]];
|
[[UIApplication sharedApplication] openURL:[request URL]];
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
} recurse:NO];
|
} recurse:NO];
|
||||||
|
|
||||||
self.savePasswordSwitch.on = [MPAppDelegate get].activeUser.saveKey;
|
self.savePasswordSwitch.on = [MPAppDelegate get].activeUser.saveKey;
|
||||||
self.defaultTypeLabel.text = NSStringShortFromMPElementType([MPAppDelegate get].activeUser.defaultType);
|
self.defaultTypeLabel.text = [[MPAppDelegate get].key.algorithm shortNameOfType:[MPAppDelegate get].activeUser.defaultType];
|
||||||
|
|
||||||
[super viewWillAppear:animated];
|
[super viewWillAppear:animated];
|
||||||
}
|
}
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
|
|
||||||
else
|
else
|
||||||
if (cell == self.changeMPCell)
|
if (cell == self.changeMPCell)
|
||||||
[[MPAppDelegate get] changeMasterPasswordFor:[MPAppDelegate get].activeUser];
|
[[MPAppDelegate get] changeMasterPasswordFor:[MPAppDelegate get].activeUser didResetBlock:nil];
|
||||||
|
|
||||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
[MPAppDelegate get].activeUser.defaultType = type;
|
[MPAppDelegate get].activeUser.defaultType = type;
|
||||||
[[MPAppDelegate get] saveContext];
|
[[MPAppDelegate get] saveContext];
|
||||||
|
|
||||||
self.defaultTypeLabel.text = NSStringShortFromMPElementType([MPAppDelegate get].activeUser.defaultType);
|
self.defaultTypeLabel.text = [[MPAppDelegate get].key.algorithm shortNameOfType:[MPAppDelegate get].activeUser.defaultType];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (MPElementType)selectedType {
|
- (MPElementType)selectedType {
|
||||||
|
|||||||
@@ -9,6 +9,11 @@
|
|||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "MPElementEntity.h"
|
#import "MPElementEntity.h"
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
MPSearchScopeAll,
|
||||||
|
MPSearchScopeOutdated,
|
||||||
|
} MPSearchScope;
|
||||||
|
|
||||||
@protocol MPSearchResultsDelegate<NSObject>
|
@protocol MPSearchResultsDelegate<NSObject>
|
||||||
|
|
||||||
- (void)didSelectElement:(MPElementEntity *)element;
|
- (void)didSelectElement:(MPElementEntity *)element;
|
||||||
@@ -18,7 +23,7 @@
|
|||||||
@interface MPSearchDelegate : NSObject<UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate, UISearchDisplayDelegate, NSFetchedResultsControllerDelegate>
|
@interface MPSearchDelegate : NSObject<UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate, UISearchDisplayDelegate, NSFetchedResultsControllerDelegate>
|
||||||
|
|
||||||
@property (strong, nonatomic) NSDateFormatter *dateFormatter;
|
@property (strong, nonatomic) NSDateFormatter *dateFormatter;
|
||||||
@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController;
|
@property (strong, readonly) NSFetchedResultsController *fetchedResultsController;
|
||||||
@property (strong, nonatomic) NSString *query;
|
@property (strong, nonatomic) NSString *query;
|
||||||
@property (strong, nonatomic) UILabel *tipView;
|
@property (strong, nonatomic) UILabel *tipView;
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
#import "MPSearchDelegate.h"
|
#import "MPSearchDelegate.h"
|
||||||
#import "MPAppDelegate.h"
|
#import "MPAppDelegate.h"
|
||||||
#import "MPAppDelegate_Store.h"
|
|
||||||
#import "LocalyticsSession.h"
|
#import "LocalyticsSession.h"
|
||||||
|
#import "MPAppDelegate_Store.h"
|
||||||
|
|
||||||
@interface MPSearchDelegate (Private)
|
@interface MPSearchDelegate (Private)
|
||||||
|
|
||||||
@@ -17,11 +17,13 @@
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MPSearchDelegate
|
@implementation MPSearchDelegate {
|
||||||
|
|
||||||
|
NSFetchedResultsController *_fetchedResultsController;
|
||||||
|
}
|
||||||
@synthesize tipView;
|
@synthesize tipView;
|
||||||
@synthesize query;
|
@synthesize query;
|
||||||
@synthesize dateFormatter;
|
@synthesize dateFormatter;
|
||||||
@synthesize fetchedResultsController;
|
|
||||||
@synthesize delegate;
|
@synthesize delegate;
|
||||||
@synthesize searchDisplayController;
|
@synthesize searchDisplayController;
|
||||||
@synthesize searchTipContainer;
|
@synthesize searchTipContainer;
|
||||||
@@ -35,13 +37,6 @@
|
|||||||
self.dateFormatter.dateStyle = NSDateFormatterShortStyle;
|
self.dateFormatter.dateStyle = NSDateFormatterShortStyle;
|
||||||
self.query = @"";
|
self.query = @"";
|
||||||
|
|
||||||
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([MPElementEntity class])];
|
|
||||||
fetchRequest.sortDescriptors = [NSArray arrayWithObject:[[NSSortDescriptor alloc] initWithKey:@"uses_" ascending:NO]];
|
|
||||||
self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest
|
|
||||||
managedObjectContext:[MPAppDelegate managedObjectContext]
|
|
||||||
sectionNameKeyPath:nil cacheName:nil];
|
|
||||||
self.fetchedResultsController.delegate = self;
|
|
||||||
|
|
||||||
self.tipView = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 170)];
|
self.tipView = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 170)];
|
||||||
self.tipView.textAlignment = UITextAlignmentCenter;
|
self.tipView.textAlignment = UITextAlignmentCenter;
|
||||||
self.tipView.backgroundColor = [UIColor clearColor];
|
self.tipView.backgroundColor = [UIColor clearColor];
|
||||||
@@ -62,6 +57,23 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSFetchedResultsController *)fetchedResultsController {
|
||||||
|
|
||||||
|
if (!_fetchedResultsController) {
|
||||||
|
NSManagedObjectContext *moc = [MPAppDelegate managedObjectContextIfReady];
|
||||||
|
if (!moc)
|
||||||
|
return nil;
|
||||||
|
|
||||||
|
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([MPElementEntity class])];
|
||||||
|
fetchRequest.sortDescriptors = [NSArray arrayWithObject:[[NSSortDescriptor alloc] initWithKey:@"uses_" ascending:NO]];
|
||||||
|
_fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:moc
|
||||||
|
sectionNameKeyPath:nil cacheName:nil];
|
||||||
|
_fetchedResultsController.delegate = self;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _fetchedResultsController;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
|
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
|
||||||
|
|
||||||
UITableView *tableView = self.searchDisplayController.searchResultsTableView;
|
UITableView *tableView = self.searchDisplayController.searchResultsTableView;
|
||||||
@@ -96,6 +108,11 @@
|
|||||||
- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {
|
- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {
|
||||||
|
|
||||||
controller.searchBar.prompt = @"Enter the site's name:";
|
controller.searchBar.prompt = @"Enter the site's name:";
|
||||||
|
controller.searchBar.showsScopeBar = controller.searchBar.selectedScopeButtonIndex != MPSearchScopeAll;
|
||||||
|
if (controller.searchBar.showsScopeBar)
|
||||||
|
controller.searchBar.scopeButtonTitles = [NSArray arrayWithObjects:@"All", @"Outdated", nil];
|
||||||
|
else
|
||||||
|
controller.searchBar.scopeButtonTitles = nil;
|
||||||
|
|
||||||
[UIView animateWithDuration:0.2f animations:^{
|
[UIView animateWithDuration:0.2f animations:^{
|
||||||
self.searchTipContainer.alpha = 0;
|
self.searchTipContainer.alpha = 0;
|
||||||
@@ -112,6 +129,8 @@
|
|||||||
|
|
||||||
controller.searchBar.prompt = nil;
|
controller.searchBar.prompt = nil;
|
||||||
controller.searchBar.searchResultsButtonSelected = NO;
|
controller.searchBar.searchResultsButtonSelected = NO;
|
||||||
|
controller.searchBar.selectedScopeButtonIndex = MPSearchScopeAll;
|
||||||
|
controller.searchBar.showsScopeBar = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)searchDisplayController:(UISearchDisplayController *)controller didLoadSearchResultsTableView:(UITableView *)tableView {
|
- (void)searchDisplayController:(UISearchDisplayController *)controller didLoadSearchResultsTableView:(UITableView *)tableView {
|
||||||
@@ -126,26 +145,59 @@
|
|||||||
if (!controller.active)
|
if (!controller.active)
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
assert(self.query);
|
[self fetchData];
|
||||||
|
|
||||||
self.fetchedResultsController.fetchRequest.predicate = [NSPredicate predicateWithFormat:@"(%@ == '' OR name BEGINSWITH[cd] %@) AND user == %@",
|
return YES;
|
||||||
self.query, self.query, NilToNSNull([MPAppDelegate get].activeUser)];
|
}
|
||||||
|
|
||||||
|
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption {
|
||||||
|
|
||||||
|
if (!controller.active)
|
||||||
|
return NO;
|
||||||
|
|
||||||
|
[self fetchData];
|
||||||
|
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)fetchData {
|
||||||
|
|
||||||
|
assert(self.query);
|
||||||
|
assert([MPAppDelegate get].activeUser);
|
||||||
|
|
||||||
|
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"user == %@", [MPAppDelegate get].activeUser];
|
||||||
|
if (self.query.length)
|
||||||
|
predicate = [NSCompoundPredicate
|
||||||
|
andPredicateWithSubpredicates:[NSArray arrayWithObjects:[NSPredicate predicateWithFormat:@"name BEGINSWITH[cd] %@", self.query],
|
||||||
|
predicate, nil]];
|
||||||
|
|
||||||
|
switch ((MPSearchScope)self.searchDisplayController.searchBar.selectedScopeButtonIndex) {
|
||||||
|
|
||||||
|
case MPSearchScopeAll:
|
||||||
|
break;
|
||||||
|
case MPSearchScopeOutdated:
|
||||||
|
predicate = [NSCompoundPredicate
|
||||||
|
andPredicateWithSubpredicates:[NSArray arrayWithObjects:[NSPredicate predicateWithFormat:@"requiresExplicitMigration_ == YES"],
|
||||||
|
predicate, nil]];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
self.fetchedResultsController.fetchRequest.predicate = predicate;
|
||||||
|
|
||||||
NSError *error;
|
NSError *error;
|
||||||
if (![self.fetchedResultsController performFetch:&error])
|
if (![self.fetchedResultsController performFetch:&error])
|
||||||
err(@"Couldn't fetch elements: %@", error);
|
err(@"Couldn't fetch elements: %@", error);
|
||||||
|
|
||||||
NSArray *subviews = self.searchDisplayController.searchBar.superview.subviews;
|
[self.searchDisplayController.searchBar.superview enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) {
|
||||||
NSUInteger overlayIndex = [subviews indexOfObject:self.searchDisplayController.searchBar] + 1;
|
CGRect searchBarFrame = self.searchDisplayController.searchBar.frame;
|
||||||
UIView *overlay = [subviews count] > overlayIndex? [subviews objectAtIndex:overlayIndex]: nil;
|
if ([subview isKindOfClass:[UIControl class]] &&
|
||||||
if (overlay == self.searchDisplayController.searchResultsTableView || ![overlay isKindOfClass:[UIControl class]])
|
CGPointEqualToPoint(
|
||||||
overlay = nil;
|
CGPointDistanceBetweenCGPoints(searchBarFrame.origin, subview.frame.origin),
|
||||||
if (self.tipView.superview != overlay) {
|
CGPointMake(0, searchBarFrame.size.height))) {
|
||||||
[self.tipView removeFromSuperview];
|
[self.tipView removeFromSuperview];
|
||||||
[overlay addSubview:self.tipView];
|
[subview addSubview:self.tipView];
|
||||||
|
*stop = YES;
|
||||||
}
|
}
|
||||||
|
} recurse:NO];
|
||||||
return YES;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// See MP-14, also crashes easily on internal assertions etc..
|
// See MP-14, also crashes easily on internal assertions etc..
|
||||||
@@ -203,6 +255,7 @@
|
|||||||
|
|
||||||
- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
|
- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
|
||||||
|
|
||||||
|
dbg(@"controllerDidChangeContent on thread: %@", [NSThread currentThread].name);
|
||||||
[self.searchDisplayController.searchResultsTableView reloadData];
|
[self.searchDisplayController.searchResultsTableView reloadData];
|
||||||
// [self.searchDisplayController.searchResultsTableView endUpdates];
|
// [self.searchDisplayController.searchResultsTableView endUpdates];
|
||||||
}
|
}
|
||||||
@@ -304,13 +357,14 @@
|
|||||||
|
|
||||||
[self.fetchedResultsController.managedObjectContext performBlock:^{
|
[self.fetchedResultsController.managedObjectContext performBlock:^{
|
||||||
MPElementType type = [MPAppDelegate get].activeUser.defaultType;
|
MPElementType type = [MPAppDelegate get].activeUser.defaultType;
|
||||||
MPElementEntity *element = [NSEntityDescription insertNewObjectForEntityForName:ClassNameFromMPElementType(type)
|
MPElementEntity *element = [NSEntityDescription insertNewObjectForEntityForName:[MPAlgorithmDefault classNameOfType:type]
|
||||||
inManagedObjectContext:self.fetchedResultsController.managedObjectContext];
|
inManagedObjectContext:self.fetchedResultsController.managedObjectContext];
|
||||||
assert([MPAppDelegate get].activeUser);
|
assert([MPAppDelegate get].activeUser);
|
||||||
|
|
||||||
element.name = siteName;
|
element.name = siteName;
|
||||||
element.user = [MPAppDelegate get].activeUser;
|
element.user = [MPAppDelegate get].activeUser;
|
||||||
element.type = type;
|
element.type = type;
|
||||||
|
element.version = MPAlgorithmDefaultVersion;
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[self.delegate didSelectElement:element];
|
[self.delegate didSelectElement:element];
|
||||||
@@ -352,7 +406,8 @@ forRowAtIndexPath:(NSIndexPath *)indexPath {
|
|||||||
[TestFlight passCheckpoint:MPCheckpointDeleteElement];
|
[TestFlight passCheckpoint:MPCheckpointDeleteElement];
|
||||||
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointDeleteElement
|
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointDeleteElement
|
||||||
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
NSStringFromMPElementType(element.type), @"type",
|
element.typeName, @"type",
|
||||||
|
PearlUnsignedInteger(element.version), @"version",
|
||||||
nil]];
|
nil]];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,10 +111,11 @@
|
|||||||
case 7:
|
case 7:
|
||||||
return NSNotFound;
|
return NSNotFound;
|
||||||
|
|
||||||
default:
|
default: {
|
||||||
Throw(@"Unsupported row: %d, when selecting generated element type.", indexPath.row);
|
Throw(@"Unsupported row: %d, when selecting generated element type.", indexPath.row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
case 1: {
|
case 1: {
|
||||||
// Stored
|
// Stored
|
||||||
@@ -128,10 +129,11 @@
|
|||||||
case 3:
|
case 3:
|
||||||
return NSNotFound;
|
return NSNotFound;
|
||||||
|
|
||||||
default:
|
default: {
|
||||||
Throw(@"Unsupported row: %d, when selecting stored element type.", indexPath.row);
|
Throw(@"Unsupported row: %d, when selecting stored element type.", indexPath.row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Throw(@"Unsupported section: %d, when selecting element type.", indexPath.section);
|
Throw(@"Unsupported section: %d, when selecting element type.", indexPath.section);
|
||||||
|
|||||||
@@ -11,16 +11,20 @@
|
|||||||
@interface MPUnlockViewController : UIViewController<UITextFieldDelegate, UIScrollViewDelegate>
|
@interface MPUnlockViewController : UIViewController<UITextFieldDelegate, UIScrollViewDelegate>
|
||||||
|
|
||||||
@property (weak, nonatomic) IBOutlet UIImageView *spinner;
|
@property (weak, nonatomic) IBOutlet UIImageView *spinner;
|
||||||
|
@property (weak, nonatomic) IBOutlet UILabel *passwordFieldLabel;
|
||||||
@property (weak, nonatomic) IBOutlet UITextField *passwordField;
|
@property (weak, nonatomic) IBOutlet UITextField *passwordField;
|
||||||
@property (weak, nonatomic) IBOutlet UIView *passwordView;
|
@property (weak, nonatomic) IBOutlet UIView *passwordView;
|
||||||
@property (weak, nonatomic) IBOutlet UIScrollView *avatarsView;
|
@property (weak, nonatomic) IBOutlet UIScrollView *avatarsView;
|
||||||
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
|
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
|
||||||
@property (weak, nonatomic) IBOutlet UILabel *oldNameLabel;
|
@property (weak, nonatomic) IBOutlet UILabel *oldNameLabel;
|
||||||
@property (weak, nonatomic) IBOutlet UIButton *avatarTemplate;
|
@property (weak, nonatomic) IBOutlet UIButton *avatarTemplate;
|
||||||
@property (weak, nonatomic) IBOutlet UILabel *deleteTip;
|
@property (weak, nonatomic) IBOutlet UIView *createPasswordTipView;
|
||||||
|
@property (weak, nonatomic) IBOutlet UILabel *tip;
|
||||||
@property (weak, nonatomic) IBOutlet UIView *passwordTipView;
|
@property (weak, nonatomic) IBOutlet UIView *passwordTipView;
|
||||||
@property (weak, nonatomic) IBOutlet UILabel *passwordTipLabel;
|
@property (weak, nonatomic) IBOutlet UILabel *passwordTipLabel;
|
||||||
|
@property (weak, nonatomic) IBOutlet UIView *wordWall;
|
||||||
@property (strong, nonatomic) IBOutlet UILongPressGestureRecognizer *targetedUserActionGesture;
|
@property (strong, nonatomic) IBOutlet UILongPressGestureRecognizer *targetedUserActionGesture;
|
||||||
|
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *loadingUsersIndicator;
|
||||||
|
|
||||||
@property (nonatomic, strong) UIColor *avatarShadowColor;
|
@property (nonatomic, strong) UIColor *avatarShadowColor;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,9 @@
|
|||||||
|
|
||||||
@property (strong, nonatomic) MPUserEntity *selectedUser;
|
@property (strong, nonatomic) MPUserEntity *selectedUser;
|
||||||
@property (strong, nonatomic) NSMutableDictionary *avatarToUser;
|
@property (strong, nonatomic) NSMutableDictionary *avatarToUser;
|
||||||
|
@property (nonatomic) BOOL wordWallAnimating;
|
||||||
|
@property (nonatomic, strong) NSArray *wordList;
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -24,19 +27,25 @@
|
|||||||
@synthesize selectedUser;
|
@synthesize selectedUser;
|
||||||
@synthesize avatarToUser;
|
@synthesize avatarToUser;
|
||||||
@synthesize spinner;
|
@synthesize spinner;
|
||||||
|
@synthesize passwordFieldLabel;
|
||||||
@synthesize passwordField;
|
@synthesize passwordField;
|
||||||
@synthesize passwordView;
|
@synthesize passwordView;
|
||||||
@synthesize avatarsView;
|
@synthesize avatarsView;
|
||||||
@synthesize nameLabel, oldNameLabel;
|
@synthesize nameLabel, oldNameLabel;
|
||||||
@synthesize avatarTemplate;
|
@synthesize avatarTemplate;
|
||||||
@synthesize deleteTip;
|
@synthesize createPasswordTipView;
|
||||||
|
@synthesize tip;
|
||||||
@synthesize passwordTipView;
|
@synthesize passwordTipView;
|
||||||
@synthesize passwordTipLabel;
|
@synthesize passwordTipLabel;
|
||||||
|
@synthesize wordWall;
|
||||||
@synthesize targetedUserActionGesture;
|
@synthesize targetedUserActionGesture;
|
||||||
|
@synthesize loadingUsersIndicator;
|
||||||
@synthesize avatarShadowColor = _avatarShadowColor;
|
@synthesize avatarShadowColor = _avatarShadowColor;
|
||||||
|
@synthesize wordWallAnimating = _wordWallAnimating;
|
||||||
|
@synthesize wordList = _wordList;
|
||||||
|
|
||||||
|
|
||||||
- (void)initAvatarAlert:(UIAlertView *)alert forUser:(MPUserEntity *)user {
|
- (void)initializeAvatarAlert:(UIAlertView *)alert forUser:(MPUserEntity *)user {
|
||||||
|
|
||||||
UIScrollView *alertAvatarScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(12, 30, 260, 150)];
|
UIScrollView *alertAvatarScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(12, 30, 260, 150)];
|
||||||
alertAvatarScrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
|
alertAvatarScrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
|
||||||
@@ -80,7 +89,7 @@
|
|||||||
[alertAvatarScrollView setContentOffset:selectedOffset animated:YES];
|
[alertAvatarScrollView setContentOffset:selectedOffset animated:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)initConfirmationAlert:(UIAlertView *)alert forUser:(MPUserEntity *)user {
|
- (void)initializeConfirmationAlert:(UIAlertView *)alert forUser:(MPUserEntity *)user {
|
||||||
|
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(12, 70, 260, 110)];
|
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(12, 70, 260, 110)];
|
||||||
[alert addSubview:container];
|
[alert addSubview:container];
|
||||||
@@ -121,6 +130,30 @@
|
|||||||
self.avatarTemplate.hidden = YES;
|
self.avatarTemplate.hidden = YES;
|
||||||
self.spinner.alpha = 0;
|
self.spinner.alpha = 0;
|
||||||
self.passwordTipView.alpha = 0;
|
self.passwordTipView.alpha = 0;
|
||||||
|
self.createPasswordTipView.alpha = 0;
|
||||||
|
|
||||||
|
NSMutableArray *wordListLines = [NSMutableArray arrayWithCapacity:27413];
|
||||||
|
[[[NSString alloc] initWithData:[NSData dataWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"dictionary" withExtension:@"lst"]]
|
||||||
|
encoding:NSUTF8StringEncoding] enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) {
|
||||||
|
[wordListLines addObject:line];
|
||||||
|
}];
|
||||||
|
self.wordList = wordListLines;
|
||||||
|
|
||||||
|
self.wordWall.alpha = 0;
|
||||||
|
[self.wordWall enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) {
|
||||||
|
UILabel *wordLabel = (UILabel *)subview;
|
||||||
|
|
||||||
|
[self initializeWordLabel:wordLabel];
|
||||||
|
} recurse:NO];
|
||||||
|
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserverForName:PersistentStoreDidChange object:nil queue:nil usingBlock:
|
||||||
|
^(NSNotification *note) {
|
||||||
|
[self updateUsers];
|
||||||
|
}];
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserverForName:PersistentStoreDidMergeChanges object:nil queue:nil usingBlock:
|
||||||
|
^(NSNotification *note) {
|
||||||
|
[self updateUsers];
|
||||||
|
}];
|
||||||
|
|
||||||
[self updateLayoutAnimated:NO allowScroll:YES completion:nil];
|
[self updateLayoutAnimated:NO allowScroll:YES completion:nil];
|
||||||
|
|
||||||
@@ -135,10 +168,14 @@
|
|||||||
[self setAvatarsView:nil];
|
[self setAvatarsView:nil];
|
||||||
[self setNameLabel:nil];
|
[self setNameLabel:nil];
|
||||||
[self setAvatarTemplate:nil];
|
[self setAvatarTemplate:nil];
|
||||||
[self setDeleteTip:nil];
|
[self setTip:nil];
|
||||||
[self setPasswordTipView:nil];
|
[self setPasswordTipView:nil];
|
||||||
[self setPasswordTipLabel:nil];
|
[self setPasswordTipLabel:nil];
|
||||||
[self setTargetedUserActionGesture:nil];
|
[self setTargetedUserActionGesture:nil];
|
||||||
|
[self setWordWall:nil];
|
||||||
|
[self setCreatePasswordTipView:nil];
|
||||||
|
[self setPasswordFieldLabel:nil];
|
||||||
|
[self setLoadingUsersIndicator:nil];
|
||||||
[super viewDidUnload];
|
[super viewDidUnload];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,6 +192,11 @@
|
|||||||
|
|
||||||
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:animated? UIStatusBarAnimationSlide: UIStatusBarAnimationNone];
|
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:animated? UIStatusBarAnimationSlide: UIStatusBarAnimationNone];
|
||||||
|
|
||||||
|
if (!animated)
|
||||||
|
[[self findTargetedAvatar] setSelected:YES];
|
||||||
|
else
|
||||||
|
[self updateLayoutAnimated:YES allowScroll:YES completion:nil];
|
||||||
|
|
||||||
[super viewDidAppear:animated];
|
[super viewDidAppear:animated];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,9 +208,19 @@
|
|||||||
|
|
||||||
- (void)updateUsers {
|
- (void)updateUsers {
|
||||||
|
|
||||||
|
NSManagedObjectContext *moc = [MPAppDelegate managedObjectContextIfReady];
|
||||||
|
if (!moc) {
|
||||||
|
self.tip.text = @"Loading...";
|
||||||
|
[self.loadingUsersIndicator startAnimating];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.tip.text = @"Tap and hold to delete or reset.";
|
||||||
|
[self.loadingUsersIndicator stopAnimating];
|
||||||
|
|
||||||
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([MPUserEntity class])];
|
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([MPUserEntity class])];
|
||||||
fetchRequest.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"lastUsed" ascending:NO]];
|
fetchRequest.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"lastUsed" ascending:NO]];
|
||||||
NSArray *users = [[MPAppDelegate managedObjectContext] executeFetchRequest:fetchRequest error:nil];
|
NSArray *users = [moc executeFetchRequest:fetchRequest error:nil];
|
||||||
|
|
||||||
// Clean up avatars.
|
// Clean up avatars.
|
||||||
for (UIView *subview in [self.avatarsView subviews])
|
for (UIView *subview in [self.avatarsView subviews])
|
||||||
@@ -240,7 +292,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
[self updateLayoutAnimated:YES allowScroll:YES completion:^(BOOL finished) {
|
[self updateLayoutAnimated:YES allowScroll:YES completion:^(BOOL finished) {
|
||||||
if (finished)
|
|
||||||
if (self.selectedUser)
|
if (self.selectedUser)
|
||||||
[self.passwordField becomeFirstResponder];
|
[self.passwordField becomeFirstResponder];
|
||||||
}];
|
}];
|
||||||
@@ -248,13 +299,18 @@
|
|||||||
|
|
||||||
- (void)didSelectNewUserAvatar:(UIButton *)newUserAvatar {
|
- (void)didSelectNewUserAvatar:(UIButton *)newUserAvatar {
|
||||||
|
|
||||||
MPUserEntity *newUser = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([MPUserEntity class])
|
__block MPUserEntity *newUser = nil;
|
||||||
inManagedObjectContext:[MPAppDelegate managedObjectContext]];
|
[[MPAppDelegate managedObjectContextIfReady] performBlockAndWait:^{
|
||||||
|
newUser = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([MPUserEntity class])
|
||||||
|
inManagedObjectContext:[MPAppDelegate managedObjectContextIfReady]];
|
||||||
|
}];
|
||||||
|
|
||||||
[self showNewUserNameAlertFor:newUser completion:^(BOOL finished) {
|
[self showNewUserNameAlertFor:newUser completion:^(BOOL finished) {
|
||||||
newUserAvatar.selected = NO;
|
newUserAvatar.selected = NO;
|
||||||
if (!finished)
|
if (!finished)
|
||||||
[[MPAppDelegate managedObjectContext] deleteObject:newUser];
|
[[MPAppDelegate managedObjectContextIfReady] performBlock:^{
|
||||||
|
[[MPAppDelegate managedObjectContextIfReady] deleteObject:newUser];
|
||||||
|
}];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +342,7 @@
|
|||||||
[PearlAlert showAlertWithTitle:@"Choose Your Avatar"
|
[PearlAlert showAlertWithTitle:@"Choose Your Avatar"
|
||||||
message:@"\n\n\n\n\n\n" viewStyle:UIAlertViewStyleDefault
|
message:@"\n\n\n\n\n\n" viewStyle:UIAlertViewStyleDefault
|
||||||
initAlert:^(UIAlertView *_alert, UITextField *_firstField) {
|
initAlert:^(UIAlertView *_alert, UITextField *_firstField) {
|
||||||
[self initAvatarAlert:_alert forUser:newUser];
|
[self initializeAvatarAlert:_alert forUser:newUser];
|
||||||
}
|
}
|
||||||
tappedButtonBlock:^(UIAlertView *_alert, NSInteger _buttonIndex) {
|
tappedButtonBlock:^(UIAlertView *_alert, NSInteger _buttonIndex) {
|
||||||
|
|
||||||
@@ -303,7 +359,7 @@
|
|||||||
@"\n\n\n\n\n\n"
|
@"\n\n\n\n\n\n"
|
||||||
viewStyle:UIAlertViewStyleDefault
|
viewStyle:UIAlertViewStyleDefault
|
||||||
initAlert:^void(UIAlertView *__alert, UITextField *__firstField) {
|
initAlert:^void(UIAlertView *__alert, UITextField *__firstField) {
|
||||||
[self initConfirmationAlert:__alert forUser:newUser];
|
[self initializeConfirmationAlert:__alert forUser:newUser];
|
||||||
}
|
}
|
||||||
tappedButtonBlock:^void(UIAlertView *__alert, NSInteger __buttonIndex) {
|
tappedButtonBlock:^void(UIAlertView *__alert, NSInteger __buttonIndex) {
|
||||||
if (__buttonIndex == [__alert cancelButtonIndex]) {
|
if (__buttonIndex == [__alert cancelButtonIndex]) {
|
||||||
@@ -339,7 +395,9 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lay out password entry and user selection views.
|
||||||
if (self.selectedUser && !self.passwordView.alpha) {
|
if (self.selectedUser && !self.passwordView.alpha) {
|
||||||
|
// User was just selected.
|
||||||
self.passwordView.alpha = 1;
|
self.passwordView.alpha = 1;
|
||||||
self.avatarsView.center = CGPointMake(160, 170);
|
self.avatarsView.center = CGPointMake(160, 170);
|
||||||
self.avatarsView.scrollEnabled = NO;
|
self.avatarsView.scrollEnabled = NO;
|
||||||
@@ -347,9 +405,9 @@
|
|||||||
self.nameLabel.backgroundColor = [UIColor blackColor];
|
self.nameLabel.backgroundColor = [UIColor blackColor];
|
||||||
self.oldNameLabel.center = self.nameLabel.center;
|
self.oldNameLabel.center = self.nameLabel.center;
|
||||||
self.avatarShadowColor = [UIColor whiteColor];
|
self.avatarShadowColor = [UIColor whiteColor];
|
||||||
self.deleteTip.alpha = 0;
|
|
||||||
} else
|
} else
|
||||||
if (!self.selectedUser && self.passwordView.alpha == 1) {
|
if (!self.selectedUser && self.passwordView.alpha == 1) {
|
||||||
|
// User was just deselected.
|
||||||
self.passwordField.text = nil;
|
self.passwordField.text = nil;
|
||||||
self.passwordView.alpha = 0;
|
self.passwordView.alpha = 0;
|
||||||
self.avatarsView.center = CGPointMake(160, 310);
|
self.avatarsView.center = CGPointMake(160, 310);
|
||||||
@@ -358,9 +416,36 @@
|
|||||||
self.nameLabel.backgroundColor = [UIColor clearColor];
|
self.nameLabel.backgroundColor = [UIColor clearColor];
|
||||||
self.oldNameLabel.center = self.nameLabel.center;
|
self.oldNameLabel.center = self.nameLabel.center;
|
||||||
self.avatarShadowColor = [UIColor lightGrayColor];
|
self.avatarShadowColor = [UIColor lightGrayColor];
|
||||||
self.deleteTip.alpha = 0.5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lay out the word wall.
|
||||||
|
if (!self.selectedUser || self.selectedUser.keyID) {
|
||||||
|
self.passwordFieldLabel.text = @"Enter your master password:";
|
||||||
|
|
||||||
|
self.wordWall.alpha = 0;
|
||||||
|
self.createPasswordTipView.alpha = 0;
|
||||||
|
self.wordWallAnimating = NO;
|
||||||
|
} else {
|
||||||
|
self.passwordFieldLabel.text = @"Create your master password:";
|
||||||
|
|
||||||
|
if (!self.wordWallAnimating) {
|
||||||
|
self.wordWallAnimating = YES;
|
||||||
|
self.wordWall.alpha = 1;
|
||||||
|
self.createPasswordTipView.alpha = 1;
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
// Jump out of our UIView animation block.
|
||||||
|
[self beginWordWallAnimation];
|
||||||
|
});
|
||||||
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 15 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
|
||||||
|
[UIView animateWithDuration:1 animations:^{
|
||||||
|
self.createPasswordTipView.alpha = 0;
|
||||||
|
}];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Lay out user targeting.
|
||||||
MPUserEntity *targetedUser = self.selectedUser;
|
MPUserEntity *targetedUser = self.selectedUser;
|
||||||
UIButton *selectedAvatar = [self avatarForUser:self.selectedUser];
|
UIButton *selectedAvatar = [self avatarForUser:self.selectedUser];
|
||||||
UIButton *targetedAvatar = selectedAvatar;
|
UIButton *targetedAvatar = selectedAvatar;
|
||||||
@@ -390,7 +475,8 @@
|
|||||||
[self.avatarsView setContentOffset:targetContentOffset animated:animated];
|
[self.avatarsView setContentOffset:targetContentOffset animated:animated];
|
||||||
}
|
}
|
||||||
|
|
||||||
self.nameLabel.text = targetedUser? targetedUser.name: @"New User";
|
// Lay out user name label.
|
||||||
|
self.nameLabel.text = targetedAvatar? targetedUser? targetedUser.name: @"New User": nil;
|
||||||
self.nameLabel.bounds = CGRectSetHeight(self.nameLabel.bounds,
|
self.nameLabel.bounds = CGRectSetHeight(self.nameLabel.bounds,
|
||||||
[self.nameLabel.text sizeWithFont:self.nameLabel.font
|
[self.nameLabel.text sizeWithFont:self.nameLabel.font
|
||||||
constrainedToSize:CGSizeMake(self.nameLabel.bounds.size.width - 10, 100)
|
constrainedToSize:CGSizeMake(self.nameLabel.bounds.size.width - 10, 100)
|
||||||
@@ -400,6 +486,36 @@
|
|||||||
completion(YES);
|
completion(YES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)beginWordWallAnimation {
|
||||||
|
|
||||||
|
[self.wordWall enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) {
|
||||||
|
UILabel *wordLabel = (UILabel *)subview;
|
||||||
|
|
||||||
|
if (wordLabel.frame.origin.x < -self.wordWall.frame.size.width / 3) {
|
||||||
|
wordLabel.frame = CGRectSetX(wordLabel.frame, wordLabel.frame.origin.x + self.wordWall.frame.size.width);
|
||||||
|
[self initializeWordLabel:wordLabel];
|
||||||
|
}
|
||||||
|
} recurse:NO];
|
||||||
|
|
||||||
|
if (self.wordWallAnimating)
|
||||||
|
[UIView animateWithDuration:15 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{
|
||||||
|
[self.wordWall enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) {
|
||||||
|
UILabel *wordLabel = (UILabel *)subview;
|
||||||
|
|
||||||
|
wordLabel.frame = CGRectSetX(wordLabel.frame, wordLabel.frame.origin.x - self.wordWall.frame.size.width / 3);
|
||||||
|
} recurse:NO];
|
||||||
|
} completion:^(BOOL finished) {
|
||||||
|
if (finished)
|
||||||
|
[self beginWordWallAnimation];
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)initializeWordLabel:(UILabel *)wordLabel {
|
||||||
|
|
||||||
|
wordLabel.alpha = 0.05 + (random() % 35) / 100.0F;
|
||||||
|
wordLabel.text = [self.wordList objectAtIndex:(NSUInteger)random() % [self.wordList count]];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setPasswordTip:(NSString *)string {
|
- (void)setPasswordTip:(NSString *)string {
|
||||||
|
|
||||||
if (string.length)
|
if (string.length)
|
||||||
@@ -509,7 +625,8 @@
|
|||||||
pulseShadowOpacityAnimation.repeatCount = MAXFLOAT;
|
pulseShadowOpacityAnimation.repeatCount = MAXFLOAT;
|
||||||
|
|
||||||
CAAnimationGroup *group = [[CAAnimationGroup alloc] init];
|
CAAnimationGroup *group = [[CAAnimationGroup alloc] init];
|
||||||
group.animations = [NSArray arrayWithObjects:toShadowColorAnimation, toShadowOpacityAnimation, pulseShadowOpacityAnimation, nil];
|
group.animations = [NSArray arrayWithObjects:toShadowColorAnimation, toShadowOpacityAnimation, pulseShadowOpacityAnimation,
|
||||||
|
nil];
|
||||||
group.duration = MAXFLOAT;
|
group.duration = MAXFLOAT;
|
||||||
|
|
||||||
[avatar.layer removeAnimationForKey:@"inactiveShadow"];
|
[avatar.layer removeAnimationForKey:@"inactiveShadow"];
|
||||||
@@ -619,18 +736,25 @@
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
[PearlSheet showSheetWithTitle:targetedUser.name
|
[PearlSheet showSheetWithTitle:targetedUser.name
|
||||||
message:nil
|
message:nil viewStyle:UIActionSheetStyleBlackTranslucent
|
||||||
viewStyle:UIActionSheetStyleBlackTranslucent
|
initSheet:nil tappedButtonBlock:^(UIActionSheet *sheet, NSInteger buttonIndex) {
|
||||||
tappedButtonBlock:^(UIActionSheet *sheet, NSInteger buttonIndex) {
|
|
||||||
if (buttonIndex == [sheet cancelButtonIndex])
|
if (buttonIndex == [sheet cancelButtonIndex])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (buttonIndex == [sheet destructiveButtonIndex]) {
|
if (buttonIndex == [sheet destructiveButtonIndex]) {
|
||||||
[[MPAppDelegate get].managedObjectContext deleteObject:targetedUser];
|
[[MPAppDelegate get].managedObjectContextIfReady performBlockAndWait:^{
|
||||||
|
[[MPAppDelegate get].managedObjectContextIfReady deleteObject:targetedUser];
|
||||||
|
}];
|
||||||
[[MPAppDelegate get] saveContext];
|
[[MPAppDelegate get] saveContext];
|
||||||
[self updateUsers];
|
[self updateUsers];
|
||||||
} else if (buttonIndex == [sheet firstOtherButtonIndex])
|
return;
|
||||||
[[MPAppDelegate get] changeMasterPasswordFor:targetedUser];
|
}
|
||||||
} cancelTitle:[PearlStrings get].commonButtonCancel destructiveTitle:@"Delete User" otherTitles:@"Reset Password", nil];
|
|
||||||
|
if (buttonIndex == [sheet firstOtherButtonIndex])
|
||||||
|
[[MPAppDelegate get] changeMasterPasswordFor:targetedUser didResetBlock:^{
|
||||||
|
[[self avatarForUser:targetedUser] setSelected:YES];
|
||||||
|
}];
|
||||||
|
} cancelTitle:[PearlStrings get].commonButtonCancel
|
||||||
|
destructiveTitle:@"Delete User" otherTitles:@"Reset Password", nil];
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -12,7 +12,11 @@
|
|||||||
|
|
||||||
@property (nonatomic, retain) NSNumber *sendInfo;
|
@property (nonatomic, retain) NSNumber *sendInfo;
|
||||||
@property (nonatomic, retain) NSNumber *helpHidden;
|
@property (nonatomic, retain) NSNumber *helpHidden;
|
||||||
|
@property (nonatomic, retain) NSNumber *userNameHidden;
|
||||||
@property (nonatomic, retain) NSNumber *showQuickStart;
|
@property (nonatomic, retain) NSNumber *showQuickStart;
|
||||||
|
@property (nonatomic, retain) NSNumber *actionsTipShown;
|
||||||
|
@property (nonatomic, retain) NSNumber *typeTipShown;
|
||||||
|
@property (nonatomic, retain) NSNumber *userNameTipShown;
|
||||||
|
|
||||||
+ (MPiOSConfig *)get;
|
+ (MPiOSConfig *)get;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
@implementation MPiOSConfig
|
@implementation MPiOSConfig
|
||||||
@dynamic sendInfo, helpHidden, showQuickStart;
|
@dynamic sendInfo, helpHidden, userNameHidden, showQuickStart, actionsTipShown, typeTipShown, userNameTipShown;
|
||||||
|
|
||||||
- (id)init {
|
- (id)init {
|
||||||
|
|
||||||
@@ -17,8 +17,12 @@
|
|||||||
[self.defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
|
[self.defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
[NSNumber numberWithBool:NO], NSStringFromSelector(@selector(sendInfo)),
|
[NSNumber numberWithBool:NO], NSStringFromSelector(@selector(sendInfo)),
|
||||||
[NSNumber numberWithBool:NO], NSStringFromSelector(@selector(helpHidden)),
|
[NSNumber numberWithBool:NO], NSStringFromSelector(@selector(helpHidden)),
|
||||||
|
[NSNumber numberWithBool:YES], NSStringFromSelector(@selector(userNameHidden)),
|
||||||
[NSNumber numberWithBool:YES], NSStringFromSelector(@selector(showQuickStart)),
|
[NSNumber numberWithBool:YES], NSStringFromSelector(@selector(showQuickStart)),
|
||||||
@"510296984", NSStringFromSelector(@selector(iTunesID)),
|
@"510296984", NSStringFromSelector(@selector(iTunesID)),
|
||||||
|
PearlBoolNot(self.firstRun), NSStringFromSelector(@selector(actionsTipShown)),
|
||||||
|
PearlBoolNot(self.firstRun), NSStringFromSelector(@selector(typeTipShown)),
|
||||||
|
PearlBool(NO), NSStringFromSelector(@selector(userNameTipShown)),
|
||||||
nil]];
|
nil]];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 157 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 177 KiB After Width: | Height: | Size: 141 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 149 KiB After Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |