2
0

Compare commits

...

419 Commits

Author SHA1 Message Date
Maarten Billemont
db55634ab2 Update logo. 2014-06-04 00:21:07 -04:00
Maarten Billemont
c3364bbbef Fix link opening and popup dismissal bugs. 2014-06-03 23:58:16 -04:00
Maarten Billemont
74e8001506 Site style, description and link updates. 2014-06-03 23:57:39 -04:00
Maarten Billemont
c1c15ddb89 Clean up old UI.
[ADDED]     Password strength to type cells.
[FIXED]     Lots of misc UI fixes.
[ADDED]     Footer links in pull-down.
2014-06-03 21:04:22 -04:00
Maarten Billemont
c8eb2fdde7 Saved passwords login.
[FIXED]     Some crashes.
[ADDED]     Support for saved passwords login.
2014-06-01 22:45:29 -04:00
Maarten Billemont
da7abf1030 Try to fix login item code signing. 2014-05-20 01:20:03 -04:00
Maarten Billemont
8250e9b2c4 Update provisioning profile and sign mac adhoc with dev too (adhoc doesn't allow icloud apps). 2014-05-19 15:13:47 -04:00
Maarten Billemont
e97d6bded4 Project configuration update. 2014-05-19 14:41:45 -04:00
Maarten Billemont
8805a411ba Show all when empty and fix UI updates.
[FIXED]     Updating UI when changing entity model.
[UPDATED]   Show all recent sites when query is empty.
2014-05-19 14:37:05 -04:00
Maarten Billemont
a1ca633aaf Test for TestFlight Application Token. 2014-05-18 08:39:11 -04:00
Maarten Billemont
78d5fc0904 Fix a bunch of warnings... 2014-05-18 00:19:36 -04:00
Maarten Billemont
d9e251c2cd Updated profiles. 2014-05-17 23:53:41 -04:00
Maarten Billemont
fe2b6024bc Remove Localytics and Google+ entirely. 2014-05-17 23:52:51 -04:00
Maarten Billemont
1be65c0969 Merge branch 'new-storyboard'
Conflicts:
	External/LoveLyndir
	External/Pearl
2014-05-17 20:13:51 -04:00
Maarten Billemont
557eb95c7e Login name fixes and coachmark improvements.
[IMPROVED]  Coachmark improvement and animation.
[UPDATED]   Password cell hierarchy refactoring and improvements.
[FIXED]     Login name button.
2014-05-17 20:12:59 -04:00
Maarten Billemont
9941dba008 Clean up classes after removing the small password cell. 2014-05-13 22:56:06 -04:00
Maarten Billemont
fa57b8817b Bugfixes with regards to swiping password types. 2014-05-13 07:27:11 -04:00
Maarten Billemont
943c378206 Delete site WIP. 2014-05-10 21:42:11 -04:00
Maarten Billemont
b53de7a648 Rotation and marquee link.
[UPDATED]   Different Crashlytics for Mac/iOS.
[UPDATED]   Mac build fixes.
[FIXED]     Layout on rotation.  WIP.
[ADDED]     Link on marquee to thanks.lhunath.com.
2014-05-10 09:18:46 -04:00
Maarten Billemont
09afe61a4c Fix .mpw parsing. 2014-05-06 17:21:12 -04:00
Maarten Billemont
7e96496614 Merge branch 'master' of github.com:Lyndir/MasterPassword 2014-05-05 11:18:19 -04:00
Maarten Billemont
d43c19a749 Add C implementation of Master Password. 2014-05-05 11:16:59 -04:00
Maarten Billemont
989cafda71 Add "Internet Defense League" snippet. 2014-05-05 11:15:57 -04:00
Maarten Billemont
e165c6941d Merge branch 'new-storyboard' of github.com:Lyndir/MasterPassword into new-storyboard 2014-04-26 23:24:29 -04:00
Maarten Billemont
9105055ff4 Hopefully fixed an odd PearlLogger bug. 2014-04-26 16:29:13 -04:00
Maarten Billemont
6345899783 Fixed a crash on enumerateCloudStores if iCloud is disabled. 2014-04-26 15:01:24 -04:00
Maarten Billemont
b1daeaf8ed Type fixes. 2014-04-26 14:35:38 -04:00
Maarten Billemont
9fee4a2bbe Fixed critical issue with storing passwords & inconsistency recovery + dictation support.
[FIXED]     Fixed an issue that caused stored passwords to be saved without encryption.
[ADDED]     Logic to check for any data inconsistencies and fix them.
[ADDED]     Support for using dictation in site search box.
2014-04-26 14:03:44 -04:00
Maarten Billemont
fc82790b8c Mac fixes + enabled stored default types. 2014-04-25 20:02:58 -04:00
Maarten Billemont
d95e5ec263 Bump TestFlightSDK to 3.0.0 2014-04-24 22:17:40 -04:00
Maarten Billemont
99456a35ab Remove Google+, DCIntrospect. 2014-04-24 22:12:18 -04:00
Maarten Billemont
b4e052fc9d Small type fixes. 2014-04-24 22:03:23 -04:00
Maarten Billemont
d3852dc78c Small type fix. 2014-04-24 22:00:38 -04:00
Maarten Billemont
f41b7813f9 Code signing configuration update. 2014-04-24 21:59:06 -04:00
Maarten Billemont
6df4a13d93 Remove DCIntrospect now that we have Reveal. 2014-04-24 21:54:05 -04:00
Maarten Billemont
aa461b73c8 Fixed sending emails when the key window is an alert window + added coachmarks. 2014-04-24 21:43:47 -04:00
Maarten Billemont
e070082f4a Restructured passwords UI a bit for a saner nav bar. 2014-04-21 23:35:29 -04:00
Maarten Billemont
079434d62b Fixed pull-down, added sections for settings and logs. 2014-04-20 11:09:49 -04:00
Maarten Billemont
f57de77545 Permanent IDs are now properly generated before save. 2014-04-15 01:07:46 -04:00
Maarten Billemont
18657271ba Fixed MOC hierarchy, saving and permanent object ID resolution. 2014-04-15 00:26:13 -04:00
Maarten Billemont
11d1dc711d Remove status bar from login screen. 2014-04-13 15:45:08 -04:00
Maarten Billemont
965d5efe7f Dismiss emergency generator when deactivated. 2014-04-13 14:06:33 -04:00
Maarten Billemont
87b01fcaaf Operational emergency generator. 2014-04-13 13:04:18 -04:00
Maarten Billemont
b2624c7572 Emergency generator, avatar change, improvements.
[ADDED]     Ability to change avatar while creating new user.
[FIXED]     Transition oddness.
[IMPROVED]  Remove passwordsVC while not needed.
[ADDED]     Emergency generator.
2014-04-12 14:43:41 -04:00
Maarten Billemont
bd37f1d6a7 Completed password cell handling and misc UI and moc update improvements.
[UPDATED]   Make private moc parent of all private blocks to avoid blocking the main thread for writes, update the main moc on private moc updates.
[FIXED]     Don't cause a crash on elements with a bad type.
[UPDATED]   Improved cell handling and UI update handling.
[UPDATED]   Replace FontReplacer with moarfonts to fix issues in UICollectionViewCells.
2014-04-06 23:34:18 -04:00
Maarten Billemont
f475c15360 Dismiss search when tapped outside. 2014-03-20 16:49:33 -04:00
Maarten Billemont
d3d4aeea41 Fix avatar item size to collection view size. 2014-03-20 08:42:15 -04:00
Maarten Billemont
5913ce80e5 full-height avatar collection view + iphone 4 height/keyboard fix. 2014-03-20 08:13:06 -04:00
Maarten Billemont
4c8bed2826 New passwords display in collection view. 2014-03-20 07:15:37 -04:00
Maarten Billemont
d036b43d6f Updated animations for activation of the passwords VC and fancier focussed user. 2014-03-19 20:09:25 -04:00
Maarten Billemont
318aca4d8f WIP - new UI for Master Password. 2014-03-15 20:38:14 -04:00
Maarten Billemont
060c9f91f3 "gmail.com" in guide search bar, iCloud description and tip tooltip.
[UPDATED]   Layout of setup on 4" iPhones.
[UPDATED]   iCloud description text.
[UPDATED]   Show "gmail.com" in the guide's search bar.
[ADDED]     A tooltip on the tip button.
2014-03-08 16:37:36 -05:00
Maarten Billemont
4184f609d6 Fixed updating search results when query is no match or element deleted.
[FIXED]     Make search results empty when no results.
[FIXED]     Update search results upon deletion.
2014-02-28 20:44:29 -05:00
Maarten Billemont
658d710847 Cloud and initial window improvements.
[ADDED]     Advanced option to mark self as corrupt.
[ADDED]     Tell user initial cloud sync can take a moment.
[IMPROVED]  Initial window now visible on full-screen spaces.
[FIXED]     User name label.
2014-02-22 18:27:14 -05:00
Maarten Billemont
3fa9843855 Improved site operations UI.
[IMPROVED]  New UI for site operations.
[ADDED]     Ability to delete a site.
2014-02-21 00:19:24 -05:00
Maarten Billemont
de3f51b447 Merge branch 'master' of github.com:Lyndir/MasterPassword 2014-02-20 07:29:27 -05:00
Maarten Billemont
43c32e0f4c Improved input handling. 2014-02-20 07:29:05 -05:00
Maarten Billemont
775a6fd4ea Collection-view for elements and swipe to modify.
[ADDED]     NSCollectionView for navigating between elements.
[ADDED]     Mac: Functional buttons for changing type, loginName and counter.
2014-02-19 00:59:57 -05:00
Maarten Billemont
4f594c8c1d Merge branch 'master' of github.com:Lyndir/MasterPassword 2014-02-13 17:53:42 -05:00
Maarten Billemont
ebadac8cd8 "Get it for" on new site pages. 2014-02-13 17:53:06 -05:00
Maarten Billemont
c48bed5ebd Add license to site. 2014-02-13 07:44:02 -05:00
Maarten Billemont
4f3efde6f0 Rewrite Mac UI for better multiple site handling. 2014-02-12 00:13:12 -05:00
Maarten Billemont
5b4e86a90a iOSPorts is no longer a requirement + fix some Pearl API. 2014-02-11 08:28:45 -05:00
Maarten Billemont
2be83752db Merge branch 'master' of github.com:Lyndir/MasterPassword 2014-02-10 22:45:13 -05:00
Maarten Billemont
bd1a0f4e25 Fix Mac provisioning. 2014-02-10 22:45:05 -05:00
Maarten Billemont
70cd397591 Get it links on the site. 2014-02-10 09:25:35 -05:00
Maarten Billemont
1120529e34 Added an FAQ page to the homepage.
[ADDED]     FAQ: Answers common questions, most importantly, how to pick a master password.
2014-02-09 22:26:12 -05:00
Maarten Billemont
f57415a08b Security page improvements.
[ADDED]     Table of contents.
[FIXED]     Inline header style fixes.
[ADDED]     Trade-offs.
2014-02-09 17:57:20 -05:00
Maarten Billemont
f9da568bfd Security page improvements.
[UPDATED]   Linguistic improvements to security page.
[ADDED]     Explanation why MP is cryptographically secure.
[ADDED]     Paragraph about Silent Circle and Lavabit to trust section.
[ADDED]     Summary of MP's security features.
[ADDED]     Brief prelude about account security.
2014-02-09 15:44:12 -05:00
Maarten Billemont
39c9f8c5a0 Explain all the security properties of the Master Password solution.
[ADDED]     security.html to the site.
2014-02-07 01:02:43 -05:00
Maarten Billemont
a645e22973 Bump Crashlytics. 2014-01-26 18:57:26 -05:00
Maarten Billemont
eaf86d3348 Use gittip.com instead of Love Lyndir. 2014-01-26 18:55:08 -05:00
Maarten Billemont
2565321a4a Bump TestFlightSDK. 2014-01-26 18:48:05 -05:00
Maarten Billemont
ec828a82fd Build Master Password iOS scheme. 2014-01-26 12:14:33 -05:00
Maarten Billemont
411aa41226 Remove private 'Press' repo. 2014-01-26 12:09:36 -05:00
Maarten Billemont
00b164058d Check out dependencies using script, not git submodule init directly. 2014-01-26 12:03:23 -05:00
Maarten Billemont
9808613c75 Prepare for Travis-CI. 2014-01-26 11:57:57 -05:00
Maarten Billemont
1d20d81652 Bump libraries. 2013-12-23 10:31:06 -05:00
Maarten Billemont
f5c66ff35a Merge branch 'master' of github.com:Lyndir/MasterPassword
Conflicts:
	.gitmodules
2013-12-19 08:17:29 -05:00
Maarten Billemont
4c3d3234f5 Fixed submodule path for LoveLyndir. 2013-12-19 08:16:39 -05:00
Maarten Billemont
d543173b18 API and libraries bump. 2013-12-16 09:07:01 -05:00
Maarten Billemont
d8578e0162 USM fix and misc fixes.
[UPDATED]   UbiquityStoreManager to fix "bad file descriptor" errors.
[FIXED]     Crashlytics script when plist is empty.
[FIXED]     Missing DCIntrospect in updateDependencies.
[UPDATED]   Project configuration.
2013-12-03 20:34:48 -05:00
Maarten Billemont
d665833eba Add masterpassword CLI tool to website. 2013-12-03 20:29:26 -05:00
Maarten Billemont
33e25a5fed CLI tool install script.
[UPDATED]   Templates are now in ciphers.plist.
[ADDED]     Install script for Java-based mpw CLI tool.
[UPDATED]   Java tool is now bundled in a single executable self-containing JAR.
2013-12-03 08:16:32 -05:00
Maarten Billemont
c0737de939 Fix LoveLyndir submodule checkout. 2013-11-29 20:43:19 -05:00
Maarten Billemont
a18679eba8 Fix typo. 2013-11-17 12:49:15 -05:00
Maarten Billemont
ce321aeceb Make sure symbols of libs still exist in .app.
[FIXED]     Don't strip libs, only .app.
2013-11-16 16:36:46 -05:00
Maarten Billemont
6074547f64 Small fixes and privacy policy.
[UPDATED]   Reload users if the selected user can't be found.
[ADDED]     Privacy policy to the website.
[UPDATED]   Pearl - PearlOverlay from main thread.
2013-11-16 16:35:14 -05:00
Maarten Billemont
8432932cb7 Improved icons. 2013-11-09 21:14:23 -05:00
Maarten Billemont
f8dccc04d7 Minor versions 0-padded to 2 digits.
[FIXED]     Automatic app version calculator broke for minor versions < 10... moar hacks.
2013-11-09 21:04:47 -05:00
Maarten Billemont
b38ef59c93 Cleaner iOS icon for iOS 7. 2013-11-09 20:50:53 -05:00
Maarten Billemont
c1162c76d3 LoveLyndir & USM fixes.
[IMPROVED]      Sped up emergency display.
[UPDATED]       LoveLyndir and USM bump for fixes.
2013-11-09 20:18:36 -05:00
Maarten Billemont
231426d5b3 Add LoveLyndir module. 2013-11-09 19:54:55 -05:00
Maarten Billemont
783eb95438 LoveLyndir bump. 2013-11-07 22:07:46 -05:00
Maarten Billemont
7bdc3e153d Removed NSURL+UbiquityStoreManager from USM. 2013-11-07 22:06:06 -05:00
Maarten Billemont
28460d4576 Handle StoreUUID conflicts and new (offline) devices. 2013-11-07 22:03:34 -05:00
Maarten Billemont
396f6fa7bd Navbar overlap in all-sites VC.
[FIXED]     Navbar hack in all-sites causing overlap on device in iOS 7.
[UPDATED]   iCloud defaults to off.
2013-11-04 08:22:30 -05:00
Maarten Billemont
e39eafee7f Importing sites, activity in iOS 7, wipe cloud, love lyndir.
[FIXED]     Bugs when importing mpsites when the user doesn't exist yet.
[FIXED]     Activity now displayed using PearlOverlay, PearlAlert broke in iOS 7 for activity.
[ADDED]     Advanced option to wipe cloud container.
[UPDATED]   Love Lyndir completion.
2013-10-30 23:37:12 -04:00
Maarten Billemont
f1549fe922 Explain other solutions to the iCloud sites problem.
[UPDATED]   Site explains other solutions to iCloud sites disappearing.
2013-10-18 11:13:02 -04:00
Maarten Billemont
b16c539607 Initial LoveLyndir integration. 2013-10-18 01:16:26 -04:00
Maarten Billemont
b11b33da5f Fix potential crash due to reloading of main view and gesture recognizers.
[MOVED]     Search delegates and controllers and gesture recognizers are now fully handled by the storyboard.
2013-10-17 08:15:29 -04:00
Maarten Billemont
6e9cd5a1f5 Fixed app review URL.
[FIXED]     Review button from within app wasn't working anymore on iOS 7.
2013-10-05 21:25:11 -04:00
Maarten Billemont
b67132671a Modernized Obj-C syntax.
[UPDATED]   Modernized Obj-C syntax.
2013-09-27 21:23:52 -04:00
Maarten Billemont
14e34e8e7a Debug an issue with iOS 6 -> iOS 7 cloud store migration. 2013-09-27 20:06:07 -04:00
Maarten Billemont
16f5ab29fa Fix EXCLUDED_SOURCE_FILE_NAMES. 2013-09-22 23:58:21 -04:00
Maarten Billemont
2af717fe5e Bump USM. 2013-09-22 23:56:19 -04:00
Maarten Billemont
c5be6bd742 Fixed local store migration and possible crash.
[FIXED]     Migration to local store.
[FIXED]     Potential crash when enumerating sheets to dismiss.
2013-09-22 23:46:06 -04:00
Maarten Billemont
693eddb578 Bump libraries. 2013-09-22 01:12:19 -04:00
Maarten Billemont
46e5bc2cbf Bump Pearl. 2013-09-21 22:13:32 -04:00
Maarten Billemont
f11afaaa45 Bump Pearl. 2013-09-21 10:46:27 -04:00
Maarten Billemont
cf64ce96f2 Merge branch 'master' of github.com:Lyndir/MasterPassword 2013-09-21 10:44:04 -04:00
Maarten Billemont
b1eae1b06a Bump libs. 2013-09-21 10:43:39 -04:00
Maarten Billemont
d19af3aba8 Fixes for 64-bit and ubiquity logging.
[ADDED]     Debugging with DCIntrospect and Reveal.
[REMOVED]   A bunch of google+ files that are no longer necessary.
[FIXED]     Type and formatting fixes for 64-bit platform types.
[UPDATED]   Production logging of what StoreManager is doing to help people with trouble out.
[ADDED]     Log reason for ubiquity error to checkpoint.
2013-09-21 10:34:48 -04:00
Maarten Billemont
ece5341e27 Cloud store recovery procedure.
[ADDED]     Describe the procedure to recover cloud stores on the website.
2013-09-20 19:25:53 -04:00
Maarten Billemont
7f9aaf4642 Submodule fixes.
[UPDATED]   InAppSettingsKit now uses the lhunath repo.
[UPDATED]   Fix to updating submodule repo URLs in updateDependencies.
[UPDATED]   Minor fix to PearlEmail.
2013-09-19 11:27:47 -04:00
Maarten Billemont
d59c3690d4 Bump Pearl. 2013-09-18 00:22:47 -04:00
Maarten Billemont
37070e482d Fixed a bunch of UI quirks, iOS 6 & 7.
[FIXED]     UI Quirks in iOS 6 and iOS 7.
2013-09-18 00:21:52 -04:00
Maarten Billemont
7fd322a5c6 Fixed icon and version references in Info.plist.
[FIXED]     Remove obsolete icon Info.plist keys.
[FIXED]     Auto-generated CFBundleVersion hash->decimal must be 9 digits long or version bump may end up lowering version number.
2013-09-17 00:13:21 -04:00
Maarten Billemont
07dd98823f Fixes to migration of local store from old Master Password model persistence models. 2013-09-16 23:18:01 -04:00
Maarten Billemont
40d6019f71 Improvements to store migration.
[IMPROVED]  Don't ask to migrate store when there's no sites in it.
2013-09-15 23:14:51 -04:00
Maarten Billemont
32ec0038b6 Bump USM. 2013-09-14 20:24:07 -04:00
Maarten Billemont
99a1d505d3 Fix a deadlock.
[FIXED]     Deadlock when NSUserDefaultsDidChange is handled on the main queue when the main queue is waiting for the persistence queue.
[FIXED]     Logging of cloudEnabled.
[REMOVED]   Debug NSLogs.
2013-09-14 20:21:25 -04:00
Maarten Billemont
62076d8170 Bump USM. 2013-09-14 14:05:47 -04:00
Maarten Billemont
009b1ff996 Fixes to cloud store switching.
[UPDATED]   Log out when user is no longer available.
[UPDATED]   Re-enabled cloud store switching using new USM store enumeration facilities.
[UPDATED]   Lower log level for test and crash logs so we can see why stuff fails.
2013-09-14 14:04:06 -04:00
Maarten Billemont
27870c7420 Fix positioning of toggles.
[FIXED]     Positioning of on/off toggles.
2013-09-14 00:10:12 -04:00
Maarten Billemont
7a16b47e37 Fading improvement, re-login fixed, UI tweaks.
[IMPROVED]  Fading of share/tip delayed, nicer effect.
[FIXED]     No automatic re-login when store changes and saveKey is YES for the current user.
[UPDATED]   Misc UI improvements.
[REMOVED]   Unassigned app icons and launch images.
2013-09-13 23:58:00 -04:00
Maarten Billemont
48324735e1 Fixed counter issue, status bar issue and updated app icons.
[FIXED]     Counter should default to 1, not 0.
[FIXED]     Some issues with the status bar in the MPMainViewController.
[UPDATED]   AppIcons and LaunchImages converted to asset catalog.
[ADDED]     New iOS 7 size app icon images.
2013-09-13 22:32:32 -04:00
Maarten Billemont
f0dcc4c34c Fixed queuing of password generation logic.
[IMPROVED]  Removed password logic out of MPEntities so that it can be backgrounded without relying on the persistence layer staying up.
[IMPROVED]  Some workload removed from the main thread.
2013-09-13 08:14:58 -04:00
Maarten Billemont
36386c3213 iOS 7 cloud loading. 2013-09-08 10:42:28 -04:00
Maarten Billemont
8ea0f00cf0 Improved cloud store enumeration.
[ADDED]     Stores now enumerated in a TVC.
2013-09-07 10:08:49 -04:00
Maarten Billemont
0921796136 Log VC, iCloud toggling, iOS 7 fixes.
[UPDATED]   Show users and sites in cloud stores of log VC.
[ADDED]     Ability to turn off iCloud if corruption happens.
[ADDED]     When switching iCloud on/off, provide user the option to migrate his current sites.
[ADDED]     Ability to get to settings & logs from unlock VC.
2013-09-05 23:52:12 -04:00
Maarten Billemont
ab360066e5 More robust migration.
[FIXED]     Better recovery from failure to migrate local store.
[FIXED]     Ability to migrate outdated local store models.
2013-08-31 12:29:56 -04:00
Maarten Billemont
34645c9433 Theming for iOS 6, updated status hiding and more exception handling.
[ADDED]     More verbose log printing when trace enabled.
[ADDED]     More exception handling on application launch; we can't allow any of this to keep us from being able to open the emergency generator.
[UPDATED]   Only apply UI theming on iOS 6-.
[ADDED]     Modern way of hiding the status bar on iOS 7.
2013-08-27 23:28:51 -04:00
Maarten Billemont
b2a608824c Merge branch 'master' into ios7
Conflicts:
	MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/project.pbxproj
2013-08-27 22:18:40 -04:00
Maarten Billemont
af56920fd9 Show all release checks that fail at once. 2013-08-27 22:15:45 -04:00
Maarten Billemont
784b741b60 Fix documentation of LocalyticsSession.h 2013-08-27 22:05:16 -04:00
Maarten Billemont
ea066bd828 Fix some warnings in Pearl. 2013-08-27 21:56:47 -04:00
Maarten Billemont
c5d88bd5c7 Bumping libraries and project configuration updates.
[UPDATED]   TestFlight SDK -> 2.0.0
[UPDATED]   USM to deal with exceptions better.
[UPDATED]   Project configuration.
2013-08-27 21:51:56 -04:00
Maarten Billemont
a8115fdced Bump USM. 2013-08-27 20:49:02 -04:00
Maarten Billemont
c0406888fc Fix storyboard inconsistencies.
[FIXED]     Storyboard had multiple resource references with the same name.
2013-08-26 23:25:03 -04:00
Maarten Billemont
c7f04f8449 Merge branch 'master' into ios7 2013-08-26 23:20:28 -04:00
Maarten Billemont
ae4be86ecf UI fix for iOS 7.
[FIXED]     New ActionSheet doesn't deal well with spacing in items.
[FIXED]     UI now works on iOS 7.
2013-08-26 23:20:19 -04:00
Maarten Billemont
d188985823 Revert "UI fix for iOS 7."
This reverts commit ac0d412123.
2013-08-26 23:20:08 -04:00
Maarten Billemont
ac0d412123 UI fix for iOS 7.
[FIXED]     New ActionSheet doesn't deal well with spacing in items.
[FIXED]     UI now works on iOS 7.
2013-08-26 23:19:44 -04:00
Maarten Billemont
19e35dbccd Unclutter the UI and revert to no news. 2013-08-26 23:18:04 -04:00
Maarten Billemont
3086baf523 Fix MPAppsVC pager positioning on 4".
[FIXED]     Manually added pager VC added to wrong superview.
2013-08-26 23:17:02 -04:00
Maarten Billemont
e3d8d3c31c statusbar/navbar visibility & news.html
[FIXED]     Handle statusbar/navbar visibility only from viewWillAppear.
[FIXED]     URL to news.html.
2013-08-26 21:43:34 -04:00
Maarten Billemont
7589b3a048 Revert Xcode 5 change to storyboard. 2013-08-25 18:50:17 -04:00
Maarten Billemont
72f0d69a71 Don't use Localytics or Crashlytics when disabled. 2013-08-25 18:49:13 -04:00
Maarten Billemont
2399156ee4 Conditionally enable crash/analytics. 2013-08-25 15:38:38 -04:00
Maarten Billemont
3d3f08da9b Add a release checking script to prevent bad releases. 2013-08-15 22:18:17 -04:00
Maarten Billemont
2a0abf0da7 Merge branch 'master' of github.com:Lyndir/MasterPassword 2013-08-15 19:38:16 -04:00
Maarten Billemont
2d8146edbd Fixed potential crashed due to rare nil values at checkpoints.
[FIXED]     Avoid nil values at checkpoints since they will cause crashes.
2013-08-15 19:38:05 -04:00
Maarten Billemont
dad198f5e1 Update radials in site to support other browsers. 2013-08-15 09:53:08 -04:00
Maarten Billemont
0a5329fe17 Email/support un news.
[UPDATED]   Refresh news whenever the app opens.
[UPDATED]   Email and support links in news.html
2013-08-11 16:20:56 -04:00
Maarten Billemont
64d9f09cf6 Minor USM bump. 2013-08-11 15:40:44 -04:00
Maarten Billemont
d583d12099 Option to turn off iCloud on corruption.
[ADDED]     Option to turn off iCloud when store is broken.
2013-08-11 15:37:51 -04:00
Maarten Billemont
17bb5706f8 Fixed some minor crash cases.
[FIXED]     Crash when changing iCloud store.
[FIXED]     Use main thread when holding down on a user.
2013-08-11 15:30:01 -04:00
Maarten Billemont
d583bdfd3c Added support page to site.
[ADDED]     Site support page.
2013-08-11 14:11:19 -04:00
Maarten Billemont
9eb9667163 Make sure CFBundleVersion is always higher, try 2... 2013-08-11 00:23:45 -04:00
Maarten Billemont
a315a9dfc3 Make sure CFBundleVersion is always higher... 2013-08-11 00:20:10 -04:00
Maarten Billemont
8375808cdc Bump External dependencies. 2013-08-11 00:08:25 -04:00
Maarten Billemont
77439af486 Bump Crashlytics SDK. 2013-08-10 23:49:43 -04:00
Maarten Billemont
76f4a00738 Revert Storyboard back to Xcode 4 compatible format. 2013-08-10 23:32:33 -04:00
Maarten Billemont
9d615b2d4c Merge branch 'master' of github.com:Lyndir/MasterPassword 2013-07-07 21:17:00 -04:00
Maarten Billemont
aaffc0297e Profile bump.
[UPDATED]   Master Password Ad Hoc profile.
2013-07-07 21:15:57 -04:00
Maarten Billemont
5dc5885582 Site updates.
[UPDATED]   Mention the value of passwords never leaving your device.
[UPDATED]   Added some emphasis in the algorithm section.
2013-06-28 09:07:53 -04:00
Maarten Billemont
7389f5bf45 Fix queue of observer/notification blocks.
[FIXED]     Make sure all notification and observer blocks that expect the main thread are scheduled on it.
2013-06-26 20:23:02 -04:00
Maarten Billemont
b06d461a36 Fix code active signing profile. 2013-06-16 20:27:53 -04:00
Maarten Billemont
802f57878b Bump Press. 2013-06-16 20:25:11 -04:00
Maarten Billemont
bccf35d057 More clear master password creation tip.
[IMPROVED]  Word wall tip.
2013-06-16 19:31:09 -04:00
Maarten Billemont
137a1c531c Legacy icon set. 2013-06-16 15:09:33 -04:00
Maarten Billemont
e96df9f990 Xcode 4 build fixes. 2013-06-16 15:08:05 -04:00
Maarten Billemont
691670cc43 Fix Xcode 4 issues & double type trigger. 2013-06-16 14:22:36 -04:00
Maarten Billemont
bd64bfec67 Password window improvements.
[FIXED]     Password window closes initially.
[FIXED]     Site label more visible.
2013-06-16 13:48:51 -04:00
Maarten Billemont
0813fb40d0 Retire use of confinement concurrency type.
[FIXED]     Confinement concurrency type is just all sorts of buggy.
2013-06-16 12:39:52 -04:00
Maarten Billemont
3cb8215d5a Migrate to xcassets for app icon. 2013-06-16 11:26:32 -04:00
Maarten Billemont
a7fe11e8db Press bump. 2013-06-16 01:01:53 -04:00
Maarten Billemont
4a9fc66b5a Fix new analysis and compiler warnings. 2013-06-16 01:00:57 -04:00
Maarten Billemont
fb81cd61a9 More project configuration. 2013-06-16 00:49:44 -04:00
Maarten Billemont
13034b4184 Project configuration improvements and warning fixes.
[UPDATED]   Fixed some warnings by explicitly type-casting NSNotFound checks.
[UPDATED]   Fixed some Xcode 5 warnings by doing project configuration improvements.
2013-06-16 00:47:33 -04:00
Maarten Billemont
b2345da9f3 Type selection for Mac.
[ADDED]     Mac: Type selection for site passwords.
[UPDATED]   Type changing refactored to be OS independant.
2013-06-15 01:39:49 -04:00
Maarten Billemont
08d3d9ad30 Improve lock/unlock assurance flow.
[FIXED]     Bug that caused the window to sometimes re-open when closed.
2013-06-09 19:03:54 -04:00
Maarten Billemont
797060f609 Add a space to the OS X wrapper name. 2013-06-08 20:37:53 -04:00
Maarten Billemont
ea09116929 Merge branch 'master' of github.com:Lyndir/MasterPassword 2013-06-08 18:13:20 -04:00
Maarten Billemont
86758b498c Open at Login and initial window improvements.
[ADDED]     Mac: Open at Login.
[UPDATED]   Mac: Mark users menu item when no user selected.
[ADDED]     Mac: Toggle open-at-login and enable-cloud from initial window.
2013-06-08 18:12:49 -04:00
Maarten Billemont
9115b56a42 Update updateDependencies. 2013-06-05 09:09:23 -04:00
Maarten Billemont
c400868026 Activate before no-user alert.
[FIXED]     Also activate app before no-user alert.
2013-06-04 21:31:02 -04:00
Maarten Billemont
b4dbb15853 Submodule maintenance. 2013-06-04 08:25:32 -04:00
Maarten Billemont
195f70db53 Menu and first-launch improvements.
[ADDED]     On first start, show the status item by highlighting and opening it.
[UPDATED]   Using RHStatusItemView for status item so we can highlight it programmatically.
[FIXED]     Activate app on startup so apps window shows.
[ADDED]     NSAlert when trying to open password window with no user selected.
[UPDATED]   Crisper menu icon.
2013-06-04 00:56:19 -04:00
Maarten Billemont
f3248f446c Missing news site causes error message in MP.
[ADDED]     Dummy news.html.
2013-06-04 00:52:29 -04:00
Maarten Billemont
80cb2c8a4f Based site on HTML5 boilerplate. 2013-06-02 19:12:25 -04:00
Maarten Billemont
35a600080b iCloud availability check.
[UPDATED]   Disable iCloud preference when iCloud is unavailable.
[FIXED]     Username in incorrect-mp error popup.
2013-05-31 00:14:04 -04:00
Maarten Billemont
af1efe7bc6 iCloud no longer required for Mac.
[UPDATED]   Mac: Allow iCloud to be disabled.
2013-05-30 00:16:03 -04:00
Maarten Billemont
8219ef10f5 New website. 2013-05-30 00:14:51 -04:00
Maarten Billemont
35411c3261 Added new website. 2013-05-26 01:06:44 -04:00
Maarten Billemont
e8bab69ed7 Mac: iOS App Advertisement + bug fixes.
[ADDED]     Window to advertise iOS app.
[FIXED]     Under some conditions, quit didn't work reliably.
[UPDATED]   Mac UI improvements.
[UPDATED]   Mac Executable Name 'Master Password'.
2013-05-19 16:55:43 -04:00
Maarten Billemont
9904fb2d57 Alert display issues fixed.
[FIXED]     Alert display issues.
[FIXED]     Access to activeUser from a different thread.
2013-05-16 00:59:32 -04:00
Maarten Billemont
d7f369350b Store loading and locking modal alerts.
[ADDED]     Waiting until the store is loaded.
[UPDATED]   Hide or lock password window when locked.
2013-05-16 00:19:50 -04:00
Maarten Billemont
0df322f648 Fixed saveKey getting unset and some MOC threading issues.
[FIXED]     Don't unset saveKey when loading the key fails.
            This causes saveKey to fail as soon as it's synced to a device that hasn't saved the key yet.
[FIXED]     A bunch of threading violation issues with thread-confined MOCs.
2013-05-15 22:42:21 -04:00
Maarten Billemont
cb860cec96 Prepare for new site. 2013-05-13 21:11:58 -04:00
Maarten Billemont
14c0b2dd27 Resource clean-up.
[REMOVED]   Unused resources removed from .app.
[DELETED]   Guide pages aren't used anymore.
[UPDATED]   pngcrush'ed all PNGs to reduce their size.
2013-05-13 00:22:24 -04:00
Maarten Billemont
a2521483c2 Fix orientation bug in lock screen.
[FIXED]     When navigating back from oriented main vc, lock vc isn't rotated back to portrait.
2013-05-12 16:48:54 -04:00
Maarten Billemont
fa4b2a9e54 Ability to select a different cloud store.
[ADDED]     Advanced feature to allow selecting a different cloud store.
2013-05-12 14:08:45 -04:00
Maarten Billemont
e3963a72ad Press bump. 2013-05-11 20:05:07 -04:00
Maarten Billemont
cefe8d144d Import fix, password type change fix, fancier generator appearance.
[FIXED]     Import of ubiquity changes was using wrong delegate method and MOC.
[FIXED]     Password type change broken when password type causes a class change.
[IMPROVED]  Fancier animation of emergency generator appearance.
2013-05-11 19:43:41 -04:00
Maarten Billemont
076cfb1257 MOC saving improvements, Mac app activation, loading overlay, USM update.
[MOVED]     iOS code from MPAppDelegate_Shared to MPiOSAppDelegate.
[FIXED]     Perform MOC saving in MOC perform blocks.
[FIXED]     Mac: Activate app when showing password window and not active.
[FIXED]     Hide overlay while corruption dialog is up.
[FIXED]     Hide corruption dialog when reloading store.
2013-05-11 08:55:09 -04:00
Maarten Billemont
71e3f44c8c Improved migration, file-based StoreUUID, Mac fixes.
[ADDED]     Migration to file-based StoreUUID.
[IMPROVED]  Cleaner, more modular, migration code.
[FIXED]     Don't hook activation to show password window: too annoying when focus shifts.
[FIXED]     Don't set the active user when just importing ubiquity changes, it causes a log-out.
[ADDED]     Mac: Ability to rebuild iCloud.
[REMOVED]   Mac: wasRunning logic to avoid password window appearance on first activation.
[FIXED]     Mac: Retrieve siteName from main thread.
2013-05-10 11:13:55 -04:00
Maarten Billemont
c36f34346d Output info level logs when sendInfo is enabled to aid in debugging. 2013-05-07 16:16:33 -04:00
Maarten Billemont
cd6b83ffe8 iPhone 5 alignment issue in unlock VC.
[FIXED]     Deselect new user avatar if MOC is unavailable when tapping it.
[FIXED]     Position of avatars & spinner on iPhone 5.
[IMPROVED]  Issue button in review dialog.
2013-05-07 13:25:05 -04:00
Maarten Billemont
d110fd18c1 Started checkpoint and executable name revert.
[ADDED]     "Started" checkpoint that logs some platform environment properties.
[REVERTED]  Executable/app name back to just MasterPassword.
2013-05-07 11:22:01 -04:00
Maarten Billemont
e45b9985c2 Mac: New sites.
[MOVED]     Creation of new elements moved to shared code.
[FIXED]     When switching user, unset active key.
[FIXED]     Synchronize content calculation to avoid race issues while typing.
[ADDED]     Ability to create new sites.
[FIXED]     Unset active element when hitting backspace or escape.
2013-05-07 00:48:48 -04:00
Maarten Billemont
8f4eb6df84 Merge branch 'master' of github.com:Lyndir/MasterPassword 2013-05-03 23:50:57 -04:00
Maarten Billemont
809bd60169 Info.plist fixes.
[FIXED]     Add extensions to Icon as well to CFBundleIconFiles because Xcode doesn't seem to listen to the Apple docs.
[FIXED]     Removed newsstand metadata: this is not a newsstand app.
2013-05-03 11:29:38 -04:00
Maarten Billemont
802c5949da More compatible way of specifying icon files.
[FIXED]     Add extensions to Icon as well to CFBundleIconFiles because Xcode doesn't seem to listen to the Apple docs.
2013-05-03 10:15:27 -04:00
Maarten Billemont
407c5528ee Fix sign comparison of enum. 2013-05-02 22:03:53 -04:00
Maarten Billemont
fed3a2bc10 Fix sign comparison of enum. 2013-05-02 22:03:53 -04:00
Maarten Billemont
7329353c6c Work-around for a weird Core Data bug. 2013-05-02 22:01:18 -04:00
Maarten Billemont
a7c861d1b0 Work-around for a weird Core Data bug. 2013-05-02 22:01:18 -04:00
Maarten Billemont
9af8ab3360 Merge branch 'master' of github.com:Lyndir/MasterPassword 2013-05-02 20:41:46 -04:00
Maarten Billemont
ddb5328019 Merge branch 'master' of github.com:Lyndir/MasterPassword 2013-05-02 20:41:46 -04:00
Maarten Billemont
96d97d95e1 New user on Mac.
[ADDED]     Mac: Support for creating a new user.
2013-05-02 20:40:12 -04:00
Maarten Billemont
ab15694d9a Safer migration, boolean description fix.
[ADDED]     Safer store migration: don't delete the old store, allowing the client to downgrade.
[ADDED]     Log checkpoints and send to TestFlight too.
[FIXED]     Describe booleans as YES/NO, not 1/0.
2013-05-02 11:19:34 -04:00
Maarten Billemont
81312e3ff4 Safer migration, boolean description fix.
[ADDED]     Safer store migration: don't delete the old store, allowing the client to downgrade.
[ADDED]     Log checkpoints and send to TestFlight too.
[FIXED]     Describe booleans as YES/NO, not 1/0.
2013-05-02 11:19:34 -04:00
Maarten Billemont
5e1e88bdeb Fancier password dialog.
[ADDED]     Mac: Shadows on labels so they're easier to read in regular mode.
[ADDED]     Mac: Some "subtle" bling on the password.
2013-04-30 21:10:52 -04:00
Maarten Billemont
9882bf408c Content generation fix.
[UPDATED]   For safer MOC usage API.
[FIXED]     Actually set the active element so that content is generated.
2013-04-30 20:49:42 -04:00
Maarten Billemont
40f34f3d77 Avoid using object.managedObjectContext - when no strong reference exists to the MOC, it may yield nil.
[FIXED]     Unexpected nil MOCs.
2013-04-30 01:49:53 -04:00
Maarten Billemont
0ee1e176ed Don't use temporary objectIDs for state.
[FIXED]     Make sure we have permanent ObjectIDs before storing them in state.
[FIXED]     MP-14
2013-04-30 00:32:30 -04:00
Maarten Billemont
c73f89e4a1 App versioning update.
[UPDATED]   App versioning: version is now: decimal short commit hash, short version is now tag+commit number.
2013-04-29 21:24:45 -04:00
Maarten Billemont
fe9a1cdbc4 Log Inspector and trace mode.
[ADDED]     Log Inspector, shake on preference screen to open log.
[ADDED]     Trace Mode: Log at trace level.
[FIXED]     Log messages weren't being recorded for inclusion in feedback.
2013-04-29 21:15:14 -04:00
Maarten Billemont
8a4eecd9fa Removed volume button.
[REMOVED]   Volume button in guide - there is no voice-over.
2013-04-28 00:46:08 -04:00
Maarten Billemont
d27a0fdbad Core Data context fixes and migration fixes.
[FIXED]     More careful Core Data threading and context usage.
[FIXED]     iOS bug when migrating, now using USM's copy migration.
[ADDED]     Better handling of store changes while in Main VC and Element List VCs.
2013-04-28 00:35:32 -04:00
Maarten Billemont
07e44a46ae Remove Facebook App ID & add icon to archive. 2013-04-27 17:53:54 -04:00
Maarten Billemont
dfda47bca0 Warn when secret data is unavailable so we notice when it is. 2013-04-27 17:39:31 -04:00
Maarten Billemont
6fb36035c2 TestFlight now uses an "Application Token". 2013-04-27 17:17:51 -04:00
Maarten Billemont
a6e3b83ebb Dumped Google+ SDK.
[UPDATED]   Google+ SDK.
2013-04-27 17:14:05 -04:00
Maarten Billemont
dc3c30a2f7 Localytics update.
[UPDATED]   Localytics update.
[ADDED]     When sendInfo is enabled, set the user identifier on Localytics.
2013-04-27 16:37:32 -04:00
Maarten Billemont
3219fc764f Fixed and updated InAppSettingsKit.
[UPDATED]   InAppSettingsKit
[IMPROVED]  Text in Settings.bundle.
2013-04-27 16:01:31 -04:00
Maarten Billemont
5d5e9395b3 Threading fixes for Mac, spinner fix for iOS.
[UPDATED]   TestFlight.
[FIXED]     Mac: References to MPAppDelegate that should be OS-independant now use MPAppDelegate_Shared.
[FIXED]     Mac: Threading and content UI updates.
[FIXED]     iOS: Spinner was showing when going back to unlock VC.
2013-04-27 00:34:28 -04:00
Maarten Billemont
291b408995 More workspace fixes to avoid iOS/Mac confusion by IDE.
[RENAMED]   MPAppDelegate -> MPiOSAppDelegate for iOS to avoid class name confusion in workspace.
2013-04-24 21:26:04 -04:00
Maarten Billemont
ceb0333fcf Active user switching for for password window.
[RENAMED]   MPAppDelegate -> MPMacAppDelegate for Mac to avoid class name confusion in workspace.
[FIXED]     Window behavior when switching user.
2013-04-24 21:23:53 -04:00
Maarten Billemont
44b4e5430a Password window style.
[ADDED]     Ability to change style of password window.
[FIXED]     Some window activation oddities (WIP).
[UPDATED]   Renamed executable iOS/Mac specific in the hopes of helping with IDE conflicts.
2013-04-24 00:25:51 -04:00
Maarten Billemont
cb7e145e83 Fixed a bunch of OS X issues.
[FIXED]     Don't create a moc when the main moc is unset.
[FIXED]     Load the MPUserEntity into the moc when doing selectUser:
[FIXED]     Remove KVO on activeUserObjectID, isn't used anymore.  Instead, override setActiveUser:
[FIXED]     Don't show the password window on launch.
[FIXED]     Don't force unlock of the key whenever unset - only when the window pops.
[REMOVED]   Migration - this app is not ready for explicit migration, additionally, this block appears to cause a lock-up of the PSC.
2013-04-23 20:38:56 -04:00
Maarten Billemont
35ef2b0789 Icon file restructuring. 2013-04-22 00:57:17 -04:00
Maarten Billemont
e34adae8f0 OS X build fixes. 2013-04-21 17:05:59 -04:00
Maarten Billemont
5137cbf14d Checkpoint for opening emergency generator. 2013-04-21 13:34:33 -04:00
Maarten Billemont
32fb52f48f Update emergencyContentTipContainer in storyboard. 2013-04-20 19:53:54 -04:00
Maarten Billemont
95d5d8b40c Reformat. 2013-04-20 14:11:19 -04:00
Maarten Billemont
c0d57b5561 MPCheckpoint
[UPDATED]   Refactoring of checkpoints.
2013-04-20 13:51:37 -04:00
Maarten Billemont
efcfbe2584 Fixed popup appearance.
[FIXED]     Appearance of popup when copying emergency password.
2013-04-20 12:14:44 -04:00
Maarten Billemont
eeac1d0dd3 Initial page-flip other apps, emergency password copy and marquee hint.
[ADDED]     Initial page-flip animation on opening of other apps VC to make it clear to the user that pages can be flipped.
[ADDED]     Copying of password from emergency generator.
[ADDED]     Marquee animate the bottom tip to also hint about the emergency generator.
2013-04-20 11:44:26 -04:00
Maarten Billemont
ac1358a0ec Emergency generator, action pictograms.
[ADDED]     Emergency Generator!
[ADDED]     Easier method for just using the master password algorithm bare.
[UPDATED]   Pictograms in action popup and centering of text.
2013-04-19 00:43:01 -04:00
Maarten Billemont
c31df49599 activeUser refactor, tool tip hiding and dismiss when logout.
[UPDATED]   Made activeUser access follow same pattern as activeElement which makes it more clear what the thread model is like.
[FIXED]     Save after update of all elements.
[UPDATED]   Tool tips hidden in IB now; makes it less cluttered.
[FIXED]     Dismissing view controllers when logging out.
2013-04-17 22:00:15 -04:00
Maarten Billemont
ee93412dd1 Search & AllSites improvements, sort by recency, rememberLogin setup.
[UPDATED]   Simplified AllSites VC in IB (removed the unused navVC).
[UPDATED]   Outdated sites are now shown in the AllSites VC.
[ADDED]     An update-all-sites button when showing outdated sites in the AllSites VC.
[REMOVED]   Search scopes.
[ADDED]     Sorting elements by recency and usage count now.
[FIXED]     Initial positioning of help container.
[ADDED]     Setup VC for rememberLogin.
2013-04-15 00:04:16 -04:00
Maarten Billemont
7cf2c7f5c6 Setup and guide.
[FIXED]     Setup wasn't showing up on app load.
[FIXED]     More temporary moc fixes and main thread fixes.
[IMPROVED]  Guide now plays an introduction animation.
[FIXED]     Setup iCloud switch is now functional.
2013-04-14 10:26:34 -04:00
Maarten Billemont
5bf8842031 More fixes of temporary moc accesses. 2013-04-13 14:03:50 -04:00
Maarten Billemont
abe874cda3 Temporary moc fix, setup & new guide.
[FIXED]     Pass along temporary mocs, they appear to be stored __weak in the object and we can't rely on them not being nil.
[ADDED]     Setup flow for initially setting the iCloud preference.
[ADDED]     New guide.
[IMPROVED]  Hierarchy and flow of unlock -> main.
2013-04-13 13:40:17 -04:00
Maarten Billemont
036c04f65f Migration cleanup and improvements.
[IMPROVED]  Migration code cleanup.
[FIXED]     When local store migration fails, fall back to opening the old local store if possible.
[FIXED]     Better migration of cloud preferences.
[FIXED]     Better checking of when to perform cloud store migration.
[FIXED]     Always migrate the local store, even when the cloud store is enabled.
[UPDATED]   Removed the loading indicator in favor of a loading overlay.
[UPDATED]   Sorted the file references lexicographically.
2013-04-07 19:43:14 -04:00
Maarten Billemont
418411769d Migration fixes.
[FIXED]     Moved migration into the persistence queue by performing it on willLoadStore.
[FIXED]     Re-enabled cloud after migration.
[UPDATED]   Allow rebuilding the old cloud store if it got deleted locally.
2013-04-06 19:41:20 -04:00
Maarten Billemont
12804984ba Merge branch 'master' of github.com:Lyndir/MasterPassword 2013-04-05 00:33:10 -04:00
Maarten Billemont
de36cf8645 Fixes for new properties in MPAppDelegate_Store
[FIXED]     Properties in categories aren't synthesized.  Using fancy new PearlAssociateObjectProperty from Pearl now to make a fake property.
[FIXED]     Show overlay on UI thread.
[FIXED]     ONLY_ACTIVE_ARCH = NO because weird codesign errors happen on second build with it set to YES.
	modified:   External/Pearl
2013-04-05 00:31:05 -04:00
Maarten Billemont
922230c54e Remove iCloudStoreManager.
[REMOVED]   iCloudStoreManager was replaced by UbiquityStoreManager.
2013-04-04 14:16:33 -04:00
Maarten Billemont
e0e548c611 Merge branch 'master' of github.com:Lyndir/MasterPassword 2013-04-04 10:54:07 -04:00
Maarten Billemont
5e40258f54 Updated for new UbiquityStoreManager API.
[UPDATED]   New and improved UbiquityStoreManager with better API.
2013-04-03 19:25:15 -04:00
Maarten Billemont
2f17639eeb Revert "Temporary build fix: Disable iCloudStoreManager integration."
This reverts commit b301d0bdd6.
2013-04-01 22:03:28 -04:00
Maarten Billemont
e22be0f97c Build fixes. 2013-03-30 11:53:26 -04:00
Maarten Billemont
0a394265fa Update Mac project after file restructuring. 2013-03-29 20:24:06 -04:00
Maarten Billemont
9c10a2c4e3 Xcode workspace
[UPDATED]   Crashlytics.
2013-03-29 17:41:22 -04:00
Maarten Billemont
93a672b22f Update build scripts for new paths.
[FIXED]     After relocation, the build scripts need path updates.
2013-03-29 12:10:01 -04:00
Maarten Billemont
b301d0bdd6 Temporary build fix: Disable iCloudStoreManager integration. 2013-03-29 12:03:31 -04:00
Maarten Billemont
1c79545245 Serious houskeeping: Better file structure & preparation for Xcode workspace. 2013-03-29 11:59:47 -04:00
Maarten Billemont
02b323d640 Keep track of some todos. 2013-03-29 09:07:01 -04:00
Maarten Billemont
4b8d30ac28 Initial android artifact.
[ADDED]     Added initial stub for an android MP app.
2013-03-29 09:05:15 -04:00
Maarten Billemont
cd475580ff iCloudStoreManager is now UbiquityStoreManager 2013-03-29 09:05:03 -04:00
Maarten Billemont
f937792fc2 Typo correction in site. 2013-03-28 10:19:30 -04:00
Maarten Billemont
31d4d5b6c6 Extract common code from SearchVC and AllVC.
[ADDED]     A more generic element listing controller, now used by the
            search controller and all elements listing controller.
[IMPROVED]  Improved change detection and UI handling in the element
            listing controllers.
[FIXED]     Bug with previewing generated password types for
            non-generated elements.
2013-02-10 15:28:58 -05:00
Maarten Billemont
d7d91d13c6 UI updates: site search & type change
[ADDED]     Display the password type when searching for sites.
[ADDED]     Indicate the strength of a password type by time to crack.
[ADDED]     Display a password prediction below each password type on
            the type selection screen.
[MOVED]     Moved the Short type below the Basic type because it's less
            secure.
[FIXED]     Some font regression bugs.
2013-02-08 18:11:24 -05:00
Maarten Billemont
16a7b87d2a Update content font to Source Code Pro.
[UPDATE]    Font of element content and loginName to Source Code Pro for
            improved legibility and distinguishment between O and 0.
[REMOVED]   Unused fonts from the bundle to save space.
2013-02-02 14:17:35 -05:00
Maarten Billemont
21f1e7ee49 New element fix and statusbar experimentation.
[FIXED]     Set lastUsed when creating a new site since elements can't
            be saved without that value set.
[UPDATED]   Configuration for tinting of status bar.
            Doesn't work yet with the custom navbar container image:
            Should check if last row of that image's pixels isn't too
            dark.  iOS 6 apparently averages it for the tint color.
2013-02-02 01:38:11 -05:00
Maarten Billemont
ad8317a7a0 All sites add button.
[ADDED]     An add site button in the all sites VC.
2013-02-02 00:45:30 -05:00
Maarten Billemont
820be14845 Add missing dependencies to updateDependencies. 2013-02-01 16:45:35 -05:00
Maarten Billemont
b7d3b2d02c Ignore IDE preferences of Java implementation. 2013-02-01 12:54:57 -05:00
Maarten Billemont
a710765336 Bump Java dependencies to release.
[UPDATED]   Java: property-list to 2.0.0
2013-02-01 12:53:17 -05:00
Maarten Billemont
9a68cbf533 Listing all sites now with bookmark button and modal VC.
[ADDED]     Modal VC to show all sites.
[UPDATED]   All sites button on search bar now uses bookmark button.
[REMOVED]   Query string hack for search results button.
2013-02-01 01:13:45 -05:00
Maarten Billemont
2bb0e2e3ef Icon update.
[UPDATED]   Icon graphics updated.
2013-01-31 20:58:27 -05:00
Maarten Billemont
17c47269a3 Startup UI improvements.
[IMPROVED]  Fade-in effect when opening Master Password.
[IMPROVED]  Shade of circular shadow fixed between launch image and
            background image.
2013-01-31 18:58:56 -05:00
Maarten Billemont
6c23134e47 Update Google+ integration.
[UPDATED]   Google+ SDK to 1.1.0.
2013-01-31 16:33:46 -05:00
Maarten Billemont
cc015ada1b Delete stale reference to facebook-ios-sdk
[REMOVED]   Stale reference to facebook-ios-sdk submodule.
2013-01-31 12:29:24 -05:00
Maarten Billemont
acd52e8ef6 Bump Pearl and TestFlight for iOS 6 fixes.
[UPDATED]   Pearl for iOS 6 compilation fixes.
[UPDATED]   TestFlight for close_file bugfix.
2013-01-31 12:25:17 -05:00
Maarten Billemont
f2ee139db6 Social update, CoreData overhaul & iOS6/rotation fixes.
[REMOVED]   Facebook SDK.
[ADDED]     Social framework integration for Twitter & Facebook.
[MOVED]     User migration warning state moved into MainVC, out of
            data model.
[UPDATED]   Major overhaul of Core Data integration.  Multiple contexts
            and making sure we're on the right thread and the right
            context even for read access.
[FIXED]     Some iOS 6 deprecation fixes.
[FIXED]     Some VC rotation issues.
2013-01-31 00:42:32 -05:00
Maarten Billemont
725da285da Minor code improvement.
[FIXED]     Some minor code fixes thanks to inspections.
[FIXED]     Some iOS6 deprecation issues.
[IMPROVED]  Cleanup with regards to store migration.
2013-01-27 16:27:49 -05:00
Maarten Billemont
1b3f5f5d25 Added a few missing resources.
[ADDED]     Mac: Missing menu icon.
[UPDATED]   Sketch source file for iOS app icon and Mac menu icon.
2013-01-27 01:02:41 -05:00
Maarten Billemont
ecd03ecf42 Update of iOS code for updated API of UbiquityStoreManager.
[UPDATED]   UbiquityStoreManager's new API uses cloudEnabled instead of iCloudEnabled.
2013-01-27 00:54:54 -05:00
Maarten Billemont
d5bffd86d6 Mac fixes and improvements to usability.
[FIXED]     Mac: Locking shouldn't unset the active user.
[IMPROVED]  Mac: Behavior of auto-completing site-name field improved.
[ADDED]     Mac: Alert when MP is incorrect when unlocking.
2013-01-26 22:12:34 -05:00
Maarten Billemont
b07298e203 Fixed migration of old store to new store + don't hold references to CoreData objects.
[FIXED]     Working migration of old store to new store.
[FIXED]     We shouldn't be holding references to CoreData objects anywhere.
            In that light, the user NSMenuItems have been fixed.
2013-01-25 01:05:31 -05:00
Maarten Billemont
4c19a29897 Mac support for user handling and iCloud improvements.
[MOVED]     Extract user migration out of iOS specific codebase.
[UPDATED]   iCloud persistence manager.
[ADDED]     Mac: Hotkey for signing the user out.
[IMPROVED]  Mac: Menu item handling and usability.
2013-01-17 00:37:20 -05:00
Maarten Billemont
32f870406c Mac UI fixes.
[FIXED]     Behavior of the Mac menu item and appearance of the password
            window.
[ADDED]     Disabling menu items while not usable and explaining
            disabled items with tooltips.
2012-11-01 10:55:11 -04:00
Maarten Billemont
05ab38b998 Facebook updates + Mac fixes.
[UPDATED]   Facebook integration bumped for iOS 6.
[FIXED]     Bringing Mac version back up to date.  Compiles again and
            runs with UI bugs.
[ADDED]     Mac: User selection.
2012-10-30 22:54:34 -04:00
Maarten Billemont
678545cc26 Make parent pom resolvable.
[FIXED]     Java: Make the parent POM resolvable for people that don't
            have the snapshot version of it.
2012-10-23 09:21:33 -04:00
Maarten Billemont
4c3e0f0c97 Site updates.
[ADDED]     Smart App Banner added to site.
[UPDATED]   Available-on-App-Store resource updated.
2012-10-09 09:58:44 +02:00
Maarten Billemont
a8752b5f28 Disable TestFlight's feedback dialog.
[REMOVED]   TestFlight's feedback dialog.  It's ugly and it doesn't
            allow log sending.
2012-09-23 17:38:05 +02:00
Maarten Billemont
f75f5c1b30 Signing profile bump. 2012-09-22 17:48:35 +02:00
Maarten Billemont
735a75df92 News file referenced by the new version. 2012-09-22 17:38:05 +02:00
Maarten Billemont
d8414aaab9 Fix the URL of the news page to point to the web. 2012-09-22 10:23:21 +02:00
Maarten Billemont
02a5d48ce4 Added a news view.
[ADDED]     A news view on the unlock screen.
2012-09-22 10:14:41 +02:00
Maarten Billemont
cdee54a0f7 TestFlight update to 1.1 2012-09-22 08:53:55 +02:00
Maarten Billemont
b1f0f70849 Localytics SDK update because of startup issue. 2012-09-21 19:42:18 +02:00
Maarten Billemont
850978cbe3 Fixed bug with scroll view in iOS5.
[FIXED]     On iOS5, the app crashed because gesture recognizers of a
            scrollview were being replaced.  Now properly adding the
            desired gesture recognizer to the scroll view preserving the
            existing gesture recognizers.
2012-09-21 16:45:57 +02:00
Maarten Billemont
e8c00296bd TestFligt identifier + Localytics crash.
[IMPROVED]  Use correct device identifier for TestFlight depending on
            whether we're in AdHoc mode or not.
[FIXED]     Crash when sending nil config values to Localytics.
2012-09-21 10:31:48 +02:00
Maarten Billemont
52b8033c37 Fixed issue with logs in feedback message.
[FIXED]     Including logs in the feedback message caused failure to
            parse attachments.
2012-09-20 21:37:58 +02:00
Maarten Billemont
6f2bc83806 Revert the renameID change to see if it causes model incompatibilties. 2012-09-20 21:19:44 +02:00
Maarten Billemont
2a48c9d272 Fixed some rare crashes.
[FIXED]     Crash for users with no name.
[FIXED]     Crash when copying an element with no content.
2012-09-20 21:16:34 +02:00
Maarten Billemont
27d0373a6e Add TestFlight back. 2012-09-19 23:52:23 +02:00
Maarten Billemont
96b50f7ef0 Not ready yet for ARMv7s.
[REVERTED]  Still too many of our dependant libs have no ARMv7s symbols.
2012-09-19 23:46:39 +02:00
Maarten Billemont
dc7ff5f668 Bump for ARMv7s Pearl libs. 2012-09-19 23:43:15 +02:00
Maarten Billemont
0c9c9737d9 Only show TestFlight feedback in Adhoc mode. 2012-09-19 23:34:17 +02:00
Maarten Billemont
8ef099d707 Signing configuration update. 2012-09-19 23:31:46 +02:00
Maarten Billemont
6da15306b0 Work-around for iOS 6 bug.
[FIXED]     iOS 6 SDK seems to crash on iOS 5 devices when doing
            scrollEnabled.
2012-09-19 23:29:21 +02:00
Maarten Billemont
699d0869fc ARMv7s
[UPDATED]   Project configuration update for ARMv7s support.
2012-09-19 22:11:16 +02:00
Maarten Billemont
83efa853fc Binary libraries only support armv7.
[FIXED]     Crashlytics only supports armv7 so force armv7 for now.
2012-09-13 00:48:45 +02:00
Maarten Billemont
75de4b443f iPhone 5 compatibility.
[ADDED]     Taller iPhone 5-size launch image.
[FIXED]     Missing PSC in MOC.
[IMPROVED]  Slower fade-in of unlock UI.
[FIXED]     Properly set enableHTTPS in Localytics.
2012-09-13 00:38:15 +02:00
Maarten Billemont
42c7fb446e Localytics project configuration update. 2012-09-12 16:07:36 +02:00
Maarten Billemont
bce6b96417 Tag screens in Localytics + email fix + psc fix
[FIXED]     Sending email with no recipient caused a crash.
[FIXED]     Duplicate persistence coordinator.
[UPDATED]   Crashlytics and Localytics SDKs.
[UPDATED]   Don't continue the Localytics session when device locked.
[UPDATED]   Put Localytics communication on HTTPS for confidentiality.
[ADDED]     Tagging screens in Localytics.
2012-09-12 16:02:02 +02:00
Maarten Billemont
6f82cf7f15 Fixed crashes related to over-released gesture recognizers.
[FIXED]     Memory warnings caused Master Password to crash due to
            gesture recognizers and an iOS 5 bug.
2012-09-07 23:55:12 +02:00
Maarten Billemont
fac419dd94 Fixes related to review feedback. 2012-09-02 21:16:16 +02:00
Maarten Billemont
c03d547ad8 Font improvements and copy-login fix.
[FIXED]     Login name copies content instead of login name.
[IMPROVED]  Font of password and login name improved for better
            differentiation between capital and lower-case letters.
2012-09-02 13:14:09 +02:00
Maarten Billemont
e2bf8cefa2 Migration of saved passwords.
[ADDED]     Migrate saved passwords when master password changes.
[IMPROVED]  UI improvements to apps.
2012-09-01 22:14:57 +02:00
Maarten Billemont
d75ec5c689 Added "Other Apps".
[REMOVED]   Cleaned up some check points that weren't really useful.
[ADDED]     Added a few new checkpoints with new functionality.
[ADDED]     An "other apps" page that introduces Gorillas and DeBlock.
[IMPROVED]  Help is now toggled with a drag handle instead of an action
            button.
2012-09-01 14:57:55 +02:00
Maarten Billemont
aa2d9eb202 Bump Pearl. 2012-08-31 16:30:05 +02:00
Maarten Billemont
ac52f38612 Disabled custom button title font because of odd iOS bug.
[FIXED]     Odd bug that causes imageViews to get oddly stretched.
2012-08-31 11:47:50 +02:00
Maarten Billemont
332808027f Make user name entry required.
[FIXED]     Prevent the ability to create a new user without user name.
2012-08-30 22:47:33 +02:00
Maarten Billemont
cd64bff5ef Layout Core Data model graph. 2012-08-30 22:30:42 +02:00
Maarten Billemont
7813ddee38 Fade unlock VC + search bar responder fix.
[ADDED]     Fade effect to unlock view.
[UPDATED]   Signing profiles.
[FIXED]     A rare bug that caused the search bar to remain first responder without making it take input or dismissable (hopefully fixed, at least).
2012-08-28 00:13:46 +02:00
Maarten Billemont
af744235bc Status bar issue.
[FIXED]     Status bar issue.
[FIXED]     Review dialog link and buttons.
2012-08-27 00:14:33 +02:00
Maarten Billemont
ca9cbc9fd1 Follow on social networks.
[UPDATED]   Migrated from MFMailComposeViewController to PearlEMail.
[ADDED]     Social network "follow" button.
2012-08-26 17:40:32 +02:00
Maarten Billemont
5e7b6ed60e Sharing on Facebook, Twitter and Google+
[FIXED]     Font of navbar.
[FIXED]     A few compile fixes.
[IMPROVED]  Made properties nonatomic.
[ADDED]     Support for facebook, twitter and google+ sharing.
2012-08-25 12:55:07 +02:00
Maarten Billemont
b9ccee398e Fixed a few crashes.
[UPDATED]   A nil type is never OK.  Crash early if it is so.
[UPDATED]   Set crashlytics identifiers using its userIdentifier and userName property for good metadata.
[FIXED]     Make sure the MOC has a PSC with stores when returning it.
[FIXED]     Don't reset the store for just any open error! Only if it's actually incompatible.
[IMPROVED]  Remove timestamps from Crashlytics and TestFlight logs, they already provide them.
[FIXED]     Avoid crashes in some odd cases where there's no type set.
2012-08-24 10:12:15 +02:00
Maarten Billemont
7921734740 Modernize ObjC syntax.
[IMPROVED]  Migrate to modern ObjC syntax for type boxing.
2012-08-19 20:02:23 +02:00
Maarten Billemont
9d883b6ff7 UserName -> LoginName 2012-08-19 19:54:06 +02:00
Maarten Billemont
75ef15bb4d Import improvements and core data fixes.
[FIXED]     Import fixes:
                - Wait for MOC to become available.
                - Progress UI while working.
                - Import files exported with a different master password.
                - Core Data crashes.
[RENAMED]   Site's User name -> Login name.
[FIXED]     Core Data crashes related to using entities from old MOCs.
2012-08-19 09:34:49 +02:00
Maarten Billemont
479d357bd1 Fixed importing with a different key and entity access after MOC changes.
[FIXED]   Importing stored content when not logged in with the same key.
[FIXED]   Holding entities is a bad idea when MOCs can change.  Holding ObjectIDs instead now.
2012-08-18 15:37:24 +02:00
Maarten Billemont
d429044f64 Remove debugging "Save" button + fix keybaord appearance.
[FIXED]     Keyboard didn't appear when app is reactivated.
[REMOVED]   "Save" option in user menu on lock screen was for debugging.
2012-08-05 11:40:50 +02:00
Maarten Billemont
b38e8d9ea6 Fix appearance of the Guide on start-up.
[FIXED]     When the unlock VC shows, the guide's appearance is aborted.
2012-08-05 11:18:58 +02:00
Maarten Billemont
c928b1ca2c Fix unlock screen when MOC unavailable.
[REMOVED]   Disable TestFlight for release, it doesn't work anyway.
[FIXED]     Properly handle unlock screen when there is no MOC yet.
[FIXED]     Some log statements format strings & arguments.
2012-08-04 23:15:50 +02:00
Maarten Billemont
553a14dced Empty SMS password in repo. 2012-08-04 13:46:43 +02:00
Maarten Billemont
8b8d727ee0 Fixes to key saving and searching.
[FIXED]     Saving of keyData in keychain.
[FIXED]     MPSearchDelegate before MOC is available.
[FIXED]     Tip during search didn't show up.
2012-08-04 12:22:36 +02:00
Maarten Billemont
4cdeab4256 Don't block the MOC lookup.
[IMPROVED]  Don't block when MOC is not yet ready, just return nil.
[IMPROVED]  Outdated tip links to info, icon links to site search.
[IMPROVED]  Minor improvements to error handling during import.
2012-08-04 10:16:58 +02:00
Maarten Billemont
bc3aa3255e Get rid of these binaries; they don't belong in a repo. 2012-07-30 10:19:46 +02:00
Maarten Billemont
f2fdca6a03 Add env var support to CLI.
[ADDED]     The Java CLI client can now take values for the username and
            master password from the environment.
2012-07-30 10:17:26 +02:00
Maarten Billemont
647235616e Fixes to import code.
[FIXED]     Don't recalculate key for each entry in import list.
[FIXED]     Use correct fetch request to find user entity for import.
[FIXED]     Properly schedule all use of MOC with performBlock*
[ADDED]     Use undoManager to revert failed import changes.
2012-07-30 07:58:18 +02:00
Maarten Billemont
b0b6dcc56b Make iCloud removal use file coordinators. 2012-07-29 15:36:00 +02:00
Maarten Billemont
918a240dba UI fixes to do with password type button and help.
[FIXED]     Password type button goes off-screen.
2012-07-29 13:43:11 +02:00
Maarten Billemont
830dcb45ff Word wall + fixes to: guide, export, UI.
[ADDED]     Word wall: Show some random dictionary words while user
            thinks of a new master password to give him some
            inspiration.
[IMPROVED]  Only select user after he choose to reset.
[IMPROVED]  Ugly backdrops in the guide images cleaned up.
[FIXED]     Export of sites should now include a password version field.
[FIXED]     Filename to save exported passwords into should use day of
            the month instead of day of the year.
[FIXED]     No search predicate was set when search scope button wasn't
            set.  As a result, sites from other users showed up.
2012-07-29 12:40:22 +02:00
Maarten Billemont
7be9884075 Better abstraction for key & algorithm + V1
[IMPROVED]  A master password key is now better abstracted in an object.
[IMPROVED]  A master password algorithm is now better astracted in an
            object.
[ADDED]     Elements now have a specific algorithm version.
[ADDED]     Automatic/explicit migration of elements.
[ADDED]     Searching outdated elements.
2012-07-17 22:57:11 +02:00
Maarten Billemont
5ca0d954bb UI improvements with regards to user name saving.
[IMPROVED]  Settings -> user button.
[IMPROVED]  More sensible and understandable logic.
[FIXED]     State handling of what to show when, etc.
2012-07-16 21:49:27 +02:00
Maarten Billemont
02d69261df Password settings alpha.
[FIXED]     Hide password settings when no element selected.
2012-07-16 21:03:15 +02:00
Maarten Billemont
fc60460935 Settings toggle and site user name.
[ADDED]     Allow saving a user name per site.  This is an optional
            addition, toggled by tapping the new settings icon.
            Obviously user names can't be recovered after loss.
2012-07-16 20:29:48 +02:00
Maarten Billemont
559e11b16e Video and send-to-phone.
[ADDED]     Site: Demo video.
[ADDED]     Site: Send-to-phone using email and SMS.
2012-07-16 18:45:11 +02:00
Maarten Billemont
0a72809b02 Add +1 to site & hide alert.
[FIXED]     Hide alert message when main view appears.
[ADDED]     Google +1 to site.
2012-07-15 15:23:40 +02:00
Maarten Billemont
8c71ed0081 Fix deleting of users.
[FIXED]     When retrieving content without a key set, return nil.
2012-07-15 00:09:20 +02:00
Maarten Billemont
3e19a026ba Accessibility improvements + Xcode 4.3 fixes.
[ADDED]     Accessibility hints and labels.
2012-07-14 23:57:06 +02:00
Maarten Billemont
8fa3c6c75d Improved algorithm page style.
[FIXED]     A few text fixes in algorithm page.
2012-07-14 23:55:22 +02:00
Maarten Billemont
217cf56d94 Versioning + automatic user selection + misc UI tweaks.
[ADDED]     Versioning and explicit migration to MPElementEntity.
[ADDED]     Upgrade button in case the element needs explicit migration.
[ADDED]     Messages in Crashlytics and TestFlight logs upon
            initialization so we can easily see it worked and what the
            client's versioning looks like.
[IMPROVED]  Only show firstRun UI tooltips once.
[IMPROVED]  Automatically select the latest user upon load of unlock.
[IMPROVED]  Automatically select the user when his password is reset.
[IMPROVED]  Hide active element when logging a user out.
2012-07-12 08:50:34 +02:00
Maarten Billemont
6f37f28a4c Element versioning + upgrade tool & tip.
[ADDED]     "version" to MPElementEntity.
[ADDED]     Tool tip, a tip that points at the content tool.
[ADDED]     Upgrade tool, a tool used for upgrading outdated elements.
2012-07-10 07:26:49 +02:00
Maarten Billemont
3b7d2dc08e Exclusion from GA.
[ADDED]     Site: Method of excluding oneself from Google Analytics.
2012-07-10 07:25:57 +02:00
Maarten Billemont
5e9af44736 Press Kit improvements and addition to site.
[IMPROVED]  Press Kit: Front page + grammar.
[ADDED]     Site: Press Kit download button.
[ADDED]     Site: GA /outbound/ events.
2012-07-09 10:47:00 +02:00
Maarten Billemont
be33a29fa0 AdWords + SEO
[ADDED]     Site: AdWords conversion detection.
[ADDED]     Site: SEO by schema.org tagging.
2012-07-07 01:20:37 +02:00
Maarten Billemont
29ed22d0b7 Badge + java version.
[ADDED]     Site: Price badge on front phone.
[ADDED]     Site: Mention Java version.
[ADDED]     Site: Sync script.
[IMPROVED]  Screenshots of lock screen.
2012-07-06 10:39:49 +02:00
Maarten Billemont
8b997528c9 Improved logging of password generation.
[IMPROVED]  Trace-level logging during password generation.
2012-07-05 13:47:50 +02:00
Maarten Billemont
04a6c8e68d A Java proof-of-concept CLI for Master Password. 2012-07-05 13:42:32 +02:00
Maarten Billemont
0e8e4dc06d Add site tip: Promo code for feedback. 2012-07-05 13:40:31 +02:00
Maarten Billemont
8b91c2a0b8 Press data and site experimentation with nivo-slider.
[ADDED]     Press resources: Releases, media, etc.
2012-07-05 00:02:45 +02:00
Maarten Billemont
e967affddb Added unit tests for playing around with the logic. 2012-07-04 23:57:29 +02:00
Maarten Billemont
dea7434bd4 prMac Press Release
[ADDED]     prMac press release for 1.2.1, REV1b
2012-07-03 11:02:58 +02:00
Maarten Billemont
1da63e450d High-resolution iTunesArtwork. 2012-07-03 11:00:25 +02:00
Maarten Billemont
029d240999 Fixed a crash when tapping a non-type row.
[FIXED]     MP-23 Crash when tapping non-type row
2012-07-03 10:04:39 +02:00
Maarten Billemont
110f7069e1 Lock when backgrounded.
[FIXED]     When backgrounding the app and re-showing it, don't reveal
            the UI when logout is enabled.
2012-06-28 00:02:00 +02:00
Maarten Billemont
d77cde1929 Moved MPSearchDelegate to code.
[FIXED]     Another potential crash because of an over-released
            top-level object in storyboard.
2012-06-27 23:44:37 +02:00
Maarten Billemont
2dba4c87ba Small build fixes.
[FIXED]     Linker warning about PIE.
[UPDATED]   Login failed is no longer recorded when login attempt was
            not using a password (noisy).
2012-06-27 15:01:58 +02:00
Maarten Billemont
6841ae2b0d Updated iTunesArtwork
[IMPROVED]  iTunesArtwork prettier & 1024px.
[ADDED]     FontReplacer target.
2012-06-27 13:53:39 +02:00
Maarten Billemont
a3698b9e47 Guide pager, fonts, crash.
[ADDED]     Page controller in guide to see where in the guide you are.
[ADDED]     FontReplacer to be able to "use" Exo from IB (by
            substituting "Futura").
[FIXED]     A crash when loading the main VC because of the reset
            password gesture recogniser.
[IMPROVED]  Font in tables to standard system fonts.
[IMPROVED]  Guide content positioning and sizing making space for pager.
2012-06-27 09:51:14 +02:00
Maarten Billemont
5b65c8c6bd Improve UI to be more HIG friendly.
[IMPROVED]  Use action sheets instead of alerts when showing destructive
            action choices.
[IMPROVED]  Make tappable regions at least 44x44pt.
[IMPROVED]  Title/message for alert/sheets.
2012-06-25 08:59:54 +02:00
Maarten Billemont
94c9d50a12 Ability to noop TestFlight and Crashlytics 2012-06-24 21:06:00 +02:00
Maarten Billemont
5849c9668f Format noise. 2012-06-24 18:27:10 +02:00
Maarten Billemont
4d4ba3425e Improvements to password import.
[FIXED]     Importing of mpsites with passwords showing for
            stored password types.
[FIXED]     Don't try to show mail composition dialog when the user has
            no mail account configured.  This will crash.  Instead,
            show a friendly popup explaining things.
[IMPROVED]  Message of password export emails.
[FIXED]     Hierarchy of MPUnlockVC so password field becomes touchable.
2012-06-24 16:32:22 +02:00
Maarten Billemont
b7e91358be Use only annotated tags for version determination. 2012-06-24 16:32:22 +02:00
Maarten Billemont
da860d74c4 More internal fixes. 2012-06-24 16:29:51 +02:00
Maarten Billemont
4e2ceb33a0 Fix an odd bug with a missing input handler for certain keyboard types. 2012-06-24 14:53:05 +02:00
Maarten Billemont
d14bde07bd Hardcoded signing profiles to avoid Xcode using the wrong one. 2012-06-23 14:34:26 +02:00
Maarten Billemont
fa2dc822d3 Prettier loading screen and disable Crashlytics debug mode. 2012-06-15 11:34:53 +02:00
Maarten Billemont
d4adafb448 Reset from unlock, FAQ improvements.
[ADDED]     Ability to reset a master password from the unlock screen.
[FIXED]     Manually retain objects that live next to a VC in a
            storyboard within the VC to avoid an OS bug.
[FIXED]     Visibility of the deleteTip.
[ADDED]     An index to the FAQ.
[IMPROVED]  Improved and expanded the FAQ a bit more.
2012-06-15 11:16:02 +02:00
Maarten Billemont
a67d9676ba Improved feedback + logging.
[REMOVED]   Apptentive is now implemented by a standard iOS mail
            composer window and can optionally include logs.
[IMPROVED]  Better inf-level logging of what's going on.
[AUDITED]   Made sure no personal is going out through inf+ levels.
2012-06-14 21:56:54 +02:00
Maarten Billemont
bc2da6a99b Site style updates of what & algorithm pages. 2012-06-12 10:20:06 +02:00
Maarten Billemont
50b5c87f61 Some fixes.
[REMOVED]   Old explanation of saveKey from settings.
[FIXED]     Status-bar display when closing the guide.
[FIXED]     Crash when opening type selection.
2012-06-12 07:52:18 +02:00
Maarten Billemont
d4bcad2658 Small fix of last commit. 2012-06-11 23:44:02 +02:00
Maarten Billemont
13bca309ba Checkpoints update and tag in Localytics too. 2012-06-11 23:39:50 +02:00
Maarten Billemont
83bdb9d626 Checkpoint fixes. 2012-06-11 23:24:23 +02:00
Maarten Billemont
5f1fc453d4 Updated guide + settings bundle + fixes.
[UPDATED]   Guide updated with UI changes.
[FIXED]     Don't animate pushing the unlock VC when appearance of main
            VC is not animated (eg. application startup).
[FIXED]     rememberKey -> rememberLogin in settings bundle.
[REMOVED]   saveKey from settings bundle.
[UPDATED]   Removed lock from the Default image; show a dummy avatar
            instead.
[FIXED]     Don't forget key when signing out.
2012-06-11 23:03:17 +02:00
Maarten Billemont
9c875d4311 Default password type + new user confirmation.
[ADDED]     User preference for default password type.
[RENAMED]   Secure type to Maximum Security.
[FIXED]     Logging bug in password generation.
[ADDED]     Confirmation popup after new user creation.
2012-06-11 16:15:49 +02:00
Maarten Billemont
afafa473a7 Reverted changes to unlock presenting and fixed settings display.
[FIXED]     IASK display by not initializing the VC with the right nib.
2012-06-11 00:53:03 +02:00
Maarten Billemont
4d5f609d72 Fixes.
[REVERTED]  managedObjectContext and persistenceStoreCoordinator needn't
            be lazy anymore.
[FIXED]     AdHoc #def'ed code fixed.
2012-06-10 21:43:18 +02:00
Maarten Billemont
6f1d53ea35 Improved runtime debug logging + new user avatar selection.
[UPDATED]   Crashlytics.
[IMPROVED]  Sending logs and configuration to crashlytics, added
            sendDebugInfo option that allows the user to choose to send
            more info.  Now also sending a device identifier.
[ADDED]     Avatar selection dialog when a new user is created.
2012-06-10 08:36:11 +02:00
Maarten Billemont
a8bf74a925 AppCode code formatting. 2012-06-08 23:46:13 +02:00
Maarten Billemont
d59f77720c Minor improvements. 2012-06-08 21:06:19 +02:00
Maarten Billemont
92be7f7267 Some site layout improvements. 2012-06-08 20:46:08 +02:00
Maarten Billemont
09d5e64c55 Improved signin/signout state logic. 2012-06-08 00:40:30 +02:00
Maarten Billemont
f796888901 Retire version 2 of the site. 2012-06-07 00:27:22 +02:00
Maarten Billemont
679990dc4b Improved algorithm security.
[UPDATED]   Algorithm updated to reflect advice from randombit.net
            cryptography list:
                - Add in a salt (user name) to defeat rainbow tables.
                - Add in a fixed string to scope the algorithm and avoid
                  colliding with someone else's similar or identical
                  algorithm (also helps protect against precalculated
                  rainbow tables).
                - Use HMAC instead of plain SHA to avoid SHA weaknesses.
                  The old implementation wasn't vulnerable to extension
                  attacks or other known weaknesses, but HMAC is a safer
                  choice and will bring up less suspicion.
                - Prefix strings by length as an extra precautionary
                  measure against possible bugs in hash functions.
2012-06-07 00:25:55 +02:00
Maarten Billemont
b472c85c9d Avatar display fixes.
[ADDED]     A new password type: Secure password.  20 characters, not
            word-based, very high entropy.
[FIXED]     UI bugs and improvements with the avatar display and
            password checking state display.
2012-06-06 22:38:43 +02:00
Maarten Billemont
77306e0046 Unlock and user preferences implementation.
[FIXED]     Unlock screen.
[FIXED]     Internal fixes.
[ADDED]     Avatar selection in preferences.
[ADDED]     Implementation of the other preferences.
[IMPROVED]  UI of unlock and preferences screens.
2012-06-06 00:59:09 +02:00
Maarten Billemont
0491ba3f97 Type improvements and fixes.
[IMPROVED]  Cleaner handling of types in entities.
[FIXED]     Lots of little fixes from refactoring and AppCode
            inspections, throughout.
2012-06-05 00:55:02 +02:00
Maarten Billemont
ba299d4674 User support.
[ADDED]     Support for multiple users, each their own master password.
2012-06-04 11:27:02 +02:00
Maarten Billemont
3de9a0c67e Removed apptentive ratings, added some tool tips, and some fixes.
[REMOVED]   Stop using apptentive for rating questions.  Pearl's
            built-in functionality seems nicer and more basic.
[ADDED]     Some more tool-tips to help the user, to be shown on first
            run only.
[FIXED]     The site name tip wasn't showing anymore.
[FIXED]     Some language and formatting in help.html.
2012-05-27 22:35:03 +02:00
Maarten Billemont
7d0ea4b3f5 Some usability improvements + apptentive fixes.
[IMPROVED]  Make persistence more lazy to avoid UI blocks.
[IMPROVED]  Use "Master Password" as CFBundleDisplayName at runtime.  No
            home-screen length restrictions there.
[FIXED]     Inform Apptentive of significant events.
2012-05-27 14:26:13 +02:00
Maarten Billemont
ac14b10752 Integrated Apptentive.
[ADDED]     Experimental support for Apptentive.
2012-05-23 09:30:07 +02:00
Maarten Billemont
2d8f2943e5 Fix headers of other pages of the website. 2012-05-23 08:56:56 +02:00
Maarten Billemont
4c0348b5c8 Disable get satisfaction better. 2012-05-22 00:14:38 +02:00
Maarten Billemont
a5d2f82db4 Site improvements.
[IMPROVED]  Site prepared for production version of Master Password.
[ADDED]     Screenshots and marketing stuff to the site.
[UPDATED]   Texts on the site.
2012-05-21 23:57:06 +02:00
Maarten Billemont
ec8eff2117 Sign distribution builds with distribution profiles.
[FIXED]     When resigning development applications, get-task-allowed
            isn't properly set in the binary.
2012-05-21 08:48:40 +02:00
1265 changed files with 73175 additions and 21862 deletions

23
.gitignore vendored
View File

@@ -2,6 +2,7 @@
.DS_Store
# IntelliJ
/MasterPassword/Java/.idea
/.idea/*
!/.idea/encodings.xml
!/.idea/inspectionProfiles
@@ -12,14 +13,22 @@
/*.iws
# Xcode IDE
/*.xcodeproj/*
!/*.xcodeproj/*.pbxproj
!/*.xcodeproj/xcshareddata
!/*.xcodeproj/xcshareddata/*
!/*.xcodeproj/project.xcworkspace
!/*.xcodeproj/project.xcworkspace/*
/*.xcodeproj/project.xcworkspace/xcuserdata
xcuserdata/
/DerivedData/
# Media
Press/Background.png
Press/Front-Page.png
Press/MasterPassword_PressKit/MasterPassword_pressrelease_*.pdf
# IPA
/sendipa/*
!/sendipa/sendipa.conf
# Java
MasterPassword/Java/**/target
# C
MasterPassword/C/mpw
MasterPassword/C/lib/*/*
!MasterPassword/C/lib/*/.source

14
.gitmodules vendored
View File

@@ -3,7 +3,13 @@
url = git://github.com/Lyndir/Pearl.git
[submodule "External/InAppSettingsKit"]
path = External/InAppSettingsKit
url = git://github.com/futuretap/InAppSettingsKit.git
[submodule "External/iCloudStoreManager"]
path = External/iCloudStoreManager
url = git://github.com/alekseyn/iCloudStoreManager.git
url = git://github.com/lhunath/InAppSettingsKit.git
[submodule "External/UbiquityStoreManager"]
path = External/UbiquityStoreManager
url = git://github.com/lhunath/UbiquityStoreManager.git
[submodule "External/RHStatusItemView"]
path = External/RHStatusItemView
url = git://github.com/lhunath/RHStatusItemView.git
[submodule "External/LoveLyndir"]
path = External/LoveLyndir
url = git://github.com/Lyndir/love-lyndir.client.git

View File

@@ -0,0 +1,17 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0" is_locked="false">
<option name="myName" value="Project Default" />
<option name="myLocal" value="false" />
<inspection_tool class="FunctionImplicitDeclarationInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ImplicitIntegerAndEnumConversion" enabled="false" level="WARNING" enabled_by_default="false" />
<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="OCNotLocalizedStringInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OCUnusedMacroInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OCUnusedMethodInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SignednessMismatch" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnavailableInDeploymentTarget" enabled="true" level="INFO" enabled_by_default="true" />
<inspection_tool class="UnusedLocalVariable" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnusedParameter" enabled="false" level="WARNING" enabled_by_default="false" />
</profile>
</component>

View File

@@ -0,0 +1,7 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</settings>
</component>

7
.travis.yml Normal file
View File

@@ -0,0 +1,7 @@
language: objective-c
xcode_workspace: MasterPassword.xcworkspace
xcode_scheme: MasterPassword iOS (Development)
xcode_sdk: iphonesimulator
git:
submodules: false
before_install: ./Scripts/updateDependencies

View File

@@ -1,89 +0,0 @@
//
// Crashlytics.h
// Crashlytics
//
// Copyright 2012 Crashlytics, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol CrashlyticsDelegate;
@interface Crashlytics : NSObject {
@private
NSString *_apiKey;
NSString *_dataDirectory;
NSString *_bundleIdentifier;
BOOL _installed;
NSMutableDictionary *_customAttributes;
id _user;
NSInteger _sendButtonIndex;
NSInteger _alwaysSendButtonIndex;
NSObject <CrashlyticsDelegate> *_delegate;
}
@property (nonatomic, readonly, copy) NSString *apiKey;
@property (nonatomic, readonly, copy) NSString *version;
@property (nonatomic, assign) BOOL debugMode;
@property (nonatomic, assign) NSObject <CrashlyticsDelegate> *delegate;
/**
*
* The recommended way to install Crashlytics into your application is to place a call
* to +startWithAPIKey: in your -application:didFinishLaunchingWithOptions: method.
*
* This delay defaults to 1 second in order to generally give the application time to
* fully finish launching.
*
**/
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey;
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey afterDelay:(NSTimeInterval)delay;
/**
*
* If you need the functionality provided by the CrashlyticsDelegate protocol, you can use
* these convenience methods to activate the framework and set the delegate in one call.
*
**/
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(NSObject <CrashlyticsDelegate> *)delegate;
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(NSObject <CrashlyticsDelegate> *)delegate afterDelay:(NSTimeInterval)delay;
/**
*
* Access the singleton Crashlytics instance.
*
**/
+ (Crashlytics *)sharedInstance;
/**
*
* The easiest way to cause a crash - great for testing!
*
**/
- (void)crash;
@end
/**
*
* The CrashlyticsDelegate protocol provides a mechanism for your application to take
* action on events that occur in the Crashlytics crash reporting system. You can make
* use of these calls by assigning an object to the Crashlytics' delegate property directly,
* or through the convenience startWithAPIKey:delegate:... methods.
*
**/
@protocol CrashlyticsDelegate <NSObject>
@optional
/**
*
* Called once a Crashlytics instance has determined that the last execution of the
* application ended in a crash. This is called some time after the crash reporting
* process has begun. If you have specififed a delay in one of the
* startWithAPIKey:... calls, this will take at least that long to be invoked.
*
**/
- (void)crashlyticsDidDetectCrashDuringPreviousExecution:(Crashlytics *)crashlytics;
@end

View File

@@ -1 +0,0 @@
../../../run

View File

@@ -1,15 +0,0 @@
#!/usr/bin/ruby
#
# WARNING: DO NOT MODIFY THIS FILE.
#
# Crashlytics
# Crashlytics Version: 1.0.0.1
#
# Copyright Crashlytics, Inc. 2012. All rights reserved.
#
require 'pathname'
path = Pathname.new(__FILE__).parent
`#{path}/../../../run`

Binary file not shown.

1
External/LoveLyndir vendored Submodule

Submodule External/LoveLyndir added at ceed9e2000

Binary file not shown.

View File

@@ -0,0 +1,217 @@
//
// Crashlytics.h
// Crashlytics
//
// Copyright 2013 Crashlytics, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
*
* The CLS_LOG macro provides as easy way to gather more information in your log messages that are
* sent with your crash data. CLS_LOG prepends your custom log message with the function name and
* line number where the macro was used. If your app was built with the DEBUG preprocessor macro
* defined CLS_LOG uses the CLSNSLog function which forwards your log message to NSLog and CLSLog.
* If the DEBUG preprocessor macro is not defined CLS_LOG uses CLSLog only.
*
* Example output:
* -[AppDelegate login:] line 134 $ login start
*
* If you would like to change this macro, create a new header file, unset our define and then define
* your own version. Make sure this new header file is imported after the Crashlytics header file.
*
* #undef CLS_LOG
* #define CLS_LOG(__FORMAT__, ...) CLSNSLog...
*
**/
#ifdef DEBUG
#define CLS_LOG(__FORMAT__, ...) CLSNSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define CLS_LOG(__FORMAT__, ...) CLSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#endif
/**
*
* Add logging that will be sent with your crash data. This logging will not show up in the system.log
* and will only be visible in your Crashlytics dashboard.
*
**/
OBJC_EXTERN void CLSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
/**
*
* Add logging that will be sent with your crash data. This logging will show up in the system.log
* and your Crashlytics dashboard. It is not recommended for Release builds.
*
**/
OBJC_EXTERN void CLSNSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
@protocol CrashlyticsDelegate;
@interface Crashlytics : NSObject
@property (nonatomic, readonly, copy) NSString *apiKey;
@property (nonatomic, readonly, copy) NSString *version;
@property (nonatomic, assign) BOOL debugMode;
@property (nonatomic, assign) NSObject <CrashlyticsDelegate> *delegate;
/**
*
* The recommended way to install Crashlytics into your application is to place a call
* to +startWithAPIKey: in your -application:didFinishLaunchingWithOptions: method.
*
* This delay defaults to 1 second in order to generally give the application time to
* fully finish launching.
*
**/
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey;
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey afterDelay:(NSTimeInterval)delay;
/**
*
* If you need the functionality provided by the CrashlyticsDelegate protocol, you can use
* these convenience methods to activate the framework and set the delegate in one call.
*
**/
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(NSObject <CrashlyticsDelegate> *)delegate;
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(NSObject <CrashlyticsDelegate> *)delegate afterDelay:(NSTimeInterval)delay;
/**
*
* Access the singleton Crashlytics instance.
*
**/
+ (Crashlytics *)sharedInstance;
/**
*
* The easiest way to cause a crash - great for testing!
*
**/
- (void)crash;
/**
*
* Many of our customers have requested the ability to tie crashes to specific end-users of their
* application in order to facilitate responses to support requests or permit the ability to reach
* out for more information. We allow you to specify up to three separate values for display within
* the Crashlytics UI - but please be mindful of your end-user's privacy.
*
* We recommend specifying a user identifier - an arbitrary string that ties an end-user to a record
* in your system. This could be a database id, hash, or other value that is meaningless to a
* third-party observer but can be indexed and queried by you.
*
* Optionally, you may also specify the end-user's name or username, as well as email address if you
* do not have a system that works well with obscured identifiers.
*
* Pursuant to our EULA, this data is transferred securely throughout our system and we will not
* disseminate end-user data unless required to by law. That said, if you choose to provide end-user
* contact information, we strongly recommend that you disclose this in your application's privacy
* policy. Data privacy is of our utmost concern.
*
**/
- (void)setUserIdentifier:(NSString *)identifier;
- (void)setUserName:(NSString *)name;
- (void)setUserEmail:(NSString *)email;
+ (void)setUserIdentifier:(NSString *)identifier;
+ (void)setUserName:(NSString *)name;
+ (void)setUserEmail:(NSString *)email;
/**
*
* Set a value for a key to be associated with your crash data.
*
**/
- (void)setObjectValue:(id)value forKey:(NSString *)key;
- (void)setIntValue:(int)value forKey:(NSString *)key;
- (void)setBoolValue:(BOOL)value forKey:(NSString *)key;
- (void)setFloatValue:(float)value forKey:(NSString *)key;
+ (void)setObjectValue:(id)value forKey:(NSString *)key;
+ (void)setIntValue:(int)value forKey:(NSString *)key;
+ (void)setBoolValue:(BOOL)value forKey:(NSString *)key;
+ (void)setFloatValue:(float)value forKey:(NSString *)key;
@end
/**
* The CLSCrashReport protocol exposes methods that you can call on crash report objects passed
* to delegate methods. If you want these values or the entire object to stay in memory retain
* them or copy them.
**/
@protocol CLSCrashReport <NSObject>
@required
/**
* Returns the session identifier for the crash report.
**/
@property (nonatomic, readonly) NSString *identifier;
/**
* Returns the custom key value data for the crash report.
**/
@property (nonatomic, readonly) NSDictionary *customKeys;
/**
* Returns the CFBundleVersion of the application that crashed.
**/
@property (nonatomic, readonly) NSString *bundleVersion;
/**
* Returns the CFBundleShortVersionString of the application that crashed.
**/
@property (nonatomic, readonly) NSString *bundleShortVersionString;
/**
* Returns the date that the application crashed at.
**/
@property (nonatomic, readonly) NSDate *crashedOnDate;
/**
* Returns the os version that the application crashed on.
**/
@property (nonatomic, readonly) NSString *OSVersion;
/**
* Returns the os build version that the application crashed on.
**/
@property (nonatomic, readonly) NSString *OSBuildVersion;
@end
/**
*
* The CrashlyticsDelegate protocol provides a mechanism for your application to take
* action on events that occur in the Crashlytics crash reporting system. You can make
* use of these calls by assigning an object to the Crashlytics' delegate property directly,
* or through the convenience startWithAPIKey:delegate:... methods.
*
**/
@protocol CrashlyticsDelegate <NSObject>
@optional
/**
*
* Called once a Crashlytics instance has determined that the last execution of the
* application ended in a crash. This is called some time after the crash reporting
* process has begun. If you have specified a delay in one of the
* startWithAPIKey:... calls, this will take at least that long to be invoked.
*
**/
- (void)crashlyticsDidDetectCrashDuringPreviousExecution:(Crashlytics *)crashlytics;
/**
*
* Just like crashlyticsDidDetectCrashDuringPreviousExecution this delegate method is
* called once a Crashlytics instance has determined that the last execution of the
* application ended in a crash. A CLSCrashReport is passed back that contains data about
* the last crash report that was generated. See the CLSCrashReport protocol for method details.
* This method is called after crashlyticsDidDetectCrashDuringPreviousExecution.
*
**/
- (void)crashlytics:(Crashlytics *)crashlytics didDetectCrashDuringPreviousExecution:(id <CLSCrashReport>)crash;
@end

View File

@@ -0,0 +1,30 @@
<?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>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Crashlytics</string>
<key>CFBundleIdentifier</key>
<string>com.crashlytics.sdk.mac</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Crashlytics</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.2</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>macosx</string>
</array>
<key>CFBundleVersion</key>
<string>9</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>MinimumOSVersion</key>
<string>10.6</string>
</dict>
</plist>

BIN
External/Mac/Crashlytics.framework/run vendored Executable file

Binary file not shown.

2
External/Pearl vendored

1
External/RHStatusItemView vendored Submodule

1
External/Reveal.framework/Headers vendored Symbolic link
View File

@@ -0,0 +1 @@
Versions/Current/Headers

1
External/Reveal.framework/Reveal vendored Symbolic link
View File

@@ -0,0 +1 @@
Versions/Current/Reveal

View File

@@ -0,0 +1,17 @@
//
// Copyright (c) 2013 Itty Bitty Apps. All rights reserved.
#import <Foundation/Foundation.h>
extern NSString * const IBARevealLoaderRequestStartNotification;
extern NSString * const IBARevealLoaderRequestStopNotification;
extern NSString * const IBARevealLoaderSetOptionsNotification;
extern NSString * const IBARevealLoaderOptionsLogLevelMaskKey;
@interface IBARevealLoader : NSObject
+ (void)startServer;
+ (void)stopServer;
@end

View File

@@ -0,0 +1,57 @@
// Copyright (c) 2013 Itty Bitty Apps Pty Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
CF_EXTERN_C_BEGIN
/*!
\brief The Reveal Log level bit flags.
\discussion These flags are additive. i.e. you should bitwise OR them together.
\seealso IBARevealLoggerSetLevelMask
\seealso IBARevealLoggerGetLevelMask
Example:
// Enable Error, Warning and Info logger levels.
IBARevealLoggerSetLevelMask(IBARevealLogLevelError|IBARevealLogLevelWarn|IBARevealLogLevelInfo);
*/
typedef NS_OPTIONS(int32_t, IBARevealLogLevel)
{
IBARevealLogLevelNone = 0,
IBARevealLogLevelDebug = (1 << 0),
IBARevealLogLevelInfo = (1 << 1),
IBARevealLogLevelWarn = (1 << 2),
IBARevealLogLevelError = (1 << 3)
};
/*!
\brief Set the Reveal logger level mask.
\param mask A bit mask which is a combination of the IBARevealLogLevel enum options.
\discussion If you do not wish to see log messages from Reveal you should call this function with an appropriate level mask as early in your application's lifecycle as possible. For example in your application's main() function.
Example:
// Enable Error, Warning and Info logger levels.
IBARevealLoggerSetLevelMask(IBARevealLogLevelError|IBARevealLogLevelWarn|IBARevealLogLevelInfo);
*/
CF_EXPORT void IBARevealLoggerSetLevelMask(int32_t mask);
/*!
\brief Get the current Reveal logger level mask.
\return A bit mask representing the levels at which Reveal is currently logging.
\discussion The default Reveal Logger level mask is IBARevealLogLevelError|IBARevealLogLevelWarn|IBARevealLogLevelInfo.
Example:
// Turn off the Info log level.
IBARevealLoggerSetLevelMask(IBARevealLoggerGetLevelMask() & ~IBARevealLogLevelInfo);
*/
CF_EXPORT int32_t IBARevealLoggerGetLevelMask(void);
CF_EXTERN_C_END

View File

@@ -0,0 +1,5 @@
// Copyright (c) 2013 Itty Bitty Apps Pty Ltd. All rights reserved.
//
#import "IBARevealLogger.h"
#import "IBARevealLoader.h"

Binary file not shown.

View File

@@ -0,0 +1 @@
A

223
External/TestFlight/README.md vendored Normal file
View File

@@ -0,0 +1,223 @@
## Introduction
The TestFlight SDK allows you to track how beta testers are testing your application. Out of the box we track simple usage information, such as which tester is using your application, their device model/OS, how long they used the application, and automatic recording of any crashes they encounter.
The SDK can track more information if you pass it to TestFlight. The Checkpoint API is used to help you track exactly how your testers are using your application. Curious about which users passed level 5 in your game, or posted their high score to Twitter, or found that obscure feature? See "Checkpoint API" down below to see how.
The SDK also offers a remote logging solution. Find out more about our logging system in the "Remote Logging" section.
## Requirements
The TestFlight SDK requires iOS 4.3 or above, the Apple LLVM compiler, and the libz library to run.
## Integration
1. Add the files to your project: File -> Add Files to " "
1. Find and select the folder that contains the SDK
2. Make sure that "Copy items into destination folder (if needed)" is checked
3. Set Folders to "Create groups for any added folders"
4. Select all targets that you want to add the SDK to
2. Verify that libTestFlight.a has been added to the Link Binary With Libraries Build Phase for the targets you want to use the SDK with
1. Select your Project in the Project Navigator
2. Select the target you want to enable the SDK for
3. Select the Build Phases tab
4. Open the Link Binary With Libraries Phase
5. If libTestFlight.a is not listed, drag and drop the library from your Project Navigator to the Link Binary With Libraries area
6. Repeat Steps 2 - 5 until all targets you want to use the SDK with have the SDK linked
3. Add libz to your Link Binary With Libraries Build Phase
1. Select your Project in the Project Navigator
2. Select the target you want to enable the SDK for
3. Select the Build Phases tab
4. Open the Link Binary With Libraries Phase
5. Click the + to add a new library
6. Find libz.dylib in the list and add it
7. Repeat Steps 2 - 6 until all targets you want to use the SDK with have libz.dylib
4. Get your App Token
1. If this is a new application, and you have not uploaded it to TestFlight before, first register it here: [https://testflightapp.com/dashboard/applications/create/](https://testflightapp.com/dashboard/applications/create/).
Otherwise, if you have previously uploaded your app to TestFlight, go to your list of applications ([http://testflightapp.com/dashboard/applications/](http://testflightapp.com/dashboard/applications/)) and click on the application you are using from the list.
2. Click on the "App Token" tab on the left. The App Token for that application will be there.
5. In your Application Delegate:
1. Import TestFlight: `#import "TestFlight.h"`
2. Launch TestFlight with your App Token
In your `-application:didFinishLaunchingWithOptions:` method, call `+[TestFlight takeOff:]` with your App Token.
-(BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// start of your application:didFinishLaunchingWithOptions
[TestFlight takeOff:@"Insert your Application Token here"];
// The rest of your application:didFinishLaunchingWithOptions method
// ...
}
3. To report crashes to you we install our own uncaught exception handler. If you are not currently using an exception handler of your own then all you need to do is go to the next step. If you currently use an Exception Handler, or you use another framework that does please go to the section on advanced exception handling.
## Uploading your build
After you have integrated the SDK into your application you need to upload your build to TestFlight. You can upload your build on our [website](https://testflightapp.com/dashboard/builds/add/), using our [desktop app](https://testflightapp.com/desktop/), or by using our [upload API](https://testflightapp.com/api/doc/).
## Basic Features
### Session Information
View information about how often users use your app, how long they use it for, and when they use it. You can see what type of device the user is using, which OS, which language, etc.
Sessions automatically start at when the app becomes active and end when the app resigns active. Sessions that start shortly after an end continue the session instead of starting a new one.
NB: Sessions do not start when `takeOff:` is called, `takeOff:` registers callbacks to start sessions when the app is active.
For **beta** users, you can see who the users are if they have a TestFlight account and their device is registered with TestFlight.
### Crash Reports
The TestFlight SDK automatically reports all crashes (beta and prod) to TestFlight's website where you can view them. Crash reports are sent **at** crash time. TestFlight will also automatically symbolicate all crashes (if you have uploaded your dSYM). For **beta** apps, on the site, you can see which checkpoints the user passed before the crash and see remote logs that were sent before the crash.
### Beta In App Updates
If a user is using a **beta** version of your app and that user has permission to install it; an in app popup will ask them if they would like to install the update. If they tap "Install", the new version is installed from inside the app.
NB: For this to work, you must increment your build version before uploading. Otherwise the new and old builds will have the same version number and we won't know if the user needs to update or is already using the new version.
To turn this off set this option before calling `takeOff:`
[TestFlight setOptions:@{ TFOptionDisableInAppUpdates : @YES }];
## Additional Features
### Checkpoints
When a tester does something you care about in your app, you can pass a checkpoint. For example completing a level, adding a todo item, etc. The checkpoint progress is used to provide insight into how your testers are testing your apps. The passed checkpoints are also attached to crashes, which can help when creating steps to replicate. Checkpoints are visible for all beta builds.
[TestFlight passCheckpoint:@"CHECKPOINT_NAME"];
Use `passCheckpoint:` to track when a user performs certain tasks in your application. This can be useful for making sure testers are hitting all parts of your application, as well as tracking which testers are being thorough.
Checkpoints are meant to tell you if a user visited a place in your app or completed a task. They should not be used for debugging purposes. Instead, use Remote Logging for debugging information (more information below).
NB: Checkpoints are only recorded during BETA sessions.
### Custom Environment Information
In **beta** builds, if you want to see some extra information about your user, you can add some custom environment information. You must add this information before the session starts (a session starts at `takeOff:`) to see it on TestFlight's website. NB: You can only see this information for **beta** users.
[TestFlight addCustomEnvironmentInformation:@"info" forKey:@"key"];
You may call this method as many times as you would like to add more information.
### User Feedback
In **beta** builds, if you collect feedback from your users, you may pass it back to TestFlight which will associate it with the user's current session.
[TestFlight submitFeedback:feedback];
Once users have submitted feedback from inside of the application you can view it in the feedback area of your build page.
### Remote Logging
Remote Logging allows you to see the logs your app prints out remotely, on TestFlight's website. You can see logs for **beta sessions**.
To use it, simply replace all of your `NSLog` calls with `TFLog` calls. An easy way to do this without rewriting all your `NSLog` calls is to add the following macro to your `.pch` file.
#import "TestFlight.h"
#define NSLog TFLog
Not only will `TFLog` log remotely to TestFlight, it will also log to the console (viewable in a device's logs) and STDERR (shown while debugging) just like NSLog does, providing a complete replacement.
For even better information in your remote logs, such as file name and line number, you can use this macro instead:
#define NSLog(__FORMAT__, ...) TFLog((@"%s [Line %d] " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
Which will produce output that looks like
-[MyAppDelegate application:didFinishLaunchingWithOptions:] [Line 45] Launched!
NB: Logs are only recorded during sessions.
**Custom Logging**
If you have your own custom logging, call `TFLog` from your custom logging function. If you do not need `TFLog` to log to the console or STDERR because you handle those yourself, you can turn them off with these calls:
[TestFlight setOptions:@{ TFOptionLogToConsole : @NO }];
[TestFlight setOptions:@{ TFOptionLogToSTDERR : @NO }];
## Advanced Notes
### Checkpoint API
When passing a checkpoint, TestFlight logs the checkpoint synchronously (See Remote Logging for more information). If your app has very high performance needs, you can turn the logging off with the `TFOptionLogOnCheckpoint` option.
### Remote Logging
All logging is done synchronously. Every time the SDK logs, it must write data to a file. This is to ensure log integrity at crash time. Without this, we could not trust logs at crash time. If you have a high performance app, please email support@testflightapp.com for more options.
### Advanced Session Control
Continuing sessions: You can adjust the amount of time a user can leave the app for and still continue the same session when they come back by changing the `TFOptionSessionKeepAliveTimeout` option. Change it to 0 to turn the feature off.
Manual Session Control: If your app is a music player that continues to play music in the background, a navigation app that continues to function in the background, or any app where a user is considered to be "using" the app even while the app is not active you should use Manual Session Control. Please only use manual session control if you know exactly what you are doing. There are many pitfalls which can result in bad session duration and counts. See `TestFlight+ManualSessions.h` for more information and instructions.
### Advanced Exception/Signal Handling
An uncaught exception means that your application is in an unknown state and there is not much that you can do but try and exit gracefully. Our SDK does its best to get the data we collect in this situation to you while it is crashing, but it is designed in such a way that the important act of saving the data occurs in as safe way a way as possible before trying to send anything. If you do use uncaught exception or signal handlers, install your handlers before calling `takeOff:`. Our SDK will then call your handler while ours is running. For example:
/*
My Apps Custom uncaught exception catcher, we do special stuff here, and TestFlight takes care of the rest
*/
void HandleExceptions(NSException *exception) {
NSLog(@"This is where we save the application data during a exception");
// Save application data on crash
}
/*
My Apps Custom signal catcher, we do special stuff here, and TestFlight takes care of the rest
*/
void SignalHandler(int sig) {
NSLog(@"This is where we save the application data during a signal");
// Save application data on crash
}
-(BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// installs HandleExceptions as the Uncaught Exception Handler
NSSetUncaughtExceptionHandler(&HandleExceptions);
// create the signal action structure
struct sigaction newSignalAction;
// initialize the signal action structure
memset(&newSignalAction, 0, sizeof(newSignalAction));
// set SignalHandler as the handler in the signal action structure
newSignalAction.sa_handler = &SignalHandler;
// set SignalHandler as the handlers for SIGABRT, SIGILL and SIGBUS
sigaction(SIGABRT, &newSignalAction, NULL);
sigaction(SIGILL, &newSignalAction, NULL);
sigaction(SIGBUS, &newSignalAction, NULL);
// Call takeOff after install your own unhandled exception and signal handlers
[TestFlight takeOff:@"Insert your Application Token here"];
// continue with your application initialization
}
You do not need to add the above code if your application does not use exception handling already.

View File

@@ -0,0 +1,30 @@
//
// TestFlight+AsyncLogging.h
// libTestFlight
//
// Created by Jason Gregori on 2/12/13.
// Copyright (c) 2013 TestFlight. All rights reserved.
//
/*
When logging, it is important that logs are written synchronously. In the event of a crash, all logs that happened before the crash are gauranteed to be on disk. If they were written asynchronously and a crash occurs, you might lose some very valuable logs that might have helped fixed the crash.
However, because TFLog waits until writing to disk is complete, it takes a while. If you have a very high preformance app that can't afford to wait for logs, these functions are for you.
USE THESE, BUT KNOW YOU RISK LOSING SOME LOGS AT CRASH TIME
*/
#import "TestFlight.h"
#if __cplusplus
extern "C" {
#endif
void TFLog_async(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
void TFLogv_async(NSString *format, va_list arg_list);
#if __cplusplus
}
#endif

View File

@@ -0,0 +1,58 @@
//
// TestFlight+ManualSessions.h
// libTestFlight
//
// Created by Jason Gregori on 5/16/13.
// Copyright (c) 2013 TestFlight. All rights reserved.
//
/*
YOU ARE STRONGLY ADVISED NOT TO USE THESE METHODS unless you know exactly what you are doing. By using these you take on the responsibility of ensuring your session data is reported accurately.
The way TestFlight normally does sessions is to automatically start them at app launch, app did become active, and app will enter foreground and end them at app will resign active, app did enter background, or app will terminate.
If your app is a music player that continues to play music in the background, a navigation app that continues to function in the background, or any app where a user is considered to be "using" the app even while the app is not active, this file is for you.
Usage
-----
1. Add this file to your project.
2. Set the manual sessions option to true **before** calling `takeOff:`
[TestFlight setOptions:@{ TFOptionManualSessions : @YES }];
3. Use the manually start/end session methods to control you sessions.
Pitfalls
--------
When using manual sessions in the background, you must always be aware of the fact that iOS may suspend your app at any time without any warning. You must end your session before that happens. If you do not, the session will continue and include all the time the app was suspended in it's duration if the app is brought back from suspension. This will lead to very inaccurate session lengths and counts.
On app termination: For the most accurate sessions, try to end your session if you know the app is about to terminate. If you do not, the session will still be ended on the next launch, however, it's end time will not be exact. In that case, the end time will be within 30 seconds of the correct time (session information is saved every 30 seconds and when a checkpoint is sent).
Sessions do not continue across termination if you do not end a session before termination.
On crashes: Do not worry about ending sessions in the event of a crash. Even manual sessions are automatically ended in the event of a crash.
Continuing sessions: If a session is started without 30 seconds of the last session ending (and their was no termination between the sessions), the last session will continue instead of a new session starting. This is the case in manual and automatic sessions. You may change the timeout or turn this feature off using the `TFOptionSessionKeepAliveTimeout` option.
*/
#import "TestFlight.h"
extern NSString *const TFOptionManualSessions; // Defaults to @NO. Set to @YES before calling `takeOff:` in order to use manual session methods.
@interface TestFlight (ManualSessions)
// these methods are thread safe
+ (void)manuallyStartSession;
+ (void)manuallyEndSession;
@end

104
External/TestFlight/TestFlight.h vendored Normal file
View File

@@ -0,0 +1,104 @@
//
// TestFlight.h
// libTestFlight
//
// Created by Jonathan Janzen on 06/11/11.
// Copyright 2011 TestFlight. All rights reserved.
#import <Foundation/Foundation.h>
#define TESTFLIGHT_SDK_VERSION @"3.0.0"
#undef TFLog
#if __cplusplus
extern "C" {
#endif
/*
* Remote Logging
* BETA only
* Note: All Logging is synchronous, see the README for more information.
*/
void TFLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
void TFLogv(NSString *format, va_list arg_list);
void TFLogPreFormatted(NSString *message);
#if __cplusplus
}
#endif
/**
* TestFlight object
* All methods are class level
*/
@interface TestFlight : NSObject
/**
* Add custom environment information
* BETA only
* If you want to track custom information such as a user name from your application you can add it here.
* NB: This information must be added before the session starts, it is recorded only on session start.
*
* @param information A string containing the environment you are storing
* @param key The key to store the information with
*/
+ (void)addCustomEnvironmentInformation:(NSString *)information forKey:(NSString*)key;
/**
* Sets up TestFlight's infrastructure.
*
* - Saves App Token
* - Starts automatic session management
* - Installs Crash Handlers
* - Kicks off sending of old session data
*
* @param applicationToken Will be the application token for the current application.
* The token for this application can be retrieved by going to https://testflightapp.com/dashboard/applications/
* selecting this application from the list then selecting SDK.
*/
+ (void)takeOff:(NSString *)applicationToken;
/**
* Sets custom options
*
* @param options NSDictionary containing the options you want to set. Available options are described below at "TestFlight Option Keys"
*
*/
+ (void)setOptions:(NSDictionary*)options;
/**
* Track when a user has passed a checkpoint after the flight has taken off. Eg. passed level 1, posted high score.
* BETA only
* Checkpoints are sent in the background.
* Note: The checkpoint is logged synchronously (See TFLog and TFOptionLogOnCheckpoint for more information).
*
* @param checkpointName The name of the checkpoint, this should be a static string
*/
+ (void)passCheckpoint:(NSString *)checkpointName;
/**
* Submits custom feedback to the site. Sends the data in feedback to the site. This is to be used as the method to submit
* feedback from custom feedback forms.
* BETA only
*
* @param feedback Your users feedback, method does nothing if feedback is nil
*/
+ (void)submitFeedback:(NSString*)feedback;
@end
/**
* TestFlight Option Keys
*
* Pass these as keys to the dictionary you pass to +`[TestFlight setOptions:]`.
* The values should be NSNumber BOOLs (`[NSNumber numberWithBool:YES]` or `@YES`)
*/
extern NSString *const TFOptionDisableInAppUpdates; // Defaults to @NO. Setting to @YES, disables the in app update screen shown in BETA apps when there is a new version available on TestFlight.
extern NSString *const TFOptionFlushSecondsInterval; // Defaults to @60. Set to a number. @0 turns off the flush timer. 30 seconds is the minimum flush interval.
extern NSString *const TFOptionLogOnCheckpoint; // Defaults to @YES. Because logging is synchronous, if you have a high preformance app, you might want to turn this off.
extern NSString *const TFOptionLogToConsole; // Defaults to @YES. Prints remote logs to Apple System Log.
extern NSString *const TFOptionLogToSTDERR; // Defaults to @YES. Sends remote logs to STDERR when debugger is attached.
extern NSString *const TFOptionReinstallCrashHandlers; // If set to @YES: Reinstalls crash handlers, to be used if a third party library installs crash handlers overtop of the TestFlight Crash Handlers.
extern NSString *const TFOptionReportCrashes; // Defaults to @YES. If set to @NO, crash handlers are never installed. Must be set **before** calling `takeOff:`.
extern NSString *const TFOptionSendLogOnlyOnCrash; // Defaults to @NO. Setting to @YES stops remote logs from being sent when sessions end. They would only be sent in the event of a crash.
extern NSString *const TFOptionSessionKeepAliveTimeout; // Defaults to @30. This is the amount of time a user can leave the app for and still continue the same session when they come back. If they are away from the app for longer, a new session is created when they come back. Must be a number. Change to @0 to turn off.

BIN
External/TestFlight/libTestFlight.a vendored Normal file

Binary file not shown.

318
External/TestFlight/release_notes.md vendored Normal file
View File

@@ -0,0 +1,318 @@
## 3.0.0 - February 18, 2014
- Remove checkpoints, feedback, and logs from production apps.
## 2.2.2 - February 5, 2014
- Remove `+ (void)setDeviceIdentifier:(NSString *)deviceIdentifer`, it is no longer used
- On start up, if unsent events are found only attempt to send some of them (this is in case a device doesn't have internet for a while and unsent events build up)
- Fix crash if you try to run `TFLog(nil)` (thanks Florian!)
## 2.2.1 - January 16, 2014
- Consolidate both SDK versions into one which removes all access to `ASIdentifierManager`
## 2.2 - December 17, 2013
- Restore In App Updates
- Automatic identification of beta testers
## 2.1.3 - November 25, 2013
- Fix bug in 2.1.2-noadid which caused adid to be collected
## 2.1.2 - November 19, 2013
- Fix for bug that caused events to not get sent properly when using the `TFOptionSessionKeepAliveTimeout` option
- Fix for bug that caused logs that were sent immediately after start session to sometimes not be sent to server
## 2.1.1 - October 2, 2013
- Create sdk version that removes all access to `ASIdentifierManager`
- Add UIDevice's `identifierForVendor`
## 2.1 - September 30, 2013
- Full support for the iPhone 5s ARM64 processor while still supporting down to iOS 4.3
## 2.0.2 - August 30, 2013
- Fixed a bug where the sdk would cause an app's CPU usage to rise significantly if the device had no internet connection when the app started
## 2.0.1 - August 22, 2013
- Fixed rare `8badf00d` crash in TFNetworkManager that happened when the app was in the background
## 2.0 - August 12, 2013
Improvements
- ARC
- All public TestFlight methods may be called from any thread or dispatch_queue
- All public TestFlight methods (except for `TFLog` and `takeOff:`) are asynchronous, so there is never a wait on them
- TestFlight never uses more than 1 network connection at a time
- All network traffic is grouped together, sent at once, and transferred in MessagePack. This results in using less bandwidth and less network calls.
- All network traffic if server is not reachable
- Size of SDK reduced by 70%
- New In App Update UI in an alert with landscape support. Should work for all different types of apps.
- Manual Sessions: You can manually control session start and end. See `TestFlight+ManualSessions.h` for more information
- Combining of back to back sessions. If a session starts less than 30 seconds from the last session which ended, the previous session is continued. You may change the time limit (or turn this off) using the `TFOptionSessionKeepAliveTimeout` option key.
- No longer automatically starts a session on `+takeOff:` in order to support new background modes that might launch an app in the background.
- `TFOptionReportCrashes` option to not install crash handlers
- Remove all calls to `dispatch_get_current_queue`, it is deprecated
Changes
- Removed all access to mac address
- Added AdSupport.framework requirement (as a replacement for mac address to get accurate user counts)
- Add format attribute to TFLog to show warnings for wrong format specifiers or not using a format string
- Removed Questions
- Removed Feedback View (along with backtrace option)
Bug Fixes
- Fixed addrinfo memory leak
- Fixed possible `-[TFAirTrafficController getNumberOrNilFrom:withKey:]` crash when bad data is received.
- CoreTelephony crash work around: this is a workaround of a iOS bug that causes deallocated instances of `CTTelephonyNetworkInfo` to receive notifications which causes crashes. Core Telephony is used to retrieve the device's mobile carrier.
- Fix bug with crash reporting in iOS 7
## 1.2.4 - February 19, 2013
- Fixed bug that caused crash reports to sometimes not send immediately (they would be resent later)
## 1.2.3 - January 8, 2013
- Fixed typos in readme
- Fixed bug where logs not sent on crash
- Fixed bug where empty crash files were created (but not sent)
- Cache path to TF's directory so it does not need to be regenerated every time
- Use consts for `setOptions:`
- Updated `setDeviceIdentifier:` comments to make them clearer
- Remove potentially conflicting function name `UIColorFromRGB`
- Fixed crash on bad in app update data
## 1.2.2 - December 26, 2012
- Fix typo in app token error message
## 1.2.1 - December 26, 2012
- The max number of concurrent network connections has been reduced from 4 to 2.
##1.2 - November 12, 2012
* Removed Team Token support. As of version 1.2 takeOff must be called with the Application Token, https://testflightapp.com/dashboard/applications/, choose your application, select SDK, get the Token for this Application.
##1.2 BETA 3 - October 11, 2012
* Added application token support. Application Tokens are currently optional if you do not have one you do not need one
##1.2 BETA 2 - October 9, 2012
* Resolved an instance of close_file being called on a bad file descriptor
##1.2 BETA 1 - October 1, 2012
* Removed support for armv6
* Exception handler now returns instead of raising a SIGTRAP
##1.1 - September 13, 2012
* armv7s and iOS 6 support
* Updated for general release
##1.1 BETA 3 - September 12, 2012
* armv7s slice added to library
* fixed typo for in application updates, inAppUdates changed to inAppUpdates
##1.1 BETA 2 - September 6, 2012
* Re-enabled armv6 support
* Added option to disable in application updates
##1.1 BETA 1 - July 13, 2012
* Added TFLogv to allow for log customizations. Check the README or online docs for more information.
* Added option attachBacktraceToFeedback, which attaches a backtrace to feedback sent from the SDK. For users who use feedback in more than one location in the application.
* Resolved issue where other exception handlers would not be called during an exception.
* SDK now sends the device language for a session.
* Documentation fixes.
* Stability fixes.
###1.0 - March 29, 2012
* Resolved occurrences of exceptions with the message "No background task exists with identifier 0"
###1.0 BETA 1 - March 23, 2012
* Privacy Updates
* UDID is no longer collected by the SDK. During testing please use `[TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]];` to send the UDID so you can identify your testers. For release do not set `+setDeviceIdentifier`. See Beta Testing and Release Differentiation in the README or online at [https://testflightapp.com/sdk/doc/1.0beta1/](http://testflightapp.com/sdk/doc/1.0beta1/)
###0.8.3 - February 14, 2012
* Rolled previous beta code into release builds
* No longer allow in application updates to occur in applications that were obtained from the app store.
**Tested compiled library with:**
* Xcode 4.3
* Xcode 4.2
* Xcode 4.1
* Xcode 3.2.6
###0.8.3 BETA 5 - February 10, 2012
* Changed logging from asynchronous to synchronous.
* Resolved crash when looking for a log path failed.
* Added submitFeedback to the TestFlight class to allow for custom feedback forms.
###0.8.3 BETA 4 - January 20, 2012
* Resolved an issue that occured when an application was upgraded from 0.8.3 BETA 1 to 0.8.3 BETA 3+ with unsent data from 0.8.3 BETA 1
###0.8.3 BETA 3 - January 19, 2012
* On crash log files over 64k will not be sent until next launch.
**Known Issues:**
* Logging massive amounts of data at the end of a session may prevent the application from launching in time on next launch
###0.8.3 BETA 2 - January 13, 2012
* libz.dylib is now required to be added to your "Link Binary with Libraries" build phase
* Log file compression, The compression is done on an as needed basis rather than before sending
* Changed all outgoing data from JSON to MessagePack
* Added option `logToSTDERR` to disable the `STDERR` logger
###0.8.3 BETA 1 - December 29, 2011
* In rare occurrences old session data that had not been sent to our server may have been discarded or attached to the wrong build. It is now no longer discarded
* Made sending of Session End events more robust
* Network queuing system does better bursting of unsent data
* Log files that are larger than 64K are now sent sometime after the next launch
* Log files that are larger than 16MB are no longer supported and will be replaced with a message indicating the log file was too large
* Fixed crashes while resuming from background
###0.8.2 - December 20, 2011
* Promoted 0.8.2 BETA 4 to stable
**Known Issues:**
* Under some circumstances Session End events may not be sent until the next launch.
* With large log files Session End events may take a long time to show up.
**Tested compiled library with:**
* Xcode 4.3
* Xcode 4.2
* Xcode 4.1
* Xcode 3.2.6
###0.8.2 BETA 4 - December 12, 2011
* Prevented "The string argument is NULL" from occuring during finishedHandshake in rare cases
* Resolved issue where data recorded while offline may not be sent
###0.8.2 BETA 3 - December 8, 2011
* Added auto-release pools to background setup and tear down
###0.8.2 BETA 2 - December 5, 2011
* Fixed the "pointer being freed was not allocated" bug
###0.8.1 - November 18, 2011
* Implemented TFLog logging system, see README for more information
* Fixed an issue where Session End events may not be sent until next launch
* Fixed an issue where duplicate events could be sent
* Fixed an issue with Session End events not being sent from some iPod touch models
**Tested compiled library with:**
* Xcode 4.2
* Xcode 4.1
* Xcode 3.2.6
###0.8 - November 8, 2011
* Added `SIGTRAP` as a signal type that we catch
* Removed all Objective-c from crash reporting
* Removed the use of non signal safe functions from signal handling
* Created a signal safe way to get symbols from a stack trace
* Changed the keyboardType for Long Answer Questions and Feedback to allow for international character input
* Changed `TESTFLIGHT_SDK_VERSION` string to be an `NSString`
* Changed cache folder from Library/Caches/TestFlight to Library/Caches/com.testflight.testflightsdk
* Fixed issue with saving data when device is offline
* Fixed compability issues with iOS 3
* Added calling into the rootViewController shouldAutorotateToInterfaceOrientation if a rootViewController is set
* Made the comments in TestFlight.h compatible with Appledoc
Tested compiled library with:
* Xcode 4.2
* Xcode 4.1
* Xcode 3.2
###0.7.2 - September 29, 2011
* Changed `TESTFLIGHT_SDK_VERSION` string to be an `NSString`
* Fixed an issue where exiting an application while the SDK is active caused modal views to be dismissed
###0.7.1 - September 22, 2011
* Internal release
* Refactoring
###0.7 - September 21, 2011
* Moved TestFlight images and data to the Library/Caches folder
* Resolved an issue where sometimes the rootViewController could not be found and feedback, questions and upgrade views would not be displayed
* In application upgrade changed to allow skipping until the next version is installed and allows upgrades to be forced
* Fixed a memory leak when launching questions
###0.6 - September 2, 2011
* Renamed base64_encode to testflight_base64_encode to remove a conflict with other third party libraries
* Added ability to reinstall crash handlers when they are overwritten using the setOptions API
* Fixed an issue where crash reports might not get sent under certain circumstances
* Fixed a deadlock when the application is put in the background and then resumed before all information can be sent
* Fixed an issue when attempting to un-install all signal handlers during a signal
* Added support for landscape mode on the iPad to the Questions and Feedback views
* Crash reporting now works in versions of Xcode earlier than 4.2
* Fixed a memory leak during handshake
###0.5 - August 19, 2011
* Feedback that is not attached to a checkpoint [TestFlight openFeedbackView]
* Usability changes to question views
* Removed pause and resume sessions, replaced with sessions being stopped and started
* Added text auto correction to the Long Answer question type
* Crash reports now send on crash instead of next launch
###0.4 - August 15, 2011
* In Application Feedback with Questions
* In application updates
* Custom Environment Information added
* Networking stack reimplementation
* Exception handling fixes
###0.3 - June 15, 2011
* Removed all mention of JSONKit from the README
* Added support for using both the Bundle Version and the Bundle Short Version string
###0.2 - June 14, 2011
* Removed all categories this allows users to use the SDK without having to set -ObjC and -load_all
* Prefixed JSONKit for use in TestFlight to remove reported issues where some users were already using JSONKit
* Added support for armv6 again
###0.1 - June 11, 2011
* Initial Version

View File

@@ -0,0 +1 @@
Versions/Current/Crashlytics

View File

@@ -0,0 +1 @@
Versions/Current/Headers

View File

@@ -0,0 +1 @@
Versions/Current/Resources

Binary file not shown.

View File

@@ -0,0 +1,217 @@
//
// Crashlytics.h
// Crashlytics
//
// Copyright 2013 Crashlytics, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
*
* The CLS_LOG macro provides as easy way to gather more information in your log messages that are
* sent with your crash data. CLS_LOG prepends your custom log message with the function name and
* line number where the macro was used. If your app was built with the DEBUG preprocessor macro
* defined CLS_LOG uses the CLSNSLog function which forwards your log message to NSLog and CLSLog.
* If the DEBUG preprocessor macro is not defined CLS_LOG uses CLSLog only.
*
* Example output:
* -[AppDelegate login:] line 134 $ login start
*
* If you would like to change this macro, create a new header file, unset our define and then define
* your own version. Make sure this new header file is imported after the Crashlytics header file.
*
* #undef CLS_LOG
* #define CLS_LOG(__FORMAT__, ...) CLSNSLog...
*
**/
#ifdef DEBUG
#define CLS_LOG(__FORMAT__, ...) CLSNSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define CLS_LOG(__FORMAT__, ...) CLSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#endif
/**
*
* Add logging that will be sent with your crash data. This logging will not show up in the system.log
* and will only be visible in your Crashlytics dashboard.
*
**/
OBJC_EXTERN void CLSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
/**
*
* Add logging that will be sent with your crash data. This logging will show up in the system.log
* and your Crashlytics dashboard. It is not recommended for Release builds.
*
**/
OBJC_EXTERN void CLSNSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
@protocol CrashlyticsDelegate;
@interface Crashlytics : NSObject
@property (nonatomic, readonly, copy) NSString *apiKey;
@property (nonatomic, readonly, copy) NSString *version;
@property (nonatomic, assign) BOOL debugMode;
@property (nonatomic, assign) NSObject <CrashlyticsDelegate> *delegate;
/**
*
* The recommended way to install Crashlytics into your application is to place a call
* to +startWithAPIKey: in your -application:didFinishLaunchingWithOptions: method.
*
* This delay defaults to 1 second in order to generally give the application time to
* fully finish launching.
*
**/
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey;
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey afterDelay:(NSTimeInterval)delay;
/**
*
* If you need the functionality provided by the CrashlyticsDelegate protocol, you can use
* these convenience methods to activate the framework and set the delegate in one call.
*
**/
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(NSObject <CrashlyticsDelegate> *)delegate;
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(NSObject <CrashlyticsDelegate> *)delegate afterDelay:(NSTimeInterval)delay;
/**
*
* Access the singleton Crashlytics instance.
*
**/
+ (Crashlytics *)sharedInstance;
/**
*
* The easiest way to cause a crash - great for testing!
*
**/
- (void)crash;
/**
*
* Many of our customers have requested the ability to tie crashes to specific end-users of their
* application in order to facilitate responses to support requests or permit the ability to reach
* out for more information. We allow you to specify up to three separate values for display within
* the Crashlytics UI - but please be mindful of your end-user's privacy.
*
* We recommend specifying a user identifier - an arbitrary string that ties an end-user to a record
* in your system. This could be a database id, hash, or other value that is meaningless to a
* third-party observer but can be indexed and queried by you.
*
* Optionally, you may also specify the end-user's name or username, as well as email address if you
* do not have a system that works well with obscured identifiers.
*
* Pursuant to our EULA, this data is transferred securely throughout our system and we will not
* disseminate end-user data unless required to by law. That said, if you choose to provide end-user
* contact information, we strongly recommend that you disclose this in your application's privacy
* policy. Data privacy is of our utmost concern.
*
**/
- (void)setUserIdentifier:(NSString *)identifier;
- (void)setUserName:(NSString *)name;
- (void)setUserEmail:(NSString *)email;
+ (void)setUserIdentifier:(NSString *)identifier;
+ (void)setUserName:(NSString *)name;
+ (void)setUserEmail:(NSString *)email;
/**
*
* Set a value for a key to be associated with your crash data.
*
**/
- (void)setObjectValue:(id)value forKey:(NSString *)key;
- (void)setIntValue:(int)value forKey:(NSString *)key;
- (void)setBoolValue:(BOOL)value forKey:(NSString *)key;
- (void)setFloatValue:(float)value forKey:(NSString *)key;
+ (void)setObjectValue:(id)value forKey:(NSString *)key;
+ (void)setIntValue:(int)value forKey:(NSString *)key;
+ (void)setBoolValue:(BOOL)value forKey:(NSString *)key;
+ (void)setFloatValue:(float)value forKey:(NSString *)key;
@end
/**
* The CLSCrashReport protocol exposes methods that you can call on crash report objects passed
* to delegate methods. If you want these values or the entire object to stay in memory retain
* them or copy them.
**/
@protocol CLSCrashReport <NSObject>
@required
/**
* Returns the session identifier for the crash report.
**/
@property (nonatomic, readonly) NSString *identifier;
/**
* Returns the custom key value data for the crash report.
**/
@property (nonatomic, readonly) NSDictionary *customKeys;
/**
* Returns the CFBundleVersion of the application that crashed.
**/
@property (nonatomic, readonly) NSString *bundleVersion;
/**
* Returns the CFBundleShortVersionString of the application that crashed.
**/
@property (nonatomic, readonly) NSString *bundleShortVersionString;
/**
* Returns the date that the application crashed at.
**/
@property (nonatomic, readonly) NSDate *crashedOnDate;
/**
* Returns the os version that the application crashed on.
**/
@property (nonatomic, readonly) NSString *OSVersion;
/**
* Returns the os build version that the application crashed on.
**/
@property (nonatomic, readonly) NSString *OSBuildVersion;
@end
/**
*
* The CrashlyticsDelegate protocol provides a mechanism for your application to take
* action on events that occur in the Crashlytics crash reporting system. You can make
* use of these calls by assigning an object to the Crashlytics' delegate property directly,
* or through the convenience startWithAPIKey:delegate:... methods.
*
**/
@protocol CrashlyticsDelegate <NSObject>
@optional
/**
*
* Called once a Crashlytics instance has determined that the last execution of the
* application ended in a crash. This is called some time after the crash reporting
* process has begun. If you have specified a delay in one of the
* startWithAPIKey:... calls, this will take at least that long to be invoked.
*
**/
- (void)crashlyticsDidDetectCrashDuringPreviousExecution:(Crashlytics *)crashlytics;
/**
*
* Just like crashlyticsDidDetectCrashDuringPreviousExecution this delegate method is
* called once a Crashlytics instance has determined that the last execution of the
* application ended in a crash. A CLSCrashReport is passed back that contains data about
* the last crash report that was generated. See the CLSCrashReport protocol for method details.
* This method is called after crashlyticsDidDetectCrashDuringPreviousExecution.
*
**/
- (void)crashlytics:(Crashlytics *)crashlytics didDetectCrashDuringPreviousExecution:(id <CLSCrashReport>)crash;
@end

View File

@@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>11C74</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
@@ -17,38 +15,16 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.1.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<string>2.2.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
<string>0100.01.03</string>
<key>CrashlyticsAPIKey</key>
<string>0d10c90776f5ef5acd01ddbeaca9a6cba4814560</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>8H7</string>
<string>33</string>
<key>DTPlatformName</key>
<string>iphoneos</string>
<key>DTPlatformVersion</key>
<string>4.3</string>
<key>DTSDKBuild</key>
<string>8H7</string>
<key>DTSDKName</key>
<string>iphoneos4.3</string>
<key>DTXcode</key>
<string>0410</string>
<key>DTXcodeBuild</key>
<string>4B110</string>
<key>MinimumOSVersion</key>
<string>3.1</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
</array>
<string>4.0</string>
</dict>
</plist>

View File

@@ -0,0 +1 @@
A

BIN
External/iOS/Crashlytics.framework/run vendored Executable file

Binary file not shown.

BIN
External/iOS/Crashlytics.framework/submit vendored Executable file

Binary file not shown.

View File

@@ -1,10 +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>Key.development</key>
<string>e6238ceba8ec92832e77b1b-9ccd60bc-c39b-11e0-06e4-007f58cb3154</string>
<key>Key.distribution</key>
<string></string>
</dict>
</plist>

View File

@@ -1,57 +0,0 @@
//
// LocalyticsDatabase.h
// LocalyticsDemo
//
// Created by jkaufman on 5/26/11.
// Copyright 2011 Localytics. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <sqlite3.h>
#define MAX_DATABASE_SIZE 500000 // The maximum allowed disk size of the primary database file at open, in bytes
#define VACUUM_THRESHOLD 0.8 // The database is vacuumed after its size exceeds this proportion of the maximum.
@interface LocalyticsDatabase : NSObject {
sqlite3 *_databaseConnection;
}
+ (LocalyticsDatabase *)sharedLocalyticsDatabase;
- (NSUInteger)databaseSize;
- (int)eventCount;
- (NSTimeInterval)createdTimestamp;
- (BOOL)beginTransaction:(NSString *)name;
- (BOOL)releaseTransaction:(NSString *)name;
- (BOOL)rollbackTransaction:(NSString *)name;
- (BOOL)incrementLastUploadNumber:(int *)uploadNumber;
- (BOOL)incrementLastSessionNumber:(int *)sessionNumber;
- (BOOL)addEventWithBlobString:(NSString *)blob;
- (BOOL)addCloseEventWithBlobString:(NSString *)blob;
- (BOOL)addFlowEventWithBlobString:(NSString *)blob;
- (BOOL)removeLastCloseAndFlowEvents;
- (BOOL)addHeaderWithSequenceNumber:(int)number blobString:(NSString *)blob rowId:(sqlite3_int64 *)insertedRowId;
- (int)unstagedEventCount;
- (BOOL)stageEventsForUpload:(sqlite3_int64)headerId;
- (BOOL)updateAppKey:(NSString *)appKey;
- (NSString *)uploadBlobString;
- (BOOL)deleteUploadedData;
- (BOOL)resetAnalyticsData;
- (BOOL)vacuumIfRequired;
- (NSTimeInterval)lastSessionStartTimestamp;
- (BOOL)setLastsessionStartTimestamp:(NSTimeInterval)timestamp;
- (BOOL)isOptedOut;
- (BOOL)setOptedOut:(BOOL)optOut;
- (NSString *)installId;
- (NSString *)appKey; // Most recent app key-- may not be that used to open the session.
- (NSString *)customDimension:(int)dimension;
- (BOOL)setCustomDimension:(int)dimension value:(NSString *)value;
@end

View File

@@ -1,743 +0,0 @@
//
// LocalyticsDatabase.m
// LocalyticsDemo
//
// Created by jkaufman on 5/26/11.
// Copyright 2011 Localytics. All rights reserved.
//
#import "LocalyticsDatabase.h"
#define LOCALYTICS_DIR @".localytics" // Name for the directory in which Localytics database is stored
#define LOCALYTICS_DB @"localytics" // File name for the database (without extension)
#define BUSY_TIMEOUT 30 // Maximum time SQlite will busy-wait for the database to unlock before returning SQLITE_BUSY
@interface LocalyticsDatabase ()
- (int)schemaVersion;
- (void)createSchema;
- (void)upgradeToSchemaV2;
- (void)upgradeToSchemaV3;
- (void)moveDbToCaches;
- (NSString *)randomUUID;
@end
@implementation LocalyticsDatabase
// The singleton database object.
static LocalyticsDatabase *_sharedLocalyticsDatabase = nil;
+ (NSString *)localyticsDirectoryPath {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
return [[paths objectAtIndex:0] stringByAppendingPathComponent:LOCALYTICS_DIR];
}
+ (NSString *)localyticsDatabasePath {
NSString *path = [[LocalyticsDatabase localyticsDirectoryPath] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.sqlite", LOCALYTICS_DB]];
return path;
}
#pragma mark Singleton Class
+ (LocalyticsDatabase *)sharedLocalyticsDatabase {
@synchronized(self) {
if (_sharedLocalyticsDatabase == nil) {
_sharedLocalyticsDatabase = [[self alloc] init];
}
}
return _sharedLocalyticsDatabase;
}
- (LocalyticsDatabase *)init {
if((self = [super init])) {
// Mover any data that a previous library may have left in the documents directory
[self moveDbToCaches];
// Create directory structure for Localytics.
NSString *directoryPath = [LocalyticsDatabase localyticsDirectoryPath];
if (![[NSFileManager defaultManager] fileExistsAtPath:directoryPath]) {
[[NSFileManager defaultManager] createDirectoryAtPath:directoryPath withIntermediateDirectories:YES attributes:nil error:nil];
}
// Attempt to open database. It will be created if it does not exist, already.
NSString *dbPath = [LocalyticsDatabase localyticsDatabasePath];
int code = sqlite3_open([dbPath UTF8String], &_databaseConnection);
// If we were unable to open the database, it is likely corrupted. Clobber it and move on.
if (code != SQLITE_OK) {
[[NSFileManager defaultManager] removeItemAtPath:dbPath error:nil];
code = sqlite3_open([dbPath UTF8String], &_databaseConnection);
}
// Check db connection, creating schema if necessary.
if (code == SQLITE_OK) {
sqlite3_busy_timeout(_databaseConnection, BUSY_TIMEOUT); // Defaults to 0, otherwise.
if ([self schemaVersion] == 0) {
[self createSchema];
}
}
// Perform any Migrations if necessary
if ([self schemaVersion] < 2) {
[self upgradeToSchemaV2];
}
if ([self schemaVersion] < 3) {
[self upgradeToSchemaV3];
}
}
return self;
}
#pragma mark - Database
- (BOOL)beginTransaction:(NSString *)name {
const char *sql = [[NSString stringWithFormat:@"SAVEPOINT %@", name] cStringUsingEncoding:NSUTF8StringEncoding];
int code = sqlite3_exec(_databaseConnection, sql, NULL, NULL, NULL);
return code == SQLITE_OK;
}
- (BOOL)releaseTransaction:(NSString *)name {
const char *sql = [[NSString stringWithFormat:@"RELEASE SAVEPOINT %@", name] cStringUsingEncoding:NSUTF8StringEncoding];
int code = sqlite3_exec(_databaseConnection, sql, NULL, NULL, NULL);
return code == SQLITE_OK;
}
- (BOOL)rollbackTransaction:(NSString *)name {
const char *sql = [[NSString stringWithFormat:@"ROLLBACK SAVEPOINT %@", name] cStringUsingEncoding:NSUTF8StringEncoding];
int code = sqlite3_exec(_databaseConnection, sql, NULL, NULL, NULL);
return code == SQLITE_OK;
}
- (int)schemaVersion {
int version = 0;
const char *sql = "SELECT MAX(schema_version) FROM localytics_info";
sqlite3_stmt *selectSchemaVersion;
if(sqlite3_prepare_v2(_databaseConnection, sql, -1, &selectSchemaVersion, NULL) == SQLITE_OK) {
if(sqlite3_step(selectSchemaVersion) == SQLITE_ROW) {
version = sqlite3_column_int(selectSchemaVersion, 0);
}
}
sqlite3_finalize(selectSchemaVersion);
return version;
}
- (NSString *)installId {
NSString *installId = nil;
sqlite3_stmt *selectInstallId;
sqlite3_prepare_v2(_databaseConnection, "SELECT install_id FROM localytics_info", -1, &selectInstallId, NULL);
int code = sqlite3_step(selectInstallId);
if (code == SQLITE_ROW && sqlite3_column_text(selectInstallId, 0)) {
installId = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectInstallId, 0)];
}
sqlite3_finalize(selectInstallId);
return installId;
}
- (NSString *)appKey {
NSString *appKey = nil;
sqlite3_stmt *selectAppKey;
sqlite3_prepare_v2(_databaseConnection, "SELECT app_key FROM localytics_info", -1, &selectAppKey, NULL);
int code = sqlite3_step(selectAppKey);
if (code == SQLITE_ROW && sqlite3_column_text(selectAppKey, 0)) {
appKey = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectAppKey, 0)];
}
sqlite3_finalize(selectAppKey);
return appKey;
}
// Due to the new iOS storage guidelines it is necessary to move the database out of the documents directory
// and into the /library/caches directory
- (void)moveDbToCaches {
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *localyticsDocumentsDirectory = [[documentPaths objectAtIndex:0] stringByAppendingPathComponent:LOCALYTICS_DIR];
NSArray *cachesPaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *localyticsCachesDirectory = [[cachesPaths objectAtIndex:0] stringByAppendingPathComponent:LOCALYTICS_DIR];
// If the old directory doesn't exist, there is nothing else to do here
if([[NSFileManager defaultManager] fileExistsAtPath:localyticsDocumentsDirectory] == NO)
{
return;
}
// Try to move the directory
if(NO == [[NSFileManager defaultManager] moveItemAtPath:localyticsDocumentsDirectory
toPath:localyticsCachesDirectory
error:nil])
{
// If the move failed try and, delete the old directory
[ [NSFileManager defaultManager] removeItemAtPath:localyticsDocumentsDirectory error:nil];
}
}
- (void)createSchema {
int code = SQLITE_OK;
// Execute schema creation within a single transaction.
code = sqlite3_exec(_databaseConnection, "BEGIN", NULL, NULL, NULL);
if (code == SQLITE_OK) {
code = sqlite3_exec(_databaseConnection,
"CREATE TABLE upload_headers ("
"sequence_number INTEGER PRIMARY KEY, "
"blob_string TEXT)",
NULL, NULL, NULL);
}
if (code == SQLITE_OK) {
code = sqlite3_exec(_databaseConnection,
"CREATE TABLE events ("
"event_id INTEGER PRIMARY KEY AUTOINCREMENT, " // In case foreign key constraints are reintroduced.
"upload_header INTEGER, "
"blob_string TEXT NOT NULL)",
NULL, NULL, NULL);
}
if (code == SQLITE_OK) {
code = sqlite3_exec(_databaseConnection,
"CREATE TABLE localytics_info ("
"schema_version INTEGER PRIMARY KEY, "
"last_upload_number INTEGER, "
"last_session_number INTEGER, "
"opt_out BOOLEAN, "
"last_close_event INTEGER, "
"last_flow_event INTEGER, "
"last_session_start REAL, "
"app_key CHAR(64), "
"custom_d0 CHAR(64), "
"custom_d1 CHAR(64), "
"custom_d2 CHAR(64), "
"custom_d3 CHAR(64) "
")",
NULL, NULL, NULL);
}
if (code == SQLITE_OK) {
code = sqlite3_exec(_databaseConnection,
"INSERT INTO localytics_info (schema_version, last_upload_number, last_session_number, opt_out) "
"VALUES (3, 0, 0, 0)", NULL, NULL, NULL);
}
// Commit transaction.
if (code == SQLITE_OK || code == SQLITE_DONE) {
sqlite3_exec(_databaseConnection, "COMMIT", NULL, NULL, NULL);
} else {
sqlite3_exec(_databaseConnection, "ROLLBACK", NULL, NULL, NULL);
}
}
// V2 adds a unique identifier for each installation
// This identifier has been moved to user preferences so the database an live in the caches directory
// Also adds storage for custom dimensions
- (void)upgradeToSchemaV2 {
int code = SQLITE_OK;
code = sqlite3_exec(_databaseConnection, "BEGIN", NULL, NULL, NULL);
if (code == SQLITE_OK) {
code = sqlite3_exec(_databaseConnection,
"ALTER TABLE localytics_info ADD install_id CHAR(40)",
NULL, NULL, NULL);
}
if (code == SQLITE_OK) {
code = sqlite3_exec(_databaseConnection,
"ALTER TABLE localytics_info ADD custom_d0 CHAR(64)",
NULL, NULL, NULL);
}
if (code == SQLITE_OK) {
code = sqlite3_exec(_databaseConnection,
"ALTER TABLE localytics_info ADD custom_d1 CHAR(64)",
NULL, NULL, NULL);
}
if (code == SQLITE_OK) {
code = sqlite3_exec(_databaseConnection,
"ALTER TABLE localytics_info ADD custom_d2 CHAR(64)",
NULL, NULL, NULL);
}
if (code == SQLITE_OK) {
sqlite3_exec(_databaseConnection,
"ALTER TABLE localytics_info ADD custom_d3 CHAR(64)",
NULL, NULL, NULL);
}
// Attempt to set schema version and install_id regardless of the result code following the ALTER statements above.
// This is necessary because a previous version of the library performed the migration without setting these values.
// The transaction will succeed even if the individual statements fail with errors (eg. "duplicate column name").
sqlite3_stmt *updateLocalyticsInfo;
sqlite3_prepare_v2(_databaseConnection, "UPDATE localytics_info set install_id = ?, schema_version = 2 ", -1, &updateLocalyticsInfo, NULL);
sqlite3_bind_text (updateLocalyticsInfo, 1, [[self randomUUID] UTF8String], -1, SQLITE_TRANSIENT);
code = sqlite3_step(updateLocalyticsInfo);
sqlite3_finalize(updateLocalyticsInfo);
// Commit transaction.
if (code == SQLITE_OK || code == SQLITE_DONE) {
sqlite3_exec(_databaseConnection, "COMMIT", NULL, NULL, NULL);
} else {
sqlite3_exec(_databaseConnection, "ROLLBACK", NULL, NULL, NULL);
}
}
// V3 adds a field for the last app key and patches a V2 migration issue.
- (void)upgradeToSchemaV3 {
sqlite3_exec(_databaseConnection,
"ALTER TABLE localytics_info ADD app_key CHAR(64)",
NULL, NULL, NULL);
}
- (NSUInteger)databaseSize {
NSUInteger size = 0;
NSDictionary *fileAttributes = [[NSFileManager defaultManager]
attributesOfItemAtPath:[LocalyticsDatabase localyticsDatabasePath]
error:nil];
size = [fileAttributes fileSize];
return size;
}
- (int) eventCount {
int count = 0;
const char *sql = "SELECT count(*) FROM events";
sqlite3_stmt *selectEventCount;
if(sqlite3_prepare_v2(_databaseConnection, sql, -1, &selectEventCount, NULL) == SQLITE_OK)
{
if(sqlite3_step(selectEventCount) == SQLITE_ROW) {
count = sqlite3_column_int(selectEventCount, 0);
}
}
sqlite3_finalize(selectEventCount);
return count;
}
- (NSTimeInterval)createdTimestamp {
NSTimeInterval timestamp = 0;
NSDictionary *fileAttributes = [[NSFileManager defaultManager]
attributesOfItemAtPath:[LocalyticsDatabase localyticsDatabasePath]
error:nil];
timestamp = [[fileAttributes fileCreationDate] timeIntervalSince1970];
return timestamp;
}
- (NSTimeInterval)lastSessionStartTimestamp {
NSTimeInterval lastSessionStart = 0;
sqlite3_stmt *selectLastSessionStart;
sqlite3_prepare_v2(_databaseConnection, "SELECT last_session_start FROM localytics_info", -1, &selectLastSessionStart, NULL);
int code = sqlite3_step(selectLastSessionStart);
if (code == SQLITE_ROW) {
lastSessionStart = sqlite3_column_double(selectLastSessionStart, 0) == 1;
}
sqlite3_finalize(selectLastSessionStart);
return lastSessionStart;
}
- (BOOL)setLastsessionStartTimestamp:(NSTimeInterval)timestamp {
sqlite3_stmt *updateLastSessionStart;
sqlite3_prepare_v2(_databaseConnection, "UPDATE localytics_info SET last_session_start = ?", -1, &updateLastSessionStart, NULL);
sqlite3_bind_double(updateLastSessionStart, 1, timestamp);
int code = sqlite3_step(updateLastSessionStart);
sqlite3_finalize(updateLastSessionStart);
return code == SQLITE_DONE;
}
- (BOOL)isOptedOut {
BOOL optedOut = NO;
sqlite3_stmt *selectOptOut;
sqlite3_prepare_v2(_databaseConnection, "SELECT opt_out FROM localytics_info", -1, &selectOptOut, NULL);
int code = sqlite3_step(selectOptOut);
if (code == SQLITE_ROW) {
optedOut = sqlite3_column_int(selectOptOut, 0) == 1;
}
sqlite3_finalize(selectOptOut);
return optedOut;
}
- (BOOL)setOptedOut:(BOOL)optOut {
sqlite3_stmt *updateOptedOut;
sqlite3_prepare_v2(_databaseConnection, "UPDATE localytics_info SET opt_out = ?", -1, &updateOptedOut, NULL);
sqlite3_bind_int(updateOptedOut, 1, optOut);
int code = sqlite3_step(updateOptedOut);
sqlite3_finalize(updateOptedOut);
return code == SQLITE_OK;
}
- (NSString *)customDimension:(int)dimension {
if(dimension < 0 || dimension > 3) {
return nil;
}
NSString *value = nil;
NSString *query = [NSString stringWithFormat:@"select custom_d%i from localytics_info", dimension];
sqlite3_stmt *selectCustomDim;
sqlite3_prepare_v2(_databaseConnection, [query UTF8String], -1, &selectCustomDim, NULL);
int code = sqlite3_step(selectCustomDim);
if (code == SQLITE_ROW && sqlite3_column_text(selectCustomDim, 0)) {
value = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectCustomDim, 0)];
}
sqlite3_finalize(selectCustomDim);
return value;
}
- (BOOL)setCustomDimension:(int)dimension value:(NSString *)value {
if(dimension < 0 || dimension > 3) {
return false;
}
NSString *query = [NSString stringWithFormat:@"update localytics_info SET custom_d%i = %@",
dimension,
(value == nil) ? @"null" : [NSString stringWithFormat:@"\"%@\"", value]];
int code = sqlite3_exec(_databaseConnection, [query UTF8String], NULL, NULL, NULL);
return code == SQLITE_OK;
}
- (BOOL)incrementLastUploadNumber:(int *)uploadNumber {
NSString *t = @"increment_upload_number";
int code = SQLITE_OK;
code = [self beginTransaction:t] ? SQLITE_OK : SQLITE_ERROR;
if(code == SQLITE_OK) {
// Increment value
code = sqlite3_exec(_databaseConnection,
"UPDATE localytics_info "
"SET last_upload_number = (last_upload_number + 1)",
NULL, NULL, NULL);
}
if(code == SQLITE_OK) {
// Retrieve new value
sqlite3_stmt *selectUploadNumber;
sqlite3_prepare_v2(_databaseConnection,
"SELECT last_upload_number FROM localytics_info",
-1, &selectUploadNumber, NULL);
code = sqlite3_step(selectUploadNumber);
if (code == SQLITE_ROW) {
*uploadNumber = sqlite3_column_int(selectUploadNumber, 0);
}
sqlite3_finalize(selectUploadNumber);
}
if(code == SQLITE_ROW) {
[self releaseTransaction:t];
} else {
[self rollbackTransaction:t];
}
return code == SQLITE_ROW;
}
- (BOOL)incrementLastSessionNumber:(int *)sessionNumber {
NSString *t = @"increment_session_number";
int code = [self beginTransaction:t] ? SQLITE_OK : SQLITE_ERROR;
if(code == SQLITE_OK) {
// Increment value
code = sqlite3_exec(_databaseConnection,
"UPDATE localytics_info "
"SET last_session_number = (last_session_number + 1)",
NULL, NULL, NULL);
}
if(code == SQLITE_OK) {
// Retrieve new value
sqlite3_stmt *selectSessionNumber;
sqlite3_prepare_v2(_databaseConnection,
"SELECT last_session_number FROM localytics_info",
-1, &selectSessionNumber, NULL);
code = sqlite3_step(selectSessionNumber);
if (code == SQLITE_ROW && sessionNumber != NULL) {
*sessionNumber = sqlite3_column_int(selectSessionNumber, 0);
}
sqlite3_finalize(selectSessionNumber);
}
if(code == SQLITE_ROW) {
[self releaseTransaction:t];
} else {
[self rollbackTransaction:t];
}
return code == SQLITE_ROW;
}
- (BOOL)addEventWithBlobString:(NSString *)blob {
int code = SQLITE_OK;
sqlite3_stmt *insertEvent;
sqlite3_prepare_v2(_databaseConnection, "INSERT INTO events (blob_string) VALUES (?)", -1, &insertEvent, NULL);
sqlite3_bind_text(insertEvent, 1, [blob UTF8String], -1, SQLITE_TRANSIENT);
code = sqlite3_step(insertEvent);
sqlite3_finalize(insertEvent);
return code == SQLITE_DONE;
}
- (BOOL)addCloseEventWithBlobString:(NSString *)blob {
NSString *t = @"add_close_event";
BOOL success = [self beginTransaction:t];
// Add close event.
if (success) {
success = [self addEventWithBlobString:blob];
}
// Record row id to localytics_info so that it can be removed if the session resumes.
if (success) {
sqlite3_stmt *updateCloseEvent;
sqlite3_prepare_v2(_databaseConnection, "UPDATE localytics_info SET last_close_event = (SELECT event_id FROM events WHERE rowid = ?)", -1, &updateCloseEvent, NULL);
sqlite3_int64 lastRow = sqlite3_last_insert_rowid(_databaseConnection);
sqlite3_bind_int64(updateCloseEvent, 1, lastRow);
int code = sqlite3_step(updateCloseEvent);
sqlite3_finalize(updateCloseEvent);
success = code == SQLITE_DONE;
}
if (success) {
[self releaseTransaction:t];
} else {
[self rollbackTransaction:t];
}
return success;
}
- (BOOL)addFlowEventWithBlobString:(NSString *)blob {
NSString *t = @"add_flow_event";
BOOL success = [self beginTransaction:t];
// Add flow event.
if (success) {
success = [self addEventWithBlobString:blob];
}
// Record row id to localytics_info so that it can be removed if the session resumes.
if (success) {
sqlite3_stmt *updateFlowEvent;
sqlite3_prepare_v2(_databaseConnection, "UPDATE localytics_info SET last_flow_event = (SELECT event_id FROM events WHERE rowid = ?)", -1, &updateFlowEvent, NULL);
sqlite3_int64 lastRow = sqlite3_last_insert_rowid(_databaseConnection);
sqlite3_bind_int64(updateFlowEvent, 1, lastRow);
int code = sqlite3_step(updateFlowEvent);
sqlite3_finalize(updateFlowEvent);
success = code == SQLITE_DONE;
}
if (success) {
[self releaseTransaction:t];
} else {
[self rollbackTransaction:t];
}
return success;
}
- (BOOL)removeLastCloseAndFlowEvents {
// Attempt to remove the last recorded close event.
// Fail quietly if none was saved or it was previously removed.
int code = sqlite3_exec(_databaseConnection, "DELETE FROM events WHERE event_id = (SELECT last_close_event FROM localytics_info) OR event_id = (SELECT last_flow_event FROM localytics_info)", NULL, NULL, NULL);
return code == SQLITE_OK;
}
- (BOOL)addHeaderWithSequenceNumber:(int)number blobString:(NSString *)blob rowId:(sqlite3_int64 *)insertedRowId {
sqlite3_stmt *insertHeader;
sqlite3_prepare_v2(_databaseConnection, "INSERT INTO upload_headers (sequence_number, blob_string) VALUES (?, ?)", -1, &insertHeader, NULL);
sqlite3_bind_int(insertHeader, 1, number);
sqlite3_bind_text(insertHeader, 2, [blob UTF8String], -1, SQLITE_TRANSIENT);
int code = sqlite3_step(insertHeader);
sqlite3_finalize(insertHeader);
if (code == SQLITE_DONE && insertedRowId != NULL) {
*insertedRowId = sqlite3_last_insert_rowid(_databaseConnection);
}
return code == SQLITE_DONE;
}
- (int)unstagedEventCount {
int rowCount = 0;
sqlite3_stmt *selectEventCount;
sqlite3_prepare_v2(_databaseConnection, "SELECT COUNT(*) FROM events WHERE UPLOAD_HEADER IS NULL", -1, &selectEventCount, NULL);
int code = sqlite3_step(selectEventCount);
if (code == SQLITE_ROW) {
rowCount = sqlite3_column_int(selectEventCount, 0);
}
sqlite3_finalize(selectEventCount);
return rowCount;
}
- (BOOL)stageEventsForUpload:(sqlite3_int64)headerId {
// Associate all outstanding events with the given upload header ID.
NSString *stageEvents = [NSString stringWithFormat:@"UPDATE events SET upload_header = ? WHERE upload_header IS NULL"];
sqlite3_stmt *updateEvents;
sqlite3_prepare_v2(_databaseConnection, [stageEvents UTF8String], -1, &updateEvents, NULL);
sqlite3_bind_int(updateEvents, 1, headerId);
int code = sqlite3_step(updateEvents);
sqlite3_finalize(updateEvents);
BOOL success = (code == SQLITE_DONE);
return success;
}
- (BOOL)updateAppKey:(NSString *)appKey {
sqlite3_stmt *updateAppKey;
sqlite3_prepare_v2(_databaseConnection, "UPDATE localytics_info set app_key = ?", -1, &updateAppKey, NULL);
sqlite3_bind_text (updateAppKey, 1, [appKey UTF8String], -1, SQLITE_TRANSIENT);
int code = sqlite3_step(updateAppKey);
sqlite3_finalize(updateAppKey);
BOOL success = (code == SQLITE_DONE);
return success;
}
- (NSString *)uploadBlobString {
// Retrieve the blob strings of each upload header and its child events, in order.
const char *sql = "SELECT * FROM ( "
" SELECT h.blob_string AS 'blob', h.sequence_number as 'seq', 0 FROM upload_headers h"
" UNION ALL "
" SELECT e.blob_string AS 'blob', e.upload_header as 'seq', 1 FROM events e"
") "
"ORDER BY 2, 3";
sqlite3_stmt *selectBlobs;
sqlite3_prepare_v2(_databaseConnection, sql, -1, &selectBlobs, NULL);
NSMutableString *uploadBlobString = [NSMutableString string];
while (sqlite3_step(selectBlobs) == SQLITE_ROW) {
const char *blob = (const char *)sqlite3_column_text(selectBlobs, 0);
if (blob != NULL) {
NSString *blobString = [[NSString alloc] initWithCString:blob encoding:NSUTF8StringEncoding];
[uploadBlobString appendString:blobString];
[blobString release];
}
}
sqlite3_finalize(selectBlobs);
return [[uploadBlobString copy] autorelease];
}
- (BOOL)deleteUploadedData {
// Delete all headers and staged events.
NSString *t = @"delete_upload_data";
int code = [self beginTransaction:t] ? SQLITE_OK : SQLITE_ERROR;
if (code == SQLITE_OK) {
code = sqlite3_exec(_databaseConnection, "DELETE FROM events WHERE upload_header IS NOT NULL", NULL, NULL, NULL);
}
if (code == SQLITE_OK) {
code = sqlite3_exec(_databaseConnection, "DELETE FROM upload_headers", NULL, NULL, NULL);
}
if (code == SQLITE_OK) {
[self releaseTransaction:t];
} else {
[self rollbackTransaction:t];
}
return code == SQLITE_OK;
}
- (BOOL)resetAnalyticsData {
// Delete or zero all analytics data.
// Reset: headers, events, session number, upload number, last session start, last close event, and last flow event.
// Unaffected: schema version, opt out status, install ID (deprecated), and app key.
NSString *t = @"reset_analytics_data";
int code = [self beginTransaction:t] ? SQLITE_OK : SQLITE_ERROR;
if (code == SQLITE_OK) {
code = sqlite3_exec(_databaseConnection, "DELETE FROM events", NULL, NULL, NULL);
}
if (code == SQLITE_OK) {
code = sqlite3_exec(_databaseConnection, "DELETE FROM upload_headers", NULL, NULL, NULL);
}
if (code == SQLITE_OK) {
code = sqlite3_exec(_databaseConnection,"UPDATE localytics_info SET last_session_number = 0, last_upload_number = 0,"
"last_close_event = null, last_flow_event = null, last_session_start = null, "
"custom_d0 = null, custom_d1 = null, custom_d2 = null, custom_d3 = null",
NULL, NULL, NULL);
}
if (code == SQLITE_OK) {
[self releaseTransaction:t];
} else {
[self rollbackTransaction:t];
}
return code == SQLITE_OK;
}
- (BOOL)vacuumIfRequired {
int code = SQLITE_OK;
if ([self databaseSize] > MAX_DATABASE_SIZE * VACUUM_THRESHOLD) {
code = sqlite3_exec(_databaseConnection, "VACUUM", NULL, NULL, NULL);
}
return code == SQLITE_OK;
}
- (NSString *)randomUUID {
CFUUIDRef theUUID = CFUUIDCreate(NULL);
CFStringRef stringUUID = CFUUIDCreateString(NULL, theUUID);
CFRelease(theUUID);
return [(NSString *)stringUUID autorelease];
}
#pragma mark - Lifecycle
+ (id)allocWithZone:(NSZone *)zone {
@synchronized(self) {
if (_sharedLocalyticsDatabase == nil) {
_sharedLocalyticsDatabase = [super allocWithZone:zone];
return _sharedLocalyticsDatabase;
}
}
// returns nil on subsequent allocations
return nil;
}
- (id)copyWithZone:(NSZone *)zone {
return self;
}
- (id)retain {
return self;
}
- (unsigned)retainCount {
// maximum value of an unsigned int - prevents additional retains for the class
return UINT_MAX;
}
- (oneway void)release {
// ignore release commands
}
- (id)autorelease {
return self;
}
- (void)dealloc {
sqlite3_close(_databaseConnection);
[super dealloc];
}
@end

View File

@@ -1,216 +0,0 @@
// LocalyticsSession.h
// Copyright (C) 2009 Char Software Inc., DBA Localytics
//
// This code is provided under the Localytics Modified BSD License.
// A copy of this license has been distributed in a file called LICENSE
// with this source code.
//
// Please visit www.localytics.com for more information.
#import <UIKit/UIKit.h>
// Set this to true to enable localytics traces (useful for debugging)
#define DO_LOCALYTICS_LOGGING false
/*!
@class LocalyticsSession
@discussion The class which manages creating, collecting, & uploading a Localytics session.
Please see the following guides for information on how to best use this
library, sample code, and other useful information:
<ul>
<li><a href="http://wiki.localytics.com/index.php?title=Developer's_Integration_Guide">Main Developer's Integration Guide</a></li>
</ul>
<strong>Best Practices</strong>
<ul>
<li>Instantiate the LocalyticsSession object in applicationDidFinishLaunching.</li>
<li>Open your session and begin your uploads in applicationDidFinishLaunching. This way the
upload has time to complete and it all happens before your users have a
chance to begin any data intensive actions of their own.</li>
<li>Close the session in applicationWillTerminate, and in applicationDidEnterBackground.</li>
<li>Resume the session in applicationWillEnterForeground.</li>
<li>Do not call any Localytics functions inside a loop. Instead, calls
such as <code>tagEvent</code> should follow user actions. This limits the
amount of data which is stored and uploaded.</li>
<li>Do not use multiple LocalticsSession objects to upload data with
multiple application keys. This can cause invalid state.</li>
</ul>
@author Localytics
*/
@interface LocalyticsSession : NSObject {
BOOL _hasInitialized; // Whether or not the session object has been initialized.
BOOL _isSessionOpen; // Whether or not this session has been opened.
float _backgroundSessionTimeout; // If an App stays in the background for more
// than this many seconds, start a new session
// when it returns to foreground.
@private
#pragma mark Member Variables
dispatch_queue_t _queue; // Queue of Localytics block objects.
dispatch_group_t _criticalGroup; // Group of blocks the must complete before backgrounding.
NSString *_sessionUUID; // Unique identifier for this session.
NSString *_applicationKey; // Unique identifier for the instrumented application
NSTimeInterval _lastSessionStartTimestamp; // The start time of the most recent session.
NSDate *_sessionResumeTime; // Time session was started or resumed.
NSDate *_sessionCloseTime; // Time session was closed.
NSMutableString *_unstagedFlowEvents; // Comma-delimited list of app screens and events tagged during this
// session that have NOT been staged for upload.
NSMutableString *_stagedFlowEvents; // App screens and events tagged during this session that HAVE been staged
// for upload.
NSMutableString *_screens; // Comma-delimited list of screens tagged during this session.
NSTimeInterval _sessionActiveDuration; // Duration that session open.
BOOL _sessionHasBeenOpen; // Whether or not this session has ever been open.
}
@property dispatch_queue_t queue;
@property dispatch_group_t criticalGroup;
@property BOOL isSessionOpen;
@property BOOL hasInitialized;
@property float backgroundSessionTimeout;
#pragma mark Public Methods
/*!
@method sharedLocalyticsSession
@abstract Accesses the Session object. This is a Singleton class which maintains
a single session throughout your application. It is possible to manage your own
session, but this is the easiest way to access the Localytics object throughout your code.
The class is accessed within the code using the following syntax:
[[LocalyticsSession sharedLocalyticsSession] functionHere]
So, to tag an event, all that is necessary, anywhere in the code is:
[[LocalyticsSession sharedLocalyticsSession] tagEvent:@"MY_EVENT"];
*/
+ (LocalyticsSession *)sharedLocalyticsSession;
/*!
@method LocalyticsSession
@abstract Initializes the Localytics Object. Not necessary if you choose to use startSession.
@param applicationKey The key unique for each application generated at www.localytics.com
*/
- (void)LocalyticsSession:(NSString *)appKey;
/*!
@method startSession
@abstract An optional convenience initialize method that also calls the LocalyticsSession, open &
upload methods. Best Practice is to call open & upload immediately after Localytics Session when loading an app,
this method fascilitates that behavior.
It is recommended that this call be placed in <code>applicationDidFinishLaunching</code>.
@param applicationKey The key unique for each application generated
at www.localytics.com
*/
- (void)startSession:(NSString *)appKey;
/*!
@method setOptIn
@abstract (OPTIONAL) Allows the application to control whether or not it will collect user data.
Even if this call is used, it is necessary to continue calling upload(). No new data will be
collected, so nothing new will be uploaded but it is necessary to upload an event telling the
server this user has opted out.
@param optedIn True if the user is opted in, false otherwise.
*/
- (void)setOptIn:(BOOL)optedIn;
/*!
@method isOptedIn
@abstract (OPTIONAL) Whether or not this user has is opted in or out. The only way they can be
opted out is if setOptIn(false) has been called before this. This function should only be
used to pre-populate a checkbox in an options menu. It is not recommended that an application
branch based on Localytics instrumentation because this creates an additional test case. If
the app is opted out, all subsequent Localytics calls will return immediately.
@result true if the user is opted in, false otherwise.
*/
- (BOOL)isOptedIn;
/*!
@method open
@abstract Opens the Localytics session. Not necessary if you choose to use startSession.
The session time as presented on the website is the time between <code>open</code> and the
final <code>close</code> so it is recommended to open the session as early as possible, and close
it at the last moment. The session must be opened before any tags can
be written. It is recommended that this call be placed in <code>applicationDidFinishLaunching</code>.
<br>
If for any reason this is called more than once every subsequent open call
will be ignored.
*/
- (void)open;
/*!
@method resume
@abstract Resumes the Localytics session. When the App enters the background, the session is
closed and the time of closing is recorded. When the app returns to the foreground, the session
is resumed. If the time since closing is greater than BACKGROUND_SESSION_TIMEOUT, (15 seconds
by default) a new session is created, and uploading is triggered. Otherwise, the previous session
is reopened.
*/
- (void)resume;
/*!
@method close
@abstract Closes the Localytics session. This should be called in
<code>applicationWillTerminate</code>.
<br>
If close is not called, the session will still be uploaded but no
events will be processed and the session time will not appear. This is
because the session is not yet closed so it should not be used in
comparison with sessions which are closed.
*/
- (void)close;
/*!
@method tagEvent
@abstract Allows a session to tag a particular event as having occurred. For
example, if a view has three buttons, it might make sense to tag
each button click with the name of the button which was clicked.
For another example, in a game with many levels it might be valuable
to create a new tag every time the user gets to a new level in order
to determine how far the average user is progressing in the game.
<br>
<strong>Tagging Best Practices</strong>
<ul>
<li>DO NOT use tags to record personally identifiable information.</li>
<li>The best way to use tags is to create all the tag strings as predefined
constants and only use those. This is more efficient and removes the risk of
collecting personal information.</li>
<li>Do not set tags inside loops or any other place which gets called
frequently. This can cause a lot of data to be stored and uploaded.</li>
</ul>
<br>
See the tagging guide at: http://wiki.localytics.com/
@param event The name of the event which occurred.
*/
- (void)tagEvent:(NSString *)event;
- (void)tagEvent:(NSString *)event attributes:(NSDictionary *)attributes;
- (void)tagEvent:(NSString *)event attributes:(NSDictionary *)attributes reportAttributes:(NSDictionary *)reportAttributes;
/*!
@method tagScreen
@abstract Allows tagging the flow of screens encountered during the session.
@param screen The name of the screen
*/
- (void)tagScreen:(NSString *)screen;
/*!
@method upload
@abstract Creates a low priority thread which uploads any Localytics data already stored
on the device. This should be done early in the process life in order to
guarantee as much time as possible for slow connections to complete. It is also reasonable
to upload again when the application is exiting because if the upload is cancelled the data
will just get uploaded the next time the app comes up.
*/
- (void)upload;
/*!
@method setCustomDimension
@abstract (ENTERPRISE ONLY) Sets the value of a custom dimension. Custom dimensions are dimensions
which contain user defined data unlike the predefined dimensions such as carrier, model, and country.
Once a value for a custom dimension is set, the device it was set on will continue to upload that value
until the value is changed. To clear a value pass nil as the value.
The proper use of custom dimensions involves defining a dimension with less than ten distinct possible
values and assigning it to one of the four available custom dimensions. Once assigned this definition should
never be changed without changing the App Key otherwise old installs of the application will pollute new data.
*/
- (void)setCustomDimension:(int)dimension value:(NSString *)value;
@end

File diff suppressed because it is too large Load Diff

View File

@@ -1,42 +0,0 @@
// LocalyticsUploader.h
// Copyright (C) 2009 Char Software Inc., DBA Localytics
//
// This code is provided under the Localytics Modified BSD License.
// A copy of this license has been distributed in a file called LICENSE
// with this source code.
//
// Please visit www.localytics.com for more information.
#import <UIKit/UIKit.h>
/*!
@class LocalyticsUploader
@discussion Singleton class to handle data uploads
*/
@interface LocalyticsUploader : NSObject {
}
@property (readonly) BOOL isUploading;
/*!
@method sharedLocalyticsUploader
@abstract Establishes this as a Singleton Class allowing for data persistence.
The class is accessed within the code using the following syntax:
[[LocalyticsUploader sharedLocalyticsUploader] functionHere]
*/
+ (LocalyticsUploader *)sharedLocalyticsUploader;
/*!
@method LocalyticsUploader
@abstract Creates a thread which uploads all queued header and event data.
All files starting with sessionFilePrefix are renamed,
uploaded and deleted on upload. This way the sessions can continue
writing data regardless of whether or not the upload succeeds. Files
which have been renamed still count towards the total number of Localytics
files which can be stored on the disk.
@param localyticsApplicationKey the Localytics application ID
*/
- (void)uploaderWithApplicationKey:(NSString *)localyticsApplicationKey;
@end

View File

@@ -1,236 +0,0 @@
// LocalyticsUploader.m
// Copyright (C) 2009 Char Software Inc., DBA Localytics
//
// This code is provided under the Localytics Modified BSD License.
// A copy of this license has been distributed in a file called LICENSE
// with this source code.
//
// Please visit www.localytics.com for more information.
#import "LocalyticsUploader.h"
#import "LocalyticsSession.h"
#import "LocalyticsDatabase.h"
#import <zlib.h>
#define LOCALYTICS_URL @"http://analytics.localytics.com/api/v2/applications/%@/uploads"
static LocalyticsUploader *_sharedUploader = nil;
@interface LocalyticsUploader ()
- (void)finishUpload;
- (NSData *)gzipDeflatedDataWithData:(NSData *)data;
- (void)logMessage:(NSString *)message;
@property (readwrite) BOOL isUploading;
@end
@implementation LocalyticsUploader
@synthesize isUploading = _isUploading;
#pragma mark - Singleton Class
+ (LocalyticsUploader *)sharedLocalyticsUploader {
@synchronized(self) {
if (_sharedUploader == nil) {
_sharedUploader = [[self alloc] init];
}
}
return _sharedUploader;
}
#pragma mark - Class Methods
- (void)uploaderWithApplicationKey:(NSString *)localyticsApplicationKey {
// Do nothing if already uploading.
if (self.isUploading == true)
{
[self logMessage:@"Upload already in progress. Aborting."];
return;
}
[self logMessage:@"Beginning upload process"];
self.isUploading = true;
// Prepare the data for upload. The upload could take a long time, so some effort has to be made to be sure that events
// which get written while the upload is taking place don't get lost or duplicated. To achieve this, the logic is:
// 1) Append every header row blob string and and those of its associated events to the upload string.
// 2) Deflate and upload the data.
// 3) On success, delete all blob headers and staged events. Events added while an upload is in process are not
// deleted because they are not associated a header (and cannot be until the upload completes).
// Step 1
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
LocalyticsDatabase *db = [LocalyticsDatabase sharedLocalyticsDatabase];
NSString *blobString = [db uploadBlobString];
if ([blobString length] == 0) {
// There is nothing outstanding to upload.
[self logMessage:@"Abandoning upload. There are no new events."];
[pool drain];
[self finishUpload];
return;
}
NSData *requestData = [blobString dataUsingEncoding:NSUTF8StringEncoding];
NSString *myString = [[[NSString alloc] initWithData:requestData encoding:NSUTF8StringEncoding] autorelease];
[self logMessage:[NSString stringWithFormat:@"Uploading data (length: %u)", [myString length]]];
// Step 2
NSData *deflatedRequestData = [[self gzipDeflatedDataWithData:requestData] retain];
[pool drain];
NSString *apiUrlString = [NSString stringWithFormat:LOCALYTICS_URL, [localyticsApplicationKey stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *submitRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:apiUrlString]
cachePolicy:NSURLRequestReloadIgnoringCacheData
timeoutInterval:60.0];
[submitRequest setHTTPMethod:@"POST"];
[submitRequest setValue:@"application/x-gzip" forHTTPHeaderField:@"Content-Type"];
[submitRequest setValue:@"gzip" forHTTPHeaderField:@"Content-Encoding"];
[submitRequest setValue:[NSString stringWithFormat:@"%d", [deflatedRequestData length]] forHTTPHeaderField:@"Content-Length"];
[submitRequest setHTTPBody:deflatedRequestData];
[deflatedRequestData release];
// Perform synchronous upload in an async dispatch. This is necessary because the calling block will not persist to
// receive the response data.
dispatch_group_async([[LocalyticsSession sharedLocalyticsSession] criticalGroup], [[LocalyticsSession sharedLocalyticsSession] queue], ^{
@try {
NSURLResponse *response = nil;
NSError *responseError = nil;
[NSURLConnection sendSynchronousRequest:submitRequest returningResponse:&response error:&responseError];
NSInteger responseStatusCode = [(NSHTTPURLResponse *)response statusCode];
if (responseError) {
// On error, simply print the error and close the uploader. We have to assume the data was not transmited
// so it is not deleted. In the event that we accidently store data which was succesfully uploaded, the
// duplicate data will be ignored by the server when it is next uploaded.
[self logMessage:[NSString stringWithFormat:
@"Error Uploading. Code: %d, Description: %@",
[responseError code],
[responseError localizedDescription]]];
} else {
// Step 3
// While response status codes in the 5xx range leave upload rows intact, the default case is to delete.
if (responseStatusCode >= 500 && responseStatusCode < 600) {
[self logMessage:[NSString stringWithFormat:@"Upload failed with response status code %d", responseStatusCode]];
} else {
// Because only one instance of the uploader can be running at a time it should not be possible for
// new upload rows to appear so there is no fear of deleting data which has not yet been uploaded.
[self logMessage:[NSString stringWithFormat:@"Upload completed successfully. Response code %d", responseStatusCode]];
[[LocalyticsDatabase sharedLocalyticsDatabase] deleteUploadedData];
}
}
}
@catch (NSException * e) {}
[self finishUpload];
});
}
- (void)finishUpload
{
self.isUploading = false;
// Upload data has been deleted. Recover the disk space if necessary.
[[LocalyticsDatabase sharedLocalyticsDatabase] vacuumIfRequired];
}
/*!
@method gzipDeflatedDataWithData
@abstract Deflates the provided data using gzip at the default compression level (6). Complete NSData gzip category available on CocoaDev. http://www.cocoadev.com/index.pl?NSDataCategory.
@return the deflated data
*/
- (NSData *)gzipDeflatedDataWithData:(NSData *)data
{
if ([data length] == 0) return data;
z_stream strm;
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;
strm.opaque = Z_NULL;
strm.total_out = 0;
strm.next_in=(Bytef *)[data bytes];
strm.avail_in = [data length];
// Compresssion Levels:
// Z_NO_COMPRESSION
// Z_BEST_SPEED
// Z_BEST_COMPRESSION
// Z_DEFAULT_COMPRESSION
if (deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, (15+16), 8, Z_DEFAULT_STRATEGY) != Z_OK) return nil;
NSMutableData *compressed = [NSMutableData dataWithLength:16384]; // 16K chunks for expansion
do {
if (strm.total_out >= [compressed length])
[compressed increaseLengthBy: 16384];
strm.next_out = [compressed mutableBytes] + strm.total_out;
strm.avail_out = [compressed length] - strm.total_out;
deflate(&strm, Z_FINISH);
} while (strm.avail_out == 0);
deflateEnd(&strm);
[compressed setLength: strm.total_out];
return [NSData dataWithData:compressed];
}
/*!
@method logMessage
@abstract Logs a message with (localytics uploader) prepended to it
@param message The message to log
*/
- (void) logMessage:(NSString *)message {
if(DO_LOCALYTICS_LOGGING) {
NSLog(@"(localytics uploader) %s\n", [message UTF8String]);
}
}
#pragma mark - System Functions
+ (id)allocWithZone:(NSZone *)zone {
@synchronized(self) {
if (_sharedUploader == nil) {
_sharedUploader = [super allocWithZone:zone];
return _sharedUploader;
}
}
// returns nil on subsequent allocations
return nil;
}
- (id)copyWithZone:(NSZone *)zone {
return self;
}
- (id)retain {
return self;
}
- (unsigned)retainCount {
// maximum value of an unsigned int - prevents additional retains for the class
return UINT_MAX;
}
- (oneway void)release {
// ignore release commands
}
- (id)autorelease {
return self;
}
- (void)dealloc {
[_sharedUploader release];
[super dealloc];
}
@end

View File

@@ -1,48 +0,0 @@
// UploaderThread.h
// Copyright (C) 2009 Char Software Inc., DBA Localytics
//
// This code is provided under the Localytics Modified BSD License.
// A copy of this license has been distributed in a file called LICENSE
// with this source code.
//
// Please visit www.localytics.com for more information.
#import <UIKit/UIKit.h>
/*!
@class UploaderThread
@discussion Singleton class to handle data uploads
*/
@interface UploaderThread : NSObject {
NSURLConnection *_uploadConnection; // The connection which uploads the bits
NSInteger _responseStatusCode; // The HTTP response status code for the current connection
BOOL _isUploading; // A flag to gaurantee only one uploader instance can happen at once
}
@property (nonatomic, retain) NSURLConnection *uploadConnection;
@property BOOL isUploading;
/*!
@method sharedUploaderThread
@abstract Establishes this as a Singleton Class allowing for data persistence.
The class is accessed within the code using the following syntax:
[[UploaderThread sharedUploaderThread] functionHere]
*/
+ (UploaderThread *)sharedUploaderThread;
/*!
@method UploaderThread
@abstract Creates a thread which uploads all queued header and event data.
All files starting with sessionFilePrefix are renamed,
uploaded and deleted on upload. This way the sessions can continue
writing data regardless of whether or not the upload succeeds. Files
which have been renamed still count towards the total number of Localytics
files which can be stored on the disk.
@param localyticsApplicationKey the Localytics application ID
*/
- (void)uploaderThreadwithApplicationKey:(NSString *)localyticsApplicationKey;
@end

View File

@@ -1,260 +0,0 @@
// UploaderThread.m
// Copyright (C) 2009 Char Software Inc., DBA Localytics
//
// This code is provided under the Localytics Modified BSD License.
// A copy of this license has been distributed in a file called LICENSE
// with this source code.
//
// Please visit www.localytics.com for more information.
#import "UploaderThread.h"
#import "LocalyticsSession.h"
#import "LocalyticsDatabase.h"
#import <zlib.h>
#define LOCALYTICS_URL @"http://analytics.localytics.com/api/v2/applications/%@/uploads" // url to send the
static UploaderThread *_sharedUploaderThread = nil;
@interface UploaderThread ()
- (void)complete;
- (NSData *)gzipDeflatedDataWithData:(NSData *)data;
- (void)logMessage:(NSString *)message;
@end
@implementation UploaderThread
@synthesize uploadConnection = _uploadConnection;
@synthesize isUploading = _isUploading;
#pragma mark Singleton Class
+ (UploaderThread *)sharedUploaderThread {
@synchronized(self) {
if (_sharedUploaderThread == nil)
{
_sharedUploaderThread = [[self alloc] init];
}
}
return _sharedUploaderThread;
}
#pragma mark Class Methods
- (void)uploaderThreadwithApplicationKey:(NSString *)localyticsApplicationKey {
// Do nothing if already uploading.
if (self.uploadConnection != nil || self.isUploading == true)
{
[self logMessage:@"Upload already in progress. Aborting."];
return;
}
[self logMessage:@"Beginning upload process"];
self.isUploading = true;
// Prepare the data for upload. The upload could take a long time, so some effort has to be made to be sure that events
// which get written while the upload is taking place don't get lost or duplicated. To achieve this, the logic is:
// 1) Append every header row blob string and and those of its associated events to the upload string.
// 2) Deflate and upload the data.
// 3) On success, delete all blob headers and staged events. Events added while an upload is in process are not
// deleted because they are not associated a header (and cannot be until the upload completes).
// Step 1
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
LocalyticsDatabase *db = [LocalyticsDatabase sharedLocalyticsDatabase];
NSString *blobString = [db uploadBlobString];
if ([blobString length] == 0) {
// There is nothing outstanding to upload.
[self logMessage:@"Abandoning upload. There are no new events."];
[pool drain];
[self complete];
return;
}
NSData *requestData = [blobString dataUsingEncoding:NSUTF8StringEncoding];
NSString *myString = [[[NSString alloc] initWithData:requestData encoding:NSUTF8StringEncoding] autorelease];
[self logMessage:@"Upload data:"];
[self logMessage:myString];
// Step 2
NSData *deflatedRequestData = [[self gzipDeflatedDataWithData:requestData] retain];
[pool drain];
NSString *apiUrlString = [NSString stringWithFormat:LOCALYTICS_URL, [localyticsApplicationKey stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *submitRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:apiUrlString]
cachePolicy:NSURLRequestReloadIgnoringCacheData
timeoutInterval:60.0];
[submitRequest setHTTPMethod:@"POST"];
[submitRequest setValue:@"application/x-gzip" forHTTPHeaderField:@"Content-Type"];
[submitRequest setValue:@"gzip" forHTTPHeaderField:@"Content-Encoding"];
[submitRequest setValue:[NSString stringWithFormat:@"%d", [deflatedRequestData length]] forHTTPHeaderField:@"Content-Length"];
[submitRequest setHTTPBody:deflatedRequestData];
[deflatedRequestData release];
// The NSURLConnection Object automatically spawns its own thread as a default behavior.
@try
{
[self logMessage:@"Spawning new thread for upload"];
self.uploadConnection = [NSURLConnection connectionWithRequest:submitRequest delegate:self];
// Step 3 is handled by connectionDidFinishLoading.
}
@catch (NSException * e)
{
[self complete];
}
}
#pragma mark **** NSURLConnection FUNCTIONS ****
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
// Used to gather response data from server - Not utilized in this version
}
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
// Could receive multiple response callbacks, likely due to redirection.
// Record status and act only when connection completes load.
_responseStatusCode = [(NSHTTPURLResponse *)response statusCode];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
// If the connection finished loading, the files should be deleted. While response status codes in the 5xx range
// leave upload rows intact, the default case is to delete.
if (_responseStatusCode >= 500 && _responseStatusCode < 600)
{
[self logMessage:[NSString stringWithFormat:@"Upload failed with response status code %d", _responseStatusCode]];
} else
{
// The connection finished loading and uploaded data should be deleted. Because only one instance of the
// uploader can be running at a time it should not be possible for new upload rows to appear so there is no
// fear of deleting data which has not yet been uploaded.
[self logMessage:[NSString stringWithFormat:@"Upload completed successfully. Response code %d", _responseStatusCode]];
[[LocalyticsDatabase sharedLocalyticsDatabase] deleteUploadData];
}
// Close upload session
[self complete];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
// On error, simply print the error and close the uploader. We have to assume the data was not transmited
// so it is not deleted. In the event that we accidently store data which was succesfully uploaded, the
// duplicate data will be ignored by the server when it is next uploaded.
[self logMessage:[NSString stringWithFormat:
@"Error Uploading. Code: %d, Description: %s",
[error code],
[error localizedDescription]]];
[self complete];
}
/*!
@method complete
@abstract closes the upload connection and reports back to the session that the upload is complete
*/
- (void)complete {
_responseStatusCode = 0;
self.uploadConnection = nil;
self.isUploading = false;
}
/*!
@method gzipDeflatedDataWithData
@abstract Deflates the provided data using gzip at the default compression level (6). Complete NSData gzip category available on CocoaDev. http://www.cocoadev.com/index.pl?NSDataCategory.
@return the deflated data
*/
- (NSData *)gzipDeflatedDataWithData:(NSData *)data
{
if ([data length] == 0) return data;
z_stream strm;
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;
strm.opaque = Z_NULL;
strm.total_out = 0;
strm.next_in=(Bytef *)[data bytes];
strm.avail_in = [data length];
// Compresssion Levels:
// Z_NO_COMPRESSION
// Z_BEST_SPEED
// Z_BEST_COMPRESSION
// Z_DEFAULT_COMPRESSION
if (deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, (15+16), 8, Z_DEFAULT_STRATEGY) != Z_OK) return nil;
NSMutableData *compressed = [NSMutableData dataWithLength:16384]; // 16K chunks for expansion
do {
if (strm.total_out >= [compressed length])
[compressed increaseLengthBy: 16384];
strm.next_out = [compressed mutableBytes] + strm.total_out;
strm.avail_out = [compressed length] - strm.total_out;
deflate(&strm, Z_FINISH);
} while (strm.avail_out == 0);
deflateEnd(&strm);
[compressed setLength: strm.total_out];
return [NSData dataWithData:compressed];
}
/*!
@method logMessage
@abstract Logs a message with (localytics uploader) prepended to it
@param message The message to log
*/
- (void) logMessage:(NSString *)message {
if(DO_LOCALYTICS_LOGGING) {
NSLog(@"(localytics uploader) %s\n", [message UTF8String]);
}
}
#pragma mark System Functions
+ (id)allocWithZone:(NSZone *)zone {
@synchronized(self) {
if (_sharedUploaderThread == nil) {
_sharedUploaderThread = [super allocWithZone:zone];
return _sharedUploaderThread;
}
}
// returns nil on subsequent allocations
return nil;
}
- (id)copyWithZone:(NSZone *)zone {
return self;
}
- (id)retain {
return self;
}
- (unsigned)retainCount {
// maximum value of an unsigned int - prevents additional retains for the class
return UINT_MAX;
}
- (oneway void)release {
// ignore release commands
}
- (id)autorelease {
return self;
}
- (void)dealloc {
[_uploadConnection release];
[_sharedUploaderThread release];
[super dealloc];
}
@end

