Compare commits

...

353 Commits

Author SHA1 Message Date
J-Jamet
e7bbb47422 Merge branch 'release/2.5.0.0beta13' 2018-07-14 11:11:36 +02:00
J-Jamet
846bc7edb1 Update Changelogs 2018-07-14 11:01:34 +02:00
J-Jamet
99a9842a1f Fix null pointer on nodeButtonView 2018-07-14 10:47:52 +02:00
J-Jamet
33009138c3 Update version and fix memory crash 2018-07-14 10:23:04 +02:00
J-Jamet
c74b82ebd8 Fix changelogs 2018-07-13 17:06:20 +02:00
J-Jamet
49ea92a4a5 WebDav - Merge branch 'translations' into develop 2018-07-13 14:50:25 +02:00
David Ramiro
6cc4eeaa30 Translated using Weblate (German)
Currently translated at 100,0% (296 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/de/
2018-07-13 13:53:21 +02:00
David Ramiro
1b89f79888 Translated using Weblate (German)
Currently translated at 100,0% (296 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/de/
2018-07-13 13:53:21 +02:00
Ale-Ma
07d99de3ea Translated using Weblate (Italian)
Currently translated at 51.6% (153 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/it/
2018-07-13 13:53:21 +02:00
piegope
ae757affa1 Translated using Weblate (Spanish)
Currently translated at 100.0% (296 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/es/
2018-07-13 13:53:21 +02:00
Max
482b6296fc Translated using Weblate (Russian)
Currently translated at 57.0% (169 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/ru/
2018-07-13 13:53:21 +02:00
piegope
d37ce729f0 Translated using Weblate (Español (España))
Currently translated at 100,0% (296 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/es/
2018-07-13 13:53:21 +02:00
ButterflyOfFire
e92ce232bc Translated using Weblate (Arabic)
Currently translated at 35.1% (104 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/ar/
2018-07-13 13:53:21 +02:00
piegope
78ae44b160 Translated using Weblate (Spanish)
Currently translated at 87.5% (259 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/es/
2018-07-13 13:53:21 +02:00
Ale-Ma
49ce87a8e0 Translated using Weblate (Italian)
Currently translated at 51.3% (152 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/it/
2018-07-13 13:53:21 +02:00
ButterflyOfFire
d2fe5ce884 Translated using Weblate (Arabic)
Currently translated at 34.7% (103 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/ar/
2018-07-13 13:53:21 +02:00
ButterflyOfFire
5e695756de Added translation using Weblate (Arabe) 2018-07-13 13:53:21 +02:00
Max
0506a75417 Translated using Weblate (Russian)
Currently translated at 57.0% (169 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/ru/
2018-07-13 13:53:21 +02:00
dienteperro
34e1316144 Translated using Weblate (Spanish)
Currently translated at 57.0% (169 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/es/
2018-07-13 13:53:21 +02:00
Kunzisoft
18dffa6c75 Translated using Weblate (English)
Currently translated at 100.0% (296 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/en/
2018-07-13 13:53:21 +02:00
Kunzisoft
03621c378e Translated using Weblate (French)
Currently translated at 100.0% (296 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/fr/
2018-07-13 13:53:21 +02:00
Kunzisoft
aff9312419 Translated using Weblate (French)
Currently translated at 100.0% (296 of 296 strings)

Translation: KeePass DX/Strings
Translate-URL: https://hosted.weblate.org/projects/keepass-dx/strings/fr/
2018-07-13 13:53:21 +02:00
J-Jamet
4651b1be96 Icons depends now of setting of list items #97 2018-07-13 11:25:02 +02:00
J-Jamet
32497a22d2 Add dialog with a warning to copy, add the setting to copy the protected custom fields #139 2018-07-12 21:53:05 +02:00
J-Jamet
3b5ef56c16 Fix clean clipboard in notification 2018-07-11 18:26:49 +02:00
J-Jamet
d4cc3a58d8 Remove copy menu for group 2018-07-11 12:24:37 +02:00
J-Jamet
afedbb38b2 Merge remote-tracking branch 'origin/develop' into develop 2018-07-11 12:15:26 +02:00
J-Jamet
fe70bf3877 Fix database creation workflow 2018-07-11 12:15:04 +02:00
J-Jamet
f14ee6cf1c Update changelogs 2018-07-10 14:45:56 +02:00
J-Jamet
1791b15f85 Update gradle and remove compatibility mode for FingerPrintManager 2018-07-10 11:24:00 +02:00
J-Jamet
6c5b3b3a0d Fix german translation 2018-07-10 11:24:00 +02:00
J-Jamet
6ea2287679 Update German translation - Merge branch 'davidramiro-develop' into develop 2018-07-09 14:49:32 +02:00
David Ramiro
cad4ec22b4 Update German translation 2018-07-08 22:10:28 +02:00
J-Jamet
f277983caf Merge branch 'develop' of https://github.com/Kunzisoft/KeePassDX into develop 2018-07-06 08:54:14 +02:00
J-Jamet
5e561e5321 Update descriptions 2018-07-06 08:53:54 +02:00
J-Jamet
ef83dbcae2 Fix errors highlight by @gaul fb715950a7 2018-07-04 13:19:06 +02:00
J-Jamet
ab6c69adcb Standardize the slide animation 2018-07-04 12:59:32 +02:00
J-Jamet
1c90747476 Add setting to disable education screens 2018-07-02 11:25:59 +02:00
J-Jamet
c3b3d8482c Update changelog 2018-07-01 21:53:40 +02:00
J-Jamet
86b4d92599 Change DbHeaderV4 number 2018-07-01 21:53:25 +02:00
J-Jamet
1f6786b1f8 Fix null pointer for enableButtonOncheckedChangeListener 2018-07-01 12:50:59 +02:00
J-Jamet
4cd2b153f4 Fix broadcast unregister receiver 2018-07-01 11:54:46 +02:00
J-Jamet
27b0810688 Merge branch 'feature/Magikeyboard' into develop 2018-06-30 16:10:08 +02:00
J-Jamet
94c72a4cf6 Remove Jelly Bean condition 2018-06-30 16:04:03 +02:00
J-Jamet
e634116e71 Fix bugs for Kitkat device 2018-06-30 15:22:16 +02:00
J-Jamet
9021cb5bc8 Add TODO, dev dialog and fix icon bug 2018-06-29 19:02:31 +02:00
J-Jamet
3674900a54 Add receiver to lock the entry in the keyboard 2018-06-29 17:59:58 +02:00
J-Jamet
9855ae79c3 Add keyboard notification 2018-06-29 16:56:13 +02:00
J-Jamet
fe1a4985f1 Add settings bones 2018-06-26 00:25:09 +02:00
J-Jamet
015a368a1d Add keyboard explanation 2018-06-25 17:00:57 +02:00
J-Jamet
07f59e071d Upgrade changelogs 2018-06-25 11:37:06 +02:00
J-Jamet
670e2bfe33 Refining activity animations 2018-06-25 11:25:28 +02:00
J-Jamet
992b6382a3 Fix disabled button 2018-06-25 11:00:50 +02:00
J-Jamet
c3ac550c93 Add setting to disable the open button #126 2018-06-25 10:42:19 +02:00
J-Jamet
acba7fc5de New adaptive icon 2018-06-24 21:22:36 +02:00
J-Jamet
ccb500fdf4 Fix search with Autofill service #130 2018-06-23 11:40:33 +02:00
J-Jamet
44111507e7 Change style of keyboard 2018-06-22 18:27:07 +02:00
J-Jamet
5f14596ed2 Assign entry elements to keys 2018-06-10 21:51:09 +02:00
J-Jamet
4ad65c8f4a Retrieve entry selected in keyboard 2018-06-10 14:03:34 +02:00
J-Jamet
b4b215fe30 Lock since keyboard and refactor 2018-06-08 17:59:18 +02:00
J-Jamet
d8a8005d70 Merge branch 'develop' into feature/Magikeyboard 2018-06-06 19:23:48 +02:00
J-Jamet
37ca15b77c Refactor lock 2018-06-06 19:11:20 +02:00
J-Jamet
6c18fe5591 Fix the spelling error 2018-06-05 19:24:26 +02:00
J-Jamet
fdcb05467c First commit to add Magikeyboard 2018-06-03 16:33:59 +02:00
J-Jamet
ef8db46ae7 Update changelogs 2018-05-31 18:26:03 +02:00
J-Jamet
14f56c77e8 Merge branch 'feature/IconsVector' into develop 2018-05-31 17:37:45 +02:00
J-Jamet
44e21084e4 Change material icons as XML 2018-05-31 17:37:08 +02:00
J-Jamet
b7f1275789 Fix globe icon #125 2018-05-31 15:24:09 +02:00
J-Jamet
b1be05db4d Set folder icon by default for a new group #122 2018-05-31 13:21:38 +02:00
J-Jamet
09c776fd7e Remove "Rounds fix" setting no more used 2018-05-31 11:53:45 +02:00
J-Jamet
e8a24790a5 Upgrade version and changelogs 2018-05-30 11:51:28 +02:00
J-Jamet
8b3be79266 Merge branch 'feature/ListNodesFragment' into develop 2018-05-30 11:16:13 +02:00
J-Jamet
e5f0572c1c Change node menu as XML 2018-05-30 10:03:38 +02:00
J-Jamet
68df3bc6c3 Set messages in threads 2018-05-29 23:04:43 +02:00
J-Jamet
a3da960c26 Fix toolbar paste action and colors 2018-05-29 22:27:38 +02:00
J-Jamet
d9490f9840 Refactor runnable action 2018-05-29 19:58:27 +02:00
J-Jamet
3b24f9d821 Merge branch 'feature/NodeMenu' into feature/ListNodesFragment 2018-05-29 12:18:09 +02:00
J-Jamet
bf35897e92 Add toolbar paste and animations for activities 2018-05-29 12:09:08 +02:00
J-Jamet
977705b42d Fix group title 2018-05-28 20:12:09 +02:00
J-Jamet
459bc40515 Add Move for Entries and Groups 2018-05-28 19:53:45 +02:00
J-Jamet
eb8ca9355c Merge branch 'feature/ListNodesFragment' into feature/NodeMenu 2018-05-28 18:10:06 +02:00
J-Jamet
31f7b0d5be Fix timeout for fragment 2018-05-28 17:54:38 +02:00
J-Jamet
7c54946c4b Fix fragment - Merge branch 'feature/ListNodesFragment' into feature/NodeMenu 2018-05-25 22:09:35 +02:00
J-Jamet
5aaf2c222a Fix fragment during orientation change 2018-05-25 21:52:09 +02:00
J-Jamet
9424feefce Add contextual bar to paste and add move entry 2018-05-24 19:51:28 +02:00
Jérémy JAMET
a3917ccab6 Add translation link in Readme.md 2018-05-24 14:48:28 +02:00
J-Jamet
5286a60142 Group activity with fragment for navigation 2018-05-24 00:11:46 +02:00
J-Jamet
d4459de49b Rename string clipboard cleared 2018-05-23 12:25:08 +02:00
J-Jamet
05dba6668c Change about description string key 2018-05-23 10:25:50 +02:00
J-Jamet
c15a1c6eaa Refactor KDF Engine for v3 2018-05-22 15:22:04 +02:00
J-Jamet
fe8c962f73 Better KDF Exception management 2018-05-22 12:52:12 +02:00
J-Jamet
4192cf2403 Add FAQ store time 2018-05-18 11:02:02 +02:00
J-Jamet
1817f1aa9e Fix extended ASCII in default setting 2018-05-18 09:09:07 +02:00
J-Jamet
afacf352ed Merge branch 'develop' of https://github.com/Kunzisoft/KeePassDX into develop 2018-05-15 15:43:30 +02:00
J-Jamet
d3ebbba2a1 Remove compat methods 2018-05-15 15:43:03 +02:00
J-Jamet
460edf1745 Merge branch 'develop' of https://github.com/Kunzisoft/KeePassDX into develop 2018-05-13 22:22:21 +02:00
J-Jamet
dacb19d412 Add Gimp source for store screens 2018-05-13 22:21:28 +02:00
Jérémy JAMET
fe8158db85 Update FAQ.md 2018-05-13 20:13:24 +02:00
Jérémy JAMET
a36e4fbcd0 Update FAQ link 2018-05-13 20:11:32 +02:00
J-Jamet
9442c7ef07 Merge tag '2.5.0.0beta11' into develop 2018-05-13 18:23:52 +02:00
J-Jamet
d4a0b59eb1 Merge branch 'release/2.5.0.0beta11' 2018-05-13 18:23:37 +02:00
J-Jamet
07600949ab Upgrade version and fix potential null pointer for kdf 2018-05-13 18:14:25 +02:00
J-Jamet
7efaad1818 Fix database creation issue 2018-05-13 17:54:35 +02:00
J-Jamet
e32b0d1c25 Merge tag '2.5.0.0beta10' into develop 2018-05-13 17:05:32 +02:00
J-Jamet
0fdcc29aa2 Merge branch 'release/2.5.0.0beta10' 2018-05-13 17:05:10 +02:00
J-Jamet
37bedbffc9 Fix italian translation for compilation 2018-05-13 16:59:35 +02:00
J-Jamet
46505150c4 New Red Volcano theme and change visual feature message for version libre 2018-05-13 16:47:59 +02:00
J-Jamet
e18c5c90cc Upgrade changelogs 2018-05-13 14:52:59 +02:00
J-Jamet
1f5649d9d2 Merge branch 'feature/ChangeAlgorithms' into develop #9 #29 2018-05-13 14:25:31 +02:00
J-Jamet
7bbd55a9fd Add binary to memory explanation 2018-05-13 14:17:19 +02:00
J-Jamet
92eeccf84e Fix algorithm and kdf function for database V3 and add small trad 2018-05-13 13:55:37 +02:00
J-Jamet
7bcc289518 Upgrade explanations 2018-05-13 13:02:09 +02:00
J-Jamet
507f758c0d Add memory usage and parallelism for Argon2 settings 2018-05-12 23:53:41 +02:00
J-Jamet
6afffb7245 Register UUID of database version in KDF parameter 2018-05-11 19:19:16 +02:00
J-Jamet
c62f4ae0b3 Text if choose only one extension #105 2018-05-11 13:25:33 +02:00
J-Jamet
ee80c614e0 Fix layer error for icon free #113 2018-05-11 12:44:33 +02:00
J-Jamet
fea7af6910 Dynamic creation of KdfEngine, reorganise code 2018-05-09 15:17:55 +02:00
J-Jamet
c72aa0e97d Merge branch 'develop' into feature/ChangeAlgorithms to Fix NDK 2018-05-09 12:01:16 +02:00
J-Jamet
3dd60b5392 Fix ndk filters 2018-05-09 10:59:48 +02:00
J-Jamet
a357267552 #107 Set master password in landscape 2018-05-07 10:47:00 +02:00
J-Jamet
1badeb2eef Change FAQ as markdown and add descriptions 2018-05-07 10:34:27 +02:00
Yhaulez
0bb8d2a417 Create FAQ 2018-05-06 16:26:19 +02:00
J-Jamet
4a215db83c Change toolbar style and password layout 2018-05-05 23:16:39 +02:00
J-Jamet
512e55a170 Fix fingerprint animation and for first init 2018-05-05 20:39:01 +02:00
J-Jamet
1ebe8dc022 Update fingerprint state with checkbox 2018-05-04 21:24:57 +02:00
J-Jamet
cafeabdbc3 Fix search styles 2018-05-02 21:31:04 +02:00
J-Jamet
b342b26409 Update readme 2018-05-02 20:59:05 +02:00
J-Jamet
938c3a07af Fix wait dialog callback 2018-05-02 20:52:16 +02:00
J-Jamet
16288f98f7 Merge branch 'develop' into feature/ChangeAlgorithms 2018-05-02 15:57:47 +02:00
J-Jamet
a932156e85 Remove unused progressbar 2018-05-02 15:26:24 +02:00
J-Jamet
64e9b9fb6d Fix lock orientation change 2018-05-02 14:02:10 +02:00
J-Jamet
7af28550da Merge branch 'feature/RefactorProgress' into develop #98 2018-05-02 13:49:56 +02:00
J-Jamet
60e2d786dd Change progress dialog title, and remove code 2018-05-02 13:49:03 +02:00
J-Jamet
ec08f3430d Add progress bar for all, create database in a single progress dialog 2018-05-02 09:54:55 +02:00
J-Jamet
a50aa0fb95 Fix null pointer for KeyDerivationName 2018-05-02 07:16:55 +02:00
J-Jamet
cf026e8eaa Update progress bar and message progress 2018-05-01 20:03:43 +02:00
J-Jamet
77614d0c4a Upgrade changelogs and version 2018-04-30 19:54:50 +02:00
J-Jamet
e8d71039d7 refactor 2018-04-30 18:18:13 +02:00
J-Jamet
4164b5bd37 Fix crash by locking activity position 2018-04-30 17:47:31 +02:00
J-Jamet
3c66ec82b5 Upgrade French 2018-04-30 17:00:42 +02:00
J-Jamet
b796c16877 Upgrade Italian 2018-04-30 16:57:10 +02:00
J-Jamet
42d34d8f0c Add material icon pack in free version and change texts 2018-04-30 16:10:18 +02:00
J-Jamet
5fbb37df82 Fix german fingerprint error 2018-04-29 14:07:56 +02:00
J-Jamet
52e12d7cbd Upgrade russian translation 2018-04-28 22:34:25 +02:00
J-Jamet
5cf5719e8e Fix education text color 2018-04-28 20:08:33 +02:00
J-Jamet
af3a80143e Fix crash by return blank when Resources$NotFoundException 2018-04-28 19:49:59 +02:00
J-Jamet
90db27c3fe Refactor Master key functions 2018-04-28 18:15:30 +02:00
J-Jamet
3d584b76f7 Choose kdf and encapsulate code 2018-04-28 15:58:04 +02:00
J-Jamet
fbf3dec421 Assign algorithm dynamically 2018-04-28 12:20:18 +02:00
J-Jamet
1d36683128 Remove screens in Readme 2018-04-28 11:11:50 +02:00
J-Jamet
cefc546c0a Upgrade german translation 2018-04-28 11:08:23 +02:00
J-Jamet
7aeb51813c Show algorithm dialog 2018-04-26 23:00:15 +02:00
J-Jamet
d6fc29ec79 Creation of classes and prepare assignment for algorithms 2018-04-26 22:00:11 +02:00
J-Jamet
9af182e0c3 Change dark style 2018-04-26 16:14:22 +02:00
J-Jamet
c7120b997f Fix contribution issue for KeePass DX Pro 2018-04-26 14:39:45 +02:00
J-Jamet
e61571fcec Upgrade fastlane 2018-04-26 12:18:14 +02:00
J-Jamet
9a900b32b2 Merge tag '2.5.0.0beta9' into develop
2.5.0.0beta9
2018-04-25 13:16:14 +02:00
J-Jamet
1033dd78b0 Merge branch 'release/2.5.0.0beta9' 2018-04-25 13:15:44 +02:00
J-Jamet
4aaae3f59e Upgrade readme and screen 2018-04-25 13:15:13 +02:00
J-Jamet
1424633a58 Update screenshots 2018-04-25 01:36:30 +02:00
J-Jamet
c9b98094e5 Change purple colors 2018-04-24 00:46:31 +02:00
J-Jamet
5707026985 Change fingerprint visual 2018-04-24 00:36:37 +02:00
J-Jamet
bfcfb842fb Fix visual bugs 2018-04-23 20:59:59 +02:00
J-Jamet
8fe2230891 Fix visual bugs 2018-04-23 20:40:17 +02:00
J-Jamet
41cc0b1a5a Fix compilation 2018-04-23 19:20:15 +02:00
J-Jamet
cc8c525dab Upgrade fastlane 2018-04-23 18:55:32 +02:00
J-Jamet
92bc3c2838 Add pro app name 2018-04-23 15:51:13 +02:00
J-Jamet
1d065e7bc5 Fix crash when orientation change after a modification 2018-04-21 15:44:17 +02:00
J-Jamet
fb1b90a281 Add modification 2018-04-21 14:20:43 +02:00
J-Jamet
268f716104 Upgrade fastlane 2018-04-21 07:14:34 +02:00
J-Jamet
b7328875f1 Fix filepicker style 2018-04-20 20:27:34 +02:00
J-Jamet
02ee58efa7 Add dev to crypt settings and comment transition 2018-04-20 19:59:31 +02:00
J-Jamet
6754881847 Add activity animation 2018-04-20 17:57:39 +02:00
J-Jamet
6e4c5d8c26 Add transition for settings 2018-04-20 17:43:08 +02:00
J-Jamet
544648c2eb Remove TODO 2018-04-20 16:03:10 +02:00
J-Jamet
e62f8bf56b Solve empty password issue #2 2018-04-20 15:48:53 +02:00
J-Jamet
7f5138b08b Upgrade Changelogs and versions 2018-04-20 10:44:22 +02:00
J-Jamet
a367aeaf12 Change font by Droid Sans Mono Slashed and activate by default, add it in password generator #86 2018-04-19 11:09:55 +02:00
J-Jamet
fc6453beba Keyboard setting with dev dialog 2018-04-18 22:28:49 +02:00
J-Jamet
8a981b7a79 Move appearance settings 2018-04-18 21:26:42 +02:00
J-Jamet
d7f9a02699 New selection screen 2018-04-18 19:32:51 +02:00
J-Jamet
7c9153ea04 Open button expanded and add small text 2018-04-17 14:09:44 +02:00
J-Jamet
2c16fe3335 Add fab menu 2018-04-16 21:32:56 +02:00
J-Jamet
eb14d27ca5 #88 Fix crash when header can't be write 2018-04-16 19:47:27 +02:00
J-Jamet
7024178069 #88 Open file with kitkat 2018-04-16 19:37:03 +02:00
J-Jamet
c85ce3e0e8 Replace standart by standard 2018-04-16 16:14:27 +02:00
J-Jamet
067c5ff1cf Fix bugs for Icons and Styles, add contribution and pro dialog 2018-04-16 15:27:45 +02:00
J-Jamet
429bd99f1c Upgrade app icons 2018-04-15 23:44:35 +02:00
J-Jamet
7b5bb0fd97 Add ocean theme and fix styles 2018-04-15 21:07:44 +02:00
J-Jamet
ae50f424d3 App icon for each flavor 2018-04-15 19:28:59 +02:00
J-Jamet
53cc1ad673 Disable custom font and clipboard notification by default #86 2018-04-15 12:08:44 +02:00
J-Jamet
ceb80c6cac Remove the first activity, fix colors in Classic theme and fix custom icon tint 2018-04-14 21:54:29 +02:00
J-Jamet
71bd3ab780 Add splashscreen 2018-04-14 20:39:15 +02:00
J-Jamet
8a40a4b3ae Fix visual bugs, add classic theme and pro theme #27 2018-04-14 19:58:26 +02:00
J-Jamet
7772db17ae Change productFlavors names 2018-04-14 15:36:41 +02:00
J-Jamet
11738d807c Merge branch 'feature/IconPackModules' into develop 2018-04-13 20:55:15 +02:00
J-Jamet
80b9a8fa50 List of IconPack as gradle entity 2018-04-13 20:54:05 +02:00
J-Jamet
d619f6581e Fix landscape icon #84 2018-04-13 20:04:11 +02:00
J-Jamet
697e9aa923 Fix visual bugs and save icon pack setting 2018-04-13 19:47:56 +02:00
J-Jamet
15c843fbb9 Add setting to choose an IconPack 2018-04-13 17:08:13 +02:00
J-Jamet
b6b7e61cfb Add tint for icon pack 2018-04-12 19:21:53 +02:00
J-Jamet
d5b0ee9371 Add feather icon and licences for icon packs 2018-04-12 17:32:06 +02:00
J-Jamet
e86807c3d3 Clean code and solve recovered icon 2018-04-11 20:57:04 +02:00
J-Jamet
08fcb119a9 Finish merge material_icon_pack 2018-04-11 19:10:48 +02:00
J-Jamet
edff33afd1 Merge branch 'justintime4tea-53_new-icon-pack' into feature/IconPackModules (Move in module material_icon_pack)
# Conflicts:
#	app/build.gradle
#	icon-pack-classic/src/main/res/drawable-hdpi/classic_64_32dp.png
#	icon-pack-classic/src/main/res/drawable-ldpi/classic_64_32dp.png
#	icon-pack-classic/src/main/res/drawable/classic_64_32dp.png
2018-04-11 19:09:53 +02:00
J-Jamet
bdfa963bed Merge branch '53_new-icon-pack' of git://github.com/justintime4tea/KeePass-Libre into justintime4tea-53_new-icon-pack 2018-04-11 18:23:17 +02:00
J-Jamet
4eff247865 Add icon pack identifier 2018-04-11 18:13:58 +02:00
J-Jamet
3e3d5bd7d8 Merge branch 'feature/Education' into develop 2018-04-11 15:31:18 +02:00
J-Jamet
5a74d1be8f Add links for field reference and autofill setting, add doc, fix glitches, add changelogs 2018-04-10 21:15:05 +02:00
J-Jamet
812eccfe0e Sort_selection as ScrollView #83 2018-04-10 19:01:22 +02:00
J-Jamet
d00c337382 Fix visual issues in education screens 2018-04-10 17:58:17 +02:00
J-Jamet
54dbcc95ab Change education for entries screens 2018-04-10 17:31:22 +02:00
J-Jamet
2e5ddd80ff Change education for group screen 2018-04-10 15:18:27 +02:00
J-Jamet
2c44a4d760 Change education for password screen 2018-04-10 12:44:49 +02:00
J-Jamet
f8561222d5 Change education for database selection 2018-04-10 12:23:41 +02:00
J-Jamet
2c8e3e9c8e Merge branch 'develop' into feature/Education
# Conflicts:
#	app/src/main/java/com/kunzisoft/keepass/activities/EntryActivity.java
#	app/src/main/java/com/kunzisoft/keepass/activities/EntryEditActivity.java
#	app/src/main/java/com/kunzisoft/keepass/activities/GroupActivity.java
#	app/src/main/java/com/kunzisoft/keepass/fileselect/FileSelectActivity.java
#	app/src/main/java/com/kunzisoft/keepass/password/PasswordActivity.java
#	app/src/main/java/com/kunzisoft/keepass/utils/MenuUtil.java
#	app/src/main/res/values/donottranslate.xml
2018-04-10 10:33:52 +02:00
J-Jamet
ccbc6c07ed Update supportVersion libraries 2018-04-10 09:59:33 +02:00
J-Jamet
47e820e3d8 (Implementation) Merge branch 'justintime4tea-kunzi-develop' into develop 2018-04-10 09:49:24 +02:00
J-Jamet
13dea4b567 New icon pack importer 2018-04-09 21:37:28 +02:00
Justin Gross
70d1ce715e Change compile to implementation 2018-04-08 16:20:07 -04:00
J-Jamet
cc41545c0a create Classic Icon Pack 2018-04-08 12:45:25 +02:00
J-Jamet
aded8fab0a Rebuild classic icons (Add apple icon and remove numbers) 2018-04-07 15:41:52 +02:00
J-Jamet
9cb4d28ad8 Upgrade Readme 2018-04-07 10:31:59 +02:00
J-Jamet
a1b2235fb3 Merge tag '2.5.0.0beta8' into develop
2.5.0.0beta8
2018-04-06 20:29:47 +02:00
J-Jamet
161923c808 Merge branch 'release/2.5.0.0beta8' 2018-04-06 20:29:26 +02:00
J-Jamet
d5a03424d0 Solve fab color 2018-04-06 20:27:33 +02:00
J-Jamet
3e87c1ab9d Change password layout 2018-04-06 19:39:58 +02:00
J-Jamet
a6046bc49a Add sorting by last access and by creation time 2018-04-06 19:02:31 +02:00
J-Jamet
db98f4b30c Remove db name for v3 2018-04-06 17:15:36 +02:00
J-Jamet
60eff63569 Add dialogs to save Db name and description 2018-04-06 16:51:25 +02:00
J-Jamet
b8e97ec53b Change rounds_fix_explanation 2018-04-06 08:43:33 +02:00
J-Jamet
c2b60b2268 Entry edit as menu, Launch in lowercase 2018-04-06 08:34:53 +02:00
J-Jamet
cac1f923cc Change url icon by launch icon 2018-04-06 08:06:37 +02:00
J-Jamet
b4ac0ef21f Move donation in menu 2018-04-06 07:56:57 +02:00
J-Jamet
8b85c22f25 Remove font 2018-04-05 20:31:27 +02:00
J-Jamet
582faab29d Base64Coder as dependency 2018-04-05 20:28:47 +02:00
J-Jamet
a9f6fa3441 commons-collections as dependency 2018-04-05 20:21:47 +02:00
J-Jamet
54740c1ba2 Change packages and solve dependencies 2018-04-05 20:11:08 +02:00
J-Jamet
94a8ecbdf1 GPL2 to GPL3 2018-04-05 18:41:49 +02:00
J-Jamet
46855e0b70 Merge branch 'feature/EncryptionSettings' into develop #9 2018-04-05 17:25:07 +02:00
J-Jamet
2d3eabe07e Update changelogs 2018-04-05 17:24:11 +02:00
J-Jamet
48bda000e9 Add database name, description and version, encapsulate db methods 2018-04-05 17:20:17 +02:00
J-Jamet
8aea6fa2da Remove keepassdroid assets 2018-04-05 13:26:00 +02:00
J-Jamet
c46aa0e5c8 remove .idea files from being tracked 2018-04-05 13:17:13 +02:00
Justin Gross
ed7f6e4b68 Update icons to font awesome 2018-04-04 16:49:40 -04:00
J-Jamet
825d88014d Set Key Rounds for database V4 2018-04-04 20:37:23 +02:00
J-Jamet
b3ff38fb35 Get rounds from KdfParameters 2018-04-04 17:25:45 +02:00
Justin Gross
1ebba9d8be Merge pull request #1 from Kunzisoft/develop
Merge upstream changes
2018-04-04 11:00:37 -04:00
J-Jamet
1e4deb2182 Refactor rounds 2018-04-04 14:42:58 +02:00
J-Jamet
d5acd04a19 Merge branch 'develop' into feature/EncryptionSettings 2018-04-04 13:38:48 +02:00
J-Jamet
fe73a951e3 Upgrade version 2018-04-04 13:38:05 +02:00
J-Jamet
415094154d Upgrade description 2018-04-04 13:31:07 +02:00
J-Jamet
347522b9a6 Add lock, field copy, sort and donation 2018-04-03 20:40:52 +02:00
J-Jamet
918f563faa Change Education for Password layout and fix translations 2018-04-03 17:11:46 +02:00
J-Jamet
3b88b0fea6 Keep long in DateToKDBX4 2018-04-03 13:49:23 +02:00
J-Jamet
d8e3d52f21 Catch OutOfMemoryError when writing 2018-04-03 13:07:05 +02:00
J-Jamet
041f3eb568 Solve visual bugs and translation 2018-04-02 12:59:02 +02:00
J-Jamet
4a1d97a622 Add entry edit screens preference 2018-04-01 16:34:54 +02:00
J-Jamet
cd0d712f56 Add reset education screens preference 2018-04-01 00:37:30 +02:00
J-Jamet
761d9a1883 Add education to "add button" 2018-03-31 21:59:05 +02:00
J-Jamet
2c9a6d7c26 Add education to database selection 2018-03-31 21:24:39 +02:00
J-Jamet
8105f89088 New FileSystem screen 2018-03-31 16:29:34 +02:00
J-Jamet
90084ed2f7 Solve protected field display 2018-03-31 14:57:01 +02:00
J-Jamet
496725a8fd Add encryption settings 2018-03-30 21:04:33 +02:00
J-Jamet
72b0cdf0d7 Add changelogs 2018-03-30 16:07:37 +02:00
J-Jamet
a266d307a6 Change timeout settings 2018-03-30 16:05:47 +02:00
J-Jamet
f7fe414597 Hide custom entries protected #65 2018-03-30 15:18:58 +02:00
J-Jamet
5c1e9bd94f Patch to allow autofill in search #62 2018-03-30 14:03:43 +02:00
J-Jamet
747135afae Fix crash #69 2018-03-29 23:26:22 +02:00
J-Jamet
675efe3ab8 Replace anonymous fun by lambda 2018-03-29 23:12:16 +02:00
J-Jamet
02b6191e66 Merge branch 'feature/RefactorModel' into develop 2018-03-29 22:15:40 +02:00
J-Jamet
1e07d6a28d Solve field reference issues #61 (Was fix in part by refactoring) 2018-03-29 22:07:09 +02:00
J-Jamet
ab98f03ebf Fix ExpireDate issue for Database V3 2018-03-29 21:17:24 +02:00
J-Jamet
4aff5e3a06 Fix ExpireDate issue for Database V3 2018-03-29 17:24:32 +02:00
J-Jamet
3ad4e8efe7 #67 Add warning dialog for storage setting 2018-03-29 12:34:07 +02:00
J-Jamet
d04d7737c3 Change copy password summary 2018-03-29 10:28:45 +02:00
J-Jamet
8de52cb51e Solve default XML settings 2018-03-29 10:25:55 +02:00
J-Jamet
c8cb79726b Change search methods 2018-03-29 10:16:44 +02:00
J-Jamet
d51a227c1d Add accessors to Database 2018-03-29 09:55:32 +02:00
J-Jamet
94ed03ce35 Refactor Database, Add Type parameters, Refactor ExtraFields 2018-03-29 00:35:25 +02:00
J-Jamet
304a5e946d Merge branch 'develop' into ModelTypeParameter 2018-03-28 21:37:50 +02:00
J-Jamet
ff64b53580 Fix crash when database can't be saved 2018-03-28 21:30:44 +02:00
J-Jamet
9ece794f9a Add type parameter to PwObject 2018-03-28 14:33:00 +02:00
J-Jamet
b67dc22f10 Solve gradle compilation warning 2018-03-28 12:41:23 +02:00
J-Jamet
8a1a29caa8 Upgrade Android version dialog #49 2018-03-28 11:57:03 +02:00
J-Jamet
a8d07c3e82 Refactor entry search 2018-03-27 18:46:59 +02:00
J-Jamet
937135bb36 Solve bug #63 Empty Autofill View 2018-03-27 15:31:47 +02:00
J-Jamet
10c32266c2 Add accessors to PwDatabase 2018-03-26 16:04:38 +02:00
J-Jamet
ad45369442 Add color to notification 2018-03-26 13:14:52 +02:00
J-Jamet
1ca770fa72 Upgrade fastlane 2018-03-25 20:58:24 +02:00
J-Jamet
4acd11d2b2 Merge tag '2.5.0.0beta7' into develop
2.5.0.0beta7
2018-03-25 20:40:21 +02:00
J-Jamet
38c264e38d Merge branch 'release/2.5.0.0beta7' 2018-03-25 20:40:00 +02:00
J-Jamet
8da6b882fc Fix compilation 2018-03-25 20:23:54 +02:00
J-Jamet
6e03c2ebfc Upgrade changelogs 2018-03-25 20:10:53 +02:00
J-Jamet
a5cb5ed896 Temp Merge branch 'feature/RefactorModel' to correct serializable crash 2018-03-25 20:03:41 +02:00
J-Jamet
32bef7b099 Add constructors 2018-03-25 15:49:13 +02:00
J-Jamet
af0359132e Move comparators in SortNodeEnum 2018-03-25 15:29:50 +02:00
J-Jamet
85990879de Add serializable to binary to solve crash, refactor UUID and icon 2018-03-25 14:05:19 +02:00
J-Jamet
9436a4c3a5 Merge remote-tracking branch 'origin/develop' into develop 2018-03-24 20:06:45 +01:00
J-Jamet
efc786e318 Description for error API #49 2018-03-24 20:06:27 +01:00
J-Jamet
ed299b35e9 Change clones (To redefine) 2018-03-24 17:13:16 +01:00
J-Jamet
0defe9401f Solve password notification 2018-03-24 12:53:47 +01:00
J-Jamet
b66678f028 Refactor Groups and Entries methods 2018-03-24 00:02:08 +01:00
J-Jamet
b0cfd4292f Make attributes private in PwGroup and PwEntry 2018-03-23 21:30:50 +01:00
J-Jamet
8e390685cd Upgrade changelog and change extended visual 2018-03-23 19:14:58 +01:00
J-Jamet
9bcacdca4a Change extended visual 2018-03-23 19:04:19 +01:00
J-Jamet
c1969402f1 Add extended Ascii (ñæËÌÂÝÜ...) #36 2018-03-23 16:54:32 +01:00
J-Jamet
50bf22a4c7 Better fingerprint error management #38 #52 2018-03-23 13:48:51 +01:00
J-Jamet
cf93044d3f Start factorise 2018-03-22 23:06:05 +01:00
J-Jamet
33404add38 Verify nullity of group 2018-03-22 16:48:02 +01:00
J-Jamet
49ba74c38f Add Copy of password in settings 2018-03-22 15:48:46 +01:00
J-Jamet
3ed5db9819 Change search label in settings 2018-03-22 15:10:24 +01:00
J-Jamet
4535204d1e Move down file_browser settings 2018-03-22 15:03:44 +01:00
J-Jamet
18c656a555 Solve flickering and architecture for timeout #43 2018-03-22 14:36:23 +01:00
J-Jamet
42c28b5b95 Add timeout in launch 2018-03-22 13:04:45 +01:00
J-Jamet
9fc47fdf05 Solve timeout bug and remove compat class for invalidateOptionMenu 2018-03-21 23:17:40 +01:00
J-Jamet
9ef34599ce Solve bug of refresh entry 2018-03-21 22:25:35 +01:00
J-Jamet
bd3e5c6917 Solve color bugs 2018-03-21 22:14:57 +01:00
J-Jamet
7e9bed1e53 #55 Fix dispatch event 2018-03-21 21:59:55 +01:00
J-Jamet
ff2215929c Add menu_edit strings 2018-03-21 17:49:15 +01:00
J-Jamet
36d53e9788 Add file_browser strings 2018-03-21 17:32:35 +01:00
J-Jamet
6b9db7d40d Merge branch 'develop' of https://github.com/Kunzisoft/KeePassDX into develop 2018-03-21 17:02:00 +01:00
J-Jamet
30f805f5a9 #55 Fix listener to add node (dispatch event must to be refactored) 2018-03-21 16:13:40 +01:00
J-Jamet
64448ef218 #58 Horizontal scroll to see password and fix layout issues 2018-03-21 15:08:57 +01:00
J-Jamet
6e312e0420 #53 Fix password checkbox and add lambda 2018-03-21 14:36:42 +01:00
J-Jamet
1f7b86d34f #52 Add strike-through for 0 and check setting by default 2018-03-21 14:17:44 +01:00
J-Jamet
ae00fd5782 Allow notifications for all fields 2018-03-20 15:04:44 +01:00
J-Jamet
62f6f02467 Add notification to copy extra field, remove unused string 2018-03-20 14:47:49 +01:00
J-Jamet
55ee89314f Merge remote-tracking branch 'origin/develop' into develop 2018-03-20 13:43:28 +01:00
J-Jamet
b2f985aa03 New Notification engine 2018-03-20 13:43:11 +01:00
J-Jamet
b3a34c0138 Auto open select file #32 2018-03-19 18:17:29 +01:00
J-Jamet
1f06b09d38 Remove manual compat dependencies in settings 2018-03-19 16:49:26 +01:00
J-Jamet
758914a80a Solve bug of empty filename #51 2018-03-19 16:33:43 +01:00
J-Jamet
f2566abdcd Solve bug of icon information color 2018-03-19 16:20:38 +01:00
J-Jamet
cb6d479350 Default file as hint, change color 2018-03-19 16:09:33 +01:00
J-Jamet
846930a4f9 Refactor packages 2018-03-19 01:39:34 +01:00
J-Jamet
e788d89b18 Fix null in entry menu 2018-03-19 01:17:52 +01:00
J-Jamet
07f68cfe2f Add 30 minutes to timeout #43 2018-03-18 15:46:25 +01:00
J-Jamet
1c6ef51925 Launch notification only one time 2018-03-18 15:31:47 +01:00
J-Jamet
9995bc4d9f Fix App timeout for main cases #43 2018-03-18 15:31:22 +01:00
J-Jamet
accb931831 Upgrade clipboard and timeout 2018-03-18 13:26:13 +01:00
J-Jamet
42ac83c814 Upgrade version 2018-03-18 11:31:35 +01:00
J-Jamet
9ee9063c4d Refactor Timeout, delete useless Intents class 2018-03-17 20:18:06 +01:00
J-Jamet
8c38b361ea New notifications to copy fields 2018-03-17 20:01:13 +01:00
J-Jamet
cb919b2de5 Fix action "add group" for v3 #46 2018-03-17 11:07:33 +01:00
J-Jamet
679ea7c58f Fix Autofill settings crash #22 2018-03-16 19:15:39 +01:00
J-Jamet
21ebbd25f8 Update changelogs 2018-03-16 17:19:06 +01:00
J-Jamet
3c232ac5b6 Change HTTP to HTTPS 2018-03-16 16:36:23 +01:00
J-Jamet
d36d2408d7 Upgrade Notifications 2018-03-15 23:37:21 +01:00
J-Jamet
9fd59f850c Fix flickering and timeout toast in settings 2018-03-14 17:36:11 +01:00
J-Jamet
4cc7d1e74d Fix ActivityNotFound in FilePicker #37 2018-03-14 16:52:40 +01:00
J-Jamet
66f4353c3e Fix ActivityNotFound for AutoFill Service #37 2018-03-14 14:38:56 +01:00
J-Jamet
0acc83b066 Merge tag '2.5.0.0beta6' into develop
2.5.0.0beta6
2018-03-10 13:56:07 +01:00
989 changed files with 40591 additions and 18955 deletions

2
.gitignore vendored
View File

@@ -71,7 +71,9 @@ app/app.iml
# Art # Art
art/screen*.png art/screen*.png
art/logo_512.png art/logo_512.png
art/store_screens/
# Dir linux # Dir linux
.directory .directory
*/.directory */.directory
.idea

22
.idea/compiler.xml generated
View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View File

@@ -1,3 +0,0 @@
<component name="CopyrightManager">
<settings default="" />
</component>

6
.idea/encodings.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

20
.idea/gradle.xml generated
View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.14.1" />
<option name="gradleJvm" value="1.8" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

View File

@@ -1,11 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AndroidLintAppCompatResource" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="AndroidLintMissingTranslation" enabled="true" level="INFO" enabled_by_default="true" />
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
</profile>
</component>

View File

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

49
.idea/misc.xml generated
View File

@@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.7</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

9
.idea/modules.xml generated
View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/KeePassDX.iml" filepath="$PROJECT_DIR$/KeePassDX.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>

View File

@@ -1,3 +1,61 @@
KeepassDX (2.5.0.0beta11)
* Fix memory issue with parcelable (crash in beta12 version)
KeepassDX (2.5.0.0beta12)
* Added the Magikeyboard to fill the forms (settings still in development)
* Added move and copy for groups and entries
* New navigation in a single screen / new animations between activities
* New icons for the material pack / vectorization
* New adaptive launcher icon
* Icons depends now of setting of list items
* Added a setting to disable the open button when no password is identified
* Added a setting to disable the education screens
* Added a setting to disable the copy of protected custom fields
* Fix the fingerprint recognition (WARNING : The keystore is reinit, you must delete the old keys)
* Fix small bugs
KeepassDX (2.5.0.0beta11)
* Fix crash in beta10 version
KeepassDX (2.5.0.0beta10)
* Dynamically change Algorithm and Key Derivation Function in settings
* Upgrade translations
* New red volcano theme, fix classic dark theme
* Add Material Icon Pack to the Free version
* Update fingerprint state with checkbox
* Fix bugs
KeepassDX (2.5.0.0beta9)
* Education Screens to learn how to use the app
* New designs
* New custom font for character visibility
* New themes
* New icon pack
* Change setting organisation
* Pro version
KeepassDX (2.5.0.0beta8)
* Hide custom entries protected
* Best management of field references (https://keepass.info/help/base/fieldrefs.html)
* Change database / default settings
* Add Autofill for search
* Add sorting by last access and by creation time
* Rebuild custom entries
* Refactor old code
* Fix bugs
KeepassDX (2.5.0.0beta7)
* Rebuild Notifications
* Change links to https
* Add extended Ascii (ñæËÌÂÝÜ...)
* Upgrade custom visibility font
* Best fingerprint error management
* Add setting to prevent the password copy
* Fix bugs
KeepassDX (2.5.0.0beta6)
* Fix crash
KeepassDX (2.5.0.0beta5) KeepassDX (2.5.0.0beta5)
* Autofill (Android O) * Autofill (Android O)
* Deletion for group * Deletion for group

View File

@@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

55
FAQ.md Normal file
View File

@@ -0,0 +1,55 @@
# F.A.Q.
## Why KeePass DX?
KeePass DX is an **Android password manager** implemented from Keepass password manager.
KeePass DX was created to meet the security and usability needs of a KeePass application on Android :
- To be easy to use with **secure password management and form filling tools**.
- To use only tools under **open source license** to guarantee the security of the application (With [open source store](https://f-droid.org/en/) and no closed API).
- To be in a **native langage** (java) for weight, security and a better integration of the application.
- To respect **Android design, architecture and ergonomic**.
## What makes KeePass DX stand out from other password managers?
- We **do not recover your sensitive data** on a private server or a closed cloud, you have control of your passwords.
- We respect **KeePass file standards** to maintain compatibility and data porting on different devices (computers and portable devices with different operating system).
- The code is **open source**, which implies increased **security**, you can check how the encryption algorithms are implemented.
- We remain attentive to **your needs** and we can even integrate the features that you have defined.
- We **do not put advertising** even in the free version.
## How am I sure my passwords are safely stored on the application?
- We allow users to save and use passwords, keys and digital identities in a secure way by **integrating the last encryption algorithms** and **Android architecture standards**.
- You can increase the security of your database by increasing the rounds of encryption keys. *(In Settings -> Database Settings when your database is open)* **Warning**: *Increase the number of rounds sparingly to have a reasonable opening time.*
## Can I store my data on a cloud storage?
**Yes** this is possible. Otherwise, we **recommend using cloud with personal server and open source license**, like [NextCloud](https://f-droid.org/en/packages/com.nextcloud.client/) to be sure how your databases are stored.
## Can I recover my passwords on another device if I loose my main device?
**Yes** you can, but you **must first save the .kdb or .kdbx file from your database to an external storage** *(like a hardrive or a cloud)*.
We recommend you save your data after each modification so incase you loose your android device you could retrieve the data and import it into the new KeePass DX installed on the new android device.
## Why are updates not available at the same time on all stores?
- **PlayStore** only needs an APK generated and manually signed to be available on the store, it usually takes **20 minutes** to be available because it is deployed with fastlane. But the management of the APK and its data by the google servers is obscure.
- **F-Droid**, to **ensure that the code is open source**, checks the sources directly on git repository (by checking the presence of new tags) and builds itself the APK that the server signs during the compilation of code and dependencies. Updating the project will take **1-10 days** for F-Droid to analyze all available repositories, build sources and deploy the generated APK. So F-Droid is slower for deployment but it is run by **volunteers** and guaranteed a **clean APK**. :)
## Why not an online version?
The offline and online client concepts only exists with Keepass2Android because the file access network tools are directly integrated into the code of the main application. Which is a very dubious choice knowing that **it is not normally the purpose of a password management application to take care of external file synchronization on clouds** (which can be under closed licensed and recover your data base), it is rather the purpose of the [file management application](https://developer.android.com/guide/topics/providers/document-provider).
## Can I open my database easily other than with a password?
**Yes**, we have integrated a secure openning option of fingerprint for android devices that support this feature, so no one can access the application without scanning his/her fingerprint or fill a master key.
## Can I open my database without my master key (master password and/or key file)?
**No**, you can not open a database file without the master password (and / or) the associated key file. Be sure to remember your master password and save the key file in a safe place.
## Can I suggest features and report bugs for the application?
**Yes**, we welcome this you could go ahead and do that on our github:
https://github.com/Kunzisoft/KeePassDX

16
LICENSE
View File

@@ -1,7 +1,19 @@
--- ---
The KeePass icon was created by Jeremy JAMET and is licensed under the terms of GPLv3. KeePass DX is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
The KeePass DX icon was created by Jeremy JAMET and is licensed under the terms of GPLv3.
--- ---
@@ -54,7 +66,7 @@ Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft <contact@kunzisoft.com>.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,

View File

@@ -0,0 +1,396 @@
Attribution 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution 4.0 International Public License ("Public License"). To the
extent this Public License may be interpreted as a contract, You are
granted the Licensed Rights in consideration of Your acceptance of
these terms and conditions, and the Licensor grants You such rights in
consideration of benefits the Licensor receives from making the
Licensed Material available under these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
d. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
g. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's
License You apply must not prevent recipients of the Adapted
Material from complying with this Public License.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.

View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
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.

View File

@@ -1,43 +1,48 @@
# Android Keepass DX # Android Keepass DX
<img src="https://raw.githubusercontent.com/Kunzisoft/KeePassDX/master/fastlane/metadata/android/en-US/images/icon.png"> Keepass DX is a material design Keepass Client for manage keys and passwords in crypt database for your android device. <img src="https://raw.githubusercontent.com/Kunzisoft/KeePassDX/master/art/icon.png"> Keepass DX is a **multi-format KeePass manager for Android devices**. The application allows to create keys and passwords in a secure way by integrating with the Android design standards.
<img src="https://raw.githubusercontent.com/Kunzisoft/KeePassDX/master/art/screen.jpg" width="220">
### Features ### Features
* Create database files / entries and groups * Create database files / entries and groups
* Support for .kdb and .kdbx files (version 1 to 4) * Support for **.kdb** and **.kdbx** files (version 1 to 4) with AES - Twofish - ChaCha20 - Argon2 algorithm
* Open database, copy username / password, open URI / URL * **Compatible** with the majority of alternative programs (KeePass, KeePassX, KeePass XC...)
* Fingerprint for fast unlocking * Allows **fast copy** of fields and opening of URI / URL
* Material design with themes * **Fingerprint** for fast unlocking
* AutoFill and Integration (Development in progress) * Material design with **themes**
* Precise management of settings * **AutoFill** and Integration
* Field filling **keyboard**
* Precise management of **settings**
<img src="https://raw.githubusercontent.com/Kunzisoft/KeePassDX/master/fastlane/metadata/android/en-US/images/phoneScreenshots/screen1.jpg" width="220"> Keepass DX is **open source** and **ad-free**.
<img src="https://raw.githubusercontent.com/Kunzisoft/KeePassDX/master/fastlane/metadata/android/en-US/images/phoneScreenshots/screen2.jpg" width="220">
## What is KeePass? ## What is KeePass DX?
Today you need to remember many passwords. You need a password for the Windows network logon, your e-mail account, your website's FTP password, online passwords (like website member account), etc. etc. etc. The list is endless. Also, you should use different passwords for each account. Because if you use only one password everywhere and someone gets this password you have a problem... A serious problem. The thief would have access to your e-mail account, website, etc. Unimaginable. Today you need to remember many passwords. You need a password for your e-mail account, your website's FTP password, online passwords (like website member account), etc. etc. etc. The list is endless. Also, you **should use different passwords for each account**. Because if you use only one password everywhere and someone gets this password you have a problem... A serious problem. The thief would have access to your e-mail account, website, etc. Unimaginable.
KeePass is a free open source password manager, which helps you to manage your passwords in a secure way. You can put all your passwords in one database, which is locked with one master key or a key file. So you only have to remember one single master password or select the key file to unlock the whole database. The databases are encrypted using the best and most secure encryption algorithms currently known (AES and Twofish). For more information, see the features page. KeePass DX is a **free open source password manager for Android**, which helps you to **manage your passwords in a secure way**. You can put all your passwords in one database, which is locked with one **master key** or a **key file**. So you **only have to remember one single master password or select the key file** to unlock the whole database. The databases are encrypted using the best and **most secure encryption algorithms** currently known.
## Is it really free? ## Is it really free?
Yes, KeePass is really free, and more than that: it is open source (OSI certified). You can have a look at its full source and check whether the encryption algorithms are implemented correctly. Yes, KeePass DX is under **free license (OSI certified)** and **without advertising**. You can have a look at its full source and check whether the encryption algorithms are implemented correctly.
## Donation *Note : If you access the application from a store, visual features may not be available to incentivize the contribution to the work of open source projects. These optional visuals are accessible after a donation (and a small congratulation message :) or the purchase of an extended version, but do not worry, the main features remain completely free.*
Even if the application is free, to maintain the application, you can make donations. ## Contributions
[![Donation Paypal](https://4.bp.blogspot.com/-ncaIbUGaHOk/WfhaThYUPGI/AAAAAAAAAVQ/_HidNgdB1q4DaC24ujaKNzH64KUUJiQewCLcBGAs/s1600/pay-with-paypal.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KM6QMDAXZM3UU "Kunzisoft Paypal Donation") You can contribute in different ways to help us on our work.
[![Donation Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/Kunzisoft/donate "Kunzisoft Liberapay Donation") * Add features by a **[pull request](https://help.github.com/articles/about-pull-requests/)**.
* Help to **[translate](https://hosted.weblate.org/projects/keepass-dx/strings/)** into your language (By using [Weblate](https://hosted.weblate.org/projects/keepass-dx/) or with a manual [pull request](https://help.github.com/articles/about-pull-requests/))
<img src="https://raw.githubusercontent.com/Kunzisoft/KeePassDX/master/fastlane/metadata/android/en-US/images/phoneScreenshots/screen4.jpg" width="220"> * **[Donate](https://www.kunzisoft.com/donation)** 人◕ ‿‿ ◕人Y for a better service and a quick development of your features.
<img src="https://raw.githubusercontent.com/Kunzisoft/KeePassDX/master/fastlane/metadata/android/en-US/images/phoneScreenshots/screen5.jpg" width="220"> * Buy the **[Pro version](https://play.google.com/store/apps/details?id=com.kunzisoft.keepass.pro)** of KeePass DX
## Download ## Download
*We recommend the installation from [F-Droid](https://f-droid.org/en/packages/com.kunzisoft.keepass.libre/) which verifies that all libraries and application code are open source.*
[<img src="https://f-droid.org/badge/get-it-on.png" [<img src="https://f-droid.org/badge/get-it-on.png"
alt="Get it on F-Droid" alt="Get it on F-Droid"
height="80">](https://f-droid.org/en/packages/com.kunzisoft.keepass.libre/) height="80">](https://f-droid.org/en/packages/com.kunzisoft.keepass.libre/)
@@ -45,16 +50,26 @@ Even if the application is free, to maintain the application, you can make donat
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" [<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png"
alt="Get it on Google Play" alt="Get it on Google Play"
height="80">](https://play.google.com/store/apps/details?id=com.kunzisoft.keepass.free) height="80">](https://play.google.com/store/apps/details?id=com.kunzisoft.keepass.free)
## F.A.Q.
Other questions? You can read the [F.A.Q.](https://github.com/Kunzisoft/KeePassDX/blob/master/FAQ.md)
## Other devices
- [KeePass XC](https://keepassxc.org/) (https://keepassxc.org/) works with **GNU/Linux**, **Mac** and **Windows**, is updated regularly and under the terms of the GNU General Public License. This is the recommended version for computers.
- [KeePass](https://keepass.info/) (https://keepass.info/) is the historical project, with good technical documentation for standardized database files but only running on **Windows**.
## License ## License
Copyright (c) 2017 Jeremy Jamet / Kunzisoft. Copyright (c) 2017 Jeremy Jamet / [Kunzisoft](https://www.kunzisoft.com).
This file is part of KeePass DX. This file is part of KeePass DX.
KeePass DX is free software: you can redistribute it and/or modify KeePass DX is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
KeePass DX is distributed in the hope that it will be useful, KeePass DX is distributed in the hope that it will be useful,
@@ -65,4 +80,4 @@ Even if the application is free, to maintain the application, you can make donat
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
This project is a fork of [KeepassDroid](https://github.com/bpellin/keepassdroid) by bpellin. *This project is a fork of [KeepassDroid](https://github.com/bpellin/keepassdroid) by bpellin.*

View File

@@ -1,24 +1,21 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion = 27 compileSdkVersion 27
buildToolsVersion = "27.0.3" buildToolsVersion '27.0.3'
defaultConfig { defaultConfig {
applicationId "com.kunzisoft.keepass" applicationId "com.kunzisoft.keepass"
minSdkVersion 14 minSdkVersion 15
targetSdkVersion 27 targetSdkVersion 27
versionCode = 6 versionCode = 13
versionName = "2.5.0.0beta6" versionName = "2.5.0.0beta13"
multiDexEnabled true multiDexEnabled true
testApplicationId = "com.keepassdroid.tests" testApplicationId = "com.kunzisoft.keepass.tests"
testInstrumentationRunner = "android.test.InstrumentationTestRunner" testInstrumentationRunner = "android.test.InstrumentationTestRunner"
ndk { buildConfigField "String[]", "ICON_PACKS", "{\"classic\",\"material\"}"
abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a',
'arm64-v8a', 'mips', 'mips64'
}
} }
externalNativeBuild { externalNativeBuild {
@@ -44,28 +41,42 @@ android {
applicationIdSuffix = ".libre" applicationIdSuffix = ".libre"
versionNameSuffix "-libre" versionNameSuffix "-libre"
buildConfigField "boolean", "FULL_VERSION", "true" buildConfigField "boolean", "FULL_VERSION", "true"
buildConfigField "boolean", "GOOGLE_PLAY_VERSION", "false" buildConfigField "boolean", "CLOSED_STORE", "false"
buildConfigField "String[]", "STYLES_DISABLED", "{\"KeepassDXStyle_Dark\",\"KeepassDXStyle_Red\",\"KeepassDXStyle_Purple\"}"
buildConfigField "String[]", "ICON_PACKS_DISABLED", "{}"
} }
pro_google { pro {
applicationIdSuffix = ".pro" applicationIdSuffix = ".pro"
versionNameSuffix "-pro" versionNameSuffix "-pro"
buildConfigField "boolean", "FULL_VERSION", "true" buildConfigField "boolean", "FULL_VERSION", "true"
buildConfigField "boolean", "GOOGLE_PLAY_VERSION", "true" buildConfigField "boolean", "CLOSED_STORE", "true"
buildConfigField "String[]", "STYLES_DISABLED", "{}"
buildConfigField "String[]", "ICON_PACKS_DISABLED", "{}"
} }
free_google { free {
applicationIdSuffix = ".free" applicationIdSuffix = ".free"
versionNameSuffix "-free" versionNameSuffix "-free"
buildConfigField "boolean", "FULL_VERSION", "false" buildConfigField "boolean", "FULL_VERSION", "false"
buildConfigField "boolean", "GOOGLE_PLAY_VERSION", "true" buildConfigField "boolean", "CLOSED_STORE", "true"
buildConfigField "String[]", "STYLES_DISABLED", "{\"KeepassDXStyle_Dark\",\"KeepassDXStyle_Blue\",\"KeepassDXStyle_Red\",\"KeepassDXStyle_Purple\"}"
buildConfigField "String[]", "ICON_PACKS_DISABLED", "{}"
} }
} }
sourceSets {
libre.res.srcDir 'src/libre/res'
pro.res.srcDir 'src/pro/res'
free.res.srcDir 'src/free/res'
}
compileOptions { compileOptions {
targetCompatibility 1.8 targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility 1.8 sourceCompatibility JavaVersion.VERSION_1_8
} }
} }
def supportVersion = "27.1.0" def supportVersion = "27.1.1"
def spongycastleVersion = "1.58.0.0" def spongycastleVersion = "1.58.0.0"
def permissionDispatcherVersion = "3.1.0" def permissionDispatcherVersion = "3.1.0"
@@ -77,16 +88,28 @@ dependencies {
implementation "com.android.support:cardview-v7:$supportVersion" implementation "com.android.support:cardview-v7:$supportVersion"
implementation "com.madgag.spongycastle:core:$spongycastleVersion" implementation "com.madgag.spongycastle:core:$spongycastleVersion"
implementation "com.madgag.spongycastle:prov:$spongycastleVersion" implementation "com.madgag.spongycastle:prov:$spongycastleVersion"
// Expandable view
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
// Time // Time
implementation "joda-time:joda-time:2.9.9" implementation 'joda-time:joda-time:2.9.9'
implementation "org.sufficientlysecure:html-textview:3.5" implementation 'org.sufficientlysecure:html-textview:3.5'
implementation "com.nononsenseapps:filepicker:4.1.0" implementation 'com.nononsenseapps:filepicker:4.1.0'
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.11.0'
// Permissions // Permissions
implementation ("com.github.hotchemi:permissionsdispatcher:$permissionDispatcherVersion") { implementation("com.github.hotchemi:permissionsdispatcher:$permissionDispatcherVersion") {
// if you don't use android.app.Fragment you can exclude support for them // if you don't use android.app.Fragment you can exclude support for them
exclude module: "support-v13" exclude module: "support-v13"
} }
annotationProcessor "com.github.hotchemi:permissionsdispatcher-processor:$permissionDispatcherVersion" annotationProcessor "com.github.hotchemi:permissionsdispatcher-processor:$permissionDispatcherVersion"
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.1' // Apache Commons Collections
implementation group: 'com.google.guava', name: 'guava', version: '23.0-android' implementation 'commons-collections:commons-collections:3.2.1'
// Base64
implementation 'biz.source_code:base64coder:2010-12-19'
implementation 'com.google.code.gson:gson:2.8.4'
implementation 'com.google.guava:guava:23.0-android'
// Icon pack, classic for all, material for libre and pro
implementation project(path: ':icon-pack-classic')
implementation project(path: ':icon-pack-material')
implementation project(path: ':magikeyboard')
implementation project(path: ':keepass-model')
} }

View File

@@ -1,66 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.tests;
import java.util.UUID;
import junit.framework.TestCase;
import com.keepassdroid.database.PwEntryV4;
import com.keepassdroid.database.PwGroupV4;
import com.keepassdroid.database.PwIconCustom;
import com.keepassdroid.database.PwIconStandard;
import com.keepassdroid.database.security.ProtectedBinary;
import com.keepassdroid.database.security.ProtectedString;
public class PwEntryTestV4 extends TestCase {
public void testAssign() {
PwEntryV4 entry = new PwEntryV4();
entry.additional = "test223";
entry.autoType = entry.new AutoType();
entry.autoType.defaultSequence = "1324";
entry.autoType.enabled = true;
entry.autoType.obfuscationOptions = 123412432109L;
entry.autoType.put("key", "value");
entry.backgroupColor = "blue";
entry.binaries.put("key1", new ProtectedBinary(false, new byte[] {0,1}));
entry.customIcon = new PwIconCustom(UUID.randomUUID(), new byte[0]);
entry.foregroundColor = "red";
entry.history.add(new PwEntryV4());
entry.icon = new PwIconStandard(5);
entry.overrideURL = "override";
entry.parent = new PwGroupV4();
entry.addField("key2", new ProtectedString(false, "value2"));
entry.url = "http://localhost";
entry.uuid = UUID.randomUUID();
PwEntryV4 target = new PwEntryV4();
target.assign(entry);
/* This test is not so useful now that I am not implementing value equality for Entries
assertTrue("Entries do not match.", entry.equals(target));
*/
}
}

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,11 +17,11 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests; package com.kunzisoft.keepass.tests;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import com.keepassdroid.tests.database.TestData; import com.kunzisoft.keepass.tests.database.TestData;
public class AccentTest extends AndroidTestCase { public class AccentTest extends AndroidTestCase {

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests; package com.kunzisoft.keepass.tests;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestSuite; import junit.framework.TestSuite;

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests; package com.kunzisoft.keepass.tests;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestSuite; import junit.framework.TestSuite;
@@ -29,7 +29,7 @@ public class OutputTests extends TestSuite {
public static Test suite() { public static Test suite() {
return new TestSuiteBuilder(AllTests.class) return new TestSuiteBuilder(AllTests.class)
.includePackages("com.keepassdroid.tests.output") .includePackages("com.kunzisoft.keepass.tests.output")
.build(); .build();
} }
} }

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,11 +17,11 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests; package com.kunzisoft.keepass.tests;
import junit.framework.TestCase; import junit.framework.TestCase;
import com.keepassdroid.database.PwDate; import com.kunzisoft.keepass.database.PwDate;
public class PwDateTest extends TestCase { public class PwDateTest extends TestCase {
public void testDate() { public void testDate() {

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests; package com.kunzisoft.keepass.tests;
import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertArrayEquals;
@@ -27,8 +27,8 @@ import java.util.Calendar;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import com.keepassdroid.database.PwEntryV3; import com.kunzisoft.keepass.database.PwEntryV3;
import com.keepassdroid.tests.database.TestData; import com.kunzisoft.keepass.tests.database.TestData;
public class PwEntryTestV3 extends AndroidTestCase { public class PwEntryTestV3 extends AndroidTestCase {
PwEntryV3 mPE; PwEntryV3 mPE;
@@ -37,12 +37,12 @@ public class PwEntryTestV3 extends AndroidTestCase {
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
mPE = (PwEntryV3) TestData.GetTest1(getContext()).entries.get(0); mPE = (PwEntryV3) TestData.GetTest1(getContext()).getEntryAt(0);
} }
public void testName() { public void testName() {
assertTrue("Name was " + mPE.title, mPE.title.equals("Amazon")); assertTrue("Name was " + mPE.getTitle(), mPE.getTitle().equals("Amazon"));
} }
public void testPassword() throws UnsupportedEncodingException { public void testPassword() throws UnsupportedEncodingException {
@@ -54,7 +54,7 @@ public class PwEntryTestV3 extends AndroidTestCase {
public void testCreation() { public void testCreation() {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(mPE.tCreation.getJDate()); cal.setTime(mPE.getCreationTime().getDate());
assertEquals("Incorrect year.", cal.get(Calendar.YEAR), 2009); assertEquals("Incorrect year.", cal.get(Calendar.YEAR), 2009);
assertEquals("Incorrect month.", cal.get(Calendar.MONTH), 3); assertEquals("Incorrect month.", cal.get(Calendar.MONTH), 3);

View File

@@ -0,0 +1,67 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.kunzisoft.keepass.tests;
import com.kunzisoft.keepass.database.AutoType;
import com.kunzisoft.keepass.database.PwEntryV4;
import com.kunzisoft.keepass.database.PwGroupV4;
import com.kunzisoft.keepass.database.PwIconCustom;
import com.kunzisoft.keepass.database.PwIconStandard;
import com.kunzisoft.keepass.database.security.ProtectedBinary;
import com.kunzisoft.keepass.database.security.ProtectedString;
import junit.framework.TestCase;
import java.util.UUID;
public class PwEntryTestV4 extends TestCase {
public void testAssign() {
PwEntryV4 entry = new PwEntryV4();
entry.setAdditional("test223");
entry.setAutoType(new AutoType());
entry.getAutoType().defaultSequence = "1324";
entry.getAutoType().enabled = true;
entry.getAutoType().obfuscationOptions = 123412432109L;
entry.getAutoType().put("key", "value");
entry.setBackgroupColor("blue");
entry.putProtectedBinary("key1", new ProtectedBinary(false, new byte[] {0,1}));
entry.setCustomIcon(new PwIconCustom(UUID.randomUUID(), new byte[0]));
entry.setForegroundColor("red");
entry.addToHistory(new PwEntryV4());
entry.setIcon(new PwIconStandard(5));
entry.setOverrideURL("override");
entry.setParent(new PwGroupV4());
entry.addExtraField("key2", new ProtectedString(false, "value2"));
entry.setUrl("http://localhost");
entry.setUUID(UUID.randomUUID());
PwEntryV4 target = new PwEntryV4();
target.updateWith(entry);
/* This test is not so useful now that I am not implementing value equality for Entries
assertTrue("Entries do not match.", entry.equals(target));
*/
}
}

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,13 +17,13 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests; package com.kunzisoft.keepass.tests;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import com.keepassdroid.database.PwGroupV3; import com.kunzisoft.keepass.database.PwGroupV3;
import com.keepassdroid.tests.database.TestData; import com.kunzisoft.keepass.tests.database.TestData;
public class PwGroupTest extends AndroidTestCase { public class PwGroupTest extends AndroidTestCase {
@@ -38,7 +38,7 @@ public class PwGroupTest extends AndroidTestCase {
} }
public void testGroupName() { public void testGroupName() {
assertTrue("Name was " + mPG.name, mPG.name.equals("Internet")); assertTrue("Name was " + mPG.getName(), mPG.getName().equals("Internet"));
} }
} }

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests; package com.kunzisoft.keepass.tests;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
@@ -29,8 +29,8 @@ import android.content.res.AssetManager;
import android.net.Uri; import android.net.Uri;
import android.os.Environment; import android.os.Environment;
import com.keepassdroid.utils.EmptyUtils; import com.kunzisoft.keepass.utils.EmptyUtils;
import com.keepassdroid.utils.UriUtil; import com.kunzisoft.keepass.utils.UriUtil;
public class TestUtil { public class TestUtil {
private static final File sdcard = Environment.getExternalStorageDirectory(); private static final File sdcard = Environment.getExternalStorageDirectory();

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests; package com.kunzisoft.keepass.tests;
import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertArrayEquals;
@@ -28,10 +28,10 @@ import java.util.UUID;
import junit.framework.TestCase; import junit.framework.TestCase;
import com.keepassdroid.database.PwDate; import com.kunzisoft.keepass.database.PwDate;
import com.keepassdroid.stream.LEDataInputStream; import com.kunzisoft.keepass.stream.LEDataInputStream;
import com.keepassdroid.stream.LEDataOutputStream; import com.kunzisoft.keepass.stream.LEDataOutputStream;
import com.keepassdroid.utils.Types; import com.kunzisoft.keepass.utils.Types;
public class TypesTest extends TestCase { public class TypesTest extends TestCase {

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,9 +17,11 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.crypto; package com.kunzisoft.keepass.tests.crypto;
import static org.junit.Assert.assertArrayEquals; import com.kunzisoft.keepass.crypto.CipherFactory;
import junit.framework.TestCase;
import java.security.InvalidAlgorithmParameterException; import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException; import java.security.InvalidKeyException;
@@ -33,9 +35,7 @@ import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec; import javax.crypto.spec.SecretKeySpec;
import junit.framework.TestCase; import static org.junit.Assert.assertArrayEquals;
import com.keepassdroid.crypto.CipherFactory;
public class AESTest extends TestCase { public class AESTest extends TestCase {

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.crypto; package com.kunzisoft.keepass.tests.crypto;
import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertArrayEquals;
@@ -37,11 +37,11 @@ import javax.crypto.NoSuchPaddingException;
import junit.framework.TestCase; import junit.framework.TestCase;
import com.keepassdroid.crypto.CipherFactory; import com.kunzisoft.keepass.crypto.CipherFactory;
import com.keepassdroid.crypto.engine.AesEngine; import com.kunzisoft.keepass.crypto.engine.AesEngine;
import com.keepassdroid.crypto.engine.CipherEngine; import com.kunzisoft.keepass.crypto.engine.CipherEngine;
import com.keepassdroid.stream.BetterCipherInputStream; import com.kunzisoft.keepass.stream.BetterCipherInputStream;
import com.keepassdroid.stream.LEDataInputStream; import com.kunzisoft.keepass.stream.LEDataInputStream;
public class CipherTest extends TestCase { public class CipherTest extends TestCase {
private Random rand = new Random(); private Random rand = new Random();

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.crypto; package com.kunzisoft.keepass.tests.crypto;
import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertArrayEquals;
@@ -26,8 +26,8 @@ import java.util.Random;
import junit.framework.TestCase; import junit.framework.TestCase;
import com.keepassdroid.crypto.finalkey.AndroidFinalKey; import com.kunzisoft.keepass.crypto.finalkey.AndroidFinalKey;
import com.keepassdroid.crypto.finalkey.NativeFinalKey; import com.kunzisoft.keepass.crypto.finalkey.NativeFinalKey;
public class FinalKeyTest extends TestCase { public class FinalKeyTest extends TestCase {
private Random mRand; private Random mRand;

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,20 +17,21 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.database; package com.kunzisoft.keepass.tests.database;
import java.util.List;
import android.content.Context; import android.content.Context;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import com.keepassdroid.database.Database; import com.kunzisoft.keepass.database.Database;
import com.keepassdroid.database.PwDatabase; import com.kunzisoft.keepass.database.PwDatabase;
import com.keepassdroid.database.PwDatabaseV3; import com.kunzisoft.keepass.database.PwDatabaseV3;
import com.keepassdroid.database.PwEntry; import com.kunzisoft.keepass.database.PwEntry;
import com.keepassdroid.database.PwGroup; import com.kunzisoft.keepass.database.PwEntryV3;
import com.keepassdroid.database.edit.DeleteGroup; import com.kunzisoft.keepass.database.PwGroup;
import com.keepassdroid.search.SearchDbHelper; import com.kunzisoft.keepass.database.action.node.DeleteGroupRunnable;
import com.kunzisoft.keepass.search.SearchDbHelper;
import java.util.List;
public class DeleteEntry extends AndroidTestCase { public class DeleteEntry extends AndroidTestCase {
private static final String GROUP1_NAME = "Group1"; private static final String GROUP1_NAME = "Group1";
@@ -54,12 +55,12 @@ public class DeleteEntry extends AndroidTestCase {
return; return;
} }
PwDatabaseV3 pm = (PwDatabaseV3) db.pm; PwDatabaseV3 pm = (PwDatabaseV3) db.getPwDatabase();
PwGroup group1 = getGroup(pm, GROUP1_NAME); PwGroup group1 = getGroup(pm, GROUP1_NAME);
assertNotNull("Could not find group1", group1); assertNotNull("Could not find group1", group1);
// Delete the group // Delete the group
DeleteGroup task = new DeleteGroup(db, group1, null, true); DeleteGroupRunnable task = new DeleteGroupRunnable(null, db, group1, null, true);
task.run(); task.run();
// Verify the entries were deleted // Verify the entries were deleted
@@ -71,8 +72,8 @@ public class DeleteEntry extends AndroidTestCase {
// Verify the entries were removed from the search index // Verify the entries were removed from the search index
SearchDbHelper dbHelp = new SearchDbHelper(ctx); SearchDbHelper dbHelp = new SearchDbHelper(ctx);
PwGroup results1 = dbHelp.search(db, ENTRY1_NAME); PwGroup results1 = dbHelp.search(db.getPwDatabase(), ENTRY1_NAME);
PwGroup results2 = dbHelp.search(db, ENTRY2_NAME); PwGroup results2 = dbHelp.search(db.getPwDatabase(), ENTRY2_NAME);
assertEquals("Entry1 was not removed from the search results", 0, results1.numbersOfChildEntries()); assertEquals("Entry1 was not removed from the search results", 0, results1.numbersOfChildEntries());
assertEquals("Entry2 was not removed from the search results", 0, results2.numbersOfChildEntries()); assertEquals("Entry2 was not removed from the search results", 0, results2.numbersOfChildEntries());
@@ -80,15 +81,13 @@ public class DeleteEntry extends AndroidTestCase {
// Verify the group was deleted // Verify the group was deleted
group1 = getGroup(pm, GROUP1_NAME); group1 = getGroup(pm, GROUP1_NAME);
assertNull("Group 1 was not removed.", group1); assertNull("Group 1 was not removed.", group1);
} }
private PwEntry getEntry(PwDatabaseV3 pm, String name) { private PwEntryV3 getEntry(PwDatabaseV3 pm, String name) {
List<PwEntry> entries = pm.entries; List<PwEntryV3> entries = pm.getEntries();
for ( int i = 0; i < entries.size(); i++ ) { for ( int i = 0; i < entries.size(); i++ ) {
PwEntry entry = entries.get(i); PwEntryV3 entry = entries.get(i);
if ( entry.getTitle().equals(name) ) { if ( entry.getTitle().equals(name) ) {
return entry; return entry;
} }

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,34 +17,36 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.database; package com.kunzisoft.keepass.tests.database;
import junit.framework.TestCase; import junit.framework.TestCase;
import com.keepassdroid.database.PwDatabaseV4; import com.kunzisoft.keepass.database.PwDatabaseV4;
import com.keepassdroid.database.PwEntryV4; import com.kunzisoft.keepass.database.PwEntryV4;
public class EntryV4 extends TestCase { public class EntryV4 extends TestCase {
public void testBackup() { public void testBackup() {
PwDatabaseV4 db = new PwDatabaseV4(); PwDatabaseV4 db = new PwDatabaseV4();
db.historyMaxItems = 2; db.setHistoryMaxItems(2);
PwEntryV4 entry = new PwEntryV4(); PwEntryV4 entry = new PwEntryV4();
entry.setTitle("Title1", db); entry.startToManageFieldReferences(db);
entry.setUsername("User1", db); entry.setTitle("Title1");
entry.setUsername("User1");
entry.createBackup(db); entry.createBackup(db);
entry.setTitle("Title2", db); entry.setTitle("Title2");
entry.setUsername("User2", db); entry.setUsername("User2");
entry.createBackup(db); entry.createBackup(db);
entry.setTitle("Title3", db); entry.setTitle("Title3");
entry.setUsername("User3", db); entry.setUsername("User3");
entry.createBackup(db); entry.createBackup(db);
PwEntryV4 backup = entry.history.get(0); PwEntryV4 backup = entry.getHistory().get(0);
entry.endToManageFieldReferences();
assertEquals("Title2", backup.getTitle()); assertEquals("Title2", backup.getTitle());
assertEquals("User2", backup.getUsername()); assertEquals("User2", backup.getUsername());
} }

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.database; package com.kunzisoft.keepass.tests.database;
import android.content.Context; import android.content.Context;
import android.content.res.AssetManager; import android.content.res.AssetManager;
@@ -25,9 +25,9 @@ import android.net.Uri;
import android.os.Environment; import android.os.Environment;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import com.keepassdroid.database.load.ImporterV3; import com.kunzisoft.keepass.database.load.ImporterV3;
import com.keepassdroid.tests.TestUtil; import com.kunzisoft.keepass.tests.TestUtil;
import com.keepassdroid.utils.UriUtil; import com.kunzisoft.keepass.utils.UriUtil;
import java.io.InputStream; import java.io.InputStream;
import java.io.File; import java.io.File;

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.database; package com.kunzisoft.keepass.tests.database;
import java.io.InputStream; import java.io.InputStream;
@@ -25,9 +25,9 @@ import android.content.Context;
import android.content.res.AssetManager; import android.content.res.AssetManager;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import com.keepassdroid.database.PwDatabaseV3; import com.kunzisoft.keepass.database.PwDatabaseV3;
import com.keepassdroid.database.PwEncryptionAlgorithm; import com.kunzisoft.keepass.database.PwEncryptionAlgorithm;
import com.keepassdroid.database.load.ImporterV3; import com.kunzisoft.keepass.database.load.ImporterV3;
public class Kdb3Twofish extends AndroidTestCase { public class Kdb3Twofish extends AndroidTestCase {
public void testReadTwofish() throws Exception { public void testReadTwofish() throws Exception {
@@ -40,10 +40,9 @@ public class Kdb3Twofish extends AndroidTestCase {
PwDatabaseV3 db = importer.openDatabase(is, "12345", null); PwDatabaseV3 db = importer.openDatabase(is, "12345", null);
assertTrue(db.algorithm == PwEncryptionAlgorithm.Twofish); assertTrue(db.getEncryptionAlgorithm() == PwEncryptionAlgorithm.Twofish);
is.close(); is.close();
} }
} }

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.database; package com.kunzisoft.keepass.tests.database;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@@ -29,16 +29,16 @@ import android.content.Context;
import android.content.res.AssetManager; import android.content.res.AssetManager;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import com.keepassdroid.database.PwDatabaseV4; import com.kunzisoft.keepass.database.PwDatabaseV4;
import com.keepassdroid.database.exception.InvalidDBException; import com.kunzisoft.keepass.database.exception.InvalidDBException;
import com.keepassdroid.database.exception.PwDbOutputException; import com.kunzisoft.keepass.database.exception.PwDbOutputException;
import com.keepassdroid.database.load.Importer; import com.kunzisoft.keepass.database.load.Importer;
import com.keepassdroid.database.load.ImporterFactory; import com.kunzisoft.keepass.database.load.ImporterFactory;
import com.keepassdroid.database.load.ImporterV4; import com.kunzisoft.keepass.database.load.ImporterV4;
import com.keepassdroid.database.save.PwDbOutput; import com.kunzisoft.keepass.database.save.PwDbOutput;
import com.keepassdroid.database.save.PwDbV4Output; import com.kunzisoft.keepass.database.save.PwDbV4Output;
import com.keepassdroid.stream.CopyInputStream; import com.kunzisoft.keepass.stream.CopyInputStream;
import com.keepassdroid.tests.TestUtil; import com.kunzisoft.keepass.tests.TestUtil;
public class Kdb4 extends AndroidTestCase { public class Kdb4 extends AndroidTestCase {

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,18 +17,17 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.database; package com.kunzisoft.keepass.tests.database;
import java.io.InputStream;
import android.content.Context; import android.content.Context;
import android.content.res.AssetManager; import android.content.res.AssetManager;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import com.keepassdroid.crypto.CipherFactory; import com.kunzisoft.keepass.crypto.engine.AesEngine;
import com.keepassdroid.crypto.engine.AesEngine; import com.kunzisoft.keepass.database.PwDatabaseV4;
import com.keepassdroid.database.PwDatabaseV4; import com.kunzisoft.keepass.database.load.ImporterV4;
import com.keepassdroid.database.load.ImporterV4;
import java.io.InputStream;
public class Kdb4Header extends AndroidTestCase { public class Kdb4Header extends AndroidTestCase {
public void testReadHeader() throws Exception { public void testReadHeader() throws Exception {
@@ -41,9 +40,9 @@ public class Kdb4Header extends AndroidTestCase {
PwDatabaseV4 db = importer.openDatabase(is, "12345", null); PwDatabaseV4 db = importer.openDatabase(is, "12345", null);
assertEquals(6000, db.numKeyEncRounds); assertEquals(6000, db.getNumberKeyEncryptionRounds());
assertTrue(db.dataCipher.equals(AesEngine.CIPHER_UUID)); assertTrue(db.getDataCipher().equals(AesEngine.CIPHER_UUID));
is.close(); is.close();

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.database; package com.kunzisoft.keepass.tests.database;
import java.io.InputStream; import java.io.InputStream;
import java.util.UUID; import java.util.UUID;
@@ -27,15 +27,16 @@ import android.content.res.AssetManager;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import biz.source_code.base64Coder.Base64Coder; import biz.source_code.base64Coder.Base64Coder;
import com.keepassdroid.database.PwDatabaseV4; import com.kunzisoft.keepass.database.PwDatabase;
import com.keepassdroid.database.PwEntryV4; import com.kunzisoft.keepass.database.PwDatabaseV4;
import com.keepassdroid.database.load.ImporterV4; import com.kunzisoft.keepass.database.PwEntryV4;
import com.keepassdroid.utils.SprEngine; import com.kunzisoft.keepass.database.load.ImporterV4;
import com.keepassdroid.utils.Types; import com.kunzisoft.keepass.utils.SprEngineV4;
import com.kunzisoft.keepass.utils.Types;
public class SprEngineTest extends AndroidTestCase { public class SprEngineTest extends AndroidTestCase {
private PwDatabaseV4 db; private PwDatabaseV4 db;
private SprEngine spr; private SprEngineV4 spr;
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
@@ -51,7 +52,7 @@ public class SprEngineTest extends AndroidTestCase {
is.close(); is.close();
spr = SprEngine.getInstance(db); spr = new SprEngineV4();
} }
private final String REF = "{REF:P@I:2B1D56590D961F48A8CE8C392CE6CD35}"; private final String REF = "{REF:P@I:2B1D56590D961F48A8CE8C392CE6CD35}";
@@ -60,7 +61,7 @@ public class SprEngineTest extends AndroidTestCase {
public void testRefReplace() { public void testRefReplace() {
UUID entryUUID = decodeUUID(ENCODE_UUID); UUID entryUUID = decodeUUID(ENCODE_UUID);
PwEntryV4 entry = (PwEntryV4) db.entries.get(entryUUID); PwEntryV4 entry = (PwEntryV4) db.getEntryByUUIDId(entryUUID);
assertEquals(RESULT, spr.compile(REF, entry, db)); assertEquals(RESULT, spr.compile(REF, entry, db));
@@ -69,7 +70,7 @@ public class SprEngineTest extends AndroidTestCase {
private UUID decodeUUID(String encoded) { private UUID decodeUUID(String encoded) {
if (encoded == null || encoded.length() == 0 ) { if (encoded == null || encoded.length() == 0 ) {
return PwDatabaseV4.UUID_ZERO; return PwDatabase.UUID_ZERO;
} }
byte[] buf = Base64Coder.decode(encoded); byte[] buf = Base64Coder.decode(encoded);

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.database; package com.kunzisoft.keepass.tests.database;
import java.io.InputStream; import java.io.InputStream;
@@ -25,10 +25,10 @@ import android.content.Context;
import android.content.res.AssetManager; import android.content.res.AssetManager;
import android.net.Uri; import android.net.Uri;
import com.keepassdroid.database.Database; import com.kunzisoft.keepass.database.Database;
import com.keepassdroid.database.PwDatabaseV3Debug; import com.kunzisoft.keepass.database.PwDatabaseV3Debug;
import com.keepassdroid.database.load.Importer; import com.kunzisoft.keepass.database.load.Importer;
import com.keepassdroid.tests.TestUtil; import com.kunzisoft.keepass.tests.TestUtil;
public class TestData { public class TestData {
private static final String TEST1_KEYFILE = ""; private static final String TEST1_KEYFILE = "";
@@ -58,10 +58,10 @@ public class TestData {
InputStream keyIs = TestUtil.getKeyFileInputStream(ctx, keyfile); InputStream keyIs = TestUtil.getKeyFileInputStream(ctx, keyfile);
Db.LoadData(ctx, is, password, keyIs, Importer.DEBUG); Db.loadData(ctx, is, password, keyIs, Importer.DEBUG);
Uri.Builder b = new Uri.Builder(); Uri.Builder b = new Uri.Builder();
Db.mUri = b.scheme("file").path(filename).build(); Db.setUri(b.scheme("file").path(filename).build());
return Db; return Db;
@@ -72,6 +72,6 @@ public class TestData {
GetDb1(ctx); GetDb1(ctx);
} }
return (PwDatabaseV3Debug) mDb1.pm; return (PwDatabaseV3Debug) mDb1.getPwDatabase();
} }
} }

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.output; package com.kunzisoft.keepass.tests.output;
import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertArrayEquals;
@@ -32,16 +32,16 @@ import java.security.NoSuchAlgorithmException;
import android.content.res.AssetManager; import android.content.res.AssetManager;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import com.keepassdroid.database.PwDatabaseV3Debug; import com.kunzisoft.keepass.database.PwDatabaseV3Debug;
import com.keepassdroid.database.PwDbHeader; import com.kunzisoft.keepass.database.PwDbHeader;
import com.keepassdroid.database.PwDbHeaderV3; import com.kunzisoft.keepass.database.PwDbHeaderV3;
import com.keepassdroid.database.exception.PwDbOutputException; import com.kunzisoft.keepass.database.exception.PwDbOutputException;
import com.keepassdroid.database.save.PwDbHeaderOutputV3; import com.kunzisoft.keepass.database.save.PwDbHeaderOutputV3;
import com.keepassdroid.database.save.PwDbV3Output; import com.kunzisoft.keepass.database.save.PwDbV3Output;
import com.keepassdroid.database.save.PwDbV3OutputDebug; import com.kunzisoft.keepass.database.save.PwDbV3OutputDebug;
import com.keepassdroid.stream.NullOutputStream; import com.kunzisoft.keepass.stream.NullOutputStream;
import com.keepassdroid.tests.TestUtil; import com.kunzisoft.keepass.tests.TestUtil;
import com.keepassdroid.tests.database.TestData; import com.kunzisoft.keepass.tests.database.TestData;
public class PwManagerOutputTest extends AndroidTestCase { public class PwManagerOutputTest extends AndroidTestCase {
PwDatabaseV3Debug mPM; PwDatabaseV3Debug mPM;
@@ -60,7 +60,7 @@ public class PwManagerOutputTest extends AndroidTestCase {
pos.outputPlanGroupAndEntries(bos); pos.outputPlanGroupAndEntries(bos);
assertTrue("No output", bos.toByteArray().length > 0); assertTrue("No output", bos.toByteArray().length > 0);
assertArrayEquals("Group and entry output doesn't match.", mPM.postHeader, bos.toByteArray()); assertArrayEquals("Group and entry output doesn't match.", mPM.getPostHeader(), bos.toByteArray());
} }
@@ -77,7 +77,7 @@ public class PwManagerOutputTest extends AndroidTestCase {
byte[] digest = md.digest(); byte[] digest = md.digest();
assertTrue("No output", digest.length > 0); assertTrue("No output", digest.length > 0);
assertArrayEquals("Hash of groups and entries failed.", mPM.dbHeader.contentsHash, digest); assertArrayEquals("Hash of groups and entries failed.", mPM.getDbHeader().contentsHash, digest);
} }
private void assertHeadersEquals(PwDbHeaderV3 expected, PwDbHeaderV3 actual) { private void assertHeadersEquals(PwDbHeaderV3 expected, PwDbHeaderV3 actual) {
@@ -100,10 +100,10 @@ public class PwManagerOutputTest extends AndroidTestCase {
PwDbHeaderV3 header = pActual.outputHeader(bActual); PwDbHeaderV3 header = pActual.outputHeader(bActual);
ByteArrayOutputStream bExpected = new ByteArrayOutputStream(); ByteArrayOutputStream bExpected = new ByteArrayOutputStream();
PwDbHeaderOutputV3 outExpected = new PwDbHeaderOutputV3(mPM.dbHeader, bExpected); PwDbHeaderOutputV3 outExpected = new PwDbHeaderOutputV3(mPM.getDbHeader(), bExpected);
outExpected.output(); outExpected.output();
assertHeadersEquals(mPM.dbHeader, header); assertHeadersEquals(mPM.getDbHeader(), header);
assertTrue("No output", bActual.toByteArray().length > 0); assertTrue("No output", bActual.toByteArray().length > 0);
assertArrayEquals("Header does not match.", bExpected.toByteArray(), bActual.toByteArray()); assertArrayEquals("Header does not match.", bExpected.toByteArray(), bActual.toByteArray());
} }
@@ -114,7 +114,7 @@ public class PwManagerOutputTest extends AndroidTestCase {
PwDbHeader hActual = pActual.outputHeader(bActual); PwDbHeader hActual = pActual.outputHeader(bActual);
byte[] finalKey = pActual.getFinalKey(hActual); byte[] finalKey = pActual.getFinalKey(hActual);
assertArrayEquals("Keys mismatched", mPM.finalKey, finalKey); assertArrayEquals("Keys mismatched", mPM.getFinalKey(), finalKey);
} }

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.search; package com.kunzisoft.keepass.tests.search;
import android.content.Context; import android.content.Context;
@@ -25,10 +25,9 @@ import android.content.SharedPreferences;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import com.kunzisoft.keepass.R; import com.kunzisoft.keepass.database.Database;
import com.keepassdroid.database.Database; import com.kunzisoft.keepass.database.PwGroup;
import com.keepassdroid.database.PwGroup; import com.kunzisoft.keepass.tests.database.TestData;
import com.keepassdroid.tests.database.TestData;
public class SearchTest extends AndroidTestCase { public class SearchTest extends AndroidTestCase {
@@ -42,21 +41,21 @@ public class SearchTest extends AndroidTestCase {
} }
public void testSearch() { public void testSearch() {
PwGroup results = mDb.Search("Amazon"); PwGroup results = mDb.search("Amazon");
assertTrue("Search result not found.", results.numbersOfChildEntries() > 0); assertTrue("Search result not found.", results.numbersOfChildEntries() > 0);
} }
public void testBackupIncluded() { public void testBackupIncluded() {
updateOmitSetting(false); updateOmitSetting(false);
PwGroup results = mDb.Search("BackupOnly"); PwGroup results = mDb.search("BackupOnly");
assertTrue("Search result not found.", results.numbersOfChildEntries() > 0); assertTrue("Search result not found.", results.numbersOfChildEntries() > 0);
} }
public void testBackupExcluded() { public void testBackupExcluded() {
updateOmitSetting(true); updateOmitSetting(true);
PwGroup results = mDb.Search("BackupOnly"); PwGroup results = mDb.search("BackupOnly");
assertFalse("Search result found, but should not have been.", results.numbersOfChildEntries() > 0); assertFalse("Search result found, but should not have been.", results.numbersOfChildEntries() > 0);
} }
@@ -66,7 +65,7 @@ public class SearchTest extends AndroidTestCase {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
SharedPreferences.Editor editor = prefs.edit(); SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean(ctx.getString(R.string.settings_omitbackup_key), setting); editor.putBoolean("settings_omitbackup_key", setting);
editor.commit(); editor.commit();
} }

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.stream; package com.kunzisoft.keepass.tests.stream;
import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertArrayEquals;
@@ -30,8 +30,8 @@ import java.util.zip.GZIPOutputStream;
import junit.framework.TestCase; import junit.framework.TestCase;
import com.keepassdroid.stream.HashedBlockInputStream; import com.kunzisoft.keepass.stream.HashedBlockInputStream;
import com.keepassdroid.stream.HashedBlockOutputStream; import com.kunzisoft.keepass.stream.HashedBlockOutputStream;
public class HashedBlock extends TestCase { public class HashedBlock extends TestCase {

View File

@@ -5,7 +5,7 @@
* *
* KeePass DX is free software: you can redistribute it and/or modify * KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* KeePass DX is distributed in the hope that it will be useful, * KeePass DX is distributed in the hope that it will be useful,
@@ -17,11 +17,11 @@
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>. * along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
package com.keepassdroid.tests.utils; package com.kunzisoft.keepass.tests.utils;
import java.util.Locale; import java.util.Locale;
import com.keepassdroid.utils.StrUtil; import com.kunzisoft.keepass.utils.StrUtil;
import junit.framework.TestCase; import junit.framework.TestCase;

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportWidth="108"
android:viewportHeight="108"
android:width="108dp"
android:height="108dp">
<group
android:translateY="-332">
<group
android:translateY="332">
<path
android:pathData="M65.728516 32.791016L58.052734 35.904297 56.173828 48.380859 35.306641 69.267578 35.238281 73.759766 69.478516 108 108 108 108 70.810547 73.09375 35.904297 65.728516 32.791016Z"
android:fillColor="@color/long_shadow"
android:strokeLineJoin="round"
android:strokeLineCap="round"
android:strokeMiterLimit="4" />
</group>
<group
android:scaleX="0.3939503"
android:scaleY="0.3939503"
android:translateX="33.66343"
android:translateY="233.998">
<path
android:pathData="M88.76953 339.91602L4.1718754 424.59766 4.0000004 436 15.400391 435.82813 27.240234 424 40 424l0 -12 12 0 0 -12.73438 34.01172 -33.97656A8 8 0 0 1 84 360a8 8 0 0 1 8 -8 8 8 0 0 1 5.296882 2.01367l2.787098 -2.7832 -11.31445 -11.31445z"
android:fillColor="#eaeaea"
android:strokeWidth="1"
android:strokeColor="#58000000" />
</group>
<group
android:scaleX="0.3939503"
android:scaleY="0.3939503"
android:translateX="33.66343"
android:translateY="233.998">
<path
android:pathData="M4.0000004 340L4.1718754 351.40137 88.59863 435.82812 100 436 99.828122 424.59863 15.401367 340.17188Z"
android:fillColor="#81c784" />
</group>
<group
android:scaleX="0.3939503"
android:scaleY="0.3939503"
android:translateX="33.66343"
android:translateY="233.998">
<path
android:pathData="M81.39454 332.00195a27 27 0 0 0 -19.48634 7.90625 27 27 0 0 0 0 38.1836 27 27 0 0 0 38.1836 0 27 27 0 0 0 0 -38.1836 27 27 0 0 0 -18.69726 -7.90625zM92 352a8 8 0 0 1 8 8 8 8 0 0 1 -8 8 8 8 0 0 1 -8 -8 8 8 0 0 1 8 -8z"
android:fillColor="#eaeaea"
android:strokeWidth="1"
android:strokeColor="#58000000" />
</group>
</group>
</vector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/green" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/green" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportWidth="108"
android:viewportHeight="108"
android:width="108dp"
android:height="108dp">
<group
android:translateY="-332">
<group
android:translateY="332">
<path
android:pathData="M65.728516 32.791016L58.052734 35.904297 56.173828 48.380859 35.306641 69.267578 35.238281 73.759766 69.478516 108 108 108 108 70.810547 73.09375 35.904297 65.728516 32.791016Z"
android:fillColor="@color/long_shadow"
android:strokeLineJoin="round"
android:strokeLineCap="round"
android:strokeMiterLimit="4" />
</group>
<group
android:scaleX="0.3939503"
android:scaleY="0.3939503"
android:translateX="33.66343"
android:translateY="233.998">
<path
android:pathData="M88.76953 339.91602L4.1718754 424.59766 4.0000004 436 15.400391 435.82813 27.240234 424 40 424l0 -12 12 0 0 -12.73438 34.01172 -33.97656A8 8 0 0 1 84 360a8 8 0 0 1 8 -8 8 8 0 0 1 5.296882 2.01367l2.787098 -2.7832 -11.31445 -11.31445z"
android:fillColor="#eaeaea"
android:strokeWidth="1"
android:strokeColor="#58000000"/>
</group>
<group
android:scaleX="0.3939503"
android:scaleY="0.3939503"
android:translateX="33.66343"
android:translateY="233.998">
<path
android:pathData="M4.0000004 340L4.1718754 351.40137 88.59863 435.82812 100 436 99.828122 424.59863 15.401367 340.17188Z"
android:fillColor="#64b5f6" />
</group>
<group
android:scaleX="0.3939503"
android:scaleY="0.3939503"
android:translateX="33.66343"
android:translateY="233.998">
<path
android:pathData="M81.39454 332.00195a27 27 0 0 0 -19.48634 7.90625 27 27 0 0 0 0 38.1836 27 27 0 0 0 38.1836 0 27 27 0 0 0 0 -38.1836 27 27 0 0 0 -18.69726 -7.90625zM92 352a8 8 0 0 1 8 8 8 8 0 0 1 -8 8 8 8 0 0 1 -8 -8 8 8 0 0 1 8 -8z"
android:fillColor="#eaeaea"
android:strokeWidth="1"
android:strokeColor="#58000000" />
</group>
</group>
</vector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/green" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/green" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -16,54 +16,35 @@
android:label="@string/app_name" android:label="@string/app_name"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:name="com.keepassdroid.app.App" android:name="com.kunzisoft.keepass.app.App"
android:allowBackup="true" android:allowBackup="true"
android:fullBackupContent="@xml/backup" android:fullBackupContent="@xml/backup"
android:backupAgent="com.keepassdroid.backup.SettingsBackupAgent" android:backupAgent="com.kunzisoft.keepass.backup.SettingsBackupAgent"
android:theme="@style/KeepassDXStyle.Light" android:theme="@style/KeepassDXStyle.Night"
tools:replace="android:theme"> tools:replace="android:theme">
<!-- TODO backup API Key --> <!-- TODO backup API Key -->
<meta-data <meta-data
android:name="com.google.android.backup.api_key" android:name="com.google.android.backup.api_key"
android:value="" /> android:value="" />
<!-- Folder picker -->
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/nnf_provider_paths" />
</provider>
<activity <activity
android:name="com.keepassdroid.fileselect.FilePickerStylishActivity" android:name="com.kunzisoft.keepass.fileselect.FileSelectActivity"
android:label="@string/app_name"> android:theme="@style/KeepassDXStyle.SplashScreen"
<intent-filter> android:label="@string/app_name"
<action android:name="android.intent.action.GET_CONTENT" /> android:launchMode="singleTop"
<category android:name="android.intent.category.DEFAULT" /> android:configChanges="orientation|keyboardHidden"
</intent-filter> android:windowSoftInputMode="stateHidden" >
</activity>
<activity android:name=".KeePass"
android:label="@string/app_name">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name="com.keepassdroid.fileselect.FileSelectActivity" android:name="com.kunzisoft.keepass.activities.AboutActivity"
android:launchMode="singleInstance" android:launchMode="singleTask"
android:configChanges="orientation|keyboardHidden"
android:windowSoftInputMode="stateHidden" />
<activity
android:name="com.keepassdroid.activities.AboutActivity"
android:launchMode="singleInstance"
android:label="@string/menu_about" /> android:label="@string/menu_about" />
<activity <activity
android:name="com.keepassdroid.password.PasswordActivity" android:name="com.kunzisoft.keepass.password.PasswordActivity"
android:configChanges="orientation|keyboardHidden" android:configChanges="orientation|keyboardHidden"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize">
<intent-filter> <intent-filter>
@@ -102,25 +83,43 @@
<data android:mimeType="application/octet-stream"/> <data android:mimeType="application/octet-stream"/>
</intent-filter> </intent-filter>
</activity> </activity>
<!-- Folder picker -->
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/nnf_provider_paths" />
</provider>
<activity <activity
android:name="com.keepassdroid.activities.GroupActivity" android:name="com.kunzisoft.keepass.fileselect.FilePickerStylishActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.kunzisoft.keepass.activities.GroupActivity"
android:configChanges="orientation|keyboardHidden" android:configChanges="orientation|keyboardHidden"
android:windowSoftInputMode="adjustPan"> android:windowSoftInputMode="adjustPan">
<meta-data <meta-data
android:name="android.app.default_searchable" android:name="android.app.default_searchable"
android:value="com.keepassdroid.search.SearchResults" android:value="com.kunzisoft.keepass.search.SearchResults"
android:exported="false"/> android:exported="false"/>
</activity> </activity>
<activity <activity
android:name="com.keepassdroid.activities.EntryActivity" android:name="com.kunzisoft.keepass.activities.EntryActivity"
android:configChanges="orientation|keyboardHidden" android:configChanges="orientation|keyboardHidden"
android:windowSoftInputMode="stateHidden" /> android:windowSoftInputMode="stateHidden" />
<activity <activity
android:name="com.keepassdroid.activities.EntryEditActivity" android:name="com.kunzisoft.keepass.activities.EntryEditActivity"
android:configChanges="orientation|keyboardHidden" android:configChanges="orientation|keyboardHidden"
android:windowSoftInputMode="stateHidden" /> android:windowSoftInputMode="stateHidden" />
<activity <activity
android:name="com.keepassdroid.search.SearchResultsActivity" android:name="com.kunzisoft.keepass.search.SearchResultsActivity"
android:launchMode="standard"> android:launchMode="standard">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEARCH" /> <action android:name="android.intent.action.SEARCH" />
@@ -130,23 +129,30 @@
android:name="android.app.searchable" android:name="android.app.searchable"
android:resource="@xml/searchable" /> android:resource="@xml/searchable" />
</activity> </activity>
<activity android:name="com.keepassdroid.settings.SettingsActivity" /> <activity android:name="com.kunzisoft.keepass.settings.SettingsActivity" />
<activity android:name="com.keepassdroid.autofill.AutoFillAuthActivity" <activity android:name="com.kunzisoft.keepass.autofill.AutoFillAuthActivity"
android:configChanges="orientation|keyboardHidden" /> android:configChanges="orientation|keyboardHidden" />
<activity android:name="com.kunzisoft.keepass.selection.EntrySelectionAuthActivity"
android:configChanges="orientation|keyboardHidden" />
<activity android:name="com.kunzisoft.keepass.settings.SettingsAutofillActivity" />
<service android:name="com.keepassdroid.services.TimeoutService" />
<service <service
android:name="com.keepassdroid.autofill.KeeAutofillService" android:name="com.kunzisoft.keepass.notifications.NotificationCopyingService"
android:enabled="true"
android:exported="false" />
<!-- Receiver for Autofill -->
<service
android:name="com.kunzisoft.keepass.autofill.KeeAutofillService"
android:label="@string/autofill_service_name" android:label="@string/autofill_service_name"
android:permission="android.permission.BIND_AUTOFILL_SERVICE"> android:permission="android.permission.BIND_AUTOFILL_SERVICE">
<meta-data <meta-data
android:name="android.autofill" android:name="android.autofill"
android:resource="@xml/dataset_service" /> android:resource="@xml/dataset_service" />
<intent-filter> <intent-filter>
<action android:name="android.service.autofill.AutofillService" /> <action android:name="android.service.autofill.AutofillService" />
</intent-filter> </intent-filter>
</service> </service>
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" /> <meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
</application> </application>
</manifest> </manifest>

Binary file not shown.

View File

@@ -1,225 +0,0 @@
// Copyright 2003-2010 Christian d'Heureuse, Inventec Informatik AG, Zurich, Switzerland
// www.source-code.biz, www.inventec.ch/chdh
//
// This module is multi-licensed and may be used under the terms
// of any of the following licenses:
//
// EPL, Eclipse Public License, http://www.eclipse.org/legal
// LGPL, GNU Lesser General Public License, http://www.gnu.org/licenses/lgpl.html
// AL, Apache License, http://www.apache.org/licenses
// BSD, BSD License, http://www.opensource.org/licenses/bsd-license.php
//
// Please contact the author if you need another license.
// This module is provided "as is", without warranties of any kind.
package biz.source_code.base64Coder;
/**
* A Base64 encoder/decoder.
*
* <p>
* This class is used to encode and decode data in Base64 format as described in RFC 1521.
*
* <p>
* Project home page: <a href="http://www.source-code.biz/base64coder/java/">www.source-code.biz/base64coder/java</a><br>
* Author: Christian d'Heureuse, Inventec Informatik AG, Zurich, Switzerland<br>
* Multi-licensed: EPL / LGPL / AL / BSD.
*/
public class Base64Coder {
// The line separator string of the operating system.
private static final String systemLineSeparator = System.getProperty("line.separator");
// Mapping table from 6-bit nibbles to Base64 characters.
private static char[] map1 = new char[64];
static {
int i=0;
for (char c='A'; c<='Z'; c++) map1[i++] = c;
for (char c='a'; c<='z'; c++) map1[i++] = c;
for (char c='0'; c<='9'; c++) map1[i++] = c;
map1[i++] = '+'; map1[i++] = '/'; }
// Mapping table from Base64 characters to 6-bit nibbles.
private static byte[] map2 = new byte[128];
static {
for (int i=0; i<map2.length; i++) map2[i] = -1;
for (int i=0; i<64; i++) map2[map1[i]] = (byte)i; }
/**
* Encodes a string into Base64 format.
* No blanks or line breaks are inserted.
* @param s A String to be encoded.
* @return A String containing the Base64 encoded data.
*/
public static String encodeString (String s) {
return new String(encode(s.getBytes())); }
/**
* Encodes a byte array into Base 64 format and breaks the output into lines of 76 characters.
* This method is compatible with <code>sun.misc.BASE64Encoder.encodeBuffer(byte[])</code>.
* @param in An array containing the data bytes to be encoded.
* @return A String containing the Base64 encoded data, broken into lines.
*/
public static String encodeLines (byte[] in) {
return encodeLines(in, 0, in.length, 76, systemLineSeparator); }
/**
* Encodes a byte array into Base 64 format and breaks the output into lines.
* @param in An array containing the data bytes to be encoded.
* @param iOff Offset of the first byte in <code>in</code> to be processed.
* @param iLen Number of bytes to be processed in <code>in</code>, starting at <code>iOff</code>.
* @param lineLen Line length for the output data. Should be a multiple of 4.
* @param lineSeparator The line separator to be used to separate the output lines.
* @return A String containing the Base64 encoded data, broken into lines.
*/
public static String encodeLines (byte[] in, int iOff, int iLen, int lineLen, String lineSeparator) {
int blockLen = (lineLen*3) / 4;
if (blockLen <= 0) throw new IllegalArgumentException();
int lines = (iLen+blockLen-1) / blockLen;
int bufLen = ((iLen+2)/3)*4 + lines*lineSeparator.length();
StringBuilder buf = new StringBuilder(bufLen);
int ip = 0;
while (ip < iLen) {
int l = Math.min(iLen-ip, blockLen);
buf.append (encode(in, iOff+ip, l));
buf.append (lineSeparator);
ip += l; }
return buf.toString(); }
/**
* Encodes a byte array into Base64 format.
* No blanks or line breaks are inserted in the output.
* @param in An array containing the data bytes to be encoded.
* @return A character array containing the Base64 encoded data.
*/
public static char[] encode (byte[] in) {
return encode(in, 0, in.length); }
/**
* Encodes a byte array into Base64 format.
* No blanks or line breaks are inserted in the output.
* @param in An array containing the data bytes to be encoded.
* @param iLen Number of bytes to process in <code>in</code>.
* @return A character array containing the Base64 encoded data.
*/
public static char[] encode (byte[] in, int iLen) {
return encode(in, 0, iLen); }
/**
* Encodes a byte array into Base64 format.
* No blanks or line breaks are inserted in the output.
* @param in An array containing the data bytes to be encoded.
* @param iOff Offset of the first byte in <code>in</code> to be processed.
* @param iLen Number of bytes to process in <code>in</code>, starting at <code>iOff</code>.
* @return A character array containing the Base64 encoded data.
*/
public static char[] encode (byte[] in, int iOff, int iLen) {
int oDataLen = (iLen*4+2)/3; // output length without padding
int oLen = ((iLen+2)/3)*4; // output length including padding
char[] out = new char[oLen];
int ip = iOff;
int iEnd = iOff + iLen;
int op = 0;
while (ip < iEnd) {
int i0 = in[ip++] & 0xff;
int i1 = ip < iEnd ? in[ip++] & 0xff : 0;
int i2 = ip < iEnd ? in[ip++] & 0xff : 0;
int o0 = i0 >>> 2;
int o1 = ((i0 & 3) << 4) | (i1 >>> 4);
int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6);
int o3 = i2 & 0x3F;
out[op++] = map1[o0];
out[op++] = map1[o1];
out[op] = op < oDataLen ? map1[o2] : '='; op++;
out[op] = op < oDataLen ? map1[o3] : '='; op++; }
return out; }
/**
* Decodes a string from Base64 format.
* No blanks or line breaks are allowed within the Base64 encoded input data.
* @param s A Base64 String to be decoded.
* @return A String containing the decoded data.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static String decodeString (String s) {
return new String(decode(s)); }
/**
* Decodes a byte array from Base64 format and ignores line separators, tabs and blanks.
* CR, LF, Tab and Space characters are ignored in the input data.
* This method is compatible with <code>sun.misc.BASE64Decoder.decodeBuffer(String)</code>.
* @param s A Base64 String to be decoded.
* @return An array containing the decoded data bytes.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static byte[] decodeLines (String s) {
char[] buf = new char[s.length()];
int p = 0;
for (int ip = 0; ip < s.length(); ip++) {
char c = s.charAt(ip);
if (c != ' ' && c != '\r' && c != '\n' && c != '\t')
buf[p++] = c; }
return decode(buf, 0, p); }
/**
* Decodes a byte array from Base64 format.
* No blanks or line breaks are allowed within the Base64 encoded input data.
* @param s A Base64 String to be decoded.
* @return An array containing the decoded data bytes.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static byte[] decode (String s) {
return decode(s.toCharArray()); }
/**
* Decodes a byte array from Base64 format.
* No blanks or line breaks are allowed within the Base64 encoded input data.
* @param in A character array containing the Base64 encoded data.
* @return An array containing the decoded data bytes.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static byte[] decode (char[] in) {
return decode(in, 0, in.length); }
/**
* Decodes a byte array from Base64 format.
* No blanks or line breaks are allowed within the Base64 encoded input data.
* @param in A character array containing the Base64 encoded data.
* @param iOff Offset of the first character in <code>in</code> to be processed.
* @param iLen Number of characters to process in <code>in</code>, starting at <code>iOff</code>.
* @return An array containing the decoded data bytes.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static byte[] decode (char[] in, int iOff, int iLen) {
if (iLen%4 != 0) throw new IllegalArgumentException ("Length of Base64 encoded input string is not a multiple of 4.");
while (iLen > 0 && in[iOff+iLen-1] == '=') iLen--;
int oLen = (iLen*3) / 4;
byte[] out = new byte[oLen];
int ip = iOff;
int iEnd = iOff + iLen;
int op = 0;
while (ip < iEnd) {
int i0 = in[ip++];
int i1 = in[ip++];
int i2 = ip < iEnd ? in[ip++] : 'A';
int i3 = ip < iEnd ? in[ip++] : 'A';
if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127)
throw new IllegalArgumentException ("Illegal character in Base64 encoded data.");
int b0 = map2[i0];
int b1 = map2[i1];
int b2 = map2[i2];
int b3 = map2[i3];
if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0)
throw new IllegalArgumentException ("Illegal character in Base64 encoded data.");
int o0 = ( b0 <<2) | (b1>>>4);
int o1 = ((b1 & 0xf)<<4) | (b2>>>2);
int o2 = ((b2 & 3)<<6) | b3;
out[op++] = (byte)o0;
if (op<oLen) out[op++] = (byte)o1;
if (op<oLen) out[op++] = (byte)o2; }
return out; }
// Dummy constructor.
private Base64Coder() {}
} // end class Base64Coder

View File

@@ -1,487 +0,0 @@
/*
*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.activities;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat;
import android.support.v7.widget.Toolbar;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.keepassdroid.app.App;
import com.keepassdroid.compat.ActivityCompat;
import com.keepassdroid.database.Database;
import com.keepassdroid.database.PwDatabase;
import com.keepassdroid.database.PwEntry;
import com.keepassdroid.database.exception.SamsungClipboardException;
import com.keepassdroid.intents.Intents;
import com.keepassdroid.settings.PreferencesUtil;
import com.keepassdroid.password.PasswordActivity;
import com.keepassdroid.tasks.UIToastTask;
import com.keepassdroid.utils.EmptyUtils;
import com.keepassdroid.utils.MenuUtil;
import com.keepassdroid.utils.Types;
import com.keepassdroid.utils.Util;
import com.keepassdroid.view.EntryContentsView;
import com.kunzisoft.keepass.R;
import java.util.Date;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import java.util.UUID;
import static com.keepassdroid.settings.PreferencesUtil.isClipboardNotificationsEnable;
public class EntryActivity extends LockingHideActivity {
public static final String KEY_ENTRY = "entry";
public static final int NOTIFY_USERNAME = 1;
public static final int NOTIFY_PASSWORD = 2;
private ImageView titleIconView;
private TextView titleView;
private EntryContentsView entryContentsView;
protected PwEntry mEntry;
private Timer mTimer = new Timer();
private boolean mShowPassword;
private NotificationManager mNM;
private BroadcastReceiver mIntentReceiver;
protected boolean readOnly = false;
public static void launch(Activity act, PwEntry pw) {
Intent intent = new Intent(act, EntryActivity.class);
intent.putExtra(KEY_ENTRY, Types.UUIDtoBytes(pw.getUUID()));
act.startActivityForResult(intent, EntryEditActivity.ADD_OR_UPDATE_ENTRY_REQUEST_CODE);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.entry_view);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
assert getSupportActionBar() != null;
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_close_white_24dp);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
Database db = App.getDB();
// Likely the app has been killed exit the activity
if ( ! db.Loaded() ) {
finish();
return;
}
readOnly = db.readOnly;
mShowPassword = !PreferencesUtil.isPasswordMask(this);
// Get Entry from UUID
Intent i = getIntent();
UUID uuid = Types.bytestoUUID(i.getByteArrayExtra(KEY_ENTRY));
mEntry = db.pm.entries.get(uuid);
if (mEntry == null) {
Toast.makeText(this, R.string.entry_not_found, Toast.LENGTH_LONG).show();
finish();
return;
}
// Refresh Menu contents in case onCreateMenuOptions was called before mEntry was set
ActivityCompat.invalidateOptionsMenu(this);
// Update last access time.
mEntry.touch(false, false);
// Get views
titleIconView = (ImageView) findViewById(R.id.entry_icon);
titleView = (TextView) findViewById(R.id.entry_title);
entryContentsView = (EntryContentsView) findViewById(R.id.entry_contents);
entryContentsView.applyFontVisibilityToFields(PreferencesUtil.fieldFontIsInVisibility(this));
fillData();
// Setup Edit Buttons
View edit = findViewById(R.id.entry_edit);
edit.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
EntryEditActivity.Launch(EntryActivity.this, mEntry);
}
});
if (readOnly) {
edit.setVisibility(View.GONE);
}
// If notifications enabled in settings
if (isClipboardNotificationsEnable(getApplicationContext())) {
// Notification Manager
mNM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
if (mEntry.getPassword().length() > 0) {
// only show notification if password is available
Notification password = getNotification(Intents.COPY_PASSWORD, R.string.copy_password);
mNM.notify(NOTIFY_PASSWORD, password);
}
if (mEntry.getUsername().length() > 0) {
// only show notification if username is available
Notification username = getNotification(Intents.COPY_USERNAME, R.string.copy_username);
mNM.notify(NOTIFY_USERNAME, username);
}
}
mIntentReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if ( action != null) {
if (action.equals(Intents.COPY_USERNAME)) {
String username = mEntry.getUsername();
if (username.length() > 0) {
timeoutCopyToClipboard(username);
}
} else if (action.equals(Intents.COPY_PASSWORD)) {
String password = mEntry.getPassword();
if (password.length() > 0) {
timeoutCopyToClipboard(password);
}
}
}
}
};
IntentFilter filter = new IntentFilter();
filter.addAction(Intents.COPY_USERNAME);
filter.addAction(Intents.COPY_PASSWORD);
registerReceiver(mIntentReceiver, filter);
}
@Override
protected void onDestroy() {
// These members might never get initialized if the app timed out
if ( mIntentReceiver != null ) {
unregisterReceiver(mIntentReceiver);
}
if ( mNM != null ) {
try {
mNM.cancelAll();
} catch (SecurityException e) {
// Some android devices give a SecurityException when trying to cancel notifications without the WAKE_LOCK permission,
// we'll ignore these.
}
}
super.onDestroy();
}
private Notification getNotification(String intentText, int descResId) {
String desc = getString(descResId);
Intent intent = new Intent(intentText);
PendingIntent pending = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
// no longer supported for api level >22
// notify.setLatestEventInfo(this, getString(R.string.app_name), desc, pending);
// so instead using compat builder and create new notification
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
Notification notify = builder.setContentIntent(pending).setContentText(desc).setContentTitle(getString(R.string.app_name))
.setSmallIcon(R.drawable.notify).setTicker(desc).setWhen(System.currentTimeMillis()).build();
return notify;
}
private void populateTitle(Drawable drawIcon, String text) {
titleIconView.setImageDrawable(drawIcon);
titleView.setText(text);
}
protected void fillData() {
Database db = App.getDB();
PwDatabase pm = db.pm;
// Assign title
populateTitle(db.drawFactory.getIconDrawable(getResources(), mEntry.getIcon()),
mEntry.getTitle(true, pm));
// Assign basic fields
entryContentsView.assignUserName(mEntry.getUsername(true, pm));
entryContentsView.assignUserNameCopyListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
timeoutCopyToClipboard(mEntry.getUsername(true, App.getDB().pm),
getString(R.string.copy_field, getString(R.string.entry_user_name)));
}
});
entryContentsView.assignPassword(mEntry.getPassword(true, pm));
entryContentsView.assignPasswordCopyListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
timeoutCopyToClipboard(mEntry.getPassword(true, App.getDB().pm),
getString(R.string.copy_field, getString(R.string.entry_password)));
}
});
entryContentsView.assignURL(mEntry.getUrl(true, pm));
entryContentsView.setHiddenPasswordStyle(!mShowPassword);
entryContentsView.assignComment(mEntry.getNotes(true, pm));
// Assign custom fields
if (mEntry.allowExtraFields()) {
entryContentsView.clearExtraFields();
for (Map.Entry<String, String> field : mEntry.getExtraFields(pm).entrySet()) {
final String label = field.getKey();
final String value = field.getValue();
entryContentsView.addExtraField(label, value, new View.OnClickListener() {
@Override
public void onClick(View view) {
timeoutCopyToClipboard(value, getString(R.string.copy_field, label));
}
});
}
}
// Assign dates
entryContentsView.assignCreationDate(mEntry.getCreationTime());
entryContentsView.assignModificationDate(mEntry.getLastModificationTime());
entryContentsView.assignLastAccessDate(mEntry.getLastAccessTime());
Date expires = mEntry.getExpiryTime();
if ( mEntry.expires() ) {
entryContentsView.assignExpiresDate(expires);
} else {
entryContentsView.assignExpiresDate(getString(R.string.never));
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case EntryEditActivity.ADD_OR_UPDATE_ENTRY_REQUEST_CODE:
fillData();
break;
}
}
private void changeShowPasswordIcon(MenuItem togglePassword) {
if ( mShowPassword ) {
togglePassword.setTitle(R.string.menu_hide_password);
togglePassword.setIcon(R.drawable.ic_visibility_off_white_24dp);
} else {
togglePassword.setTitle(R.string.menu_showpass);
togglePassword.setIcon(R.drawable.ic_visibility_white_24dp);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
MenuUtil.donationMenuInflater(inflater, menu);
inflater.inflate(R.menu.entry, menu);
inflater.inflate(R.menu.database_lock, menu);
MenuItem togglePassword = menu.findItem(R.id.menu_toggle_pass);
if (!entryContentsView.isPasswordPresent()) {
togglePassword.setVisible(false);
} else {
changeShowPasswordIcon(togglePassword);
}
MenuItem gotoUrl = menu.findItem(R.id.menu_goto_url);
// In API >= 11 onCreateOptionsMenu may be called before onCreate completes
// so mEntry may not be set
if (mEntry == null) {
gotoUrl.setVisible(false);
}
else {
String url = mEntry.getUrl();
if (EmptyUtils.isNullOrEmpty(url)) {
// disable button if url is not available
gotoUrl.setVisible(false);
}
}
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch ( item.getItemId() ) {
case R.id.menu_donate:
return MenuUtil.onDonationItemSelected(this);
case R.id.menu_toggle_pass:
mShowPassword = !mShowPassword;
changeShowPasswordIcon(item);
entryContentsView.setHiddenPasswordStyle(!mShowPassword);
return true;
case R.id.menu_goto_url:
String url;
url = mEntry.getUrl();
// Default http:// if no protocol specified
if ( ! url.contains("://") ) {
url = "http://" + url;
}
try {
Util.gotoUrl(this, url);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, R.string.no_url_handler, Toast.LENGTH_LONG).show();
}
return true;
case R.id.menu_lock:
App.setShutdown();
setResult(PasswordActivity.RESULT_EXIT_LOCK);
finish();
return true;
case android.R.id.home :
finish(); // close this activity and return to preview activity (if there is any)
}
return super.onOptionsItemSelected(item);
}
private void timeoutCopyToClipboard(String text) {
timeoutCopyToClipboard(text, "");
}
private void timeoutCopyToClipboard(String text, String toastString) {
if (!toastString.isEmpty())
Toast.makeText(EntryActivity.this, toastString, Toast.LENGTH_LONG).show();
try {
Util.copyToClipboard(this, text);
} catch (SamsungClipboardException e) {
showSamsungDialog();
return;
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
String sClipClear = prefs.getString(getString(R.string.clipboard_timeout_key), getString(R.string.clipboard_timeout_default));
long clipClearTime = Long.parseLong(sClipClear);
if ( clipClearTime > 0 ) {
mTimer.schedule(new ClearClipboardTask(this, text), clipClearTime);
}
}
@Override
public void finish() {
// Transit data in previous Activity after an update
/*
TODO Slowdown when add entry as result
Intent intent = new Intent();
intent.putExtra(EntryEditActivity.ADD_OR_UPDATE_ENTRY_KEY, mEntry);
setResult(EntryEditActivity.UPDATE_ENTRY_RESULT_CODE, intent);
*/
super.finish();
}
// Setup to allow the toast to happen in the foreground
final Handler uiThreadCallback = new Handler();
// Task which clears the clipboard, and sends a toast to the foreground.
private class ClearClipboardTask extends TimerTask {
private final String mClearText;
private final Context mCtx;
ClearClipboardTask(Context ctx, String clearText) {
mClearText = clearText;
mCtx = ctx;
}
@Override
public void run() {
String currentClip = Util.getClipboard(mCtx);
if ( currentClip.equals(mClearText) ) {
try {
Util.copyToClipboard(mCtx, "");
uiThreadCallback.post(new UIToastTask(mCtx, R.string.ClearClipboard));
} catch (SamsungClipboardException e) {
uiThreadCallback.post(new UIToastTask(mCtx, R.string.clipboard_error_clear));
}
}
}
}
private void showSamsungDialog() {
String text = getString(R.string.clipboard_error).concat(System.getProperty("line.separator")).concat(getString(R.string.clipboard_error_url));
SpannableString s = new SpannableString(text);
TextView tv = new TextView(this);
tv.setText(s);
tv.setAutoLinkMask(RESULT_OK);
tv.setMovementMethod(LinkMovementMethod.getInstance());
Linkify.addLinks(s, Linkify.WEB_URLS);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.clipboard_error_title)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.setView(tv)
.show();
}
}

View File

@@ -1,413 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.activities;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import com.keepassdroid.app.App;
import com.keepassdroid.database.Database;
import com.keepassdroid.database.PwDatabase;
import com.keepassdroid.database.PwDatabaseV4;
import com.keepassdroid.database.PwEntry;
import com.keepassdroid.database.PwEntryV4;
import com.keepassdroid.database.PwGroup;
import com.keepassdroid.database.PwGroupId;
import com.keepassdroid.database.PwIconStandard;
import com.keepassdroid.database.edit.AddEntry;
import com.keepassdroid.database.edit.OnFinish;
import com.keepassdroid.database.edit.RunnableOnFinish;
import com.keepassdroid.database.edit.UpdateEntry;
import com.keepassdroid.database.security.ProtectedString;
import com.keepassdroid.fragments.GeneratePasswordDialogFragment;
import com.keepassdroid.fragments.IconPickerDialogFragment;
import com.keepassdroid.icons.Icons;
import com.keepassdroid.settings.PreferencesUtil;
import com.keepassdroid.tasks.ProgressTask;
import com.keepassdroid.utils.MenuUtil;
import com.keepassdroid.utils.Types;
import com.keepassdroid.utils.Util;
import com.keepassdroid.view.EntryEditNewField;
import com.kunzisoft.keepass.R;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import java.util.UUID;
public class EntryEditActivity extends LockingHideActivity
implements IconPickerDialogFragment.IconPickerListener,
GeneratePasswordDialogFragment.GeneratePasswordListener {
// Keys for current Activity
public static final String KEY_ENTRY = "entry";
public static final String KEY_PARENT = "parent";
// Keys for callback
public static final int ADD_ENTRY_RESULT_CODE = 31;
public static final int UPDATE_ENTRY_RESULT_CODE = 32;
public static final int ADD_OR_UPDATE_ENTRY_REQUEST_CODE = 7129;
public static final String ADD_OR_UPDATE_ENTRY_KEY = "ADD_OR_UPDATE_ENTRY_KEY";
protected PwEntry mEntry;
protected PwEntry mCallbackNewEntry;
protected boolean mIsNew;
protected int mSelectedIconID = -1;
// Views
private ScrollView scrollView;
private TextView entryTitleView;
private TextView entryUserNameView;
private TextView entryUrlView;
private TextView entryPasswordView;
private TextView entryConfirmationPasswordView;
private TextView entryCommentView;
private ViewGroup entryExtraFieldsContainer;
/**
* launch EntryEditActivity to update an existing entry
* @param act from activity
* @param pw Entry to update
*/
public static void Launch(Activity act, PwEntry pw) {
Intent intent = new Intent(act, EntryEditActivity.class);
intent.putExtra(KEY_ENTRY, Types.UUIDtoBytes(pw.getUUID()));
act.startActivityForResult(intent, ADD_OR_UPDATE_ENTRY_REQUEST_CODE);
}
/**
* launch EntryEditActivity to add a new entry
* @param act from activity
* @param pwGroup Group who will contains new entry
*/
public static void Launch(Activity act, PwGroup pwGroup) {
Intent intent = new Intent(act, EntryEditActivity.class);
intent.putExtra(KEY_PARENT, pwGroup.getId());
act.startActivityForResult(intent, ADD_OR_UPDATE_ENTRY_REQUEST_CODE);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.entry_edit);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(getString(R.string.app_name));
setSupportActionBar(toolbar);
assert getSupportActionBar() != null;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
scrollView = (ScrollView) findViewById(R.id.entry_scroll);
scrollView.setScrollBarStyle(View.SCROLLBARS_INSIDE_INSET);
entryTitleView = (TextView) findViewById(R.id.entry_title);
entryUserNameView = (TextView) findViewById(R.id.entry_user_name);
entryUrlView = (TextView) findViewById(R.id.entry_url);
entryPasswordView = (TextView) findViewById(R.id.entry_password);
entryConfirmationPasswordView = (TextView) findViewById(R.id.entry_confpassword);
entryCommentView = (TextView) findViewById(R.id.entry_comment);
entryExtraFieldsContainer = (ViewGroup) findViewById(R.id.advanced_container);
// Likely the app has been killed exit the activity
Database db = App.getDB();
if ( ! db.Loaded() ) {
finish();
return;
}
Intent intent = getIntent();
byte[] uuidBytes = intent.getByteArrayExtra(KEY_ENTRY);
PwDatabase pm = db.pm;
if ( uuidBytes == null ) {
PwGroupId parentId = (PwGroupId) intent.getSerializableExtra(KEY_PARENT);
PwGroup parent = pm.groups.get(parentId);
mEntry = PwEntry.getInstance(parent);
mIsNew = true;
} else {
UUID uuid = Types.bytestoUUID(uuidBytes);
mEntry = pm.entries.get(uuid);
mIsNew = false;
fillData();
}
View iconButton = findViewById(R.id.icon_button);
iconButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
IconPickerDialogFragment.launch(EntryEditActivity.this);
}
});
// Generate password button
View generatePassword = findViewById(R.id.generate_button);
generatePassword.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
GeneratePasswordDialogFragment generatePasswordDialogFragment = new GeneratePasswordDialogFragment();
generatePasswordDialogFragment.show(getSupportFragmentManager(), "PasswordGeneratorFragment");
}
});
// Save button
View save = findViewById(R.id.entry_save);
save.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (!validateBeforeSaving()) {
return;
}
mCallbackNewEntry = populateNewEntry();
OnFinish onFinish = new AfterSave();
EntryEditActivity act = EntryEditActivity.this;
RunnableOnFinish task;
if ( mIsNew ) {
task = new AddEntry(act, App.getDB(), mCallbackNewEntry, onFinish);
} else {
task = new UpdateEntry(act, App.getDB(), mEntry, mCallbackNewEntry, onFinish);
}
ProgressTask pt = new ProgressTask(act, task, R.string.saving_database);
pt.run();
}
});
if (mEntry.allowExtraFields()) {
View add = findViewById(R.id.add_new_field);
add.setVisibility(View.VISIBLE);
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EntryEditNewField ees = new EntryEditNewField(EntryEditActivity.this);
ees.setData("", new ProtectedString(false, ""));
entryExtraFieldsContainer.addView(ees);
// Scroll bottom
scrollView.post(new Runnable() {
@Override
public void run() {
scrollView.fullScroll(ScrollView.FOCUS_DOWN);
}
});
}
});
}
}
protected boolean validateBeforeSaving() {
// Require title
String title = entryTitleView.getText().toString();
if ( title.length() == 0 ) {
Toast.makeText(this, R.string.error_title_required, Toast.LENGTH_LONG).show();
return false;
}
// Validate password
String pass = entryPasswordView.getText().toString();
String conf = entryConfirmationPasswordView.getText().toString();
if ( ! pass.equals(conf) ) {
Toast.makeText(this, R.string.error_pass_match, Toast.LENGTH_LONG).show();
return false;
}
// Validate extra fields
if (mEntry.allowExtraFields()) {
for (int i = 0; i < entryExtraFieldsContainer.getChildCount(); i++) {
EntryEditNewField entryEditNewField = (EntryEditNewField) entryExtraFieldsContainer.getChildAt(i);
String key = entryEditNewField.getLabel();
if (key == null || key.length() == 0) {
Toast.makeText(this, R.string.error_string_key, Toast.LENGTH_LONG).show();
return false;
}
}
}
return true;
}
protected PwEntry populateNewEntry() {
if (mEntry instanceof PwEntryV4) {
// TODO backup
PwEntryV4 newEntry = (PwEntryV4) mEntry.clone(true);
newEntry.history = (ArrayList<PwEntryV4>) newEntry.history.clone();
newEntry.createBackup((PwDatabaseV4) App.getDB().pm);
}
PwEntry newEntry = mEntry.clone(true);
Date now = Calendar.getInstance().getTime();
newEntry.setLastAccessTime(now);
newEntry.setLastModificationTime(now);
PwDatabase db = App.getDB().pm;
newEntry.setTitle(entryTitleView.getText().toString(), db);
if(mSelectedIconID != -1)
// or TODO icon factory newEntry.setIcon(App.getDB().pm.iconFactory.getIcon(mSelectedIconID));
newEntry.setIcon(new PwIconStandard(mSelectedIconID));
else {
if (mIsNew) {
newEntry.setIcon(App.getDB().pm.iconFactory.getIcon(0));
}
else {
// Keep previous icon, if no new one was selected
newEntry.setIcon(mEntry.icon);
}
}
newEntry.setUrl(entryUrlView.getText().toString(), db);
newEntry.setUsername(entryUserNameView.getText().toString(), db);
newEntry.setNotes(entryCommentView.getText().toString(), db);
newEntry.setPassword(entryPasswordView.getText().toString(), db);
if (newEntry.allowExtraFields()) {
// Delete all new standard strings
newEntry.removeExtraFields();
// Add extra fields from views
for (int i = 0; i < entryExtraFieldsContainer.getChildCount(); i++) {
EntryEditNewField view = (EntryEditNewField) entryExtraFieldsContainer.getChildAt(i);
String key = view.getLabel();
String value = view.getValue();
boolean protect = view.isProtected();
newEntry.addField(key, new ProtectedString(protect, value));
}
}
return newEntry;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
MenuUtil.donationMenuInflater(inflater, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
switch ( item.getItemId() ) {
case R.id.menu_donate:
return MenuUtil.onDonationItemSelected(this);
case android.R.id.home:
finish();
}
return super.onOptionsItemSelected(item);
}
protected void fillData() {
ImageButton currIconButton = (ImageButton) findViewById(R.id.icon_button);
App.getDB().drawFactory.assignDrawableTo(currIconButton, getResources(), mEntry.getIcon());
boolean visibilityFont = PreferencesUtil.fieldFontIsInVisibility(this);
entryTitleView.setText(mEntry.getTitle());
entryUserNameView.setText(mEntry.getUsername());
entryUrlView.setText(mEntry.getUrl());
String password = mEntry.getPassword();
entryPasswordView.setText(password);
entryConfirmationPasswordView.setText(password);
entryCommentView.setText(mEntry.getNotes());
Util.applyFontVisibilityToTextView(visibilityFont, entryCommentView);
if (mEntry.allowExtraFields()) {
LinearLayout container = (LinearLayout) findViewById(R.id.advanced_container);
for (Map.Entry<String, ProtectedString> pair : mEntry.getExtraProtectedFields().entrySet()) {
EntryEditNewField entryEditNewField = new EntryEditNewField(EntryEditActivity.this);
entryEditNewField.setData(pair.getKey(), pair.getValue());
entryEditNewField.setFontVisibility(visibilityFont);
container.addView(entryEditNewField);
}
}
}
@Override
public void iconPicked(Bundle bundle) {
mSelectedIconID = bundle.getInt(IconPickerDialogFragment.KEY_ICON_ID);
ImageButton currIconButton = (ImageButton) findViewById(R.id.icon_button);
currIconButton.setImageResource(Icons.iconToResId(mSelectedIconID));
}
@Override
public void acceptPassword(Bundle bundle) {
String generatedPassword = bundle.getString(GeneratePasswordDialogFragment.KEY_PASSWORD_ID);
entryPasswordView.setText(generatedPassword);
entryConfirmationPasswordView.setText(generatedPassword);
}
@Override
public void cancelPassword(Bundle bundle) {
// Do nothing here
}
@Override
public void finish() {
// Assign entry callback as a result in all case
if (mCallbackNewEntry != null) {
Intent intentEntry = new Intent();
if (mIsNew) {
intentEntry.putExtra(ADD_OR_UPDATE_ENTRY_KEY, mCallbackNewEntry);
setResult(ADD_ENTRY_RESULT_CODE, intentEntry);
} else {
intentEntry.putExtra(ADD_OR_UPDATE_ENTRY_KEY, mCallbackNewEntry);
setResult(UPDATE_ENTRY_RESULT_CODE, intentEntry);
}
}
super.finish();
}
private final class AfterSave extends OnFinish {
AfterSave() {
super(new Handler());
}
@Override
public void run() {
if ( mSuccess ) {
finish();
} else {
displayMessage(EntryEditActivity.this);
}
}
}
}

View File

@@ -1,426 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.activities;
import android.app.Activity;
import android.app.Dialog;
import android.app.SearchManager;
import android.app.assist.AssistStructure;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.annotation.RequiresApi;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import com.keepassdroid.adapters.NodeAdapter;
import com.keepassdroid.app.App;
import com.keepassdroid.autofill.AutofillHelper;
import com.keepassdroid.database.Database;
import com.keepassdroid.database.PwEntry;
import com.keepassdroid.database.PwGroup;
import com.keepassdroid.database.PwGroupId;
import com.keepassdroid.database.PwNode;
import com.keepassdroid.database.SortNodeEnum;
import com.keepassdroid.database.edit.AddGroup;
import com.keepassdroid.database.edit.DeleteEntry;
import com.keepassdroid.database.edit.DeleteGroup;
import com.keepassdroid.dialog.ReadOnlyDialog;
import com.keepassdroid.fragments.AssignMasterKeyDialogFragment;
import com.keepassdroid.fragments.GroupEditDialogFragment;
import com.keepassdroid.fragments.IconPickerDialogFragment;
import com.keepassdroid.password.PasswordActivity;
import com.keepassdroid.search.SearchResultsActivity;
import com.keepassdroid.tasks.ProgressTask;
import com.keepassdroid.view.ListNodesWithAddButtonView;
import com.kunzisoft.keepass.R;
public class GroupActivity extends ListNodesActivity
implements GroupEditDialogFragment.EditGroupListener, IconPickerDialogFragment.IconPickerListener {
protected boolean addGroupEnabled = false;
protected boolean addEntryEnabled = false;
protected boolean isRoot = false;
protected boolean readOnly = false;
protected EditGroupDialogAction editGroupDialogAction = EditGroupDialogAction.NONE;
private ListNodesWithAddButtonView rootView;
private AutofillHelper autofillHelper;
private enum EditGroupDialogAction {
CREATION, UPDATE, NONE
}
private static final String TAG = "Group Activity:";
public static void launch(Activity act) {
launch(act, (PwGroup) null);
}
public static void launch(Activity act, PwGroup group) {
Intent intent = new Intent(act, GroupActivity.class);
if ( group != null ) {
intent.putExtra(KEY_ENTRY, group.getId());
}
act.startActivityForResult(intent, 0);
}
@RequiresApi(api = Build.VERSION_CODES.O)
public static void launch(Activity act, AssistStructure assistStructure) {
launch(act, null, assistStructure);
}
@RequiresApi(api = Build.VERSION_CODES.O)
public static void launch(Activity act, PwGroup group, AssistStructure assistStructure) {
if ( assistStructure != null ) {
Intent intent = new Intent(act, GroupActivity.class);
if ( group != null ) {
intent.putExtra(KEY_ENTRY, group.getId());
}
AutofillHelper.addAssistStructureExtraInIntent(intent, assistStructure);
act.startActivityForResult(intent, AutofillHelper.AUTOFILL_RESPONSE_REQUEST_CODE);
} else {
launch(act, group);
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.w(TAG, "Retrieved tree");
if ( mCurrentGroup == null ) {
Log.w(TAG, "Group was null");
return;
}
// Construct main view
rootView = new ListNodesWithAddButtonView(this);
rootView.enableAddGroup(addGroupEnabled);
rootView.enableAddEntry(addEntryEnabled);
setContentView(rootView);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
if ( mCurrentGroup.getParent() != null )
toolbar.setNavigationIcon(R.drawable.ic_arrow_up_white_24dp);
rootView.setAddGroupClickListener(new View.OnClickListener() {
public void onClick(View v) {
editGroupDialogAction = EditGroupDialogAction.CREATION;
GroupEditDialogFragment groupEditDialogFragment = new GroupEditDialogFragment();
groupEditDialogFragment.show(getSupportFragmentManager(),
GroupEditDialogFragment.TAG_CREATE_GROUP);
}
});
rootView.setAddEntryClickListener(new View.OnClickListener() {
public void onClick(View v) {
EntryEditActivity.Launch(GroupActivity.this, mCurrentGroup);
}
});
setGroupTitle();
setGroupIcon();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
autofillHelper = new AutofillHelper();
autofillHelper.retrieveAssistStructure(getIntent());
}
Log.w(TAG, "Finished creating tree");
if (isRoot) {
showWarnings();
}
}
protected PwGroup initCurrentGroup() {
PwGroup currentGroup;
Database db = App.getDB();
readOnly = db.readOnly;
PwGroup root = db.pm.rootGroup;
Log.w(TAG, "Creating tree view");
PwGroupId pwGroupId = (PwGroupId) getIntent().getSerializableExtra(KEY_ENTRY);
if ( pwGroupId == null ) {
currentGroup = root;
} else {
currentGroup = db.pm.groups.get(pwGroupId);
}
addGroupEnabled = !readOnly;
addEntryEnabled = !readOnly;
isRoot = (currentGroup == root);
if ( !currentGroup.allowAddEntryIfIsRoot() )
addEntryEnabled = !isRoot && addEntryEnabled;
return currentGroup;
}
@Override
protected RecyclerView defineNodeList() {
return (RecyclerView) findViewById(R.id.nodes_list);
}
@Override
public void onNodeClick(PwNode node) {
// Add event when we have Autofill
AssistStructure assistStructure = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
assistStructure = autofillHelper.getAssistStructure();
if (assistStructure != null) {
mAdapter.registerANodeToUpdate(node);
switch (node.getType()) {
case GROUP:
GroupActivity.launch(this, (PwGroup) node, assistStructure);
break;
case ENTRY:
// Build response with the entry selected
autofillHelper.buildResponseWhenEntrySelected(this, (PwEntry) node);
finish();
break;
}
}
}
if ( assistStructure == null ){
super.onNodeClick(node);
}
}
@Override
protected void addOptionsToAdapter(NodeAdapter nodeAdapter) {
super.addOptionsToAdapter(nodeAdapter);
nodeAdapter.setActivateContextMenu(true);
nodeAdapter.setNodeMenuListener(new NodeAdapter.NodeMenuListener() {
@Override
public boolean onOpenMenuClick(PwNode node) {
mAdapter.registerANodeToUpdate(node);
switch (node.getType()) {
case GROUP:
GroupActivity.launch(GroupActivity.this, (PwGroup) node);
break;
case ENTRY:
EntryActivity.launch(GroupActivity.this, (PwEntry) node);
break;
}
return true;
}
@Override
public boolean onEditMenuClick(PwNode node) {
mAdapter.registerANodeToUpdate(node);
switch (node.getType()) {
case GROUP:
editGroupDialogAction = EditGroupDialogAction.UPDATE;
GroupEditDialogFragment groupEditDialogFragment =
GroupEditDialogFragment.build(node);
groupEditDialogFragment.show(getSupportFragmentManager(),
GroupEditDialogFragment.TAG_CREATE_GROUP);
break;
case ENTRY:
EntryEditActivity.Launch(GroupActivity.this, (PwEntry) node);
break;
}
return true;
}
@Override
public boolean onDeleteMenuClick(PwNode node) {
switch (node.getType()) {
case GROUP:
deleteGroup((PwGroup) node);
break;
case ENTRY:
deleteEntry((PwEntry) node);
break;
}
return true;
}
});
}
@Override
protected void onResume() {
super.onResume();
// Show button on resume
rootView.showButton();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
AutofillHelper.onActivityResultSetResultAndFinish(this, requestCode, resultCode, data);
}
}
@Override
public void onSortSelected(SortNodeEnum sortNodeEnum, boolean ascending, boolean groupsBefore, boolean recycleBinBottom) {
super.onSortSelected(sortNodeEnum, ascending, groupsBefore, recycleBinBottom);
// Show button if hide after sort
rootView.showButton();
}
protected void setGroupIcon() {
if (mCurrentGroup != null) {
ImageView iv = (ImageView) findViewById(R.id.icon);
App.getDB().drawFactory.assignDrawableTo(iv, getResources(), mCurrentGroup.getIcon());
}
}
private void deleteEntry(PwEntry entry) {
Handler handler = new Handler();
DeleteEntry task = new DeleteEntry(this, App.getDB(), entry,
new AfterDeleteNode(handler, entry));
ProgressTask pt = new ProgressTask(this, task, R.string.saving_database);
pt.run();
}
private void deleteGroup(PwGroup group) {
//TODO Verify trash recycle bin
Handler handler = new Handler();
DeleteGroup task = new DeleteGroup(this, App.getDB(), group,
new AfterDeleteNode(handler, group));
ProgressTask pt = new ProgressTask(this, task, R.string.saving_database);
pt.run();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.search, menu);
inflater.inflate(R.menu.database_master_key, menu);
inflater.inflate(R.menu.database_lock, menu);
// Get the SearchView and set the searchable configuration
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
assert searchManager != null;
MenuItem searchItem = menu.findItem(R.id.menu_search);
SearchView searchView = null;
if (searchItem != null) {
searchView = (SearchView) searchItem.getActionView();
}
if (searchView != null) {
searchView.setSearchableInfo(searchManager.getSearchableInfo(new ComponentName(this, SearchResultsActivity.class)));
searchView.setIconifiedByDefault(false); // Do not iconify the widget; expand it by default
}
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
case R.id.menu_search:
onSearchRequested();
return true;
case R.id.menu_lock:
App.setShutdown();
setResult(PasswordActivity.RESULT_EXIT_LOCK);
finish();
return true;
case R.id.menu_change_master_key:
setPassword();
return true;
}
return super.onOptionsItemSelected(item);
}
private void setPassword() {
AssignMasterKeyDialogFragment dialog = new AssignMasterKeyDialogFragment();
dialog.show(getSupportFragmentManager(), "passwordDialog");
}
@Override
public void approveEditGroup(Bundle bundle) {
String GroupName = bundle.getString(GroupEditDialogFragment.KEY_NAME);
int GroupIconID = bundle.getInt(GroupEditDialogFragment.KEY_ICON_ID);
switch (editGroupDialogAction) {
case CREATION:
// If edit group creation
Handler handler = new Handler();
AddGroup task = new AddGroup(this, App.getDB(), GroupName, GroupIconID, mCurrentGroup,
new AfterAddNode(handler), false);
ProgressTask pt = new ProgressTask(this, task, R.string.saving_database);
pt.run();
break;
case UPDATE:
// If edit group update
// TODO UpdateGroup
break;
}
editGroupDialogAction = EditGroupDialogAction.NONE;
}
@Override
public void cancelEditGroup(Bundle bundle) {
// Do nothing here
}
@Override
// For icon in create tree dialog
public void iconPicked(Bundle bundle) {
GroupEditDialogFragment groupEditDialogFragment =
(GroupEditDialogFragment) getSupportFragmentManager()
.findFragmentByTag(GroupEditDialogFragment.TAG_CREATE_GROUP);
if (groupEditDialogFragment != null) {
groupEditDialogFragment.iconPicked(bundle);
}
}
protected void showWarnings() {
if (App.getDB().readOnly) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (prefs.getBoolean(getString(R.string.show_read_only_warning), true)) {
Dialog dialog = new ReadOnlyDialog(this);
dialog.show();
}
}
}
}

View File

@@ -1,314 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.activities;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import com.keepassdroid.adapters.NodeAdapter;
import com.keepassdroid.app.App;
import com.keepassdroid.compat.ActivityCompat;
import com.keepassdroid.compat.EditorCompat;
import com.keepassdroid.database.PwDatabase;
import com.keepassdroid.database.PwEntry;
import com.keepassdroid.database.PwGroup;
import com.keepassdroid.database.PwNode;
import com.keepassdroid.database.edit.AfterAddNodeOnFinish;
import com.keepassdroid.database.edit.OnFinish;
import com.keepassdroid.fragments.AssignMasterKeyDialogFragment;
import com.keepassdroid.fragments.SortDialogFragment;
import com.keepassdroid.settings.PreferencesUtil;
import com.keepassdroid.tasks.UIToastTask;
import com.keepassdroid.utils.MenuUtil;
import com.keepassdroid.database.SortNodeEnum;
import com.keepassdroid.view.AssignPasswordHelper;
import com.kunzisoft.keepass.R;
public abstract class ListNodesActivity extends LockingActivity
implements AssignMasterKeyDialogFragment.AssignPasswordDialogListener,
NodeAdapter.OnNodeClickCallback,
SortDialogFragment.SortSelectionListener {
public static final String KEY_ENTRY = "entry";
protected PwGroup mCurrentGroup;
protected NodeAdapter mAdapter;
private SharedPreferences prefs;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if ( isFinishing() ) {
return;
}
// Likely the app has been killed exit the activity
if ( ! App.getDB().Loaded() ) {
finish();
return;
}
prefs = PreferenceManager.getDefaultSharedPreferences(this);
ActivityCompat.invalidateOptionsMenu(this);
setContentView(R.layout.list_nodes);
mCurrentGroup = initCurrentGroup();
mAdapter = new NodeAdapter(this);
addOptionsToAdapter(mAdapter);
}
protected abstract PwGroup initCurrentGroup();
protected abstract RecyclerView defineNodeList();
protected void addOptionsToAdapter(NodeAdapter nodeAdapter) {
mAdapter.setOnNodeClickListener(this);
}
@Override
protected void onResume() {
super.onResume();
// Add elements to the list
mAdapter.rebuildList(mCurrentGroup);
assignListToNodeAdapter(defineNodeList());
}
protected void setGroupTitle() {
if ( mCurrentGroup != null ) {
String name = mCurrentGroup.getName();
TextView tv = (TextView) findViewById(R.id.group_name);
if ( name != null && name.length() > 0 ) {
if ( tv != null ) {
tv.setText(name);
}
} else {
if ( tv != null ) {
tv.setText(getText(R.string.root));
}
}
}
}
protected void assignListToNodeAdapter(RecyclerView recyclerView) {
recyclerView.setScrollBarStyle(View.SCROLLBARS_INSIDE_INSET);
// TODO mList.setTextFilterEnabled(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(mAdapter);
}
@Override
public void onNodeClick(PwNode node) {
mAdapter.registerANodeToUpdate(node);
switch (node.getType()) {
case GROUP:
GroupActivity.launch(this, (PwGroup) node);
break;
case ENTRY:
EntryActivity.launch(this, (PwEntry) node);
break;
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
MenuUtil.donationMenuInflater(inflater, menu);
inflater.inflate(R.menu.tree, menu);
inflater.inflate(R.menu.default_menu, menu);
return true;
}
@Override
public void onSortSelected(SortNodeEnum sortNodeEnum, boolean ascending, boolean groupsBefore, boolean recycleBinBottom) {
// Toggle setting
Editor editor = prefs.edit();
editor.putString(getString(R.string.sort_node_key), sortNodeEnum.name());
editor.putBoolean(getString(R.string.sort_ascending_key), ascending);
editor.putBoolean(getString(R.string.sort_group_before_key), groupsBefore);
editor.putBoolean(getString(R.string.sort_recycle_bin_bottom_key), recycleBinBottom);
EditorCompat.apply(editor);
// Tell the adapter to refresh it's list
mAdapter.notifyChangeSort(sortNodeEnum, ascending, groupsBefore);
mAdapter.rebuildList(mCurrentGroup);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch ( item.getItemId() ) {
case R.id.menu_sort:
SortDialogFragment sortDialogFragment;
PwDatabase database = App.getDB().pm;
/*
// TODO Recycle bin bottom
if (database.isRecycleBinAvailable() && database.isRecycleBinEnable()) {
sortDialogFragment =
SortDialogFragment.getInstance(
PrefsUtil.getListSort(this),
PrefsUtil.getAscendingSort(this),
PrefsUtil.getGroupsBeforeSort(this),
PrefsUtil.getRecycleBinBottomSort(this));
} else {
*/
sortDialogFragment =
SortDialogFragment.getInstance(
PreferencesUtil.getListSort(this),
PreferencesUtil.getAscendingSort(this),
PreferencesUtil.getGroupsBeforeSort(this));
//}
sortDialogFragment.show(getSupportFragmentManager(), "sortDialog");
return true;
default:
MenuUtil.onDefaultMenuOptionsItemSelected(this, item);
return super.onOptionsItemSelected(item);
}
}
@Override
public void onAssignKeyDialogPositiveClick(
boolean masterPasswordChecked, String masterPassword,
boolean keyFileChecked, Uri keyFile) {
AssignPasswordHelper assignPasswordHelper =
new AssignPasswordHelper(this,
masterPassword, keyFile);
assignPasswordHelper.assignPasswordInDatabase(null);
}
@Override
public void onAssignKeyDialogNegativeClick(
boolean masterPasswordChecked, String masterPassword,
boolean keyFileChecked, Uri keyFile) {
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case EntryEditActivity.ADD_OR_UPDATE_ENTRY_REQUEST_CODE:
if (resultCode == EntryEditActivity.ADD_ENTRY_RESULT_CODE ||
resultCode == EntryEditActivity.UPDATE_ENTRY_RESULT_CODE) {
PwNode newNode = (PwNode) data.getSerializableExtra(EntryEditActivity.ADD_OR_UPDATE_ENTRY_KEY);
if (newNode != null) {
if (resultCode == EntryEditActivity.ADD_ENTRY_RESULT_CODE)
mAdapter.addNode(newNode);
if (resultCode == EntryEditActivity.UPDATE_ENTRY_RESULT_CODE) {
//mAdapter.updateLastNodeRegister(newNode);
mAdapter.rebuildList(mCurrentGroup);
}
} else {
Log.e(this.getClass().getName(), "New node can be retrieve in Activity Result");
}
}
break;
}
}
@Override
public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
/*
* ACTION_SEARCH automatically forces a new task. This occurs when you open a kdb file in
* another app such as Files or GoogleDrive and then Search for an entry. Here we remove the
* FLAG_ACTIVITY_NEW_TASK flag bit allowing search to open it's activity in the current task.
*/
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
int flags = intent.getFlags();
flags &= ~Intent.FLAG_ACTIVITY_NEW_TASK;
intent.setFlags(flags);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
super.startActivityForResult(intent, requestCode, options);
}
}
class AfterAddNode extends AfterAddNodeOnFinish {
AfterAddNode(Handler handler) {
super(handler);
}
public void run(PwNode pwNode) {
super.run();
if (mSuccess) {
mAdapter.addNode(pwNode);
} else {
displayMessage(ListNodesActivity.this);
}
}
}
class AfterDeleteNode extends OnFinish {
private PwNode pwNode;
AfterDeleteNode(Handler handler, PwNode pwNode) {
super(handler);
this.pwNode = pwNode;
}
@Override
public void run() {
if ( mSuccess) {
mAdapter.removeNode(pwNode);
PwGroup parent = pwNode.getParent();
PwDatabase database = App.getDB().pm;
if (database.isRecycleBinAvailable() && database.isRecycleBinEnable()) {
PwGroup recycleBin = database.getRecycleBin();
// Add trash if it doesn't exists
if (parent.equals(recycleBin)
&& mCurrentGroup.getParent() == null
&& !mCurrentGroup.equals(recycleBin)) {
mAdapter.addNode(parent);
}
}
} else {
mHandler.post(new UIToastTask(ListNodesActivity.this, "Unrecoverable error: " + mMessage));
App.setShutdown();
finish();
}
}
}
}

View File

@@ -1,86 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.activities;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.annotation.Nullable;
import com.keepassdroid.app.App;
import com.keepassdroid.settings.PreferencesUtil;
import com.keepassdroid.stylish.StylishActivity;
import com.keepassdroid.timeout.TimeoutHelper;
public abstract class LockingActivity extends StylishActivity {
private ScreenReceiver screenReceiver;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (PreferencesUtil.isLockDatabaseWhenScreenShutOffEnable(this)) {
screenReceiver = new ScreenReceiver();
registerReceiver(screenReceiver, new IntentFilter((Intent.ACTION_SCREEN_OFF)));
} else
screenReceiver = null;
}
@Override
protected void onResume() {
super.onResume();
TimeoutHelper.checkShutdown(this);
TimeoutHelper.recordTime(this);
}
@Override
protected void onPause() {
super.onPause();
TimeoutHelper.checkTime(this);
TimeoutHelper.checkShutdown(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
if(screenReceiver != null)
unregisterReceiver(screenReceiver);
}
public class ScreenReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if(intent.getAction() != null) {
if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
if (PreferencesUtil.isLockDatabaseWhenScreenShutOffEnable(LockingActivity.this)) {
App.setShutdown();
TimeoutHelper.checkShutdown(LockingActivity.this);
}
}
}
}
}
}

View File

@@ -1,17 +0,0 @@
package com.keepassdroid.adapters;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
abstract class BasicViewHolder extends RecyclerView.ViewHolder {
View container;
ImageView icon;
TextView text;
BasicViewHolder(View itemView) {
super(itemView);
}
}

View File

@@ -1,17 +0,0 @@
package com.keepassdroid.adapters;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.kunzisoft.keepass.R;
class EntryViewHolder extends BasicViewHolder {
EntryViewHolder(View itemView) {
super(itemView);
container = itemView.findViewById(R.id.entry_container);
icon = (ImageView) itemView.findViewById(R.id.entry_icon);
text = (TextView) itemView.findViewById(R.id.entry_text);
}
}

View File

@@ -1,17 +0,0 @@
package com.keepassdroid.adapters;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.kunzisoft.keepass.R;
class GroupViewHolder extends BasicViewHolder {
GroupViewHolder(View itemView) {
super(itemView);
container = itemView.findViewById(R.id.group_container);
icon = (ImageView) itemView.findViewById(R.id.group_icon);
text = (TextView) itemView.findViewById(R.id.group_text);
}
}

View File

@@ -1,47 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.compat;
import java.lang.reflect.Method;
import android.app.Activity;
public class ActivityCompat {
private static Method invalidateOptMenu;
static {
try {
invalidateOptMenu = Activity.class.getMethod("invalidateOptionsMenu", (Class<Activity>[]) null);
} catch (Exception e) {
// Do nothing if method dosen't exist
}
}
public static void invalidateOptionsMenu(Activity act) {
if (invalidateOptMenu != null) {
try {
invalidateOptMenu.invoke(act, (Object[]) null);
} catch (Exception e) {
// Do nothing
}
}
}
}

View File

@@ -1,66 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.compat;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import android.content.Context;
@SuppressWarnings({"unchecked", "rawtypes"})
public class BackupManagerCompat {
private static Class classBackupManager;
private static Constructor constructorBackupManager;
private static Method dataChanged;
private Object backupManager;
static {
try {
classBackupManager = Class.forName("android.app.backup.BackupManager");
constructorBackupManager = classBackupManager.getConstructor(Context.class);
dataChanged = classBackupManager.getMethod("dataChanged", (Class[]) null);
} catch (Exception e) {
// Do nothing, class does not exist
}
}
public BackupManagerCompat(Context ctx) {
if (constructorBackupManager != null) {
try {
backupManager = constructorBackupManager.newInstance(ctx);
} catch (Exception e) {
// Do nothing
}
}
}
public void dataChanged() {
if (backupManager != null && dataChanged != null) {
try {
dataChanged.invoke(backupManager, (Object[]) null);
} catch (Exception e) {
// Do nothing
}
}
}
}

View File

@@ -1,53 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.compat;
import java.lang.reflect.Constructor;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
// This compatiblity hack can go away when support for Android 1.5 api level 3 is dropped
public class BitmapDrawableCompat {
private static Constructor<BitmapDrawable> constResBitmap;
static {
try {
constResBitmap = BitmapDrawable.class.getConstructor(Resources.class, Bitmap.class);
// This constructor is support in this api version
} catch (Exception e) {
// This constructor is not supported
}
}
public static BitmapDrawable getBitmapDrawable(Resources res, Bitmap bitmap) {
if (constResBitmap != null) {
try {
return constResBitmap.newInstance(res, bitmap);
} catch (Exception e) {
// Do nothing, fall through to the safe constructor
}
}
return new BitmapDrawable(bitmap);
}
}

View File

@@ -1,70 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.compat;
import java.lang.reflect.Field;
import android.os.Build;
public class BuildCompat {
private static Field manufacturer;
private static String manuText;
public static final int VERSION_CODE_GINGERBREAD = 9;
public static final int VERSION_CODE_ICE_CREAM_SANDWICH = 14;
public static final int VERSION_CODE_JELLY_BEAN = 16;
public static final int VERSION_CODE_JELLY_BEAN_MR2 = 18;
public static final int VERSION_KITKAT = 19;
public static final int VERSION_CODE_M = 23;
private static Field versionSDK;
private static int versionInt;
static {
// MANUFACTURER is only available in API version 4 and later
try {
manufacturer = Build.class.getField("MANUFACTURER");
manuText = (String) manufacturer.get(null);
} catch (Exception e) {
manuText = "";
}
// SDK is only available in API version 4 and later
try {
versionSDK = Build.VERSION.class.getField("SDK_INT");
versionInt = versionSDK.getInt(null);
} catch (Exception e) {
try {
versionInt = Integer.parseInt(Build.VERSION.SDK);
} catch (Exception nfe) {
versionInt = -1;
}
}
}
public static String getManufacturer() {
return manuText;
}
public static int getSdkVersion() {
return versionInt;
}
}

View File

@@ -1,52 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.compat;
import android.content.ContentResolver;
import android.net.Uri;
import java.lang.reflect.Method;
public class ContentResolverCompat {
public static boolean available;
private static Class contentResolver;
private static Method takePersistableUriPermission;
static {
try {
contentResolver = ContentResolver.class;
takePersistableUriPermission = contentResolver.getMethod("takePersistableUriPermission", new Class[]{Uri.class, int.class});
available = true;
} catch (Exception e) {
available = false;
}
}
public static void takePersistableUriPermission(ContentResolver resolver, Uri uri, int modeFlags) {
if (available) {
try {
takePersistableUriPermission.invoke(resolver, new Object[]{uri, modeFlags});
} catch (Exception e) {
// Fail silently
}
}
}
}

View File

@@ -1,53 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.compat;
import java.lang.reflect.Method;
import android.app.Activity;
import android.content.SharedPreferences;
public class EditorCompat {
private static Method apply;
static {
try {
apply = Activity.class.getMethod("apply", (Class<SharedPreferences.Editor>[]) null);
} catch (Exception e) {
// Substitute commit for apply when not available (API level < 9)
try {
apply = Activity.class.getMethod("commit", (Class<SharedPreferences.Editor>[]) null);
} catch (Exception f) {
// Should be impossible, but leave apply null in this case
}
}
}
public static void apply(SharedPreferences.Editor edit) {
try {
apply.invoke(edit, (Object[]) null);
} catch (Exception e) {
// Shouldn't be possible, but call commit directly if this happens
edit.commit();
}
}
}

View File

@@ -1,72 +0,0 @@
/*
* Copyright 2017 Brian Pellin.
*
* This file is part of KeePassDroid.
*
* KeePassDroid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePassDroid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePassDroid. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.compat;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.security.spec.AlgorithmParameterSpec;
public class KeyGenParameterSpecCompat {
private static Class builder;
private static Constructor buildConst;
private static Method builderBuild;
private static Method setBlockModes;
private static Method setUserAuthReq;
private static Method setEncPad;
private static boolean available;
static {
try {
builder = Class.forName("android.security.keystore.KeyGenParameterSpec$Builder");
buildConst = builder.getConstructor(String.class, int.class);
builderBuild = builder.getMethod("build", (Class [])null);
setBlockModes = builder.getMethod("setBlockModes", String[].class);
setUserAuthReq = builder.getMethod("setUserAuthenticationRequired", new Class []{boolean.class});
setEncPad = builder.getMethod("setEncryptionPaddings", String[].class);
available = true;
} catch (Exception e) {
available = false;
}
}
public static AlgorithmParameterSpec build(String keystoreAlias, int purpose, String blockMode,
boolean userAuthReq, String encPadding) {
if (!available) {
return null;
}
try {
Object inst = buildConst.newInstance(keystoreAlias, purpose);
inst = setBlockModes.invoke(inst, new Object[] {new String[] {blockMode}});
inst = setUserAuthReq.invoke(inst, userAuthReq);
inst = setEncPad.invoke(inst, new Object[] {new String[] {encPadding}});
return (AlgorithmParameterSpec) builderBuild.invoke(inst, null);
} catch (Exception e) {
return null;
}
}
}

View File

@@ -1,53 +0,0 @@
/*
* Copyright 2017 Brian Pellin.
*
* This file is part of KeePassDroid.
*
* KeePassDroid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePassDroid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePassDroid. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.compat;
import android.app.KeyguardManager;
import java.lang.reflect.Method;
public class KeyguardManagerCompat {
private static Method isKeyguardSecure;
private static boolean available;
static {
try {
isKeyguardSecure = KeyguardManager.class.getMethod("isKeyguardSecure", (Class[]) null);
available = true;
} catch (Exception e) {
available = false;
}
}
public static boolean isKeyguardSecure(KeyguardManager inst) {
if (!available) {
return false;
}
try {
return (boolean) isKeyguardSecure.invoke(inst, null);
} catch (Exception e) {
return false;
}
}
}

View File

@@ -1,49 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.crypto.keyDerivation;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public class KdfFactory {
public static List<KdfEngine> kdfList = new ArrayList<KdfEngine>();
static {
kdfList.add(new AesKdf());
kdfList.add(new Argon2Kdf());
}
public static KdfParameters getDefaultParameters() {
return kdfList.get(0).getDefaultParameters();
}
public static KdfEngine get(UUID uuid) {
for (KdfEngine engine: kdfList) {
if (engine.uuid.equals(uuid)) {
return engine;
}
}
return null;
}
}

View File

@@ -1,227 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.database;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri;
import android.preference.PreferenceManager;
import android.util.Log;
import com.keepassdroid.database.exception.ContentFileNotFoundException;
import com.keepassdroid.database.exception.InvalidDBException;
import com.keepassdroid.database.exception.InvalidPasswordException;
import com.keepassdroid.database.exception.PwDbOutputException;
import com.keepassdroid.database.load.Importer;
import com.keepassdroid.database.load.ImporterFactory;
import com.keepassdroid.database.save.PwDbOutput;
import com.keepassdroid.icons.DrawableFactory;
import com.keepassdroid.search.SearchDbHelper;
import com.keepassdroid.tasks.UpdateStatus;
import com.keepassdroid.utils.UriUtil;
import com.kunzisoft.keepass.R;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.SyncFailedException;
/**
* @author bpellin
*/
public class Database {
public PwDatabase pm;
public Uri mUri;
public SearchDbHelper searchHelper;
public boolean readOnly = false;
public boolean passwordEncodingError = false;
public DrawableFactory drawFactory = new DrawableFactory();
private boolean loaded = false;
public boolean Loaded() {
return loaded;
}
public void setLoaded() {
loaded = true;
}
public void LoadData(Context ctx, InputStream is, String password, InputStream keyInputStream) throws IOException, InvalidDBException {
LoadData(ctx, is, password, keyInputStream, new UpdateStatus(), !Importer.DEBUG);
}
public void LoadData(Context ctx, Uri uri, String password, Uri keyfile) throws IOException, FileNotFoundException, InvalidDBException {
LoadData(ctx, uri, password, keyfile, new UpdateStatus(), !Importer.DEBUG);
}
public void LoadData(Context ctx, Uri uri, String password, Uri keyfile, UpdateStatus status) throws IOException, FileNotFoundException, InvalidDBException {
LoadData(ctx, uri, password, keyfile, status, !Importer.DEBUG);
}
public void LoadData(Context ctx, Uri uri, String password, Uri keyfile, UpdateStatus status, boolean debug) throws IOException, FileNotFoundException, InvalidDBException {
mUri = uri;
readOnly = false;
if (uri.getScheme().equals("file")) {
File file = new File(uri.getPath());
readOnly = !file.canWrite();
}
try {
passUrisAsInputStreams(ctx, uri, password, keyfile, status, debug, 0);
} catch (InvalidPasswordException e) {
// Retry with rounds fix
try {
passUrisAsInputStreams(ctx, uri, password, keyfile, status, debug, getFixRounds(ctx));
} catch (Exception e2) {
// Rethrow original exception
throw e;
}
}
}
private long getFixRounds(Context ctx) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
return prefs.getLong(ctx.getString(R.string.roundsFix_key), ctx.getResources().getInteger(R.integer.roundsFix_default));
}
private void passUrisAsInputStreams(Context ctx, Uri uri, String password, Uri keyfile, UpdateStatus status, boolean debug, long roundsFix) throws IOException, FileNotFoundException, InvalidDBException {
InputStream is, kfIs;
try {
is = UriUtil.getUriInputStream(ctx, uri);
} catch (Exception e) {
Log.e("KPD", "Database::LoadData", e);
throw ContentFileNotFoundException.getInstance(uri);
}
try {
kfIs = UriUtil.getUriInputStream(ctx, keyfile);
} catch (Exception e) {
Log.e("KPD", "Database::LoadData", e);
throw ContentFileNotFoundException.getInstance(keyfile);
}
LoadData(ctx, is, password, kfIs, status, debug, roundsFix);
}
public void LoadData(Context ctx, InputStream is, String password, InputStream kfIs, boolean debug) throws IOException, InvalidDBException {
LoadData(ctx, is, password, kfIs, new UpdateStatus(), debug);
}
public void LoadData(Context ctx, InputStream is, String password, InputStream kfIs, UpdateStatus status, boolean debug) throws IOException, InvalidDBException {
LoadData(ctx, is, password, kfIs, status, debug, 0);
}
public void LoadData(Context ctx, InputStream is, String password, InputStream kfIs, UpdateStatus status, boolean debug, long roundsFix) throws IOException, InvalidDBException {
BufferedInputStream bis = new BufferedInputStream(is);
if ( ! bis.markSupported() ) {
throw new IOException("Input stream does not support mark.");
}
// We'll end up reading 8 bytes to identify the header. Might as well use two extra.
bis.mark(10);
Importer imp = ImporterFactory.createImporter(bis, debug);
bis.reset(); // Return to the start
pm = imp.openDatabase(bis, password, kfIs, status, roundsFix);
if ( pm != null ) {
PwGroup root = pm.rootGroup;
pm.populateGlobals(root);
LoadData(ctx, pm, password, kfIs, status);
}
loaded = true;
}
public void LoadData(Context ctx, PwDatabase pm, String password, InputStream keyInputStream, UpdateStatus status) {
if ( pm != null ) {
passwordEncodingError = !pm.validatePasswordEncoding(password);
}
searchHelper = new SearchDbHelper(ctx);
loaded = true;
}
public PwGroup Search(String str) {
if (searchHelper == null) { return null; }
return searchHelper.search(this, str);
}
public void SaveData(Context ctx) throws IOException, PwDbOutputException {
SaveData(ctx, mUri);
}
public void SaveData(Context ctx, Uri uri) throws IOException, PwDbOutputException {
if (uri.getScheme().equals("file")) {
String filename = uri.getPath();
File tempFile = new File(filename + ".tmp");
FileOutputStream fos = new FileOutputStream(tempFile);
//BufferedOutputStream bos = new BufferedOutputStream(fos);
//PwDbV3Output pmo = new PwDbV3Output(pm, bos, App.getCalendar());
PwDbOutput pmo = PwDbOutput.getInstance(pm, fos);
pmo.output();
//bos.flush();
//bos.close();
fos.close();
// Force data to disk before continuing
try {
fos.getFD().sync();
} catch (SyncFailedException e) {
// Ignore if fsync fails. We tried.
}
File orig = new File(filename);
if (!tempFile.renameTo(orig)) {
throw new IOException("Failed to store database.");
}
}
else {
OutputStream os;
try {
os = ctx.getContentResolver().openOutputStream(uri);
} catch (Exception e) {
throw new IOException("Failed to store database.");
}
PwDbOutput pmo = PwDbOutput.getInstance(pm, os);
pmo.output();
os.close();
}
mUri = uri;
}
public void clear() {
drawFactory.clear();
pm = null;
mUri = null;
loaded = false;
passwordEncodingError = false;
}
}

View File

@@ -1,115 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.database;
import java.util.Date;
import java.util.List;
import com.keepassdroid.database.iterator.EntrySearchStringIterator;
public abstract class EntrySearchHandler extends EntryHandler<PwEntry> {
private List<PwEntry> listStorage;
private SearchParameters sp;
private Date now;
public static EntrySearchHandler getInstance(PwGroup group, SearchParameters sp, List<PwEntry> listStorage) {
if (group instanceof PwGroupV3) {
return new EntrySearchHandlerV4(sp, listStorage);
} else if (group instanceof PwGroupV4) {
return new EntrySearchHandlerV4(sp, listStorage);
} else {
throw new RuntimeException("Not implemented.");
}
}
protected EntrySearchHandler(SearchParameters sp, List<PwEntry> listStorage) {
this.sp = sp;
this.listStorage = listStorage;
now = new Date();
}
@Override
public boolean operate(PwEntry entry) {
if (sp.respectEntrySearchingDisabled && !entry.isSearchingEnabled()) {
return true;
}
if (sp.excludeExpired && entry.expires() && now.after(entry.getExpiryTime())) {
return true;
}
String term = sp.searchString;
if (sp.ignoreCase) {
term = term.toLowerCase();
}
if (searchStrings(entry, term)) {
listStorage.add(entry);
return true;
}
if (sp.searchInGroupNames) {
PwGroup parent = entry.getParent();
if (parent != null) {
String groupName = parent.getName();
if (groupName != null) {
if (sp.ignoreCase) {
groupName = groupName.toLowerCase();
}
if (groupName.indexOf(term) >= 0) {
listStorage.add(entry);
return true;
}
}
}
}
if (searchID(entry)) {
listStorage.add(entry);
return true;
}
return true;
}
protected boolean searchID(PwEntry entry) {
return false;
}
private boolean searchStrings(PwEntry entry, String term) {
EntrySearchStringIterator iter = EntrySearchStringIterator.getInstance(entry, sp);
while (iter.hasNext()) {
String str = iter.next();
if (str != null & str.length() > 0) {
if (sp.ignoreCase) {
str = str.toLowerCase();
}
if (str.indexOf(term) >= 0) {
return true;
}
}
}
return false;
}
}

View File

@@ -1,48 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.database;
import com.keepassdroid.utils.StrUtil;
import com.keepassdroid.utils.UuidUtil;
import java.util.List;
import java.util.Locale;
public class EntrySearchHandlerV4 extends EntrySearchHandler {
private SearchParametersV4 sp;
protected EntrySearchHandlerV4(SearchParameters sp, List<PwEntry> listStorage) {
super(sp, listStorage);
this.sp = (SearchParametersV4) sp;
}
@Override
protected boolean searchID(PwEntry e) {
PwEntryV4 entry = (PwEntryV4) e;
if (sp.searchInUUIDs) {
String hex = UuidUtil.toHexString(entry.uuid);
return StrUtil.indexOfIgnoreCase(hex, sp.searchString, Locale.ENGLISH) >= 0;
}
return false;
}
}

View File

@@ -1,46 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.database;
import java.util.Date;
public interface ITimeLogger {
Date getLastModificationTime();
void setLastModificationTime(Date date);
Date getCreationTime();
void setCreationTime(Date date);
Date getLastAccessTime();
void setLastAccessTime(Date date);
Date getExpiryTime();
void setExpiryTime(Date date);
boolean expires();
void setExpires(boolean exp);
long getUsageCount();
void setUsageCount(long count);
Date getLocationChanged();
void setLocationChanged(Date date);
}

View File

@@ -1,563 +0,0 @@
/*
* Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePass DX.
*
* KeePass DX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePass DX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.database;
import android.webkit.URLUtil;
import com.keepassdroid.collections.VariantDictionary;
import com.keepassdroid.crypto.CryptoUtil;
import com.keepassdroid.crypto.engine.AesEngine;
import com.keepassdroid.crypto.engine.CipherEngine;
import com.keepassdroid.crypto.keyDerivation.AesKdf;
import com.keepassdroid.crypto.keyDerivation.KdfEngine;
import com.keepassdroid.crypto.keyDerivation.KdfFactory;
import com.keepassdroid.crypto.keyDerivation.KdfParameters;
import com.keepassdroid.database.exception.InvalidKeyFileException;
import com.keepassdroid.utils.EmptyUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import java.io.IOException;
import java.io.InputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import biz.source_code.base64Coder.Base64Coder;
public class PwDatabaseV4 extends PwDatabase {
public static final Date DEFAULT_NOW = new Date();
public static final UUID UUID_ZERO = new UUID(0,0);
public static final int DEFAULT_ROUNDS = 6000;
private static final int DEFAULT_HISTORY_MAX_ITEMS = 10; // -1 unlimited
private static final long DEFAULT_HISTORY_MAX_SIZE = 6 * 1024 * 1024; // -1 unlimited
private static final String RECYCLEBIN_NAME = "RecycleBin";
public byte[] hmacKey;
public UUID dataCipher = AesEngine.CIPHER_UUID;
public CipherEngine dataEngine = new AesEngine();
public PwCompressionAlgorithm compressionAlgorithm = PwCompressionAlgorithm.Gzip;
// TODO: Refactor me away to get directly from kdfParameters
public long numKeyEncRounds = 6000;
public Date nameChanged = DEFAULT_NOW;
public Date settingsChanged = DEFAULT_NOW;
public String description = "";
public Date descriptionChanged = DEFAULT_NOW;
public String defaultUserName = "";
public Date defaultUserNameChanged = DEFAULT_NOW;
public Date keyLastChanged = DEFAULT_NOW;
public long keyChangeRecDays = -1;
public long keyChangeForceDays = 1;
public boolean keyChangeForceOnce = false;
public long maintenanceHistoryDays = 365;
public String color = "";
public boolean recycleBinEnabled = true;
public UUID recycleBinUUID = UUID_ZERO;
public Date recycleBinChanged = DEFAULT_NOW;
public UUID entryTemplatesGroup = UUID_ZERO;
public Date entryTemplatesGroupChanged = DEFAULT_NOW;
public int historyMaxItems = DEFAULT_HISTORY_MAX_ITEMS;
public long historyMaxSize = DEFAULT_HISTORY_MAX_SIZE;
public UUID lastSelectedGroup = UUID_ZERO;
public UUID lastTopVisibleGroup = UUID_ZERO;
public MemoryProtectionConfig memoryProtection = new MemoryProtectionConfig();
public List<PwDeletedObject> deletedObjects = new ArrayList<PwDeletedObject>();
public List<PwIconCustom> customIcons = new ArrayList<PwIconCustom>();
public Map<String, String> customData = new HashMap<String, String>();
public KdfParameters kdfParameters = KdfFactory.getDefaultParameters();
public VariantDictionary publicCustomData = new VariantDictionary();
public BinaryPool binPool = new BinaryPool();
public String localizedAppName = "KeePassDroid";
public class MemoryProtectionConfig {
public boolean protectTitle = false;
public boolean protectUserName = false;
public boolean protectPassword = false;
public boolean protectUrl = false;
public boolean protectNotes = false;
public boolean autoEnableVisualHiding = false;
public boolean GetProtection(String field) {
if ( field.equalsIgnoreCase(PwDefsV4.TITLE_FIELD)) return protectTitle;
if ( field.equalsIgnoreCase(PwDefsV4.USERNAME_FIELD)) return protectUserName;
if ( field.equalsIgnoreCase(PwDefsV4.PASSWORD_FIELD)) return protectPassword;
if ( field.equalsIgnoreCase(PwDefsV4.URL_FIELD)) return protectUrl;
if ( field.equalsIgnoreCase(PwDefsV4.NOTES_FIELD)) return protectNotes;
return false;
}
}
@Override
public byte[] getMasterKey(String key, InputStream keyInputStream)
throws InvalidKeyFileException, IOException {
assert(key != null);
byte[] fKey = new byte[]{};
if ( key.length() > 0 && keyInputStream != null) {
return getCompositeKey(key, keyInputStream);
} else if ( key.length() > 0 ) {
fKey = getPasswordKey(key);
} else if ( keyInputStream != null) {
fKey = getFileKey(keyInputStream);
}
MessageDigest md;
try {
md = MessageDigest.getInstance("SHA-256");
} catch (NoSuchAlgorithmException e) {
throw new IOException("No SHA-256 implementation");
}
return md.digest(fKey);
}
@Override
public void makeFinalKey(byte[] masterSeed, byte[] masterSeed2, int numRounds) throws IOException {
byte[] transformedMasterKey = transformMasterKey(masterSeed2, masterKey, numRounds);
byte[] cmpKey = new byte[65];
System.arraycopy(masterSeed, 0, cmpKey, 0, 32);
System.arraycopy(transformedMasterKey, 0, cmpKey, 32, 32);
finalKey = CryptoUtil.resizeKey(cmpKey, 0, 64, dataEngine.keyLength());
MessageDigest md;
try {
md = MessageDigest.getInstance("SHA-512");
cmpKey[64] = 1;
hmacKey = md.digest(cmpKey);
} catch (NoSuchAlgorithmException e) {
throw new IOException("No SHA-512 implementation");
} finally {
Arrays.fill(cmpKey, (byte)0);
}
}
public void makeFinalKey(byte[] masterSeed, KdfParameters kdfP) throws IOException {
makeFinalKey(masterSeed, kdfP, 0);
}
public void makeFinalKey(byte[] masterSeed, KdfParameters kdfP, long roundsFix)
throws IOException {
KdfEngine kdfEngine = KdfFactory.get(kdfP.kdfUUID);
if (kdfEngine == null) {
throw new IOException("Unknown key derivation function");
}
// Set to 6000 rounds to open corrupted database
if (roundsFix > 0 && kdfP.kdfUUID.equals(AesKdf.CIPHER_UUID)) {
kdfP.setUInt32(AesKdf.ParamRounds, roundsFix);
numKeyEncRounds = roundsFix;
}
byte[] transformedMasterKey = kdfEngine.transform(masterKey, kdfP);
if (transformedMasterKey.length != 32) {
transformedMasterKey = CryptoUtil.hashSha256(transformedMasterKey);
}
byte[] cmpKey = new byte[65];
System.arraycopy(masterSeed, 0, cmpKey, 0, 32);
System.arraycopy(transformedMasterKey, 0, cmpKey, 32, 32);
finalKey = CryptoUtil.resizeKey(cmpKey, 0, 64, dataEngine.keyLength());
MessageDigest md;
try {
md = MessageDigest.getInstance("SHA-512");
cmpKey[64] = 1;
hmacKey = md.digest(cmpKey);
} catch (NoSuchAlgorithmException e) {
throw new IOException("No SHA-512 implementation");
} finally {
Arrays.fill(cmpKey, (byte)0);
}
}
@Override
protected String getPasswordEncoding() {
return "UTF-8";
}
private static final String RootElementName = "KeyFile";
//private static final String MetaElementName = "Meta";
//private static final String VersionElementName = "Version";
private static final String KeyElementName = "Key";
private static final String KeyDataElementName = "Data";
@Override
protected byte[] loadXmlKeyFile(InputStream keyInputStream) {
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(keyInputStream);
Element el = doc.getDocumentElement();
if (el == null || ! el.getNodeName().equalsIgnoreCase(RootElementName)) {
return null;
}
NodeList children = el.getChildNodes();
if (children.getLength() < 2) {
return null;
}
for ( int i = 0; i < children.getLength(); i++ ) {
Node child = children.item(i);
if ( child.getNodeName().equalsIgnoreCase(KeyElementName) ) {
NodeList keyChildren = child.getChildNodes();
for ( int j = 0; j < keyChildren.getLength(); j++ ) {
Node keyChild = keyChildren.item(j);
if ( keyChild.getNodeName().equalsIgnoreCase(KeyDataElementName) ) {
NodeList children2 = keyChild.getChildNodes();
for ( int k = 0; k < children2.getLength(); k++) {
Node text = children2.item(k);
if (text.getNodeType() == Node.TEXT_NODE) {
Text txt = (Text) text;
return Base64Coder.decode(txt.getNodeValue());
}
}
}
}
}
}
} catch (Exception e) {
return null;
}
return null;
}
@Override
public List<PwGroup> getGroups() {
List<PwGroup> list = new ArrayList<PwGroup>();
PwGroupV4 root = (PwGroupV4) rootGroup;
root.buildChildGroupsRecursive(list);
return list;
}
@Override
public List<PwGroup> getGrpRoots() {
return rootGroup.childGroups;
}
@Override
public List<PwEntry> getEntries() {
List<PwEntry> list = new ArrayList<PwEntry>();
PwGroupV4 root = (PwGroupV4) rootGroup;
root.buildChildEntriesRecursive(list);
return list;
}
@Override
public long getNumRounds() {
return numKeyEncRounds;
}
@Override
public void setNumRounds(long rounds) throws NumberFormatException {
numKeyEncRounds = rounds;
}
@Override
public boolean algorithmSettingsEnabled() {
return false;
}
@Override
public PwEncryptionAlgorithm getEncAlgorithm() {
return PwEncryptionAlgorithm.Rjindal;
}
@Override
public PwGroupIdV4 newGroupId() {
PwGroupIdV4 id = new PwGroupIdV4(UUID_ZERO);
while (true) {
id = new PwGroupIdV4(UUID.randomUUID());
if (!isGroupIdUsed(id)) break;
}
return id;
}
@Override
public PwGroup createGroup() {
return new PwGroupV4();
}
@Override
public boolean isBackup(PwGroup group) {
if (!recycleBinEnabled) {
return false;
}
return group.isContainedIn(getRecycleBin());
}
@Override
public void populateGlobals(PwGroup currentGroup) {
groups.put(rootGroup.getId(), rootGroup);
super.populateGlobals(currentGroup);
}
/** Ensure that the recycle bin tree exists, if enabled and create it
* if it doesn't exist
*
*/
private void ensureRecycleBin() {
if (getRecycleBin() == null) {
// Create recycle bin
PwGroupV4 recycleBin = new PwGroupV4(true, true, RECYCLEBIN_NAME, iconFactory.getIcon(PwIconStandard.TRASH_BIN));
recycleBin.enableAutoType = false;
recycleBin.enableSearching = false;
recycleBin.isExpanded = false;
addGroupTo(recycleBin, rootGroup);
recycleBinUUID = recycleBin.uuid;
}
}
@Override
public boolean isRecycleBinAvailable() {
return true;
}
@Override
public boolean isRecycleBinEnable() {
return recycleBinEnabled;
}
@Override
public boolean canRecycle(PwGroup group) {
if (!recycleBinEnabled) {
return false;
}
PwGroup recycle = getRecycleBin();
return (recycle == null) || (!group.isContainedIn(recycle));
}
@Override
public boolean canRecycle(PwEntry entry) {
if (!recycleBinEnabled) {
return false;
}
PwGroup parent = entry.getParent();
return (parent != null) && canRecycle(parent);
}
@Override
public void recycle(PwGroup group) {
ensureRecycleBin();
PwGroup parent = group.getParent();
removeGroupFrom(group, parent);
parent.touch(false, true);
PwGroup recycleBin = getRecycleBin();
addGroupTo(group, recycleBin);
group.touch(false, true);
// TODO ? group.touchLocation();
}
@Override
public void recycle(PwEntry entry) {
ensureRecycleBin();
PwGroup parent = entry.getParent();
removeEntryFrom(entry, parent);
parent.touch(false, true);
PwGroup recycleBin = getRecycleBin();
addEntryTo(entry, recycleBin);
entry.touch(false, true);
entry.touchLocation();
}
@Override
public void undoRecycle(PwGroup group, PwGroup origParent) {
PwGroup recycleBin = getRecycleBin();
removeGroupFrom(group, recycleBin);
addGroupTo(group, origParent);
}
@Override
public void undoRecycle(PwEntry entry, PwGroup origParent) {
PwGroup recycleBin = getRecycleBin();
removeEntryFrom(entry, recycleBin);
addEntryTo(entry, origParent);
}
@Override
public void deleteEntry(PwEntry entry) {
super.deleteEntry(entry);
deletedObjects.add(new PwDeletedObject(entry.getUUID()));
}
@Override
public void undoDeleteEntry(PwEntry entry, PwGroup origParent) {
super.undoDeleteEntry(entry, origParent);
// TODO undo delete entry
deletedObjects.remove(entry);
}
@Override
public PwGroupV4 getRecycleBin() {
if (recycleBinUUID == null) {
return null;
}
PwGroupId recycleId = new PwGroupIdV4(recycleBinUUID);
return (PwGroupV4) groups.get(recycleId);
}
@Override
public boolean isGroupSearchable(PwGroup group, boolean omitBackup) {
if (!super.isGroupSearchable(group, omitBackup)) {
return false;
}
PwGroupV4 g = (PwGroupV4) group;
return g.isSearchEnabled();
}
@Override
public boolean validatePasswordEncoding(String key) {
return true;
}
@Override
public void initNew(String dbPath) {
String filename = URLUtil.guessFileName(dbPath, null, null);
rootGroup = new PwGroupV4(true, true, dbNameFromPath(dbPath), iconFactory.getIcon(PwIconStandard.FOLDER));
groups.put(rootGroup.getId(), rootGroup);
}
private String dbNameFromPath(String dbPath) {
String filename = URLUtil.guessFileName(dbPath, null, null);
if (EmptyUtils.isNullOrEmpty(filename)) {
return "KeePass Database";
}
int lastExtDot = filename.lastIndexOf(".");
if (lastExtDot == -1) {
return filename;
}
return filename.substring(0, lastExtDot);
}
private class GroupHasCustomData extends GroupHandler<PwGroup> {
public boolean hasCustomData = false;
@Override
public boolean operate(PwGroup group) {
if (group == null) {
return true;
}
PwGroupV4 g4 = (PwGroupV4) group;
if (g4.customData.size() > 0) {
hasCustomData = true;
return false;
}
return true;
}
}
private class EntryHasCustomData extends EntryHandler<PwEntry> {
public boolean hasCustomData = false;
@Override
public boolean operate(PwEntry entry) {
if (entry == null) {
return true;
}
PwEntryV4 e4 = (PwEntryV4)entry;
if (e4.customData.size() > 0) {
hasCustomData = true;
return false;
}
return true;
}
}
public int getMinKdbxVersion() {
if (!AesKdf.CIPHER_UUID.equals(kdfParameters.kdfUUID)) {
return PwDbHeaderV4.FILE_VERSION_32;
}
if (publicCustomData.size() > 0) {
return PwDbHeaderV4.FILE_VERSION_32;
}
EntryHasCustomData entryHandler = new EntryHasCustomData();
GroupHasCustomData groupHandler = new GroupHasCustomData();
if (rootGroup == null ) {
return PwDbHeaderV4.FILE_VERSION_32_3;
}
rootGroup.preOrderTraverseTree(groupHandler, entryHandler);
if (groupHandler.hasCustomData || entryHandler.hasCustomData) {
return PwDbHeaderV4.FILE_VERSION_32;
}
return PwDbHeaderV4.FILE_VERSION_32_3;
}
}

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