Compare commits

...

287 Commits
v1.03 ... 1.07

Author SHA1 Message Date
Philipp Crocoll
2dc125e0ce allow to save attachments to deliberate storages, closes #346 2018-09-17 12:56:10 +02:00
Philipp Crocoll
9c88ce213b make nextcloud support explicit (closes https://github.com/PhilippC/keepass2android/issues/256) 2018-09-17 11:34:36 +02:00
Philipp Crocoll
026de5dd4e no longer provide a system-wide file chooser, closes #541 2018-09-17 10:48:18 +02:00
Philipp Crocoll
262897fbf6 add preference option to disable auto-return from queries with only one matching result (closes https://github.com/PhilippC/keepass2android/issues/544) 2018-09-17 10:32:41 +02:00
Philipp Crocoll
304a9d90d0 allow to open Autofill settings also if service is enabled 2018-09-17 10:31:21 +02:00
Philipp Crocoll
91e1674833 make sure dialog asking overwrite/append of attachments is shown by moving code to OnResume. fixes https://github.com/PhilippC/keepass2android/issues/342 2018-09-17 10:11:03 +02:00
Philipp Crocoll
ee63946be2 set network security configuration to that of Android 6, trusting user certificates, closes #339 2018-09-12 04:51:58 +02:00
Philipp Crocoll
b1bcfacf35 refactor PasswordActivity's key provider handling, implement Password+Keyfile+ChallengeXC, closes #456 2018-09-12 04:39:21 +02:00
Philipp Crocoll
d4936e8eec fix issue with opening attachments with special characters in their name, closes #480 2018-09-11 21:42:44 +02:00
Philipp Crocoll
dbba098555 allow to delete entries from the EntryActivity (i.e. also after searching), closes #473 2018-09-11 05:03:54 +02:00
Philipp Crocoll
b368e93061 fix potential crash in keyboard 2018-09-11 05:02:31 +02:00
Philipp Crocoll
10b333ae48 allow to switch to built-in keyboard when opening PasswordActivity or EntryEditActivity, closes #67 2018-09-11 04:48:55 +02:00
Philipp Crocoll
87c0345a6a prevent accidental modification of password in edit text after using fingerprint, closes #493 2018-09-11 04:32:49 +02:00
Philipp Crocoll
381510d213 implement GUI for public key authentication with SFTP, closes #69 2018-09-11 04:19:40 +02:00
Philipp Crocoll
f5f99f5a04 attempt to integrate pulickey auth 2018-09-10 12:57:17 +02:00
Philipp Crocoll
fcf1214f80 implement publickey authentication in JavaFileStorage (not yet integrated in main app) 2018-09-10 12:56:03 +02:00
Philipp Crocoll
7e122529d2 implement prompt callbacks for JSch, fixes https://github.com/PhilippC/keepass2android/issues/519 2018-09-10 11:43:59 +02:00
Philipp Crocoll
600c3d21dc Merge branch '1.06' into 1.07 2018-09-10 09:52:39 +02:00
Philipp Crocoll
135d7ebda5 keep old keyboard dialog for Android <= 8, fix bugs with keyboard labels, release 1.06f 2018-09-10 09:51:53 +02:00
Philipp Crocoll
267d710c13 some changes to get the build working on VS2017 and to reduce APK size 2018-08-28 21:58:33 +02:00
PhilippC
5c9cf0a655 Merge pull request #523 from gilbsgilbs/pcloud-integration
Add PCloud support.
2018-08-28 20:55:41 +02:00
Philipp Crocoll
337297e3e0 manifest for 1.06d 2018-08-28 20:54:56 +02:00
Philipp Crocoll
26def9805f avoid potential OutOfBounds exception 2018-08-28 20:47:50 +02:00
Philipp Crocoll
5429876cde fix potential NullPointerExceptions 2018-08-28 05:39:28 +02:00
Gilbert Gilb's
6301b48b5d Fix indentation. 2018-08-27 21:48:48 +02:00
Gilbert Gilb's
5dea97cce2 Add PCloud support. 2018-08-27 20:58:36 +02:00
PhilippC
69b63bcb15 Merge pull request #522 from gilbsgilbs/linux-build
Support build on Linux
2018-08-27 12:17:56 +02:00
Philipp Crocoll
d13b2d236b manifest for 1.06c 2018-08-27 12:14:07 +02:00
Philipp Crocoll
9dce637d22 fix potential crash in FileSelectActivity 2018-08-27 12:06:04 +02:00
Philipp Crocoll
dbb291fb86 implement a new way to select additional fields in the keyboard, closes https://github.com/PhilippC/keepass2android/issues/377 2018-08-27 11:18:46 +02:00
Gilbert Gilb's
cefad66475 Add execution rights to gradle wrappers. 2018-08-25 15:37:25 +02:00
Gilbert Gilb's
726f4438d6 Fix xamarin.Android bindings path.
See https://github.com/PhilippC/keepass2android/pull/156#issuecomment-415965219
2018-08-25 15:37:25 +02:00
Gilbert Gilb's
880e75a91c Fix project configuration paths case.
This is required for linux builds.
2018-08-25 15:37:25 +02:00
Gilbert Gilb's
0f1fd0e367 Fix dummy credentials for Dropbox.
The client disallows empty credentials, making KP2A force close.
2018-08-25 15:37:25 +02:00
Gilbert Gilb's
7a44cf6e26 Add scripts and instructions for Linux builds.
This is mostly based on @bensku work.

See https://github.com/PhilippC/keepass2android/pull/156
2018-08-25 15:37:23 +02:00
Philipp Crocoll
bc2dc1b2e9 manifest for 1.06b 2018-08-23 07:01:36 +02:00
PhilippC
2d9429d688 Merge pull request #514 from PhilippC/l10n_master
New Crowdin translations
2018-08-21 20:35:40 +02:00
PhilippC
62f3ff1902 New translations strings.xml (German) 2018-08-21 20:32:04 +02:00
PhilippC
36735cdfbe New translations strings.xml (Chinese Traditional) 2018-08-21 20:31:51 +02:00
PhilippC
f57db90d7b New translations strings.xml (Portuguese, Brazilian) 2018-08-21 20:31:23 +02:00
Philipp Crocoll
97aec23384 Merge branch 'master' of https://github.com/PhilippC/keepass2android 2018-08-21 20:27:59 +02:00
PhilippC
eb3bcf04ea Merge pull request #467 from PhilippC/l10n_master
New Crowdin translations
2018-08-21 20:27:13 +02:00
PhilippC
40626ba708 New translations strings.xml (Chinese Simplified) 2018-08-21 20:23:42 +02:00
PhilippC
882597365b New translations strings.xml (Portuguese) 2018-08-21 20:23:16 +02:00
PhilippC
6b456c2f57 New translations strings.xml (German) 2018-08-21 19:41:08 +02:00
PhilippC
515ae57e88 New translations strings.xml (French) 2018-08-21 19:41:04 +02:00
PhilippC
9cc9d6ab66 New translations strings.xml (Croatian) 2018-08-21 19:40:55 +02:00
PhilippC
40b4fd210a New translations strings.xml (Chinese Traditional) 2018-08-21 19:40:53 +02:00
PhilippC
2ce2d0efab New translations strings.xml (Portuguese, Brazilian) 2018-08-21 19:40:24 +02:00
PhilippC
97a863293d New translations strings.xml (Polish) 2018-08-21 19:40:20 +02:00
PhilippC
d45426a4c1 New translations strings.xml (Persian) 2018-08-21 19:40:17 +02:00
Philipp Crocoll
d5a49db782 Prevent users from accidentally opening the local backup, closes #479 2018-08-21 19:34:22 +02:00
Philipp Crocoll
4b393f412c avoid exception with new Keyboard dialog on some devices 2018-08-21 07:25:31 +02:00
Philipp Crocoll
8cc77fbe1d hide password input fields from accessibility services 2018-08-20 16:56:20 +02:00
PhilippC
673632bd92 Merge pull request #487 from mohammadnaseri/master
Password should be invisible to the accessibility services: fixed for entering online storage credentials
2018-08-20 16:47:08 +02:00
Philipp Crocoll
d2b9a5d1a9 Merge branch 'master' of https://github.com/PhilippC/keepass2android 2018-08-20 16:45:34 +02:00
Philipp Crocoll
2bc46b0a0e fix a local build issue 2018-08-20 16:44:32 +02:00
Philipp Crocoll
74200daf90 finish transition to custom activity as dialog instead of using AlertDialog which is no longer working in Android P, closes #377 2018-08-20 16:44:23 +02:00
Philipp Crocoll
b89c127df4 try to introduce an activity as dialog for string selection, not yet working 2018-08-20 15:44:22 +02:00
Philipp Crocoll
67bbbb2097 handle empty initialPath in sftp dialog to close #499 2018-08-18 06:08:08 +02:00
PhilippC
c6ddf0de87 New translations strings.xml (Vietnamese) 2018-08-16 19:10:06 +02:00
Philipp Crocoll
0ef73952b1 fix crash when no FingerprintManager is available, fixes #474 2018-08-15 04:47:38 +02:00
PhilippC
0e02a3aeee New translations strings.xml (Croatian) 2018-08-12 16:00:05 +02:00
Mohammad Naseri
1558a7c386 Password should be invisible to the accessibility services 2018-08-03 12:38:48 +02:00
PhilippC
b72becd328 New translations strings.xml (Swedish) 2018-08-03 11:40:06 +02:00
PhilippC
df2ac8e203 New translations strings.xml (Portuguese) 2018-07-26 12:00:09 +02:00
PhilippC
c6c230002c New translations strings.xml (Portuguese) 2018-07-26 11:50:06 +02:00
PhilippC
885503b5fa New translations strings.xml (Persian) 2018-07-24 21:10:10 +02:00
PhilippC
40fd91257e New translations strings.xml (Vietnamese) 2018-07-23 13:40:11 +02:00
PhilippC
02ece3cf41 New translations strings.xml (Chinese Simplified) 2018-07-23 13:40:08 +02:00
PhilippC
901c879647 New translations strings.xml (Catalan) 2018-07-23 13:40:05 +02:00
PhilippC
990a73f4a4 New translations strings.xml (Chinese Traditional) 2018-07-23 13:31:16 +02:00
PhilippC
73169d339d New translations strings.xml (Croatian) 2018-07-23 13:31:14 +02:00
PhilippC
265b86c031 New translations strings.xml (Czech) 2018-07-23 13:31:11 +02:00
PhilippC
7c29c23015 New translations strings.xml (Danish) 2018-07-23 13:31:08 +02:00
PhilippC
538e579477 New translations strings.xml (Dutch) 2018-07-23 13:31:06 +02:00
PhilippC
73db5f55e2 New translations strings.xml (Finnish) 2018-07-23 13:31:02 +02:00
PhilippC
31a9980343 New translations strings.xml (French) 2018-07-23 13:31:00 +02:00
PhilippC
02c50f510f New translations strings.xml (Galician) 2018-07-23 13:30:57 +02:00
PhilippC
3541ee0512 New translations strings.xml (German) 2018-07-23 13:30:54 +02:00
PhilippC
e72821ba1e New translations strings.xml (Greek) 2018-07-23 13:30:51 +02:00
PhilippC
3af00871a5 New translations strings.xml (Hebrew) 2018-07-23 13:30:48 +02:00
PhilippC
22fe4ca790 New translations strings.xml (Bulgarian) 2018-07-23 13:30:46 +02:00
PhilippC
72d0570c15 New translations strings.xml (Hungarian) 2018-07-23 13:30:43 +02:00
PhilippC
62e0cc0867 New translations strings.xml (Italian) 2018-07-23 13:30:40 +02:00
PhilippC
8987480491 New translations strings.xml (Japanese) 2018-07-23 13:30:38 +02:00
PhilippC
70bb4c2478 New translations strings.xml (Korean) 2018-07-23 13:30:35 +02:00
PhilippC
cf079a6be4 New translations strings.xml (Portuguese, Brazilian) 2018-07-23 13:30:33 +02:00
PhilippC
f153cdcba1 New translations strings.xml (Russian) 2018-07-23 13:30:30 +02:00
PhilippC
4e048240c5 New translations strings.xml (Serbian (Cyrillic)) 2018-07-23 13:30:27 +02:00
PhilippC
c098bb1ca0 New translations strings.xml (Slovak) 2018-07-23 13:30:24 +02:00
PhilippC
e02ded734c New translations strings.xml (Slovenian) 2018-07-23 13:30:22 +02:00
PhilippC
e721f29f5a New translations strings.xml (Spanish) 2018-07-23 13:30:19 +02:00
PhilippC
f763d5f936 New translations strings.xml (Swedish) 2018-07-23 13:30:17 +02:00
PhilippC
a3368eb557 New translations strings.xml (Turkish) 2018-07-23 13:30:14 +02:00
PhilippC
b5758347c2 New translations strings.xml (Ukrainian) 2018-07-23 13:30:11 +02:00
PhilippC
775a6d92aa New translations strings.xml (Indonesian) 2018-07-23 13:30:09 +02:00
PhilippC
2ab5995177 New translations strings.xml (Basque) 2018-07-23 13:30:06 +02:00
PhilippC
f6e847d43f New translations strings.xml (Portuguese) 2018-07-23 13:28:28 +02:00
PhilippC
cac2ca3d18 New translations strings.xml (Polish) 2018-07-23 13:28:26 +02:00
PhilippC
d1e870cee0 New translations strings.xml (Persian) 2018-07-23 13:28:24 +02:00
PhilippC
ca0f65767b New translations strings.xml (Norwegian Nynorsk) 2018-07-23 13:28:22 +02:00
PhilippC
7968bfc262 New translations strings.xml (Norwegian Bokmal) 2018-07-23 13:28:19 +02:00
PhilippC
ed4bbe9814 New translations strings.xml (Romanian) 2018-07-23 13:28:16 +02:00
PhilippC
6e83eb6da2 New translations strings.xml (Arabic) 2018-07-23 13:28:14 +02:00
PhilippC
00949b6135 Update Crowdin configuration file 2018-07-23 11:37:54 +02:00
Philipp Crocoll
f3a857f26f Merge branch 'master' of https://github.com/PhilippC/keepass2android 2018-07-23 11:00:38 +02:00
PhilippC
4bd03372aa Update Crowdin configuration file 2018-07-23 10:36:20 +02:00
Philipp Crocoll
dcc589c57a Changelog for 1.06 2018-07-23 10:29:55 +02:00
Philipp Crocoll
3018ec8cf0 update translations from crowdin 2018-07-23 10:29:48 +02:00
Philipp Crocoll
c452a66a4f don't try to use samsung api if Fingprint Unlock with Android API is set up, should fix #126 2018-07-23 10:07:30 +02:00
Philipp Crocoll
7a860f8564 fix #460 ("Lookup entry with "%1$s"") 2018-07-20 21:44:29 +02:00
Philipp Crocoll
94f6f4bdff fix string error 2018-07-16 13:07:43 +02:00
Philipp Crocoll
a627dac4b7 remove internal YubiChallenge activity in favor of ykdroid (allows to reduce required permissions) 2018-07-16 13:07:29 +02:00
Philipp Crocoll
848b6862be harmonize wording for caching, closes #86 2018-07-13 06:47:48 +02:00
Philipp Crocoll
d181575e93 improve wording for file caching at more places (see discussion in #86) 2018-07-12 21:23:06 +02:00
Philipp Crocoll
778775055f suggest to enable fingerprint if hardware is detected but fingerprint unlock not configured, closes #426 and closes #355 2018-07-12 06:44:02 +02:00
Philipp Crocoll
22ccda8d34 Merge branch 'master' of https://github.com/PhilippC/keepass2android 2018-07-12 05:29:08 +02:00
Philipp Crocoll
c5fc6fd72e manifest for next release 2018-07-12 05:28:59 +02:00
Philipp Crocoll
c8a4978b5f improve wording for file caching, considering that this is also used for the offline version (see discussion in #86) 2018-07-12 05:27:01 +02:00
PhilippC
9e88f8c884 Merge pull request #449 from pp3345/ykdroid-keyboard-configuration
Mark keyboard configuration changes as handled in PasswordActivity
2018-07-10 22:25:06 +02:00
Yussuf Khalil
2e543bf4d3 Mark keyboard configuration changes as handled in PasswordActivity
This is required to avoid screen flickering due to recreation of the
activity when the ykDroid overlay is presented.
2018-07-10 19:30:08 +02:00
Philipp Crocoll
caf42d423f make sure the underlying stream is only written when the write transaction is commited. Avoids corrupted files when cancelling Yubichallenge during saving (#4) 2018-07-09 12:34:21 +02:00
Philipp Crocoll
dc39f874ac fix potential null reference exception when displaying error message 2018-07-09 12:27:29 +02:00
Philipp Crocoll
d1c7a124cf don't return empty strings for filename without path and ext in content storage, fixes #446 2018-07-09 11:03:10 +02:00
Philipp Crocoll
8ec17ce9a6 add timeout to fix #444 2018-07-09 10:22:44 +02:00
Philipp Crocoll
012af35e87 fix potential crash in SearchProvider, fixes #429 2018-07-03 19:38:59 +02:00
Philipp Crocoll
78bd1f4a5d update translations from crowdin, activates KeepassXC-challenge-response for all languages, add Changelog for 1.06-pre1 2018-07-02 12:54:25 +02:00
Philipp Crocoll
4477158182 editing groups was not possible, fixed. fixes #434 2018-07-02 12:10:28 +02:00
Philipp Crocoll
6e96021047 allow to use ykDroid instead of built-in activity 2018-07-02 12:03:32 +02:00
Philipp Crocoll
48f57eea66 fix bug with progress dialog not disappearing somtimes 2018-07-02 12:01:47 +02:00
Philipp Crocoll
4b6cfefaf3 Merge branch '1.05b' 2018-06-30 22:14:03 +02:00
Philipp Crocoll
0e34cc7f26 change manifest version to 1.06-pre 2018-06-30 22:13:16 +02:00
Philipp Crocoll
27fb2870ab check if file is trashed, do not load trashed files, fixes #165 2018-06-30 22:13:00 +02:00
Philipp Crocoll
ee6b7c4fe0 Merge branch 'master' of https://github.com/PhilippC/keepass2android 2018-06-30 21:45:13 +02:00
Philipp Crocoll
0464cecde5 add roundIcon property for app, now round icon should work on Android 7 2018-06-30 21:21:48 +02:00
Philipp Crocoll
b237259599 fix incorrect folder icon (fixes #433) 2018-06-30 21:10:56 +02:00
Philipp Crocoll
8c379739f0 refactoring of ProgressTask and OnFinish classes, allowing to access the currently active activity from the task handlers. This fixes #33 and is required to correctly manage the activity recreation caused by the NFC activity coming to foreground with KeepassXC challenge (#4) 2018-06-26 13:44:48 +02:00
Philipp Crocoll
4fb8db982c add missing calls to base.OnActivityResult() in *EditActivity, leading to errors saving with YubiChallenge (#4). 2018-06-25 13:24:22 +02:00
Philipp Crocoll
921b50b642 add NFC permission to debug manifest also 2018-06-25 13:23:34 +02:00
Philipp Crocoll
031332e8ab re-add KeepassXC-style challenge response support 2018-06-25 13:23:24 +02:00
Philipp Crocoll
f03ccced8d Merge branch 'master' into 1.05b 2018-06-25 12:21:34 +02:00
Philipp Crocoll
51973d225c switch to suggested Native TLS implementation and HttpClient stack (https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/http-stack?tabs=windows) 2018-06-23 13:08:32 +02:00
Philipp Crocoll
a59666e752 workaround to fix #420, based on https://stackoverflow.com/questions/28411153/jsch-suppressed-java-lang-classnotfoundexception-lorg-ietf-jgss-oid/28965796#28965796 and https://github.com/zeapo/Android-Password-Store/issues/49 2018-06-23 13:03:51 +02:00
PhilippC
8259191e50 Merge pull request #415 from jakseb/docfix
Fix broken links to screenshots in documentation
2018-06-23 12:08:44 +02:00
Philipp Crocoll
3eb84cc955 improve permission handling related to GoogleDrive 2018-06-23 11:43:54 +02:00
Philipp Crocoll
b1b7bff09d Manifest for 1.05d 2018-06-18 13:05:35 +02:00
Sebastian Jakubiak
82f28bfc8c Update links to screenshots in docs
Fixes #366 and #396
2018-06-16 11:04:02 +02:00
Philipp Crocoll
dfed92ac61 don't create local backups of local backups 2018-06-11 07:16:04 +02:00
Philipp Crocoll
0d6c9b468e fix UI bug when opening read-only databases (checkmarks were visible in Group list) 2018-06-11 07:15:54 +02:00
Philipp Crocoll
2bc12c510b implement defaults for otpauth:// style otp entries 2018-06-06 06:02:48 +02:00
Philipp Crocoll
f3022a19c2 manifest for 1.05c 2018-06-06 06:02:19 +02:00
Philipp Crocoll
800afae1c9 catch potential null reference exception 2018-06-06 03:05:57 +02:00
Philipp Crocoll
3c19f8e76f fix for IllegalStateException also when stopping the OngoingNotificationsService 2018-06-06 02:57:50 +02:00
Philipp Crocoll
3ca462f46f Manifest for 1.05b 2018-06-06 02:56:49 +02:00
Philipp Crocoll
fadd21ebd0 fix translations errors 2018-06-05 21:35:11 +02:00
Philipp Crocoll
a10c474ce5 attempt to make OngoingNotificationsService compatible to Android 8 restrictions 2018-06-05 21:35:03 +02:00
Philipp Crocoll
513ea5a198 manifest for 1.05a 2018-06-02 09:50:36 +02:00
Philipp Crocoll
4bab1c32d7 fix for second button in bottom bar never visible 2018-06-02 09:50:25 +02:00
Philipp Crocoll
39064eb2c6 update translations from crowdin, make changelog more robust against different forms of list item characters 2018-06-02 07:11:32 +02:00
Philipp Crocoll
28a60f5243 fix bug with automatic addition of URI scheme for owncloud files, improve input types to avoid automatic trailing spaces when using keyboard suggestions 2018-06-02 06:57:00 +02:00
Philipp Crocoll
56b9b878f8 make sure the local backup is not used automatically instead of the actual file 2018-06-02 06:55:48 +02:00
Philipp Crocoll
e7ad6e32e3 avoid showing infotexts after showing android 8 specific texts, update changelog, change version number for actual 1.05-pre3 release 2018-06-02 06:36:36 +02:00
Philipp Crocoll
a1d6347db3 create own YubiChallenge activity 2018-05-28 10:39:09 +02:00
Philipp Crocoll
9e80013e28 check for null bitmap, should fix #369 2018-05-07 11:12:43 +02:00
PhilippC
e66a8a0b21 Merge pull request #367 from gacelperfinian/patch-1
Updated Documentation.md to GitHub-flavoured MarkDown
2018-05-07 10:56:10 +02:00
Philipp Crocoll
77593969b2 fix leaking data to logcat 2018-05-07 10:42:58 +02:00
Gacel Perfinian
186fa35f70 Updated Documentation.md to GitHub-flavoured MarkDown
Changes:
- Changed last bullet in **What you should know and think about** into two bullet points due to change 2.
- Changed MarkDown so it renders correctly on GitHub Parser.
- Changed wording into bullet 2.2 to emphasise storing any second-factor authentication (if any was used).
2018-05-04 14:13:02 +08:00
Philipp Crocoll
c39d0048a8 Merge branch 'filecorruptionhandling' 2018-04-11 06:28:33 +02:00
Philipp Crocoll
5fc22b9530 introduced automatic local backups after successfully opening a database. This should make sure that users can access their database even if the file gets corrupted (#238) 2018-04-11 06:27:56 +02:00
Philipp Crocoll
51735c3f6d implement saving with KeepassXC-Challenge (#4) 2018-04-10 21:44:37 +02:00
Philipp Crocoll
f14aad0c50 implemented loading of files with KeepassXC Challenge (#4).
requires write support, handling of Challenge/Response errors (or user cancels). Caution: saving corrupts the file at the moment!
2018-04-10 07:15:19 +02:00
Philipp Crocoll
cdbb492f2c implemented editing of connection settings for ftp/sftp/webdav, includes changing password. Closes #27 2018-04-06 06:06:03 +02:00
Philipp Crocoll
de18aefd7b introduce vdots for file select list, prepare GUI for editing of storage locations 2018-04-04 05:01:19 +02:00
Philipp Crocoll
5f8807d62c workaround for error with Thai calendar settings (https://bugzilla.xamarin.com/show_bug.cgi?id=59077), fixes #327 2018-04-04 04:06:11 +02:00
Philipp Crocoll
e42d8b8eeb improve message when storage access framework access permission is revoked 2018-04-02 19:05:32 +02:00
Philipp Crocoll
d67b8b8298 fix bug with displaying info texts 2018-04-02 19:04:51 +02:00
Philipp Crocoll
10c8d157f5 request Read AND Write permissions in BuiltInFileStorage to be more compatible with Android O, also request storage permissions for GDrive to fix #265, even though this seems to be a workaround 2018-04-02 17:02:09 +02:00
Philipp Crocoll
1f10558f1f Merge branch 'master' of https://github.com/PhilippC/keepass2android 2018-04-02 05:52:41 +02:00
Philipp Crocoll
409228285e upgrade JSch to 0.1.54, closes #48. Upgrade ADAL. 2018-04-02 05:52:37 +02:00
PhilippC
0ac7758c04 Merge pull request #322 from ypid/fix/typo
Fix typo in README.md
2018-04-01 07:11:38 +02:00
Robin Schneider
802e3d04b2 Fix typo in README.md 2018-03-31 22:19:37 +02:00
Philipp Crocoll
39ef4a4711 replace obsolete Android.Text.ClipboardManager, might help with #248 2018-03-29 06:53:56 +02:00
Philipp Crocoll
b2215e1db6 release 1.05-pre2 2018-03-29 06:14:40 +02:00
Philipp Crocoll
7d42da5d3c add an IME subtype to close #56 2018-03-27 21:57:53 +02:00
Philipp Crocoll
82770e6dd0 disable sounds from notifications 2018-03-27 21:37:45 +02:00
Philipp Crocoll
62bbfc6075 remove testing code 2018-03-27 20:45:47 +02:00
Philipp Crocoll
a5eb77dd87 register broadcast receiver on app create, fixes #266 2018-03-27 20:45:32 +02:00
Philipp Crocoll
cb9cf4885f refactor, maybe helps to find crash report cause 2018-03-27 07:15:08 +02:00
PhilippC
a5455925ea Merge pull request #270 from mydexterid/ISSUE-221-Yubikey-static-password-support
Fix for issue #221
2018-03-26 20:31:36 +02:00
Philipp Crocoll
61ef383c38 add button to hide autofill info text in Group activity, closes #311 2018-03-26 20:27:51 +02:00
Philipp Crocoll
b0aa706c07 upgrade to target Android 8.1 2018-03-26 19:56:55 +02:00
Philipp Crocoll
a04c8f6214 fix checking for InputTypes flags, fixes #303 2018-03-26 13:40:30 +02:00
Philipp Crocoll
fd5b582c6c fix crash when disabling log file before writing anything into it, fixes #301 2018-03-21 05:00:57 +01:00
Philipp Crocoll
dc45613b7b fix crash when searching from autofill/keyboard/search url. fixes https://github.com/PhilippC/keepass2android/issues/289 2018-03-21 04:57:27 +01:00
Philipp Crocoll
d986d8f398 Merge branch 'master' of https://github.com/PhilippC/keepass2android 2018-03-21 04:56:45 +01:00
Philipp Crocoll
6c64f20a14 fix erroneous string value 2018-03-21 04:47:42 +01:00
Philipp Crocoll
2071087794 improve detection of file/folder, closes https://github.com/PhilippC/keepass2android/issues/276 2018-03-21 04:47:26 +01:00
PhilippC
ba56ab719c Update README.md 2018-03-12 11:36:52 +01:00
PhilippC
617c053b95 Update README.md 2018-03-12 11:36:35 +01:00
PhilippC
868cff2c4c Update README.md 2018-03-12 11:36:17 +01:00
Philipp Crocoll
8e23ebf3e4 add package to lock database broadcast from keyboard 2018-02-28 06:11:34 +01:00
DEXTER
6dd6eff02c PasswordActivity.cs: Do not clear the password field
when Yubikey is used to fill in the password entry.
2018-02-24 14:06:39 +01:00
DEXTER
3a1fcd2147 AndroidManifest*.xml: Add yubico's url to VIEW/BROWSABLE intent-filter
This patch makes it so that the user can choose keepass2android as
a handler for my.yubico.com in
Settings->Apps->App links->keepass2android->Open supported links->
Open in this app.
This is needed to be set manually by the user in order for their
Yubikey NEOs to work.
2018-02-24 14:06:01 +01:00
Philipp Crocoll
d4bd4a8150 update info text string to clarify things 2018-02-21 05:56:38 +01:00
Philipp Crocoll
2ace518db9 Merge branch '1.04'
Conflicts:
	src/keepass2android/ChangeLog.cs
	src/keepass2android/GroupBaseActivity.cs
	src/keepass2android/Properties/AndroidManifest_net.xml
	src/keepass2android/Resources/values/strings.xml
2018-02-20 22:18:20 +01:00
Philipp Crocoll
e8641cee8f changelog for 1.05-pre1 2018-02-20 22:15:49 +01:00
Philipp Crocoll
884328d10f refactor CopyToClipboardService to get (hopefully) more helpful reports on Google Play, see #248 2018-02-20 22:03:43 +01:00
Philipp Crocoll
d8bd8a29bc don't create notification channels for devices < sdk 26 2018-02-20 22:02:33 +01:00
Philipp Crocoll
cbd6b796ca created and integrated Adaptive Icons, closes #204 2018-02-20 21:52:25 +01:00
Philipp Crocoll
90cfa4ed5c refactor CopyToClipboardService to get (hopefully) more helpful reports on Google Play, see #248 2018-02-19 13:33:35 +01:00
Philipp Crocoll
6426abfedf commit missing change for previous commit 2018-02-19 13:24:44 +01:00
Philipp Crocoll
d746928765 show entry icon in notification, closes #21 2018-02-19 13:11:45 +01:00
Philipp Crocoll
f83554c817 prevent database from being loaded twice simultaneously, fixes #15 2018-02-12 13:21:58 +01:00
Philipp Crocoll
6fc4741c9a remove icon preferences on Android 8, show info on how to use notification channels on Android 8 2018-02-10 21:06:50 +01:00
Philipp Crocoll
7b63346bd0 set notification channel importances correctly 2018-02-09 12:22:49 +01:00
Philipp Crocoll
737c63e8b0 switch to TargetSDK 26, implement notification channels allowing customization of notification importance on Android 8, see #178 2018-02-09 12:07:21 +01:00
Philipp Crocoll
94b37f6414 fix crashes on Huawei devices when trying to enable autofill 2018-02-09 10:51:08 +01:00
Philipp Crocoll
5fa2bc3bc8 allow to bring up search fied on start, closes #107 2018-02-08 12:44:50 +01:00
Philipp Crocoll
5d7a5ace66 change the way how Files are written through SAF. Fixes #241 2018-02-08 11:46:48 +01:00
Philipp Crocoll
0bd213a327 make sure correct items for ActionMode are displayed, fixes #231 2018-02-08 11:09:41 +01:00
Philipp Crocoll
3d9f351d84 Merge branch 'master' of https://github.com/PhilippC/keepass2android 2018-02-08 08:54:36 +01:00
Philipp Crocoll
9fda220f33 move netftpandroid to github 2018-02-08 08:53:25 +01:00
PhilippC
991ae1d6e3 Merge pull request #203 from StefanSchoof/patch-1
Add Bugzilla link to Firefox Support
2018-01-23 23:10:33 +01:00
Philipp Crocoll
b993be4658 add some info texts, especialy for novice users to avoid some common misunderstandings. closes #46, closes #47 2018-01-23 23:09:17 +01:00
Philipp Crocoll
c4f8af2311 Merge branch '1.04' 2018-01-23 21:05:59 +01:00
Philipp Crocoll
4c541e98ab manifest for release 1.04 2018-01-23 21:05:22 +01:00
Philipp Crocoll
7b8b24b45d fix translations 2018-01-23 20:56:59 +01:00
Philipp Crocoll
a61a44edc9 update translations from crowdin 2018-01-23 20:42:52 +01:00
Philipp Crocoll
393f3e5737 fix bug with showing auto-fill hint too often 2018-01-23 20:32:01 +01:00
Philipp Crocoll
c34e38e50f allow to import content-URI database files to internal folder (closes #158) 2018-01-23 20:23:23 +01:00
Philipp Crocoll
b98676ea77 avoid crash when IconSet was uninstalled (fixes #139) 2018-01-23 20:03:05 +01:00
Philipp Crocoll
002c67e48c support otpauth:// URIs in otp field as used by KeeWeb (closes #118) 2018-01-23 19:53:06 +01:00
Philipp Crocoll
cf21684916 fix display issue with dynamic fields and visible passwords (related to #96) 2018-01-23 19:52:33 +01:00
Philipp Crocoll
9fe1a904c8 allow to hide the length of the QuickUnlock code. Closes #52 2018-01-23 19:11:01 +01:00
Philipp Crocoll
c4e67db75f fix QuickUnlock with Unicode characters like emojis (length correction was incorrect or misleading), fixes #161 2018-01-22 13:07:04 +01:00
Philipp Crocoll
8487555315 fix issue with displaying long passwords by using two different TextViews for the visible and "protected" password view, toggling visibility instead of InputType. Fixes #96. 2018-01-22 12:48:40 +01:00
Philipp Crocoll
304c1ef5d2 don't use implicit intents for notification actions. Should fix #149. 2018-01-22 11:45:28 +01:00
Philipp Crocoll
c911a7a310 manifest for 1.04-pre4 (main change in release: rebuilding keyboard, seems to fix broken keyboard) 2018-01-22 11:33:43 +01:00
Philipp Crocoll
322f29b31b manifest for 1.04-pre3 2018-01-22 10:08:08 +01:00
StefanSchoof
f0a86db9e4 Add Bugzilla link to Firefox Support 2018-01-11 10:56:22 +01:00
Philipp Crocoll
60bcfa8ab1 add a little help page about autofill 2018-01-08 11:06:30 +01:00
Philipp Crocoll
074b63d68d move AccService-Library to plugin repo 2018-01-05 05:51:58 +01:00
Philipp Crocoll
45fb856898 add check for null preference 2018-01-05 05:37:41 +01:00
Philipp Crocoll
138ed85f93 increase number of displayed recent fiels, fixes #179 2018-01-05 05:37:24 +01:00
Philipp Crocoll
a632dd172e version 1.04-pre2 2018-01-04 21:47:26 +01:00
Philipp Crocoll
8fbf915710 set AutoReturnFromQuery to default true 2018-01-04 20:58:03 +01:00
Philipp Crocoll
8eafc5816d show message in bottom bar if KP2A autofill service is not enabled (#9) 2018-01-04 20:48:51 +01:00
Philipp Crocoll
17b50df101 change heuristic to decide what is a username field: treat every field before a password field as username field. Even though this seems to make less sense, it works better with several apps; decode field references for AutoFill; display item in preferences for Autofill (#9) 2018-01-03 21:19:14 +01:00
Philipp Crocoll
b9e436d56d implemented saving of data from autofill service (#9) 2018-01-02 16:28:54 +01:00
Philipp Crocoll
a929db9939 fix save popup in QuickUnlock 2018-01-02 14:59:19 +01:00
Philipp Crocoll
8287232866 display the last opened entry as an additional dataset, helps to fill paypal app and helps with partitioned data 2018-01-02 14:29:29 +01:00
Philipp Crocoll
11330b608b use CommonUtil for logging of Autofill service everywhere 2018-01-02 13:07:14 +01:00
Philipp Crocoll
ff94d188db version 1.04-pre1 2017-12-31 11:47:31 +01:00
Philipp Crocoll
332ce12eb5 ignore .vs folder 2017-12-31 11:23:22 +01:00
Philipp Crocoll
e4eb0c7019 remove deleted entries to avoid "finding" them when SearchForUrl 2017-12-31 11:21:57 +01:00
Philipp Crocoll
8e45d6462f make sure Kp2a is closed after creating an entry for an autofill (#9) fill request 2017-12-31 11:21:41 +01:00
Philipp Crocoll
1857dd72b9 allow to fill single inputs (or autofill=off) with autofill (#9) 2017-12-31 10:52:40 +01:00
Philipp Crocoll
e4c6285fab improve presentation of Autofill (#9), support credit card datasets created from templates & expiry date 2017-12-30 21:30:18 +01:00
Philipp Crocoll
c150d24843 allow webdomains for browsers only, otherwise use package name 2017-12-30 20:36:27 +01:00
Philipp Crocoll
6c69119d09 allow autofill (#9) for apps/websites without explicit autofill hints by detecting password fields and falling back to filling username/password if no autofill hint is available 2017-12-30 03:41:02 +01:00
Philipp Crocoll
d87b8f7652 improve autofill service (#9): introduce partitioning of Autofill data 2017-12-29 17:37:14 +01:00
Philipp Crocoll
577febe3b7 unregister screen off broadcast receiver in PasswordActivity.OnDestroy() 2017-12-29 07:31:20 +01:00
Philipp Crocoll
c8d56a237b improve implementation of Oreo autofill (#9), now supporting all Android/W3cHints, using all Keepass fields (if hints match field name). Make hint comparison code clearer and always compare case insensitive 2017-12-29 07:07:46 +01:00
Philipp Crocoll
fb018946b9 minor refactoring 2017-12-28 21:59:55 +01:00
Philipp Crocoll
0697f4a964 minor refactoring and code formatting 2017-12-28 21:53:03 +01:00
Philipp Crocoll
4c0cfb77fb once again, update support packages, now to 26 versions 2017-12-28 21:31:59 +01:00
Philipp Crocoll
1a2885408d remove support v4 2017-12-28 14:58:30 +01:00
Philipp Crocoll
de8e363d33 remove support v4 from all packages.config 2017-12-28 14:57:21 +01:00
Philipp Crocoll
7436ac0b5e add support v4 package 2017-12-28 10:16:37 +01:00
Philipp Crocoll
eaf9447abc adjust filename of aar 2017-12-28 09:43:48 +01:00
Philipp Crocoll
45cadb9cfb update gson to avoid xpp3 dependency, should fix gradle build errors 2017-12-28 09:31:53 +01:00
Philipp Crocoll
9bab31514e add google Maven repo to build.gradle 2017-12-28 03:22:32 +01:00
Philipp Crocoll
6e13320f36 update build tools versions 2017-12-28 03:20:50 +01:00
Philipp Crocoll
1ed1e91189 first working (but still very rudimentary) version of Oreo Autofill (#9).
Not yet implemented and/or tested: partitioning, autofill fields without hints, saving, filling of other fields than username or password, package signature verification, DAL
2017-12-28 03:04:03 +01:00
Philipp Crocoll
7561afd92d remove support v4 references to avoid incompatible duplicates 2017-12-26 19:48:46 +01:00
Philipp Crocoll
92eb5836fb Merge branch 'master' into master_compiletest 2017-12-26 19:29:50 +01:00
Philipp Crocoll
0068fcef88 Merge commit '7720e8005e7df0338f19522fc23eb074a8c01b35' into master_compiletest 2017-12-26 19:26:28 +01:00
Philipp Crocoll
e2df24522f working 2017-12-26 19:26:05 +01:00
Philipp Crocoll
0c185c78e3 update support libraries to 25er version, some progress on AutoFill service implementation 2017-12-26 11:59:05 +01:00
Philipp Crocoll
7720e8005e start working on Oreo AutofillService (issue #9):
* upgraded target version to 26
* added service, parses autofill structure but does not yet retrieve/fill passwords
2017-12-19 22:25:16 +01:00
Philipp Crocoll
4a738990ae explicitly use IME_ACTION_NEXT instead of relying on actionId which seems to be incorrect/not set on latest Chrome versions. Fixes #89. 2017-12-06 05:35:13 +01:00
Philipp Crocoll
f7e8f25b70 update build tools for keyboard 2017-12-06 05:33:53 +01:00
Philipp Crocoll
da828523f3 Improve error messages when initializing fingerprint unlock fails. This is especially important for users who have migrated to a new device and previously received a very technical error message, but they simply need to reenable fingerprint on the new device. Fixes #37. 2017-12-03 07:44:01 +01:00
Philipp Crocoll
d621ea15a3 adjust targetFrameworkVersion of .csproj files to that of the manifest file 2017-12-03 07:42:38 +01:00
Philipp Crocoll
db74e573d1 catch exception when decrypting key fails, fixes #50 2017-12-02 16:41:57 +01:00
Philipp Crocoll
d40656b69a update translation files, now with removed strings in all translations 2017-11-27 13:06:39 +01:00
486 changed files with 31281 additions and 6866 deletions

7
.gitignore vendored
View File

@@ -153,3 +153,10 @@ intermediates
/src/java/Kp2aAccServiceLib/app/app.iml
/src/java/Kp2aAccServiceLib/gradle
adbprompt.ps1
/src/java/KP2ASoftkeyboard_AS/build/android-profile/*.rawproto
src/java/KP2ASoftkeyboard_AS/build/generated/mockable-android-23.jar
*.rawproto
src/java/Keepass2AndroidPluginSDK2/build/generated/mockable-Google-Inc.-Google-APIs-23.jar
/src/.vs
/src/JavaFileStorageBindings/Jars/JavaFileStorage-release.aar
/src/PluginSdkBinding/Jars/app-debug.aar

2
.gitmodules vendored
View File

@@ -3,4 +3,4 @@
url = https://github.com/PhilippC/Xamarin-Samsung-Pass.git
[submodule "src/netftpandroid"]
path = src/netftpandroid
url = https://git01.codeplex.com/forks/philippc/netftpandroid
url = https://github.com/PhilippC/netftpandroid.git

6
crowdin.yml Normal file
View File

@@ -0,0 +1,6 @@
files:
- source: src/keepass2android/Resources/values/strings.xml
translation: >-
/src/keepass2android/Resources/values-%two_letters_code%/%original_file_name%
translate_attributes: '0'
content_segmentation: '0'

View File

@@ -7,11 +7,12 @@ If you think something is missing in the documentation, please create an issue a
If you store important information using Keepass2Android, you should know a little bit about what's going on:
* Keepass2Android stores your password in an encrypted file. It is *your responsibility* to backup this file regularly and safely.
* There is no way for anyone, including the app's author, to access the information stored in your password database without
** having the database file
** knowing the master password (and additional second factor if you chose one)
This means that **if you forget the master password, your database is lost**! So make sure you remember the password. You might also want to think about:
** What happens if I have an accident? Should any trusted person be able to access my database?
** What happens if my phone gets lost or stolen? Do I know how to recover my database from a backup or the cloud?
* having the database file
* knowing the master password (and additional second factor if you chose one)
This means that **if you forget the master password, your database is lost**! So make sure you remember the password and retain any second factor method (if one is used).
* You might also want to think about:
* What happens if I have an accident? Should any trusted person be able to access my database?
* What happens if my phone gets lost or stolen? Do I know how to recover my database from a backup or the cloud?
# Getting started

View File

@@ -4,28 +4,28 @@
on how to set up a Keepass 2 database with Yubikey/OTP protection.<br>
<br>
After successful setup you should have the database file, e.g. yubi.kdbx, and the OTP auxiliary file, e.g. yubi.otp.xml, both in the same folder.<br>
<a href="http://download-codeplex.sec.s-msft.com/Download?ProjectName=keepass2android&DownloadId=767825"><img title="OTPAuxFile" src="http://download-codeplex.sec.s-msft.com/Download?ProjectName=keepass2android&DownloadId=767826" alt="OTPAuxFile" width="513" height="40" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a></p>
<a href="How to use Keepass2Android with YubiKey NEO_OTPAuxFile_2.png"><img title="OTPAuxFile" src="How to use Keepass2Android with YubiKey NEO_OTPAuxFile_thumb.png" alt="OTPAuxFile" width="513" height="40" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a></p>
<p>Make sure you make <strong>both files</strong> available to Keepass2Android, e.g. by placing them both in your Dropbox.</p>
<p>Now you should check your NDEF setup of the Yubikey NEO. Therefore, go to the Tools menu in the Yubico Personalization Utility. Select the same slot as used for OTPs with Keepass 2. The default setting for NDEF type and payload should work. If you experience
problems, you may use the configuration as shown in this screenshot or simply press the &ldquo;Reset&rdquo; button:</p>
<p><a href="http://download-codeplex.sec.s-msft.com/Download?ProjectName=keepass2android&DownloadId=767911"><img title="image" src="http://download-codeplex.sec.s-msft.com/Download?ProjectName=keepass2android&DownloadId=767912" alt="image" width="760" height="622" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a></p>
<p><a href="How to use Keepass2Android with YubiKey NEO_image_2.png"><img title="image" src="How to use Keepass2Android with YubiKey NEO_image_thumb.png" alt="image" width="760" height="622" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a></p>
<p><br>
<br>
In Keepass2Android, select &quot;Open file&quot; and locate your database file, e.g. yubi.kdbx.<br>
<br>
In the password screen under &quot;Select master key type&quot; select &quot;Password &#43; OTP&quot;.</p>
<p><a href="http://download-codeplex.sec.s-msft.com/Download?ProjectName=keepass2android&DownloadId=767913"><img title="Screenshot_2013-12-13-06-38-50" src="http://download-codeplex.sec.s-msft.com/Download?ProjectName=keepass2android&DownloadId=767914" alt="Screenshot_2013-12-13-06-38-50" width="204" height="360" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a></p>
<p><a href="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-38-50_2.png"><img title="Screenshot_2013-12-13-06-38-50" src="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-38-50_thumb.png" alt="Screenshot_2013-12-13-06-38-50" width="204" height="360" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a></p>
<p>Click &quot;Load auxiliary OTP file&quot;. This is required to load the information how many OTPs must be entered. As loading the file might require user action in some cases, this is not performed automatically.<br>
<a href="http://download-codeplex.sec.s-msft.com/Download?ProjectName=keepass2android&DownloadId=767915"><img title="Screenshot_2013-12-13-06-38-12" src="http://download-codeplex.sec.s-msft.com/Download?ProjectName=keepass2android&DownloadId=767916" alt="Screenshot_2013-12-13-06-38-12" width="204" height="360" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a><br>
<a href="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-38-12_2.png"><img title="Screenshot_2013-12-13-06-38-12" src="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-38-12_thumb.png" alt="Screenshot_2013-12-13-06-38-12" width="204" height="360" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a><br>
After loading the OTP auxiliary file, you should see a few text fields for entering the OTPs. Now swipe your YubiKey NEO at the back of your Android device. If you have multiple apps which can handle NFC actions, you might be prompted to select which app to
use. Select Keepass2Android in this case. Swipe your YubiKey again until all OTP fields are filled. Note: You don't need to select the next text field, this is done automatically!<br>
<a href="http://download-codeplex.sec.s-msft.com/Download?ProjectName=keepass2android&DownloadId=767917"><img title="Screenshot_2013-12-13-06-38-36" src="http://download-codeplex.sec.s-msft.com/Download?ProjectName=keepass2android&DownloadId=767918" alt="Screenshot_2013-12-13-06-38-36" width="204" height="360" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a><br>
<a href="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-38-36_2.png"><img title="Screenshot_2013-12-13-06-38-36" src="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-38-36_thumb.png" alt="Screenshot_2013-12-13-06-38-36" width="204" height="360" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a><br>
Don't forget to also enter your password and click OK. You will see the &ldquo;Saving auxiliary OTP file&hellip;&rdquo; dialog. Note that there is some encryption envolved which is probably fast on your PC but might take some time on your mobile device. You
can reduce the look-ahead window length to speed this up.<br>
<a href="http://download-codeplex.sec.s-msft.com/Download?ProjectName=keepass2android&DownloadId=767919"><img title="Screenshot_2013-12-13-06-39-47" src="http://download-codeplex.sec.s-msft.com/Download?ProjectName=keepass2android&DownloadId=767920" alt="Screenshot_2013-12-13-06-39-47" width="204" height="360" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a></p>
<a href="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-39-47_2.png"><img title="Screenshot_2013-12-13-06-39-47" src="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-39-47_thumb.png" alt="Screenshot_2013-12-13-06-39-47" width="204" height="360" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a></p>
<h2>&nbsp;</h2>
<h2>A note about offline access</h2>
<p>If your database is stored in the cloud or on the web, you can still access it if you have enabled file caching (which is on by default). With OTPs, this becomes a little bit more complicated: If you repeatedly open your datbase while being offline, the
OTP counter stored on the Yubikey will be increased. Don&rsquo;t forget to synchronize the database (which will also synchronize the OTP auxiliary file) as soon as possible to avoid problems with accessing your database on other devices! If you often need
to open the database while you&rsquo;re offline, consider increasing the look-ahead window length!</p>
</div><div class="ClearBoth"></div>
</div><div class="ClearBoth"></div>

20
docs/OreoAutoFill.md Normal file
View File

@@ -0,0 +1,20 @@
Google has introduced the Android Autofill interface in Android 8. Keepass2Android supports this interface. In most Android apps and all Autofill-enabled browsers, this is the most convenient way of entering passwords. As soon as you focus a field, you will see a popup "Fill with Keepass2Android".
<img src="autofill-facebook.png" />
After clicking this popup, you can unlock your KP2A database. If automatic look up succeeds, KP2A will close automatically, if not you are prompted to select the entry you want to auto-fill. When returning to the target app, the fields should be filled automatically already.
As of January 2018, the following browsers are known to have Android Autofill support:
* Firefox Focus / Firefox Klar
* Opera Mini
These browsers do not (yet) have autofill support:
* Google Chrome
* Firefox for Android ([bugzilla entry](https://bugzilla.mozilla.org/show_bug.cgi?id=1352011))
* Brave-Browser
* Opera
Please use the Share-URL-feature and the built-in KP2A keyboard for these browsers.

View File

@@ -1,12 +1,11 @@
# What is Keepass2Android?
Keepass2Android is a password manager app. It allows to store and retrieve passwords and other sensitive information in a file called "database". This database is secured with a so-called master password. The master password typically is a strong password and can be complemented with a second factor for additional security.
The password database file can be synchronized across different devices. This works best using one of the built-in cloud storage options, but can also be performed with third-party apps. Keepass2Android is compatible with Keepass 1 and Keepass 2 on Windows and KepassX on Linux.
The password database file can be synchronized across different devices. This works best using one of the built-in cloud storage options, but can also be performed with third-party apps. Keepass2Android is compatible with Keepass 1 and Keepass 2 on Windows and KeepassX on Linux.
# Where to get it?
Regular stable releases of Keepass2Android are available on [Google Play](https://play.google.com/store/apps/details?id=keepass2android.keepass2android).
Beta-releases can be obtained by opting in to the [Beta testing channel](https://play.google.com/apps/testing/keepass2android.keepass2android). Please join the [Beta tester group](https://plus.google.com/communities/107293657110547776032) for news and discussions about the latest beta releases.
Beta-releases can be obtained by opting in to the [Beta testing channel](https://play.google.com/apps/testing/keepass2android.keepass2android) or [Beta testing channel for Keepass2Android Offline](https://play.google.com/apps/testing/keepass2android.keepass2android_nonet). Please join the [Beta tester group](https://plus.google.com/communities/107293657110547776032) for news and discussions about the latest beta releases.
# How can I contribute?
* Help to translate Keepass2Android into your language or improve translations at [our Crowdin page](http://crowdin.net/project/keepass2android)

BIN
docs/autofill-facebook.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 353 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 800 800"
enable-background="new 0 0 800 800"
xml:space="preserve"
sodipodi:docname="Logo-green-foreground.svg"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"><metadata
id="metadata4969"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs4967" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1017"
id="namedview4965"
showgrid="false"
inkscape:zoom="0.75130096"
inkscape:cx="413.59403"
inkscape:cy="332.90312"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" /><path
d="m 318.7,232 c 13.6,0 24.6,10.9 24.6,24.4 0,13.5 -11,24.4 -24.6,24.4 -13.6,0 -24.6,-10.9 -24.6,-24.4 0,-13.5 11,-24.4 24.6,-24.4 z m 134.8,24.4 c 0,13.5 11,24.4 24.6,24.4 13.6,0 24.6,-10.9 24.6,-24.4 0,-13.5 -11,-24.4 -24.6,-24.4 -13.6,0 -24.6,10.9 -24.6,24.4 z M 399.8,177.7 M 140.2,600.6 v 47 h 517.3 v -47 z m 0,-249.7 v 47 h 517.3 v -47 z m -0.1,130.3 h 191.8 c -0.8,-4.1 -1.2,-8.3 -1.2,-12.4 0,-12.4 3.4,-24.2 9.9,-34.6 H 140.1 Z m 517.4,0 v -47 H 454.9 c 6.5,10.4 9.8,22.2 9.8,34.6 0,4.1 -0.4,8.3 -1.2,12.4 z m -517.4,36.2 v 47 h 186.6 l 14.3,-47 z m 314.2,0 14.4,47 h 188.8 v -47 z m -21.6,48.4 -21,-68.9 2.7,-1.6 c 10.3,-5.9 16.7,-16.9 16.7,-28.6 0,-18.2 -15,-33 -33.3,-33 -18.3,0 -33.3,14.8 -33.3,33 0,11.8 6.4,22.7 16.7,28.6 l 2.7,1.6 -21.1,68.9 z m 74.8,-407.3 0.2,-0.3 35.6,-51.3 c 2.4,-3.5 1.8,-8.1 -1.4,-10.3 -3.2,-2.2 -7.7,-1.1 -10.2,2.4 l -37.2,53.5 -0.1,0.3 c -29.3,-11.8 -62.1,-18.5 -96.8,-18.5 -35.2,0 -68.5,6.9 -98.1,19 L 261.8,99 c -2.4,-3.5 -7,-4.6 -10.2,-2.4 -3.2,2.2 -3.8,6.8 -1.4,10.3 l 36.2,52.2 c -66.8,32.2 -111.9,92.4 -111.9,161.3 h 42.9 c 0,-79.1 80.8,-143.5 180.1,-143.5 99.3,0 180.1,64.3 180.1,143.5 h 42.9 c 0.2,-69.3 -45.4,-129.8 -113,-161.9 z"
id="path4962"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#ffffff;fill-rule:evenodd" /></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 353 KiB

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0B109C0E-0514-4340-8779-5BD6A0DDE84E}</ProjectGuid>
<ProjectTypeGuids>{10368E6C-D01B-4462-8E8B-01FC667A7035};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AdalBindings</RootNamespace>
<AssemblyName>AdalBindings</AssemblyName>
<FileAlignment>512</FileAlignment>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Jars\AboutJars.txt" />
<None Include="Additions\AboutAdditions.txt" />
<LibraryProjectZip Include="Jars\adal-1.14.0.aar" />
</ItemGroup>
<ItemGroup>
<TransformFile Include="Transforms\Metadata.xml" />
<TransformFile Include="Transforms\EnumFields.xml" />
<TransformFile Include="Transforms\EnumMethods.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedReferenceJar Include="Jars\gson-2.3.1.jar" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.Bindings.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,48 @@
Additions allow you to add arbitrary C# to the generated classes
before they are compiled. This can be helpful for providing convenience
methods or adding pure C# classes.
== Adding Methods to Generated Classes ==
Let's say the library being bound has a Rectangle class with a constructor
that takes an x and y position, and a width and length size. It will look like
this:
public partial class Rectangle
{
public Rectangle (int x, int y, int width, int height)
{
// JNI bindings
}
}
Imagine we want to add a constructor to this class that takes a Point and
Size structure instead of 4 ints. We can add a new file called Rectangle.cs
with a partial class containing our new method:
public partial class Rectangle
{
public Rectangle (Point location, Size size) :
this (location.X, location.Y, size.Width, size.Height)
{
}
}
At compile time, the additions class will be added to the generated class
and the final assembly will a Rectangle class with both constructors.
== Adding C# Classes ==
Another thing that can be done is adding fully C# managed classes to the
generated library. In the above example, let's assume that there isn't a
Point class available in Java or our library. The one we create doesn't need
to interact with Java, so we'll create it like a normal class in C#.
By adding a Point.cs file with this class, it will end up in the binding library:
public class Point
{
public int X { get; set; }
public int Y { get; set; }
}

View File

@@ -0,0 +1,24 @@
This directory is for Android .jars.
There are 2 types of jars that are supported:
== Input Jar ==
This is the jar that bindings should be generated for.
For example, if you were binding the Google Maps library, this would
be Google's "maps.jar".
Set the build action for these jars in the properties page to "InputJar".
== Reference Jars ==
These are jars that are referenced by the input jar. C# bindings will
not be created for these jars. These jars will be used to resolve
types used by the input jar.
NOTE: Do not add "android.jar" as a reference jar. It will be added automatically
based on the Target Framework selected.
Set the build action for these jars in the properties page to "ReferenceJar".

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,30 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AdalBindings")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AdalBindings")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,14 @@
<enum-field-mappings>
<!--
This example converts the constants Fragment_id, Fragment_name,
and Fragment_tag from android.support.v4.app.FragmentActivity.FragmentTag
to an enum called Android.Support.V4.App.FragmentTagType with values
Id, Name, and Tag.
<mapping jni-class="android/support/v4/app/FragmentActivity$FragmentTag" clr-enum-type="Android.Support.V4.App.FragmentTagType">
<field jni-name="Fragment_name" clr-name="Name" value="0" />
<field jni-name="Fragment_id" clr-name="Id" value="1" />
<field jni-name="Fragment_tag" clr-name="Tag" value="2" />
</mapping>
-->
</enum-field-mappings>

View File

@@ -0,0 +1,13 @@
<enum-method-mappings>
<!--
This example changes the Java method:
android.support.v4.app.Fragment.SavedState.writeToParcel (int flags)
to be:
android.support.v4.app.Fragment.SavedState.writeToParcel (Android.OS.ParcelableWriteFlags flags)
when bound in C#.
<mapping jni-class="android/support/v4/app/Fragment.SavedState">
<method jni-name="writeToParcel" parameter="flags" clr-enum-type="Android.OS.ParcelableWriteFlags" />
</mapping>
-->
</enum-method-mappings>

View File

@@ -0,0 +1,13 @@
<metadata>
<!--
This sample removes the class: android.support.v4.content.AsyncTaskLoader.LoadTask:
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='AsyncTaskLoader.LoadTask']" />
This sample removes the method: android.support.v4.content.CursorLoader.loadInBackground:
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" />
-->
<remove-node path="/api/package[@name='com.microsoft.aad.adal']/class[@name='AuthenticationActivity']" />
<remove-node path="/api/package[@name='com.microsoft.aad.adal']/class[@name='DateTimeAdapter']" />
<remove-node path="/api/package[@name='com.microsoft.aad.adal']" />
</metadata>

View File

@@ -10,7 +10,7 @@
<RootNamespace>AndroidFileChooserBinding</RootNamespace>
<AssemblyName>AndroidFileChooserBinding</AssemblyName>
<FileAlignment>512</FileAlignment>
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -47,9 +47,6 @@
<Reference Include="Mono.Android" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.Android.Support.v4">
<HintPath>..\packages\Xamarin.Android.Support.v4.20.0.0.4\lib\MonoAndroid10\Xamarin.Android.Support.v4.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Android.Support.v4" version="20.0.0.4" targetFramework="MonoAndroid22" requireReinstallation="True" />
</packages>

View File

@@ -26,6 +26,7 @@
android:hint="@string/http_auth_dialog_password"
android:inputType="textPassword"
android:paddingTop="10dp"
android:paddingBottom="20dp" />
android:paddingBottom="20dp"
android:importantForAccessibility="no" />
</LinearLayout>

View File

@@ -11,7 +11,7 @@
<AssemblyName>JavaFileStorageBindings</AssemblyName>
<FileAlignment>512</FileAlignment>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -50,15 +50,6 @@
<Reference Include="GooglePlayServicesLib">
<HintPath>..\Components\googleplayservices-19.0.0\lib\android\GooglePlayServicesLib.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.v4">
<HintPath>..\Components\googleplayservices-19.0.0\lib\android\Xamarin.Android.Support.v4.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.v7.AppCompat">
<HintPath>..\Components\googleplayservices-19.0.0\lib\android\Xamarin.Android.Support.v7.AppCompat.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.v7.MediaRouter">
<HintPath>..\Components\googleplayservices-19.0.0\lib\android\Xamarin.Android.Support.v7.MediaRouter.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -89,6 +80,13 @@
<Visible>False</Visible>
</XamarinComponentReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AdalBindings\AdalBindings.csproj">
<Project>{0b109c0e-0514-4340-8779-5bd6a0dde84e}</Project>
<Name>AdalBindings</Name>
</ProjectReference>
<ProjectReference Include="..\PCloudBindings\PCloudBindings.csproj" />
</ItemGroup>
<ItemGroup>
<EmbeddedReferenceJar Include="Jars\okhttp-digest-1.7.jar" />
</ItemGroup>
@@ -101,9 +99,6 @@
<ItemGroup>
<EmbeddedReferenceJar Include="Jars\onedrive-sdk-android-1.2.2\classes-onedrive-sdk.jar" />
</ItemGroup>
<ItemGroup>
<EmbeddedReferenceJar Include="Jars\adal-1.1.19\classes-adal.jar" />
</ItemGroup>
<ItemGroup>
<EmbeddedReferenceJar Include="Jars\gdrive\commons-logging-1.1.1.jar" />
</ItemGroup>

View File

@@ -11,6 +11,8 @@
<remove-node path="/api/package[@name='com.jcraft.jsch.jcraft']" />
<remove-node path="/api/package[@name='com.jcraft.jzlib']" />
<remove-node path="/api/package[@name='com.pcloud.sdk']" />
<remove-node path="/api/package[@name='com.dropbox.core']" />
<remove-node path="/api/package[@name='com.dropbox.core.util']" />
<remove-node path="/api/package[@name='com.dropbox.core.http']" />

View File

@@ -10,7 +10,7 @@
<RootNamespace>KP2AKdbLibraryBinding</RootNamespace>
<AssemblyName>KP2AKdbLibraryBinding</AssemblyName>
<FileAlignment>512</FileAlignment>
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

View File

@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2009
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeePassLib2Android", "KeePassLib2Android\KeePassLib2Android.csproj", "{545B4A6B-8BBA-4FBE-92FC-4AC060122A54}"
EndProject
@@ -27,6 +27,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.FtpClient.Androi
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamsungPass", "SamsungPass\Xamarin.SamsungPass\SamsungPass\SamsungPass.csproj", "{3A4B8E88-FA9B-4663-BCDA-21C12E3AF98A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCloudBindings", "PCloudBindings\PCloudBindings.csproj", "{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdalBindings", "AdalBindings\AdalBindings.csproj", "{0B109C0E-0514-4340-8779-5BD6A0DDE84E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -156,19 +160,25 @@ Global
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Debug|Win32.ActiveCfg = Debug|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Debug|Win32.Build.0 = Debug|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Debug|x64.ActiveCfg = Debug|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Debug|x64.Build.0 = Debug|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Release|Any CPU.Build.0 = Release|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Release|Win32.ActiveCfg = Release|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Release|Win32.Build.0 = Release|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Release|x64.ActiveCfg = Release|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.ReleaseNoNet|Any CPU.ActiveCfg = Release|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.ReleaseNoNet|Any CPU.Build.0 = Release|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.Release|x64.Build.0 = Release|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.ReleaseNoNet|Any CPU.ActiveCfg = ReleaseNoNet|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.ReleaseNoNet|Any CPU.Build.0 = ReleaseNoNet|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.ReleaseNoNet|Mixed Platforms.ActiveCfg = ReleaseNoNet|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.ReleaseNoNet|Mixed Platforms.Build.0 = ReleaseNoNet|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.ReleaseNoNet|Win32.ActiveCfg = Release|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.ReleaseNoNet|Win32.ActiveCfg = ReleaseNoNet|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.ReleaseNoNet|Win32.Build.0 = ReleaseNoNet|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.ReleaseNoNet|x64.ActiveCfg = ReleaseNoNet|Any CPU
{48574278-4779-4B3A-A9E4-9CF1BC285D0B}.ReleaseNoNet|x64.Build.0 = ReleaseNoNet|Any CPU
{3C0F7FE5-639F-4422-A087-8B26CF862D1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3C0F7FE5-639F-4422-A087-8B26CF862D1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C0F7FE5-639F-4422-A087-8B26CF862D1B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -283,10 +293,61 @@ Global
{3A4B8E88-FA9B-4663-BCDA-21C12E3AF98A}.ReleaseNoNet|Mixed Platforms.Build.0 = ReleaseNoNet|Any CPU
{3A4B8E88-FA9B-4663-BCDA-21C12E3AF98A}.ReleaseNoNet|Win32.ActiveCfg = ReleaseNoNet|Any CPU
{3A4B8E88-FA9B-4663-BCDA-21C12E3AF98A}.ReleaseNoNet|x64.ActiveCfg = ReleaseNoNet|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Debug|Win32.ActiveCfg = Debug|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Debug|Win32.Build.0 = Debug|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Debug|x64.ActiveCfg = Debug|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Debug|x64.Build.0 = Debug|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Release|Any CPU.Build.0 = Release|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Release|Win32.ActiveCfg = Release|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Release|Win32.Build.0 = Release|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Release|x64.ActiveCfg = Release|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.Release|x64.Build.0 = Release|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.ReleaseNoNet|Any CPU.ActiveCfg = ReleaseNoNet|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.ReleaseNoNet|Any CPU.Build.0 = ReleaseNoNet|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.ReleaseNoNet|Mixed Platforms.ActiveCfg = ReleaseNoNet|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.ReleaseNoNet|Mixed Platforms.Build.0 = ReleaseNoNet|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.ReleaseNoNet|Win32.ActiveCfg = ReleaseNoNet|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.ReleaseNoNet|Win32.Build.0 = ReleaseNoNet|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.ReleaseNoNet|x64.ActiveCfg = ReleaseNoNet|Any CPU
{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}.ReleaseNoNet|x64.Build.0 = ReleaseNoNet|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Debug|Win32.ActiveCfg = Debug|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Debug|Win32.Build.0 = Debug|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Debug|x64.ActiveCfg = Debug|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Debug|x64.Build.0 = Debug|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Release|Any CPU.Build.0 = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Release|Win32.ActiveCfg = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Release|Win32.Build.0 = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Release|x64.ActiveCfg = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.Release|x64.Build.0 = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.ReleaseNoNet|Any CPU.ActiveCfg = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.ReleaseNoNet|Any CPU.Build.0 = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.ReleaseNoNet|Mixed Platforms.ActiveCfg = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.ReleaseNoNet|Mixed Platforms.Build.0 = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.ReleaseNoNet|Win32.ActiveCfg = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.ReleaseNoNet|Win32.Build.0 = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU
{0B109C0E-0514-4340-8779-5BD6A0DDE84E}.ReleaseNoNet|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2B48EDA2-ABCE-4DB5-A609-DFDF5FAAE767}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
$0.DotNetNamingPolicy = $1

View File

@@ -55,7 +55,10 @@ namespace KeePassLib.Cryptography.KeyDerivation
get { return "AES-KDF"; }
}
public AesKdf()
public override byte[] GetSeed(KdfParameters p)
{ return p.GetByteArray(ParamSeed); }
public AesKdf()
{
}

View File

@@ -68,7 +68,10 @@ namespace KeePassLib.Cryptography.KeyDerivation
get { return "Argon2"; }
}
public Argon2Kdf()
public override byte[] GetSeed(KdfParameters p)
{ return p.GetByteArray(ParamSalt); }
public Argon2Kdf()
{
}

View File

@@ -36,7 +36,9 @@ namespace KeePassLib.Cryptography.KeyDerivation
get;
}
public virtual KdfParameters GetDefaultParameters()
public abstract byte[] GetSeed(KdfParameters p);
public virtual KdfParameters GetDefaultParameters()
{
return new KdfParameters(this.Uuid);
}

View File

@@ -12,7 +12,7 @@
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AssemblyName>KeePassLib2Android</AssemblyName>
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<NuGetPackageImportStamp>8482b288</NuGetPackageImportStamp>
</PropertyGroup>

View File

@@ -20,11 +20,8 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using KeePassLib.Cryptography;
using KeePassLib.Cryptography.KeyDerivation;
using KeePassLib.Native;
using KeePassLib.Resources;
using KeePassLib.Security;
using KeePassLib.Utility;
@@ -168,7 +165,7 @@ namespace KeePassLib.Keys
/// Creates the composite key from the supplied user key sources (password,
/// key file, user account, computer ID, etc.).
/// </summary>
private byte[] CreateRawCompositeKey32(byte[] mPbMasterSeed)
private byte[] CreateRawCompositeKey32(byte[] mPbMasterSeed, byte[] mPbKdfSeed)
{
ValidateUserKeys();
@@ -178,7 +175,7 @@ namespace KeePassLib.Keys
foreach(IUserKey pKey in m_vUserKeys)
{
if (pKey is ISeedBasedUserKey)
((ISeedBasedUserKey)pKey).SetParams(mPbMasterSeed);
((ISeedBasedUserKey)pKey).SetParams(mPbMasterSeed, mPbKdfSeed);
ProtectedBinary b = pKey.KeyData;
if(b != null)
{
@@ -211,15 +208,17 @@ namespace KeePassLib.Keys
{
if(p == null) { Debug.Assert(false); throw new ArgumentNullException("p"); }
byte[] pbRaw32 = CreateRawCompositeKey32(mPbMasterSeed);
KdfEngine kdf = KdfPool.Get(p.KdfUuid);
if (kdf == null) // CryptographicExceptions are translated to "file corrupted"
throw new Exception(KLRes.UnknownKdf + MessageService.NewParagraph +
KLRes.FileNewVerOrPlgReq + MessageService.NewParagraph +
"UUID: " + p.KdfUuid.ToHexString() + ".");
byte[] pbRaw32 = CreateRawCompositeKey32(mPbMasterSeed, kdf.GetSeed(p));
if((pbRaw32 == null) || (pbRaw32.Length != 32))
{ Debug.Assert(false); return null; }
KdfEngine kdf = KdfPool.Get(p.KdfUuid);
if(kdf == null) // CryptographicExceptions are translated to "file corrupted"
throw new Exception(KLRes.UnknownKdf + MessageService.NewParagraph +
KLRes.FileNewVerOrPlgReq + MessageService.NewParagraph +
"UUID: " + p.KdfUuid.ToHexString() + ".");
byte[] pbTrf32 = kdf.Transform(pbRaw32, p);
if(pbTrf32 == null) { Debug.Assert(false); return null; }
@@ -256,7 +255,7 @@ namespace KeePassLib.Keys
public interface ISeedBasedUserKey
{
void SetParams(byte[] masterSeed);
void SetParams(byte[] masterSeed, byte[] mPbKdfSeed);
}
public sealed class InvalidCompositeKeyException : Exception

View File

@@ -100,7 +100,8 @@ namespace keepass2android
int count = 0;
while (File.Exists(LogFilename + "." + count))
count++;
File.Move(LogFilename, LogFilename + "." + count);
if (count > 0)
File.Move(LogFilename, LogFilename + "." + count);
}

View File

@@ -52,7 +52,7 @@ namespace keepass2android
/// <summary>
/// Tell the app that the file from ioc was opened with keyfile.
/// </summary>
void StoreOpenedFileAsRecent(IOConnectionInfo ioc, string keyfile);
void StoreOpenedFileAsRecent(IOConnectionInfo ioc, string keyfile, string displayName = "");
/// <summary>
/// Creates a new database and returns it

View File

@@ -2,11 +2,16 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using Android;
using Android.Content;
using Android.Database;
using Android.OS;
using Android.Provider;
using Java.IO;
using KeePassLib.Serialization;
using KeePassLib.Utility;
using Console = System.Console;
namespace keepass2android.Io
{
@@ -28,7 +33,12 @@ namespace keepass2android.Io
get { yield return "content"; }
}
public void Delete(IOConnectionInfo ioc)
public bool UserShouldBackup
{
get { return true; }
}
public void Delete(IOConnectionInfo ioc)
{
throw new NotImplementedException();
}
@@ -45,7 +55,20 @@ namespace keepass2android.Io
public Stream OpenFileForRead(IOConnectionInfo ioc)
{
return _ctx.ContentResolver.OpenInputStream(Android.Net.Uri.Parse(ioc.Path));
try
{
return _ctx.ContentResolver.OpenInputStream(Android.Net.Uri.Parse(ioc.Path));
}
catch (Exception e)
{
if (e.Message.Contains("requires that you obtain access using ACTION_OPEN_DOCUMENT"))
{
//looks like permission was revoked.
throw new DocumentAccessRevokedException();
}
throw;
}
}
public IWriteTransaction OpenWriteTransaction(IOConnectionInfo ioc, bool useFileTransaction)
@@ -55,8 +78,9 @@ namespace keepass2android.Io
public string GetFilenameWithoutPathAndExt(IOConnectionInfo ioc)
{
return "";
}
return UrlUtil.StripExtension(
UrlUtil.GetFileName(ioc.Path));
}
public bool RequiresCredentials(IOConnectionInfo ioc)
{
@@ -261,7 +285,26 @@ namespace keepass2android.Io
}
class AndroidContentWriteTransaction : IWriteTransaction
public class DocumentAccessRevokedException : Exception
{
public DocumentAccessRevokedException()
{
}
public DocumentAccessRevokedException(string message) : base(message)
{
}
public DocumentAccessRevokedException(string message, Exception innerException) : base(message, innerException)
{
}
protected DocumentAccessRevokedException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
class AndroidContentWriteTransaction : IWriteTransaction
{
private readonly string _path;
private readonly Context _ctx;
@@ -286,11 +329,15 @@ namespace keepass2android.Io
public void CommitWrite()
{
using (Stream outputStream = _ctx.ContentResolver.OpenOutputStream(Android.Net.Uri.Parse(_path)))
ParcelFileDescriptor fileDescriptor = _ctx.ContentResolver.OpenFileDescriptor(Android.Net.Uri.Parse(_path), "w");
using (var outputStream = new FileOutputStream(fileDescriptor.FileDescriptor))
{
byte[] data = _memoryStream.ToArray();
outputStream.Write(data, 0, data.Length);
outputStream.Close();
}
fileDescriptor.Close();
}

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Security;
@@ -10,10 +11,14 @@ using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.OS;
using Android.Preferences;
using Android.Support.V13.App;
using Android.Support.V4.App;
using Java.IO;
using Java.Util;
using KeePassLib.Serialization;
using KeePassLib.Utility;
using ActivityCompat = Android.Support.V13.App.ActivityCompat;
using File = System.IO.File;
using FileNotFoundException = System.IO.FileNotFoundException;
using IOException = System.IO.IOException;
@@ -59,7 +64,12 @@ namespace keepass2android.Io
public abstract IEnumerable<string> SupportedProtocols { get; }
public void Delete(IOConnectionInfo ioc)
public bool UserShouldBackup
{
get { return true; }
}
public void Delete(IOConnectionInfo ioc)
{
//todo check if directory
IOConnection.DeleteFile(ioc);
@@ -253,10 +263,14 @@ namespace keepass2android.Io
if (requiresPermission && (Build.VERSION.SdkInt >= BuildVersionCodes.M))
{
if (activity.Activity.CheckSelfPermission(Manifest.Permission.WriteExternalStorage) ==
if ((activity.Activity.CheckSelfPermission(Manifest.Permission.WriteExternalStorage) ==
Permission.Denied)
{
activity.StartFileUsageProcess(ioc, requestCode, alwaysReturnSuccess);
||
(activity.Activity.CheckSelfPermission(Manifest.Permission.ReadExternalStorage) ==
Permission.Denied))
{
activity.StartFileUsageProcess(ioc, requestCode, alwaysReturnSuccess);
return;
}
}
@@ -274,7 +288,7 @@ namespace keepass2android.Io
public void OnCreate(IFileStorageSetupActivity fileStorageSetupActivity, Bundle savedInstanceState)
{
((Activity)fileStorageSetupActivity).RequestPermissions(new[] { Manifest.Permission.WriteExternalStorage }, 0);
Android.Support.V4.App.ActivityCompat.RequestPermissions(((Activity)fileStorageSetupActivity), new[] { Manifest.Permission.WriteExternalStorage, Manifest.Permission.ReadExternalStorage }, 0);
}
public void OnResume(IFileStorageSetupActivity activity)
@@ -367,7 +381,14 @@ namespace keepass2android.Io
{
if (ioc.IsLocalFile())
{
if (IsLocalFileFlaggedReadOnly(ioc))
if (IsLocalBackup(ioc))
{
if (reason != null)
reason.Result = UiStringKey.ReadOnlyReason_LocalBackup;
return true;
}
if (IsLocalFileFlaggedReadOnly(ioc))
{
if (reason != null)
reason.Result = UiStringKey.ReadOnlyReason_ReadOnlyFlag;
@@ -388,7 +409,22 @@ namespace keepass2android.Io
return false;
}
private bool IsLocalFileFlaggedReadOnly(IOConnectionInfo ioc)
private readonly Dictionary<string, bool> _isLocalBackupCache = new Dictionary<string, bool>();
public bool IsLocalBackup(IOConnectionInfo ioc)
{
if (!ioc.IsLocalFile())
return false;
bool result;
if (_isLocalBackupCache.TryGetValue(ioc.Path, out result))
return result;
result = (PreferenceManager.GetDefaultSharedPreferences(Application.Context)
.GetBoolean(IoUtil.GetIocPrefKey(ioc, "is_local_backup"), false));
_isLocalBackupCache[ioc.Path] = result;
return result;
}
private bool IsLocalFileFlaggedReadOnly(IOConnectionInfo ioc)
{
//see http://stackoverflow.com/a/33292700/292233
try
@@ -412,7 +448,7 @@ namespace keepass2android.Io
public void OnRequestPermissionsResult(IFileStorageSetupActivity fileStorageSetupActivity, int requestCode,
string[] permissions, Permission[] grantResults)
{
fileStorageSetupActivity.State.PutBoolean(PermissionGrantedKey, grantResults[0] == Permission.Granted);
fileStorageSetupActivity.State.PutBoolean(PermissionGrantedKey, grantResults.All(res => res == Permission.Granted));
}
}

View File

@@ -84,7 +84,12 @@ namespace keepass2android.Io
public IEnumerable<string> SupportedProtocols { get { return _cachedStorage.SupportedProtocols; } }
public void DeleteFile(IOConnectionInfo ioc)
public bool UserShouldBackup
{
get { return _cachedStorage.UserShouldBackup; }
}
public void DeleteFile(IOConnectionInfo ioc)
{
if (IsCached(ioc))
{
@@ -340,57 +345,7 @@ namespace keepass2android.Io
private class CachedWriteTransaction: IWriteTransaction
{
private class CachedWriteMemoryStream : MemoryStream
{
private readonly IOConnectionInfo ioc;
private readonly CachingFileStorage _cachingFileStorage;
private readonly bool _useFileTransaction;
private bool _closed;
public CachedWriteMemoryStream(IOConnectionInfo ioc, CachingFileStorage cachingFileStorage, bool useFileTransaction)
{
this.ioc = ioc;
_cachingFileStorage = cachingFileStorage;
_useFileTransaction = useFileTransaction;
}
public override void Close()
{
if (_closed) return;
//write file to cache:
//(note: this might overwrite local changes. It's assumed that a sync operation or check was performed before
string hash;
using (var hashingStream = new HashingStreamEx(File.Create(_cachingFileStorage.CachedFilePath(ioc)), true, new SHA256Managed()))
{
Position = 0;
CopyTo(hashingStream);
hashingStream.Close();
hash = MemUtil.ByteArrayToHexString(hashingStream.Hash);
}
File.WriteAllText(_cachingFileStorage.VersionFilePath(ioc), hash);
//update file on remote. This might overwrite changes there as well, see above.
Position = 0;
if (_cachingFileStorage.IsCached(ioc))
{
//if the file already is in the cache, it's ok if writing to remote fails.
_cachingFileStorage.TryUpdateRemoteFile(this, ioc, _useFileTransaction, hash);
}
else
{
//if not, we don't accept a failure (e.g. invalid credentials would always remain a problem)
_cachingFileStorage.UpdateRemoteFile(this, ioc, _useFileTransaction, hash);
}
base.Close();
_closed = true;
}
}
private readonly IOConnectionInfo _ioc;
private readonly bool _useFileTransaction;
@@ -424,17 +379,48 @@ namespace keepass2android.Io
public Stream OpenFile()
{
_memoryStream = new CachedWriteMemoryStream(_ioc, _cachingFileStorage, _useFileTransaction);
_memoryStream = new MemoryStream();
return _memoryStream;
}
public void CommitWrite()
{
//the transaction is committed in the stream's Close
_committed = true;
_memoryStream.Close();
//write file to cache:
//(note: this might overwrite local changes. It's assumed that a sync operation or check was performed before
byte[] output = _memoryStream.ToArray();
string hash;
using (var hashingStream = new HashingStreamEx(File.Create(_cachingFileStorage.CachedFilePath(_ioc)), true, new SHA256Managed()))
{
hashingStream.Write(output, 0, output.Length);
hashingStream.Close();
hash = MemUtil.ByteArrayToHexString(hashingStream.Hash);
}
File.WriteAllText(_cachingFileStorage.VersionFilePath(_ioc), hash);
//create another memory stream which is open for reading again
MemoryStream openMemStream = new MemoryStream(output);
//update file on remote. This might overwrite changes there as well, see above.
if (_cachingFileStorage.IsCached(_ioc))
{
//if the file already is in the cache, it's ok if writing to remote fails.
_cachingFileStorage.TryUpdateRemoteFile(openMemStream, _ioc, _useFileTransaction, hash);
}
else
{
//if not, we don't accept a failure (e.g. invalid credentials would always remain a problem)
_cachingFileStorage.UpdateRemoteFile(openMemStream, _ioc, _useFileTransaction, hash);
}
openMemStream.Dispose();
}
}
}
public IWriteTransaction OpenWriteTransaction(IOConnectionInfo ioc, bool useFileTransaction)

View File

@@ -10,7 +10,11 @@ namespace keepass2android.Io
{
}
public override bool UserShouldBackup
{
get { return false; }
}
}
public partial class DropboxAppFolderFileStorage: JavaFileStorage
@@ -20,8 +24,12 @@ namespace keepass2android.Io
{
}
}
public override bool UserShouldBackup
{
get { return false; }
}
}
}
#endif

View File

@@ -2,12 +2,12 @@ namespace keepass2android.Io
{
public partial class DropboxFileStorage
{
private const string AppKey = "";
private const string AppSecret = "";
private const string AppKey = "dummy";
private const string AppSecret = "dummy";
}
public partial class DropboxAppFolderFileStorage
{
private const string AppKey = "";
private const string AppSecret = "";
private const string AppKey = "dummy";
private const string AppSecret = "dummy";
}
}
}

View File

@@ -22,6 +22,10 @@ namespace keepass2android.Io
}
public override bool UserShouldBackup
{
get { return false; }
}
}
}
#endif

View File

@@ -46,9 +46,14 @@ namespace keepass2android.Io
/// <summary>
/// returns the protocol ids supported by this FileStorage. Can return pseudo-protocols like "dropbox" or real protocols like "ftp"
/// </summary>
IEnumerable<string> SupportedProtocols { get; }
IEnumerable<string> SupportedProtocols { get; }
/// <summary>
/// <summary>
/// returns true if users should backup files on this file storage (if the file is important). Can be false for cloud providers with built-in versioning or backups.
/// </summary>
bool UserShouldBackup { get; }
/// <summary>
/// Deletes the given file or directory.
/// </summary>
void Delete(IOConnectionInfo ioc);

View File

@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using Android.Content;
using Android.OS;
using Java.IO;
using KeePassLib.Serialization;
using KeePassLib.Utility;
namespace keepass2android.Io
{
@@ -125,5 +127,53 @@ namespace keepass2android.Io
return ctx.FilesDir;
}
}
//creates a local ioc where the sourceIoc can be stored to
public static IOConnectionInfo GetInternalIoc(IOConnectionInfo sourceIoc, Context ctx)
{
Java.IO.File internalDirectory = IoUtil.GetInternalDirectory(ctx);
string targetPath = UrlUtil.GetFileName(sourceIoc.Path);
targetPath = targetPath.Trim("|\\?*<\":>+[]/'".ToCharArray());
if (targetPath == "")
targetPath = "internal";
if (new File(internalDirectory, targetPath).Exists())
{
int c = 1;
var ext = UrlUtil.GetExtension(targetPath);
var filenameWithoutExt = UrlUtil.StripExtension(targetPath);
do
{
c++;
targetPath = filenameWithoutExt + c;
if (!String.IsNullOrEmpty(ext))
targetPath += "." + ext;
} while (new File(internalDirectory, targetPath).Exists());
}
return IOConnectionInfo.FromPath(new File(internalDirectory, targetPath).CanonicalPath);
}
public static IOConnectionInfo ImportFileToInternalDirectory(IOConnectionInfo sourceIoc, Context ctx, IKp2aApp app)
{
var targetIoc = GetInternalIoc(sourceIoc, ctx);
IoUtil.Copy(targetIoc, sourceIoc, app);
return targetIoc;
}
public static string GetIocPrefKey(IOConnectionInfo ioc, string suffix)
{
var iocAsHexString = IocAsHexString(ioc);
return "kp2a_ioc_key_" + iocAsHexString + suffix;
}
public static string IocAsHexString(IOConnectionInfo ioc)
{
SHA256Managed sha256 = new SHA256Managed();
string iocAsHexString =
MemUtil.ByteArrayToHexString(sha256.ComputeHash(Encoding.Unicode.GetBytes(ioc.Path.ToCharArray())));
return iocAsHexString;
}
}
}

View File

@@ -22,9 +22,10 @@ namespace keepass2android.Io
protected string Protocol { get { return _jfs.ProtocolId; } }
public virtual IEnumerable<string> SupportedProtocols { get { yield return Protocol; } }
public abstract bool UserShouldBackup { get; }
private readonly IJavaFileStorage _jfs;
private readonly IJavaFileStorage _jfs;
private readonly IKp2aApp _app;
public JavaFileStorage(IJavaFileStorage jfs, IKp2aApp app)

View File

@@ -161,7 +161,12 @@ namespace keepass2android.Io
}
}
public void Delete(IOConnectionInfo ioc)
public bool UserShouldBackup
{
get { return true; }
}
public void Delete(IOConnectionInfo ioc)
{
try
{
@@ -226,7 +231,7 @@ namespace keepass2android.Io
internal Uri IocToUri(IOConnectionInfo ioc)
public static Uri IocToUri(IOConnectionInfo ioc)
{
if (!string.IsNullOrEmpty(ioc.UserName))
{
@@ -570,7 +575,7 @@ namespace keepass2android.Io
{
_client = _fileStorage.GetClient(_ioc, false);
_stream = _client.OpenWrite(_fileStorage.IocToUri(_iocTemp).PathAndQuery);
_stream = _client.OpenWrite(NetFtpFileStorage.IocToUri(_iocTemp).PathAndQuery);
return _stream;
}
catch (FtpCommandException ex)
@@ -590,8 +595,8 @@ namespace keepass2android.Io
//make sure target file does not exist:
//try
{
if (_client.FileExists(_fileStorage.IocToUri(_ioc).PathAndQuery))
_client.DeleteFile(_fileStorage.IocToUri(_ioc).PathAndQuery);
if (_client.FileExists(NetFtpFileStorage.IocToUri(_ioc).PathAndQuery))
_client.DeleteFile(NetFtpFileStorage.IocToUri(_ioc).PathAndQuery);
}
//catch (FtpCommandException)
@@ -599,8 +604,8 @@ namespace keepass2android.Io
//TODO get a new clien? might be stale
}
_client.Rename(_fileStorage.IocToUri(_iocTemp).PathAndQuery,
_fileStorage.IocToUri(_ioc).PathAndQuery);
_client.Rename(NetFtpFileStorage.IocToUri(_iocTemp).PathAndQuery,
NetFtpFileStorage.IocToUri(_ioc).PathAndQuery);
}
catch (FtpCommandException ex)

View File

@@ -32,7 +32,12 @@ namespace keepass2android.Io
get { return _baseStorage.SupportedProtocols; }
}
public void Delete(IOConnectionInfo ioc)
public bool UserShouldBackup
{
get { return _baseStorage.UserShouldBackup; }
}
public void Delete(IOConnectionInfo ioc)
{
_baseStorage.Delete(ioc);
}

View File

@@ -33,6 +33,11 @@ namespace keepass2android.Io
yield return "onedrive";
}
}
public override bool UserShouldBackup
{
get { return false; }
}
}
}
#endif

View File

@@ -0,0 +1,23 @@
using Android.Content;
#if !EXCLUDE_JAVAFILESTORAGE
namespace keepass2android.Io
{
public partial class PCloudFileStorage: JavaFileStorage
{
private const string ClientId = "CkRWTQXY6Lm";
public PCloudFileStorage(Context ctx, IKp2aApp app) :
base(new Keepass2android.Javafilestorage.PCloudFileStorage(ctx, ClientId), app)
{
}
public override bool UserShouldBackup
{
get { return false; }
}
}
}
#endif

View File

@@ -5,12 +5,16 @@ namespace keepass2android.Io
{
public class SftpFileStorage: JavaFileStorage
{
public SftpFileStorage(IKp2aApp app) :
base(new Keepass2android.Javafilestorage.SftpStorage(), app)
public SftpFileStorage(Context ctx, IKp2aApp app) :
base(new Keepass2android.Javafilestorage.SftpStorage(ctx.ApplicationContext), app)
{
}
public override bool UserShouldBackup
{
get { return true; }
}
}

View File

@@ -30,15 +30,24 @@ namespace keepass2android.Io
yield return "http";
yield return "https";
yield return "owncloud";
}
yield return "nextcloud";
}
}
public static string Owncloud2Webdav(string owncloudUrl)
public override bool UserShouldBackup
{
get { return true; }
}
public static string owncloudPrefix = "owncloud://";
public static string nextcloudPrefix = "nextcloud://";
public static string Owncloud2Webdav(string owncloudUrl, string prefix)
{
string owncloudPrefix = "owncloud://";
if (owncloudUrl.StartsWith(owncloudPrefix))
if (owncloudUrl.StartsWith(prefix))
{
owncloudUrl = owncloudUrl.Substring(owncloudPrefix.Length);
owncloudUrl = owncloudUrl.Substring(prefix.Length);
}
if (!owncloudUrl.Contains("://"))
owncloudUrl = "https://" + owncloudUrl;

View File

@@ -12,9 +12,10 @@
<FileAlignment>512</FileAlignment>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
<NuGetPackageImportStamp>06ffb71c</NuGetPackageImportStamp>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -55,6 +56,36 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
<Reference Include="Xamarin.Android.Arch.Core.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Android.Arch.Core.Common.1.0.0\lib\MonoAndroid80\Xamarin.Android.Arch.Core.Common.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Arch.Lifecycle.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.1\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Arch.Lifecycle.Runtime, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.0\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.Annotations, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Annotations.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Android.Support.Compat.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Compat.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.Core.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Android.Support.Core.UI.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Core.UI.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.Core.Utils, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Android.Support.Core.Utils.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Core.Utils.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.Fragment, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Android.Support.Fragment.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Fragment.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.Media.Compat, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Android.Support.Media.Compat.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Media.Compat.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.v13, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Android.Support.v13.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.v13.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="database\CheckDatabaseForChanges.cs" />
@@ -86,6 +117,7 @@
<Compile Include="Io\JavaFileStorage.cs" />
<Compile Include="Io\NetFtpFileStorage.cs" />
<Compile Include="Io\OfflineSwitchableFileStorage.cs" />
<Compile Include="Io\PCloudFileStorage.cs" />
<Compile Include="Io\SftpFileStorage.cs" />
<Compile Include="Io\OneDriveFileStorage.cs" />
<Compile Include="Io\WebDavFileStorage.cs" />
@@ -97,15 +129,15 @@
<Compile Include="database\edit\ActionOnFinish.cs" />
<Compile Include="database\edit\AddEntry.cs" />
<Compile Include="database\edit\AddGroup.cs" />
<Compile Include="database\edit\CreateDb.cs" />
<Compile Include="database\edit\CreateDB.cs" />
<Compile Include="database\edit\DeleteEntry.cs" />
<Compile Include="database\edit\DeleteGroup.cs" />
<Compile Include="database\edit\DeleteRunnable.cs" />
<Compile Include="database\edit\FileOnFinish.cs" />
<Compile Include="database\edit\LoadDb.cs" />
<Compile Include="database\edit\LoadDB.cs" />
<Compile Include="database\edit\OnFinish.cs" />
<Compile Include="database\edit\RunnableOnFinish.cs" />
<Compile Include="database\edit\SaveDb.cs" />
<Compile Include="database\edit\SaveDB.cs" />
<Compile Include="database\edit\SetPassword.cs" />
<Compile Include="database\edit\UpdateEntry.cs" />
<Compile Include="IKp2aApp.cs" />
@@ -124,6 +156,10 @@
<Compile Include="Utils\Spr\SprEngine.PickChars.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AdalBindings\AdalBindings.csproj">
<Project>{0b109c0e-0514-4340-8779-5bd6a0dde84e}</Project>
<Name>AdalBindings</Name>
</ProjectReference>
<ProjectReference Include="..\JavaFileStorageBindings\JavaFileStorageBindings.csproj">
<Project>{48574278-4779-4b3a-a9e4-9cf1bc285d0b}</Project>
<Name>JavaFileStorageBindings</Name>
@@ -148,7 +184,35 @@
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Arch.Core.Common.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Core.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Arch.Core.Common.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Core.Common.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.1\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.1\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Compat.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Compat.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Core.UI.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.UI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Core.UI.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.UI.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Core.Utils.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.Utils.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Core.Utils.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.Utils.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Fragment.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Fragment.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Fragment.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Fragment.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Media.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Media.Compat.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Media.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Media.Compat.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.v13.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.v13.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.v13.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.v13.targets'))" />
</Target>
<Import Project="..\packages\Xamarin.Android.Arch.Core.Common.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Core.Common.targets" Condition="Exists('..\packages\Xamarin.Android.Arch.Core.Common.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Core.Common.targets')" />
<Import Project="..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.1\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.targets" Condition="Exists('..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.1\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.targets')" />
<Import Project="..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.targets" Condition="Exists('..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Compat.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Compat.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Core.UI.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.UI.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Core.UI.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.UI.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Core.Utils.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.Utils.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Core.Utils.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.Utils.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Fragment.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Fragment.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Fragment.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Fragment.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Media.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Media.Compat.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Media.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Media.Compat.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.v13.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.v13.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v13.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.v13.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@@ -30,8 +30,12 @@ namespace keepass2android
readonly IKp2aApp _app;
private readonly Handler _handler;
private string _message = "";
private string _submessage;
public ProgressDialogStatusLogger() {
public String SubMessage => _submessage;
public String Message => _message;
public ProgressDialogStatusLogger() {
}
@@ -56,6 +60,7 @@ namespace keepass2android
public void UpdateSubMessage(String submessage)
{
_submessage = submessage;
if (_app != null && _progressDialog != null && _handler != null)
{
_handler.Post(() =>

View File

@@ -25,39 +25,107 @@ namespace keepass2android
/// <summary>
/// Class to run a task while a progress dialog is shown
/// </summary>
public class ProgressTask {
private readonly Handler _handler;
public class ProgressTask
{
//for handling Activity recreation situations, we need access to the currently active task. It must hold that there is no more than one active task.
private static ProgressTask _currentTask = null;
public static void SetNewActiveActivity(Activity activeActivity)
{
if (_currentTask != null)
{
_currentTask.ActiveActivity = activeActivity;
}
}
public static void RemoveActiveActivity(Activity activity)
{
if ((_currentTask != null) && (_currentTask._activeActivity == activity))
_currentTask.ActiveActivity = null;
}
public Activity ActiveActivity
{
get { return _activeActivity; }
private set
{
_activeActivity = value;
if (_task != null)
_task.ActiveActivity = _activeActivity;
if (_activeActivity != null)
{
SetupProgressDialog(_app);
_progressDialog.Show();
}
}
}
private readonly Handler _handler;
private readonly RunnableOnFinish _task;
private readonly IProgressDialog _progressDialog;
private IProgressDialog _progressDialog;
private readonly IKp2aApp _app;
private Thread _thread;
private Activity _activeActivity;
private ProgressDialogStatusLogger _progressDialogStatusLogger;
public ProgressTask(IKp2aApp app, Context ctx, RunnableOnFinish task) {
public ProgressTask(IKp2aApp app, Activity activity, RunnableOnFinish task)
{
_activeActivity = activity;
_task = task;
_handler = app.UiThreadHandler;
_app = app;
// Show process dialog
_progressDialog = app.CreateProgressDialog(ctx);
_progressDialog.SetTitle(_app.GetResourceString(UiStringKey.progress_title));
_progressDialog.SetMessage("Initializing...");
// Set code to run when this is finished
_task.OnFinishToRun = new AfterTask(task.OnFinishToRun, _handler, _progressDialog);
_task.SetStatusLogger(new ProgressDialogStatusLogger(_app, _handler, _progressDialog));
SetupProgressDialog(app);
// Set code to run when this is finished
_task.OnFinishToRun = new AfterTask(activity, task.OnFinishToRun, _handler, this);
_task.SetStatusLogger(_progressDialogStatusLogger);
}
public void Run() {
// Show process dialog
_progressDialog.Show();
private void SetupProgressDialog(IKp2aApp app)
{
string currentMessage = "Initializing...";
string currentSubmessage = "";
if (_progressDialogStatusLogger != null)
{
currentMessage = _progressDialogStatusLogger.Message;
currentSubmessage = _progressDialogStatusLogger.SubMessage;
}
if (_progressDialog != null)
{
var pd = _progressDialog;
app.UiThreadHandler.Post(() =>
{
pd.Dismiss();
});
}
// Show process dialog
_progressDialog = app.CreateProgressDialog(_activeActivity);
_progressDialog.SetTitle(_app.GetResourceString(UiStringKey.progress_title));
_progressDialogStatusLogger = new ProgressDialogStatusLogger(_app, _handler, _progressDialog);
_progressDialogStatusLogger.UpdateMessage(currentMessage);
_progressDialogStatusLogger.UpdateSubMessage(currentSubmessage);
}
public void Run(bool allowOverwriteCurrentTask = false)
{
if ((!allowOverwriteCurrentTask) && (_currentTask != null))
throw new Exception("Cannot start another ProgressTask while ProgressTask is already running! " + _task.GetType().Name + "/" + _currentTask._task.GetType().Name);
_currentTask = this;
// Show process dialog
_progressDialog.Show();
// Start Thread to Run task
_thread = new Thread(_task.Run);
_thread.Start();
}
public void JoinWorkerThread()
@@ -66,11 +134,11 @@ namespace keepass2android
}
private class AfterTask : OnFinish {
readonly IProgressDialog _progressDialog;
readonly ProgressTask _progressTask;
public AfterTask (OnFinish finish, Handler handler, IProgressDialog pd): base(finish, handler)
public AfterTask (Activity activity, OnFinish finish, Handler handler, ProgressTask pt): base(activity, finish, handler)
{
_progressDialog = pd;
_progressTask = pt;
}
public override void Run() {
@@ -79,17 +147,22 @@ namespace keepass2android
if (Handler != null) //can be null in tests
{
// Remove the progress dialog
Handler.Post(delegate { _progressDialog.Dismiss(); });
Handler.Post(delegate
{
_progressTask._progressDialog.Dismiss();
});
}
else
{
_progressDialog.Dismiss();
_progressTask._progressDialog.Dismiss();
}
_currentTask = null;
}
}
}
}

View File

@@ -63,7 +63,8 @@ namespace keepass2android
AskDeletePermanentlyItems,
AskDeletePermanentlyItemsNoRecycle,
InOfflineMode,
DuplicateTitle,
DocumentAccessRevoked,
DuplicateTitle,
TemplateTitle_IdCard,
TemplateField_IdCard_Name,
TemplateField_IdCard_PlaceOfIssue,
@@ -84,6 +85,7 @@ namespace keepass2android
AskAddTemplatesMessage,
ReadOnlyReason_PreKitKat,
ReadOnlyReason_ReadOnlyFlag,
ReadOnlyReason_ReadOnlyKitKat
ReadOnlyReason_ReadOnlyKitKat,
ReadOnlyReason_LocalBackup
}
}

View File

@@ -18,8 +18,8 @@ namespace keepass2android
private readonly IKp2aApp _app;
public CheckDatabaseForChanges(Context context, IKp2aApp app, OnFinish finish)
: base(finish)
public CheckDatabaseForChanges(Activity context, IKp2aApp app, OnFinish finish)
: base(context, finish)
{
_context = context;
_app = app;

View File

@@ -21,7 +21,6 @@ using System.IO;
using System.Runtime.Serialization;
using System.Security.Cryptography;
using System.Text;
using Android.Content;
using Java.Lang;
using KeePassLib;
using KeePassLib.Keys;
@@ -152,27 +151,20 @@ namespace keepass2android
set { _databaseFormat = value; }
}
public static string GetFingerprintPrefKey(IOConnectionInfo ioc)
{
var iocAsHexString = IocAsHexString(ioc);
public string IocAsHexString()
{
return IoUtil.IocAsHexString(Ioc);
}
return "kp2a_ioc_" + iocAsHexString;
}
public static string GetFingerprintPrefKey(IOConnectionInfo ioc)
{
var iocAsHexString = IoUtil.IocAsHexString(ioc);
public string IocAsHexString()
{
return IocAsHexString(Ioc);
}
return "kp2a_ioc_" + iocAsHexString;
}
private static string IocAsHexString(IOConnectionInfo ioc)
{
SHA256Managed sha256 = new SHA256Managed();
string iocAsHexString =
MemUtil.ByteArrayToHexString(sha256.ComputeHash(Encoding.Unicode.GetBytes(ioc.Path.ToCharArray())));
return iocAsHexString;
}
public static string GetFingerprintModePrefKey(IOConnectionInfo ioc)
public static string GetFingerprintModePrefKey(IOConnectionInfo ioc)
{
return GetFingerprintPrefKey(ioc) + "_mode";
}
@@ -225,7 +217,7 @@ namespace keepass2android
}
public void SaveData(Context ctx) {
public void SaveData() {
KpDatabase.UseFileTransactions = _app.GetBooleanPreference(PreferenceKey.UseFileTransactions);
using (IWriteTransaction trans = _app.GetFileStorage(Ioc).OpenWriteTransaction(Ioc, KpDatabase.UseFileTransactions))
@@ -289,6 +281,7 @@ namespace keepass2android
CanWrite = true;
_reloadRequested = false;
OtpAuxFileIoc = null;
LastOpenedEntry = null;
}
public void MarkAllGroupsAsDirty() {

View File

@@ -56,5 +56,10 @@ namespace keepass2android
{
get { return _entry; }
}
/// <summary>
/// if the entry was selected by searching for a URL, the query URL is returned here.
/// </summary>
public string SearchUrl { get; set; }
}
}

View File

@@ -11,12 +11,12 @@ namespace keepass2android
{
public class SynchronizeCachedDatabase: RunnableOnFinish
{
private readonly Context _context;
private readonly Activity _context;
private readonly IKp2aApp _app;
private SaveDb _saveDb;
public SynchronizeCachedDatabase(Context context, IKp2aApp app, OnFinish finish)
: base(finish)
public SynchronizeCachedDatabase(Activity context, IKp2aApp app, OnFinish finish)
: base(context, finish)
{
_context = context;
_app = app;
@@ -59,7 +59,7 @@ namespace keepass2android
if (cachingFileStorage.HasLocalChanges(ioc))
{
//conflict! need to merge
_saveDb = new SaveDb(_context, _app, new ActionOnFinish((success, result) =>
_saveDb = new SaveDb(_context, _app, new ActionOnFinish(ActiveActivity, (success, result, activity) =>
{
if (!success)
{

View File

@@ -16,41 +16,37 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll.
*/
using System;
using Android.App;
using Android.OS;
namespace keepass2android
{
public class ActionOnFinish: OnFinish
{
public delegate void ActionToPerformOnFinsh(bool success, String message);
public delegate void ActionToPerformOnFinsh(bool success, String message, Activity activeActivity);
readonly ActionToPerformOnFinsh _actionToPerform;
public ActionOnFinish(ActionToPerformOnFinsh actionToPerform) : base(null, null)
public ActionOnFinish(Activity activity, ActionToPerformOnFinsh actionToPerform) : base(activity, null, null)
{
_actionToPerform = actionToPerform;
}
public ActionOnFinish(ActionToPerformOnFinsh actionToPerform, OnFinish finish) : base(finish)
public ActionOnFinish(Activity activity, ActionToPerformOnFinsh actionToPerform, OnFinish finish) : base(activity, finish)
{
_actionToPerform = actionToPerform;
}
public ActionOnFinish(ActionToPerformOnFinsh actionToPerform, Handler handler) : base(handler)
{
_actionToPerform = actionToPerform;
}
public override void Run()
{
if (Message == null)
Message = "";
if (Handler != null)
{
Handler.Post(() => {_actionToPerform(Success, Message);});
Handler.Post(() => {_actionToPerform(Success, Message, ActiveActivity);});
}
else
_actionToPerform(Success, Message);
_actionToPerform(Success, Message, ActiveActivity);
base.Run();
}
}

View File

@@ -15,6 +15,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
along with Keepass2Android. If not, see <http://www.gnu.org/licenses/>.
*/
using Android.App;
using Android.Content;
using KeePassLib;
@@ -29,20 +30,20 @@ namespace keepass2android
private readonly IKp2aApp _app;
private readonly PwEntry _entry;
private readonly PwGroup _parentGroup;
private readonly Context _ctx;
private readonly Activity _ctx;
public static AddEntry GetInstance(Context ctx, IKp2aApp app, PwEntry entry, PwGroup parentGroup, OnFinish finish) {
public static AddEntry GetInstance(Activity ctx, IKp2aApp app, PwEntry entry, PwGroup parentGroup, OnFinish finish) {
return new AddEntry(ctx, app, entry, parentGroup, finish);
}
protected AddEntry(Context ctx, IKp2aApp app, PwEntry entry, PwGroup parentGroup, OnFinish finish):base(finish) {
protected AddEntry(Activity ctx, IKp2aApp app, PwEntry entry, PwGroup parentGroup, OnFinish finish):base(ctx, finish) {
_ctx = ctx;
_parentGroup = parentGroup;
_app = app;
_entry = entry;
_onFinishToRun = new AfterAdd(app.GetDb(), entry, OnFinishToRun);
_onFinishToRun = new AfterAdd(ctx, app.GetDb(), entry, OnFinishToRun);
}
@@ -68,7 +69,7 @@ namespace keepass2android
private readonly Database _db;
private readonly PwEntry _entry;
public AfterAdd(Database db, PwEntry entry, OnFinish finish):base(finish) {
public AfterAdd(Activity activity, Database db, PwEntry entry, OnFinish finish):base(activity, finish) {
_db = db;
_entry = entry;

View File

@@ -16,6 +16,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
*/
using System;
using Android.App;
using Android.Content;
using KeePassLib;
@@ -34,16 +35,16 @@ namespace keepass2android
internal PwGroup Group;
internal PwGroup Parent;
protected bool DontSave;
readonly Context _ctx;
readonly Activity _ctx;
public static AddGroup GetInstance(Context ctx, IKp2aApp app, string name, int iconid, PwUuid groupCustomIconId, PwGroup parent, OnFinish finish, bool dontSave) {
public static AddGroup GetInstance(Activity ctx, IKp2aApp app, string name, int iconid, PwUuid groupCustomIconId, PwGroup parent, OnFinish finish, bool dontSave) {
return new AddGroup(ctx, app, name, iconid, groupCustomIconId, parent, finish, dontSave);
}
private AddGroup(Context ctx, IKp2aApp app, String name, int iconid, PwUuid groupCustomIconId, PwGroup parent, OnFinish finish, bool dontSave)
: base(finish)
private AddGroup(Activity ctx, IKp2aApp app, String name, int iconid, PwUuid groupCustomIconId, PwGroup parent, OnFinish finish, bool dontSave)
: base(ctx, finish)
{
_ctx = ctx;
_name = name;
@@ -53,7 +54,7 @@ namespace keepass2android
DontSave = dontSave;
_app = app;
_onFinishToRun = new AfterAdd(this, OnFinishToRun);
_onFinishToRun = new AfterAdd(ctx, this, OnFinishToRun);
}
@@ -76,7 +77,7 @@ namespace keepass2android
private class AfterAdd : OnFinish {
readonly AddGroup _addGroup;
public AfterAdd(AddGroup addGroup,OnFinish finish): base(finish) {
public AfterAdd(Activity activity, AddGroup addGroup,OnFinish finish): base(activity, finish) {
_addGroup = addGroup;
}

View File

@@ -18,6 +18,7 @@ This file is part of Keepass2Android, Copyright 2016 Philipp Crocoll. This file
using System;
using System.Collections.Generic;
using System.Linq;
using Android.App;
using Android.Content;
using KeePassLib;
using KeePassLib.Security;
@@ -128,10 +129,10 @@ namespace keepass2android
}
private readonly IKp2aApp _app;
private readonly Context _ctx;
private readonly Activity _ctx;
public AddTemplateEntries(Context ctx, IKp2aApp app, OnFinish finish)
: base(finish)
public AddTemplateEntries(Activity ctx, IKp2aApp app, OnFinish finish)
: base(ctx, finish)
{
_ctx = ctx;
_app = app;
@@ -358,7 +359,7 @@ namespace keepass2android
private readonly Database _db;
private readonly List<PwEntry> _entries;
public AfterAdd(Database db, List<PwEntry> entries, OnFinish finish):base(finish) {
public AfterAdd(Activity activity, Database db, List<PwEntry> entries, OnFinish finish):base(activity, finish) {
_db = db;
_entries = entries;

View File

@@ -16,7 +16,7 @@ namespace keepass2android.database.edit
{
public class CopyEntry: AddEntry
{
public CopyEntry(Context ctx, IKp2aApp app, PwEntry entry, OnFinish finish)
public CopyEntry(Activity ctx, IKp2aApp app, PwEntry entry, OnFinish finish)
: base(ctx, app, CreateCopy(entry, app), entry.ParentGroup, finish)
{
}

View File

@@ -16,6 +16,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
*/
using System.Collections.Generic;
using Android.App;
using Android.Content;
using KeePassLib;
using KeePassLib.Cryptography.KeyDerivation;
@@ -31,19 +32,19 @@ namespace keepass2android
private readonly IOConnectionInfo _ioc;
private readonly bool _dontSave;
private readonly Context _ctx;
private readonly Activity _ctx;
private readonly IKp2aApp _app;
private CompositeKey _key;
public CreateDb(IKp2aApp app, Context ctx, IOConnectionInfo ioc, OnFinish finish, bool dontSave): base(finish) {
public CreateDb(IKp2aApp app, Activity ctx, IOConnectionInfo ioc, OnFinish finish, bool dontSave): base(ctx, finish) {
_ctx = ctx;
_ioc = ioc;
_dontSave = dontSave;
_app = app;
}
public CreateDb(IKp2aApp app, Context ctx, IOConnectionInfo ioc, OnFinish finish, bool dontSave, CompositeKey key)
: base(finish)
public CreateDb(IKp2aApp app, Activity ctx, IOConnectionInfo ioc, OnFinish finish, bool dontSave, CompositeKey key)
: base(ctx, finish)
{
_ctx = ctx;
_ioc = ioc;

View File

@@ -17,6 +17,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
using System;
using System.Collections.Generic;
using Android.App;
using Android.Content;
using KeePassLib;
using KeePassLib.Interfaces;
@@ -28,8 +29,8 @@ namespace keepass2android
private readonly PwEntry _entry;
private UiStringKey _statusMessage;
public DeleteEntry(Context ctx, IKp2aApp app, PwEntry entry, OnFinish finish):base(finish, app) {
Ctx = ctx;
public DeleteEntry(Activity activiy, IKp2aApp app, PwEntry entry, OnFinish finish):base(activiy, finish, app) {
Ctx = activiy;
Db = app.GetDb();
_entry = entry;

View File

@@ -17,6 +17,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
using System;
using System.Collections.Generic;
using Android.App;
using Android.Content;
using KeePassLib;
@@ -28,10 +29,10 @@ namespace keepass2android
private PwGroup _group;
protected bool DontSave;
public DeleteGroup(Context ctx, IKp2aApp app, PwGroup group, OnFinish finish)
: base(finish, app)
public DeleteGroup(Activity activity, IKp2aApp app, PwGroup group, OnFinish finish)
: base(activity, finish, app)
{
SetMembers(ctx, app, group, false);
SetMembers(activity, app, group, false);
}
/*
public DeleteGroup(Context ctx, Database db, PwGroup group, Activity act, OnFinish finish, bool dontSave)
@@ -44,9 +45,9 @@ namespace keepass2android
SetMembers(ctx, db, group, null, dontSave);
}
*/
private void SetMembers(Context ctx, IKp2aApp app, PwGroup group, bool dontSave)
private void SetMembers(Activity activity, IKp2aApp app, PwGroup group, bool dontSave)
{
base.SetMembers(ctx, app.GetDb());
base.SetMembers(activity, app.GetDb());
_group = group;
DontSave = dontSave;

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using Android.App;
using Android.Content;
using KeePassLib;
using KeePassLib.Interfaces;
@@ -11,11 +12,11 @@ namespace keepass2android
private readonly List<IStructureItem> _elementsToDelete;
private readonly bool _canRecycle;
public DeleteMultipleItems(Context ctx, Database db, List<IStructureItem> elementsToDelete, OnFinish finish, IKp2aApp app)
: base(finish, app)
public DeleteMultipleItems(Activity activity, Database db, List<IStructureItem> elementsToDelete, OnFinish finish, IKp2aApp app)
: base(activity, finish, app)
{
_elementsToDelete = elementsToDelete;
SetMembers(ctx, db);
SetMembers(activity, db);
//determine once. The property is queried for each delete operation, but might return false
//after one entry/group is deleted (and thus in recycle bin and thus can't be recycled anymore)

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Android.App;
using Android.Content;
using KeePassLib;
@@ -7,8 +8,8 @@ namespace keepass2android
{
public abstract class DeleteRunnable : RunnableOnFinish
{
protected DeleteRunnable(OnFinish finish, IKp2aApp app)
: base(finish)
protected DeleteRunnable(Activity activity, OnFinish finish, IKp2aApp app)
: base(activity, finish)
{
App = app;
}
@@ -17,11 +18,11 @@ namespace keepass2android
protected Database Db;
protected Context Ctx;
protected Activity Ctx;
protected void SetMembers(Context ctx, Database db)
protected void SetMembers(Activity activity, Database db)
{
Ctx = ctx;
Ctx = activity;
Db = db;
}
@@ -181,6 +182,7 @@ namespace keepass2android
PwDeletedObject pdo = new PwDeletedObject(pe.Uuid, dtNow);
pd.DeletedObjects.Add(pdo);
touchedGroups.Add(pgParent);
Db.Entries.Remove(pe.Uuid);
}
else // Recycle
{
@@ -208,7 +210,7 @@ namespace keepass2android
Android.Util.Log.Debug("KP2A", "Calling PerformDelete..");
PerformDelete(touchedGroups, permanentlyDeletedGroups);
_onFinishToRun = new ActionOnFinish((success, message) =>
_onFinishToRun = new ActionOnFinish(ActiveActivity,(success, message, activity) =>
{
if (success)
{

View File

@@ -16,6 +16,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
*/
using System;
using Android.App;
using Android.Content;
using KeePassLib;
@@ -32,10 +33,10 @@ namespace keepass2android
private readonly PwIcon _iconId;
private readonly PwUuid _customIconId;
internal PwGroup Group;
readonly Context _ctx;
readonly Activity _ctx;
public EditGroup(Context ctx, IKp2aApp app, String name, PwIcon iconid, PwUuid customIconId, PwGroup group, OnFinish finish)
: base(finish)
public EditGroup(Activity ctx, IKp2aApp app, String name, PwIcon iconid, PwUuid customIconId, PwGroup group, OnFinish finish)
: base(ctx, finish)
{
_ctx = ctx;
_name = name;
@@ -44,7 +45,7 @@ namespace keepass2android
_customIconId = customIconId;
_app = app;
_onFinishToRun = new AfterEdit(this, OnFinishToRun);
_onFinishToRun = new AfterEdit(ctx, this, OnFinishToRun);
}
@@ -64,8 +65,8 @@ namespace keepass2android
private class AfterEdit : OnFinish {
readonly EditGroup _editGroup;
public AfterEdit(EditGroup editGroup, OnFinish finish)
: base(finish)
public AfterEdit(Activity ctx, EditGroup editGroup, OnFinish finish)
: base(ctx, finish)
{
_editGroup = editGroup;
}

View File

@@ -16,6 +16,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
*/
using System;
using Android.App;
namespace keepass2android
{
@@ -23,7 +24,7 @@ namespace keepass2android
public abstract class FileOnFinish : OnFinish {
private String _filename = "";
protected FileOnFinish(FileOnFinish finish):base(finish) {
protected FileOnFinish(Activity activity, FileOnFinish finish):base(activity, finish) {
}
public string Filename

View File

@@ -18,7 +18,9 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
using System;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Android.App;
using KeePassLib;
using KeePassLib.Keys;
using KeePassLib.Serialization;
@@ -34,7 +36,7 @@ namespace keepass2android
private readonly bool _rememberKeyfile;
IDatabaseFormat _format;
public LoadDb(IKp2aApp app, IOConnectionInfo ioc, Task<MemoryStream> databaseData, CompositeKey compositeKey, String keyfileOrProvider, OnFinish finish): base(finish)
public LoadDb(Activity activity, IKp2aApp app, IOConnectionInfo ioc, Task<MemoryStream> databaseData, CompositeKey compositeKey, String keyfileOrProvider, OnFinish finish): base(activity, finish)
{
_app = app;
_ioc = ioc;
@@ -53,9 +55,11 @@ namespace keepass2android
{
try
{
//make sure the file data is stored in the recent files list even if loading fails
SaveFileData(_ioc, _keyfileOrProvider);
StatusLogger.UpdateMessage(UiStringKey.loading_database);
StatusLogger.UpdateMessage(UiStringKey.loading_database);
//get the stream data into a single stream variable (databaseStream) regardless whether its preloaded or not:
MemoryStream preloadedMemoryStream = _databaseData == null ? null : _databaseData.Result;
MemoryStream databaseStream;
@@ -134,10 +138,14 @@ namespace keepass2android
//now let's go:
try
{
_app.LoadDatabase(_ioc, workingCopy, _compositeKey, StatusLogger, _format);
SaveFileData(_ioc, _keyfileOrProvider);
_app.LoadDatabase(_ioc, workingCopy, _compositeKey, StatusLogger, _format);
Kp2aLog.Log("LoadDB OK");
Finish(true, _format.SuccessMessage);
//make sure the stored access time for the actual file is more recent than that of its backup
Thread.Sleep(10);
SaveFileData(_ioc, _keyfileOrProvider);
Finish(true, _format.SuccessMessage);
}
catch (OldFormatException)
{

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using Android.App;
using Android.Content;
using KeePassLib;
using KeePassLib.Interfaces;
@@ -12,10 +13,10 @@ namespace keepass2android.database.edit
{
private readonly List<IStructureItem> _elementsToMove;
private readonly PwGroup _targetGroup;
private readonly Context _ctx;
private readonly Activity _ctx;
private readonly IKp2aApp _app;
public MoveElements(List<IStructureItem> elementsToMove, PwGroup targetGroup, Context ctx, IKp2aApp app, OnFinish finish) : base(finish)
public MoveElements(List<IStructureItem> elementsToMove, PwGroup targetGroup, Activity ctx, IKp2aApp app, OnFinish finish) : base(ctx, finish)
{
_elementsToMove = elementsToMove;
_targetGroup = targetGroup;
@@ -82,7 +83,7 @@ namespace keepass2android.database.edit
}
_onFinishToRun = new ActionOnFinish((success, message) =>
_onFinishToRun = new ActionOnFinish(ActiveActivity, (success, message, activity) =>
{
if (!success)
{ // Let's not bother recovering from a failure.

View File

@@ -16,6 +16,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
*/
using System;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Widget;
@@ -31,27 +32,47 @@ namespace keepass2android
protected OnFinish BaseOnFinish;
protected Handler Handler;
private ProgressDialogStatusLogger _statusLogger = new ProgressDialogStatusLogger(); //default: no logging but not null -> can be used whenever desired
private Activity _activeActivity;
public ProgressDialogStatusLogger StatusLogger
public ProgressDialogStatusLogger StatusLogger
{
get { return _statusLogger; }
set { _statusLogger = value; }
}
public Activity ActiveActivity
{
get { return _activeActivity; }
set
{
_activeActivity = value;
if (BaseOnFinish != null)
{
BaseOnFinish.ActiveActivity = value;
}
}
}
protected OnFinish(Handler handler) {
protected OnFinish(Activity activeActivity, Handler handler)
{
ActiveActivity = activeActivity;
BaseOnFinish = null;
Handler = handler;
}
protected OnFinish(OnFinish finish, Handler handler) {
protected OnFinish(Activity activeActivity, OnFinish finish, Handler handler)
{
ActiveActivity = activeActivity;
BaseOnFinish = finish;
Handler = handler;
}
protected OnFinish(OnFinish finish) {
protected OnFinish(Activity activeActivity, OnFinish finish)
{
ActiveActivity = activeActivity;
BaseOnFinish = finish;
Handler = null;
}
@@ -86,7 +107,7 @@ namespace keepass2android
{
if ( !String.IsNullOrEmpty(message) ) {
Kp2aLog.Log("OnFinish message: "+message);
Toast.MakeText(ctx, message, ToastLength.Long).Show();
Toast.MakeText(ctx ?? Application.Context, message, ToastLength.Long).Show();
}
}
}

View File

@@ -15,6 +15,8 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
along with Keepass2Android. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using Android.App;
using Android.Content;
namespace keepass2android
{
@@ -23,8 +25,11 @@ namespace keepass2android
protected OnFinish _onFinishToRun;
public ProgressDialogStatusLogger StatusLogger = new ProgressDialogStatusLogger(); //default: empty but not null
private Activity _activeActivity;
protected RunnableOnFinish(OnFinish finish) {
protected RunnableOnFinish(Activity activeActivity, OnFinish finish)
{
_activeActivity = activeActivity;
_onFinishToRun = finish;
}
@@ -34,7 +39,18 @@ namespace keepass2android
set { _onFinishToRun = value; }
}
protected void Finish(bool result, String message, Exception exception = null) {
public Activity ActiveActivity
{
get { return _activeActivity; }
set
{
_activeActivity = value;
if (_onFinishToRun != null)
_onFinishToRun.ActiveActivity = _activeActivity;
}
}
protected void Finish(bool result, String message, Exception exception = null) {
if ( OnFinishToRun != null ) {
OnFinishToRun.SetResult(result, message, exception);
OnFinishToRun.Run();
@@ -56,7 +72,7 @@ namespace keepass2android
StatusLogger = status;
}
abstract public void Run();
public abstract void Run();
}
}

View File

@@ -18,6 +18,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
using System;
using System.IO;
using System.Security.Cryptography;
using Android.App;
using Android.Content;
using Android.OS;
using Java.Lang;
@@ -42,8 +43,8 @@ namespace keepass2android
private readonly Context _ctx;
private Thread _workerThread;
public SaveDb(Context ctx, IKp2aApp app, OnFinish finish, bool dontSave)
: base(finish)
public SaveDb(Activity ctx, IKp2aApp app, OnFinish finish, bool dontSave)
: base(ctx, finish)
{
_ctx = ctx;
_app = app;
@@ -58,8 +59,8 @@ namespace keepass2android
/// <param name="finish"></param>
/// <param name="dontSave"></param>
/// <param name="streamForOrigFile">Stream for reading the data from the (changed) original location</param>
public SaveDb(Context ctx, IKp2aApp app, OnFinish finish, bool dontSave, Stream streamForOrigFile)
: base(finish)
public SaveDb(Activity ctx, IKp2aApp app, OnFinish finish, bool dontSave, Stream streamForOrigFile)
: base(ctx, finish)
{
_ctx = ctx;
_app = app;
@@ -67,8 +68,8 @@ namespace keepass2android
_streamForOrigFile = streamForOrigFile;
}
public SaveDb(Context ctx, IKp2aApp app, OnFinish finish)
: base(finish)
public SaveDb(Activity ctx, IKp2aApp app, OnFinish finish)
: base(ctx, finish)
{
_ctx = ctx;
_app = app;
@@ -248,7 +249,7 @@ namespace keepass2android
private void PerformSaveWithoutCheck(IFileStorage fileStorage, IOConnectionInfo ioc)
{
StatusLogger.UpdateSubMessage("");
_app.GetDb().SaveData(_ctx);
_app.GetDb().SaveData();
_app.GetDb().LastFileVersion = fileStorage.GetCurrentFileVersionFast(ioc);
}

View File

@@ -15,6 +15,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
along with Keepass2Android. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using Android.App;
using Android.Content;
using KeePassLib;
using KeePassLib.Keys;
@@ -27,9 +28,9 @@ namespace keepass2android
private readonly String _keyfile;
private readonly IKp2aApp _app;
private readonly bool _dontSave;
private readonly Context _ctx;
private readonly Activity _ctx;
public SetPassword(Context ctx, IKp2aApp app, String password, String keyfile, OnFinish finish): base(finish) {
public SetPassword(Activity ctx, IKp2aApp app, String password, String keyfile, OnFinish finish): base(ctx, finish) {
_ctx = ctx;
_app = app;
_password = password;
@@ -37,8 +38,8 @@ namespace keepass2android
_dontSave = false;
}
public SetPassword(Context ctx, IKp2aApp app, String password, String keyfile, OnFinish finish, bool dontSave)
: base(finish)
public SetPassword(Activity ctx, IKp2aApp app, String password, String keyfile, OnFinish finish, bool dontSave)
: base(ctx, finish)
{
_ctx = ctx;
_app = app;
@@ -72,7 +73,7 @@ namespace keepass2android
pm.MasterKey = newKey;
// Save Database
_onFinishToRun = new AfterSave(previousKey, previousMasterKeyChanged, pm, OnFinishToRun);
_onFinishToRun = new AfterSave(ActiveActivity, previousKey, previousMasterKeyChanged, pm, OnFinishToRun);
SaveDb save = new SaveDb(_ctx, _app, OnFinishToRun, _dontSave);
save.SetStatusLogger(StatusLogger);
save.Run();
@@ -83,7 +84,7 @@ namespace keepass2android
private readonly DateTime _previousKeyChanged;
private readonly PwDatabase _db;
public AfterSave(CompositeKey backup, DateTime previousKeyChanged, PwDatabase db, OnFinish finish): base(finish) {
public AfterSave(Activity activity, CompositeKey backup, DateTime previousKeyChanged, PwDatabase db, OnFinish finish): base(activity, finish) {
_previousKeyChanged = previousKeyChanged;
_backup = backup;
_db = db;

View File

@@ -15,6 +15,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
along with Keepass2Android. If not, see <http://www.gnu.org/licenses/>.
*/
using Android.App;
using Android.Content;
using KeePassLib;
@@ -23,13 +24,13 @@ namespace keepass2android
public class UpdateEntry : RunnableOnFinish {
private readonly IKp2aApp _app;
private readonly Context _ctx;
private readonly Activity _ctx;
public UpdateEntry(Context ctx, IKp2aApp app, PwEntry oldE, PwEntry newE, OnFinish finish):base(finish) {
public UpdateEntry(Activity ctx, IKp2aApp app, PwEntry oldE, PwEntry newE, OnFinish finish):base(ctx, finish) {
_ctx = ctx;
_app = app;
_onFinishToRun = new AfterUpdate(oldE, newE, app, finish);
_onFinishToRun = new AfterUpdate(ctx, oldE, newE, app, finish);
}
@@ -45,7 +46,7 @@ namespace keepass2android
private readonly PwEntry _updatedEntry;
private readonly IKp2aApp _app;
public AfterUpdate(PwEntry backup, PwEntry updatedEntry, IKp2aApp app, OnFinish finish):base(finish) {
public AfterUpdate(Activity activity, PwEntry backup, PwEntry updatedEntry, IKp2aApp app, OnFinish finish):base(activity, finish) {
_backup = backup;
_updatedEntry = updatedEntry;
_app = app;

View File

@@ -1,4 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Android.Arch.Core.Common" version="1.0.0" targetFramework="monoandroid81" />
<package id="Xamarin.Android.Arch.Lifecycle.Common" version="1.0.1" targetFramework="monoandroid81" />
<package id="Xamarin.Android.Arch.Lifecycle.Runtime" version="1.0.0" targetFramework="monoandroid81" />
<package id="Xamarin.Android.Support.Annotations" version="26.1.0.1" targetFramework="monoandroid81" />
<package id="Xamarin.Android.Support.Compat" version="26.1.0.1" targetFramework="monoandroid81" />
<package id="Xamarin.Android.Support.Core.UI" version="26.1.0.1" targetFramework="monoandroid81" />
<package id="Xamarin.Android.Support.Core.Utils" version="26.1.0.1" targetFramework="monoandroid81" />
<package id="Xamarin.Android.Support.Fragment" version="26.1.0.1" targetFramework="monoandroid81" />
<package id="Xamarin.Android.Support.Media.Compat" version="26.1.0.1" targetFramework="monoandroid81" />
<package id="Xamarin.Android.Support.v13" version="26.1.0.1" targetFramework="monoandroid81" />
<package id="Xamarin.Android.Support.v4" version="23.1.1.0" targetFramework="MonoAndroid50" />
</packages>

View File

@@ -11,7 +11,7 @@
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<AssemblyName>Kp2aKeyboardBinding</AssemblyName>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@@ -63,8 +63,9 @@
<TransformFile Include="Transforms\EnumMethods.xml" />
<TransformFile Include="Transforms\Metadata.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.Bindings.targets" />
<ItemGroup>
<Folder Include="libs\" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Xamarin.Android.Bindings.targets" />
</Project>
</Project>

View File

@@ -0,0 +1,48 @@
Additions allow you to add arbitrary C# to the generated classes
before they are compiled. This can be helpful for providing convenience
methods or adding pure C# classes.
== Adding Methods to Generated Classes ==
Let's say the library being bound has a Rectangle class with a constructor
that takes an x and y position, and a width and length size. It will look like
this:
public partial class Rectangle
{
public Rectangle (int x, int y, int width, int height)
{
// JNI bindings
}
}
Imagine we want to add a constructor to this class that takes a Point and
Size structure instead of 4 ints. We can add a new file called Rectangle.cs
with a partial class containing our new method:
public partial class Rectangle
{
public Rectangle (Point location, Size size) :
this (location.X, location.Y, size.Width, size.Height)
{
}
}
At compile time, the additions class will be added to the generated class
and the final assembly will a Rectangle class with both constructors.
== Adding C# Classes ==
Another thing that can be done is adding fully C# managed classes to the
generated library. In the above example, let's assume that there isn't a
Point class available in Java or our library. The one we create doesn't need
to interact with Java, so we'll create it like a normal class in C#.
By adding a Point.cs file with this class, it will end up in the binding library:
public class Point
{
public int X { get; set; }
public int Y { get; set; }
}

View File

@@ -0,0 +1,24 @@
This directory is for Android .jars.
There are 2 types of jars that are supported:
== Input Jar ==
This is the jar that bindings should be generated for.
For example, if you were binding the Google Maps library, this would
be Google's "maps.jar".
Set the build action for these jars in the properties page to "InputJar".
== Reference Jars ==
These are jars that are referenced by the input jar. C# bindings will
not be created for these jars. These jars will be used to resolve
types used by the input jar.
NOTE: Do not add "android.jar" as a reference jar. It will be added automatically
based on the Target Framework selected.
Set the build action for these jars in the properties page to "ReferenceJar".

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2DB80C77-D46F-4970-B967-E9FFA9B2AC2E}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{10368E6C-D01B-4462-8E8B-01FC667A7035};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PCloudBindings</RootNamespace>
<AssemblyName>PCouldBindings</AssemblyName>
<FileAlignment>512</FileAlignment>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>0</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseNoNet|AnyCPU'">
<OutputPath>bin\ReleaseNoNet\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Jars\AboutJars.txt" />
<None Include="Additions\AboutAdditions.txt" />
<LibraryProjectZip Include="Jars\pcloud-sdk-android-1.0.1.aar" />
</ItemGroup>
<ItemGroup>
<TransformFile Include="Transforms\Metadata.xml" />
<TransformFile Include="Transforms\EnumFields.xml" />
<TransformFile Include="Transforms\EnumMethods.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.Bindings.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<EmbeddedReferenceJar Include="Jars\pcloud-sdk-java-core-1.0.1.jar" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,30 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PCloudBindings")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PCloudBindings")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,14 @@
<enum-field-mappings>
<!--
This example converts the constants Fragment_id, Fragment_name,
and Fragment_tag from android.support.v4.app.FragmentActivity.FragmentTag
to an enum called Android.Support.V4.App.FragmentTagType with values
Id, Name, and Tag.
<mapping jni-class="android/support/v4/app/FragmentActivity$FragmentTag" clr-enum-type="Android.Support.V4.App.FragmentTagType">
<field jni-name="Fragment_name" clr-name="Name" value="0" />
<field jni-name="Fragment_id" clr-name="Id" value="1" />
<field jni-name="Fragment_tag" clr-name="Tag" value="2" />
</mapping>
-->
</enum-field-mappings>

View File

@@ -0,0 +1,13 @@
<enum-method-mappings>
<!--
This example changes the Java method:
android.support.v4.app.Fragment.SavedState.writeToParcel (int flags)
to be:
android.support.v4.app.Fragment.SavedState.writeToParcel (Android.OS.ParcelableWriteFlags flags)
when bound in C#.
<mapping jni-class="android/support/v4/app/Fragment.SavedState">
<method jni-name="writeToParcel" parameter="flags" clr-enum-type="Android.OS.ParcelableWriteFlags" />
</mapping>
-->
</enum-method-mappings>

View File

@@ -0,0 +1,10 @@
<metadata>
<!--
This sample removes the class: android.support.v4.content.AsyncTaskLoader.LoadTask:
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='AsyncTaskLoader.LoadTask']" />
This sample removes the method: android.support.v4.content.CursorLoader.loadInBackground:
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" />
-->
<remove-node path="/api/package[@name='com.pcloud.sdk']" />
</metadata>

View File

@@ -10,8 +10,8 @@
<RootNamespace>PluginSdkBinding</RootNamespace>
<AssemblyName>PluginSdkBinding</AssemblyName>
<FileAlignment>512</FileAlignment>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -53,8 +53,8 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<LibraryProjectZip Include="..\java\Keepass2AndroidPluginSDK2\app\build\outputs\aar\app-debug.aar">
<Link>Jars\app-debug.aar</Link>
<LibraryProjectZip Include="..\java\Keepass2AndroidPluginSDK2\app\build\outputs\aar\app-release.aar">
<Link>Jars\app-release.aar</Link>
</LibraryProjectZip>
<None Include="Jars\AboutJars.txt" />
<None Include="Additions\AboutAdditions.txt" />

View File

@@ -13,7 +13,7 @@
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

View File

@@ -13,7 +13,7 @@
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<AssemblyName>ZlibAndroid</AssemblyName>
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

20
src/build-scripts/build-all.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
set -e
echo '*****************************************'
echo '********** Building Java parts **********'
echo '*****************************************'
./build-java.sh
echo '*****************************************'
echo '******** Building Xamarin parts *********'
echo '*****************************************'
./build-xamarin.sh
echo '*****************************************'
echo '************** Building APK *************'
echo '*****************************************'
./build-apk.sh
echo
echo 'Congratulations! You you can find the target APK in src/keepass2android/bin/Debug/.'

8
src/build-scripts/build-apk.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
set -e
pushd ../keepass2android
xabuild keepass2android.csproj /t:SignAndroidPackage "$@"
popd

18
src/build-scripts/build-java.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
set -e
pushd ../java/
pushd JavaFileStorageTest-AS
./gradlew assemble
popd
pushd KP2ASoftkeyboard_AS
./gradlew assemble
popd
pushd Keepass2AndroidPluginSDK2
./gradlew assemble
popd
popd

View File

@@ -0,0 +1,25 @@
#!/bin/bash
set -e
pushd ..
pushd Kp2aBusinessLogic/Io
if [ -f "DropboxFileStorageKeys.cs" ]
then
echo "DropboxFileStorageKeys.cs found."
else
cp DropboxFileStorageKeysDummy.cs DropboxFileStorageKeys.cs
fi
popd
pushd keepass2android
./UseManifestDebug.sh
popd
# call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64
xabuild KeePass.sln /target:keepass2android /p:BuildProjectReferences=true /p:Configuration="Debug" /p:Platform="Any CPU" "$@"
popd

55
src/build.readme.md Normal file
View File

@@ -0,0 +1,55 @@
# How to build Keepass2Android
## Overview
Keepass2Android is a Mono for Android app. This means that you need Xamarin's Mono for Android to build it. However, it also uses several components written in Java, so there are also Android-Studio projects involved. To make things even worse, parts of the keyboard and kdb-library are written in native code.
The current build-scripts assume that the native libraries are already built (they are included in the repo).
To build KP2A from scratch, make sure that you have Xamarin's Mono for Android installed and also install Android Studio. Make sure that both point to the same Android SDK location.
## Prerequisites
- Install Xamarin.Android
- Fetch all submodules (`git submodule init && git submodule update`)
## Build
### On Windows
```bat
cd build-scripts
build-java.bat
build-xamarin.bat
```
build-java.bat will call gradlew for several Java modules. build-xamarin.bat will first make sure that you have all files at their place. (There is a "secret" file for Dropbox SDK keys which is not in the repo, this is replaced with a dummy file. There are also different Android Manifest files depending on the configuration which is selected by calling the appropriate script.)
**Notes:**
- For building the java parts, it is suggested to keep a short name (e.g. "c:\projects\keepass2android") for the root project directory. Otherwise the Windows path length limit might be hit when building.
- Before building the java parts, make sure you have set the ANDROID_HOME variable or create a local.properties file inside the directories with a gradlew file. It is recommended to use the same SDK location as that of the Xamarin build.
### On Linux
- Install [Mono](https://www.mono-project.com/)
- Install Xamarin.Android
- Option 1: Use the mono-project [CI builds](https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-linux/lastSuccessfulBuild/Azure/)
- Option 2: [Build it from source](https://github.com/xamarin/xamarin-android/blob/master/Documentation/README.md#building-from-source)
- Setup your environment:
- Add `xabuild` to your path: `export PATH=/path/to/xamarin.android-oss/bin/Release/bin/:$PATH`
- Setup your `ANDROID_HOME` if it's not already: `export ANDROID_HOME=/path/to/android/`
- Alternatively, you can set your `ANDROID_SDK_PATH` and `ANDROID_NDK_PATH`.
- Build [jar2xml](https://github.com/xamarin/jar2xml) and copy `jar2xml.jar` to `/path/to/xamarin.android-oss/bin/Release/lib/xamarin.android/xbuild/Xamarin/Android/`
- Install [libzip](https://libzip.org/) for your distribution.
- Note: Xamarin seems to require `libzip4`, yet most distributions only ships `libzip5`. As a dirty workaround, it's possible to symlink `libzip.so.5` to `libzip.so.4`. Luckily, it appears to be working.
- `sudo ln -s /usr/lib/libzip.so.5 /usr/lib/libzip.so.4`
- Install NuGet dependencies:
- `cd src/ && nuget restore KeePass.sln`
- Build:
- Option 1: `cd build-scripts && ./build-all.sh`
- Option 2:
- Build the Java parts: `cd build-scripts/ && ./build-java.sh`
- Build the Xamarin parts: `./build-xamarin.sh`
- Build the signed APK: `./build-apk.sh`
- Enjoy:
- `adb install ../keepass2android/bin/Debug/keepass2android.keepass2android_debug-Signed.apk`

View File

@@ -1,23 +0,0 @@
How to build Keepass2Android
* Overview *
Keepass2Android is a Mono for Android app. This means that you need Xamarin's Mono for Android to build it. However, it also uses several components written in Java, so there are also Android-Studio projects involved. To make things even worse, parts of the keyboard and kdb-library are written in native code.
The current build-scripts assume that the native libraries are already built (they are included in the repo).
To build KP2A from scratch, make sure that you have Xamarin's Mono for Android installed and also install Android Studio. Make sure that both point to the same Android SDK location.
On Windows you can use
cd build-scripts
build-java.bat
build-xamarin.bat
build-java.bat will call gradlew for several Java modules. build-xamarin.bat will first make sure that you have all files at their place. (There is a "secret" file for Dropbox SDK keys which is not in the repo, this is replaced with a dummy file. There are also different Android Manifest files depending on the configuration which is selected by calling the appropriate script.)
* Notes *
- Please don't forget to update the git submodules before building.
- For building the java parts on Windows, it is suggested to keep a short name (e.g. "c:\projects\keepass2android") for the root project directory. Otherwise the Windows path length limit might be hit when building.
- Before building the java parts, make sure you have set the ANDROID_HOME variable or create a local.properties file inside the directories with a gradlew file. It is recommended to use the same SDK location as that of the Xamarin build.

View File

@@ -1,8 +1,8 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
@@ -25,18 +25,20 @@ dependencies {
compile 'com.squareup.okhttp3:okhttp:3.9.0'
compile 'com.burgstaller:okhttp-digest:1.7'
compile 'com.google.android.gms:play-services:4.0.30'
compile 'com.google.http-client:google-http-client-gson:1.16.0-rc'
compile 'com.google.http-client:google-http-client-gson:1.20.0'
compile('com.google.api-client:google-api-client-android:1.16.0-rc') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.apis:google-api-services-drive:v2-rev102-1.16.0-rc'
compile 'com.dropbox.core:dropbox-core-sdk:3.0.3'
//onedrive:
compile('com.onedrive.sdk:onedrive-sdk-android:1.2+') {
compile('com.onedrive.sdk:onedrive-sdk-android:1.2.0') {
transitive = false
}
compile 'com.pcloud.sdk:java-core:1.0.1'
compile 'com.pcloud.sdk:android:1.0.1'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.microsoft.services.msa:msa-auth:0.8.+'
compile 'com.microsoft.aad:adal:1.1.+'
compile 'com.microsoft.services.msa:msa-auth:0.8.6'
compile 'com.microsoft.aad:adal:1.14.0'
}

View File

@@ -1,15 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="keepass2android.javafilestorage"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="14" />
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
</manifest>
<application>
<activity
android:name=".NotifSlave"
android:label="Keepass2Android"></activity>
</application>
</manifest>

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