View File

@@ -1,111 +0,0 @@
// WebserviceConstants.h
// Copyright (C) 2009 Char Software Inc., DBA Localytics
//
// This code is provided under the Localytics Modified BSD License.
// A copy of this license has been distributed in a file called LICENSE
// with this source code.
//
// Please visit www.localytics.com for more information.
// The constants which are used to make up the JSON blob
// To save disk space and network bandwidth all the keywords have been
// abbreviated and are exploded by the server.
/*********************
* Shared Attributes *
*********************/
#define PARAM_UUID @"u" // UUID for JSON document
#define PARAM_DATA_TYPE @"dt" // Data Type
#define PARAM_CLIENT_TIME @"ct" // Client Time, seconds from Unix epoch (int)
#define PARAM_LATITUDE @"lat" // Latitude - if available
#define PARAM_LONGITUDE @"lon" // Longitude - if available
#define PARAM_SESSION_UUID @"su" // UUID for an existing session
#define PARAM_NEW_SESSION_UUID @"u" // UUID for a new session
#define PARAM_ATTRIBUTES @"attrs" // Attributes (dictionary)
/***************
* Blob Header *
***************/
// PARAM_UUID
// PARAM_DATA_TYPE => "h" for Header
// PARAM_ATTRIBUTES => dictionary containing Header Common Attributes
#define PARAM_PERSISTED_AT @"pa" // Persistent Storage Created At. A timestamp created when the app was
// first launched and the persistent storage was created. Stores as
// seconds from Unix epoch. (int)
#define PARAM_SEQUENCE_NUMBER @"seq" // Sequence number - an increasing count for each blob, stored in the
// persistent store Consistent across app starts. (int)
/****************************
* Header Common Attributes *
****************************/
// PARAM_DATA_TYPE
#define PARAM_APP_KEY @"au" // Localytics Application ID
#define PARAM_DEVICE_UUID @"du" // Device UUID
#define PARAM_DEVICE_UUID_HASHED @"udid" // Hashed version of the UUID
#define PARAM_DEVICE_MAC @"wmac" // Hashed version of the device Mac
#define PARAM_INSTALL_ID @"iu" // Install ID
#define PARAM_JAILBROKEN @"j" // Jailbroken (boolean)
#define PARAM_LIBRARY_VERSION @"lv" // Client Version
#define PARAM_APP_VERSION @"av" // Application Version
#define PARAM_DEVICE_PLATFORM @"dp" // Device Platform
#define PARAM_LOCALE_LANGUAGE @"dll" // Locale Language
#define PARAM_LOCALE_COUNTRY @"dlc" // Locale Country
#define PARAM_NETWORK_COUNTRY @"nc" // Network Country (iso code) // ???: Never used on iPhone.
#define PARAM_DEVICE_COUNTRY @"dc" // Device Country (iso code)
#define PARAM_DEVICE_MANUFACTURER @"dma" // Device Manufacturer // ???: Never used on iPhone. Used to be "Device Make".
#define PARAM_DEVICE_MODEL @"dmo" // Device Model
#define PARAM_DEVICE_OS_VERSION @"dov" // Device OS Version
#define PARAM_NETWORK_CARRIER @"nca" // Network Carrier
#define PARAM_DATA_CONNECTION @"dac" // Data Connection Type // ???: Never used on iPhone.
#define PARAM_OPT_VALUE @"optin" // Opt In (boolean)
#define PARAM_DEVICE_MEMORY @"dmem" // Device Memory
/*****************
* Session Start *
*****************/
// PARAM_UUID
// PARAM_DATA_TYPE => "s" for Start
// PARAM_CLIENT_TIME
#define PARAM_SESSION_NUMBER @"nth" // This is the nth session on the device, 1-indexed (int)
/****************
* Session Stop *
****************/
// PARAM_UUID
// PARAM_DATA_TYPE => "c" for Close
// PARAM_CLIENT_TIME
// PARAM_LATITUDE
// PARAM_LONGITUDE
// PARAM_SESSION_UUID => UUID of session being closed
#define PARAM_SESSION_ACTIVE @"cta" // Active time in seconds (time app was active)
#define PARAM_SESSION_TOTAL @"ctl" // Total session length
#define PARAM_SESSION_SCREENFLOW @"fl" // Screens encountered during this session, in order
/*********************
* Application Event *
*********************/
// PARAM_UUID
// PARAM_DATA_TYPE => "e" for Event
// PARAM_CLIENT_TIME
// PARAM_LATITUDE
// PARAM_LONGITUDE
// PARAM_SESSION_UUID => UUID of session event occured in
// PARAM_ATTRIBUTES => dictionary containing attributes for this event as key-value string pairs
#define PARAM_EVENT_NAME @"n" // Event Name, (eg. 'Button Click')
#define PARAM_REPORT_ATTRIBUTES @"rattrs" // Attributes used in custom reports
/********************
* Application flow *
********************/
// PARAM_UUID
// PARAM_DATA_TYPE => "f" for Flow
// PARAM_CLIENT_TIME
#define PARAM_SESSION_START @"ss" // Start time for the current session.
#define PARAM_NEW_FLOW_EVENTS @"nw" // Events and screens encountered during this session that have NOT been staged for upload.
#define PARAM_OLD_FLOW_EVENTS @"od" // Events and screens encountered during this session that HAVE been staged for upload.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj">
</FileRef>
<FileRef
location = "group:MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,125 @@
<?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>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>1DC75A27-0030-4493-ACE8-E1D49AB9A549</string>
<key>IDESourceControlProjectName</key>
<string>MasterPassword</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>1AA8C0BE-EEC3-4FBC-A801-8939A1AC093A</key>
<string>git://github.com/Lyndir/love-lyndir.client.git</string>
<key>42C94803-87A2-403E-896C-D9AC3A807E1B</key>
<string>git://github.com/lhunath/UbiquityStoreManager.git</string>
<key>6A449EC2-A2A3-4635-9C5F-A811E011EAC3</key>
<string>ssh://github.com/Lyndir/MasterPassword.git</string>
<key>ADA0D7F9-4871-4128-8FEE-FD1021EEF3AC</key>
<string>ssh://github.com/Lyndir/Pearl.git</string>
<key>AE3786C7-912B-4651-A73F-2E1DACBFB604</key>
<string>git://github.com/lhunath/uicolor-utilities.git</string>
<key>B0F634DD-AEE1-4F0D-AE35-4FAF51AD1B5A</key>
<string>git://github.com/lhunath/RHStatusItemView.git</string>
<key>CDDE92CF-0136-4DE0-8318-80EDB5C8CAF9</key>
<string>git://github.com/lhunath/InAppSettingsKit.git</string>
<key>E4C8E206-229C-4DA8-A130-0C544DEC7E07</key>
<string>git://github.com/jonmarimba/jrswizzle.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>MasterPassword.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>1AA8C0BE-EEC3-4FBC-A801-8939A1AC093A</key>
<string>../External/LoveLyndir</string>
<key>42C94803-87A2-403E-896C-D9AC3A807E1B</key>
<string>../External/UbiquityStoreManager</string>
<key>6A449EC2-A2A3-4635-9C5F-A811E011EAC3</key>
<string>..</string>
<key>ADA0D7F9-4871-4128-8FEE-FD1021EEF3AC</key>
<string>../External/Pearl</string>
<key>AE3786C7-912B-4651-A73F-2E1DACBFB604</key>
<string>../External/Pearl/External/uicolor-utilities</string>
<key>B0F634DD-AEE1-4F0D-AE35-4FAF51AD1B5A</key>
<string>../External/RHStatusItemView</string>
<key>CDDE92CF-0136-4DE0-8318-80EDB5C8CAF9</key>
<string>../External/InAppSettingsKit</string>
<key>E4C8E206-229C-4DA8-A130-0C544DEC7E07</key>
<string>../External/Pearl/External/jrswizzle</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>ssh://github.com/Lyndir/MasterPassword.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>6A449EC2-A2A3-4635-9C5F-A811E011EAC3</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>CDDE92CF-0136-4DE0-8318-80EDB5C8CAF9</string>
<key>IDESourceControlWCCName</key>
<string>InAppSettingsKit</string>
</dict>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>E4C8E206-229C-4DA8-A130-0C544DEC7E07</string>
<key>IDESourceControlWCCName</key>
<string>jrswizzle</string>
</dict>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>1AA8C0BE-EEC3-4FBC-A801-8939A1AC093A</string>
<key>IDESourceControlWCCName</key>
<string>LoveLyndir</string>
</dict>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>6A449EC2-A2A3-4635-9C5F-A811E011EAC3</string>
<key>IDESourceControlWCCName</key>
<string>MasterPassword</string>
</dict>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>ADA0D7F9-4871-4128-8FEE-FD1021EEF3AC</string>
<key>IDESourceControlWCCName</key>
<string>Pearl</string>
</dict>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>B0F634DD-AEE1-4F0D-AE35-4FAF51AD1B5A</string>
<key>IDESourceControlWCCName</key>
<string>RHStatusItemView</string>
</dict>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>42C94803-87A2-403E-896C-D9AC3A807E1B</string>
<key>IDESourceControlWCCName</key>
<string>UbiquityStoreManager</string>
</dict>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>AE3786C7-912B-4651-A73F-2E1DACBFB604</string>
<key>IDESourceControlWCCName</key>
<string>uicolor-utilities</string>
</dict>
</array>
</dict>
</plist>

