mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Compare commits
199 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c0f1a036b | ||
|
|
831b649cbb | ||
|
|
ded3c204b9 | ||
|
|
23eec5f066 | ||
|
|
6c167090e1 | ||
|
|
7d9eca0d46 | ||
|
|
c551aff474 | ||
|
|
e627745358 | ||
|
|
5a30d9d2b5 | ||
|
|
0a46817bbc | ||
|
|
a4134fa8c8 | ||
|
|
683535a5a6 | ||
|
|
edb53112c2 | ||
|
|
83a77af520 | ||
|
|
df3ae17c7b | ||
|
|
4a1624a443 | ||
|
|
a8de9f9f9f | ||
|
|
3aa5b40acd | ||
|
|
8400f3e874 | ||
|
|
b40bca1913 | ||
|
|
7100257f31 | ||
|
|
17df1a4d8a | ||
|
|
d7a5209c68 | ||
|
|
076220eacd | ||
|
|
99a50f271a | ||
|
|
63d265da06 | ||
|
|
30e3624eb1 | ||
|
|
88f3713e28 | ||
|
|
90f0c22545 | ||
|
|
8deed8468d | ||
|
|
923ad26b1b | ||
|
|
3bc858e4c2 | ||
|
|
f5a7fa41a7 | ||
|
|
bf71d5508b | ||
|
|
aa5adc28cb | ||
|
|
2dad013cc0 | ||
|
|
7ade66f3ac | ||
|
|
ed75a64b46 | ||
|
|
e156b80d91 | ||
|
|
90e4862280 | ||
|
|
438080d3d6 | ||
|
|
3c17605764 | ||
|
|
3f68bc0eda | ||
|
|
3e4452da00 | ||
|
|
549c690b56 | ||
|
|
aabe06f29b | ||
|
|
82693c5cd3 | ||
|
|
37a4f26d2f | ||
|
|
ca94063c7b | ||
|
|
eadc4bf6c2 | ||
|
|
b1c307c86b | ||
|
|
48331f9552 | ||
|
|
f907aa578a | ||
|
|
41e2620cc1 | ||
|
|
e7a82b167a | ||
|
|
088c556b00 | ||
|
|
c80343b6d4 | ||
|
|
4e52a8cf60 | ||
|
|
1ed1d4233f | ||
|
|
6e4626bc02 | ||
|
|
2608ae247f | ||
|
|
785586bfe9 | ||
|
|
bdcbb177ae | ||
|
|
15ac365d79 | ||
|
|
debbcb753b | ||
|
|
69d73aeaa4 | ||
|
|
dffe53370f | ||
|
|
4334e6dcdf | ||
|
|
c2c6c093d5 | ||
|
|
77e539eec2 | ||
|
|
a57970210e | ||
|
|
1b31a46fb7 | ||
|
|
87f19c74fc | ||
|
|
bd157a9724 | ||
|
|
5a327eb0db | ||
|
|
4b9c0b0109 | ||
|
|
df6b75cdbb | ||
|
|
0b4f8c122b | ||
|
|
2a87eaf3e5 | ||
|
|
c52266f5cf | ||
|
|
3b21f8add2 | ||
|
|
6574bd10a0 | ||
|
|
23f3335988 | ||
|
|
a5d7f33c82 | ||
|
|
3782c4dac0 | ||
|
|
1fc02fd2fe | ||
|
|
cc347c1dbe | ||
|
|
79ff20eb18 | ||
|
|
e6e8a447da | ||
|
|
233f0c5bdb | ||
|
|
9ed4271a14 | ||
|
|
470c0b6b43 | ||
|
|
afa8ae42b9 | ||
|
|
63d426503f | ||
|
|
ffb7f80b26 | ||
|
|
63f8826fd8 | ||
|
|
ef836e8b84 | ||
|
|
abc1c43a51 | ||
|
|
6b54dd9e0d | ||
|
|
1f54e7752d | ||
|
|
6ac941f276 | ||
|
|
a4fe92562f | ||
|
|
b9bd1d9d4b | ||
|
|
3b6c28488a | ||
|
|
875eb3500d | ||
|
|
3a88a2451c | ||
|
|
6800b73a4f | ||
|
|
983404e6d8 | ||
|
|
b95c0a18a7 | ||
|
|
36b317cad8 | ||
|
|
35d74888fb | ||
|
|
6c308483f7 | ||
|
|
9d25fb74ec | ||
|
|
d217b52744 | ||
|
|
319da4b174 | ||
|
|
9bee467942 | ||
|
|
44ac70fc97 | ||
|
|
d897611d62 | ||
|
|
c2ae251e73 | ||
|
|
35ad285864 | ||
|
|
97bdae21eb | ||
|
|
d6dc6e43c7 | ||
|
|
01e6e530d5 | ||
|
|
9ec0178beb | ||
|
|
d66f2f6d24 | ||
|
|
79cd4004cc | ||
|
|
991243e2df | ||
|
|
b91cf11d86 | ||
|
|
d182ec09fa | ||
|
|
8641822358 | ||
|
|
9665cbb428 | ||
|
|
a280dfaf3b | ||
|
|
3e56521ea8 | ||
|
|
b205230ea9 | ||
|
|
51645ab126 | ||
|
|
5d04897e75 | ||
|
|
1ac0ea5cc6 | ||
|
|
a07e8b51e5 | ||
|
|
a81f0238f4 | ||
|
|
2b81eb8ec7 | ||
|
|
e5eb642781 | ||
|
|
a4cbe25733 | ||
|
|
2042c85b22 | ||
|
|
3149f8745c | ||
|
|
15b9f1616f | ||
|
|
94c02b7288 | ||
|
|
7e70b59a59 | ||
|
|
2c7f5e41ed | ||
|
|
108b8df280 | ||
|
|
553098f9be | ||
|
|
131eb78407 | ||
|
|
f956a279a5 | ||
|
|
7150686b92 | ||
|
|
4b1fb2c173 | ||
|
|
94464bf608 | ||
|
|
2faa88784a | ||
|
|
e6607b53d8 | ||
|
|
3f6a6c864a | ||
|
|
30a578257d | ||
|
|
8411134adf | ||
|
|
f86a5d1a19 | ||
|
|
be72492537 | ||
|
|
76f9e8ec6e | ||
|
|
8fb1c44e58 | ||
|
|
f607b35cf3 | ||
|
|
0e56bec35a | ||
|
|
c890d10114 | ||
|
|
dee2fe5ce7 | ||
|
|
4a4d767bce | ||
|
|
d57e0cf601 | ||
|
|
7fa141dd1b | ||
|
|
c261a0cbca | ||
|
|
66661cbd49 | ||
|
|
100c126c3d | ||
|
|
d466e3077d | ||
|
|
24587dc34e | ||
|
|
32cc57dd03 | ||
|
|
a55488846b | ||
|
|
dcf61fd4e2 | ||
|
|
5bf998468a | ||
|
|
01c9625c59 | ||
|
|
772c378922 | ||
|
|
ee50a91379 | ||
|
|
9cfda3bad8 | ||
|
|
aa19b08bd9 | ||
|
|
87f69bb7e2 | ||
|
|
41c0aeedbe | ||
|
|
3cbe53d76f | ||
|
|
aed60d6c1e | ||
|
|
be7d35490d | ||
|
|
d0ea997c63 | ||
|
|
1fecffeba2 | ||
|
|
76319a56a2 | ||
|
|
e9a1cfea11 | ||
|
|
9115856d19 | ||
|
|
8c45266c18 | ||
|
|
6b4130df89 | ||
|
|
7948358d85 | ||
|
|
96b82bb9b2 |
13
.github/FUNDING.yml
vendored
Normal file
13
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
#github: [J-Jamet] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
#patreon: # Replace with a single Patreon username
|
||||
#open_collective: # Replace with a single Open Collective username
|
||||
#ko_fi: # Replace with a single Ko-fi username
|
||||
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: Kunzisoft # Replace with a single Liberapay username
|
||||
issuehunt: Kunzisoft/KeePassDX # Replace with a single IssueHunt username
|
||||
#otechie: # Replace with a single Otechie username
|
||||
#lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
custom: ['https://www.keepassdx.com/#donation'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
11
.github/ISSUE_TEMPLATE/bug_report.md
vendored
11
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -8,9 +8,11 @@ assignees: ''
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
@@ -18,9 +20,11 @@ Steps to reproduce the behavior:
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**KeePass Database**
|
||||
|
||||
- Created with: [e.g Windows KeePass 2.42]
|
||||
- Version: [e.g. 2]
|
||||
- Location: [e.g. Remote file retrieved with GDrive app]
|
||||
@@ -28,15 +32,18 @@ A clear and concise description of what you expected to happen.
|
||||
- Size: [e.g. 150Mo]
|
||||
- Contains attachment: [e.g. Yes]
|
||||
|
||||
**KeePassDX (please complete the following information):**
|
||||
**KeePassDX:**
|
||||
|
||||
- Version: [e.g. 2.5.0.0beta23]
|
||||
- Build: [e.g. Free]
|
||||
- Language: [e.g. French]
|
||||
|
||||
**Android (please complete the following information):**
|
||||
**Android:**
|
||||
|
||||
- Device: [e.g. GalaxyS8]
|
||||
- Version: [e.g. 8.1]
|
||||
|
||||
**Additional context**
|
||||
|
||||
Add any other context about the problem here.
|
||||
- Browser for Autofill: [e.g. Chrome version X]
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -80,6 +80,9 @@ art/screen*.png
|
||||
art/logo_512.png
|
||||
art/store_screens/
|
||||
|
||||
# Release
|
||||
releases/*
|
||||
|
||||
# Dir linux
|
||||
.directory
|
||||
*/.directory
|
||||
|
||||
31
CHANGELOG
31
CHANGELOG
@@ -1,3 +1,34 @@
|
||||
KeePassDX(3.4.4)
|
||||
* Fix crash in New Android 13 #1321
|
||||
* Better backstack management for selection mode
|
||||
* Prevent Tapjacking #1318
|
||||
* Small changes #1298
|
||||
|
||||
KeePassDX(3.4.3)
|
||||
* Remove "Select share info" setting for Magikeyboard #1304
|
||||
* Fix quick search and better loadGroup implementation #1302
|
||||
* Fix small bugs
|
||||
|
||||
KeePassDX(3.4.2)
|
||||
* Fix service parameter and workflow to remove notification when service is killed
|
||||
* Fix color
|
||||
|
||||
KeePassDX(3.4.1)
|
||||
* Fix search mode with Magikeyboard #1292
|
||||
* Fix select another entry with Magikeyboard #1293
|
||||
* Fix unexpected lock with Magikeyboard #1294
|
||||
* Small UI changes
|
||||
|
||||
KeePassDX(3.4.0)
|
||||
* Passphrase implementation #218
|
||||
* Show visual password strength indicator with entropy #631 #869 #454 #1270
|
||||
* Dynamically save password generator configuration #618 #696
|
||||
* Add advanced password filters #1052 #448 #983 #271 #539
|
||||
* Better search implementation #175 #1254 #1267
|
||||
* Manage package name from Magikeyboard #1010 #1261
|
||||
* Ask confirmation to lock if changes without save #970
|
||||
* Fix small bugs #1282
|
||||
|
||||
KeePassDX(3.3.3)
|
||||
* Fix shared otpauth link if database not open #1274
|
||||
* Ellipsize attachment name #1253
|
||||
|
||||
10
Gemfile
Normal file
10
Gemfile
Normal file
@@ -0,0 +1,10 @@
|
||||
# Autogenerated by fastlane
|
||||
#
|
||||
# Ensure this file is checked in to source control!
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem 'fastlane'
|
||||
|
||||
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
|
||||
eval_gemfile(plugins_path) if File.exist?(plugins_path)
|
||||
220
Gemfile.lock
Normal file
220
Gemfile.lock
Normal file
@@ -0,0 +1,220 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.5)
|
||||
rexml
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
artifactory (3.0.15)
|
||||
atomos (0.1.3)
|
||||
aws-eventstream (1.2.0)
|
||||
aws-partitions (1.577.0)
|
||||
aws-sdk-core (3.130.1)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
aws-partitions (~> 1, >= 1.525.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
jmespath (~> 1.0)
|
||||
aws-sdk-kms (1.55.0)
|
||||
aws-sdk-core (~> 3, >= 3.127.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-s3 (1.113.0)
|
||||
aws-sdk-core (~> 3, >= 3.127.0)
|
||||
aws-sdk-kms (~> 1)
|
||||
aws-sigv4 (~> 1.4)
|
||||
aws-sigv4 (1.4.0)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
babosa (1.0.4)
|
||||
claide (1.1.0)
|
||||
colored (1.2)
|
||||
colored2 (3.1.2)
|
||||
commander (4.6.0)
|
||||
highline (~> 2.0.0)
|
||||
declarative (0.0.20)
|
||||
digest-crc (0.6.4)
|
||||
rake (>= 12.0.0, < 14.0.0)
|
||||
domain_name (0.5.20190701)
|
||||
unf (>= 0.0.5, < 1.0.0)
|
||||
dotenv (2.7.6)
|
||||
emoji_regex (3.2.3)
|
||||
excon (0.92.2)
|
||||
faraday (1.10.0)
|
||||
faraday-em_http (~> 1.0)
|
||||
faraday-em_synchrony (~> 1.0)
|
||||
faraday-excon (~> 1.1)
|
||||
faraday-httpclient (~> 1.0)
|
||||
faraday-multipart (~> 1.0)
|
||||
faraday-net_http (~> 1.0)
|
||||
faraday-net_http_persistent (~> 1.0)
|
||||
faraday-patron (~> 1.0)
|
||||
faraday-rack (~> 1.0)
|
||||
faraday-retry (~> 1.0)
|
||||
ruby2_keywords (>= 0.0.4)
|
||||
faraday-cookie_jar (0.0.7)
|
||||
faraday (>= 0.8.0)
|
||||
http-cookie (~> 1.0.0)
|
||||
faraday-em_http (1.0.0)
|
||||
faraday-em_synchrony (1.0.0)
|
||||
faraday-excon (1.1.0)
|
||||
faraday-httpclient (1.0.1)
|
||||
faraday-multipart (1.0.3)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
faraday-net_http (1.0.1)
|
||||
faraday-net_http_persistent (1.2.0)
|
||||
faraday-patron (1.0.0)
|
||||
faraday-rack (1.0.0)
|
||||
faraday-retry (1.0.3)
|
||||
faraday_middleware (1.2.0)
|
||||
faraday (~> 1.0)
|
||||
fastimage (2.2.6)
|
||||
fastlane (2.205.1)
|
||||
CFPropertyList (>= 2.3, < 4.0.0)
|
||||
addressable (>= 2.8, < 3.0.0)
|
||||
artifactory (~> 3.0)
|
||||
aws-sdk-s3 (~> 1.0)
|
||||
babosa (>= 1.0.3, < 2.0.0)
|
||||
bundler (>= 1.12.0, < 3.0.0)
|
||||
colored
|
||||
commander (~> 4.6)
|
||||
dotenv (>= 2.1.1, < 3.0.0)
|
||||
emoji_regex (>= 0.1, < 4.0)
|
||||
excon (>= 0.71.0, < 1.0.0)
|
||||
faraday (~> 1.0)
|
||||
faraday-cookie_jar (~> 0.0.6)
|
||||
faraday_middleware (~> 1.0)
|
||||
fastimage (>= 2.1.0, < 3.0.0)
|
||||
gh_inspector (>= 1.1.2, < 2.0.0)
|
||||
google-apis-androidpublisher_v3 (~> 0.3)
|
||||
google-apis-playcustomapp_v1 (~> 0.1)
|
||||
google-cloud-storage (~> 1.31)
|
||||
highline (~> 2.0)
|
||||
json (< 3.0.0)
|
||||
jwt (>= 2.1.0, < 3)
|
||||
mini_magick (>= 4.9.4, < 5.0.0)
|
||||
multipart-post (~> 2.0.0)
|
||||
naturally (~> 2.2)
|
||||
optparse (~> 0.1.1)
|
||||
plist (>= 3.1.0, < 4.0.0)
|
||||
rubyzip (>= 2.0.0, < 3.0.0)
|
||||
security (= 0.1.3)
|
||||
simctl (~> 1.6.3)
|
||||
terminal-notifier (>= 2.0.0, < 3.0.0)
|
||||
terminal-table (>= 1.4.5, < 2.0.0)
|
||||
tty-screen (>= 0.6.3, < 1.0.0)
|
||||
tty-spinner (>= 0.8.0, < 1.0.0)
|
||||
word_wrap (~> 1.0.0)
|
||||
xcodeproj (>= 1.13.0, < 2.0.0)
|
||||
xcpretty (~> 0.3.0)
|
||||
xcpretty-travis-formatter (>= 0.0.3)
|
||||
fastlane-plugin-versioning_android (0.1.0)
|
||||
gh_inspector (1.1.3)
|
||||
google-apis-androidpublisher_v3 (0.19.0)
|
||||
google-apis-core (>= 0.4, < 2.a)
|
||||
google-apis-core (0.4.2)
|
||||
addressable (~> 2.5, >= 2.5.1)
|
||||
googleauth (>= 0.16.2, < 2.a)
|
||||
httpclient (>= 2.8.1, < 3.a)
|
||||
mini_mime (~> 1.0)
|
||||
representable (~> 3.0)
|
||||
retriable (>= 2.0, < 4.a)
|
||||
rexml
|
||||
webrick
|
||||
google-apis-iamcredentials_v1 (0.10.0)
|
||||
google-apis-core (>= 0.4, < 2.a)
|
||||
google-apis-playcustomapp_v1 (0.7.0)
|
||||
google-apis-core (>= 0.4, < 2.a)
|
||||
google-apis-storage_v1 (0.13.0)
|
||||
google-apis-core (>= 0.4, < 2.a)
|
||||
google-cloud-core (1.6.0)
|
||||
google-cloud-env (~> 1.0)
|
||||
google-cloud-errors (~> 1.0)
|
||||
google-cloud-env (1.6.0)
|
||||
faraday (>= 0.17.3, < 3.0)
|
||||
google-cloud-errors (1.2.0)
|
||||
google-cloud-storage (1.36.1)
|
||||
addressable (~> 2.8)
|
||||
digest-crc (~> 0.4)
|
||||
google-apis-iamcredentials_v1 (~> 0.1)
|
||||
google-apis-storage_v1 (~> 0.1)
|
||||
google-cloud-core (~> 1.6)
|
||||
googleauth (>= 0.16.2, < 2.a)
|
||||
mini_mime (~> 1.0)
|
||||
googleauth (1.1.2)
|
||||
faraday (>= 0.17.3, < 3.a)
|
||||
jwt (>= 1.4, < 3.0)
|
||||
memoist (~> 0.16)
|
||||
multi_json (~> 1.11)
|
||||
os (>= 0.9, < 2.0)
|
||||
signet (>= 0.16, < 2.a)
|
||||
highline (2.0.3)
|
||||
http-cookie (1.0.4)
|
||||
domain_name (~> 0.5)
|
||||
httpclient (2.8.3)
|
||||
jmespath (1.6.1)
|
||||
json (2.6.1)
|
||||
jwt (2.3.0)
|
||||
memoist (0.16.2)
|
||||
mini_magick (4.11.0)
|
||||
mini_mime (1.1.2)
|
||||
multi_json (1.15.0)
|
||||
multipart-post (2.0.0)
|
||||
nanaimo (0.3.0)
|
||||
naturally (2.2.1)
|
||||
optparse (0.1.1)
|
||||
os (1.1.4)
|
||||
plist (3.6.0)
|
||||
public_suffix (4.0.7)
|
||||
rake (13.0.6)
|
||||
representable (3.1.1)
|
||||
declarative (< 0.1.0)
|
||||
trailblazer-option (>= 0.1.1, < 0.2.0)
|
||||
uber (< 0.2.0)
|
||||
retriable (3.1.2)
|
||||
rexml (3.2.5)
|
||||
rouge (2.0.7)
|
||||
ruby2_keywords (0.0.5)
|
||||
rubyzip (2.3.2)
|
||||
security (0.1.3)
|
||||
signet (0.16.1)
|
||||
addressable (~> 2.8)
|
||||
faraday (>= 0.17.5, < 3.0)
|
||||
jwt (>= 1.5, < 3.0)
|
||||
multi_json (~> 1.10)
|
||||
simctl (1.6.8)
|
||||
CFPropertyList
|
||||
naturally
|
||||
terminal-notifier (2.0.0)
|
||||
terminal-table (1.8.0)
|
||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||
trailblazer-option (0.1.2)
|
||||
tty-cursor (0.7.1)
|
||||
tty-screen (0.8.1)
|
||||
tty-spinner (0.9.3)
|
||||
tty-cursor (~> 0.7)
|
||||
uber (0.1.0)
|
||||
unf (0.1.4)
|
||||
unf_ext
|
||||
unf_ext (0.0.8.1)
|
||||
unicode-display_width (1.8.0)
|
||||
webrick (1.7.0)
|
||||
word_wrap (1.0.0)
|
||||
xcodeproj (1.21.0)
|
||||
CFPropertyList (>= 2.3.3, < 4.0)
|
||||
atomos (~> 0.1.3)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.3.0)
|
||||
rexml (~> 3.2.4)
|
||||
xcpretty (0.3.0)
|
||||
rouge (~> 2.0.7)
|
||||
xcpretty-travis-formatter (1.0.1)
|
||||
xcpretty (~> 0.2, >= 0.0.7)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
fastlane
|
||||
fastlane-plugin-versioning_android
|
||||
|
||||
BUNDLED WITH
|
||||
2.1.4
|
||||
@@ -1,6 +1,6 @@
|
||||
# Android KeePassDX
|
||||
|
||||
<img src="https://raw.githubusercontent.com/Kunzisoft/KeePassDX/master/art/icon.png"> KeePassDX is a **multi-format KeePass manager for Android devices**. The app allows creating keys and passwords in a secure way by integrating with the Android design standards.
|
||||
<img src="https://raw.githubusercontent.com/Kunzisoft/KeePassDX/master/art/icon.png"> **Lightweight password manager for Android**, KeePassDX allows editing encrypted data in a single file in KeePass format and fill in the forms in a secure way.
|
||||
|
||||
<img src="https://raw.githubusercontent.com/Kunzisoft/KeePassDX/master/art/screen.jpg" width="220">
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ android {
|
||||
applicationId "com.kunzisoft.keepass"
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 31
|
||||
versionCode = 105
|
||||
versionName = "3.3.3"
|
||||
versionCode = 113
|
||||
versionName = "3.4.4"
|
||||
multiDexEnabled true
|
||||
|
||||
testApplicationId = "com.kunzisoft.keepass.tests"
|
||||
@@ -105,7 +105,7 @@ dependencies {
|
||||
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
|
||||
implementation 'androidx.documentfile:documentfile:1.0.1'
|
||||
implementation 'androidx.biometric:biometric:1.1.0'
|
||||
implementation 'androidx.media:media:1.5.0'
|
||||
implementation 'androidx.media:media:1.6.0'
|
||||
// Lifecycle - LiveData - ViewModel - Coroutines
|
||||
implementation "androidx.core:core-ktx:$android_core_version"
|
||||
implementation 'androidx.fragment:fragment-ktx:1.4.1'
|
||||
@@ -127,6 +127,8 @@ dependencies {
|
||||
// Apache Commons
|
||||
implementation 'commons-io:commons-io:2.8.0'
|
||||
implementation 'commons-codec:commons-codec:1.15'
|
||||
// Password generator
|
||||
implementation 'me.gosimple:nbvcxz:1.5.0'
|
||||
// Encrypt lib
|
||||
implementation project(path: ':crypto')
|
||||
// Icon pack
|
||||
|
||||
@@ -131,6 +131,9 @@
|
||||
<activity
|
||||
android:name="com.kunzisoft.keepass.activities.IconPickerActivity"
|
||||
android:configChanges="keyboardHidden" />
|
||||
<activity
|
||||
android:name="com.kunzisoft.keepass.activities.KeyGeneratorActivity"
|
||||
android:configChanges="keyboardHidden" />
|
||||
<activity
|
||||
android:name="com.kunzisoft.keepass.activities.ImageViewerActivity"
|
||||
android:configChanges="keyboardHidden" />
|
||||
@@ -147,7 +150,8 @@
|
||||
<activity
|
||||
android:name="com.kunzisoft.keepass.activities.AutofillLauncherActivity"
|
||||
android:theme="@style/Theme.Transparent"
|
||||
android:configChanges="keyboardHidden" />
|
||||
android:configChanges="keyboardHidden"
|
||||
android:excludeFromRecents="true"/>
|
||||
<activity
|
||||
android:name="com.kunzisoft.keepass.settings.SettingsAdvancedUnlockActivity" />
|
||||
<activity
|
||||
@@ -155,6 +159,7 @@
|
||||
<activity
|
||||
android:name="com.kunzisoft.keepass.activities.EntrySelectionLauncherActivity"
|
||||
android:theme="@style/Theme.Transparent"
|
||||
android:launchMode="singleInstance"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
@@ -169,9 +174,6 @@
|
||||
<data android:scheme="otpauth" android:host="hotp" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.kunzisoft.keepass.activities.MagikeyboardLauncherActivity"
|
||||
android:theme="@style/Theme.Transparent" />
|
||||
<activity
|
||||
android:name="com.kunzisoft.keepass.settings.MagikeyboardSettingsActivity"
|
||||
android:label="@string/keyboard_setting_label"
|
||||
|
||||
@@ -30,6 +30,7 @@ import androidx.core.text.HtmlCompat
|
||||
import com.kunzisoft.keepass.BuildConfig
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.stylish.StylishActivity
|
||||
import com.kunzisoft.keepass.utils.UriUtil
|
||||
import org.joda.time.DateTime
|
||||
|
||||
class AboutActivity : StylishActivity() {
|
||||
@@ -45,6 +46,12 @@ class AboutActivity : StylishActivity() {
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
supportActionBar?.setDisplayShowHomeEnabled(true)
|
||||
|
||||
val appName = if (UriUtil.contributingUser(this))
|
||||
getString(R.string.app_name) + " " + getString(R.string.app_name_part3)
|
||||
else
|
||||
getString(R.string.app_name)
|
||||
findViewById<TextView>(R.id.activity_about_app_name).text = appName
|
||||
|
||||
var version: String
|
||||
var build: String
|
||||
try {
|
||||
|
||||
@@ -58,9 +58,13 @@ import com.kunzisoft.keepass.autofill.AutofillHelper
|
||||
import com.kunzisoft.keepass.database.element.*
|
||||
import com.kunzisoft.keepass.database.element.node.Node
|
||||
import com.kunzisoft.keepass.database.element.node.NodeId
|
||||
import com.kunzisoft.keepass.database.element.template.*
|
||||
import com.kunzisoft.keepass.database.element.template.Template
|
||||
import com.kunzisoft.keepass.education.EntryEditActivityEducation
|
||||
import com.kunzisoft.keepass.model.*
|
||||
import com.kunzisoft.keepass.magikeyboard.MagikeyboardService
|
||||
import com.kunzisoft.keepass.model.AttachmentState
|
||||
import com.kunzisoft.keepass.model.EntryAttachmentState
|
||||
import com.kunzisoft.keepass.model.RegisterInfo
|
||||
import com.kunzisoft.keepass.model.SearchInfo
|
||||
import com.kunzisoft.keepass.otp.OtpElement
|
||||
import com.kunzisoft.keepass.services.AttachmentFileNotificationService
|
||||
import com.kunzisoft.keepass.services.ClipboardEntryNotificationService
|
||||
@@ -78,11 +82,9 @@ import com.kunzisoft.keepass.viewmodels.ColorPickerViewModel
|
||||
import com.kunzisoft.keepass.viewmodels.EntryEditViewModel
|
||||
import org.joda.time.DateTime
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
class EntryEditActivity : DatabaseLockActivity(),
|
||||
EntryCustomFieldDialogFragment.EntryCustomFieldListener,
|
||||
GeneratePasswordDialogFragment.GeneratePasswordListener,
|
||||
SetOTPDialogFragment.CreateOtpListener,
|
||||
DatePickerDialog.OnDateSetListener,
|
||||
TimePickerDialog.OnTimeSetListener,
|
||||
@@ -119,6 +121,20 @@ class EntryEditActivity : DatabaseLockActivity(),
|
||||
mEntryEditViewModel.selectIcon(icon)
|
||||
}
|
||||
|
||||
private var mPasswordField: Field? = null
|
||||
private var mKeyGeneratorResultLauncher = KeyGeneratorActivity.registerForGeneratedKeyResult(this) { keyGenerated ->
|
||||
keyGenerated?.let {
|
||||
mPasswordField?.let {
|
||||
it.protectedValue.stringValue = keyGenerated
|
||||
mEntryEditViewModel.selectPassword(it)
|
||||
}
|
||||
}
|
||||
mPasswordField = null
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
performedNextEducation()
|
||||
}
|
||||
}
|
||||
|
||||
// To ask data lost only one time
|
||||
private var backPressedAlreadyApproved = false
|
||||
|
||||
@@ -268,9 +284,8 @@ class EntryEditActivity : DatabaseLockActivity(),
|
||||
}
|
||||
|
||||
mEntryEditViewModel.requestPasswordSelection.observe(this) { passwordField ->
|
||||
GeneratePasswordDialogFragment
|
||||
.getInstance(passwordField)
|
||||
.show(supportFragmentManager, "PasswordGeneratorFragment")
|
||||
mPasswordField = passwordField
|
||||
KeyGeneratorActivity.launch(this, mKeyGeneratorResultLauncher)
|
||||
}
|
||||
|
||||
mEntryEditViewModel.requestCustomFieldEdition.observe(this) { field ->
|
||||
@@ -420,9 +435,10 @@ class EntryEditActivity : DatabaseLockActivity(),
|
||||
|
||||
private fun entryValidatedForKeyboardSelection(database: Database, entry: Entry) {
|
||||
// Populate Magikeyboard with entry
|
||||
populateKeyboardAndMoveAppToBackground(this,
|
||||
entry.getEntryInfo(database),
|
||||
intent)
|
||||
MagikeyboardService.populateKeyboardAndMoveAppToBackground(
|
||||
this,
|
||||
entry.getEntryInfo(database)
|
||||
)
|
||||
onValidateSpecialMode()
|
||||
// Don't keep activity history for entry edition
|
||||
finishForEntryResult(entry)
|
||||
@@ -656,17 +672,6 @@ class EntryEditActivity : DatabaseLockActivity(),
|
||||
mEntryEditViewModel.selectTime(hours, minutes)
|
||||
}
|
||||
|
||||
override fun acceptPassword(passwordField: Field) {
|
||||
mEntryEditViewModel.selectPassword(passwordField)
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
performedNextEducation()
|
||||
}
|
||||
}
|
||||
|
||||
override fun cancelPassword(passwordField: Field) {
|
||||
// Do nothing here
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
onApprovedBackPressed {
|
||||
super@EntryEditActivity.onBackPressed()
|
||||
|
||||
@@ -19,20 +19,18 @@
|
||||
*/
|
||||
package com.kunzisoft.keepass.activities
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.widget.Toast
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.helpers.EntrySelectionHelper
|
||||
import com.kunzisoft.keepass.activities.legacy.DatabaseModeActivity
|
||||
import com.kunzisoft.keepass.database.element.Database
|
||||
import com.kunzisoft.keepass.database.search.SearchHelper
|
||||
import com.kunzisoft.keepass.magikeyboard.MagikeyboardService
|
||||
import com.kunzisoft.keepass.model.EntryInfo
|
||||
import com.kunzisoft.keepass.model.SearchInfo
|
||||
import com.kunzisoft.keepass.otp.OtpEntryFields
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
|
||||
/**
|
||||
* Activity to search or select entry in database,
|
||||
@@ -45,36 +43,61 @@ class EntrySelectionLauncherActivity : DatabaseModeActivity() {
|
||||
}
|
||||
|
||||
override fun finishActivityIfReloadRequested(): Boolean {
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onDatabaseRetrieved(database: Database?) {
|
||||
super.onDatabaseRetrieved(database)
|
||||
var sharedWebDomain: String? = null
|
||||
var otpString: String? = null
|
||||
|
||||
when (intent?.action) {
|
||||
Intent.ACTION_SEND -> {
|
||||
if ("text/plain" == intent.type) {
|
||||
// Retrieve web domain or OTP
|
||||
intent.getStringExtra(Intent.EXTRA_TEXT)?.let { extra ->
|
||||
val keySelectionBundle = intent.getBundleExtra(KEY_SELECTION_BUNDLE)
|
||||
if (keySelectionBundle != null) {
|
||||
// To manage package name
|
||||
var searchInfo = SearchInfo()
|
||||
keySelectionBundle.getParcelable<SearchInfo>(KEY_SEARCH_INFO)?.let { mSearchInfo ->
|
||||
searchInfo = mSearchInfo
|
||||
}
|
||||
launch(database, searchInfo)
|
||||
} else {
|
||||
// To manage share
|
||||
var sharedWebDomain: String? = null
|
||||
var otpString: String? = null
|
||||
|
||||
when (intent?.action) {
|
||||
Intent.ACTION_SEND -> {
|
||||
if ("text/plain" == intent.type) {
|
||||
// Retrieve web domain or OTP
|
||||
intent.getStringExtra(Intent.EXTRA_TEXT)?.let { extra ->
|
||||
if (OtpEntryFields.isOTPUri(extra))
|
||||
otpString = extra
|
||||
else
|
||||
sharedWebDomain = Uri.parse(extra).host
|
||||
}
|
||||
}
|
||||
launchSelection(database, sharedWebDomain, otpString)
|
||||
}
|
||||
Intent.ACTION_VIEW -> {
|
||||
// Retrieve OTP
|
||||
intent.dataString?.let { extra ->
|
||||
if (OtpEntryFields.isOTPUri(extra))
|
||||
otpString = extra
|
||||
else
|
||||
sharedWebDomain = Uri.parse(extra).host
|
||||
}
|
||||
launchSelection(database, sharedWebDomain, otpString)
|
||||
}
|
||||
else -> {
|
||||
if (database != null) {
|
||||
GroupActivity.launch(this, database)
|
||||
} else {
|
||||
FileDatabaseSelectActivity.launch(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
Intent.ACTION_VIEW -> {
|
||||
// Retrieve OTP
|
||||
intent.dataString?.let { extra ->
|
||||
if (OtpEntryFields.isOTPUri(extra))
|
||||
otpString = extra
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
finish()
|
||||
}
|
||||
|
||||
private fun launchSelection(database: Database?,
|
||||
sharedWebDomain: String?,
|
||||
otpString: String?) {
|
||||
// Build domain search param
|
||||
val searchInfo = SearchInfo().apply {
|
||||
this.webDomain = sharedWebDomain
|
||||
@@ -90,104 +113,111 @@ class EntrySelectionLauncherActivity : DatabaseModeActivity() {
|
||||
private fun launch(database: Database?,
|
||||
searchInfo: SearchInfo) {
|
||||
|
||||
if (!searchInfo.containsOnlyNullValues()) {
|
||||
// Setting to integrate Magikeyboard
|
||||
val searchShareForMagikeyboard = PreferencesUtil.isKeyboardSearchShareEnable(this)
|
||||
// Setting to integrate Magikeyboard
|
||||
val searchShareForMagikeyboard = MagikeyboardService.activatedInSettings(this)
|
||||
|
||||
// If database is open
|
||||
val readOnly = database?.isReadOnly != false
|
||||
SearchHelper.checkAutoSearchInfo(this,
|
||||
database,
|
||||
searchInfo,
|
||||
{ openedDatabase, items ->
|
||||
// Items found
|
||||
if (searchInfo.otpString != null) {
|
||||
if (!readOnly) {
|
||||
GroupActivity.launchForSaveResult(
|
||||
this,
|
||||
openedDatabase,
|
||||
searchInfo,
|
||||
false)
|
||||
} else {
|
||||
Toast.makeText(applicationContext,
|
||||
R.string.autofill_read_only_save,
|
||||
Toast.LENGTH_LONG)
|
||||
.show()
|
||||
}
|
||||
} else if (searchShareForMagikeyboard) {
|
||||
if (items.size == 1) {
|
||||
// Automatically populate keyboard
|
||||
val entryPopulate = items[0]
|
||||
populateKeyboardAndMoveAppToBackground(
|
||||
this,
|
||||
entryPopulate,
|
||||
intent)
|
||||
} else {
|
||||
// Select the one we want
|
||||
GroupActivity.launchForKeyboardSelectionResult(this,
|
||||
openedDatabase,
|
||||
searchInfo,
|
||||
true)
|
||||
}
|
||||
} else {
|
||||
GroupActivity.launchForSearchResult(this,
|
||||
openedDatabase,
|
||||
searchInfo,
|
||||
true)
|
||||
}
|
||||
},
|
||||
{ openedDatabase ->
|
||||
// Show the database UI to select the entry
|
||||
if (searchInfo.otpString != null) {
|
||||
if (!readOnly) {
|
||||
GroupActivity.launchForSaveResult(this,
|
||||
openedDatabase,
|
||||
searchInfo,
|
||||
false)
|
||||
} else {
|
||||
Toast.makeText(applicationContext,
|
||||
R.string.autofill_read_only_save,
|
||||
Toast.LENGTH_LONG)
|
||||
.show()
|
||||
}
|
||||
} else if (readOnly || searchShareForMagikeyboard) {
|
||||
GroupActivity.launchForKeyboardSelectionResult(this,
|
||||
// If database is open
|
||||
val readOnly = database?.isReadOnly != false
|
||||
SearchHelper.checkAutoSearchInfo(this,
|
||||
database,
|
||||
searchInfo,
|
||||
{ openedDatabase, items ->
|
||||
// Items found
|
||||
if (searchInfo.otpString != null) {
|
||||
if (!readOnly) {
|
||||
GroupActivity.launchForSaveResult(
|
||||
this,
|
||||
openedDatabase,
|
||||
searchInfo,
|
||||
false)
|
||||
} else {
|
||||
Toast.makeText(applicationContext,
|
||||
R.string.autofill_read_only_save,
|
||||
Toast.LENGTH_LONG)
|
||||
.show()
|
||||
}
|
||||
} else if (searchShareForMagikeyboard) {
|
||||
MagikeyboardService.performSelection(
|
||||
items,
|
||||
{ entryInfo ->
|
||||
// Automatically populate keyboard
|
||||
MagikeyboardService.populateKeyboardAndMoveAppToBackground(
|
||||
this,
|
||||
entryInfo
|
||||
)
|
||||
},
|
||||
{ autoSearch ->
|
||||
GroupActivity.launchForKeyboardSelectionResult(this,
|
||||
openedDatabase,
|
||||
searchInfo,
|
||||
autoSearch)
|
||||
}
|
||||
)
|
||||
} else {
|
||||
GroupActivity.launchForSearchResult(this,
|
||||
openedDatabase,
|
||||
searchInfo,
|
||||
true)
|
||||
}
|
||||
},
|
||||
{ openedDatabase ->
|
||||
// Show the database UI to select the entry
|
||||
if (searchInfo.otpString != null) {
|
||||
if (!readOnly) {
|
||||
GroupActivity.launchForSaveResult(this,
|
||||
openedDatabase,
|
||||
searchInfo,
|
||||
false)
|
||||
}
|
||||
},
|
||||
{
|
||||
// If database not open
|
||||
if (searchInfo.otpString != null) {
|
||||
FileDatabaseSelectActivity.launchForSaveResult(this,
|
||||
searchInfo)
|
||||
} else if (searchShareForMagikeyboard) {
|
||||
FileDatabaseSelectActivity.launchForKeyboardSelectionResult(this,
|
||||
searchInfo)
|
||||
} else {
|
||||
FileDatabaseSelectActivity.launchForSearchResult(this,
|
||||
searchInfo)
|
||||
Toast.makeText(applicationContext,
|
||||
R.string.autofill_read_only_save,
|
||||
Toast.LENGTH_LONG)
|
||||
.show()
|
||||
}
|
||||
} else if (searchShareForMagikeyboard) {
|
||||
GroupActivity.launchForKeyboardSelectionResult(this,
|
||||
openedDatabase,
|
||||
searchInfo,
|
||||
false)
|
||||
} else {
|
||||
GroupActivity.launchForSearchResult(this,
|
||||
openedDatabase,
|
||||
searchInfo,
|
||||
false)
|
||||
}
|
||||
)
|
||||
},
|
||||
{
|
||||
// If database not open
|
||||
if (searchInfo.otpString != null) {
|
||||
FileDatabaseSelectActivity.launchForSaveResult(this,
|
||||
searchInfo)
|
||||
} else if (searchShareForMagikeyboard) {
|
||||
FileDatabaseSelectActivity.launchForKeyboardSelectionResult(this,
|
||||
searchInfo)
|
||||
} else {
|
||||
FileDatabaseSelectActivity.launchForSearchResult(this,
|
||||
searchInfo)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
private const val KEY_SELECTION_BUNDLE = "KEY_SELECTION_BUNDLE"
|
||||
private const val KEY_SEARCH_INFO = "KEY_SEARCH_INFO"
|
||||
|
||||
fun launch(context: Context,
|
||||
searchInfo: SearchInfo? = null) {
|
||||
val intent = Intent(context, EntrySelectionLauncherActivity::class.java).apply {
|
||||
putExtra(KEY_SELECTION_BUNDLE, Bundle().apply {
|
||||
putParcelable(KEY_SEARCH_INFO, searchInfo)
|
||||
})
|
||||
}
|
||||
// New task needed because don't launch from an Activity context
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or
|
||||
Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||
context.startActivity(intent)
|
||||
}
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
fun populateKeyboardAndMoveAppToBackground(activity: Activity,
|
||||
entry: EntryInfo,
|
||||
intent: Intent,
|
||||
toast: Boolean = true) {
|
||||
// Populate Magikeyboard with entry
|
||||
MagikeyboardService.addEntryAndLaunchNotificationIfAllowed(activity, entry, toast)
|
||||
// Consume the selection mode
|
||||
EntrySelectionHelper.removeModesFromIntent(intent)
|
||||
activity.moveTaskToBack(true)
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import android.util.Log
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.activity.viewModels
|
||||
import androidx.annotation.RequiresApi
|
||||
@@ -321,16 +320,6 @@ class FileDatabaseSelectActivity : DatabaseModeActivity(),
|
||||
}
|
||||
}
|
||||
|
||||
override fun onValidateSpecialMode() {
|
||||
super.onValidateSpecialMode()
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onCancelSpecialMode() {
|
||||
super.onCancelSpecialMode()
|
||||
finish()
|
||||
}
|
||||
|
||||
private fun launchPasswordActivityWithPath(databaseUri: Uri) {
|
||||
launchPasswordActivity(databaseUri, null)
|
||||
// Delete flickering for kitkat <=
|
||||
|
||||
@@ -67,6 +67,7 @@ import com.kunzisoft.keepass.database.element.node.Type
|
||||
import com.kunzisoft.keepass.database.search.SearchHelper
|
||||
import com.kunzisoft.keepass.database.search.SearchParameters
|
||||
import com.kunzisoft.keepass.education.GroupActivityEducation
|
||||
import com.kunzisoft.keepass.magikeyboard.MagikeyboardService
|
||||
import com.kunzisoft.keepass.model.GroupInfo
|
||||
import com.kunzisoft.keepass.model.MainCredential
|
||||
import com.kunzisoft.keepass.model.RegisterInfo
|
||||
@@ -79,6 +80,7 @@ import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
import com.kunzisoft.keepass.settings.SettingsActivity
|
||||
import com.kunzisoft.keepass.tasks.ActionRunnable
|
||||
import com.kunzisoft.keepass.timeout.TimeoutHelper
|
||||
import com.kunzisoft.keepass.utils.BACK_PREVIOUS_KEYBOARD_ACTION
|
||||
import com.kunzisoft.keepass.utils.UriUtil
|
||||
import com.kunzisoft.keepass.view.*
|
||||
import com.kunzisoft.keepass.viewmodels.GroupEditViewModel
|
||||
@@ -122,8 +124,6 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
|
||||
private var mBreadcrumbAdapter: BreadcrumbAdapter? = null
|
||||
|
||||
private var mSearchMenuItem: MenuItem? = null
|
||||
|
||||
private var mGroupFragment: GroupFragment? = null
|
||||
private var mRecyclingBinEnabled = false
|
||||
private var mRecyclingBinIsCurrentGroup = false
|
||||
@@ -182,6 +182,11 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
|
||||
addSearch()
|
||||
//loadGroup()
|
||||
|
||||
// Back to previous keyboard
|
||||
if (PreferencesUtil.isKeyboardPreviousSearchEnable(this@GroupActivity)) {
|
||||
sendBroadcast(Intent(BACK_PREVIOUS_KEYBOARD_ACTION))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -200,7 +205,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
finishNodeAction()
|
||||
if (mSearchState == null) {
|
||||
mSearchState = SearchState(searchFiltersView?.searchParameters
|
||||
?: SearchParameters(), 0)
|
||||
?: PreferencesUtil.getDefaultSearchParameters(this), 0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,20 +407,14 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
val currentGroup = it.group
|
||||
mCurrentGroup = currentGroup
|
||||
if (currentGroup.isVirtual) {
|
||||
val searchParameters = it.searchParameters
|
||||
mSearchState = SearchState(searchParameters, it.showFromPosition)
|
||||
mSearchState = SearchState(
|
||||
it.searchParameters,
|
||||
it.showFromPosition
|
||||
)
|
||||
}
|
||||
// Main and search groups in activity are managed with another variables
|
||||
// to keep values during orientation
|
||||
|
||||
// Expand the search view if defined in settings
|
||||
if (mRequestStartupSearch
|
||||
&& PreferencesUtil.automaticallyFocusSearch(this@GroupActivity)) {
|
||||
// To request search only one time
|
||||
mRequestStartupSearch = false
|
||||
mSearchMenuItem?.expandActionView()
|
||||
}
|
||||
|
||||
loadingView?.hideByFading()
|
||||
}
|
||||
|
||||
@@ -719,11 +718,16 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
val stringQuery = intent.getStringExtra(SearchManager.QUERY)?.trim { it <= ' ' } ?: ""
|
||||
intent.action = Intent.ACTION_DEFAULT
|
||||
intent.removeExtra(SearchManager.QUERY)
|
||||
mSearchState = SearchState(SearchParameters().apply {
|
||||
mSearchState = SearchState(PreferencesUtil.getDefaultSearchParameters(this).apply {
|
||||
searchQuery = stringQuery
|
||||
}, mSearchState?.firstVisibleItem ?: 0)
|
||||
} else if (mRequestStartupSearch
|
||||
&& PreferencesUtil.automaticallyFocusSearch(this@GroupActivity)) {
|
||||
// Expand the search view if defined in settings
|
||||
// To request search only one time
|
||||
mRequestStartupSearch = false
|
||||
addSearch()
|
||||
}
|
||||
loadGroup()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -884,10 +888,9 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
private fun entrySelectedForKeyboardSelection(database: Database, entry: Entry) {
|
||||
reloadCurrentGroup()
|
||||
// Populate Magikeyboard with entry
|
||||
populateKeyboardAndMoveAppToBackground(
|
||||
MagikeyboardService.populateKeyboardAndMoveAppToBackground(
|
||||
this,
|
||||
entry.getEntryInfo(database),
|
||||
intent
|
||||
entry.getEntryInfo(database)
|
||||
)
|
||||
onValidateSpecialMode()
|
||||
}
|
||||
@@ -1126,6 +1129,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
|
||||
finishNodeAction()
|
||||
searchView?.setOnQueryTextListener(null)
|
||||
searchFiltersView?.saveSearchParameters()
|
||||
}
|
||||
|
||||
private fun addSearchQueryInSearchView(searchQuery: String) {
|
||||
@@ -1173,7 +1177,6 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
// Get the SearchView and set the searchable configuration
|
||||
menu.findItem(R.id.menu_search)?.let {
|
||||
mLockSearchListeners = true
|
||||
mSearchMenuItem = it
|
||||
it.setOnActionExpandListener(mOnSearchActionExpandListener)
|
||||
searchView = it.actionView as SearchView?
|
||||
searchView?.apply {
|
||||
@@ -1605,50 +1608,31 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
autofillActivityResultLauncher: ActivityResultLauncher<Intent>?) {
|
||||
EntrySelectionHelper.doSpecialAction(activity.intent,
|
||||
{
|
||||
GroupActivity.launch(
|
||||
// Default action
|
||||
launch(
|
||||
activity,
|
||||
database,
|
||||
true
|
||||
)
|
||||
},
|
||||
{ searchInfo ->
|
||||
SearchHelper.checkAutoSearchInfo(activity,
|
||||
// Search action
|
||||
if (database.loaded) {
|
||||
launchForSearchResult(activity,
|
||||
database,
|
||||
searchInfo,
|
||||
{ _, _ ->
|
||||
// Response is build
|
||||
GroupActivity.launchForSearchResult(activity,
|
||||
database,
|
||||
searchInfo,
|
||||
true)
|
||||
onLaunchActivitySpecialMode()
|
||||
},
|
||||
{
|
||||
// Here no search info found
|
||||
if (database.isReadOnly) {
|
||||
GroupActivity.launchForSearchResult(activity,
|
||||
database,
|
||||
searchInfo,
|
||||
false)
|
||||
} else {
|
||||
GroupActivity.launchForSaveResult(activity,
|
||||
database,
|
||||
searchInfo,
|
||||
false)
|
||||
}
|
||||
onLaunchActivitySpecialMode()
|
||||
},
|
||||
{
|
||||
// Simply close if database not opened, normally not happened
|
||||
onCancelSpecialMode()
|
||||
}
|
||||
)
|
||||
true)
|
||||
onLaunchActivitySpecialMode()
|
||||
} else {
|
||||
// Simply close if database not opened
|
||||
onCancelSpecialMode()
|
||||
}
|
||||
},
|
||||
{ searchInfo ->
|
||||
// Save info used with OTP
|
||||
// Save info
|
||||
if (database.loaded) {
|
||||
if (!database.isReadOnly) {
|
||||
GroupActivity.launchForSaveResult(
|
||||
launchForSaveResult(
|
||||
activity,
|
||||
database,
|
||||
searchInfo,
|
||||
@@ -1667,28 +1651,33 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
}
|
||||
},
|
||||
{ searchInfo ->
|
||||
// Keyboard selection
|
||||
SearchHelper.checkAutoSearchInfo(activity,
|
||||
database,
|
||||
searchInfo,
|
||||
{ _, items ->
|
||||
// Response is build
|
||||
if (items.size == 1) {
|
||||
populateKeyboardAndMoveAppToBackground(activity,
|
||||
items[0],
|
||||
activity.intent)
|
||||
onValidateSpecialMode()
|
||||
} else {
|
||||
// Select the one we want
|
||||
GroupActivity.launchForKeyboardSelectionResult(activity,
|
||||
database,
|
||||
searchInfo,
|
||||
true)
|
||||
onLaunchActivitySpecialMode()
|
||||
}
|
||||
MagikeyboardService.performSelection(
|
||||
items,
|
||||
{ entryInfo ->
|
||||
// Keyboard populated
|
||||
MagikeyboardService.populateKeyboardAndMoveAppToBackground(
|
||||
activity,
|
||||
entryInfo
|
||||
)
|
||||
onValidateSpecialMode()
|
||||
},
|
||||
{ autoSearch ->
|
||||
launchForKeyboardSelectionResult(activity,
|
||||
database,
|
||||
searchInfo,
|
||||
autoSearch)
|
||||
onLaunchActivitySpecialMode()
|
||||
}
|
||||
)
|
||||
},
|
||||
{
|
||||
// Here no search info found, disable auto search
|
||||
GroupActivity.launchForKeyboardSelectionResult(activity,
|
||||
launchForKeyboardSelectionResult(activity,
|
||||
database,
|
||||
searchInfo,
|
||||
false)
|
||||
@@ -1701,6 +1690,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
)
|
||||
},
|
||||
{ searchInfo, autofillComponent ->
|
||||
// Autofill selection
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
SearchHelper.checkAutoSearchInfo(activity,
|
||||
database,
|
||||
@@ -1712,7 +1702,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
},
|
||||
{
|
||||
// Here no search info found, disable auto search
|
||||
GroupActivity.launchForAutofillResult(activity,
|
||||
launchForAutofillResult(activity,
|
||||
database,
|
||||
autofillActivityResultLauncher,
|
||||
autofillComponent,
|
||||
@@ -1730,20 +1720,21 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
}
|
||||
},
|
||||
{ registerInfo ->
|
||||
// Autofill registration
|
||||
if (!database.isReadOnly) {
|
||||
SearchHelper.checkAutoSearchInfo(activity,
|
||||
database,
|
||||
registerInfo?.searchInfo,
|
||||
{ _, _ ->
|
||||
// No auto search, it's a registration
|
||||
GroupActivity.launchForRegistration(activity,
|
||||
launchForRegistration(activity,
|
||||
database,
|
||||
registerInfo)
|
||||
onLaunchActivitySpecialMode()
|
||||
},
|
||||
{
|
||||
// Here no search info found, disable auto search
|
||||
GroupActivity.launchForRegistration(activity,
|
||||
launchForRegistration(activity,
|
||||
database,
|
||||
registerInfo)
|
||||
onLaunchActivitySpecialMode()
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.kunzisoft.keepass.activities
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.activity.viewModels
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.fragment.app.commit
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.fragments.KeyGeneratorFragment
|
||||
import com.kunzisoft.keepass.activities.legacy.DatabaseLockActivity
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
import com.kunzisoft.keepass.view.updateLockPaddingLeft
|
||||
import com.kunzisoft.keepass.viewmodels.KeyGeneratorViewModel
|
||||
|
||||
class KeyGeneratorActivity : DatabaseLockActivity() {
|
||||
|
||||
private lateinit var toolbar: Toolbar
|
||||
private lateinit var coordinatorLayout: CoordinatorLayout
|
||||
private lateinit var validationButton: View
|
||||
private var lockView: View? = null
|
||||
|
||||
private val keyGeneratorViewModel: KeyGeneratorViewModel by viewModels()
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
setContentView(R.layout.activity_key_generator)
|
||||
|
||||
toolbar = findViewById(R.id.toolbar)
|
||||
toolbar.title = " "
|
||||
setSupportActionBar(toolbar)
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
supportActionBar?.setDisplayShowHomeEnabled(true)
|
||||
|
||||
coordinatorLayout = findViewById(R.id.key_generator_coordinator)
|
||||
|
||||
lockView = findViewById(R.id.lock_button)
|
||||
lockView?.setOnClickListener {
|
||||
lockAndExit()
|
||||
}
|
||||
|
||||
validationButton = findViewById(R.id.key_generator_validation)
|
||||
validationButton.setOnClickListener {
|
||||
keyGeneratorViewModel.validateKeyGenerated()
|
||||
}
|
||||
|
||||
supportFragmentManager.commit {
|
||||
replace(R.id.key_generator_fragment, KeyGeneratorFragment.getInstance(
|
||||
// Default selection tab
|
||||
KeyGeneratorFragment.KeyGeneratorTab.PASSWORD
|
||||
), KEY_GENERATED_FRAGMENT_TAG
|
||||
)
|
||||
}
|
||||
|
||||
keyGeneratorViewModel.keyGenerated.observe(this) { keyGenerated ->
|
||||
setResult(Activity.RESULT_OK, Intent().apply {
|
||||
putExtra(KEY_GENERATED, keyGenerated)
|
||||
})
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
override fun viewToInvalidateTimeout(): View? {
|
||||
return findViewById<ViewGroup>(R.id.key_generator_container)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
// Show the lock button
|
||||
lockView?.visibility = if (PreferencesUtil.showLockDatabaseButton(this)) {
|
||||
View.VISIBLE
|
||||
} else {
|
||||
View.GONE
|
||||
}
|
||||
|
||||
// Padding if lock button visible
|
||||
toolbar.updateLockPaddingLeft()
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
|
||||
super.onCreateOptionsMenu(menu)
|
||||
menuInflater.inflate(R.menu.key_generator, menu)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
android.R.id.home -> {
|
||||
onBackPressed()
|
||||
}
|
||||
R.id.menu_generate -> {
|
||||
keyGeneratorViewModel.requireKeyGeneration()
|
||||
}
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
setResult(Activity.RESULT_CANCELED, Intent())
|
||||
super.onBackPressed()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val KEY_GENERATED = "KEY_GENERATED"
|
||||
private const val KEY_GENERATED_FRAGMENT_TAG = "KEY_GENERATED_FRAGMENT_TAG"
|
||||
|
||||
fun registerForGeneratedKeyResult(activity: FragmentActivity,
|
||||
keyGeneratedListener: (String?) -> Unit): ActivityResultLauncher<Intent> {
|
||||
return activity.registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||
if (result.resultCode == Activity.RESULT_OK) {
|
||||
keyGeneratedListener.invoke(
|
||||
result.data?.getStringExtra(KEY_GENERATED)
|
||||
)
|
||||
} else {
|
||||
keyGeneratedListener.invoke(null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun launch(context: FragmentActivity,
|
||||
resultLauncher: ActivityResultLauncher<Intent>) {
|
||||
// Create an instance to return the picker icon
|
||||
resultLauncher.launch(
|
||||
Intent(context, KeyGeneratorActivity::class.java)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright 2020 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePassDX.
|
||||
*
|
||||
* KeePassDX is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePassDX is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.activities
|
||||
|
||||
import com.kunzisoft.keepass.activities.legacy.DatabaseModeActivity
|
||||
import com.kunzisoft.keepass.database.element.Database
|
||||
import com.kunzisoft.keepass.database.search.SearchHelper
|
||||
|
||||
/**
|
||||
* Activity to select entry in database and populate it in Magikeyboard
|
||||
*/
|
||||
class MagikeyboardLauncherActivity : DatabaseModeActivity() {
|
||||
|
||||
override fun applyCustomStyle(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun finishActivityIfReloadRequested(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onDatabaseRetrieved(database: Database?) {
|
||||
super.onDatabaseRetrieved(database)
|
||||
SearchHelper.checkAutoSearchInfo(this,
|
||||
database,
|
||||
null,
|
||||
{ _, _ ->
|
||||
// Not called
|
||||
// if items found directly returns before calling this activity
|
||||
},
|
||||
{ openedDatabase ->
|
||||
// Select if not found
|
||||
GroupActivity.launchForKeyboardSelectionResult(this, openedDatabase)
|
||||
},
|
||||
{
|
||||
// Pass extra to get entry
|
||||
FileDatabaseSelectActivity.launchForKeyboardSelectionResult(this)
|
||||
}
|
||||
)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
@@ -369,16 +369,6 @@ class MainCredentialActivity : DatabaseModeActivity(), AdvancedUnlockFragment.Bu
|
||||
}
|
||||
}
|
||||
|
||||
override fun onValidateSpecialMode() {
|
||||
super.onValidateSpecialMode()
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onCancelSpecialMode() {
|
||||
super.onCancelSpecialMode()
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun retrieveCredentialForEncryption(): ByteArray {
|
||||
return mainCredentialView?.retrieveCredentialForStorage(credentialStorageListener)
|
||||
?: byteArrayOf()
|
||||
@@ -612,18 +602,23 @@ class MainCredentialActivity : DatabaseModeActivity(), AdvancedUnlockFragment.Bu
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
|
||||
&& !readOnlyEducationPerformed) {
|
||||
val biometricCanAuthenticate = AdvancedUnlockManager.canAuthenticate(this)
|
||||
val biometricPerformed =
|
||||
(biometricCanAuthenticate == BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED
|
||||
if ((biometricCanAuthenticate == BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED
|
||||
|| biometricCanAuthenticate == BiometricManager.BIOMETRIC_SUCCESS)
|
||||
&& advancedUnlockButton != null
|
||||
&& mPasswordActivityEducation.checkAndPerformedBiometricEducation(
|
||||
advancedUnlockButton!!,
|
||||
{
|
||||
startActivity(Intent(this, SettingsAdvancedUnlockActivity::class.java))
|
||||
},
|
||||
{
|
||||
&& advancedUnlockButton != null) {
|
||||
mPasswordActivityEducation.checkAndPerformedBiometricEducation(
|
||||
advancedUnlockButton!!,
|
||||
{
|
||||
startActivity(
|
||||
Intent(
|
||||
this,
|
||||
SettingsAdvancedUnlockActivity::class.java
|
||||
)
|
||||
)
|
||||
},
|
||||
{
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (ignored: Exception) {}
|
||||
}
|
||||
|
||||
@@ -1,224 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePassDX.
|
||||
*
|
||||
* KeePassDX is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePassDX is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.activities.dialogs
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.database.element.Field
|
||||
import com.kunzisoft.keepass.password.PasswordGenerator
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
import com.kunzisoft.keepass.timeout.ClipboardHelper
|
||||
import com.kunzisoft.keepass.view.applyFontVisibility
|
||||
|
||||
class GeneratePasswordDialogFragment : DatabaseDialogFragment() {
|
||||
|
||||
private var mListener: GeneratePasswordListener? = null
|
||||
|
||||
private var root: View? = null
|
||||
private var lengthTextView: EditText? = null
|
||||
private var passwordInputLayoutView: TextInputLayout? = null
|
||||
private var passwordView: EditText? = null
|
||||
|
||||
private var mPasswordField: Field? = null
|
||||
|
||||
private var uppercaseBox: CompoundButton? = null
|
||||
private var lowercaseBox: CompoundButton? = null
|
||||
private var digitsBox: CompoundButton? = null
|
||||
private var minusBox: CompoundButton? = null
|
||||
private var underlineBox: CompoundButton? = null
|
||||
private var spaceBox: CompoundButton? = null
|
||||
private var specialsBox: CompoundButton? = null
|
||||
private var bracketsBox: CompoundButton? = null
|
||||
private var extendedBox: CompoundButton? = null
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
try {
|
||||
mListener = context as GeneratePasswordListener
|
||||
} catch (e: ClassCastException) {
|
||||
throw ClassCastException(context.toString()
|
||||
+ " must implement " + GeneratePasswordListener::class.java.name)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetach() {
|
||||
mListener = null
|
||||
super.onDetach()
|
||||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
activity?.let { activity ->
|
||||
val builder = AlertDialog.Builder(activity)
|
||||
val inflater = activity.layoutInflater
|
||||
root = inflater.inflate(R.layout.fragment_generate_password, null)
|
||||
|
||||
passwordInputLayoutView = root?.findViewById(R.id.password_input_layout)
|
||||
passwordView = root?.findViewById(R.id.password)
|
||||
passwordView?.applyFontVisibility()
|
||||
val passwordCopyView: ImageView? = root?.findViewById(R.id.password_copy_button)
|
||||
passwordCopyView?.visibility = if(PreferencesUtil.allowCopyProtectedFields(activity))
|
||||
View.VISIBLE else View.GONE
|
||||
val clipboardHelper = ClipboardHelper(activity)
|
||||
passwordCopyView?.setOnClickListener {
|
||||
clipboardHelper.timeoutCopyToClipboard(passwordView!!.text.toString(),
|
||||
getString(R.string.copy_field,
|
||||
getString(R.string.entry_password)))
|
||||
}
|
||||
|
||||
lengthTextView = root?.findViewById(R.id.length)
|
||||
|
||||
uppercaseBox = root?.findViewById(R.id.cb_uppercase)
|
||||
lowercaseBox = root?.findViewById(R.id.cb_lowercase)
|
||||
digitsBox = root?.findViewById(R.id.cb_digits)
|
||||
minusBox = root?.findViewById(R.id.cb_minus)
|
||||
underlineBox = root?.findViewById(R.id.cb_underline)
|
||||
spaceBox = root?.findViewById(R.id.cb_space)
|
||||
specialsBox = root?.findViewById(R.id.cb_specials)
|
||||
bracketsBox = root?.findViewById(R.id.cb_brackets)
|
||||
extendedBox = root?.findViewById(R.id.cb_extended)
|
||||
|
||||
mPasswordField = arguments?.getParcelable(KEY_PASSWORD_FIELD)
|
||||
|
||||
assignDefaultCharacters()
|
||||
|
||||
val seekBar = root?.findViewById<SeekBar>(R.id.seekbar_length)
|
||||
seekBar?.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
||||
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
|
||||
lengthTextView?.setText(progress.toString())
|
||||
}
|
||||
|
||||
override fun onStartTrackingTouch(seekBar: SeekBar) {}
|
||||
|
||||
override fun onStopTrackingTouch(seekBar: SeekBar) {}
|
||||
})
|
||||
|
||||
context?.let { context ->
|
||||
seekBar?.progress = PreferencesUtil.getDefaultPasswordLength(context)
|
||||
}
|
||||
|
||||
root?.findViewById<Button>(R.id.generate_password_button)
|
||||
?.setOnClickListener { fillPassword() }
|
||||
|
||||
builder.setView(root)
|
||||
.setPositiveButton(R.string.accept) { _, _ ->
|
||||
mPasswordField?.let { passwordField ->
|
||||
passwordView?.text?.toString()?.let { passwordValue ->
|
||||
passwordField.protectedValue.stringValue = passwordValue
|
||||
}
|
||||
mListener?.acceptPassword(passwordField)
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
.setNegativeButton(android.R.string.cancel) { _, _ ->
|
||||
mPasswordField?.let { passwordField ->
|
||||
mListener?.cancelPassword(passwordField)
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
|
||||
// Pre-populate a password to possibly save the user a few clicks
|
||||
fillPassword()
|
||||
|
||||
return builder.create()
|
||||
}
|
||||
return super.onCreateDialog(savedInstanceState)
|
||||
}
|
||||
|
||||
private fun assignDefaultCharacters() {
|
||||
uppercaseBox?.isChecked = false
|
||||
lowercaseBox?.isChecked = false
|
||||
digitsBox?.isChecked = false
|
||||
minusBox?.isChecked = false
|
||||
underlineBox?.isChecked = false
|
||||
spaceBox?.isChecked = false
|
||||
specialsBox?.isChecked = false
|
||||
bracketsBox?.isChecked = false
|
||||
extendedBox?.isChecked = false
|
||||
|
||||
context?.let { context ->
|
||||
PreferencesUtil.getDefaultPasswordCharacters(context)?.let { charSet ->
|
||||
for (passwordChar in charSet) {
|
||||
when (passwordChar) {
|
||||
getString(R.string.value_password_uppercase) -> uppercaseBox?.isChecked = true
|
||||
getString(R.string.value_password_lowercase) -> lowercaseBox?.isChecked = true
|
||||
getString(R.string.value_password_digits) -> digitsBox?.isChecked = true
|
||||
getString(R.string.value_password_minus) -> minusBox?.isChecked = true
|
||||
getString(R.string.value_password_underline) -> underlineBox?.isChecked = true
|
||||
getString(R.string.value_password_space) -> spaceBox?.isChecked = true
|
||||
getString(R.string.value_password_special) -> specialsBox?.isChecked = true
|
||||
getString(R.string.value_password_brackets) -> bracketsBox?.isChecked = true
|
||||
getString(R.string.value_password_extended) -> extendedBox?.isChecked = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun fillPassword() {
|
||||
root?.findViewById<EditText>(R.id.password)?.setText(generatePassword())
|
||||
}
|
||||
|
||||
fun generatePassword(): String {
|
||||
var password = ""
|
||||
try {
|
||||
val length = Integer.valueOf(root?.findViewById<EditText>(R.id.length)?.text.toString())
|
||||
password = PasswordGenerator(resources).generatePassword(length,
|
||||
uppercaseBox?.isChecked == true,
|
||||
lowercaseBox?.isChecked == true,
|
||||
digitsBox?.isChecked == true,
|
||||
minusBox?.isChecked == true,
|
||||
underlineBox?.isChecked == true,
|
||||
spaceBox?.isChecked == true,
|
||||
specialsBox?.isChecked == true,
|
||||
bracketsBox?.isChecked == true,
|
||||
extendedBox?.isChecked == true)
|
||||
passwordInputLayoutView?.error = null
|
||||
} catch (e: NumberFormatException) {
|
||||
passwordInputLayoutView?.error = getString(R.string.error_wrong_length)
|
||||
} catch (e: IllegalArgumentException) {
|
||||
passwordInputLayoutView?.error = e.message
|
||||
}
|
||||
|
||||
return password
|
||||
}
|
||||
|
||||
interface GeneratePasswordListener {
|
||||
fun acceptPassword(passwordField: Field)
|
||||
fun cancelPassword(passwordField: Field)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val KEY_PASSWORD_FIELD = "KEY_PASSWORD_FIELD"
|
||||
|
||||
fun getInstance(field: Field): GeneratePasswordDialogFragment {
|
||||
return GeneratePasswordDialogFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putParcelable(KEY_PASSWORD_FIELD, field)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,8 +36,11 @@ import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.helpers.ExternalFileHelper
|
||||
import com.kunzisoft.keepass.activities.helpers.setOpenDocumentClickListener
|
||||
import com.kunzisoft.keepass.model.MainCredential
|
||||
import com.kunzisoft.keepass.password.PasswordEntropy
|
||||
import com.kunzisoft.keepass.utils.UriUtil
|
||||
import com.kunzisoft.keepass.view.KeyFileSelectionView
|
||||
import com.kunzisoft.keepass.view.PassKeyView
|
||||
import com.kunzisoft.keepass.view.applyFontVisibility
|
||||
|
||||
class SetMainCredentialDialogFragment : DatabaseDialogFragment() {
|
||||
|
||||
@@ -48,8 +51,7 @@ class SetMainCredentialDialogFragment : DatabaseDialogFragment() {
|
||||
|
||||
private var passwordCheckBox: CompoundButton? = null
|
||||
|
||||
private var passwordTextInputLayout: TextInputLayout? = null
|
||||
private var passwordView: TextView? = null
|
||||
private var passKeyView: PassKeyView? = null
|
||||
private var passwordRepeatTextInputLayout: TextInputLayout? = null
|
||||
private var passwordRepeatView: TextView? = null
|
||||
|
||||
@@ -59,6 +61,7 @@ class SetMainCredentialDialogFragment : DatabaseDialogFragment() {
|
||||
private var mListener: AssignMainCredentialDialogListener? = null
|
||||
|
||||
private var mExternalFileHelper: ExternalFileHelper? = null
|
||||
private var mPasswordEntropyCalculator: PasswordEntropy? = null
|
||||
|
||||
private var mEmptyPasswordConfirmationDialog: AlertDialog? = null
|
||||
private var mNoKeyConfirmationDialog: AlertDialog? = null
|
||||
@@ -100,6 +103,13 @@ class SetMainCredentialDialogFragment : DatabaseDialogFragment() {
|
||||
super.onDetach()
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
// Create the password entropy object
|
||||
mPasswordEntropyCalculator = PasswordEntropy()
|
||||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
activity?.let { activity ->
|
||||
|
||||
@@ -123,10 +133,10 @@ class SetMainCredentialDialogFragment : DatabaseDialogFragment() {
|
||||
}
|
||||
|
||||
passwordCheckBox = rootView?.findViewById(R.id.password_checkbox)
|
||||
passwordTextInputLayout = rootView?.findViewById(R.id.password_input_layout)
|
||||
passwordView = rootView?.findViewById(R.id.pass_password)
|
||||
passKeyView = rootView?.findViewById(R.id.password_view)
|
||||
passwordRepeatTextInputLayout = rootView?.findViewById(R.id.password_repeat_input_layout)
|
||||
passwordRepeatView = rootView?.findViewById(R.id.pass_conf_password)
|
||||
passwordRepeatView = rootView?.findViewById(R.id.password_confirmation)
|
||||
passwordRepeatView?.applyFontVisibility()
|
||||
|
||||
keyFileCheckBox = rootView?.findViewById(R.id.keyfile_checkox)
|
||||
keyFileSelectionView = rootView?.findViewById(R.id.keyfile_selection)
|
||||
@@ -162,7 +172,7 @@ class SetMainCredentialDialogFragment : DatabaseDialogFragment() {
|
||||
if (allowNoMasterKey)
|
||||
showNoKeyConfirmationDialog()
|
||||
else {
|
||||
passwordTextInputLayout?.error = getString(R.string.error_disallow_no_credentials)
|
||||
passwordRepeatTextInputLayout?.error = getString(R.string.error_disallow_no_credentials)
|
||||
}
|
||||
}
|
||||
if (!error) {
|
||||
@@ -194,22 +204,22 @@ class SetMainCredentialDialogFragment : DatabaseDialogFragment() {
|
||||
super.onResume()
|
||||
|
||||
// To check checkboxes if a text is present
|
||||
passwordView?.addTextChangedListener(passwordTextWatcher)
|
||||
passKeyView?.addTextChangedListener(passwordTextWatcher)
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
|
||||
passwordView?.removeTextChangedListener(passwordTextWatcher)
|
||||
passKeyView?.removeTextChangedListener(passwordTextWatcher)
|
||||
}
|
||||
|
||||
private fun verifyPassword(): Boolean {
|
||||
var error = false
|
||||
if (passwordCheckBox != null
|
||||
&& passwordCheckBox!!.isChecked
|
||||
&& passwordView != null
|
||||
&& passKeyView != null
|
||||
&& passwordRepeatView != null) {
|
||||
mMasterPassword = passwordView!!.text.toString()
|
||||
mMasterPassword = passKeyView!!.passwordString
|
||||
val confPassword = passwordRepeatView!!.text.toString()
|
||||
|
||||
// Verify that passwords match
|
||||
|
||||
@@ -26,14 +26,14 @@ class IconPickerFragment : DatabaseFragment() {
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
return inflater.inflate(R.layout.fragment_icon_picker, container, false)
|
||||
return inflater.inflate(R.layout.fragment_tabs_pagination, container, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
viewPager = view.findViewById(R.id.icon_picker_pager)
|
||||
tabLayout = view.findViewById(R.id.icon_picker_tabs)
|
||||
viewPager = view.findViewById(R.id.tabs_view_pager)
|
||||
tabLayout = view.findViewById(R.id.tabs_layout)
|
||||
resetAppTimeoutWhenViewFocusedOrChanged(view)
|
||||
|
||||
arguments?.apply {
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Copyright 2022 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePassDX.
|
||||
*
|
||||
* KeePassDX is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePassDX is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.activities.fragments
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import com.google.android.material.tabs.TabLayout
|
||||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.adapters.KeyGeneratorPagerAdapter
|
||||
import com.kunzisoft.keepass.database.element.Database
|
||||
import com.kunzisoft.keepass.viewmodels.KeyGeneratorViewModel
|
||||
|
||||
class KeyGeneratorFragment : DatabaseFragment() {
|
||||
|
||||
private var keyGeneratorPagerAdapter: KeyGeneratorPagerAdapter? = null
|
||||
private lateinit var viewPager: ViewPager2
|
||||
private lateinit var tabLayout: TabLayout
|
||||
|
||||
private val mKeyGeneratorViewModel: KeyGeneratorViewModel by activityViewModels()
|
||||
|
||||
private var mSelectedTab = KeyGeneratorTab.PASSWORD
|
||||
private var mOnPageChangeCallback: ViewPager2.OnPageChangeCallback = object:
|
||||
ViewPager2.OnPageChangeCallback() {
|
||||
override fun onPageSelected(position: Int) {
|
||||
super.onPageSelected(position)
|
||||
mSelectedTab = KeyGeneratorTab.getKeyGeneratorTabByPosition(position)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
return inflater.inflate(R.layout.fragment_tabs_pagination, container, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
keyGeneratorPagerAdapter = KeyGeneratorPagerAdapter(this, )
|
||||
viewPager = view.findViewById(R.id.tabs_view_pager)
|
||||
tabLayout = view.findViewById(R.id.tabs_layout)
|
||||
viewPager.adapter = keyGeneratorPagerAdapter
|
||||
TabLayoutMediator(tabLayout, viewPager) { tab, position ->
|
||||
tab.text = getString(KeyGeneratorTab.getKeyGeneratorTabByPosition(position).stringId)
|
||||
}.attach()
|
||||
viewPager.registerOnPageChangeCallback(mOnPageChangeCallback)
|
||||
|
||||
resetAppTimeoutWhenViewFocusedOrChanged(view)
|
||||
|
||||
arguments?.apply {
|
||||
if (containsKey(PASSWORD_TAB_ARG)) {
|
||||
viewPager.currentItem = getInt(PASSWORD_TAB_ARG)
|
||||
}
|
||||
remove(PASSWORD_TAB_ARG)
|
||||
}
|
||||
|
||||
mKeyGeneratorViewModel.requireKeyGeneration.observe(viewLifecycleOwner) {
|
||||
when (mSelectedTab) {
|
||||
KeyGeneratorTab.PASSWORD -> {
|
||||
mKeyGeneratorViewModel.requirePasswordGeneration()
|
||||
}
|
||||
KeyGeneratorTab.PASSPHRASE -> {
|
||||
mKeyGeneratorViewModel.requirePassphraseGeneration()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mKeyGeneratorViewModel.keyGeneratedValidated.observe(viewLifecycleOwner) {
|
||||
when (mSelectedTab) {
|
||||
KeyGeneratorTab.PASSWORD -> {
|
||||
mKeyGeneratorViewModel.validatePasswordGenerated()
|
||||
}
|
||||
KeyGeneratorTab.PASSPHRASE -> {
|
||||
mKeyGeneratorViewModel.validatePassphraseGenerated()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
viewPager.unregisterOnPageChangeCallback(mOnPageChangeCallback)
|
||||
super.onDestroyView()
|
||||
}
|
||||
|
||||
override fun onDatabaseRetrieved(database: Database?) {
|
||||
// Nothing here
|
||||
}
|
||||
|
||||
enum class KeyGeneratorTab(@StringRes val stringId: Int) {
|
||||
PASSWORD(R.string.password), PASSPHRASE(R.string.passphrase);
|
||||
|
||||
companion object {
|
||||
fun getKeyGeneratorTabByPosition(position: Int): KeyGeneratorTab {
|
||||
return when (position) {
|
||||
0 -> PASSWORD
|
||||
else -> PASSPHRASE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
private const val PASSWORD_TAB_ARG = "PASSWORD_TAB_ARG"
|
||||
|
||||
fun getInstance(keyGeneratorTab: KeyGeneratorTab): KeyGeneratorFragment {
|
||||
val fragment = KeyGeneratorFragment()
|
||||
fragment.arguments = Bundle().apply {
|
||||
putInt(PASSWORD_TAB_ARG, keyGeneratorTab.ordinal)
|
||||
}
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
/*
|
||||
* Copyright 2022 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePassDX.
|
||||
*
|
||||
* KeePassDX is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePassDX is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.activities.fragments
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.*
|
||||
import androidx.core.widget.doOnTextChanged
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import com.google.android.material.slider.Slider
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.database.element.Database
|
||||
import com.kunzisoft.keepass.password.PassphraseGenerator
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
import com.kunzisoft.keepass.timeout.ClipboardHelper
|
||||
import com.kunzisoft.keepass.view.PassKeyView
|
||||
import com.kunzisoft.keepass.viewmodels.KeyGeneratorViewModel
|
||||
|
||||
class PassphraseGeneratorFragment : DatabaseFragment() {
|
||||
|
||||
private lateinit var passKeyView: PassKeyView
|
||||
|
||||
private lateinit var sliderWordCount: Slider
|
||||
private lateinit var wordCountText: EditText
|
||||
private lateinit var charactersCountText: TextView
|
||||
private lateinit var wordSeparator: EditText
|
||||
private lateinit var wordCaseSpinner: Spinner
|
||||
|
||||
private var minSliderWordCount: Int = 0
|
||||
private var maxSliderWordCount: Int = 0
|
||||
private var wordCaseAdapter: ArrayAdapter<String>? = null
|
||||
|
||||
private val mKeyGeneratorViewModel: KeyGeneratorViewModel by activityViewModels()
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View {
|
||||
return inflater.inflate(R.layout.fragment_generate_passphrase, container, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
passKeyView = view.findViewById(R.id.passphrase_view)
|
||||
val passphraseCopyView: ImageView? = view.findViewById(R.id.passphrase_copy_button)
|
||||
sliderWordCount = view.findViewById(R.id.slider_word_count)
|
||||
wordCountText = view.findViewById(R.id.word_count)
|
||||
charactersCountText = view.findViewById(R.id.character_count)
|
||||
wordSeparator = view.findViewById(R.id.word_separator)
|
||||
wordCaseSpinner = view.findViewById(R.id.word_case)
|
||||
|
||||
minSliderWordCount = resources.getInteger(R.integer.passphrase_generator_word_count_min)
|
||||
maxSliderWordCount = resources.getInteger(R.integer.passphrase_generator_word_count_max)
|
||||
|
||||
contextThemed?.let { context ->
|
||||
passphraseCopyView?.visibility = if(PreferencesUtil.allowCopyProtectedFields(context))
|
||||
View.VISIBLE else View.GONE
|
||||
val clipboardHelper = ClipboardHelper(context)
|
||||
passphraseCopyView?.setOnClickListener {
|
||||
clipboardHelper.timeoutCopyToClipboard(passKeyView.passwordString,
|
||||
getString(R.string.copy_field,
|
||||
getString(R.string.entry_password)))
|
||||
}
|
||||
|
||||
wordCaseAdapter = ArrayAdapter(context,
|
||||
android.R.layout.simple_spinner_item, resources.getStringArray(R.array.word_case_array)).apply {
|
||||
setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||
}
|
||||
wordCaseSpinner.adapter = wordCaseAdapter
|
||||
}
|
||||
|
||||
loadSettings()
|
||||
|
||||
var listenSlider = true
|
||||
var listenEditText = true
|
||||
sliderWordCount.addOnChangeListener { _, value, _ ->
|
||||
try {
|
||||
listenEditText = false
|
||||
if (listenSlider) {
|
||||
wordCountText.setText(value.toInt().toString())
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to set the word count value", e)
|
||||
} finally {
|
||||
listenEditText = true
|
||||
}
|
||||
}
|
||||
sliderWordCount.addOnSliderTouchListener(object : Slider.OnSliderTouchListener {
|
||||
// TODO upgrade material-components lib
|
||||
// https://stackoverflow.com/questions/70873160/material-slider-onslidertouchlisteners-methods-can-only-be-called-from-within-t
|
||||
@SuppressLint("RestrictedApi")
|
||||
override fun onStartTrackingTouch(slider: Slider) {}
|
||||
|
||||
@SuppressLint("RestrictedApi")
|
||||
override fun onStopTrackingTouch(slider: Slider) {
|
||||
generatePassphrase()
|
||||
}
|
||||
})
|
||||
wordCountText.doOnTextChanged { _, _, _, _ ->
|
||||
if (listenEditText) {
|
||||
try {
|
||||
listenSlider = false
|
||||
setSliderValue(getWordCount())
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to get the word count value", e)
|
||||
} finally {
|
||||
listenSlider = true
|
||||
generatePassphrase()
|
||||
}
|
||||
}
|
||||
}
|
||||
wordSeparator.doOnTextChanged { _, _, _, _ ->
|
||||
generatePassphrase()
|
||||
}
|
||||
wordCaseSpinner.onItemSelectedListener = object: AdapterView.OnItemSelectedListener {
|
||||
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
|
||||
generatePassphrase()
|
||||
}
|
||||
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) {}
|
||||
}
|
||||
|
||||
generatePassphrase()
|
||||
|
||||
mKeyGeneratorViewModel.passphraseGeneratedValidated.observe(viewLifecycleOwner) {
|
||||
mKeyGeneratorViewModel.setKeyGenerated(passKeyView.passwordString)
|
||||
}
|
||||
|
||||
mKeyGeneratorViewModel.requirePassphraseGeneration.observe(viewLifecycleOwner) {
|
||||
generatePassphrase()
|
||||
}
|
||||
|
||||
resetAppTimeoutWhenViewFocusedOrChanged(view)
|
||||
}
|
||||
|
||||
private fun getWordCount(): Int {
|
||||
return try {
|
||||
Integer.valueOf(wordCountText.text.toString())
|
||||
} catch (numberException: NumberFormatException) {
|
||||
minSliderWordCount
|
||||
}
|
||||
}
|
||||
|
||||
private fun setWordCount(wordCount: Int) {
|
||||
setSliderValue(wordCount)
|
||||
wordCountText.setText(wordCount.toString())
|
||||
}
|
||||
|
||||
private fun setSliderValue(value: Int) {
|
||||
when {
|
||||
value < minSliderWordCount -> {
|
||||
sliderWordCount.value = minSliderWordCount.toFloat()
|
||||
}
|
||||
value > maxSliderWordCount -> {
|
||||
sliderWordCount.value = maxSliderWordCount.toFloat()
|
||||
}
|
||||
else -> {
|
||||
sliderWordCount.value = value.toFloat()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getWordSeparator(): String {
|
||||
return wordSeparator.text.toString().ifEmpty { " " }
|
||||
}
|
||||
|
||||
private fun getWordCase(): PassphraseGenerator.WordCase {
|
||||
var wordCase = PassphraseGenerator.WordCase.LOWER_CASE
|
||||
try {
|
||||
wordCase = PassphraseGenerator.WordCase.getByOrdinal(wordCaseSpinner.selectedItemPosition)
|
||||
} catch (caseException: Exception) {
|
||||
Log.e(TAG, "Unable to retrieve the word case", caseException)
|
||||
}
|
||||
return wordCase
|
||||
}
|
||||
|
||||
private fun setWordCase(wordCase: PassphraseGenerator.WordCase) {
|
||||
wordCaseSpinner.setSelection(wordCase.ordinal)
|
||||
}
|
||||
|
||||
private fun getSeparator(): String {
|
||||
return wordSeparator.text?.toString() ?: ""
|
||||
}
|
||||
|
||||
private fun setSeparator(separator: String) {
|
||||
wordSeparator.setText(separator)
|
||||
}
|
||||
|
||||
private fun generatePassphrase() {
|
||||
var passphrase = ""
|
||||
try {
|
||||
passphrase = PassphraseGenerator().generatePassphrase(
|
||||
getWordCount(),
|
||||
getWordSeparator(),
|
||||
getWordCase())
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to generate a passphrase", e)
|
||||
}
|
||||
passKeyView.passwordString = passphrase
|
||||
charactersCountText.text = getString(R.string.character_count, passphrase.length)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
saveSettings()
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
private fun saveSettings() {
|
||||
context?.let { context ->
|
||||
PreferencesUtil.setDefaultPassphraseWordCount(context, getWordCount())
|
||||
PreferencesUtil.setDefaultPassphraseWordCase(context, getWordCase())
|
||||
PreferencesUtil.setDefaultPassphraseSeparator(context, getSeparator())
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadSettings() {
|
||||
context?.let { context ->
|
||||
setWordCount(PreferencesUtil.getDefaultPassphraseWordCount(context))
|
||||
setWordCase(PreferencesUtil.getDefaultPassphraseWordCase(context))
|
||||
setSeparator(PreferencesUtil.getDefaultPassphraseSeparator(context))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDatabaseRetrieved(database: Database?) {
|
||||
// Nothing here
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "PassphraseGnrtrFrgmt"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,358 @@
|
||||
/*
|
||||
* Copyright 2019 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePassDX.
|
||||
*
|
||||
* KeePassDX is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePassDX is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.activities.fragments
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.CompoundButton
|
||||
import android.widget.EditText
|
||||
import android.widget.ImageView
|
||||
import androidx.core.widget.doOnTextChanged
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import com.google.android.material.slider.Slider
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.database.element.Database
|
||||
import com.kunzisoft.keepass.password.PasswordGenerator
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
import com.kunzisoft.keepass.timeout.ClipboardHelper
|
||||
import com.kunzisoft.keepass.view.PassKeyView
|
||||
import com.kunzisoft.keepass.viewmodels.KeyGeneratorViewModel
|
||||
|
||||
class PasswordGeneratorFragment : DatabaseFragment() {
|
||||
|
||||
private lateinit var passKeyView: PassKeyView
|
||||
|
||||
private lateinit var sliderLength: Slider
|
||||
private lateinit var lengthEditView: EditText
|
||||
|
||||
private lateinit var uppercaseCompound: CompoundButton
|
||||
private lateinit var lowercaseCompound: CompoundButton
|
||||
private lateinit var digitsCompound: CompoundButton
|
||||
private lateinit var minusCompound: CompoundButton
|
||||
private lateinit var underlineCompound: CompoundButton
|
||||
private lateinit var spaceCompound: CompoundButton
|
||||
private lateinit var specialsCompound: CompoundButton
|
||||
private lateinit var bracketsCompound: CompoundButton
|
||||
private lateinit var extendedCompound: CompoundButton
|
||||
private lateinit var considerCharsEditText: EditText
|
||||
private lateinit var ignoreCharsEditText: EditText
|
||||
private lateinit var atLeastOneCompound: CompoundButton
|
||||
private lateinit var excludeAmbiguousCompound: CompoundButton
|
||||
|
||||
private var minLengthSlider: Int = 0
|
||||
private var maxLengthSlider: Int = 0
|
||||
|
||||
private val mKeyGeneratorViewModel: KeyGeneratorViewModel by activityViewModels()
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View {
|
||||
return inflater.inflate(R.layout.fragment_generate_password, container, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
passKeyView = view.findViewById(R.id.password_view)
|
||||
val passwordCopyView: ImageView? = view.findViewById(R.id.password_copy_button)
|
||||
|
||||
sliderLength = view.findViewById(R.id.slider_length)
|
||||
lengthEditView = view.findViewById(R.id.length)
|
||||
|
||||
uppercaseCompound = view.findViewById(R.id.upperCase_filter)
|
||||
lowercaseCompound = view.findViewById(R.id.lowerCase_filter)
|
||||
digitsCompound = view.findViewById(R.id.digits_filter)
|
||||
minusCompound = view.findViewById(R.id.minus_filter)
|
||||
underlineCompound = view.findViewById(R.id.underline_filter)
|
||||
spaceCompound = view.findViewById(R.id.space_filter)
|
||||
specialsCompound = view.findViewById(R.id.special_filter)
|
||||
bracketsCompound = view.findViewById(R.id.brackets_filter)
|
||||
extendedCompound = view.findViewById(R.id.extendedASCII_filter)
|
||||
considerCharsEditText = view.findViewById(R.id.consider_chars_filter)
|
||||
ignoreCharsEditText = view.findViewById(R.id.ignore_chars_filter)
|
||||
atLeastOneCompound = view.findViewById(R.id.atLeastOne_filter)
|
||||
excludeAmbiguousCompound = view.findViewById(R.id.excludeAmbiguous_filter)
|
||||
|
||||
contextThemed?.let { context ->
|
||||
passwordCopyView?.visibility = if(PreferencesUtil.allowCopyProtectedFields(context))
|
||||
View.VISIBLE else View.GONE
|
||||
val clipboardHelper = ClipboardHelper(context)
|
||||
passwordCopyView?.setOnClickListener {
|
||||
clipboardHelper.timeoutCopyToClipboard(passKeyView.passwordString,
|
||||
getString(R.string.copy_field,
|
||||
getString(R.string.entry_password)))
|
||||
}
|
||||
}
|
||||
|
||||
minLengthSlider = resources.getInteger(R.integer.password_generator_length_min)
|
||||
maxLengthSlider = resources.getInteger(R.integer.password_generator_length_max)
|
||||
|
||||
loadSettings()
|
||||
|
||||
uppercaseCompound.setOnCheckedChangeListener { _, _ ->
|
||||
generatePassword()
|
||||
}
|
||||
lowercaseCompound.setOnCheckedChangeListener { _, _ ->
|
||||
generatePassword()
|
||||
}
|
||||
digitsCompound.setOnCheckedChangeListener { _, _ ->
|
||||
generatePassword()
|
||||
}
|
||||
minusCompound.setOnCheckedChangeListener { _, _ ->
|
||||
generatePassword()
|
||||
}
|
||||
underlineCompound.setOnCheckedChangeListener { _, _ ->
|
||||
generatePassword()
|
||||
}
|
||||
spaceCompound.setOnCheckedChangeListener { _, _ ->
|
||||
generatePassword()
|
||||
}
|
||||
specialsCompound.setOnCheckedChangeListener { _, _ ->
|
||||
generatePassword()
|
||||
}
|
||||
bracketsCompound.setOnCheckedChangeListener { _, _ ->
|
||||
generatePassword()
|
||||
}
|
||||
extendedCompound.setOnCheckedChangeListener { _, _ ->
|
||||
generatePassword()
|
||||
}
|
||||
considerCharsEditText.doOnTextChanged { _, _, _, _ ->
|
||||
generatePassword()
|
||||
}
|
||||
ignoreCharsEditText.doOnTextChanged { _, _, _, _ ->
|
||||
generatePassword()
|
||||
}
|
||||
atLeastOneCompound.setOnCheckedChangeListener { _, _ ->
|
||||
generatePassword()
|
||||
}
|
||||
excludeAmbiguousCompound.setOnCheckedChangeListener { _, _ ->
|
||||
generatePassword()
|
||||
}
|
||||
|
||||
var listenSlider = true
|
||||
var listenEditText = true
|
||||
sliderLength.addOnChangeListener { _, value, _ ->
|
||||
try {
|
||||
listenEditText = false
|
||||
if (listenSlider) {
|
||||
lengthEditView.setText(value.toInt().toString())
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to set the length value", e)
|
||||
} finally {
|
||||
listenEditText = true
|
||||
}
|
||||
}
|
||||
sliderLength.addOnSliderTouchListener(object : Slider.OnSliderTouchListener {
|
||||
// TODO upgrade material-components lib
|
||||
// https://stackoverflow.com/questions/70873160/material-slider-onslidertouchlisteners-methods-can-only-be-called-from-within-t
|
||||
@SuppressLint("RestrictedApi")
|
||||
override fun onStartTrackingTouch(slider: Slider) {}
|
||||
|
||||
@SuppressLint("RestrictedApi")
|
||||
override fun onStopTrackingTouch(slider: Slider) {
|
||||
generatePassword()
|
||||
}
|
||||
})
|
||||
lengthEditView.doOnTextChanged { _, _, _, _ ->
|
||||
if (listenEditText) {
|
||||
try {
|
||||
listenSlider = false
|
||||
setSliderValue(getPasswordLength())
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to get the length value", e)
|
||||
} finally {
|
||||
listenSlider = true
|
||||
generatePassword()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Pre-populate a password to possibly save the user a few clicks
|
||||
generatePassword()
|
||||
|
||||
mKeyGeneratorViewModel.passwordGeneratedValidated.observe(viewLifecycleOwner) {
|
||||
mKeyGeneratorViewModel.setKeyGenerated(passKeyView.passwordString)
|
||||
}
|
||||
|
||||
mKeyGeneratorViewModel.requirePasswordGeneration.observe(viewLifecycleOwner) {
|
||||
generatePassword()
|
||||
}
|
||||
|
||||
resetAppTimeoutWhenViewFocusedOrChanged(view)
|
||||
}
|
||||
|
||||
private fun getPasswordLength(): Int {
|
||||
return try {
|
||||
Integer.valueOf(lengthEditView.text.toString())
|
||||
} catch (numberException: NumberFormatException) {
|
||||
minLengthSlider
|
||||
}
|
||||
}
|
||||
|
||||
private fun setPasswordLength(passwordLength: Int) {
|
||||
setSliderValue(passwordLength)
|
||||
lengthEditView.setText(passwordLength.toString())
|
||||
}
|
||||
|
||||
private fun getOptions(): Set<String> {
|
||||
val optionsSet = mutableSetOf<String>()
|
||||
if (uppercaseCompound.isChecked)
|
||||
optionsSet.add(getString(R.string.value_password_uppercase))
|
||||
if (lowercaseCompound.isChecked)
|
||||
optionsSet.add(getString(R.string.value_password_lowercase))
|
||||
if (digitsCompound.isChecked)
|
||||
optionsSet.add(getString(R.string.value_password_digits))
|
||||
if (minusCompound.isChecked)
|
||||
optionsSet.add(getString(R.string.value_password_minus))
|
||||
if (underlineCompound.isChecked)
|
||||
optionsSet.add(getString(R.string.value_password_underline))
|
||||
if (spaceCompound.isChecked)
|
||||
optionsSet.add(getString(R.string.value_password_space))
|
||||
if (specialsCompound.isChecked)
|
||||
optionsSet.add(getString(R.string.value_password_special))
|
||||
if (bracketsCompound.isChecked)
|
||||
optionsSet.add(getString(R.string.value_password_brackets))
|
||||
if (extendedCompound.isChecked)
|
||||
optionsSet.add(getString(R.string.value_password_extended))
|
||||
if (atLeastOneCompound.isChecked)
|
||||
optionsSet.add(getString(R.string.value_password_atLeastOne))
|
||||
if (excludeAmbiguousCompound.isChecked)
|
||||
optionsSet.add(getString(R.string.value_password_excludeAmbiguous))
|
||||
return optionsSet
|
||||
}
|
||||
|
||||
private fun setOptions(options: Set<String>) {
|
||||
uppercaseCompound.isChecked = false
|
||||
lowercaseCompound.isChecked = false
|
||||
digitsCompound.isChecked = false
|
||||
minusCompound.isChecked = false
|
||||
underlineCompound.isChecked = false
|
||||
spaceCompound.isChecked = false
|
||||
specialsCompound.isChecked = false
|
||||
bracketsCompound.isChecked = false
|
||||
extendedCompound.isChecked = false
|
||||
atLeastOneCompound.isChecked = false
|
||||
excludeAmbiguousCompound.isChecked = false
|
||||
for (option in options) {
|
||||
when (option) {
|
||||
getString(R.string.value_password_uppercase) -> uppercaseCompound.isChecked = true
|
||||
getString(R.string.value_password_lowercase) -> lowercaseCompound.isChecked = true
|
||||
getString(R.string.value_password_digits) -> digitsCompound.isChecked = true
|
||||
getString(R.string.value_password_minus) -> minusCompound.isChecked = true
|
||||
getString(R.string.value_password_underline) -> underlineCompound.isChecked = true
|
||||
getString(R.string.value_password_space) -> spaceCompound.isChecked = true
|
||||
getString(R.string.value_password_special) -> specialsCompound.isChecked = true
|
||||
getString(R.string.value_password_brackets) -> bracketsCompound.isChecked = true
|
||||
getString(R.string.value_password_extended) -> extendedCompound.isChecked = true
|
||||
getString(R.string.value_password_atLeastOne) -> atLeastOneCompound.isChecked = true
|
||||
getString(R.string.value_password_excludeAmbiguous) -> excludeAmbiguousCompound.isChecked = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getConsiderChars(): String {
|
||||
return considerCharsEditText.text.toString()
|
||||
}
|
||||
|
||||
private fun setConsiderChars(chars: String) {
|
||||
considerCharsEditText.setText(chars)
|
||||
}
|
||||
|
||||
private fun getIgnoreChars(): String {
|
||||
return ignoreCharsEditText.text.toString()
|
||||
}
|
||||
|
||||
private fun setIgnoreChars(chars: String) {
|
||||
ignoreCharsEditText.setText(chars)
|
||||
}
|
||||
|
||||
private fun generatePassword() {
|
||||
var password = ""
|
||||
try {
|
||||
password = PasswordGenerator(resources).generatePassword(getPasswordLength(),
|
||||
uppercaseCompound.isChecked,
|
||||
lowercaseCompound.isChecked,
|
||||
digitsCompound.isChecked,
|
||||
minusCompound.isChecked,
|
||||
underlineCompound.isChecked,
|
||||
spaceCompound.isChecked,
|
||||
specialsCompound.isChecked,
|
||||
bracketsCompound.isChecked,
|
||||
extendedCompound.isChecked,
|
||||
getConsiderChars(),
|
||||
getIgnoreChars(),
|
||||
atLeastOneCompound.isChecked,
|
||||
excludeAmbiguousCompound.isChecked)
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to generate a password", e)
|
||||
}
|
||||
passKeyView.passwordString = password
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
saveSettings()
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
override fun onDatabaseRetrieved(database: Database?) {
|
||||
// Nothing here
|
||||
}
|
||||
|
||||
private fun saveSettings() {
|
||||
context?.let { context ->
|
||||
PreferencesUtil.setDefaultPasswordOptions(context, getOptions())
|
||||
PreferencesUtil.setDefaultPasswordLength(context, getPasswordLength())
|
||||
PreferencesUtil.setDefaultPasswordConsiderChars(context, getConsiderChars())
|
||||
PreferencesUtil.setDefaultPasswordIgnoreChars(context, getIgnoreChars())
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadSettings() {
|
||||
context?.let { context ->
|
||||
setOptions(PreferencesUtil.getDefaultPasswordOptions(context))
|
||||
setPasswordLength(PreferencesUtil.getDefaultPasswordLength(context))
|
||||
setConsiderChars(PreferencesUtil.getDefaultPasswordConsiderChars(context))
|
||||
setIgnoreChars(PreferencesUtil.getDefaultPasswordIgnoreChars(context))
|
||||
}
|
||||
}
|
||||
|
||||
private fun setSliderValue(value: Int) {
|
||||
when {
|
||||
value < minLengthSlider -> {
|
||||
sliderLength.value = minLengthSlider.toFloat()
|
||||
}
|
||||
value > maxLengthSlider -> {
|
||||
sliderLength.value = maxLengthSlider.toFloat()
|
||||
}
|
||||
else -> {
|
||||
sliderLength.value = value.toFloat()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "PasswordGeneratorFrgmt"
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ object EntrySelectionHelper {
|
||||
return intent.getParcelableExtra(KEY_SEARCH_INFO)
|
||||
}
|
||||
|
||||
fun addRegisterInfoInIntent(intent: Intent, registerInfo: RegisterInfo?) {
|
||||
private fun addRegisterInfoInIntent(intent: Intent, registerInfo: RegisterInfo?) {
|
||||
registerInfo?.let {
|
||||
intent.putExtra(KEY_REGISTER_INFO, it)
|
||||
}
|
||||
@@ -113,7 +113,7 @@ object EntrySelectionHelper {
|
||||
?: SpecialMode.DEFAULT
|
||||
}
|
||||
|
||||
fun addTypeModeInIntent(intent: Intent, typeMode: TypeMode) {
|
||||
private fun addTypeModeInIntent(intent: Intent, typeMode: TypeMode) {
|
||||
intent.putExtra(KEY_TYPE_MODE, typeMode as Serializable)
|
||||
}
|
||||
|
||||
|
||||
@@ -24,12 +24,15 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.dialogs.DatabaseDialogFragment
|
||||
import com.kunzisoft.keepass.activities.dialogs.DeleteNodesDialogFragment
|
||||
import com.kunzisoft.keepass.activities.dialogs.PasswordEncodingDialogFragment
|
||||
import com.kunzisoft.keepass.activities.helpers.EntrySelectionHelper
|
||||
@@ -431,7 +434,17 @@ abstract class DatabaseLockActivity : DatabaseModeActivity(),
|
||||
}
|
||||
|
||||
protected fun lockAndExit() {
|
||||
sendBroadcast(Intent(LOCK_ACTION))
|
||||
// Ask confirmation if modification not saved
|
||||
if (mDatabase?.dataModifiedSinceLastLoading == true) {
|
||||
AlertDialog.Builder(this)
|
||||
.setMessage(R.string.discard_changes)
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(R.string.lock) { _, _ ->
|
||||
sendBroadcast(Intent(LOCK_ACTION))
|
||||
}.create().show()
|
||||
} else {
|
||||
sendBroadcast(Intent(LOCK_ACTION))
|
||||
}
|
||||
}
|
||||
|
||||
fun resetAppTimeout() {
|
||||
@@ -467,25 +480,33 @@ abstract class DatabaseLockActivity : DatabaseModeActivity(),
|
||||
*/
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
fun View.resetAppTimeoutWhenViewTouchedOrFocused(context: Context, databaseLoaded: Boolean?) {
|
||||
// Log.d(DatabaseLockActivity.TAG, "View prepared to reset app timeout")
|
||||
setOnTouchListener { _, event ->
|
||||
when (event.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
// Log.d(DatabaseLockActivity.TAG, "View touched, try to reset app timeout")
|
||||
TimeoutHelper.checkTimeAndLockIfTimeoutOrResetTimeout(context,
|
||||
databaseLoaded ?: false)
|
||||
try {
|
||||
// Log.d(DatabaseLockActivity.TAG, "View prepared to reset app timeout")
|
||||
setOnTouchListener { _, event ->
|
||||
when (event.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
// Log.d(DatabaseLockActivity.TAG, "View touched, try to reset app timeout")
|
||||
TimeoutHelper.checkTimeAndLockIfTimeoutOrResetTimeout(
|
||||
context,
|
||||
databaseLoaded ?: false
|
||||
)
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
setOnFocusChangeListener { _, _ ->
|
||||
// Log.d(DatabaseLockActivity.TAG, "View focused, try to reset app timeout")
|
||||
TimeoutHelper.checkTimeAndLockIfTimeoutOrResetTimeout(
|
||||
context,
|
||||
databaseLoaded ?: false
|
||||
)
|
||||
}
|
||||
if (this is ViewGroup) {
|
||||
for (i in 0..childCount) {
|
||||
getChildAt(i)?.resetAppTimeoutWhenViewTouchedOrFocused(context, databaseLoaded)
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
setOnFocusChangeListener { _, _ ->
|
||||
// Log.d(DatabaseLockActivity.TAG, "View focused, try to reset app timeout")
|
||||
TimeoutHelper.checkTimeAndLockIfTimeoutOrResetTimeout(context,
|
||||
databaseLoaded ?: false)
|
||||
}
|
||||
if (this is ViewGroup) {
|
||||
for (i in 0..childCount) {
|
||||
getChildAt(i)?.resetAppTimeoutWhenViewTouchedOrFocused(context, databaseLoaded)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e("AppTimeout", "Unable to reset app timeout", e)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.kunzisoft.keepass.activities.legacy
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import com.kunzisoft.keepass.R
|
||||
@@ -96,10 +94,7 @@ abstract class DatabaseModeActivity : DatabaseActivity() {
|
||||
private fun backToTheMainAppAndFinish() {
|
||||
// To move the app in background and return to the main app
|
||||
moveTaskToBack(true)
|
||||
// To remove this instance in the OS app selector
|
||||
Handler(Looper.getMainLooper()).postDelayed({
|
||||
finish()
|
||||
}, 500)
|
||||
// Not using FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS or finish() because kills the service
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.kunzisoft.keepass.adapters
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import com.kunzisoft.keepass.activities.fragments.PassphraseGeneratorFragment
|
||||
import com.kunzisoft.keepass.activities.fragments.PasswordGeneratorFragment
|
||||
import com.kunzisoft.keepass.activities.fragments.KeyGeneratorFragment
|
||||
|
||||
class KeyGeneratorPagerAdapter(fragment: Fragment)
|
||||
: FragmentStateAdapter(fragment) {
|
||||
|
||||
private val passwordGeneratorFragment = PasswordGeneratorFragment()
|
||||
private val passphraseGeneratorFragment = PassphraseGeneratorFragment()
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return KeyGeneratorFragment.KeyGeneratorTab.values().size
|
||||
}
|
||||
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
return when (KeyGeneratorFragment.KeyGeneratorTab.getKeyGeneratorTabByPosition(position)) {
|
||||
KeyGeneratorFragment.KeyGeneratorTab.PASSWORD -> passwordGeneratorFragment
|
||||
KeyGeneratorFragment.KeyGeneratorTab.PASSPHRASE -> passphraseGeneratorFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -516,7 +516,7 @@ class NodesAdapter (private val context: Context,
|
||||
null -> {}
|
||||
}
|
||||
holder?.otpToken?.apply {
|
||||
text = otpElement?.token
|
||||
text = otpElement?.tokenString
|
||||
setTextSize(mTextSizeUnit, mOtpTokenTextDefaultDimension, mPrefSizeMultiplier)
|
||||
}
|
||||
holder?.otpContainer?.setOnClickListener {
|
||||
|
||||
@@ -26,7 +26,7 @@ import kotlinx.coroutines.*
|
||||
*/
|
||||
class IOActionTask<T>(
|
||||
private val action: () -> T ,
|
||||
private val afterActionDatabaseListener: ((T?) -> Unit)? = null) {
|
||||
private val afterActionListener: ((T?) -> Unit)? = null) {
|
||||
|
||||
private val mainScope = CoroutineScope(Dispatchers.Main)
|
||||
|
||||
@@ -42,7 +42,7 @@ class IOActionTask<T>(
|
||||
}
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
afterActionDatabaseListener?.invoke(asyncResult.await())
|
||||
afterActionListener?.invoke(asyncResult.await())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ class DatabaseTaskProvider {
|
||||
private fun bindService() {
|
||||
initServiceConnection()
|
||||
serviceConnection?.let {
|
||||
context.bindService(intentDatabaseTask, it, BIND_AUTO_CREATE or BIND_NOT_FOREGROUND or BIND_ABOVE_CLIENT)
|
||||
context.bindService(intentDatabaseTask, it, BIND_AUTO_CREATE or BIND_IMPORTANT or BIND_ABOVE_CLIENT)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -913,53 +913,24 @@ class Database {
|
||||
try {
|
||||
val saveUri = databaseCopyUri ?: this.fileUri
|
||||
if (saveUri != null) {
|
||||
if (saveUri.scheme == "file") {
|
||||
saveUri.path?.let { filename ->
|
||||
val tempFile = File("$filename.tmp")
|
||||
|
||||
var fileOutputStream: FileOutputStream? = null
|
||||
try {
|
||||
fileOutputStream = FileOutputStream(tempFile)
|
||||
val pmo = mDatabaseKDB?.let { DatabaseOutputKDB(it, fileOutputStream) }
|
||||
?: mDatabaseKDBX?.let { DatabaseOutputKDBX(it, fileOutputStream) }
|
||||
pmo?.output()
|
||||
} catch (e: Exception) {
|
||||
throw IOException(e)
|
||||
} finally {
|
||||
fileOutputStream?.close()
|
||||
}
|
||||
|
||||
// Force data to disk before continuing
|
||||
try {
|
||||
fileOutputStream?.fd?.sync()
|
||||
} catch (e: SyncFailedException) {
|
||||
// Ignore if fsync fails. We tried.
|
||||
}
|
||||
|
||||
if (!tempFile.renameTo(File(filename))) {
|
||||
throw IOException()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var outputStream: OutputStream? = null
|
||||
try {
|
||||
outputStream = contentResolver.openOutputStream(saveUri, "rwt")
|
||||
outputStream?.let { definedOutputStream ->
|
||||
val databaseOutput =
|
||||
mDatabaseKDB?.let { DatabaseOutputKDB(it, definedOutputStream) }
|
||||
?: mDatabaseKDBX?.let {
|
||||
DatabaseOutputKDBX(
|
||||
it,
|
||||
definedOutputStream
|
||||
)
|
||||
}
|
||||
databaseOutput?.output()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
throw IOException(e)
|
||||
} finally {
|
||||
outputStream?.close()
|
||||
var outputStream: OutputStream? = null
|
||||
try {
|
||||
outputStream = UriUtil.getUriOutputStream(contentResolver, saveUri)
|
||||
outputStream?.let { definedOutputStream ->
|
||||
val databaseOutput =
|
||||
mDatabaseKDB?.let { DatabaseOutputKDB(it, definedOutputStream) }
|
||||
?: mDatabaseKDBX?.let {
|
||||
DatabaseOutputKDBX(
|
||||
it,
|
||||
definedOutputStream
|
||||
)
|
||||
}
|
||||
databaseOutput?.output()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
throw IOException(e)
|
||||
} finally {
|
||||
outputStream?.close()
|
||||
}
|
||||
if (databaseCopyUri == null) {
|
||||
this.dataModifiedSinceLastLoading = false
|
||||
|
||||
@@ -60,6 +60,11 @@ object TemplateField {
|
||||
const val LABEL_SECURE_NOTE = "Secure Note"
|
||||
const val LABEL_MEMBERSHIP = "Membership"
|
||||
|
||||
fun isStandardPasswordName(context: Context, name: String): Boolean {
|
||||
return name.equals(LABEL_PASSWORD, true)
|
||||
|| name == getLocalizedName(context, LABEL_PASSWORD)
|
||||
}
|
||||
|
||||
fun isStandardFieldName(name: String): Boolean {
|
||||
return arrayOf(
|
||||
LABEL_TITLE,
|
||||
|
||||
@@ -148,9 +148,9 @@ class SearchHelper {
|
||||
onDatabaseClosed.invoke()
|
||||
} else if (TimeoutHelper.checkTime(context)) {
|
||||
var searchWithoutUI = false
|
||||
if (PreferencesUtil.isAutofillAutoSearchEnable(context)
|
||||
&& searchInfo != null && !searchInfo.manualSelection
|
||||
&& !searchInfo.containsOnlyNullValues()) {
|
||||
if (searchInfo != null
|
||||
&& !searchInfo.manualSelection
|
||||
&& !searchInfo.containsOnlyNullValues()) {
|
||||
// If search provide results
|
||||
database.createVirtualGroupFromSearchInfo(
|
||||
searchInfo.toString(),
|
||||
@@ -181,7 +181,7 @@ class SearchHelper {
|
||||
return false
|
||||
|
||||
// Exclude entry expired
|
||||
if (searchParameters.excludeExpired) {
|
||||
if (!searchParameters.searchInExpired) {
|
||||
if (entry.isCurrentlyExpires)
|
||||
return false
|
||||
}
|
||||
@@ -237,14 +237,20 @@ class SearchHelper {
|
||||
return false
|
||||
return if (searchParameters.isRegex) {
|
||||
val regex = if (searchParameters.caseSensitive) {
|
||||
searchParameters.searchQuery.toRegex(RegexOption.DOT_MATCHES_ALL)
|
||||
searchParameters.searchQuery
|
||||
.toRegex(RegexOption.DOT_MATCHES_ALL)
|
||||
} else {
|
||||
searchParameters.searchQuery
|
||||
.toRegex(setOf(RegexOption.DOT_MATCHES_ALL, RegexOption.IGNORE_CASE))
|
||||
}
|
||||
regex.matches(stringToCheck)
|
||||
} else {
|
||||
stringToCheck.contains(searchParameters.searchQuery, !searchParameters.caseSensitive)
|
||||
var searchFound = true
|
||||
searchParameters.searchQuery.split(" ").forEach { word ->
|
||||
searchFound = searchFound
|
||||
&& stringToCheck.contains(word, !searchParameters.caseSensitive)
|
||||
}
|
||||
searchFound
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class SearchParameters() : Parcelable{
|
||||
var searchInUsernames = true
|
||||
var searchInPasswords = false
|
||||
var searchInUrls = true
|
||||
var excludeExpired = false
|
||||
var searchInExpired = false
|
||||
var searchInNotes = true
|
||||
var searchInOTP = false
|
||||
var searchInOther = true
|
||||
@@ -49,11 +49,12 @@ class SearchParameters() : Parcelable{
|
||||
constructor(parcel: Parcel) : this() {
|
||||
searchQuery = parcel.readString() ?: searchQuery
|
||||
caseSensitive = parcel.readByte() != 0.toByte()
|
||||
isRegex = parcel.readByte() != 0.toByte()
|
||||
searchInTitles = parcel.readByte() != 0.toByte()
|
||||
searchInUsernames = parcel.readByte() != 0.toByte()
|
||||
searchInPasswords = parcel.readByte() != 0.toByte()
|
||||
searchInUrls = parcel.readByte() != 0.toByte()
|
||||
excludeExpired = parcel.readByte() != 0.toByte()
|
||||
searchInExpired = parcel.readByte() != 0.toByte()
|
||||
searchInNotes = parcel.readByte() != 0.toByte()
|
||||
searchInOTP = parcel.readByte() != 0.toByte()
|
||||
searchInOther = parcel.readByte() != 0.toByte()
|
||||
@@ -68,11 +69,12 @@ class SearchParameters() : Parcelable{
|
||||
override fun writeToParcel(parcel: Parcel, flags: Int) {
|
||||
parcel.writeString(searchQuery)
|
||||
parcel.writeByte(if (caseSensitive) 1 else 0)
|
||||
parcel.writeByte(if (isRegex) 1 else 0)
|
||||
parcel.writeByte(if (searchInTitles) 1 else 0)
|
||||
parcel.writeByte(if (searchInUsernames) 1 else 0)
|
||||
parcel.writeByte(if (searchInPasswords) 1 else 0)
|
||||
parcel.writeByte(if (searchInUrls) 1 else 0)
|
||||
parcel.writeByte(if (excludeExpired) 1 else 0)
|
||||
parcel.writeByte(if (searchInExpired) 1 else 0)
|
||||
parcel.writeByte(if (searchInNotes) 1 else 0)
|
||||
parcel.writeByte(if (searchInOTP) 1 else 0)
|
||||
parcel.writeByte(if (searchInOther) 1 else 0)
|
||||
|
||||
@@ -18,6 +18,8 @@ package com.kunzisoft.keepass.magikeyboard;
|
||||
|
||||
import static com.kunzisoft.keepass.magikeyboard.MagikeyboardService.KEY_BACK_KEYBOARD;
|
||||
import static com.kunzisoft.keepass.magikeyboard.MagikeyboardService.KEY_CHANGE_KEYBOARD;
|
||||
import static com.kunzisoft.keepass.magikeyboard.MagikeyboardService.KEY_ENTRY;
|
||||
import static com.kunzisoft.keepass.magikeyboard.MagikeyboardService.KEY_ENTRY_ALT;
|
||||
import static com.kunzisoft.keepass.magikeyboard.MagikeyboardService.KEY_OTP;
|
||||
import static com.kunzisoft.keepass.magikeyboard.MagikeyboardService.KEY_OTP_ALT;
|
||||
|
||||
@@ -1049,6 +1051,9 @@ public class KeyboardView extends View implements View.OnClickListener {
|
||||
if (popupKey.codes[0] == KEY_BACK_KEYBOARD) {
|
||||
mKeyboardActionListener.onKey(KEY_CHANGE_KEYBOARD, popupKey.codes);
|
||||
return true;
|
||||
} else if (popupKey.codes[0] == KEY_ENTRY) {
|
||||
mKeyboardActionListener.onKey(KEY_ENTRY_ALT, popupKey.codes);
|
||||
return true;
|
||||
} else if (popupKey.codes[0] == KEY_OTP) {
|
||||
mKeyboardActionListener.onKey(KEY_OTP_ALT, popupKey.codes);
|
||||
return true;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
package com.kunzisoft.keepass.magikeyboard
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.inputmethodservice.InputMethodService
|
||||
@@ -30,19 +31,30 @@ import android.view.*
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.PopupWindow
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.graphics.BlendModeColorFilterCompat
|
||||
import androidx.core.graphics.BlendModeCompat
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.MagikeyboardLauncherActivity
|
||||
import com.kunzisoft.keepass.activities.EntrySelectionLauncherActivity
|
||||
import com.kunzisoft.keepass.activities.helpers.EntrySelectionHelper
|
||||
import com.kunzisoft.keepass.adapters.FieldsAdapter
|
||||
import com.kunzisoft.keepass.database.action.DatabaseTaskProvider
|
||||
import com.kunzisoft.keepass.database.element.Database
|
||||
import com.kunzisoft.keepass.database.element.Field
|
||||
import com.kunzisoft.keepass.database.element.node.NodeIdUUID
|
||||
import com.kunzisoft.keepass.database.search.SearchHelper
|
||||
import com.kunzisoft.keepass.model.EntryInfo
|
||||
import com.kunzisoft.keepass.model.SearchInfo
|
||||
import com.kunzisoft.keepass.otp.OtpEntryFields.OTP_TOKEN_FIELD
|
||||
import com.kunzisoft.keepass.services.KeyboardEntryNotificationService
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
import com.kunzisoft.keepass.utils.*
|
||||
import java.util.*
|
||||
|
||||
class MagikeyboardService : InputMethodService(), KeyboardView.OnKeyboardActionListener {
|
||||
|
||||
@@ -50,13 +62,19 @@ class MagikeyboardService : InputMethodService(), KeyboardView.OnKeyboardActionL
|
||||
private var mDatabase: Database? = null
|
||||
|
||||
private var keyboardView: KeyboardView? = null
|
||||
private var entryContainer: View? = null
|
||||
private var entryText: TextView? = null
|
||||
private var databaseText: TextView? = null
|
||||
private var databaseColorView: ImageView? = null
|
||||
private var packageText: TextView? = null
|
||||
private var keyboard: Keyboard? = null
|
||||
private var keyboardEntry: Keyboard? = null
|
||||
private var popupCustomKeys: PopupWindow? = null
|
||||
private var fieldsAdapter: FieldsAdapter? = null
|
||||
private var playSoundDuringCLick: Boolean = false
|
||||
|
||||
private var mFormPackageName: String? = null
|
||||
|
||||
private var lockReceiver: LockReceiver? = null
|
||||
|
||||
override fun onCreate() {
|
||||
@@ -66,6 +84,7 @@ class MagikeyboardService : InputMethodService(), KeyboardView.OnKeyboardActionL
|
||||
mDatabaseTaskProvider?.registerProgressTask()
|
||||
mDatabaseTaskProvider?.onDatabaseRetrieved = { database ->
|
||||
this.mDatabase = database
|
||||
assignKeyboardView()
|
||||
}
|
||||
// Remove the entry and lock the keyboard when the lock signal is receive
|
||||
lockReceiver = LockReceiver {
|
||||
@@ -76,13 +95,25 @@ class MagikeyboardService : InputMethodService(), KeyboardView.OnKeyboardActionL
|
||||
switchToPreviousKeyboard()
|
||||
}
|
||||
|
||||
fieldsAdapter = FieldsAdapter(this)
|
||||
fieldsAdapter?.onItemClickListener = object : FieldsAdapter.OnItemClickListener {
|
||||
override fun onItemClick(item: Field) {
|
||||
currentInputConnection.commitText(getEntryInfo()?.getGeneratedFieldValue(item.name) , 1)
|
||||
actionTabAutomatically()
|
||||
}
|
||||
}
|
||||
|
||||
registerLockReceiver(lockReceiver, true)
|
||||
}
|
||||
|
||||
override fun onCreateInputView(): View {
|
||||
|
||||
val rootKeyboardView = layoutInflater.inflate(R.layout.keyboard_container, null)
|
||||
entryContainer = rootKeyboardView.findViewById(R.id.magikeyboard_entry_container)
|
||||
entryText = rootKeyboardView.findViewById(R.id.magikeyboard_entry_text)
|
||||
databaseText = rootKeyboardView.findViewById(R.id.magikeyboard_database_text)
|
||||
databaseColorView = rootKeyboardView.findViewById(R.id.magikeyboard_database_color)
|
||||
packageText = rootKeyboardView.findViewById(R.id.magikeyboard_package_text)
|
||||
keyboardView = rootKeyboardView.findViewById(R.id.magikeyboard_view)
|
||||
|
||||
if (keyboardView != null) {
|
||||
@@ -94,57 +125,49 @@ class MagikeyboardService : InputMethodService(), KeyboardView.OnKeyboardActionL
|
||||
.inflate(R.layout.keyboard_popup_fields, FrameLayout(context))
|
||||
|
||||
popupCustomKeys = PopupWindow(context).apply {
|
||||
width = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
inputMethodMode = PopupWindow.INPUT_METHOD_NEEDED
|
||||
contentView = popupFieldsView
|
||||
}
|
||||
|
||||
val recyclerView = popupFieldsView.findViewById<androidx.recyclerview.widget.RecyclerView>(R.id.keyboard_popup_fields_list)
|
||||
fieldsAdapter = FieldsAdapter(this)
|
||||
fieldsAdapter?.onItemClickListener = object : FieldsAdapter.OnItemClickListener {
|
||||
override fun onItemClick(item: Field) {
|
||||
currentInputConnection.commitText(entryInfoKey?.getGeneratedFieldValue(item.name) , 1)
|
||||
actionTabAutomatically()
|
||||
}
|
||||
}
|
||||
recyclerView.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(this, androidx.recyclerview.widget.LinearLayoutManager.HORIZONTAL, true)
|
||||
val recyclerView = popupFieldsView.findViewById<RecyclerView>(R.id.keyboard_popup_fields_list)
|
||||
recyclerView.layoutManager = LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, true)
|
||||
recyclerView.adapter = fieldsAdapter
|
||||
|
||||
val closeView = popupFieldsView.findViewById<View>(R.id.keyboard_popup_close)
|
||||
closeView.setOnClickListener { popupCustomKeys?.dismiss() }
|
||||
|
||||
// Remove entry info if the database is not loaded
|
||||
// or if entry info timestamp is before database loaded timestamp
|
||||
val databaseTime = mDatabase?.loadTimestamp
|
||||
val entryTime = entryInfoTimestamp
|
||||
if (mDatabase == null
|
||||
|| mDatabase?.loaded != true
|
||||
|| databaseTime == null
|
||||
|| entryTime == null
|
||||
|| entryTime < databaseTime) {
|
||||
removeEntryInfo()
|
||||
}
|
||||
assignKeyboardView()
|
||||
keyboardView?.onKeyboardActionListener = this
|
||||
|
||||
return rootKeyboardView
|
||||
}
|
||||
|
||||
return super.onCreateInputView()
|
||||
return rootKeyboardView
|
||||
}
|
||||
|
||||
private fun getEntryInfo(): EntryInfo? {
|
||||
var entryInfoRetrieved: EntryInfo? = null
|
||||
entryUUID?.let { entryId ->
|
||||
entryInfoRetrieved = mDatabase
|
||||
?.getEntryById(NodeIdUUID(entryId))
|
||||
?.getEntryInfo(mDatabase)
|
||||
}
|
||||
return entryInfoRetrieved
|
||||
}
|
||||
|
||||
private fun assignKeyboardView() {
|
||||
dismissCustomKeys()
|
||||
if (keyboardView != null) {
|
||||
if (entryInfoKey != null) {
|
||||
val entryInfo = getEntryInfo()
|
||||
populateEntryInfoInView(entryInfo)
|
||||
if (entryInfo != null) {
|
||||
if (keyboardEntry != null) {
|
||||
populateEntryInfoInView()
|
||||
keyboardView?.keyboard = keyboardEntry
|
||||
}
|
||||
} else {
|
||||
if (keyboard != null) {
|
||||
hideEntryInfo()
|
||||
keyboardView?.keyboard = keyboard
|
||||
}
|
||||
}
|
||||
@@ -153,23 +176,45 @@ class MagikeyboardService : InputMethodService(), KeyboardView.OnKeyboardActionL
|
||||
keyboardView?.isHapticFeedbackEnabled = PreferencesUtil.isKeyboardVibrationEnable(this)
|
||||
playSoundDuringCLick = PreferencesUtil.isKeyboardSoundEnable(this)
|
||||
}
|
||||
setDatabaseViews()
|
||||
}
|
||||
|
||||
private fun populateEntryInfoInView() {
|
||||
entryText?.visibility = View.VISIBLE
|
||||
if (entryInfoKey?.title?.isNotEmpty() == true) {
|
||||
entryText?.text = entryInfoKey?.title
|
||||
private fun setDatabaseViews() {
|
||||
if (mDatabase == null || mDatabase?.loaded != true) {
|
||||
entryContainer?.visibility = View.GONE
|
||||
} else {
|
||||
hideEntryInfo()
|
||||
entryContainer?.visibility = View.VISIBLE
|
||||
}
|
||||
databaseText?.text = mDatabase?.name ?: ""
|
||||
val databaseColor = mDatabase?.customColor
|
||||
if (databaseColor != null) {
|
||||
databaseColorView?.drawable?.colorFilter = BlendModeColorFilterCompat
|
||||
.createBlendModeColorFilterCompat(databaseColor, BlendModeCompat.SRC_IN)
|
||||
databaseColorView?.visibility = View.VISIBLE
|
||||
} else {
|
||||
databaseColorView?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
private fun hideEntryInfo() {
|
||||
entryText?.visibility = View.GONE
|
||||
private fun populateEntryInfoInView(entryInfo: EntryInfo?) {
|
||||
if (entryInfo == null) {
|
||||
entryText?.text = ""
|
||||
entryText?.visibility = View.GONE
|
||||
} else {
|
||||
entryText?.text = entryInfo.getVisualTitle()
|
||||
entryText?.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStartInputView(info: EditorInfo, restarting: Boolean) {
|
||||
super.onStartInputView(info, restarting)
|
||||
mFormPackageName = info.packageName
|
||||
if (!mFormPackageName.isNullOrEmpty()) {
|
||||
packageText?.text = mFormPackageName
|
||||
packageText?.visibility = View.VISIBLE
|
||||
} else {
|
||||
packageText?.visibility = View.GONE
|
||||
}
|
||||
assignKeyboardView()
|
||||
}
|
||||
|
||||
@@ -228,16 +273,17 @@ class MagikeyboardService : InputMethodService(), KeyboardView.OnKeyboardActionL
|
||||
(getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager?)
|
||||
?.showInputMethodPicker()
|
||||
}
|
||||
KEY_UNLOCK -> {
|
||||
}
|
||||
KEY_ENTRY -> {
|
||||
// Stop current service and reinit entry
|
||||
stopService(Intent(this, KeyboardEntryNotificationService::class.java))
|
||||
removeEntryInfo()
|
||||
val intent = Intent(this, MagikeyboardLauncherActivity::class.java)
|
||||
// New task needed because don't launch from an Activity context
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||
startActivity(intent)
|
||||
var searchInfo: SearchInfo? = null
|
||||
if (mFormPackageName != null) {
|
||||
searchInfo = SearchInfo().apply {
|
||||
applicationId = mFormPackageName
|
||||
}
|
||||
}
|
||||
actionKeyEntry(searchInfo)
|
||||
}
|
||||
KEY_ENTRY_ALT -> {
|
||||
actionKeyEntry()
|
||||
}
|
||||
KEY_LOCK -> {
|
||||
removeEntryInfo()
|
||||
@@ -245,12 +291,13 @@ class MagikeyboardService : InputMethodService(), KeyboardView.OnKeyboardActionL
|
||||
dismissCustomKeys()
|
||||
}
|
||||
KEY_USERNAME -> {
|
||||
entryInfoKey?.username?.let { username ->
|
||||
getEntryInfo()?.username?.let { username ->
|
||||
currentInputConnection.commitText(username, 1)
|
||||
}
|
||||
actionTabAutomatically()
|
||||
}
|
||||
KEY_PASSWORD -> {
|
||||
val entryInfoKey = getEntryInfo()
|
||||
entryInfoKey?.password?.let { password ->
|
||||
currentInputConnection.commitText(password, 1)
|
||||
}
|
||||
@@ -258,14 +305,14 @@ class MagikeyboardService : InputMethodService(), KeyboardView.OnKeyboardActionL
|
||||
actionGoAutomatically(!otpFieldExists)
|
||||
}
|
||||
KEY_OTP -> {
|
||||
entryInfoKey?.let { entryInfo ->
|
||||
getEntryInfo()?.let { entryInfo ->
|
||||
currentInputConnection.commitText(
|
||||
entryInfo.getGeneratedFieldValue(OTP_TOKEN_FIELD), 1)
|
||||
}
|
||||
actionGoAutomatically()
|
||||
}
|
||||
KEY_OTP_ALT -> {
|
||||
entryInfoKey?.let { entryInfo ->
|
||||
getEntryInfo()?.let { entryInfo ->
|
||||
val otpToken = entryInfo.getGeneratedFieldValue(OTP_TOKEN_FIELD)
|
||||
if (otpToken.isNotEmpty()) {
|
||||
// Cut to fill each digit separatelyKeyEvent.KEYCODE_TAB
|
||||
@@ -282,19 +329,20 @@ class MagikeyboardService : InputMethodService(), KeyboardView.OnKeyboardActionL
|
||||
actionGoAutomatically()
|
||||
}
|
||||
KEY_URL -> {
|
||||
entryInfoKey?.url?.let { url ->
|
||||
getEntryInfo()?.url?.let { url ->
|
||||
currentInputConnection.commitText(url, 1)
|
||||
}
|
||||
actionGoAutomatically()
|
||||
}
|
||||
KEY_FIELDS -> {
|
||||
entryInfoKey?.customFields?.let { customFields ->
|
||||
getEntryInfo()?.customFields?.let { customFields ->
|
||||
fieldsAdapter?.apply {
|
||||
setFields(customFields.filter { it.name != OTP_TOKEN_FIELD})
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
popupCustomKeys?.showAtLocation(keyboardView, Gravity.END or Gravity.TOP, 0, 0)
|
||||
popupCustomKeys?.showAtLocation(keyboardView,
|
||||
Gravity.END or Gravity.TOP, 0, 180)
|
||||
}
|
||||
Keyboard.KEYCODE_DELETE -> {
|
||||
inputConnection.sendKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL))
|
||||
@@ -303,6 +351,43 @@ class MagikeyboardService : InputMethodService(), KeyboardView.OnKeyboardActionL
|
||||
}
|
||||
}
|
||||
|
||||
private fun actionKeyEntry(searchInfo: SearchInfo? = null) {
|
||||
SearchHelper.checkAutoSearchInfo(this,
|
||||
mDatabase,
|
||||
searchInfo,
|
||||
{ _, items ->
|
||||
performSelection(
|
||||
items,
|
||||
{
|
||||
// Automatically populate keyboard
|
||||
addEntryAndLaunchNotificationIfAllowed(
|
||||
this,
|
||||
items[0],
|
||||
true
|
||||
)
|
||||
assignKeyboardView()
|
||||
},
|
||||
{
|
||||
launchEntrySelection(searchInfo)
|
||||
}
|
||||
)
|
||||
},
|
||||
{
|
||||
// Select if not found
|
||||
launchEntrySelection(searchInfo)
|
||||
},
|
||||
{
|
||||
// Select if database not opened
|
||||
removeEntryInfo()
|
||||
launchEntrySelection(searchInfo)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun launchEntrySelection(searchInfo: SearchInfo?) {
|
||||
EntrySelectionLauncherActivity.launch(this, searchInfo)
|
||||
}
|
||||
|
||||
private fun actionTabAutomatically() {
|
||||
if (PreferencesUtil.isAutoGoActionEnable(this))
|
||||
currentInputConnection.sendKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_TAB))
|
||||
@@ -359,23 +444,20 @@ class MagikeyboardService : InputMethodService(), KeyboardView.OnKeyboardActionL
|
||||
|
||||
const val KEY_BACK_KEYBOARD = 600
|
||||
const val KEY_CHANGE_KEYBOARD = 601
|
||||
private const val KEY_UNLOCK = 610
|
||||
private const val KEY_LOCK = 611
|
||||
private const val KEY_ENTRY = 620
|
||||
private const val KEY_USERNAME = 500
|
||||
private const val KEY_PASSWORD = 510
|
||||
const val KEY_LOCK = 611
|
||||
const val KEY_ENTRY = 620
|
||||
const val KEY_ENTRY_ALT = 621
|
||||
const val KEY_USERNAME = 500
|
||||
const val KEY_PASSWORD = 510
|
||||
const val KEY_OTP = 515
|
||||
const val KEY_OTP_ALT = 516
|
||||
private const val KEY_URL = 520
|
||||
private const val KEY_FIELDS = 530
|
||||
const val KEY_URL = 520
|
||||
const val KEY_FIELDS = 530
|
||||
|
||||
// TODO Retrieve entry info from id and service when database is open
|
||||
private var entryInfoKey: EntryInfo? = null
|
||||
private var entryInfoTimestamp: Long? = null
|
||||
private var entryUUID: UUID? = null
|
||||
|
||||
private fun removeEntryInfo() {
|
||||
entryInfoKey = null
|
||||
entryInfoTimestamp = null
|
||||
entryUUID = null
|
||||
}
|
||||
|
||||
fun removeEntry(context: Context) {
|
||||
@@ -384,10 +466,47 @@ class MagikeyboardService : InputMethodService(), KeyboardView.OnKeyboardActionL
|
||||
|
||||
fun addEntryAndLaunchNotificationIfAllowed(context: Context, entry: EntryInfo, toast: Boolean = false) {
|
||||
// Add a new entry
|
||||
entryInfoKey = entry
|
||||
entryInfoTimestamp = System.currentTimeMillis()
|
||||
entryUUID = entry.id
|
||||
// Launch notification if allowed
|
||||
KeyboardEntryNotificationService.launchNotificationIfAllowed(context, entry, toast)
|
||||
}
|
||||
|
||||
fun activatedInSettings(context: Context): Boolean {
|
||||
return ContextCompat.getSystemService(context, InputMethodManager::class.java)
|
||||
?.enabledInputMethodList
|
||||
?.any {
|
||||
it.packageName == context.packageName
|
||||
} ?: false
|
||||
}
|
||||
|
||||
fun performSelection(items: List<EntryInfo>,
|
||||
actionPopulateKeyboard: (entryInfo: EntryInfo) -> Unit,
|
||||
actionEntrySelection: (autoSearch: Boolean) -> Unit) {
|
||||
if (items.size == 1) {
|
||||
val itemFound = items[0]
|
||||
if (entryUUID != itemFound.id) {
|
||||
actionPopulateKeyboard.invoke(itemFound)
|
||||
} else {
|
||||
// Force selection if magikeyboard already populated
|
||||
actionEntrySelection.invoke(false)
|
||||
}
|
||||
} else if (items.size > 1) {
|
||||
// Select the one we want in the selection
|
||||
actionEntrySelection.invoke(true)
|
||||
} else {
|
||||
// Select an arbitrary one
|
||||
actionEntrySelection.invoke(false)
|
||||
}
|
||||
}
|
||||
|
||||
fun populateKeyboardAndMoveAppToBackground(activity: Activity,
|
||||
entry: EntryInfo,
|
||||
toast: Boolean = true) {
|
||||
// Populate Magikeyboard with entry
|
||||
addEntryAndLaunchNotificationIfAllowed(activity, entry, toast)
|
||||
// Consume the selection mode
|
||||
EntrySelectionHelper.removeModesFromIntent(activity.intent)
|
||||
activity.moveTaskToBack(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -225,6 +225,14 @@ class EntryInfo : NodeInfo {
|
||||
}
|
||||
}
|
||||
|
||||
fun getVisualTitle(): String {
|
||||
return title.ifEmpty {
|
||||
url.ifEmpty {
|
||||
username.ifEmpty { id.toString() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (other !is EntryInfo) return false
|
||||
|
||||
@@ -178,6 +178,14 @@ data class OtpElement(var otpModel: OtpModel = OtpModel()) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Token with space each 3 digits
|
||||
*/
|
||||
val tokenString: String
|
||||
get() {
|
||||
return token.replace("...".toRegex(), "$0 ")
|
||||
}
|
||||
|
||||
val secondsRemaining: Int
|
||||
get() = otpModel.period - (System.currentTimeMillis() / 1000 % otpModel.period).toInt()
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright 2019 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePassDX.
|
||||
*
|
||||
* KeePassDX is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePassDX is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.password
|
||||
|
||||
import me.gosimple.nbvcxz.resources.Generator
|
||||
|
||||
class PassphraseGenerator {
|
||||
|
||||
@Throws(IllegalArgumentException::class)
|
||||
fun generatePassphrase(wordCount: Int,
|
||||
wordSeparator: String,
|
||||
wordCase: WordCase): String {
|
||||
// From eff_large dictionary
|
||||
return when (wordCase) {
|
||||
WordCase.LOWER_CASE -> {
|
||||
Generator.generatePassphrase(wordSeparator, wordCount)
|
||||
}
|
||||
WordCase.UPPER_CASE -> {
|
||||
applyWordCase(wordCount, wordSeparator) { word ->
|
||||
word.uppercase()
|
||||
}
|
||||
}
|
||||
WordCase.TITLE_CASE -> {
|
||||
applyWordCase(wordCount, wordSeparator) { word ->
|
||||
word.replaceFirstChar { char -> char.uppercaseChar() }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun applyWordCase(wordCount: Int,
|
||||
wordSeparator: String,
|
||||
wordAction: (word: String) -> String): String {
|
||||
val splitWords = Generator.generatePassphrase(TEMP_SPLIT, wordCount).split(TEMP_SPLIT)
|
||||
val stringBuilder = StringBuilder()
|
||||
splitWords.forEach {
|
||||
stringBuilder
|
||||
.append(wordAction(it))
|
||||
.append(wordSeparator)
|
||||
}
|
||||
return stringBuilder.toString().removeSuffix(wordSeparator)
|
||||
}
|
||||
|
||||
enum class WordCase {
|
||||
LOWER_CASE,
|
||||
UPPER_CASE,
|
||||
TITLE_CASE;
|
||||
|
||||
companion object {
|
||||
fun getByOrdinal(position: Int): WordCase {
|
||||
return when (position) {
|
||||
0 -> LOWER_CASE
|
||||
1 -> UPPER_CASE
|
||||
else -> TITLE_CASE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TEMP_SPLIT = "-"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* Copyright 2022 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePassDX.
|
||||
*
|
||||
* KeePassDX is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePassDX is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.password
|
||||
|
||||
import android.content.res.Resources
|
||||
import android.graphics.Color
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.app.database.IOActionTask
|
||||
import kotlinx.coroutines.*
|
||||
import me.gosimple.nbvcxz.Nbvcxz
|
||||
import me.gosimple.nbvcxz.resources.Configuration
|
||||
import me.gosimple.nbvcxz.resources.ConfigurationBuilder
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
class PasswordEntropy(actionOnInitFinished: (() -> Unit)? = null) {
|
||||
|
||||
private var mPasswordEntropyCalculator: Nbvcxz? = null
|
||||
private var entropyJob: Job? = null
|
||||
|
||||
init {
|
||||
IOActionTask({
|
||||
// Create the password generator object
|
||||
val configuration: Configuration = ConfigurationBuilder()
|
||||
.setLocale(Locale.getDefault())
|
||||
.setMinimumEntropy(80.0)
|
||||
.createConfiguration()
|
||||
mPasswordEntropyCalculator = Nbvcxz(configuration)
|
||||
}, {
|
||||
actionOnInitFinished?.invoke()
|
||||
}).execute()
|
||||
}
|
||||
|
||||
enum class Strength(val color: Int) {
|
||||
RISKY(Color.rgb(224, 56, 56)),
|
||||
VERY_GUESSABLE(Color.rgb(196, 63, 49)),
|
||||
SOMEWHAT_GUESSABLE(Color.rgb(219, 152, 55)),
|
||||
SAFELY_UNGUESSABLE(Color.rgb(118, 168, 24)),
|
||||
VERY_UNGUESSABLE(Color.rgb(37, 152, 41))
|
||||
}
|
||||
|
||||
data class EntropyStrength(val strength: Strength,
|
||||
val entropy: Double,
|
||||
val estimationPercent: Int) {
|
||||
override fun toString(): String {
|
||||
return "EntropyStrength(strength=$strength, entropy=$entropy, estimationPercent=$estimationPercent)"
|
||||
}
|
||||
}
|
||||
|
||||
fun getEntropyStrength(passwordString: String,
|
||||
entropyStrengthResult: (EntropyStrength) -> Unit) {
|
||||
|
||||
entropyStrengthResult.invoke(EntropyStrength(Strength.RISKY, CALCULATE_ENTROPY, 0))
|
||||
entropyJob?.cancel()
|
||||
entropyJob = CoroutineScope(Dispatchers.Main).launch {
|
||||
withContext(Dispatchers.IO) {
|
||||
val asyncResult: Deferred<EntropyStrength?> = async {
|
||||
try {
|
||||
if (passwordString.length <= MAX_PASSWORD_LENGTH) {
|
||||
val estimate = mPasswordEntropyCalculator?.estimate(passwordString)
|
||||
val basicScore = estimate?.basicScore ?: 0
|
||||
val entropy = estimate?.entropy ?: 0.0
|
||||
val percentScore = min(entropy * 100 / 200, 100.0).toInt()
|
||||
val strength =
|
||||
if (basicScore == 0 || percentScore < 10) {
|
||||
Strength.RISKY
|
||||
} else if (basicScore == 1 || percentScore < 20) {
|
||||
Strength.VERY_GUESSABLE
|
||||
} else if (basicScore == 2 || percentScore < 33) {
|
||||
Strength.SOMEWHAT_GUESSABLE
|
||||
} else if (basicScore == 3 || percentScore < 50) {
|
||||
Strength.SAFELY_UNGUESSABLE
|
||||
} else if (basicScore == 4) {
|
||||
Strength.VERY_UNGUESSABLE
|
||||
} else {
|
||||
Strength.RISKY
|
||||
}
|
||||
EntropyStrength(strength, entropy, percentScore)
|
||||
} else {
|
||||
EntropyStrength(Strength.VERY_UNGUESSABLE, HIGH_ENTROPY, 100)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
null
|
||||
}
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
asyncResult.await()?.let { entropyStrength ->
|
||||
entropyStrengthResult.invoke(entropyStrength)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val MAX_PASSWORD_LENGTH = 128
|
||||
private const val CALCULATE_ENTROPY = -1.0
|
||||
private const val HIGH_ENTROPY = 1000.0
|
||||
|
||||
fun getStringEntropy(resources: Resources, entropy: Double): String {
|
||||
return when (entropy) {
|
||||
CALCULATE_ENTROPY -> {
|
||||
resources.getString(R.string.entropy_calculate)
|
||||
}
|
||||
HIGH_ENTROPY -> {
|
||||
resources.getString(R.string.entropy_high)
|
||||
}
|
||||
else -> {
|
||||
resources.getString(
|
||||
R.string.entropy,
|
||||
"%.${2}f".format(entropy)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,33 +20,17 @@
|
||||
package com.kunzisoft.keepass.password
|
||||
|
||||
import android.content.res.Resources
|
||||
import android.graphics.Color
|
||||
import android.text.Spannable
|
||||
import android.text.SpannableString
|
||||
import android.text.SpannableStringBuilder
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import com.kunzisoft.keepass.R
|
||||
import java.security.SecureRandom
|
||||
import java.util.*
|
||||
|
||||
class PasswordGenerator(private val resources: Resources) {
|
||||
|
||||
// From KeePassXC code https://github.com/keepassxreboot/keepassxc/pull/538
|
||||
private fun extendedChars(): String {
|
||||
val charSet = StringBuilder()
|
||||
// [U+0080, U+009F] are C1 control characters,
|
||||
// U+00A0 is non-breaking space
|
||||
run {
|
||||
var ch = '\u00A1'
|
||||
while (ch <= '\u00AC') {
|
||||
charSet.append(ch)
|
||||
++ch
|
||||
}
|
||||
}
|
||||
// U+00AD is soft hyphen (format character)
|
||||
var ch = '\u00AE'
|
||||
while (ch < '\u00FF') {
|
||||
charSet.append(ch)
|
||||
++ch
|
||||
}
|
||||
charSet.append('\u00FF')
|
||||
return charSet.toString()
|
||||
}
|
||||
|
||||
@Throws(IllegalArgumentException::class)
|
||||
fun generatePassword(length: Int,
|
||||
upperCase: Boolean,
|
||||
@@ -57,7 +41,11 @@ class PasswordGenerator(private val resources: Resources) {
|
||||
space: Boolean,
|
||||
specials: Boolean,
|
||||
brackets: Boolean,
|
||||
extended: Boolean): String {
|
||||
extended: Boolean,
|
||||
considerChars: String,
|
||||
ignoreChars: String,
|
||||
atLeastOneFromEach: Boolean,
|
||||
excludeAmbiguousChar: Boolean): String {
|
||||
// Desired password length is 0 or less
|
||||
if (length <= 0) {
|
||||
throw IllegalArgumentException(resources.getString(R.string.error_wrong_length))
|
||||
@@ -72,74 +60,164 @@ class PasswordGenerator(private val resources: Resources) {
|
||||
&& !space
|
||||
&& !specials
|
||||
&& !brackets
|
||||
&& !extended) {
|
||||
&& !extended
|
||||
&& considerChars.isEmpty()) {
|
||||
throw IllegalArgumentException(resources.getString(R.string.error_pass_gen_type))
|
||||
}
|
||||
|
||||
val characterSet = getCharacterSet(
|
||||
upperCase,
|
||||
lowerCase,
|
||||
digits,
|
||||
minus,
|
||||
underline,
|
||||
space,
|
||||
specials,
|
||||
brackets,
|
||||
extended)
|
||||
|
||||
val size = characterSet.length
|
||||
|
||||
val buffer = StringBuilder()
|
||||
|
||||
val random = SecureRandom() // use more secure variant of Random!
|
||||
if (size > 0) {
|
||||
for (i in 0 until length) {
|
||||
buffer.append(characterSet[random.nextInt(size)])
|
||||
// Filter builder
|
||||
val passwordFilters = PasswordFilters().apply {
|
||||
this.length = length
|
||||
this.ignoreChars = ignoreChars
|
||||
if (excludeAmbiguousChar)
|
||||
this.ignoreChars += AMBIGUOUS_CHARS
|
||||
if (upperCase) {
|
||||
addFilter(
|
||||
UPPERCASE_CHARS,
|
||||
if (atLeastOneFromEach) 1 else 0
|
||||
)
|
||||
}
|
||||
if (lowerCase) {
|
||||
addFilter(
|
||||
LOWERCASE_CHARS,
|
||||
if (atLeastOneFromEach) 1 else 0
|
||||
)
|
||||
}
|
||||
if (digits) {
|
||||
addFilter(
|
||||
DIGIT_CHARS,
|
||||
if (atLeastOneFromEach) 1 else 0
|
||||
)
|
||||
}
|
||||
if (minus) {
|
||||
addFilter(
|
||||
MINUS_CHAR,
|
||||
if (atLeastOneFromEach) 1 else 0
|
||||
)
|
||||
}
|
||||
if (underline) {
|
||||
addFilter(
|
||||
UNDERLINE_CHAR,
|
||||
if (atLeastOneFromEach) 1 else 0
|
||||
)
|
||||
}
|
||||
if (space) {
|
||||
addFilter(
|
||||
SPACE_CHAR,
|
||||
if (atLeastOneFromEach) 1 else 0
|
||||
)
|
||||
}
|
||||
if (specials) {
|
||||
addFilter(
|
||||
SPECIAL_CHARS,
|
||||
if (atLeastOneFromEach) 1 else 0
|
||||
)
|
||||
}
|
||||
if (brackets) {
|
||||
addFilter(
|
||||
BRACKET_CHARS,
|
||||
if (atLeastOneFromEach) 1 else 0
|
||||
)
|
||||
}
|
||||
if (extended) {
|
||||
addFilter(
|
||||
extendedChars(),
|
||||
if (atLeastOneFromEach) 1 else 0
|
||||
)
|
||||
}
|
||||
if (considerChars.isNotEmpty()) {
|
||||
addFilter(
|
||||
considerChars,
|
||||
if (atLeastOneFromEach) 1 else 0
|
||||
)
|
||||
}
|
||||
}
|
||||
return buffer.toString()
|
||||
|
||||
return generateRandomString(SecureRandom(), passwordFilters)
|
||||
}
|
||||
|
||||
private fun getCharacterSet(upperCase: Boolean,
|
||||
lowerCase: Boolean,
|
||||
digits: Boolean,
|
||||
minus: Boolean,
|
||||
underline: Boolean,
|
||||
space: Boolean,
|
||||
specials: Boolean,
|
||||
brackets: Boolean,
|
||||
extended: Boolean): String {
|
||||
val charSet = StringBuilder()
|
||||
private fun generateRandomString(random: Random, passwordFilters: PasswordFilters): String {
|
||||
val randomString = StringBuilder()
|
||||
|
||||
if (upperCase) {
|
||||
charSet.append(UPPERCASE_CHARS)
|
||||
// Allocate appropriate memory for the password.
|
||||
var requiredCharactersLeft = passwordFilters.getRequiredCharactersLeft()
|
||||
|
||||
// Build the password.
|
||||
for (i in 0 until passwordFilters.length) {
|
||||
var selectableChars: String = if (requiredCharactersLeft < passwordFilters.length - i) {
|
||||
// choose from any group at random
|
||||
passwordFilters.getSelectableChars()
|
||||
} else {
|
||||
// choose only from a group that we need to satisfy a minimum for.
|
||||
passwordFilters.getSelectableCharsForNeed()
|
||||
}
|
||||
passwordFilters.ignoreChars.forEach {
|
||||
selectableChars = selectableChars.replace(it.toString(), "")
|
||||
}
|
||||
|
||||
// Now that the string is built, get the next random character.
|
||||
val selectableCharsMaxIndex = selectableChars.length
|
||||
val randomSelectableCharsIndex = if (selectableCharsMaxIndex > 0) random.nextInt(selectableCharsMaxIndex) else 0
|
||||
val nextChar = selectableChars[randomSelectableCharsIndex]
|
||||
|
||||
// Put at random position
|
||||
val randomStringMaxIndex = randomString.length
|
||||
val randomStringIndex = if (randomStringMaxIndex > 0) random.nextInt(randomStringMaxIndex) else 0
|
||||
randomString.insert(randomStringIndex, nextChar)
|
||||
|
||||
// Now figure out where it came from, and decrement the appropriate minimum value
|
||||
passwordFilters.getFilterThatContainsChar(nextChar)?.let {
|
||||
if (it.minCharsNeeded > 0) {
|
||||
it.minCharsNeeded--
|
||||
requiredCharactersLeft--
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lowerCase) {
|
||||
charSet.append(LOWERCASE_CHARS)
|
||||
}
|
||||
if (digits) {
|
||||
charSet.append(DIGIT_CHARS)
|
||||
}
|
||||
if (minus) {
|
||||
charSet.append(MINUS_CHAR)
|
||||
}
|
||||
if (underline) {
|
||||
charSet.append(UNDERLINE_CHAR)
|
||||
}
|
||||
if (space) {
|
||||
charSet.append(SPACE_CHAR)
|
||||
}
|
||||
if (specials) {
|
||||
charSet.append(SPECIAL_CHARS)
|
||||
}
|
||||
if (brackets) {
|
||||
charSet.append(BRACKET_CHARS)
|
||||
}
|
||||
if (extended) {
|
||||
charSet.append(extendedChars())
|
||||
return randomString.toString()
|
||||
}
|
||||
|
||||
private data class Filter(var chars: String,
|
||||
var minCharsNeeded: Int)
|
||||
|
||||
private class PasswordFilters {
|
||||
var length: Int = 0
|
||||
var ignoreChars = ""
|
||||
val filters = mutableListOf<Filter>()
|
||||
|
||||
fun addFilter(chars: String, minCharsNeeded: Int) {
|
||||
filters.add(Filter(chars, minCharsNeeded))
|
||||
}
|
||||
|
||||
return charSet.toString()
|
||||
fun getRequiredCharactersLeft(): Int {
|
||||
var charsRequired = 0
|
||||
filters.forEach {
|
||||
charsRequired += it.minCharsNeeded
|
||||
}
|
||||
return charsRequired
|
||||
}
|
||||
|
||||
fun getSelectableChars(): String {
|
||||
val stringBuilder = StringBuilder()
|
||||
filters.forEach {
|
||||
stringBuilder.append(it.chars)
|
||||
}
|
||||
return stringBuilder.toString()
|
||||
}
|
||||
|
||||
fun getFilterThatContainsChar(char: Char): Filter? {
|
||||
return filters.find { it.chars.contains(char) }
|
||||
}
|
||||
|
||||
fun getSelectableCharsForNeed(): String {
|
||||
val selectableChars = StringBuilder()
|
||||
// choose only from a group that we need to satisfy a minimum for.
|
||||
filters.forEach {
|
||||
if (it.minCharsNeeded > 0) {
|
||||
selectableChars.append(it.chars)
|
||||
}
|
||||
}
|
||||
return selectableChars.toString()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@@ -151,5 +229,75 @@ class PasswordGenerator(private val resources: Resources) {
|
||||
private const val SPACE_CHAR = " "
|
||||
private const val SPECIAL_CHARS = "!\"#$%&'*+,./:;=?@\\^`"
|
||||
private const val BRACKET_CHARS = "[]{}()<>"
|
||||
private const val AMBIGUOUS_CHARS = "iI|lLoO01"
|
||||
|
||||
// From KeePassXC code https://github.com/keepassxreboot/keepassxc/pull/538
|
||||
private fun extendedChars(): String {
|
||||
val charSet = StringBuilder()
|
||||
// [U+0080, U+009F] are C1 control characters,
|
||||
// U+00A0 is non-breaking space
|
||||
run {
|
||||
var ch = '\u00A1'
|
||||
while (ch <= '\u00AC') {
|
||||
charSet.append(ch)
|
||||
++ch
|
||||
}
|
||||
}
|
||||
// U+00AD is soft hyphen (format character)
|
||||
var ch = '\u00AE'
|
||||
while (ch < '\u00FF') {
|
||||
charSet.append(ch)
|
||||
++ch
|
||||
}
|
||||
charSet.append('\u00FF')
|
||||
return charSet.toString()
|
||||
}
|
||||
|
||||
fun getColorizedPassword(password: String): Spannable {
|
||||
val spannableString = SpannableStringBuilder()
|
||||
if (password.isNotEmpty()) {
|
||||
password.forEach {
|
||||
when {
|
||||
UPPERCASE_CHARS.contains(it)||
|
||||
LOWERCASE_CHARS.contains(it) -> {
|
||||
spannableString.append(it)
|
||||
}
|
||||
DIGIT_CHARS.contains(it) -> {
|
||||
// RED
|
||||
spannableString.append(colorizeChar(it, Color.rgb(246, 79, 62)))
|
||||
}
|
||||
SPECIAL_CHARS.contains(it) -> {
|
||||
// Blue
|
||||
spannableString.append(colorizeChar(it, Color.rgb(39, 166, 228)))
|
||||
}
|
||||
MINUS_CHAR.contains(it)||
|
||||
UNDERLINE_CHAR.contains(it)||
|
||||
BRACKET_CHARS.contains(it) -> {
|
||||
// Purple
|
||||
spannableString.append(colorizeChar(it, Color.rgb(185, 38, 209)))
|
||||
}
|
||||
extendedChars().contains(it) -> {
|
||||
// Green
|
||||
spannableString.append(colorizeChar(it, Color.rgb(44, 181, 50)))
|
||||
}
|
||||
else -> {
|
||||
spannableString.append(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return spannableString
|
||||
}
|
||||
|
||||
private fun colorizeChar(char: Char, color: Int): Spannable {
|
||||
val spannableColorChar = SpannableString(char.toString())
|
||||
spannableColorChar.setSpan(
|
||||
ForegroundColorSpan(color),
|
||||
0,
|
||||
1,
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
return spannableColorChar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import android.os.Binder
|
||||
import android.os.Build
|
||||
import android.os.IBinder
|
||||
import android.util.Log
|
||||
import androidx.core.app.ServiceCompat
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.database.action.DatabaseTaskProvider
|
||||
import com.kunzisoft.keepass.database.element.Attachment
|
||||
@@ -36,7 +37,10 @@ import com.kunzisoft.keepass.model.EntryAttachmentState
|
||||
import com.kunzisoft.keepass.model.StreamDirection
|
||||
import com.kunzisoft.keepass.tasks.BinaryDatabaseManager
|
||||
import com.kunzisoft.keepass.utils.UriUtil
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.util.*
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
|
||||
@@ -275,7 +279,7 @@ class AttachmentFileNotificationService: LockNotificationService() {
|
||||
AttachmentState.COMPLETE,
|
||||
AttachmentState.CANCELED,
|
||||
AttachmentState.ERROR -> {
|
||||
stopForeground(false)
|
||||
ServiceCompat.stopForeground(this, ServiceCompat.STOP_FOREGROUND_DETACH)
|
||||
notificationManager?.notify(attachmentNotification.notificationId, builder.build())
|
||||
} else -> {
|
||||
startForeground(attachmentNotification.notificationId, builder.build())
|
||||
|
||||
@@ -149,30 +149,23 @@ class KeyboardEntryNotificationService : LockNotificationService() {
|
||||
|
||||
fun launchNotificationIfAllowed(context: Context, entry: EntryInfo, toast: Boolean) {
|
||||
|
||||
val containsURLToCopy = entry.url.isNotEmpty()
|
||||
val containsUsernameToCopy = entry.username.isNotEmpty()
|
||||
val containsPasswordToCopy = entry.password.isNotEmpty()
|
||||
val containsExtraFieldToCopy = entry.customFields.isNotEmpty()
|
||||
|
||||
var startService = false
|
||||
val intent = Intent(context, KeyboardEntryNotificationService::class.java)
|
||||
|
||||
if (containsURLToCopy || containsUsernameToCopy || containsPasswordToCopy || containsExtraFieldToCopy) {
|
||||
if (toast) {
|
||||
Toast.makeText(context,
|
||||
context.getString(R.string.keyboard_notification_entry_content_title, entry.title),
|
||||
Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
if (toast) {
|
||||
Toast.makeText(context,
|
||||
context.getString(R.string.keyboard_notification_entry_content_title,
|
||||
entry.getVisualTitle()
|
||||
),
|
||||
Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
// Show the notification if allowed in Preferences
|
||||
if (PreferencesUtil.isKeyboardNotificationEntryEnable(context)) {
|
||||
startService = true
|
||||
context.startService(intent.apply {
|
||||
putExtra(ENTRY_INFO_KEY, entry)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
MagikeyboardService.removeEntry(context)
|
||||
// Show the notification if allowed in Preferences
|
||||
if (PreferencesUtil.isKeyboardNotificationEntryEnable(context)) {
|
||||
startService = true
|
||||
context.startService(intent.apply {
|
||||
putExtra(ENTRY_INFO_KEY, entry)
|
||||
})
|
||||
}
|
||||
|
||||
if (!startService)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
package com.kunzisoft.keepass.services
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.core.app.ServiceCompat
|
||||
import com.kunzisoft.keepass.timeout.TimeoutHelper
|
||||
import com.kunzisoft.keepass.utils.LockReceiver
|
||||
import com.kunzisoft.keepass.utils.registerLockReceiver
|
||||
@@ -33,6 +34,7 @@ abstract class LockNotificationService : NotificationService() {
|
||||
|
||||
protected open fun actionOnLock() {
|
||||
// Stop the service in all cases
|
||||
ServiceCompat.stopForeground(this, ServiceCompat.STOP_FOREGROUND_REMOVE)
|
||||
stopSelf()
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import android.os.Bundle
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.settings.preferencedialogfragment.DurationDialogFragmentCompat
|
||||
|
||||
|
||||
@@ -31,7 +31,10 @@ import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.stylish.Stylish
|
||||
import com.kunzisoft.keepass.biometric.AdvancedUnlockManager
|
||||
import com.kunzisoft.keepass.database.element.SortNodeEnum
|
||||
import com.kunzisoft.keepass.database.search.SearchParameters
|
||||
import com.kunzisoft.keepass.education.Education
|
||||
import com.kunzisoft.keepass.magikeyboard.MagikeyboardService
|
||||
import com.kunzisoft.keepass.password.PassphraseGenerator
|
||||
import com.kunzisoft.keepass.timeout.TimeoutHelper
|
||||
import com.kunzisoft.keepass.utils.UriUtil
|
||||
import java.util.*
|
||||
@@ -111,6 +114,18 @@ object PreferencesUtil {
|
||||
context.resources.getBoolean(R.bool.show_entry_colors_default))
|
||||
}
|
||||
|
||||
fun hideProtectedValue(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.hide_password_key),
|
||||
context.resources.getBoolean(R.bool.hide_password_default))
|
||||
}
|
||||
|
||||
fun colorizePassword(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.colorize_password_key),
|
||||
context.resources.getBoolean(R.bool.colorize_password_default))
|
||||
}
|
||||
|
||||
fun showUsernamesListEntries(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.list_entries_show_username_key),
|
||||
@@ -192,15 +207,194 @@ object PreferencesUtil {
|
||||
|
||||
fun getDefaultPasswordLength(context: Context): Int {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getInt(context.getString(R.string.password_length_key),
|
||||
Integer.parseInt(context.getString(R.string.default_password_length)))
|
||||
return prefs.getInt(context.getString(R.string.password_generator_length_key),
|
||||
context.resources.getInteger(R.integer.password_generator_length_default))
|
||||
}
|
||||
|
||||
fun getDefaultPasswordCharacters(context: Context): Set<String>? {
|
||||
fun setDefaultPasswordLength(context: Context, passwordLength: Int) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context).edit().apply {
|
||||
putInt(
|
||||
context.getString(R.string.password_generator_length_key),
|
||||
passwordLength
|
||||
)
|
||||
apply()
|
||||
}
|
||||
}
|
||||
|
||||
fun getDefaultPasswordOptions(context: Context): Set<String> {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getStringSet(context.getString(R.string.list_password_generator_options_key),
|
||||
HashSet(listOf(*context.resources
|
||||
.getStringArray(R.array.list_password_generator_options_default_values))))
|
||||
return prefs.getStringSet(context.getString(R.string.password_generator_options_key),
|
||||
HashSet(listOf(*context.resources
|
||||
.getStringArray(R.array.list_password_generator_options_default_values)))) ?: setOf()
|
||||
}
|
||||
|
||||
fun setDefaultPasswordOptions(context: Context, passwordOptionsSet: Set<String>) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context).edit().apply {
|
||||
putStringSet(
|
||||
context.getString(R.string.password_generator_options_key),
|
||||
passwordOptionsSet
|
||||
)
|
||||
apply()
|
||||
}
|
||||
}
|
||||
|
||||
fun getDefaultPasswordConsiderChars(context: Context): String {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getString(context.getString(R.string.password_generator_consider_chars_key),
|
||||
context.getString(R.string.password_generator_consider_chars_default)) ?: ""
|
||||
}
|
||||
|
||||
fun setDefaultPasswordConsiderChars(context: Context, considerChars: String) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context).edit().apply {
|
||||
putString(
|
||||
context.getString(R.string.password_generator_consider_chars_key),
|
||||
considerChars
|
||||
)
|
||||
apply()
|
||||
}
|
||||
}
|
||||
|
||||
fun getDefaultPasswordIgnoreChars(context: Context): String {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getString(context.getString(R.string.password_generator_ignore_chars_key),
|
||||
context.getString(R.string.password_generator_ignore_chars_default)) ?: ""
|
||||
}
|
||||
|
||||
fun setDefaultPasswordIgnoreChars(context: Context, ignoreChars: String) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context).edit().apply {
|
||||
putString(
|
||||
context.getString(R.string.password_generator_ignore_chars_key),
|
||||
ignoreChars
|
||||
)
|
||||
apply()
|
||||
}
|
||||
}
|
||||
|
||||
fun getDefaultPassphraseWordCount(context: Context): Int {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getInt(context.getString(R.string.passphrase_generator_word_count_key),
|
||||
context.resources.getInteger(R.integer.passphrase_generator_word_count_default))
|
||||
}
|
||||
|
||||
fun setDefaultPassphraseWordCount(context: Context, passphraseWordCount: Int) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context).edit().apply {
|
||||
putInt(
|
||||
context.getString(R.string.passphrase_generator_word_count_key),
|
||||
passphraseWordCount
|
||||
)
|
||||
apply()
|
||||
}
|
||||
}
|
||||
|
||||
fun getDefaultPassphraseWordCase(context: Context): PassphraseGenerator.WordCase {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return PassphraseGenerator.WordCase
|
||||
.getByOrdinal(prefs.getInt(context
|
||||
.getString(R.string.passphrase_generator_word_case_key),
|
||||
0)
|
||||
)
|
||||
}
|
||||
|
||||
fun setDefaultPassphraseWordCase(context: Context, wordCase: PassphraseGenerator.WordCase) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context).edit().apply {
|
||||
putInt(
|
||||
context.getString(R.string.passphrase_generator_word_case_key),
|
||||
wordCase.ordinal
|
||||
)
|
||||
apply()
|
||||
}
|
||||
}
|
||||
|
||||
fun getDefaultPassphraseSeparator(context: Context): String {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getString(context.getString(R.string.passphrase_generator_separator_key),
|
||||
context.getString(R.string.passphrase_generator_separator_default)) ?: ""
|
||||
}
|
||||
|
||||
fun setDefaultPassphraseSeparator(context: Context, separator: String) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context).edit().apply {
|
||||
putString(
|
||||
context.getString(R.string.passphrase_generator_separator_key),
|
||||
separator
|
||||
)
|
||||
apply()
|
||||
}
|
||||
}
|
||||
|
||||
fun getDefaultSearchParameters(context: Context): SearchParameters {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return SearchParameters().apply {
|
||||
caseSensitive = prefs.getBoolean(context.getString(R.string.search_option_case_sensitive_key),
|
||||
context.resources.getBoolean(R.bool.search_option_case_sensitive_default))
|
||||
isRegex = prefs.getBoolean(context.getString(R.string.search_option_regex_key),
|
||||
context.resources.getBoolean(R.bool.search_option_regex_default))
|
||||
searchInTitles = prefs.getBoolean(context.getString(R.string.search_option_title_key),
|
||||
context.resources.getBoolean(R.bool.search_option_title_default))
|
||||
searchInUsernames = prefs.getBoolean(context.getString(R.string.search_option_username_key),
|
||||
context.resources.getBoolean(R.bool.search_option_username_default))
|
||||
searchInPasswords = prefs.getBoolean(context.getString(R.string.search_option_password_key),
|
||||
context.resources.getBoolean(R.bool.search_option_password_default))
|
||||
searchInUrls = prefs.getBoolean(context.getString(R.string.search_option_url_key),
|
||||
context.resources.getBoolean(R.bool.search_option_url_default))
|
||||
searchInExpired = prefs.getBoolean(context.getString(R.string.search_option_expired_key),
|
||||
context.resources.getBoolean(R.bool.search_option_expired_default))
|
||||
searchInNotes = prefs.getBoolean(context.getString(R.string.search_option_note_key),
|
||||
context.resources.getBoolean(R.bool.search_option_note_default))
|
||||
searchInOTP = prefs.getBoolean(context.getString(R.string.search_option_otp_key),
|
||||
context.resources.getBoolean(R.bool.search_option_otp_default))
|
||||
searchInOther = prefs.getBoolean(context.getString(R.string.search_option_other_key),
|
||||
context.resources.getBoolean(R.bool.search_option_other_default))
|
||||
searchInUUIDs = prefs.getBoolean(context.getString(R.string.search_option_uuid_key),
|
||||
context.resources.getBoolean(R.bool.search_option_uuid_default))
|
||||
searchInTags = prefs.getBoolean(context.getString(R.string.search_option_tag_key),
|
||||
context.resources.getBoolean(R.bool.search_option_tag_default))
|
||||
searchInCurrentGroup = prefs.getBoolean(context.getString(R.string.search_option_current_group_key),
|
||||
context.resources.getBoolean(R.bool.search_option_current_group_default))
|
||||
searchInSearchableGroup = prefs.getBoolean(context.getString(R.string.search_option_searchable_group_key),
|
||||
context.resources.getBoolean(R.bool.search_option_searchable_group_default))
|
||||
searchInRecycleBin = prefs.getBoolean(context.getString(R.string.search_option_recycle_bin_key),
|
||||
context.resources.getBoolean(R.bool.search_option_recycle_bin_default))
|
||||
searchInTemplates = prefs.getBoolean(context.getString(R.string.search_option_templates_key),
|
||||
context.resources.getBoolean(R.bool.search_option_templates_default))
|
||||
}
|
||||
}
|
||||
|
||||
fun setDefaultSearchParameters(context: Context, searchParameters: SearchParameters) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context).edit().apply {
|
||||
putBoolean(context.getString(R.string.search_option_case_sensitive_key),
|
||||
searchParameters.caseSensitive)
|
||||
putBoolean(context.getString(R.string.search_option_regex_key),
|
||||
searchParameters.isRegex)
|
||||
putBoolean(context.getString(R.string.search_option_title_key),
|
||||
searchParameters.searchInTitles)
|
||||
putBoolean(context.getString(R.string.search_option_username_key),
|
||||
searchParameters.searchInUsernames)
|
||||
putBoolean(context.getString(R.string.search_option_password_key),
|
||||
searchParameters.searchInPasswords)
|
||||
putBoolean(context.getString(R.string.search_option_url_key),
|
||||
searchParameters.searchInUrls)
|
||||
putBoolean(context.getString(R.string.search_option_expired_key),
|
||||
searchParameters.searchInExpired)
|
||||
putBoolean(context.getString(R.string.search_option_note_key),
|
||||
searchParameters.searchInNotes)
|
||||
putBoolean(context.getString(R.string.search_option_otp_key),
|
||||
searchParameters.searchInOTP)
|
||||
putBoolean(context.getString(R.string.search_option_other_key),
|
||||
searchParameters.searchInOther)
|
||||
putBoolean(context.getString(R.string.search_option_uuid_key),
|
||||
searchParameters.searchInUUIDs)
|
||||
putBoolean(context.getString(R.string.search_option_tag_key),
|
||||
searchParameters.searchInTags)
|
||||
putBoolean(context.getString(R.string.search_option_current_group_key),
|
||||
searchParameters.searchInCurrentGroup)
|
||||
putBoolean(context.getString(R.string.search_option_searchable_group_key),
|
||||
searchParameters.searchInSearchableGroup)
|
||||
putBoolean(context.getString(R.string.search_option_recycle_bin_key),
|
||||
searchParameters.searchInRecycleBin)
|
||||
putBoolean(context.getString(R.string.search_option_templates_key),
|
||||
searchParameters.searchInTemplates)
|
||||
apply()
|
||||
}
|
||||
}
|
||||
|
||||
fun isClipboardNotificationsEnable(context: Context): Boolean {
|
||||
@@ -351,12 +545,6 @@ object PreferencesUtil {
|
||||
context.resources.getBoolean(R.bool.sort_recycle_bin_bottom_default))
|
||||
}
|
||||
|
||||
fun hideProtectedValue(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.hide_password_key),
|
||||
context.resources.getBoolean(R.bool.hide_password_default))
|
||||
}
|
||||
|
||||
fun fieldFontIsInVisibility(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.monospace_font_fields_enable_key),
|
||||
@@ -432,14 +620,8 @@ object PreferencesUtil {
|
||||
context.resources.getBoolean(R.bool.keyboard_selection_entry_default))
|
||||
}
|
||||
|
||||
fun isKeyboardSearchShareEnable(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.keyboard_search_share_key),
|
||||
context.resources.getBoolean(R.bool.keyboard_search_share_default))
|
||||
}
|
||||
|
||||
fun isKeyboardSaveSearchInfoEnable(context: Context): Boolean {
|
||||
if (!isKeyboardSearchShareEnable(context))
|
||||
if (!MagikeyboardService.activatedInSettings(context))
|
||||
return false
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.keyboard_save_search_info_key),
|
||||
@@ -470,6 +652,12 @@ object PreferencesUtil {
|
||||
context.resources.getBoolean(R.bool.keyboard_previous_database_credentials_default))
|
||||
}
|
||||
|
||||
fun isKeyboardPreviousSearchEnable(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.keyboard_previous_search_key),
|
||||
context.resources.getBoolean(R.bool.keyboard_previous_search_default))
|
||||
}
|
||||
|
||||
fun isKeyboardPreviousFillInEnable(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.keyboard_previous_fill_in_key),
|
||||
@@ -488,12 +676,6 @@ object PreferencesUtil {
|
||||
context.resources.getBoolean(R.bool.autofill_close_database_default))
|
||||
}
|
||||
|
||||
fun isAutofillAutoSearchEnable(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.autofill_auto_search_key),
|
||||
context.resources.getBoolean(R.bool.autofill_auto_search_default))
|
||||
}
|
||||
|
||||
fun isAutofillInlineSuggestionsEnable(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.autofill_inline_suggestions_key),
|
||||
@@ -609,9 +791,6 @@ object PreferencesUtil {
|
||||
context.getString(R.string.lock_database_screen_off_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.lock_database_back_root_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.lock_database_show_button_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.password_length_key) -> editor.putInt(name, value.toInt())
|
||||
context.getString(R.string.list_password_generator_options_key) -> editor.putStringSet(name, getStringSetFromProperties(value))
|
||||
context.getString(R.string.hide_password_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.allow_copy_password_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.remember_database_locations_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.show_recent_files_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
@@ -632,16 +811,15 @@ object PreferencesUtil {
|
||||
context.getString(R.string.keyboard_notification_entry_clear_close_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.keyboard_entry_timeout_key) -> editor.putString(name, value.toLong().toString())
|
||||
context.getString(R.string.keyboard_selection_entry_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.keyboard_search_share_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.keyboard_save_search_info_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.keyboard_auto_go_action_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.keyboard_key_vibrate_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.keyboard_key_sound_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.keyboard_previous_database_credentials_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.keyboard_previous_search_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.keyboard_previous_fill_in_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.keyboard_previous_lock_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.autofill_close_database_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.autofill_auto_search_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.autofill_inline_suggestions_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.autofill_manual_selection_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.autofill_save_search_info_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
@@ -653,6 +831,8 @@ object PreferencesUtil {
|
||||
context.getString(R.string.setting_style_brightness_key) -> editor.putString(name, value)
|
||||
context.getString(R.string.setting_icon_pack_choose_key) -> editor.putString(name, value)
|
||||
context.getString(R.string.show_entry_colors_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.hide_password_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.colorize_password_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.list_entries_show_username_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.list_groups_show_number_entries_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.show_otp_token_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
@@ -662,6 +842,14 @@ object PreferencesUtil {
|
||||
context.getString(R.string.hide_expired_entries_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.enable_education_screens_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
|
||||
context.getString(R.string.password_generator_length_key) -> editor.putInt(name, value.toInt())
|
||||
context.getString(R.string.password_generator_options_key) -> editor.putStringSet(name, getStringSetFromProperties(value))
|
||||
context.getString(R.string.password_generator_consider_chars_key) -> editor.putString(name, value)
|
||||
context.getString(R.string.password_generator_ignore_chars_key) -> editor.putString(name, value)
|
||||
context.getString(R.string.passphrase_generator_word_count_key) -> editor.putInt(name, value.toInt())
|
||||
context.getString(R.string.passphrase_generator_word_case_key) -> editor.putInt(name, value.toInt())
|
||||
context.getString(R.string.passphrase_generator_separator_key) -> editor.putString(name, value)
|
||||
|
||||
context.getString(R.string.sort_node_key) -> editor.putString(name, value)
|
||||
context.getString(R.string.sort_group_before_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
context.getString(R.string.sort_ascending_key) -> editor.putBoolean(name, value.toBoolean())
|
||||
|
||||
@@ -69,7 +69,18 @@ object UriUtil {
|
||||
return null
|
||||
return when {
|
||||
isFileScheme(fileUri) -> fileUri.path?.let { FileOutputStream(it) }
|
||||
isContentScheme(fileUri) -> contentResolver.openOutputStream(fileUri, "rwt")
|
||||
isContentScheme(fileUri) -> {
|
||||
try {
|
||||
contentResolver.openOutputStream(fileUri, "wt")
|
||||
} catch (e: FileNotFoundException) {
|
||||
Log.e(TAG, "Unable to open stream in `wt` mode, retry in `rwt` mode.", e)
|
||||
// https://issuetracker.google.com/issues/180526528
|
||||
// Try with rwt to fix content provider issue
|
||||
val outStream = contentResolver.openOutputStream(fileUri, "rwt")
|
||||
Log.w(TAG, "`rwt` mode used.")
|
||||
outStream
|
||||
}
|
||||
}
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
@@ -258,17 +269,18 @@ object UriUtil {
|
||||
|
||||
fun contributingUser(context: Context): Boolean {
|
||||
return (Education.isEducationScreenReclickedPerformed(context)
|
||||
|| isExternalAppInstalled(context, "com.kunzisoft.keepass.pro")
|
||||
|| isExternalAppInstalled(context, "com.kunzisoft.keepass.pro", false)
|
||||
)
|
||||
}
|
||||
|
||||
private fun isExternalAppInstalled(context: Context, packageName: String): Boolean {
|
||||
private fun isExternalAppInstalled(context: Context, packageName: String, showError: Boolean = true): Boolean {
|
||||
try {
|
||||
context.applicationContext.packageManager.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES)
|
||||
Education.setEducationScreenReclickedPerformed(context)
|
||||
return true
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "App not accessible", e)
|
||||
if (showError)
|
||||
Log.e(TAG, "App not accessible", e)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import android.content.Context
|
||||
import android.text.InputType
|
||||
import android.util.AttributeSet
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.Filter
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
import com.kunzisoft.keepass.R
|
||||
|
||||
@@ -11,10 +13,43 @@ class InheritedCompletionView @JvmOverloads constructor(
|
||||
context: Context, attrs: AttributeSet? = null
|
||||
) : AppCompatAutoCompleteTextView(context, attrs) {
|
||||
|
||||
val adapter = ArrayAdapter(
|
||||
private val adapter = ArrayAdapterNoFilter(
|
||||
context,
|
||||
android.R.layout.simple_list_item_1,
|
||||
InheritedStatus.listOfStrings(context))
|
||||
android.R.layout.simple_list_item_1
|
||||
)
|
||||
|
||||
private class ArrayAdapterNoFilter(context: Context,
|
||||
@LayoutRes private val layoutResource: Int)
|
||||
: ArrayAdapter<String>(context, layoutResource) {
|
||||
val items = InheritedStatus.listOfStrings(context)
|
||||
|
||||
override fun getCount(): Int {
|
||||
return items.size
|
||||
}
|
||||
|
||||
override fun getItem(position: Int): String {
|
||||
return items[position]
|
||||
}
|
||||
|
||||
override fun getItemId(position: Int): Long {
|
||||
// Or just return p0
|
||||
return items[position].hashCode().toLong()
|
||||
}
|
||||
|
||||
override fun getFilter(): Filter {
|
||||
return object : Filter() {
|
||||
override fun performFiltering(p0: CharSequence?): FilterResults {
|
||||
return FilterResults().apply {
|
||||
values = items
|
||||
}
|
||||
}
|
||||
|
||||
override fun publishResults(p0: CharSequence?, p1: FilterResults?) {
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
setAdapter(adapter)
|
||||
|
||||
@@ -46,7 +46,7 @@ class MainCredentialView @JvmOverloads constructor(context: Context,
|
||||
defStyle: Int = 0)
|
||||
: FrameLayout(context, attrs, defStyle) {
|
||||
|
||||
private var passwordView: EditText
|
||||
private var passwordTextView: EditText
|
||||
private var keyFileSelectionView: KeyFileSelectionView
|
||||
private var checkboxPasswordView: CompoundButton
|
||||
private var checkboxKeyFileView: CompoundButton
|
||||
@@ -60,7 +60,7 @@ class MainCredentialView @JvmOverloads constructor(context: Context,
|
||||
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater?
|
||||
inflater?.inflate(R.layout.view_main_credentials, this)
|
||||
|
||||
passwordView = findViewById(R.id.password)
|
||||
passwordTextView = findViewById(R.id.password_text_view)
|
||||
keyFileSelectionView = findViewById(R.id.keyfile_selection)
|
||||
checkboxPasswordView = findViewById(R.id.password_checkbox)
|
||||
checkboxKeyFileView = findViewById(R.id.keyfile_checkox)
|
||||
@@ -75,8 +75,8 @@ class MainCredentialView @JvmOverloads constructor(context: Context,
|
||||
}
|
||||
}
|
||||
|
||||
passwordView.setOnEditorActionListener(onEditorActionListener)
|
||||
passwordView.addTextChangedListener(object : TextWatcher {
|
||||
passwordTextView.setOnEditorActionListener(onEditorActionListener)
|
||||
passwordTextView.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(charSequence: CharSequence, i: Int, i1: Int, i2: Int) {}
|
||||
|
||||
override fun onTextChanged(charSequence: CharSequence, i: Int, i1: Int, i2: Int) {}
|
||||
@@ -86,7 +86,7 @@ class MainCredentialView @JvmOverloads constructor(context: Context,
|
||||
checkboxPasswordView.isChecked = true
|
||||
}
|
||||
})
|
||||
passwordView.setOnKeyListener { _, _, keyEvent ->
|
||||
passwordTextView.setOnKeyListener { _, _, keyEvent ->
|
||||
var handled = false
|
||||
if (keyEvent.action == KeyEvent.ACTION_DOWN
|
||||
&& keyEvent?.keyCode == KeyEvent.KEYCODE_ENTER
|
||||
@@ -108,11 +108,11 @@ class MainCredentialView @JvmOverloads constructor(context: Context,
|
||||
|
||||
fun populatePasswordTextView(text: String?) {
|
||||
if (text == null || text.isEmpty()) {
|
||||
passwordView.setText("")
|
||||
passwordTextView.setText("")
|
||||
if (checkboxPasswordView.isChecked)
|
||||
checkboxPasswordView.isChecked = false
|
||||
} else {
|
||||
passwordView.setText(text)
|
||||
passwordTextView.setText(text)
|
||||
if (checkboxPasswordView.isChecked)
|
||||
checkboxPasswordView.isChecked = true
|
||||
}
|
||||
@@ -137,7 +137,7 @@ class MainCredentialView @JvmOverloads constructor(context: Context,
|
||||
fun getMainCredential(): MainCredential {
|
||||
return MainCredential().apply {
|
||||
this.masterPassword = if (checkboxPasswordView.isChecked)
|
||||
passwordView.text?.toString() else null
|
||||
passwordTextView.text?.toString() else null
|
||||
this.keyFileUri = if (checkboxKeyFileView.isChecked)
|
||||
keyFileSelectionView.uri else null
|
||||
}
|
||||
@@ -163,7 +163,7 @@ class MainCredentialView @JvmOverloads constructor(context: Context,
|
||||
*/
|
||||
fun retrieveCredentialForStorage(listener: CredentialStorageListener): ByteArray? {
|
||||
return when (mCredentialStorage) {
|
||||
CredentialStorage.PASSWORD -> listener.passwordToStore(passwordView.text?.toString())
|
||||
CredentialStorage.PASSWORD -> listener.passwordToStore(passwordTextView.text?.toString())
|
||||
CredentialStorage.KEY_FILE -> listener.keyfileToStore(keyFileSelectionView.uri)
|
||||
CredentialStorage.HARDWARE_KEY -> listener.hardwareKeyToStore()
|
||||
}
|
||||
@@ -176,15 +176,15 @@ class MainCredentialView @JvmOverloads constructor(context: Context,
|
||||
}
|
||||
|
||||
fun requestPasswordFocus() {
|
||||
passwordView.requestFocusFromTouch()
|
||||
passwordTextView.requestFocusFromTouch()
|
||||
}
|
||||
|
||||
// Auto select the password field and open keyboard
|
||||
fun focusPasswordFieldAndOpenKeyboard() {
|
||||
passwordView.postDelayed({
|
||||
passwordView.requestFocusFromTouch()
|
||||
passwordTextView.postDelayed({
|
||||
passwordTextView.requestFocusFromTouch()
|
||||
val inputMethodManager = context.getSystemService(AppCompatActivity.INPUT_METHOD_SERVICE) as? InputMethodManager?
|
||||
inputMethodManager?.showSoftInput(passwordView, InputMethodManager.SHOW_IMPLICIT)
|
||||
inputMethodManager?.showSoftInput(passwordTextView, InputMethodManager.SHOW_IMPLICIT)
|
||||
}, 100)
|
||||
}
|
||||
|
||||
|
||||
156
app/src/main/java/com/kunzisoft/keepass/view/PassKeyView.kt
Normal file
156
app/src/main/java/com/kunzisoft/keepass/view/PassKeyView.kt
Normal file
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* Copyright 2022 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePassDX.
|
||||
*
|
||||
* KeePassDX is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePassDX is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.view
|
||||
|
||||
import android.content.Context
|
||||
import android.text.Editable
|
||||
import android.text.InputType
|
||||
import android.text.SpannableString
|
||||
import android.text.TextWatcher
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.TextView
|
||||
import com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.password.PasswordGenerator
|
||||
import com.kunzisoft.keepass.password.PasswordEntropy
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
|
||||
class PassKeyView @JvmOverloads constructor(context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyle: Int = 0)
|
||||
: FrameLayout(context, attrs, defStyle) {
|
||||
|
||||
private var mPasswordEntropyCalculator: PasswordEntropy? = null
|
||||
|
||||
private val passwordInputLayout: TextInputLayout
|
||||
private val passwordText: TextView
|
||||
private val passwordStrengthProgress: LinearProgressIndicator
|
||||
private val passwordEntropy: TextView
|
||||
|
||||
private var mViewHint: String = ""
|
||||
private var mMaxLines: Int = 3
|
||||
private var mShowPassword: Boolean = false
|
||||
|
||||
private var mPasswordTextWatcher: MutableList<TextWatcher> = mutableListOf()
|
||||
private val passwordTextWatcher = object : TextWatcher {
|
||||
override fun beforeTextChanged(charSequence: CharSequence, i: Int, i1: Int, i2: Int) {
|
||||
mPasswordTextWatcher.forEach {
|
||||
it.beforeTextChanged(charSequence, i, i1, i2)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTextChanged(charSequence: CharSequence, i: Int, i1: Int, i2: Int) {
|
||||
mPasswordTextWatcher.forEach {
|
||||
it.onTextChanged(charSequence, i, i1, i2)
|
||||
}
|
||||
}
|
||||
|
||||
override fun afterTextChanged(editable: Editable) {
|
||||
mPasswordTextWatcher.forEach {
|
||||
it.afterTextChanged(editable)
|
||||
}
|
||||
getEntropyStrength(editable.toString())
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
context.theme.obtainStyledAttributes(
|
||||
attrs,
|
||||
R.styleable.PassKeyView,
|
||||
0, 0).apply {
|
||||
try {
|
||||
mViewHint = getString(R.styleable.PassKeyView_passKeyHint)
|
||||
?: context.getString(R.string.password)
|
||||
mMaxLines = getInteger(R.styleable.PassKeyView_passKeyMaxLines, mMaxLines)
|
||||
mShowPassword = getBoolean(R.styleable.PassKeyView_passKeyVisible,
|
||||
!PreferencesUtil.hideProtectedValue(context))
|
||||
} finally {
|
||||
recycle()
|
||||
}
|
||||
}
|
||||
|
||||
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater?
|
||||
inflater?.inflate(R.layout.view_passkey, this)
|
||||
|
||||
passwordInputLayout = findViewById(R.id.password_input_layout)
|
||||
passwordInputLayout?.hint = mViewHint
|
||||
passwordText = findViewById(R.id.password_text)
|
||||
if (mShowPassword) {
|
||||
passwordText?.inputType = passwordText.inputType or
|
||||
InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
|
||||
}
|
||||
passwordText?.maxLines = mMaxLines
|
||||
passwordText?.applyFontVisibility()
|
||||
passwordText.addTextChangedListener(passwordTextWatcher)
|
||||
passwordStrengthProgress = findViewById(R.id.password_strength_progress)
|
||||
passwordStrengthProgress?.apply {
|
||||
setIndicatorColor(PasswordEntropy.Strength.RISKY.color)
|
||||
progress = 0
|
||||
max = 100
|
||||
}
|
||||
passwordEntropy = findViewById(R.id.password_entropy)
|
||||
|
||||
mPasswordEntropyCalculator = PasswordEntropy {
|
||||
passwordText?.text?.toString()?.let { firstPassword ->
|
||||
getEntropyStrength(firstPassword)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getEntropyStrength(passwordText: String) {
|
||||
mPasswordEntropyCalculator?.getEntropyStrength(passwordText) { entropyStrength ->
|
||||
passwordStrengthProgress.apply {
|
||||
post {
|
||||
setIndicatorColor(entropyStrength.strength.color)
|
||||
setProgressCompat(entropyStrength.estimationPercent, true)
|
||||
}
|
||||
}
|
||||
passwordEntropy.apply {
|
||||
post {
|
||||
text = PasswordEntropy.getStringEntropy(resources, entropyStrength.entropy)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun addTextChangedListener(textWatcher: TextWatcher) {
|
||||
mPasswordTextWatcher.add(textWatcher)
|
||||
}
|
||||
|
||||
fun removeTextChangedListener(textWatcher: TextWatcher) {
|
||||
mPasswordTextWatcher.remove(textWatcher)
|
||||
}
|
||||
|
||||
var passwordString: String
|
||||
get() {
|
||||
return passwordText.text.toString()
|
||||
}
|
||||
set(value) {
|
||||
val spannableString =
|
||||
if (PreferencesUtil.colorizePassword(context))
|
||||
PasswordGenerator.getColorizedPassword(value)
|
||||
else
|
||||
SpannableString(value)
|
||||
passwordText.text = spannableString
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import androidx.core.view.isVisible
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.database.search.SearchHelper
|
||||
import com.kunzisoft.keepass.database.search.SearchParameters
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
|
||||
class SearchFiltersView @JvmOverloads constructor(context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
@@ -30,7 +31,7 @@ class SearchFiltersView @JvmOverloads constructor(context: Context,
|
||||
private var searchUsername: CompoundButton
|
||||
private var searchPassword: CompoundButton
|
||||
private var searchURL: CompoundButton
|
||||
private var searchExpires: CompoundButton
|
||||
private var searchExpired: CompoundButton
|
||||
private var searchNotes: CompoundButton
|
||||
private var searchOther: CompoundButton
|
||||
private var searchUUID: CompoundButton
|
||||
@@ -49,7 +50,7 @@ class SearchFiltersView @JvmOverloads constructor(context: Context,
|
||||
this.searchInUsernames = searchUsername.isChecked
|
||||
this.searchInPasswords = searchPassword.isChecked
|
||||
this.searchInUrls = searchURL.isChecked
|
||||
this.excludeExpired = !(searchExpires.isChecked)
|
||||
this.searchInExpired = searchExpired.isChecked
|
||||
this.searchInNotes = searchNotes.isChecked
|
||||
this.searchInOther = searchOther.isChecked
|
||||
this.searchInUUIDs = searchUUID.isChecked
|
||||
@@ -69,12 +70,12 @@ class SearchFiltersView @JvmOverloads constructor(context: Context,
|
||||
searchUsername.isChecked = value.searchInUsernames
|
||||
searchPassword.isChecked = value.searchInPasswords
|
||||
searchURL.isChecked = value.searchInUrls
|
||||
searchExpires.isChecked = !value.excludeExpired
|
||||
searchExpired.isChecked = value.searchInExpired
|
||||
searchNotes.isChecked = value.searchInNotes
|
||||
searchOther.isChecked = value.searchInOther
|
||||
searchUUID.isChecked = value.searchInUUIDs
|
||||
searchTag.isChecked = value.searchInTags
|
||||
searchGroupSearchable.isChecked = value.searchInRecycleBin
|
||||
searchGroupSearchable.isChecked = value.searchInSearchableGroup
|
||||
searchRecycleBin.isChecked = value.searchInRecycleBin
|
||||
searchTemplate.isChecked = value.searchInTemplates
|
||||
mOnParametersChangeListener = tempListener
|
||||
@@ -107,7 +108,7 @@ class SearchFiltersView @JvmOverloads constructor(context: Context,
|
||||
searchUsername = findViewById(R.id.search_chip_username)
|
||||
searchPassword = findViewById(R.id.search_chip_password)
|
||||
searchURL = findViewById(R.id.search_chip_url)
|
||||
searchExpires = findViewById(R.id.search_chip_expires)
|
||||
searchExpired = findViewById(R.id.search_chip_expires)
|
||||
searchNotes = findViewById(R.id.search_chip_note)
|
||||
searchUUID = findViewById(R.id.search_chip_uuid)
|
||||
searchOther = findViewById(R.id.search_chip_other)
|
||||
@@ -116,6 +117,9 @@ class SearchFiltersView @JvmOverloads constructor(context: Context,
|
||||
searchRecycleBin = findViewById(R.id.search_chip_recycle_bin)
|
||||
searchTemplate = findViewById(R.id.search_chip_template)
|
||||
|
||||
// Set search
|
||||
searchParameters = PreferencesUtil.getDefaultSearchParameters(context)
|
||||
|
||||
// Expand menu with button
|
||||
searchExpandButton.setOnClickListener {
|
||||
val isVisible = searchAdvanceFiltersContainer?.visibility == View.VISIBLE
|
||||
@@ -153,8 +157,8 @@ class SearchFiltersView @JvmOverloads constructor(context: Context,
|
||||
searchParameters.searchInUrls = isChecked
|
||||
mOnParametersChangeListener?.invoke(searchParameters)
|
||||
}
|
||||
searchExpires.setOnCheckedChangeListener { _, isChecked ->
|
||||
searchParameters.excludeExpired = !isChecked
|
||||
searchExpired.setOnCheckedChangeListener { _, isChecked ->
|
||||
searchParameters.searchInExpired = isChecked
|
||||
mOnParametersChangeListener?.invoke(searchParameters)
|
||||
}
|
||||
searchNotes.setOnCheckedChangeListener { _, isChecked ->
|
||||
@@ -249,4 +253,8 @@ class SearchFiltersView @JvmOverloads constructor(context: Context,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun saveSearchParameters() {
|
||||
PreferencesUtil.setDefaultSearchParameters(context, searchParameters)
|
||||
}
|
||||
}
|
||||
@@ -162,7 +162,7 @@ class TemplateEditView @JvmOverloads constructor(context: Context,
|
||||
if (templateAttribute.options.isAssociatedWithPasswordGenerator()) {
|
||||
setOnActionClickListener({
|
||||
mOnPasswordGenerationActionClickListener?.invoke(field)
|
||||
}, R.drawable.ic_generate_password_white_24dp)
|
||||
}, R.drawable.ic_random_white_24dp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ class TemplateView @JvmOverloads constructor(context: Context,
|
||||
setCopyButtonState(TextFieldView.ButtonState.GONE)
|
||||
} else {
|
||||
label = otpElement.type.name
|
||||
value = otpElement.token
|
||||
value = otpElement.tokenString
|
||||
setCopyButtonState(TextFieldView.ButtonState.ACTIVATE)
|
||||
setCopyButtonClickListener { _, _ ->
|
||||
mOnCopyActionClickListener?.invoke(Field(
|
||||
@@ -175,7 +175,7 @@ class TemplateView @JvmOverloads constructor(context: Context,
|
||||
mLastOtpTokenView = this
|
||||
mOtpRunnable = Runnable {
|
||||
if (otpElement.shouldRefreshToken()) {
|
||||
value = otpElement.token
|
||||
value = otpElement.tokenString
|
||||
}
|
||||
if (mLastOtpTokenView == null) {
|
||||
mOnOtpElementUpdated?.invoke(null)
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import android.os.Build
|
||||
import android.text.InputFilter
|
||||
import android.text.InputType
|
||||
import android.text.SpannableString
|
||||
import android.util.AttributeSet
|
||||
import android.util.TypedValue
|
||||
import android.view.ContextThemeWrapper
|
||||
@@ -19,6 +20,9 @@ import androidx.core.view.isVisible
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.database.element.template.TemplateField
|
||||
import com.kunzisoft.keepass.password.PasswordGenerator
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
|
||||
class TextEditFieldView @JvmOverloads constructor(context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
@@ -123,7 +127,13 @@ class TextEditFieldView @JvmOverloads constructor(context: Context,
|
||||
return valueView.text?.toString() ?: ""
|
||||
}
|
||||
set(value) {
|
||||
valueView.setText(value)
|
||||
val spannableString =
|
||||
if (PreferencesUtil.colorizePassword(context)
|
||||
&& TemplateField.isStandardPasswordName(context, label))
|
||||
PasswordGenerator.getColorizedPassword(value)
|
||||
else
|
||||
SpannableString(value)
|
||||
valueView.setText(spannableString)
|
||||
}
|
||||
|
||||
override var default: String = ""
|
||||
@@ -164,7 +174,11 @@ class TextEditFieldView @JvmOverloads constructor(context: Context,
|
||||
fun setProtection(protection: Boolean) {
|
||||
if (protection) {
|
||||
labelView.endIconMode = TextInputLayout.END_ICON_PASSWORD_TOGGLE
|
||||
valueView.inputType = valueView.inputType or InputType.TYPE_TEXT_VARIATION_PASSWORD
|
||||
val visibilityTag = if (PreferencesUtil.hideProtectedValue(context))
|
||||
InputType.TYPE_TEXT_VARIATION_PASSWORD
|
||||
else
|
||||
InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
|
||||
valueView.inputType = valueView.inputType or visibilityTag
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,11 +22,13 @@ package com.kunzisoft.keepass.view
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.text.InputFilter
|
||||
import android.text.SpannableString
|
||||
import android.text.util.Linkify
|
||||
import android.util.AttributeSet
|
||||
import android.util.TypedValue
|
||||
import android.view.ContextThemeWrapper
|
||||
import android.view.View
|
||||
import android.view.View.OnClickListener
|
||||
import android.widget.RelativeLayout
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.appcompat.widget.AppCompatImageButton
|
||||
@@ -36,7 +38,10 @@ import androidx.core.text.util.LinkifyCompat
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.isVisible
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.database.element.template.TemplateField
|
||||
import com.kunzisoft.keepass.model.EntryInfo.Companion.APPLICATION_ID_FIELD_NAME
|
||||
import com.kunzisoft.keepass.password.PasswordGenerator
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
import com.kunzisoft.keepass.utils.UriUtil
|
||||
|
||||
|
||||
@@ -191,7 +196,13 @@ class TextFieldView @JvmOverloads constructor(context: Context,
|
||||
return valueView.text.toString()
|
||||
}
|
||||
set(value) {
|
||||
valueView.text = value
|
||||
val spannableString =
|
||||
if (PreferencesUtil.colorizePassword(context)
|
||||
&& TemplateField.isStandardPasswordName(context, label))
|
||||
PasswordGenerator.getColorizedPassword(value)
|
||||
else
|
||||
SpannableString(value)
|
||||
valueView.text = spannableString
|
||||
changeProtectedValueParameters()
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright 2022 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePassDX.
|
||||
*
|
||||
* KeePassDX is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePassDX is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.viewmodels
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
|
||||
class KeyGeneratorViewModel: ViewModel() {
|
||||
|
||||
val keyGenerated : LiveData<String> get() = _keyGenerated
|
||||
private val _keyGenerated = MutableLiveData<String>()
|
||||
|
||||
val keyGeneratedValidated : LiveData<Void?> get() = _keyGeneratedValidated
|
||||
private val _keyGeneratedValidated = SingleLiveEvent<Void?>()
|
||||
val requireKeyGeneration : LiveData<Void?> get() = _requireKeyGeneration
|
||||
private val _requireKeyGeneration = SingleLiveEvent<Void?>()
|
||||
|
||||
val passwordGeneratedValidated : LiveData<Void?> get() = _passwordGeneratedValidated
|
||||
private val _passwordGeneratedValidated = SingleLiveEvent<Void?>()
|
||||
val requirePasswordGeneration : LiveData<Void?> get() = _requirePasswordGeneration
|
||||
private val _requirePasswordGeneration = SingleLiveEvent<Void?>()
|
||||
|
||||
val passphraseGeneratedValidated : LiveData<Void?> get() = _passphraseGeneratedValidated
|
||||
private val _passphraseGeneratedValidated = SingleLiveEvent<Void?>()
|
||||
val requirePassphraseGeneration : LiveData<Void?> get() = _requirePassphraseGeneration
|
||||
private val _requirePassphraseGeneration = SingleLiveEvent<Void?>()
|
||||
|
||||
fun setKeyGenerated(passKey: String) {
|
||||
_keyGenerated.value = passKey
|
||||
}
|
||||
|
||||
fun validateKeyGenerated() {
|
||||
_keyGeneratedValidated.call()
|
||||
}
|
||||
|
||||
fun validatePasswordGenerated() {
|
||||
_passwordGeneratedValidated.call()
|
||||
}
|
||||
|
||||
fun validatePassphraseGenerated() {
|
||||
_passphraseGeneratedValidated.call()
|
||||
}
|
||||
|
||||
fun requireKeyGeneration() {
|
||||
_requireKeyGeneration.call()
|
||||
}
|
||||
|
||||
fun requirePasswordGeneration() {
|
||||
_requirePasswordGeneration.call()
|
||||
}
|
||||
|
||||
fun requirePassphraseGeneration() {
|
||||
_requirePassphraseGeneration.call()
|
||||
}
|
||||
}
|
||||
@@ -19,11 +19,11 @@ class SingleLiveEvent<T> : MutableLiveData<T>() {
|
||||
}
|
||||
|
||||
// Observe the internal MutableLiveData
|
||||
super.observe(owner, { t ->
|
||||
super.observe(owner) { t ->
|
||||
if (mPending.compareAndSet(true, false)) {
|
||||
observer.onChanged(t)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@MainThread
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
android:right="0dp"
|
||||
android:top="12dp"
|
||||
android:bottom="12dp"/>
|
||||
<stroke android:width="1dp" android:color="@color/grey_blue_slight" />
|
||||
<solid android:color="@color/grey_blue_slight"/>
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/grey_blue_slight" />
|
||||
<solid
|
||||
android:color="@color/grey_blue_slight"/>
|
||||
</shape>
|
||||
31
app/src/main/res/drawable/key_border.xml
Normal file
31
app/src/main/res/drawable/key_border.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2022 Jeremy Jamet / Kunzisoft.
|
||||
|
||||
This file is part of KeePassDX.
|
||||
|
||||
KeePassDX is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
KeePassDX is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners
|
||||
android:radius="12dp" />
|
||||
<padding
|
||||
android:left="0dp"
|
||||
android:right="0dp"
|
||||
android:top="12dp"
|
||||
android:bottom="12dp"/>
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/grey_blue_slighter" />
|
||||
</shape>
|
||||
@@ -23,7 +23,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/fingerprint_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:filterTouchesWhenObscured="true">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/biometric_image"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
|
||||
@@ -71,28 +72,29 @@
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_toEndOf="@+id/activity_about_icon"
|
||||
android:layout_toRightOf="@+id/activity_about_icon"
|
||||
android:layout_toEndOf="@+id/activity_about_icon">
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/activity_about_app_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/activity_about_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@android:style/TextAppearance.Small"/>
|
||||
android:textAppearance="@android:style/TextAppearance.Small" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/activity_about_build"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@android:style/TextAppearance.Small"/>
|
||||
android:textAppearance="@android:style/TextAppearance.Small" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
android:id="@+id/toolbar_coordinator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
@@ -138,8 +139,9 @@
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/entry_content_tab"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="120dp"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:background="?attr/cardBackgroundTransparentColor"
|
||||
app:tabIconTint="?android:attr/textColor"
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
android:importantForAutofill="noExcludeDescendants"
|
||||
tools:targetApi="o"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:filterTouchesWhenObscured="true">
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:id="@+id/entry_edit_coordinator_layout"
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
android:importantForAutofill="noExcludeDescendants"
|
||||
tools:targetApi="o">
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
android:id="@+id/icon_picker_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
android:id="@+id/image_viewer_container"
|
||||
android:background="?android:attr/windowBackground">
|
||||
<include
|
||||
|
||||
68
app/src/main/res/layout/activity_key_generator.xml
Normal file
68
app/src/main/res/layout/activity_key_generator.xml
Normal file
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2022 Jeremy Jamet / Kunzisoft.
|
||||
|
||||
This file is part of KeePassDX.
|
||||
|
||||
KeePassDX is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
KeePassDX is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/key_generator_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:id="@+id/key_generator_coordinator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/toolbar">
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/key_generator_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
<com.kunzisoft.keepass.view.ToolbarAction
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:layout_gravity="bottom"
|
||||
android:theme="?attr/toolbarActionAppearance"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/key_generator_validation"
|
||||
style="@style/KeepassDXStyle.Fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/validate"
|
||||
android:src="@drawable/ic_check_white_24dp"
|
||||
android:tint="?attr/colorOnAccentColor"
|
||||
app:fabSize="mini"
|
||||
app:layout_constraintTop_toTopOf="@+id/toolbar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<include
|
||||
layout="@layout/view_button_lock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -23,6 +23,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
android:background="?android:attr/windowBackground"
|
||||
tools:targetApi="o">
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
android:id="@+id/toolbar_coordinator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
android:background="?android:attr/windowBackground"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
|
||||
167
app/src/main/res/layout/fragment_generate_passphrase.xml
Normal file
167
app/src/main/res/layout/fragment_generate_passphrase.xml
Normal file
@@ -0,0 +1,167 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2019 Jeremy Jamet / Kunzisoft.
|
||||
|
||||
This file is part of KeePassDX.
|
||||
|
||||
KeePassDX is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
KeePassDX is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:importantForAutofill="noExcludeDescendants"
|
||||
android:paddingBottom="@dimen/card_view_margin_vertical"
|
||||
tools:targetApi="o">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="68dp"
|
||||
android:background="?attr/colorPrimary" />
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:layout_marginBottom="@dimen/card_view_margin_vertical"
|
||||
android:layout_gravity="bottom"
|
||||
app:cardCornerRadius="4dp">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/card_view_padding">
|
||||
|
||||
<com.kunzisoft.keepass.view.PassKeyView
|
||||
android:id="@+id/passphrase_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toStartOf="@+id/passphrase_copy_button"
|
||||
android:layout_toLeftOf="@+id/passphrase_copy_button"
|
||||
app:passKeyHint="@string/passphrase"
|
||||
app:passKeyMaxLines="7"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/passphrase_copy_button"
|
||||
style="@style/KeepassDXStyle.ImageButton.Simple"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/passphrase_view"
|
||||
android:layout_alignBottom="@+id/passphrase_view"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:contentDescription="@string/menu_copy"
|
||||
android:src="@drawable/ic_content_copy_white_24dp" />
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</FrameLayout>
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/ScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/card_view_margin_vertical"
|
||||
android:layout_marginBottom="@dimen/card_view_margin_vertical"
|
||||
app:cardCornerRadius="4dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/card_view_padding"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.slider.Slider
|
||||
android:id="@+id/slider_word_count"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/word_count"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toStartOf="@+id/word_count"
|
||||
android:layout_toLeftOf="@+id/word_count"
|
||||
android:contentDescription="@string/content_description_password_length"
|
||||
android:stepSize="1"
|
||||
android:value="@integer/passphrase_generator_word_count_default"
|
||||
android:valueFrom="@integer/passphrase_generator_word_count_min"
|
||||
android:valueTo="@integer/passphrase_generator_word_count_max"
|
||||
app:thumbColor="?attr/chipFilterBackgroundColor"
|
||||
app:trackColorActive="?attr/chipFilterBackgroundColor"
|
||||
app:trackColorInactive="?attr/chipFilterBackgroundColorDisabled" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/word_count"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:inputType="number"
|
||||
android:maxLength="2"
|
||||
android:maxLines="1" />
|
||||
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:id="@+id/character_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="Character count: 51" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/word_case"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="12dp"/>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/word_separator_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@+id/word_case"
|
||||
android:layout_toRightOf="@+id/word_case">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/word_separator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/word_separator" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
@@ -23,319 +23,241 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/default_margin"
|
||||
android:layout_height="match_parent"
|
||||
android:importantForAutofill="noExcludeDescendants"
|
||||
android:paddingBottom="@dimen/card_view_margin_vertical"
|
||||
tools:targetApi="o">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/password_input_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/password_copy_button"
|
||||
android:importantForAccessibility="no"
|
||||
android:importantForAutofill="no"
|
||||
app:endIconMode="password_toggle"
|
||||
app:endIconTint="?attr/colorAccent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:hint="@string/hint_generated_password"
|
||||
android:importantForAccessibility="no"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="textPassword|textMultiLine"
|
||||
android:maxLines="3"
|
||||
tools:ignore="TextFields" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/password_copy_button"
|
||||
style="@style/KeepassDXStyle.ImageButton.Simple"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:contentDescription="@string/menu_copy"
|
||||
android:src="@drawable/ic_content_copy_white_24dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/generate_password_button"
|
||||
android:layout_margin="@dimen/button_margin"
|
||||
android:layout_height="68dp"
|
||||
android:background="?attr/colorPrimary" />
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp"
|
||||
android:drawableEnd="@drawable/ic_generate_password_white_24dp"
|
||||
android:drawableRight="@drawable/ic_generate_password_white_24dp"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingRight="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:text="@string/generate_password" />
|
||||
</LinearLayout>
|
||||
android:layout_marginStart="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:layout_marginBottom="@dimen/card_view_margin_vertical"
|
||||
android:layout_gravity="bottom"
|
||||
app:cardCornerRadius="4dp">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/card_view_padding">
|
||||
|
||||
<com.kunzisoft.keepass.view.PassKeyView
|
||||
android:id="@+id/password_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toStartOf="@+id/password_copy_button"
|
||||
android:layout_toLeftOf="@+id/password_copy_button" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/password_copy_button"
|
||||
style="@style/KeepassDXStyle.ImageButton.Simple"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/password_view"
|
||||
android:layout_alignBottom="@+id/password_view"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:contentDescription="@string/menu_copy"
|
||||
android:src="@drawable/ic_content_copy_white_24dp" />
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</FrameLayout>
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/ScrollView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/length_label"
|
||||
android:text="@string/length"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/length"
|
||||
android:layout_width="50dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/length_label"
|
||||
android:maxLines="1"
|
||||
android:maxLength="3"
|
||||
android:inputType="number"
|
||||
android:text="@string/default_password_length"
|
||||
android:hint="@string/hint_length"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatSeekBar
|
||||
android:id="@+id/seekbar_length"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/length"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignTop="@+id/length"
|
||||
android:layout_toEndOf="@+id/length"
|
||||
android:layout_toRightOf="@+id/length"
|
||||
android:contentDescription="@string/content_description_password_length"
|
||||
app:min="@string/min_password_length"
|
||||
android:progress="@string/default_password_length"
|
||||
android:max="@string/max_password_length"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
android:layout_marginStart="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/card_view_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/card_view_margin_vertical"
|
||||
android:layout_marginBottom="@dimen/card_view_margin_vertical"
|
||||
app:cardCornerRadius="4dp">
|
||||
<LinearLayout
|
||||
android:id="@+id/RelativeLayout"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginEnd="20dp">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/card_view_padding"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<CheckBox
|
||||
android:id="@+id/cb_uppercase"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/uppercase"
|
||||
android:checked="true" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="end"
|
||||
android:layout_toEndOf="@+id/cb_uppercase"
|
||||
android:layout_toRightOf="@+id/cb_uppercase"
|
||||
android:text="@string/visual_uppercase" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<CheckBox
|
||||
android:id="@+id/cb_lowercase"
|
||||
android:layout_width="wrap_content"
|
||||
<com.google.android.material.slider.Slider
|
||||
android:id="@+id/slider_length"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/lowercase"
|
||||
android:checked="true" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="end"
|
||||
android:layout_toEndOf="@+id/cb_lowercase"
|
||||
android:layout_toRightOf="@+id/cb_lowercase"
|
||||
android:text="@string/visual_lowercase" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<CheckBox
|
||||
android:id="@+id/cb_digits"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/digits"
|
||||
android:checked="true" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="end"
|
||||
android:layout_toEndOf="@+id/cb_digits"
|
||||
android:layout_toRightOf="@+id/cb_digits"
|
||||
android:text="@string/visual_digits" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<CheckBox
|
||||
android:id="@+id/cb_minus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/minus" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="end"
|
||||
android:layout_toEndOf="@+id/cb_minus"
|
||||
android:layout_toRightOf="@+id/cb_minus"
|
||||
android:text="@string/visual_minus" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<CheckBox
|
||||
android:id="@+id/cb_underline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/underline" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="end"
|
||||
android:layout_toEndOf="@+id/cb_underline"
|
||||
android:layout_toRightOf="@+id/cb_underline"
|
||||
android:text="@string/visual_underline" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<CheckBox
|
||||
android:id="@+id/cb_space"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/space" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="end"
|
||||
android:layout_toEndOf="@+id/cb_space"
|
||||
android:layout_toRightOf="@+id/cb_space"
|
||||
android:text="@string/visual_space" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<CheckBox
|
||||
android:id="@+id/cb_specials"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/special" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="end"
|
||||
android:layout_toEndOf="@+id/cb_specials"
|
||||
android:layout_toRightOf="@+id/cb_specials"
|
||||
android:text="@string/visual_special" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<CheckBox
|
||||
android:id="@+id/cb_brackets"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/brackets"
|
||||
android:layout_alignBottom="@+id/length"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_toStartOf="@+id/length"
|
||||
android:layout_toLeftOf="@+id/length"
|
||||
android:contentDescription="@string/content_description_password_length"
|
||||
android:stepSize="1"
|
||||
android:value="@integer/password_generator_length_default"
|
||||
android:valueFrom="@integer/password_generator_length_min"
|
||||
android:valueTo="@integer/password_generator_length_max"
|
||||
app:thumbColor="?attr/chipFilterBackgroundColor"
|
||||
app:trackColorActive="?attr/chipFilterBackgroundColor"
|
||||
app:trackColorInactive="?attr/chipFilterBackgroundColorDisabled" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/length"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="end"
|
||||
android:layout_toEndOf="@+id/cb_brackets"
|
||||
android:layout_toRightOf="@+id/cb_brackets"
|
||||
android:text="@string/visual_brackets" />
|
||||
android:inputType="number"
|
||||
android:maxLength="3"
|
||||
android:maxLines="1" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/password_filters"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipSpacingVertical="16dp"
|
||||
android:paddingTop="@dimen/default_margin"
|
||||
android:paddingBottom="@dimen/default_margin">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/upperCase_filter"
|
||||
style="@style/KeepassDXStyle.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="@string/visual_uppercase"/>
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/lowerCase_filter"
|
||||
style="@style/KeepassDXStyle.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="@string/visual_lowercase"/>
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/digits_filter"
|
||||
style="@style/KeepassDXStyle.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="@string/visual_digits"/>
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/minus_filter"
|
||||
style="@style/KeepassDXStyle.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:text="@string/visual_minus"/>
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/underline_filter"
|
||||
style="@style/KeepassDXStyle.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:text="@string/visual_underline"/>
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/space_filter"
|
||||
style="@style/KeepassDXStyle.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:text="@string/space"/>
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/special_filter"
|
||||
style="@style/KeepassDXStyle.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="@string/visual_special"/>
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/brackets_filter"
|
||||
style="@style/KeepassDXStyle.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:text="@string/visual_brackets"/>
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/extendedASCII_filter"
|
||||
style="@style/KeepassDXStyle.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:text="@string/visual_extended"/>
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<CheckBox
|
||||
android:id="@+id/cb_extended"
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/consider_chars_filter_layout"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ignore_chars_filter_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/consider_chars_filter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/consider_chars_filter"/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/ignore_chars_filter_layout"
|
||||
app:layout_constraintStart_toEndOf="@+id/consider_chars_filter_layout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/ignore_chars_filter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/ignore_chars_filter"/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/password_advanced"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipSpacingVertical="16dp"
|
||||
android:paddingTop="@dimen/default_margin"
|
||||
android:paddingBottom="@dimen/default_margin">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/atLeastOne_filter"
|
||||
style="@style/KeepassDXStyle.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/extended_ASCII"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true" />
|
||||
<TextView
|
||||
android:checked="true"
|
||||
android:text="@string/at_least_one_char"/>
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/excludeAmbiguous_filter"
|
||||
style="@style/KeepassDXStyle.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="end"
|
||||
android:layout_toEndOf="@+id/cb_extended"
|
||||
android:layout_toRightOf="@+id/cb_extended"
|
||||
android:text="@string/visual_extended" />
|
||||
</RelativeLayout>
|
||||
android:checked="true"
|
||||
android:text="@string/exclude_ambiguous_chars"/>
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
@@ -71,25 +71,11 @@
|
||||
android:text="@string/password"/>
|
||||
|
||||
<!-- Password Input -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/password_input_layout"
|
||||
<com.kunzisoft.keepass.view.PassKeyView
|
||||
android:id="@+id/password_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:importantForAccessibility="no"
|
||||
android:importantForAutofill="no"
|
||||
app:endIconMode="password_toggle"
|
||||
app:endIconTint="?attr/colorAccent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/pass_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPassword"
|
||||
android:importantForAccessibility="no"
|
||||
android:importantForAutofill="yes"
|
||||
android:autofillHints="newPassword"
|
||||
android:maxLines="1"
|
||||
android:hint="@string/hint_pass"/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
app:passKeyVisible="false"/>
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/password_repeat_input_layout"
|
||||
android:layout_width="match_parent"
|
||||
@@ -100,14 +86,14 @@
|
||||
app:endIconMode="password_toggle"
|
||||
app:endIconTint="?attr/colorAccent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/pass_conf_password"
|
||||
android:id="@+id/password_confirmation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPassword"
|
||||
android:ems="10"
|
||||
android:importantForAccessibility="no"
|
||||
android:importantForAutofill="yes"
|
||||
android:autofillHints="newPassword"
|
||||
android:maxLines="1"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="textPassword|textMultiLine"
|
||||
android:maxLines="3"
|
||||
android:hint="@string/hint_conf_pass"/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
@@ -23,15 +23,15 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/icon_picker_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/icon_picker_pager"
|
||||
android:id="@+id/tabs_view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tabs_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -144,7 +144,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
tools:text="5136" />
|
||||
tools:text="513 651" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -20,18 +20,79 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:background="@color/grey_blue_deep"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:id="@+id/magikeyboard_entry_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingRight="24dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="@drawable/key_border"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/magikeyboard_entry_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="16sp"
|
||||
tools:text="Git account signup"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/white"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/magikeyboard_database_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
<ImageView
|
||||
android:id="@+id/magikeyboard_database_color"
|
||||
android:layout_width="6dp"
|
||||
android:layout_height="6dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/content_description_database_color"
|
||||
android:src="@drawable/background_icon" />
|
||||
<TextView
|
||||
android:id="@+id/magikeyboard_database_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:textSize="11sp"
|
||||
tools:text="Database A"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/grey_blue_slighter"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/magikeyboard_entry_text"
|
||||
android:id="@+id/magikeyboard_package_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/grey_blue_deep"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"/>
|
||||
android:textSize="12sp"
|
||||
tools:text="com.kunzisoft.keepass"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/grey_blue_slighter"/>
|
||||
<com.kunzisoft.keepass.magikeyboard.KeyboardView
|
||||
android:id="@+id/magikeyboard_view"
|
||||
style="@style/KeepassDXStyle.Keyboard"
|
||||
|
||||
@@ -34,12 +34,12 @@
|
||||
android:id="@+id/keyboard_popup_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:contentDescription="@string/content_description_keyboard_close_fields"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="4dp"
|
||||
android:padding="8dp"
|
||||
android:background="@drawable/key_background"
|
||||
android:contentDescription="@string/content_description_keyboard_close_fields"
|
||||
android:src="@drawable/ic_close_white_24dp" />
|
||||
</RelativeLayout>
|
||||
@@ -17,19 +17,20 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<RelativeLayout
|
||||
<TextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/keyboard_popup_field_item_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/keyboard_popup_field_item_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/key_background"
|
||||
android:layout_margin="5dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
tools:text="Sample"
|
||||
android:textColor="@color/white"/>
|
||||
</RelativeLayout>
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/key_background"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="4dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingRight="12dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
tools:text="Sample"
|
||||
android:textColor="@color/white"/>
|
||||
@@ -22,4 +22,5 @@
|
||||
android:id="@+id/fingerprint_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
tools:visibility="gone" />
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:filterTouchesWhenObscured="true">
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/lock_button"
|
||||
style="@style/KeepassDXStyle.Fab.Special"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:filterTouchesWhenObscured="true">
|
||||
<!-- Icon -->
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/template_icon_button"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
android:importantForAutofill="noExcludeDescendants"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingStart="12dp"
|
||||
@@ -36,19 +37,16 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@+id/password_checkbox"
|
||||
android:layout_toEndOf="@+id/password_checkbox"
|
||||
android:importantForAccessibility="no"
|
||||
android:importantForAutofill="no"
|
||||
app:endIconMode="password_toggle"
|
||||
app:endIconTint="?attr/colorAccent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/password"
|
||||
android:id="@+id/password_text_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp"
|
||||
android:hint="@string/password"
|
||||
android:inputType="textPassword"
|
||||
android:importantForAccessibility="no"
|
||||
android:importantForAutofill="yes"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
|
||||
53
app/src/main/res/layout/view_passkey.xml
Normal file
53
app/src/main/res/layout/view_passkey.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/password_input_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:importantForAccessibility="no"
|
||||
android:importantForAutofill="no"
|
||||
app:endIconMode="password_toggle"
|
||||
app:endIconTint="?attr/colorAccent"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/password_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:hint="@string/hint_pass"
|
||||
android:importantForAccessibility="no"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="textPassword|textMultiLine"
|
||||
android:maxLines="3"
|
||||
tools:ignore="TextFields" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/password_strength_progress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
app:trackCornerRadius="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/password_input_layout"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/password_entropy"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="Entropy: 72.50 bit"
|
||||
android:textSize="11sp"
|
||||
android:layout_margin="4dp"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/password_input_layout"
|
||||
app:layout_constraintEnd_toEndOf="@+id/password_input_layout" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -4,6 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:orientation="vertical">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:targetApi="o"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:filterTouchesWhenObscured="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
|
||||
28
app/src/main/res/menu/key_generator.xml
Normal file
28
app/src/main/res/menu/key_generator.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2021 Jeremy Jamet / Kunzisoft.
|
||||
|
||||
This file is part of KeePassDX.
|
||||
|
||||
KeePassDX is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
KeePassDX is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item android:id="@+id/menu_generate"
|
||||
android:icon="@drawable/ic_random_white_24dp"
|
||||
android:title="@string/generate_password"
|
||||
android:orderInCategory="8"
|
||||
app:iconTint="?attr/colorControlNormal"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
||||
@@ -180,7 +180,7 @@
|
||||
<string name="lock_database_screen_off_summary">اقفل قاعدة البيانات عند انغلاق الشاشة</string>
|
||||
<string name="biometric_delete_all_key_title">حذف مفاتيح التشفير</string>
|
||||
<string name="unavailable_feature_text">لا يمكن بدأ هذه الميزة .</string>
|
||||
<string name="unavailable_feature_version">نسخة الاندرويد %1$s لا تحقق ادنى متطلبات السنخة %2$s.</string>
|
||||
<string name="unavailable_feature_version">هذا الجهاز يعمل بأندرويد %1$s لكن يحتاج نسخة %2$s على الأقل.</string>
|
||||
<string name="file_name">اسم الملف</string>
|
||||
<string name="path">مسار</string>
|
||||
<string name="database_history">تأريخ</string>
|
||||
@@ -190,13 +190,13 @@
|
||||
<string name="biometric_unlock_enable_summary">يسمح بفحص البصمة لفتح قاعدة البيانات</string>
|
||||
<string name="monospace_font_fields_enable_summary">غير خط الحقول لتوضيح المحارف</string>
|
||||
<string name="allow_copy_password_title">الوثوق بالحافظة</string>
|
||||
<string name="allow_copy_password_summary">اسمح لكلمة السر والحقول المحمية بالدخول للحافظة</string>
|
||||
<string name="allow_copy_password_summary">اسمح بنسخ كلمة السر والحقول المحمية إلى للحافظة</string>
|
||||
<string name="allow_copy_password_warning">تحذير: الحافظة مشتركة بين التطبيقات وستتمكن التطبيقات الاخرى من الوصول الى المعلومات الحساسة.</string>
|
||||
<string name="database_name_title">اسم قاعدة البيانات</string>
|
||||
<string name="database_description_title">وصف قاعدة البيانات</string>
|
||||
<string name="database_version_title">نسخة قاعدة البيانات</string>
|
||||
<string name="text_appearance">نص</string>
|
||||
<string name="application_appearance">تطبيق</string>
|
||||
<string name="application_appearance">الواجهة</string>
|
||||
<string name="other">أخرى</string>
|
||||
<string name="keyboard">لوحة مفاتيح</string>
|
||||
<string name="keyboard_setting_label">إعدادات Magikeyboard</string>
|
||||
@@ -227,7 +227,7 @@
|
||||
<string name="sort_last_access_time">الوصول</string>
|
||||
<string name="lock">إقفال</string>
|
||||
<string name="assign_master_key">تعيين مفتاح رئيسي</string>
|
||||
<string name="recycle_bin_title">استخدم سلة المحذوفات</string>
|
||||
<string name="recycle_bin_title">استخدام سلة المحذوفات</string>
|
||||
<string name="magic_keyboard_title">Magikeyboard</string>
|
||||
<string name="keyboard_name">Magikeyboard</string>
|
||||
<string name="keyboard_label">Magikeyboard (KeePassDX)</string>
|
||||
@@ -334,7 +334,7 @@
|
||||
<string name="database_data_compression_title">ضغط البيانات</string>
|
||||
<string name="data">البيانات</string>
|
||||
<string name="unavailable_feature_hardware">تعذر العثور على ماسح البصمة.</string>
|
||||
<string name="biometric_delete_all_key_summary">احذف كل مفاتيح التشفير المرتبطة بالبصمة</string>
|
||||
<string name="biometric_delete_all_key_summary">احذف كل مفاتيح التعمية المرتبطة بفك القفل المتقدم</string>
|
||||
<string name="advanced_unlock_explanation_summary">استخدم إلغاء القفل المتقدم لفتح قاعدة البيانات بسهولة</string>
|
||||
<string name="lock_database_show_button_summary">يعرض زر القَفل في الواجهة</string>
|
||||
<string name="lock_database_show_button_title">اعرض زر القَفل</string>
|
||||
@@ -357,8 +357,6 @@
|
||||
<string name="autofill_web_domain_blocklist_title">قائمة النطاقات المحظورة</string>
|
||||
<string name="autofill_application_id_blocklist_summary">منع الملء التلقائي للتطبيقات الموجودة في القائمة</string>
|
||||
<string name="autofill_application_id_blocklist_title">قائمة التطبيقات المحظورة</string>
|
||||
<string name="autofill_auto_search_summary">يقترح تلقائيا نتائج البحث في النطاقات ومعرفات التطبيقات</string>
|
||||
<string name="autofill_auto_search_title">البحث التلقائي</string>
|
||||
<string name="content_description_repeat_toggle_password_visibility">بدِّل ظهور كلمة السر</string>
|
||||
<string name="hide_expired_entries_summary">لن تعرض المدخلات منتهية الصلاحية</string>
|
||||
<string name="education_read_only_summary">غيِّر وضع الجلسة.
|
||||
@@ -474,7 +472,6 @@
|
||||
<string name="credential_before_click_advanced_unlock_button">اكتب كلمة السر، وأنقر هذا الزر.</string>
|
||||
<string name="device_credential">بيانات الاعتماد للجهاز</string>
|
||||
<string name="advanced_unlock_tap_delete">انفر لحذف مفاتيح فك القفل المتقدم</string>
|
||||
<string name="keyboard_search_share_title">ابحث في المعلومات المشاركة</string>
|
||||
<string name="keyboard_auto_go_action_title">إجراء اللمس التلقائي</string>
|
||||
<string name="keyboard_previous_fill_in_title">إجراء لمس تلقائي</string>
|
||||
<string name="keyboard_previous_lock_title">اقفل قاعدة البيانات</string>
|
||||
@@ -504,4 +501,23 @@
|
||||
<string name="regex">تعابير نمطية</string>
|
||||
<string name="enable_keep_screen_on_title">أبق الشاشة شغّالة</string>
|
||||
<string name="enable_education_screens_summary">أبرز العناصر لتعلم طريقة عمل التطبيق</string>
|
||||
<string name="autofill_read_only_save">غير مسموح حفظ البيانات في قاعدة بيانات مفتوحة للقراءة فقط.</string>
|
||||
<string name="autofill_inline_suggestions_keyboard">أُضيف اقتراح ملء تلقائي.</string>
|
||||
<string name="keyboard_previous_database_credentials_summary">ارجع للوحة المفاتيح السابقة تلقائيًا في شاشة بيانات اعتماد قاعدة البيانات.</string>
|
||||
<string name="autofill_manual_selection_summary">اعرض خيارًا يسمح للمستخدم باختيار مدخلة من قاعدة البيانات</string>
|
||||
<string name="keyboard_previous_search_title">شاشة البحث</string>
|
||||
<string name="keyboard_previous_search_summary">ارجع للوحة المفاتيح السابقة تلقائيًا في شاشة البحث</string>
|
||||
<string name="autofill_save_search_info_summary">حاول حفظ معلومات البحث بعد اختيار مدخلة يدويًا وهذا لتسهيل استخدمها مستقبلًا</string>
|
||||
<string name="keyboard_previous_lock_summary">ارجع للوحة المفاتيح السابقة تلقائيًا بعد إغلاق قاعدة البيانات</string>
|
||||
<string name="autofill_close_database_summary">أغلق قاعدة البيانات بعد الملء التلقائي</string>
|
||||
<string name="autofill_ask_to_save_data_summary">اسأل عن حفظ البيانات عند ملئك لنموذج</string>
|
||||
<string name="templates_group_uuid_title">مجموعة القوالب</string>
|
||||
<string name="advanced_unlock_timeout">انتهت مهلة فك القفل المتقدم</string>
|
||||
<string name="temp_advanced_unlock_timeout_summary">مهلة استخدام فك القفل المتقدم قبل حذف محتواها</string>
|
||||
<string name="advanced_unlock_delete_all_key_warning">أتريد حذف كل مفاتيح التعمية المرتبطة بفك القفل المتقدم؟</string>
|
||||
<string name="templates">القوالب</string>
|
||||
<string name="templates_group_enable_title">استخدام القوالب</string>
|
||||
<string name="notification">الإشعارات</string>
|
||||
<string name="temp_advanced_unlock_enable_summary">لا تستخدم أي محتوى معمى لاستخدام فك القفل المتقدم</string>
|
||||
<string name="temp_advanced_unlock_timeout_title">انتهاء صلاحية فك القفل المتقدم</string>
|
||||
</resources>
|
||||
@@ -132,8 +132,6 @@
|
||||
<string name="keyboard_notification_entry_clear_close_summary">Zatvori bazu podataka prilikom zatvaranja obaveštenja</string>
|
||||
<string name="keyboard_notification_entry_clear_close_title">Isprazni pri zatvaranju</string>
|
||||
<string name="keyboard_save_search_info_summary">Pokušaj da sačuvaš podeljene informacije prilikom ručnog izbora unosa</string>
|
||||
<string name="keyboard_search_share_summary">Automatski тражите заједничке информације да бисте попунили тастатуру</string>
|
||||
<string name="keyboard_search_share_title">Traži podeljene informacije</string>
|
||||
<string name="keyboard_notification_entry_summary">Prikaži obaveštenje kada je unos dostupn</string>
|
||||
<string name="keyboard_notification_entry_title">Obaveštenje</string>
|
||||
<string name="keyboard_selection_entry_summary">Prikaži polja za unos podataka u Magikeyboard-u prilikom prikazivanja unosa</string>
|
||||
|
||||
@@ -429,15 +429,11 @@
|
||||
<string name="validate">Zkontrolovat</string>
|
||||
<string name="education_setup_OTP_summary">Nastavit správu One-Time hesla (HOTP / TOTP) pro založení tokenu požadovaného pro dvoufázové ověření (2FA).</string>
|
||||
<string name="education_setup_OTP_title">Nastavit OTP</string>
|
||||
<string name="autofill_auto_search_summary">Automaticky navrhnout výsledky hledání z webové domény nebo ID aplikace</string>
|
||||
<string name="autofill_auto_search_title">Automatické vyhledávání</string>
|
||||
<string name="lock_database_show_button_summary">Zobrazí tlačítko zámku v uživatelském rozhraní</string>
|
||||
<string name="lock_database_show_button_title">Zobrazit tlačítko zámku</string>
|
||||
<string name="autofill_preference_title">Nastavení samovyplnění</string>
|
||||
<string name="warning_database_link_revoked">Přístup k souboru zrušenému správcem souborů</string>
|
||||
<string name="error_label_exists">Tento štítek už existuje.</string>
|
||||
<string name="keyboard_search_share_summary">Při sdílení URL s KeePassDX filtrovat záznamy podle URL domény</string>
|
||||
<string name="keyboard_search_share_title">Prohledat sdílené info</string>
|
||||
<string name="autofill_block_restart">Aktivovat zamezení restartováním aplikace obsahující formulář.</string>
|
||||
<string name="autofill_block">Zamezit samovyplnění</string>
|
||||
<string name="autofill_web_domain_blocklist_summary">Seznam domén, pro něž se zamezí samovyplnění</string>
|
||||
|
||||
@@ -429,15 +429,11 @@
|
||||
<string name="discard">Kassér</string>
|
||||
<string name="discard_changes">Kasser ændringer\?</string>
|
||||
<string name="validate">Valider</string>
|
||||
<string name="autofill_auto_search_summary">Foreslår automatisk søgeresultater fra webdomænet eller applikations-id</string>
|
||||
<string name="autofill_auto_search_title">Automatisk søgning</string>
|
||||
<string name="lock_database_show_button_summary">Viser låseknappen i brugergrænsefladen</string>
|
||||
<string name="lock_database_show_button_title">Vis låseknap</string>
|
||||
<string name="autofill_preference_title">Indstillinger for automatisk udfyldning</string>
|
||||
<string name="warning_database_link_revoked">Adgang til filen tilbagekaldt af filadministratoren</string>
|
||||
<string name="error_label_exists">Etiketten findes allerede.</string>
|
||||
<string name="keyboard_search_share_summary">Søg automatisk efter delte oplysninger for at udfylde tastaturet</string>
|
||||
<string name="keyboard_search_share_title">Søg i delte oplysninger</string>
|
||||
<string name="autofill_block_restart">Genstart programmet, der indeholder formularen for at aktivere blokeringen.</string>
|
||||
<string name="autofill_block">Bloker autofyld</string>
|
||||
<string name="autofill_web_domain_blocklist_summary">Blokeringsliste, der forhindrer automatisk udfyldning af webdomæner</string>
|
||||
@@ -559,4 +555,13 @@
|
||||
<string name="import_app_properties_title">Importer appegenskaber</string>
|
||||
<string name="error_move_group_here">Du kan flytte en gruppe her.</string>
|
||||
<string name="error_word_reserved">Dette ord er reseveret og kan ikke bruges.</string>
|
||||
<string name="expired">Udløbet</string>
|
||||
<string name="tags">Tags</string>
|
||||
<string name="content_description_database_color">Database farve</string>
|
||||
<string name="template_group_name">Skabeloner</string>
|
||||
<string name="searchable">Søgbar</string>
|
||||
<string name="inherited">Arve</string>
|
||||
<string name="custom_data">Brugerdefinerede data</string>
|
||||
<string name="search_filters">Søg filtre</string>
|
||||
<string name="current_group">Nuværende gruppe</string>
|
||||
</resources>
|
||||
@@ -199,7 +199,7 @@
|
||||
<string name="autofill_sign_in_prompt">Mit KeePassDX anmelden</string>
|
||||
<string name="set_autofill_service_title">Standarddienst für automatisches Ausfüllen festlegen</string>
|
||||
<string name="autofill_explanation_summary">Automatisches Ausfüllen aktivieren, um Formulare schnell in anderen Apps auszufüllen</string>
|
||||
<string name="autofill_select_entry">Eintrag auswählen…</string>
|
||||
<string name="autofill_select_entry">Eintrag auswählen …</string>
|
||||
<string name="clipboard">Zwischenablage</string>
|
||||
<string name="biometric_delete_all_key_title">Verschlüsselungsschlüssel löschen</string>
|
||||
<string name="biometric_delete_all_key_summary">Alle Verschlüsselungsschlüssel löschen, die mit der modernen Entsperrerkennung zusammenhängen</string>
|
||||
@@ -252,7 +252,7 @@
|
||||
<string name="education_donation_summary">Mithelfen, um Stabilität und Sicherheit zu verbessern sowie weitere Funktionen zu ermöglichen.</string>
|
||||
<string name="html_text_ad_free">Anders als viele andere Passwortmanager ist dieser <strong>werbefrei</strong>, <strong>quelloffen</strong> und unter einer <strong>Copyleft-Lizenz</strong>. Es werden keine persönlichen Daten gesammelt, in welcher Form auch immer, unabhängig von der verwendeten Version (kostenlos oder Pro).</string>
|
||||
<string name="html_text_buy_pro">Mit dem Kauf der Pro-Version erhalten Sie Zugriff auf diesen <strong>visuellen Stil</strong> und unterstützen insbesondere <strong>die Umsetzung gemeinschaftlicher Projekte.</strong></string>
|
||||
<string name="html_text_feature_generosity">Dieser <strong>visuelle Stil</strong> wurde wegen Ihrer Großzügigkeit freigeschaltet.</string>
|
||||
<string name="html_text_feature_generosity">Dieser <strong>visuelle Stil</strong> ist dank Ihrer Großzügigkeit verfügbar.</string>
|
||||
<string name="html_text_donation">Um unsere Freiheit zu bewahren und immer aktiv zu bleiben, zählen wir auf Ihren <strong>Beitrag.</strong></string>
|
||||
<string name="html_text_dev_feature">Diese Funktion ist <strong>in Entwicklung</strong> und erfordert <strong>Ihren Beitrag</strong>, um bald verfügbar zu sein.</string>
|
||||
<string name="html_text_dev_feature_buy_pro">Durch den Kauf der <strong>Pro-Version</strong>,</string>
|
||||
@@ -317,7 +317,7 @@
|
||||
<string name="show_recent_files_summary">Speicherort zuletzt verwendeter Datenbanken anzeigen</string>
|
||||
<string name="hide_broken_locations_title">Defekte Datenbankverknüpfungen ausblenden</string>
|
||||
<string name="hide_broken_locations_summary">Nicht funktionierende Verknüpfungen in der Liste der zuletzt verwendeten Datenbanken ausblenden</string>
|
||||
<string name="do_not_kill_app">App nicht beenden …</string>
|
||||
<string name="do_not_kill_app">App nicht beenden …</string>
|
||||
<string name="lock_database_back_root_summary">Datenbank sperren, wenn auf dem Hauptbildschirm der Zurück-Button gedrückt wird</string>
|
||||
<string name="clear_clipboard_notification_title">Beim Schließen löschen</string>
|
||||
<string name="recycle_bin">Papierkorb</string>
|
||||
@@ -445,8 +445,6 @@
|
||||
<string name="discard">Verwerfen</string>
|
||||
<string name="discard_changes">Änderungen verwerfen\?</string>
|
||||
<string name="validate">Validieren</string>
|
||||
<string name="autofill_auto_search_summary">Suchergebnisse automatisch nach Web-Domain oder Anwendungs-ID vorschlagen</string>
|
||||
<string name="autofill_auto_search_title">Automatische Suche</string>
|
||||
<string name="autofill_manual_selection_title">Manuelle Auswahl</string>
|
||||
<string name="autofill_manual_selection_summary">Manuelle Auswahl des Datenbankeintrags ermöglichen</string>
|
||||
<string name="lock_database_show_button_summary">Zeigt die Sperrtaste in der Benutzeroberfläche an</string>
|
||||
@@ -454,8 +452,6 @@
|
||||
<string name="autofill_preference_title">Einstellungen für automatisches Ausfüllen</string>
|
||||
<string name="warning_database_link_revoked">Zugriff auf die Datei durch den Dateimanager widerrufen</string>
|
||||
<string name="error_label_exists">Diese Bezeichnung existiert bereits.</string>
|
||||
<string name="keyboard_search_share_summary">Beim Teilen einer URL mit KeePassDX die Einträge nach dieser URL filtern</string>
|
||||
<string name="keyboard_search_share_title">Gemeinsame Infos durchsuchen</string>
|
||||
<string name="autofill_block_restart">Starten Sie die Anwendung, die das Formular enthält, neu, um die Sperrung zu aktivieren.</string>
|
||||
<string name="autofill_block">Automatisches Ausfüllen sperren</string>
|
||||
<string name="autofill_web_domain_blocklist_summary">Liste der Domains, auf denen ein automatisches Ausfüllen verhindert wird</string>
|
||||
@@ -470,8 +466,8 @@
|
||||
<string name="keyboard_change">Tastatur wechseln</string>
|
||||
<string name="keyboard_previous_fill_in_title">Auto-Key-Aktion</string>
|
||||
<string name="keyboard_previous_database_credentials_title">Datenbank-Anmeldebildschirm</string>
|
||||
<string name="keyboard_previous_fill_in_summary">Nach Ausführung der automatischen Tastenaktion automatisch zur vorherigen Tastatur wechseln</string>
|
||||
<string name="keyboard_previous_database_credentials_summary">Automatisches Zurückschalten zur vorherigen Tastatur auf dem Datenbank-Anmeldebildschirm</string>
|
||||
<string name="keyboard_previous_fill_in_summary">Nach dem Ausführen der automatischen Tastenaktion automatisch zur vorherigen Tastatur wechseln</string>
|
||||
<string name="keyboard_previous_database_credentials_summary">Auf dem Datenbank-Anmeldebildschirm automatisch zur vorherigen Tastatur wechseln</string>
|
||||
<string name="education_add_attachment_summary">Laden Sie einen Anhang für Ihren Eintrag hoch, um wichtige externe Daten zu speichern.</string>
|
||||
<string name="content_description_credentials_information">Anmeldeinformationen</string>
|
||||
<string name="data">Daten</string>
|
||||
@@ -492,7 +488,7 @@
|
||||
<string name="show_uuid_title">UUID anzeigen</string>
|
||||
<string name="autofill_read_only_save">Das Speichern von Daten ist für eine als schreibgeschützt geöffnete Datenbank nicht zulässig.</string>
|
||||
<string name="autofill_close_database_title">Datenbank schließen</string>
|
||||
<string name="keyboard_previous_lock_summary">Nach dem Sperren der Datenbank automatisch zur vorherigen Tastatur zurückschalten</string>
|
||||
<string name="keyboard_previous_lock_summary">Nach dem Sperren der Datenbank automatisch zur vorherigen Tastatur wechseln</string>
|
||||
<string name="keyboard_previous_lock_title">Datenbank sperren</string>
|
||||
<string name="notification">Benachrichtigung</string>
|
||||
<string name="biometric_security_update_required">Biometrisches Sicherheitsupdate erforderlich.</string>
|
||||
@@ -501,16 +497,16 @@
|
||||
<string name="save_mode">Speichermodus</string>
|
||||
<string name="search_mode">Suchmodus</string>
|
||||
<string name="error_registration_read_only">Das Speichern eines neuen Elements in einer schreibgeschützten Datenbank ist nicht zulässig</string>
|
||||
<string name="autofill_save_search_info_summary">Suchdaten bei manueller Auswahl einer Eingabe, wenn möglich, speichern</string>
|
||||
<string name="autofill_save_search_info_summary">Wenn möglich, die Suchinformationen bei manueller Eintragsauswahl, zur einfacheren zukünftigen Verwendung, speichern</string>
|
||||
<string name="autofill_ask_to_save_data_summary">Nachfragen, ob die Daten gespeichert werden sollen, wenn ein Formular ausgefüllt ist</string>
|
||||
<string name="autofill_ask_to_save_data_title">Speichern von Daten abfragen</string>
|
||||
<string name="autofill_save_search_info_title">Suchinformationen speichern</string>
|
||||
<string name="autofill_close_database_summary">Datenbank nach Auswahl eines Eintrags zum automatischen Ausfüllen schließen</string>
|
||||
<string name="keyboard_save_search_info_summary">Nachdem eine URL mit KeePassDX geteilt und ein Eintrag gewählt wurde, wird versucht, sich diesen Eintrag für die weitere Nutzung zu merken</string>
|
||||
<string name="keyboard_save_search_info_title">Gemeinsam genutzte Informationen speichern</string>
|
||||
<string name="keyboard_save_search_info_summary">Wenn möglich, die gemeinsamen Informationen bei manueller Eintragsauswahl, zur einfacheren zukünftigen Verwendung, speichern</string>
|
||||
<string name="keyboard_save_search_info_title">Gemeinsame Informationen speichern</string>
|
||||
<string name="warning_empty_recycle_bin">Sollen alle ausgewählten Knoten wirklich aus dem Papierkorb gelöscht werden\?</string>
|
||||
<string name="error_field_name_already_exists">Der Feldname existiert bereits.</string>
|
||||
<string name="advanced_unlock_prompt_store_credential_message">Warnung: Sie müssen sich immer noch an Ihr Masterpasswort erinnern, wenn Sie die moderne Entsperrerkennung verwenden.</string>
|
||||
<string name="advanced_unlock_prompt_store_credential_message">Sie müssen sich immer noch an Ihre Anmeldedaten erinnern, wenn Sie die moderne Entsperrerkennung verwenden.</string>
|
||||
<string name="open_advanced_unlock_prompt_store_credential">Zum Speichern der Anmeldeinformationen Dialog zum modernen Entsperren öffnen</string>
|
||||
<string name="open_advanced_unlock_prompt_unlock_database">Dialog zum modernen Entsperren der Datenbank öffnen</string>
|
||||
<string name="menu_keystore_remove_key">Schlüssel für modernes Entsperren löschen</string>
|
||||
@@ -633,10 +629,33 @@
|
||||
<string name="search_filters">Suchfilter</string>
|
||||
<string name="current_group">Aktuelle Gruppe</string>
|
||||
<string name="case_sensitive">Groß-/Kleinschreibung beachten</string>
|
||||
<string name="menu_merge_from">Zusammenführen von …</string>
|
||||
<string name="menu_save_copy_to">Kopie speichern unter …</string>
|
||||
<string name="menu_merge_from">Zusammenführen von …</string>
|
||||
<string name="menu_save_copy_to">Kopie speichern unter …</string>
|
||||
<string name="content_description_nav_header">Navigationskopfzeile</string>
|
||||
<string name="navigation_drawer_close">Navigationsleiste schließen</string>
|
||||
<string name="navigation_drawer_open">Navigationsleiste öffnen</string>
|
||||
<string name="expired">Abgelaufen</string>
|
||||
<string name="warning_database_already_opened">Eine Datenbank ist bereits geöffnet, schließen Sie diese, um die neue zu öffnen</string>
|
||||
<string name="advanced_unlock_keystore_warning">Diese Funktion speichert verschlüsselte Anmeldedaten im sicheren Schlüsselspeicher Ihres Geräts.
|
||||
\n
|
||||
\nAbhängig von der nativen API-Implementierung des Betriebssystems ist sie möglicherweise nicht voll funktionsfähig.
|
||||
\nÜberprüfen Sie die Kompatibilität und Sicherheit des Schlüsselspeichers mit dem Hersteller Ihres Geräts und dem Ersteller des von Ihnen verwendeten ROMs.</string>
|
||||
<string name="content_description_passphrase_word_count">Passphrase-Wortanzahl</string>
|
||||
<string name="passphrase">Passphrase</string>
|
||||
<string name="colorize_password_title">Passwörter einfärben</string>
|
||||
<string name="colorize_password_summary">Passwortzeichen nach Typ einfärben</string>
|
||||
<string name="keyboard_previous_search_title">Suchbildschirm</string>
|
||||
<string name="keyboard_previous_search_summary">Auf dem Suchbildschirm automatisch zur vorherigen Tastatur wechseln</string>
|
||||
<string name="entropy">Entropie: %1$s Bit</string>
|
||||
<string name="entropy_high">Entropie: Hoch</string>
|
||||
<string name="entropy_calculate">Entropie: Berechnen …</string>
|
||||
<string name="at_least_one_char">Mindestens ein Zeichen von jedem</string>
|
||||
<string name="consider_chars_filter">Zeichen berücksichtigen</string>
|
||||
<string name="word_separator">Trennzeichen</string>
|
||||
<string name="ignore_chars_filter">Zeichen ignorieren</string>
|
||||
<string name="lower_case">Kleinbuchstaben</string>
|
||||
<string name="upper_case">GROẞBUCHSTABEN</string>
|
||||
<string name="character_count">Anzahl der Zeichen: %1$d</string>
|
||||
<string name="exclude_ambiguous_chars">Mehrdeutige Zeichen ausschließen</string>
|
||||
<string name="title_case">Groß-/Kleinschreibung des Titels</string>
|
||||
</resources>
|
||||
@@ -413,8 +413,6 @@
|
||||
<string name="contribution">Συνεισφορά</string>
|
||||
<string name="education_setup_OTP_summary">Ρύθμιση διαχείρισης μίας-χρήσης κωδικού πρόσβασης (HOTP / TOTP) για δημιουργία token που ζητήθηκε για έλεγχο ταυτότητας δύο παραγόντων (2FA).</string>
|
||||
<string name="education_setup_OTP_title">Ρύθμιση OTP</string>
|
||||
<string name="autofill_auto_search_summary">Προτείνετε αυτόματα αποτελέσματα αναζήτησης από τον τομέα ιστού ή το αναγνωριστικό εφαρμογής</string>
|
||||
<string name="autofill_auto_search_title">Αυτόματη αναζήτηση</string>
|
||||
<string name="lock_database_show_button_summary">Εμφανίζει το κουμπί κλειδώματος στη διεπαφή χρήστη</string>
|
||||
<string name="lock_database_show_button_title">Εμφάνιση κουμπιού κλειδώματος</string>
|
||||
<string name="autofill_preference_title">Ρυθμίσεις Αυτόματης Συμπλήρωσης</string>
|
||||
@@ -449,8 +447,6 @@
|
||||
<string name="keyboard_previous_database_credentials_summary">Επιστρέψτε αυτόματα στο προηγούμενο πληκτρολόγιο στην οθόνη διαπιστευτηρίων βάσης δεδομένων</string>
|
||||
<string name="keyboard_previous_database_credentials_title">Οθόνη διαπιστευτηρίων βάσης δεδομένων</string>
|
||||
<string name="keyboard_change">Εναλλαγή πληκτρολογίου</string>
|
||||
<string name="keyboard_search_share_title">Αναζήτηση κοινών πληροφοριών</string>
|
||||
<string name="keyboard_search_share_summary">Κατά την κοινή χρήση ενός URL στο KeePassDX, φιλτράρετε τις καταχωρήσεις χρησιμοποιώντας αυτόν τον τομέα URL</string>
|
||||
<string name="database_data_remove_unlinked_attachments_summary">Καταργεί συνημμένα που περιέχονται στη βάση δεδομένων, αλλά δεν συνδέονται με μια καταχώριση</string>
|
||||
<string name="database_data_remove_unlinked_attachments_title">Κατάργηση αποσυνδεδεμένων δεδομένων</string>
|
||||
<string name="data">Δεδομένα</string>
|
||||
@@ -474,13 +470,13 @@
|
||||
<string name="autofill_read_only_save">Δεν επιτρέπεται η αποθήκευση δεδομένων για μια βάση δεδομένων που ανοίγει ως μόνο για ανάγνωση.</string>
|
||||
<string name="autofill_ask_to_save_data_summary">Ζητήστε αποθήκευση δεδομένων όταν ολοκληρωθεί η συμπλήρωση μιας φόρμας</string>
|
||||
<string name="autofill_ask_to_save_data_title">Ζητήστε να αποθηκεύσετε δεδομένα</string>
|
||||
<string name="autofill_save_search_info_summary">Προσπαθήστε να αποθηκεύσετε πληροφορίες αναζήτησης κατά την επιλογή χειροκίνητης καταχώρισης</string>
|
||||
<string name="autofill_save_search_info_summary">Προσπαθήστε να αποθηκεύσετε πληροφορίες αναζήτησης όταν κάνετε μια χειροκίνητη επιλογή καταχώρησης για ευκολότερες μελλοντικές χρήσεις</string>
|
||||
<string name="autofill_save_search_info_title">Αποθήκευση πληροφοριών αναζήτησης</string>
|
||||
<string name="autofill_close_database_summary">Κλείστε τη βάση δεδομένων μετά από μια επιλογή αυτόματης συμπλήρωσης</string>
|
||||
<string name="autofill_close_database_title">Κλείσιμο βάσης δεδομένων</string>
|
||||
<string name="keyboard_previous_lock_summary">Επιστρέψτε αυτόματα στο προηγούμενο πληκτρολόγιο μετά το κλείδωμα της βάσης δεδομένων</string>
|
||||
<string name="keyboard_previous_lock_title">Κλείδωμα βάσης δεδομένων</string>
|
||||
<string name="keyboard_save_search_info_summary">Μετά την κοινή χρήση ενός URL στο KeePassDX , όταν έχει επιλεγεί μια καταχώρηση, προσπαθήστε να θυμηθείτε αυτήν την καταχώρηση για περαιτέρω χρήσεις</string>
|
||||
<string name="keyboard_save_search_info_summary">Προσπαθήστε να αποθηκεύσετε τις κοινές πληροφορίες όταν κάνετε μια χειροκίνητη επιλογή καταχώρισης για ευκολότερες μελλοντικές χρήσεις</string>
|
||||
<string name="keyboard_save_search_info_title">Αποθήκευση κοινόχρηστων πληροφοριών</string>
|
||||
<string name="notification">Ειδοποίηση</string>
|
||||
<string name="biometric_security_update_required">Απαιτείται ενημέρωση βιομετρικής ασφάλειας.</string>
|
||||
@@ -492,7 +488,7 @@
|
||||
<string name="error_registration_read_only">Η αποθήκευση ενός νέου αντικειμένου δεν επιτρέπεται σε μια βάση δεδομένων μόνο για ανάγνωση</string>
|
||||
<string name="error_field_name_already_exists">Το όνομα πεδίου υπάρχει ήδη.</string>
|
||||
<string name="advanced_unlock_prompt_store_credential_title">Προηγμένο ξεκλείδωμα αναγνώρισης</string>
|
||||
<string name="advanced_unlock_prompt_store_credential_message">Προειδοποίηση: Θα πρέπει να θυμάστε τον κύριο κωδικό πρόσβασης εάν χρησιμοποιείτε προηγμένο ξεκλείδωμα αναγνώρισης.</string>
|
||||
<string name="advanced_unlock_prompt_store_credential_message">Πρέπει ακόμα να θυμάστε τα κύρια διαπιστευτήριά σας εάν χρησιμοποιείτε σύνθετη αναγνώριση ξεκλειδώματος.</string>
|
||||
<string name="advanced_unlock_prompt_extract_credential_title">Ανοίξτε τη βάση δεδομένων με προηγμένο ξεκλείδωμα αναγνώρισης</string>
|
||||
<string name="open_advanced_unlock_prompt_store_credential">Ανοίξτε τη προηγμένη προτροπή ξεκλειδώματος για αποθήκευση διαπιστευτηρίων</string>
|
||||
<string name="open_advanced_unlock_prompt_unlock_database">Ανοίξτε τη προηγμένη προτροπή ξεκλειδώματος για να ξεκλειδώσετε τη βάση δεδομένων</string>
|
||||
@@ -626,4 +622,27 @@
|
||||
<string name="regex">Κοινή έκφραση</string>
|
||||
<string name="menu_save_copy_to">Αποθήκευση αντιγράφου στο …</string>
|
||||
<string name="expired">Ληγμένο</string>
|
||||
<string name="warning_database_already_opened">Μια βάση δεδομένων είναι ήδη ανοιχτή, κλείστε την πρώτα για να ανοίξετε τη νέα</string>
|
||||
<string name="advanced_unlock_keystore_warning">Αυτή η δυνατότητα θα αποθηκεύσει κρυπτογραφημένα δεδομένα διαπιστευτηρίων στο ασφαλές KeyStore της συσκευής σας.
|
||||
\n
|
||||
\nΑνάλογα με την εγγενή υλοποίηση API του λειτουργικού συστήματος, ενδέχεται να μην είναι πλήρως λειτουργικό.
|
||||
\nΕλέγξτε τη συμβατότητα και την ασφάλεια του KeyStore με τον κατασκευαστή της συσκευής σας και τον δημιουργό της ROM που χρησιμοποιείτε.</string>
|
||||
<string name="passphrase">Συνθηματική φράση</string>
|
||||
<string name="colorize_password_summary">Χρωματίστε τους χαρακτήρες του κωδικού πρόσβασης ανά τύπο</string>
|
||||
<string name="keyboard_previous_search_title">Οθόνη αναζήτησης</string>
|
||||
<string name="keyboard_previous_search_summary">Αυτόματη εναλλαγή στο προηγούμενο πληκτρολόγιο στην οθόνη αναζήτησης</string>
|
||||
<string name="entropy">Εντροπία: %1$s bit</string>
|
||||
<string name="entropy_calculate">Εντροπία: Υπολογισμός…</string>
|
||||
<string name="title_case">Γράμματα Τίτλου</string>
|
||||
<string name="colorize_password_title">Χρωματίστε τους κωδικούς πρόσβασης</string>
|
||||
<string name="entropy_high">Εντροπία: Υψηλή</string>
|
||||
<string name="consider_chars_filter">Σκεφτείτε χαρακτήρες</string>
|
||||
<string name="exclude_ambiguous_chars">Εξαιρέστε διφορούμενους χαρακτήρες</string>
|
||||
<string name="content_description_passphrase_word_count">Πλήθος λέξεων συνθηματικής φράσης</string>
|
||||
<string name="at_least_one_char">Τουλάχιστον ένας χαρακτήρας από το καθένα</string>
|
||||
<string name="ignore_chars_filter">Αγνοήστε χαρακτήρες</string>
|
||||
<string name="lower_case">πεζά γράμματα</string>
|
||||
<string name="upper_case">ΚΕΦΑΛΑΙΑ ΓΡΑΜΜΑΤΑ</string>
|
||||
<string name="word_separator">Διαχωριστής</string>
|
||||
<string name="character_count">Αριθμός χαρακτήρων: %1$d</string>
|
||||
</resources>
|
||||
24
app/src/main/res/values-en-rGB/strings.xml
Normal file
24
app/src/main/res/values-en-rGB/strings.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="warning_password_encoding">Avoid password characters outside of text encoding format in database file (unrecognised chars are converted to the same letter).</string>
|
||||
<string name="keystore_not_accessible">The keystore is not properly initialised.</string>
|
||||
<string name="colorize_password_summary">Colourise password characters by type</string>
|
||||
<string name="content_description_entry_background_color">Entry background colour</string>
|
||||
<string name="invalid_db_sig">Could not recognise the database format.</string>
|
||||
<string name="advanced_unlock_not_recognized">Could not recognise advanced unlock print</string>
|
||||
<string name="advanced_unlock_prompt_not_initialized">Unable to initialise advanced unlock prompt.</string>
|
||||
<string name="download_initialization">Initialising…</string>
|
||||
<string name="download_finalization">Finalising…</string>
|
||||
<string name="download_canceled">Cancelled!</string>
|
||||
<string name="database_custom_color_title">Custom database colour</string>
|
||||
<string name="colorize_password_title">Colourise passwords</string>
|
||||
<string name="content_description_entry_foreground_color">Entry foreground colour</string>
|
||||
<string name="show_entry_colors_title">Entry colours</string>
|
||||
<string name="content_description_database_color">Database colour</string>
|
||||
<string name="show_entry_colors_summary">Displays foreground and background colours in an entry</string>
|
||||
<string name="education_new_node_summary">Entries help manage your digital identities.
|
||||
\n
|
||||
\nGroups (~folders) organise entries in your database.</string>
|
||||
<string name="error_otp_type">The existing OTP type is not recognised by this form, its validation may no longer correctly generate the token.</string>
|
||||
<string name="html_text_buy_pro">By buying the pro version, you will have access to this <strong>visual style</strong> and you will especially help <strong>the realisation of community projects.</strong></string>
|
||||
</resources>
|
||||
@@ -26,17 +26,17 @@
|
||||
<string name="add_entry">Añadir entrada</string>
|
||||
<string name="add_group">Añadir grupo</string>
|
||||
<string name="encryption_algorithm">Algoritmo de cifrado</string>
|
||||
<string name="app_timeout">Tiempo de espera excedido</string>
|
||||
<string name="app_timeout">Tiempo de espera superado</string>
|
||||
<string name="app_timeout_summary">Inactividad antes del bloqueo de aplicación</string>
|
||||
<string name="application">Aplicación</string>
|
||||
<string name="menu_app_settings">Configuración de la aplicación</string>
|
||||
<string name="brackets">Paréntesis</string>
|
||||
<string name="brackets">Corchete</string>
|
||||
<string name="file_manager_install_description">Se requiere un administrador de archivos que acepte la acciones de intención ACTION_CREATE_DOCUMENT y ACTION_OPEN_DOCUMENT para crear, abrir y guardar los archivos de la base de datos.</string>
|
||||
<string name="clipboard_cleared">Portapapeles limpiado</string>
|
||||
<string name="clipboard_cleared">Portapapeles vaciado</string>
|
||||
<string name="clipboard_timeout">Portapapeles caducado</string>
|
||||
<string name="clipboard_timeout_summary">Duración del almacenamiento en el portapapeles (si lo admite su dispositivo)</string>
|
||||
<string name="select_to_copy">Seleccionar para copiar %1$s en el portapapeles</string>
|
||||
<string name="retrieving_db_key">Recuperando la clave de la base de datos…</string>
|
||||
<string name="clipboard_timeout_summary">Duración del almacenaje en el portapapeles (si lo admite su dispositivo)</string>
|
||||
<string name="select_to_copy">Seleccionar para copiar %1$s al portapapeles</string>
|
||||
<string name="retrieving_db_key">Recuperando clave de BdD…</string>
|
||||
<string name="database">Base de datos</string>
|
||||
<string name="decrypting_db">Descifrando el contenido de la base de datos…</string>
|
||||
<string name="default_checkbox">Utilizar como base de datos por defecto</string>
|
||||
@@ -46,11 +46,11 @@
|
||||
<string name="select_database_file">Abrir base de datos existente</string>
|
||||
<string name="entry_accessed">Accedido</string>
|
||||
<string name="entry_cancel">Cancelar</string>
|
||||
<string name="entry_notes">Notas</string>
|
||||
<string name="entry_notes">Anotaciones</string>
|
||||
<string name="entry_confpassword">Confirmar contraseña</string>
|
||||
<string name="entry_created">Creado</string>
|
||||
<string name="entry_expires">Caduca</string>
|
||||
<string name="entry_keyfile">Archivo de clave</string>
|
||||
<string name="entry_keyfile">Cerrojo</string>
|
||||
<string name="entry_modified">Modificada</string>
|
||||
<string name="entry_password">Contraseña</string>
|
||||
<string name="save">Guardar</string>
|
||||
@@ -132,8 +132,8 @@
|
||||
<string name="extended_ASCII">ASCII extendido</string>
|
||||
<string name="allow">Permitir</string>
|
||||
<string name="clipboard_error_title">Error del portapapeles</string>
|
||||
<string name="clipboard_error">Algunos dispositivos no permiten que las aplicaciones usen el portapapeles.</string>
|
||||
<string name="clipboard_error_clear">No se pudo limpiar el portapapeles</string>
|
||||
<string name="clipboard_error">Algunos dispositivos no permiten que las aplicaciones utilicen el portapapeles.</string>
|
||||
<string name="clipboard_error_clear">No se pudo vaciar el portapapeles</string>
|
||||
<string name="error_string_key">Cada cadena debe tener un nombre de campo.</string>
|
||||
<string name="error_autofill_enable_service">El servicio de autocompletado no se ha podido habilitar.</string>
|
||||
<string name="field_name">Nombre del campo</string>
|
||||
@@ -310,18 +310,18 @@
|
||||
<string name="delete_entered_password_title">Eliminar contraseña</string>
|
||||
<string name="delete_entered_password_summary">Elimina la contraseña introducida tras un intento de conexión a una bse de datos</string>
|
||||
<string name="content_description_open_file">Abrir archivo</string>
|
||||
<string name="content_description_node_children">Nodos hijo</string>
|
||||
<string name="content_description_node_children">Nodo heredado</string>
|
||||
<string name="content_description_add_node">Añadir nodo</string>
|
||||
<string name="content_description_add_entry">Añadir entrada</string>
|
||||
<string name="content_description_add_entry">Añadir apunte</string>
|
||||
<string name="content_description_add_group">Añadir grupo</string>
|
||||
<string name="content_description_file_information">Información del archivo</string>
|
||||
<string name="content_description_password_checkbox">Casilla de verificación de la contraseña</string>
|
||||
<string name="content_description_keyfile_checkbox">Casilla de verificación del archivo de clave</string>
|
||||
<string name="content_description_entry_icon">Icono de entrada</string>
|
||||
<string name="content_description_file_information">Informe de archivo</string>
|
||||
<string name="content_description_password_checkbox">Casilla de contraseña</string>
|
||||
<string name="content_description_keyfile_checkbox">Casilla del cerrojo</string>
|
||||
<string name="content_description_entry_icon">Icono de apunte</string>
|
||||
<string name="entry_password_generator">Generador de contraseñas</string>
|
||||
<string name="content_description_password_length">Longitud de contraseña</string>
|
||||
<string name="entry_add_field">Añadir campo</string>
|
||||
<string name="content_description_remove_field">Eliminar el campo</string>
|
||||
<string name="content_description_remove_field">Retirar campo</string>
|
||||
<string name="entry_UUID">UUID</string>
|
||||
<string name="error_move_entry_here">No se puede mover una entrada aquí.</string>
|
||||
<string name="error_copy_entry_here">No puede copiar una entrada aquí.</string>
|
||||
@@ -342,7 +342,7 @@
|
||||
\n\"Protegido contra escritura\" evita cambios no deseados en la base de datos.
|
||||
\n\"Modificable\" le permite agregar, eliminar o modificar todos los elementos como desee.</string>
|
||||
<string name="lock_database_back_root_title">Presione \'Atrás\' para bloquear</string>
|
||||
<string name="content_description_repeat_toggle_password_visibility">Repetir la visibilidad de la contraseña</string>
|
||||
<string name="content_description_repeat_toggle_password_visibility">Repetir conmutación de visibilidad de contraseña</string>
|
||||
<string name="master_key">Clave maestra</string>
|
||||
<string name="security">Seguridad</string>
|
||||
<string name="entry_history">Historial</string>
|
||||
@@ -426,9 +426,9 @@
|
||||
<string name="auto_focus_search_title">Búsqueda rápida</string>
|
||||
<string name="menu_delete_entry_history">Eliminar el historial</string>
|
||||
<string name="error_otp_digits">El token debe contener de %1$d a %2$d dígitos.</string>
|
||||
<string name="entry_attachments">Archivos adjuntos</string>
|
||||
<string name="entry_add_attachment">Añadir el archivo adjunto</string>
|
||||
<string name="content_description_credentials_information">Información de credenciales</string>
|
||||
<string name="entry_attachments">Adjuntos</string>
|
||||
<string name="entry_add_attachment">Añadir adjunto</string>
|
||||
<string name="content_description_credentials_information">Informe de credenciales</string>
|
||||
<string name="database_opened">Base de datos abierta</string>
|
||||
<string name="education_add_attachment_title">Adjuntar</string>
|
||||
<string name="education_add_attachment_summary">Cargue un archivo adjunto a la entrada para guardar datos externos importantes.</string>
|
||||
@@ -461,7 +461,7 @@
|
||||
<string name="advanced_unlock_invalid_key">No se puede leer la clave de desbloqueo avanzada. Por favor, bórrela y repita el procedimiento de reconocimiento del desbloqueo.</string>
|
||||
<string name="advanced_unlock_prompt_extract_credential_message">Extraer la credencial de la base de datos con datos de desbloqueo avanzado</string>
|
||||
<string name="advanced_unlock_prompt_extract_credential_title">Abrir la base de datos con reconocimiento de desbloqueo avanzado</string>
|
||||
<string name="advanced_unlock_prompt_store_credential_message">Advertencia: Aún debes recordar tu contraseña maestra si usas el reconocimiento de desbloqueo avanzado.</string>
|
||||
<string name="advanced_unlock_prompt_store_credential_message">Aún debe recordar su contraseña maestra si emplea el reconocimiento de desbloqueo avanzado.</string>
|
||||
<string name="advanced_unlock_prompt_store_credential_title">Reconocimiento de desbloqueo avanzado</string>
|
||||
<string name="open_advanced_unlock_prompt_store_credential">Abrir el indicador de desbloqueo avanzado para almacenar las credenciales</string>
|
||||
<string name="open_advanced_unlock_prompt_unlock_database">Abrir el aviso de desbloqueo avanzado para desbloquear la base de datos</string>
|
||||
@@ -486,7 +486,6 @@
|
||||
<string name="settings_database_recommend_changing_master_key_summary">Recomendar cambiar la contraseña maestra (días)</string>
|
||||
<string name="notification">Notificación</string>
|
||||
<string name="hide_expired_entries_title">Ocultar las entradas expiradas</string>
|
||||
<string name="keyboard_search_share_title">Buscar información compartida</string>
|
||||
<string name="upload_attachment">Cargar %1$s</string>
|
||||
<string name="education_setup_OTP_summary">Configurar la gestión de contraseñas de un solo uso (HOTP / TOTP) para generar un token solicitado para la autenticación de dos factores (2FA).</string>
|
||||
<string name="education_setup_OTP_title">Establecer la contaseña de un solo uso</string>
|
||||
@@ -502,8 +501,6 @@
|
||||
<string name="autofill_ask_to_save_data_title">Pedir que se guarden los datos</string>
|
||||
<string name="autofill_save_search_info_summary">Intente guardar la información de la búsqueda cuando haga una selección de entrada manual</string>
|
||||
<string name="autofill_save_search_info_title">Guardar la información de la búsqueda</string>
|
||||
<string name="autofill_auto_search_summary">Sugerir automáticamente los resultados de la búsqueda desde el dominio web o el ID de la aplicación</string>
|
||||
<string name="autofill_auto_search_title">Búsqueda automática</string>
|
||||
<string name="autofill_close_database_summary">Cerrar la base de datos después de una selección de autocompletado</string>
|
||||
<string name="autofill_close_database_title">Cerrar la base de datos</string>
|
||||
<string name="enter">Entrar</string>
|
||||
@@ -518,9 +515,8 @@
|
||||
<string name="keyboard_previous_database_credentials_summary">Cambiar automáticamente al teclado anterior en la pantalla de credenciales de la base de datos</string>
|
||||
<string name="keyboard_previous_database_credentials_title">Pantalla de credenciales de la base de datos</string>
|
||||
<string name="keyboard_auto_go_action_title">Acción de la tecla automática</string>
|
||||
<string name="keyboard_save_search_info_summary">Luego de compartir un URL con KeePassDX, cuando se selecciona una entrada, intentar recordarla para futuros usos</string>
|
||||
<string name="keyboard_save_search_info_summary">Tras compartir informe a KeePassDX, cuando esté seleccionado un apunte, intente guardar el informe dentro del apunte para posibles futuros usos</string>
|
||||
<string name="keyboard_save_search_info_title">Guardar información compartida</string>
|
||||
<string name="keyboard_search_share_summary">Al compartir un URL con KeePassDX, filtrar las entradas utilizando el dominio de ese URL</string>
|
||||
<string name="show_uuid_summary">Muestra el UUID vinculado a una entrada o a un grupo</string>
|
||||
<string name="show_uuid_title">Mostrar UUID</string>
|
||||
<string name="error_rebuild_list">No es posible reconstruir adecuadamente la lista.</string>
|
||||
@@ -541,7 +537,7 @@
|
||||
<string name="error_duplicate_file">Los datos del archivo ya existen.</string>
|
||||
<string name="error_upload_file">Se produjo un error al cargar los datos del archivo.</string>
|
||||
<string name="description_app_properties">Propiedades de KeePassDX para gestionar la configuración de la aplicación</string>
|
||||
<string name="content_description_otp_information">Información de contraseña de un solo uso</string>
|
||||
<string name="content_description_otp_information">Informe de contraseña de un solo uso</string>
|
||||
<string name="icon_section_custom">Personalizado</string>
|
||||
<string name="icon_section_standard">Estándar</string>
|
||||
<string name="style_brightness_summary">Seleccionar temas oscuros o claros</string>
|
||||
@@ -604,8 +600,8 @@
|
||||
<string name="warning_exact_alarm">No ha permitido que la app use una alarma exacta. Como resultado, las funciones que requieren un temporizador no se harán con una hora exacta.</string>
|
||||
<string name="permission">Permiso</string>
|
||||
<string name="content_description_database_color">Color de la base de datos</string>
|
||||
<string name="content_description_entry_foreground_color">Color de primer plano de la entrada</string>
|
||||
<string name="content_description_entry_background_color">Color de fondo de la entrada</string>
|
||||
<string name="content_description_entry_foreground_color">Color de primer plano del apunte</string>
|
||||
<string name="content_description_entry_background_color">Color de fondo del apunte</string>
|
||||
<string name="tags">Etiquetas</string>
|
||||
<string name="warning_database_info_reloaded">La recarga de la base de datos borrará los datos modificados localmente.</string>
|
||||
<string name="warning_keyfile_integrity">El hash del archivo no está garantizado porque Android puede cambiar sus datos sobre la marcha. Cambia la extensión del archivo a .bin para una correcta integridad.</string>
|
||||
@@ -628,4 +624,27 @@
|
||||
<string name="menu_save_copy_to">Guardar una copia en …</string>
|
||||
<string name="inherited">Heredar</string>
|
||||
<string name="expired">Caducada</string>
|
||||
<string name="colorize_password_summary">Colorear caracteres de contraseña por el tipo</string>
|
||||
<string name="warning_database_already_opened">Ya hay abierta una base de datos, cierrela antes de abrir otra</string>
|
||||
<string name="exclude_ambiguous_chars">Excluya caracteres ambiguos</string>
|
||||
<string name="consider_chars_filter">Considere caracteres</string>
|
||||
<string name="entropy_calculate">Entropía: calcular…</string>
|
||||
<string name="word_separator">Separador</string>
|
||||
<string name="advanced_unlock_keystore_warning">Esta característica almacenará credenciales cifradas en el almacenaje seguro KeyStore de su dispositivo.
|
||||
\n
|
||||
\nDependiendo de la implementación del API nativo del sistema operativo, tal vez no sea completamente funcional.
|
||||
\nCompruebe la compatibilidad y garantía del almacenaje KeyStore con el fabricante de su dispositivo y el creadas de la ROM que está utilizando.</string>
|
||||
<string name="content_description_passphrase_word_count">Conteo de palabras de contraseña-frase</string>
|
||||
<string name="passphrase">Contraseña frase</string>
|
||||
<string name="colorize_password_title">Colorear contraseñas</string>
|
||||
<string name="keyboard_previous_search_title">Pantalla de búsqueda</string>
|
||||
<string name="keyboard_previous_search_summary">Volver automáticamente al teclado anterior en la pantalla de búsqueda</string>
|
||||
<string name="entropy">Entropía: %1$s bit</string>
|
||||
<string name="entropy_high">Entropía: Alta</string>
|
||||
<string name="at_least_one_char">Al menos un carácter desde cada</string>
|
||||
<string name="ignore_chars_filter">Descartar caracteres</string>
|
||||
<string name="lower_case">minúsculas</string>
|
||||
<string name="upper_case">MAYÚSCULAS</string>
|
||||
<string name="title_case">Tipo Titular</string>
|
||||
<string name="character_count">Conteo de caracteres: %1$d</string>
|
||||
</resources>
|
||||
@@ -449,8 +449,6 @@
|
||||
<string name="discard">Abandonner</string>
|
||||
<string name="discard_changes">Abandonner les modifications \?</string>
|
||||
<string name="validate">Valider</string>
|
||||
<string name="autofill_auto_search_summary">Suggérer automatiquement des résultats de recherche à partir du domaine Web ou de l’identifiant de l’application</string>
|
||||
<string name="autofill_auto_search_title">Recherche automatique</string>
|
||||
<string name="lock_database_show_button_summary">Affiche le bouton de verrouillage dans l’interface utilisateur</string>
|
||||
<string name="lock_database_show_button_title">Afficher le bouton de verrouillage</string>
|
||||
<string name="autofill_preference_title">Paramètres de remplissage automatique</string>
|
||||
@@ -462,8 +460,6 @@
|
||||
<string name="autofill_web_domain_blocklist_title">Liste de blocage de domaine Web</string>
|
||||
<string name="autofill_application_id_blocklist_summary">Liste de blocage qui empêche le remplissage automatique des applications</string>
|
||||
<string name="autofill_application_id_blocklist_title">Liste de blocage d’application</string>
|
||||
<string name="keyboard_search_share_summary">Lorsqu\'une adresse web est partagée avec KeePassDX, filtrer automatiquement les entrées contenant le domaine</string>
|
||||
<string name="keyboard_search_share_title">Rechercher les informations partagées</string>
|
||||
<string name="filter">Filtre</string>
|
||||
<string name="subdomain_search_summary">Recherche des domaines Web avec des contraintes de sous-domaines</string>
|
||||
<string name="subdomain_search_title">Recherche de sous-domaine</string>
|
||||
@@ -490,13 +486,13 @@
|
||||
<string name="autofill_read_only_save">L’enregistrement des données n’est pas autorisé pour une base de données ouverte en lecture seule.</string>
|
||||
<string name="autofill_ask_to_save_data_summary">Demande de sauvegarde des données à la fin du remplissage d\'un formulaire</string>
|
||||
<string name="autofill_ask_to_save_data_title">Demander à enregistrer des données</string>
|
||||
<string name="autofill_save_search_info_summary">Essayer d’enregistrer les informations de recherche lors de la sélection manuelle d’une entrée</string>
|
||||
<string name="autofill_save_search_info_summary">Essaye d’enregistrer les informations de recherche lors de la sélection manuelle d’une entrée pour faciliter les utilisations futures</string>
|
||||
<string name="autofill_save_search_info_title">Enregistrer les infos de recherche</string>
|
||||
<string name="autofill_close_database_summary">Ferme la base de données après une sélection de remplissage automatique</string>
|
||||
<string name="autofill_close_database_title">Fermer la base de données</string>
|
||||
<string name="keyboard_previous_lock_summary">Revient automatiquement au clavier précédent après le verrouillage de la base de données</string>
|
||||
<string name="keyboard_previous_lock_title">Verrouiller la base de données</string>
|
||||
<string name="keyboard_save_search_info_summary">Essayer d’enregistrer l\'association entre une adresse web partagée à KeePassDX et l\'entrée sélectionnée manuellement</string>
|
||||
<string name="keyboard_save_search_info_summary">Essaye de sauvegarder les informations partagées lors de la sélection manuelle d\'une entrée pour faciliter les utilisations futures.</string>
|
||||
<string name="keyboard_save_search_info_title">Enregistrer les infos partagées</string>
|
||||
<string name="notification">Notification</string>
|
||||
<string name="biometric_security_update_required">Mise à jour de sécurité biométrique requise.</string>
|
||||
@@ -641,4 +637,22 @@
|
||||
\n
|
||||
\nSelon l\'implémentation de l\'API native du système d\'exploitation, il se peut qu\'elle ne soit pas entièrement fonctionnelle.
|
||||
\nVérifiez la compatibilité et la sécurité du KeyStore auprès du fabricant de votre appareil et du créateur de la ROM que vous utilisez.</string>
|
||||
<string name="content_description_passphrase_word_count">Nombre de mots</string>
|
||||
<string name="keyboard_previous_search_title">Écran de recherche</string>
|
||||
<string name="entropy">Entropie : %1$s bit</string>
|
||||
<string name="entropy_high">Entropie : Haute</string>
|
||||
<string name="at_least_one_char">Au moins un caractère de chaque</string>
|
||||
<string name="exclude_ambiguous_chars">Exclure les caractères ambigus</string>
|
||||
<string name="ignore_chars_filter">Ignorer les caractères</string>
|
||||
<string name="lower_case">minuscule</string>
|
||||
<string name="upper_case">MAJUSCULE</string>
|
||||
<string name="title_case">1ère Lettre Majuscule</string>
|
||||
<string name="keyboard_previous_search_summary">Retour automatique au clavier précédent sur l\'écran de recherche</string>
|
||||
<string name="colorize_password_title">Coloriser les mots de passe</string>
|
||||
<string name="entropy_calculate">Entropie : Calcule…</string>
|
||||
<string name="passphrase">Phrase de passe</string>
|
||||
<string name="colorize_password_summary">Coloriser les caractères du mot de passe par type</string>
|
||||
<string name="consider_chars_filter">Considérer les caractères</string>
|
||||
<string name="word_separator">Séparateur</string>
|
||||
<string name="character_count">Nombre de caractères : %1$d</string>
|
||||
</resources>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user