2
MasterPassword/C/build Executable file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
gcc -I"lib/scrypt/lib" -I"lib/scrypt/libcperciva" -I"lib/proplib/include" -l "crypto_aesctr.o" -l "sha256.o" -l "crypto_scrypt-nosse.o" -l "memlimit.o" -l "scryptenc_cpuperf.o" -l"scryptenc.o" -l"crypto" -l"prop" -L"lib/scrypt" -L"lib/proplib/src/.libs" mpw.c -o mpw

View File

@@ -0,0 +1 @@
../Resources/Data/ciphers.plist

15
MasterPassword/C/install Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
BINDIR=${BINDIR:+${PREFIX:+$PREFIX/bin}}
[[ $BINDIR ]] && mkdir -p "$BINDIR"
if [[ ! -w $BINDIR ]]; then
for dir in /usr/local/bin ~/.bin ~/bin /usr/bin; do
[[ -w $dir ]] && BINDIR=$dir && break
done
if [[ ! -w $BINDIR ]]; then
echo >&2 "Could not find directory to install to."
echo >&2 "You can specify a prefix to install to, eg. PREFIX=/usr/local ./install"
echo >&2 "You can specify a bin directory to install to, eg. BINDIR=~/bin ./install"
echo >&2 "Make sure you have write permission to the bin directory."
fi
fi
install -v -s mpw "$BINDIR"

View File

@@ -0,0 +1 @@
https://code.google.com/p/portableproplib/

View File

@@ -0,0 +1,38 @@
diff -ruN /Users/lhunath/.src/scrypt/Makefile ./Makefile
--- /Users/lhunath/.src/scrypt/Makefile 2014-05-02 11:28:58.000000000 -0400
+++ ./Makefile 2014-05-02 12:07:27.000000000 -0400
@@ -2,11 +2,11 @@
VER?= nosse
SRCS= main.c
LDADD+= -lcrypto
-WARNS?= 6
+WARNS?= 0
# We have a config file for FreeBSD
CFLAGS += -I .
-CFLAGS += -DCONFIG_H_FILE=\"config_freebsd.h\"
+CFLAGS += -DCONFIG_H_FILE=\"config_osx.h\"
# Include all possible object files containing built scrypt code.
CLEANFILES += crypto_scrypt-ref.o
diff -ruN /Users/lhunath/.src/scrypt/lib/util/memlimit.c ./lib/util/memlimit.c
--- /Users/lhunath/.src/scrypt/lib/util/memlimit.c 2014-05-02 11:28:58.000000000 -0400
+++ ./lib/util/memlimit.c 2014-05-02 11:52:42.000000000 -0400
@@ -75,7 +75,7 @@
* have returned to us.
*/
if (usermemlen == sizeof(uint64_t))
- usermem = *(uint64_t *)usermembuf;
+ usermem = *(uint64_t *)(void *)usermembuf;
else if (usermemlen == sizeof(uint32_t))
usermem = SIZE_MAX;
else
diff -ruN /Users/lhunath/.src/scrypt/lib/util/memlimit.c ./lib/util/memlimit.c
--- /Users/lhunath/.src/scrypt/config_osx.h 1969-12-31 19:00:00.000000000 -0500
+++ config_osx.h 2014-05-02 12:06:55.000000000 -0400
@@ -0,0 +1,5 @@
+/* A default configuration for FreeBSD, used if there is no config.h. */
+
+#define HAVE_POSIX_MEMALIGN 1
+#define HAVE_SYSCTL_HW_USERMEM 1
+#define HAVE_SYS_PARAM_H 1

View File

@@ -0,0 +1 @@
https://code.google.com/p/scrypt/

218
MasterPassword/C/mpw.c Normal file
View File

@@ -0,0 +1,218 @@
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#if defined(__linux__)
#include <linux/fs.h>
#elif defined(__CYGWIN__)
#include <cygwin/fs.h>
#else
#include <sys/disk.h>
#endif
#include <fcntl.h>
#include <unistd.h>
#include <math.h>
#include <pwd.h>
#include <uuid/uuid.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <alg/sha256.h>
#include <crypto/crypto_scrypt.h>
#include <prop/proplib.h>
#define MP_N 32768
#define MP_r 8
#define MP_p 2
#define MP_dkLen 64
#define MP_hash PearlHashSHA256
#define MP_env_username "MP_USERNAME"
#define MP_env_sitetype "MP_SITETYPE"
#define MP_env_sitecounter "MP_SITECOUNTER"
char *homedir(const char *filename) {
char *homedir = NULL;
#if defined(__CYGWIN__)
homedir = getenv("USERPROFILE");
if (!homedir) {
const char *homeDrive = getenv("HOMEDRIVE");
const char *homePath = getenv("HOMEPATH");
homedir = char[strlen(homeDrive) + strlen(homePath) + 1];
sprintf(homedir, "%s/%s", homeDrive, homePath);
}
#else
struct passwd* passwd = getpwuid(getuid());
if (passwd)
homedir = passwd->pw_dir;
if (!homedir)
homedir = getenv("HOME");
#endif
if (!homedir)
homedir = getcwd(NULL, 0);
char *homefile = NULL;
asprintf(&homefile, "%s/%s", homedir, filename);
return homefile;
}
int main(int argc, char *const argv[]) {
// Read the environment.
const char *userName = getenv( MP_env_username );
const char *masterPassword = NULL;
const char *siteName = NULL;
const char *siteTypeString = getenv( MP_env_sitetype );
uint32_t siteCounter = 1;
const char *siteCounterString = getenv( MP_env_sitecounter );
// Read the options.
char opt;
while ((opt = getopt(argc, argv, "u:t:c:")) != -1)
switch (opt) {
case 'u':
userName = optarg;
break;
case 't':
siteTypeString = optarg;
break;
case 'c':
siteCounterString = optarg;
break;
case '?':
switch (optopt) {
case 'u':
fprintf (stderr, "Missing user name to option: -%c\n", optopt);
break;
case 't':
fprintf (stderr, "Missing type name to option: -%c\n", optopt);
break;
case 'c':
fprintf (stderr, "Missing counter value to option: -%c\n", optopt);
break;
default:
fprintf (stderr, "Unknown option: -%c\n", optopt);
}
return 1;
default:
abort();
}
if (optind < argc)
siteName = argv[optind];
// Convert and validate input.
if (!userName) {
fprintf (stderr, "Missing user name.\n");
return 1;
}
if (!siteName) {
fprintf (stderr, "Missing site name.\n");
return 1;
}
if (siteCounterString)
siteCounter = atoi( siteCounterString );
if (siteCounter < 1) {
fprintf (stderr, "Invalid site counter: %d\n", siteCounter);
return 1;
}
// Read the master password.
char *mpwConfigPath = homedir(".mpw");
if (!mpwConfigPath) {
fprintf (stderr, "Couldn't resolve path for configuration file: %d\n", errno);
return 1;
}
FILE *mpwConfig = fopen(mpwConfigPath, "r");
if (!mpwConfig) {
fprintf (stderr, "Couldn't open configuration file: %s: %d\n", mpwConfigPath, errno);
return 1;
}
free(mpwConfigPath);
char *line = NULL;
size_t linecap = 0;
ssize_t linelen;
while ((linelen = getline(&line, &linecap, mpwConfig)) > 0)
if (strcmp(strsep(&line, ":"), userName) == 0) {
masterPassword = line;
break;
}
if (!masterPassword) {
fprintf (stderr, "Missing master password for user: %s\n", userName);
return 1;
}
// Calculate the master key.
uint8_t *masterKey = malloc( MP_dkLen );
if (!masterKey) {
fprintf (stderr, "Could not allocate master key: %d\n", errno);
return 1;
}
const uint32_t n_userNameLength = htonl(strlen(userName));
char *masterKeySalt = NULL;
size_t masterKeySaltLength = asprintf(&masterKeySalt, "com.lyndir.masterpassword%s%s", (const char *) &n_userNameLength, userName);
if (!masterKeySalt) {
fprintf (stderr, "Could not allocate master key salt: %d\n", errno);
return 1;
}
if (crypto_scrypt( (const uint8_t *)masterPassword, strlen(masterPassword), (const uint8_t *)masterKeySalt, masterKeySaltLength, MP_N, MP_r, MP_p, masterKey, MP_dkLen ) < 0) {
fprintf (stderr, "Could not generate master key: %d\n", errno);
return 1;
}
memset(masterKeySalt, 0, masterKeySaltLength);
free(masterKeySalt);
// Calculate the site seed.
const uint32_t n_siteCounter = htonl(siteCounter), n_siteNameLength = htonl(strlen(siteName));
char *sitePasswordInfo = NULL;
size_t sitePasswordInfoLength = asprintf(&sitePasswordInfo, "com.lyndir.masterpassword%s%s%s", (const char *) &n_siteNameLength, siteName, (const char *) &n_siteCounter);
if (!sitePasswordInfo) {
fprintf (stderr, "Could not allocate site seed: %d\n", errno);
return 1;
}
uint8_t sitePasswordSeed[32];
HMAC_SHA256_Buf(masterKey, MP_dkLen, sitePasswordInfo, sitePasswordInfoLength, sitePasswordSeed);
memset(masterKey, 0, MP_dkLen);
memset(sitePasswordInfo, 0, sitePasswordInfoLength);
free(masterKey);
free(sitePasswordInfo);
// Determine the cipher.
prop_dictionary_t MPTypes_ciphers = prop_dictionary_internalize_from_file("ciphers.plist");
if (!MPTypes_ciphers) {
fprintf (stderr, "Could not read cipher definitions: %d\n", errno);
return 1;
}
prop_array_t typeCiphers = prop_dictionary_get(prop_dictionary_get(MPTypes_ciphers, "[self classNameOfType:type]"), "[self nameOfType:type]");
if (!typeCiphers) {
fprintf (stderr, "Could not find cipher definition for type: %s\n", siteTypeString);
return 1;
}
prop_string_t cipher = prop_array_get(typeCiphers, sitePasswordSeed[0] % prop_array_count(typeCiphers));
if (!typeCiphers) {
fprintf (stderr, "Missing cipher definitions for type: %s\n", siteTypeString);
return 1;
}
//trc(@"type %@, ciphers: %@, selected: %@", [self nameOfType:type], typeCiphers, cipher);
// Encode the password from the seed using the cipher.
//NSAssert([seed length] >= [cipher length] + 1, @"Insufficient seed bytes to encode cipher.");
const prop_dictionary_t characterClasses = prop_dictionary_get(MPTypes_ciphers, "MPCharacterClasses");
char *sitePassword = calloc(prop_string_size(cipher) + 1, sizeof(char));
char cipherClass[2] = {0, 0};
for (int c = 0; c < prop_string_size(cipher); ++c) {
const uint16_t keyByte = sitePasswordSeed[c + 1];
cipherClass[0] = prop_string_cstring_nocopy(cipher)[c];
const prop_string_t cipherClassCharacters = prop_dictionary_get(characterClasses, cipherClass);
const char character = prop_string_cstring_nocopy(cipherClassCharacters)[ keyByte % prop_string_size(cipherClassCharacters) ];
//trc(@"class %@ has characters: %@, index: %u, selected: %@", cipherClass, cipherClassCharacters, keyByte, character);
sitePassword[c] = character;
}
memset(sitePasswordSeed, 0, sizeof(sitePasswordSeed));
// Output the password.
fprintf( stdout, "%s\n", sitePassword );
return 0;
}

View File

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- PROJECT METADATA -->
<parent>
<groupId>com.lyndir.lhunath.masterpassword</groupId>
<artifactId>masterpassword</artifactId>
<version>GIT-SNAPSHOT</version>
</parent>
<name>Master Password Algorithm Implementation</name>
<description>The implementation of the Master Password algorithm</description>
<groupId>com.lyndir.lhunath.masterpassword</groupId>
<artifactId>masterpassword-algorithm</artifactId>
<packaging>jar</packaging>
<!-- DEPENDENCY MANAGEMENT -->
<dependencies>
<!-- PROJECT REFERENCES -->
<dependency>
<groupId>com.lyndir.lhunath.opal</groupId>
<artifactId>opal-system</artifactId>
<version>GIT-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.lyndir.lhunath.opal</groupId>
<artifactId>opal-crypto</artifactId>
<version>GIT-SNAPSHOT</version>
</dependency>
<!-- EXTERNAL DEPENDENCIES -->
<dependency>
<groupId>net.sf.plist</groupId>
<artifactId>property-list</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.lambdaworks</groupId>
<artifactId>scrypt</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,14 @@
package com.lyndir.lhunath.masterpassword;
/**
* <i>07 04, 2012</i>
*
* @author lhunath
*/
public enum MPElementFeature {
/** Export the key-protected content data. */
ExportContent,
/** Never export content. */
DevicePrivate,
}

View File

@@ -0,0 +1,79 @@
package com.lyndir.lhunath.masterpassword;
import com.google.common.collect.ImmutableSet;
import com.lyndir.lhunath.opal.system.logging.Logger;
import java.util.Set;
/**
* <i>07 04, 2012</i>
*
* @author lhunath
*/
public enum MPElementType {
GeneratedMaximum( "Maximum Security Password", "Maximum", "20 characters, contains symbols.", MPElementTypeClass.Generated ),
GeneratedLong( "Long Password", "Long", "Copy-friendly, 14 characters, contains symbols.", MPElementTypeClass.Generated ),
GeneratedMedium( "Medium Password", "Medium", "Copy-friendly, 8 characters, contains symbols.", MPElementTypeClass.Generated ),
GeneratedBasic( "Basic Password", "Basic", "8 characters, no symbols.", MPElementTypeClass.Generated ),
GeneratedShort( "Short Password", "Short", "Copy-friendly, 4 characters, no symbols.", MPElementTypeClass.Generated ),
GeneratedPIN( "PIN", "PIN", "4 numbers.", MPElementTypeClass.Generated ),
StoredPersonal( "Personal Password", "Personal", "AES-encrypted, exportable.", MPElementTypeClass.Stored, MPElementFeature.ExportContent ),
StoredDevicePrivate( "Device Private Password", "Private", "AES-encrypted, not exported.", MPElementTypeClass.Stored, MPElementFeature.DevicePrivate );
static final Logger logger = Logger.get( MPElementType.class );
private final MPElementTypeClass typeClass;
private final Set<MPElementFeature> typeFeatures;
private final String name;
private final String shortName;
private final String description;
MPElementType(final String name, final String shortName, final String description, final MPElementTypeClass typeClass, final MPElementFeature... typeFeatures) {
this.name = name;
this.shortName = shortName;
this.typeClass = typeClass;
this.description = description;
ImmutableSet.Builder<MPElementFeature> typeFeaturesBuilder = ImmutableSet.builder();
for (final MPElementFeature typeFeature : typeFeatures)
typeFeaturesBuilder.add( typeFeature );
this.typeFeatures = typeFeaturesBuilder.build();
}
public MPElementTypeClass getTypeClass() {
return typeClass;
}
public Set<MPElementFeature> getTypeFeatures() {
return typeFeatures;
}
public String getName() {
return name;
}
public String getShortName() {
return shortName;
}
public String getDescription() {
return description;
}
public static MPElementType forName(final String name) {
for (final MPElementType type : values())
if (type.getName().equals( name ))
return type;
throw logger.bug( "Element type not known: %s", name );
}
}

View File

@@ -0,0 +1,27 @@
package com.lyndir.lhunath.masterpassword;
import com.lyndir.lhunath.masterpassword.entity.*;
/**
* <i>07 04, 2012</i>
*
* @author lhunath
*/
public enum MPElementTypeClass {
Generated(MPElementGeneratedEntity.class),
Stored(MPElementStoredEntity.class);
private final Class<? extends MPElementEntity> entityClass;
MPElementTypeClass(final Class<? extends MPElementEntity> entityClass) {
this.entityClass = entityClass;
}
public Class<? extends MPElementEntity> getEntityClass() {
return entityClass;
}
}

View File

@@ -0,0 +1,41 @@
package com.lyndir.lhunath.masterpassword;
import com.google.common.collect.ImmutableList;
import com.lyndir.lhunath.opal.system.util.MetaObject;
import java.util.List;
import java.util.Map;
/**
* <i>07 04, 2012</i>
*
* @author lhunath
*/
public class MPTemplate extends MetaObject {
private final List<MPTemplateCharacterClass> template;
public MPTemplate(final String template, final Map<Character, MPTemplateCharacterClass> characterClasses) {
ImmutableList.Builder<MPTemplateCharacterClass> builder = ImmutableList.<MPTemplateCharacterClass>builder();
for (int i = 0; i < template.length(); ++i)
builder.add( characterClasses.get( template.charAt( i ) ) );
this.template = builder.build();
}
public MPTemplate(final List<MPTemplateCharacterClass> template) {
this.template = template;
}
public MPTemplateCharacterClass getCharacterClassAtIndex(final int index) {
return template.get( index );
}
public int length() {
return template.size();
}
}

View File

@@ -0,0 +1,33 @@
package com.lyndir.lhunath.masterpassword;
import com.lyndir.lhunath.opal.system.util.MetaObject;
import com.lyndir.lhunath.opal.system.util.ObjectMeta;
/**
* <i>07 04, 2012</i>
*
* @author lhunath
*/
public class MPTemplateCharacterClass extends MetaObject {
private final char identifier;
@ObjectMeta(useFor = { })
private final char[] characters;
public MPTemplateCharacterClass(final char identifier, final char[] characters) {
this.identifier = identifier;
this.characters = characters;
}
public char getIdentifier() {
return identifier;
}
public char getCharacterAtRollingIndex(final int index) {
return characters[index % characters.length];
}
}

View File

@@ -0,0 +1,109 @@
package com.lyndir.lhunath.masterpassword;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.Closeables;
import com.lyndir.lhunath.opal.system.logging.Logger;
import com.lyndir.lhunath.opal.system.util.MetaObject;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import net.sf.plist.*;
import net.sf.plist.io.PropertyListException;
import net.sf.plist.io.PropertyListParser;
/**
* <i>07 04, 2012</i>
*
* @author lhunath
*/
public class MPTemplates extends MetaObject {
static final Logger logger = Logger.get( MPTemplates.class );
private final Map<MPElementType, List<MPTemplate>> templates;
public MPTemplates(final Map<MPElementType, List<MPTemplate>> templates) {
this.templates = templates;
}
public static MPTemplates load() {
return loadFromPList( "ciphers.plist" );
}
public static MPTemplates loadFromPList(final String templateResource) {
@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
InputStream templateStream = Thread.currentThread().getContextClassLoader().getResourceAsStream( templateResource );
Preconditions.checkNotNull( templateStream, "Not found: %s", templateResource );
try {
NSObject plistObject = PropertyListParser.parse( templateStream );
Preconditions.checkState( NSDictionary.class.isAssignableFrom( plistObject.getClass() ) );
NSDictionary plist = (NSDictionary) plistObject;
NSDictionary characterClassesDict = (NSDictionary) plist.get( "MPCharacterClasses" );
NSDictionary templatesDict = (NSDictionary) plist.get( "MPElementGeneratedEntity" );
ImmutableMap.Builder<Character, MPTemplateCharacterClass> characterClassesBuilder = ImmutableMap.builder();
for (final Map.Entry<String, NSObject> characterClassEntry : characterClassesDict.entrySet()) {
String key = characterClassEntry.getKey();
NSObject value = characterClassEntry.getValue();
Preconditions.checkState( key.length() == 1 );
Preconditions.checkState( NSString.class.isAssignableFrom( value.getClass() ));
char character = key.charAt( 0 );
char[] characterClass = ((NSString)value).getValue().toCharArray();
characterClassesBuilder.put( character, new MPTemplateCharacterClass( character, characterClass ) );
}
ImmutableMap<Character, MPTemplateCharacterClass> characterClasses = characterClassesBuilder.build();
ImmutableMap.Builder<MPElementType, List<MPTemplate>> templatesBuilder = ImmutableMap.builder();
for (final Map.Entry<String, NSObject> template : templatesDict.entrySet()) {
String key = template.getKey();
NSObject value = template.getValue();
Preconditions.checkState( NSArray.class.isAssignableFrom( value.getClass() ) );
MPElementType type = MPElementType.forName( key );
List<NSObject> templateStrings = ((NSArray) value).getValue();
ImmutableList.Builder<MPTemplate> typeTemplatesBuilder = ImmutableList.<MPTemplate>builder();
for (final NSObject templateString : templateStrings)
typeTemplatesBuilder.add( new MPTemplate( ((NSString) templateString).getValue(), characterClasses ) );
templatesBuilder.put( type, typeTemplatesBuilder.build() );
}
ImmutableMap<MPElementType, List<MPTemplate>> templates = templatesBuilder.build();
return new MPTemplates( templates );
}
catch (PropertyListException e) {
logger.err( e, "Could not parse templates from: %s", templateResource );
throw Throwables.propagate( e );
}
catch (IOException e) {
logger.err( e, "Could not read templates from: %s", templateResource );
throw Throwables.propagate( e );
}
finally {
Closeables.closeQuietly( templateStream );
}
}
public MPTemplate getTemplateForTypeAtRollingIndex(final MPElementType type, final int templateIndex) {
List<MPTemplate> typeTemplates = templates.get( type );
return typeTemplates.get( templateIndex % typeTemplates.size() );
}
public static void main(final String... arguments) {
load();
}
}

View File

@@ -0,0 +1,128 @@
package com.lyndir.lhunath.masterpassword;
import com.google.common.base.Charsets;
import com.google.common.base.Preconditions;
import com.google.common.primitives.Bytes;
import com.lambdaworks.crypto.SCrypt;
import com.lyndir.lhunath.opal.crypto.CryptUtils;
import com.lyndir.lhunath.opal.system.*;
import com.lyndir.lhunath.opal.system.logging.Logger;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
import java.security.GeneralSecurityException;
/**
* Implementation of the Master Password algorithm.
*
* <i>07 04, 2012</i>
*
* @author lhunath
*/
public abstract class MasterPassword {
static final Logger logger = Logger.get( MasterPassword.class );
private static final int MP_N = 32768;
private static final int MP_r = 8;
private static final int MP_p = 2;
private static final int MP_dkLen = 64;
private static final Charset MP_charset = Charsets.UTF_8;
private static final ByteOrder MP_byteOrder = ByteOrder.BIG_ENDIAN;
private static final MessageDigests MP_hash = MessageDigests.SHA256;
private static final MessageAuthenticationDigests MP_mac = MessageAuthenticationDigests.HmacSHA256;
private static final MPTemplates templates = MPTemplates.load();
public static byte[] keyForPassword(final String password, final String username) {
long start = System.currentTimeMillis();
byte[] nusernameLengthBytes = ByteBuffer.allocate( Integer.SIZE / Byte.SIZE )
.order( MP_byteOrder )
.putInt( username.length() )
.array();
byte[] salt = Bytes.concat( "com.lyndir.masterpassword".getBytes( MP_charset ), //
nusernameLengthBytes, //
username.getBytes( MP_charset ) );
try {
byte[] key = SCrypt.scrypt( password.getBytes( MP_charset ), salt, MP_N, MP_r, MP_p, MP_dkLen );
logger.trc( "User: %s, password: %s derives to key ID: %s (took %.2fs)", username, password,
CodeUtils.encodeHex( keyIDForKey( key ) ), (double) (System.currentTimeMillis() - start) / 1000 );
return key;
}
catch (GeneralSecurityException e) {
throw logger.bug( e );
}
}
public static byte[] subkeyForKey(final byte[] key, final int subkeyLength) {
byte[] subkey = new byte[Math.min( subkeyLength, key.length )];
System.arraycopy( key, 0, subkey, 0, subkey.length );
return subkey;
}
public static byte[] keyIDForPassword(final String password, final String username) {
return keyIDForKey( keyForPassword( password, username ) );
}
public static byte[] keyIDForKey(final byte[] key) {
return MP_hash.of( key );
}
public static String generateContent(final MPElementType type, final String name, final byte[] key, int counter) {
Preconditions.checkArgument( type.getTypeClass() == MPElementTypeClass.Generated );
Preconditions.checkArgument( !name.isEmpty() );
Preconditions.checkArgument( key.length > 0 );
if (counter == 0)
counter = (int) (System.currentTimeMillis() / (300 * 1000)) * 300;
byte[] nameLengthBytes = ByteBuffer.allocate( Integer.SIZE / Byte.SIZE ).order( MP_byteOrder ).putInt( name.length() ).array();
byte[] counterBytes = ByteBuffer.allocate( Integer.SIZE / Byte.SIZE ).order( MP_byteOrder ).putInt( counter ).array();
logger.trc( "seed from: hmac-sha256(%s, 'com.lyndir.masterpassword' | %s | %s | %s)", CryptUtils.encodeBase64( key ),
CodeUtils.encodeHex( nameLengthBytes ), name, CodeUtils.encodeHex( counterBytes ) );
byte[] seed = MP_mac.of( key, Bytes.concat( "com.lyndir.masterpassword".getBytes( MP_charset ), //
nameLengthBytes, //
name.getBytes( MP_charset ), //
counterBytes ) );
logger.trc( "seed is: %s", CryptUtils.encodeBase64( seed ) );
Preconditions.checkState( seed.length > 0 );
int templateIndex = seed[0] & 0xFF; // Mask the integer's sign.
MPTemplate template = templates.getTemplateForTypeAtRollingIndex( type, templateIndex );
logger.trc( "type: %s, template: %s", type, template );
StringBuilder password = new StringBuilder( template.length() );
for (int i = 0; i < template.length(); ++i) {
int characterIndex = seed[i + 1] & 0xFF; // Mask the integer's sign.
MPTemplateCharacterClass characterClass = template.getCharacterClassAtIndex( i );
char passwordCharacter = characterClass.getCharacterAtRollingIndex( characterIndex );
logger.trc( "class: %s, index: %d, byte: 0x%02X, chosen password character: %s", characterClass, characterIndex, seed[i + 1],
passwordCharacter );
password.append( passwordCharacter );
}
return password.toString();
}
public static void main(final String... arguments) {
String masterPassword = "test-mp";
String username = "test-user";
String siteName = "test-site";
MPElementType siteType = MPElementType.GeneratedLong;
int siteCounter = 42;
String sitePassword = generateContent( siteType, siteName, keyForPassword( masterPassword, username ), siteCounter );
logger.inf( "master password: %s, username: %s\nsite name: %s, site type: %s, site counter: %d\n => site password: %s",
masterPassword, username, siteName, siteType, siteCounter, sitePassword );
}
}

View File

@@ -0,0 +1,10 @@
package com.lyndir.lhunath.masterpassword.entity;
/**
* <i>07 04, 2012</i>
*
* @author lhunath
*/
public class MPElementEntity {
}

View File

@@ -0,0 +1,10 @@
package com.lyndir.lhunath.masterpassword.entity;
/**
* <i>07 04, 2012</i>
*
* @author lhunath
*/
public class MPElementGeneratedEntity extends MPElementEntity {
}

View File

@@ -0,0 +1,10 @@
package com.lyndir.lhunath.masterpassword.entity;
/**
* <i>07 04, 2012</i>
*
* @author lhunath
*/
public class MPElementStoredEntity extends MPElementEntity {
}

View File

@@ -0,0 +1 @@
../../../../../../MasterPassword/Resources/Data/ciphers.plist

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lyndir.lhunath.masterpassword" android:versionCode="1" android:versionName="GIT-SNAPSHOT">
<uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="16" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloAndroidActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@@ -0,0 +1,3 @@
# File used by Eclipse to determine the target system
# Project target.
target=android-16

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- PROJECT METADATA -->
<parent>
<groupId>com.lyndir.lhunath.masterpassword</groupId>
<artifactId>masterpassword</artifactId>
<version>GIT-SNAPSHOT</version>
</parent>
<name>Master Password Android</name>
<description>An Android application to the Master Password algorithm</description>
<groupId>com.lyndir.lhunath.masterpassword</groupId>
<artifactId>masterpassword-android</artifactId>
<packaging>apk</packaging>
<!-- BUILD CONFIGURATION -->
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<!--configuration>
<proguard>
<skip>false</skip>
<config>proguard.cfg</config>
</proguard>
</configuration-->
</plugin>
</plugins>
</build>
<!-- DEPENDENCY MANAGEMENT -->
<dependencies>
<!-- PROJECT REFERENCES -->
<dependency>
<groupId>com.lyndir.lhunath.masterpassword</groupId>
<artifactId>masterpassword-algorithm</artifactId>
<version>GIT-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,5 @@
-ignorewarnings
-dontoptimize
-dontobfuscate
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello masterpassword-android!</string>
<string name="app_name">masterpassword-android</string>
</resources>

View File

@@ -0,0 +1,25 @@
package com.lyndir.lhunath.masterpassword;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class HelloAndroidActivity extends Activity {
private static String TAG = "masterpassword-android";
/**
* Called when the activity is first created.
* @param savedInstanceState If the activity is being re-initialized after
* previously being shut down then this Bundle contains the data it most
* recently supplied in onSaveInstanceState(Bundle). <b>Note: Otherwise it is null.</b>
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i(TAG, "onCreate");
setContentView(R.layout.main);
}
}

View File

@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- PROJECT METADATA -->
<parent>
<groupId>com.lyndir.lhunath.masterpassword</groupId>
<artifactId>masterpassword</artifactId>
<version>GIT-SNAPSHOT</version>
</parent>
<name>Master Password CLI</name>
<description>A CLI interface to the Master Password algorithm</description>
<groupId>com.lyndir.lhunath.masterpassword</groupId>
<artifactId>masterpassword-cli</artifactId>
<packaging>jar</packaging>
<!-- BUILD CONFIGURATION -->
<build>
<resources>
<resource>
<directory>src/main/scripts</directory>
<filtering>true</filtering>
<targetPath>${project.build.directory}</targetPath>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>prepare-package</id>
<phase>prepare-package</phase>
<configuration>
<target>
<chmod file="${project.build.directory}/install" perm="755"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.lyndir.lhunath.masterpassword.CLI</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- DEPENDENCY MANAGEMENT -->
<dependencies>
<!-- PROJECT REFERENCES -->
<dependency>
<groupId>com.lyndir.lhunath.masterpassword</groupId>
<artifactId>masterpassword-algorithm</artifactId>
<version>GIT-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,133 @@
/*
* Copyright 2008, Maarten Billemont
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.lyndir.lhunath.masterpassword;
import com.google.common.io.LineReader;
import com.lyndir.lhunath.opal.system.logging.Logger;
import com.lyndir.lhunath.opal.system.util.ConversionUtils;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
/**
* <p> <i>Jun 10, 2008</i> </p>
*
* @author mbillemo
*/
public class CLI {
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)
throws IOException {
String userName, masterPassword, siteName = null;
/* Environment. */
userName = System.getenv().get( ENV_USERNAME );
masterPassword = System.getenv().get( ENV_PASSWORD );
/* Arguments. */
int counter = 1;
MPElementType type = MPElementType.GeneratedLong;
boolean typeArg = false, counterArg = false, userNameArg = false;
for (final String arg : Arrays.asList( args ))
if ("-t".equals( arg ) || "--type".equals( arg ))
typeArg = true;
else if (typeArg) {
if ("list".equalsIgnoreCase( arg )) {
System.out.format( "%30s | %s\n", "type", "description" );
for (final MPElementType aType : MPElementType.values())
System.out.format( "%30s | %s\n", aType.getName(), aType.getDescription() );
System.exit( 0 );
}
type = MPElementType.forName( arg );
typeArg = false;
} else if ("-c".equals( arg ) || "--counter".equals( arg ))
counterArg = true;
else if (counterArg) {
counter = ConversionUtils.toIntegerNN( arg );
counterArg = false;
} else if ("-u".equals( arg ) || "--username".equals( arg ))
userNameArg = true;
else if (userNameArg) {
userName = arg;
userNameArg = false;
} else if ("-h".equals( arg ) || "--help".equals( arg )) {
System.out.println();
System.out.println( "\tMaster Password CLI" );
System.out.println( "\t\tLyndir" );
System.out.println( "[options] [site name]" );
System.out.println();
System.out.println( "Available options:" );
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.println( "\t\tUse 'list' to see the available types." );
System.out.println();
System.out.println( "\t-c | --counter [site counter]" );
System.out.format( "\t\tDefault: %d. The counter to use for this site.\n", counter );
System.out.println( "\t\tIncrement the counter if you need a new password." );
System.out.println();
System.out.println( "\t-u | --username [user's name]" );
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();
return;
} else
siteName = arg;
InputStreamReader inReader = new InputStreamReader( System.in );
try {
LineReader lineReader = new LineReader( inReader );
if (siteName == null) {
System.err.format( "Site name: " );
siteName = lineReader.readLine();
}
if (userName == null) {
System.err.format( "User's name: " );
userName = lineReader.readLine();
}
if (masterPassword == null) {
System.err.format( "%s's master password: ", userName );
masterPassword = lineReader.readLine();
}
byte[] masterKey = MasterPassword.keyForPassword( masterPassword, userName );
String sitePassword = MasterPassword.generateContent( type, siteName, masterKey, counter );
System.out.println( sitePassword );
}
finally {
inReader.close();
}
}
}

View File

@@ -0,0 +1,15 @@
<configuration scan="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%-8relative %22c{0} [%-5level] %msg%n</Pattern>
</layout>
</appender>
<logger name="com.lyndir" level="TRACE" />
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,56 @@
#!/usr/bin/env bash
#
# Install the Master Password CLI tool.
set -e
cd "${BASH_SOURCE%/*}"
source bashlib
inf "This will install the mpw tool."
# Try to guess then ask for the bin dir to install to.
IFS=: read -a paths <<< "$PATH"
if inArray ~/bin "${paths[@]}"; then
bindir=~/bin
elif inArray ~/.bin "${paths[@]}"; then
bindir=~/.bin
elif inArray /usr/local/bin "${paths[@]}"; then
bindir=/usr/local/bin
else
bindir=~/bin
fi
bindir=$(ask -d "$bindir" "What bin directory should I install to?")
[[ -d "$bindir" ]] || mkdir "$bindir" || ftl 'Cannot create missing bin directory: %s' "$bindir" || exit
[[ -w "$bindir" ]] || ftl 'Cannot write to bin directory: %s' "$bindir" || exit
# Try to guess then ask for the share dir to install to.
sharedir=$(cd -P "$bindir/.."; [[ $bindir = */.bin ]] && printf '%s/.share' "$PWD" || printf '%s/share' "$PWD")
sharedir=$(ask -d "$sharedir" "What share directory should I install to?")
[[ -d "$sharedir" ]] || mkdir "$sharedir" || ftl 'Cannot create missing share directory: %s' "$sharedir" || exit
[[ -w "$sharedir" ]] || ftl 'Cannot write to share directory: %s' "$sharedir" || exit
# Install Master Password.
sharepath=$sharedir/masterpassword
mkdir -p "$sharepath"
cp -a "masterpassword-cli-"*".jar" bashlib mpw "$sharepath"
ex -c "%s~%SHAREPATH%~$sharepath~g|x" "$sharepath/mpw"
ln -sf "$sharepath/mpw" "$bindir/mpw"
chmod +x "$sharepath/mpw"
[[ ! -e "$bindir/bashlib" ]] && ln -s "$sharepath/bashlib" "$bindir/bashlib" ||:
# Convenience bash function.
inf "Installation successful!"
echo
inf "To improve usability, you can install an mpw function in your bash shell."
inf "This function adds the following features:"
inf " - Ask the Master Password once, remember in the shell."
inf " - Automatically put the password in the clipboard (some platforms)."
echo
inf "To do this you need the following function in ~/.bashrc:\n%s" "$(<mpw.bashrc)"
echo
inf "We can do this for you automatically now."
if ask -c Y!n "Append the mpw function to your .bashrc?"; then
cat mpw.bashrc >> ~/.bashrc
inf "Done! Don't forget to run '%s' to apply the changes!" "source ~/.bashrc"
fi
echo
inf "To begin using Master Password, type: mpw [site name]"

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Uncomment this to set your user name. Master Password will no longer ask you for a user name.
# export MP_USERNAME="Robert Lee Mitchell"
# Uncomment this to hardcode your master password. Make sure this file's permissions are tight. Master Password will not ask you for your master password anymore. This is probably not a good idea.
# export MP_PASSWORD="banana colored duckling"
cd "%SHAREPATH%"
exec java -jar masterpassword-cli-GIT-SNAPSHOT.jar "$@"

Some files were not shown because too many files have changed in this diff Show More