Compare commits
298 Commits
translatio
...
v1.13-r1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b0ad8c3587 | ||
![]() |
edb4907bf5 | ||
![]() |
a718c7ed7e | ||
![]() |
4f11789f26 | ||
![]() |
eb15861b13 | ||
![]() |
d04d455fbd | ||
![]() |
8a03ddb7f3 | ||
![]() |
d6ce2a32e9 | ||
![]() |
21f1c8404c | ||
![]() |
092b8689b8 | ||
![]() |
3d3ba45cb1 | ||
![]() |
b380100307 | ||
![]() |
4c5ddd59d8 | ||
![]() |
5ed183f318 | ||
![]() |
9c27fd3e78 | ||
![]() |
62c361feb0 | ||
![]() |
0ee2495528 | ||
![]() |
7dc635a625 | ||
![]() |
e15112c3b4 | ||
![]() |
1d85fffb18 | ||
![]() |
5e2f29e737 | ||
![]() |
89a09ea142 | ||
![]() |
628c0d2c19 | ||
![]() |
584feabe44 | ||
![]() |
ae2cfde897 | ||
![]() |
42c66670b8 | ||
![]() |
288539b902 | ||
![]() |
61fd32f121 | ||
![]() |
43108ec4a6 | ||
![]() |
51089c6b98 | ||
![]() |
cf18fcf91c | ||
![]() |
da0513c768 | ||
![]() |
37f520cdbe | ||
![]() |
c98572bee0 | ||
![]() |
b1774ffc4b | ||
![]() |
57aaa0c4cd | ||
![]() |
b961ae1b33 | ||
![]() |
5e418e2b1b | ||
![]() |
6d22a213f3 | ||
![]() |
a76addc43f | ||
![]() |
1d96217713 | ||
![]() |
d2b8fdcfff | ||
![]() |
426fbc2510 | ||
![]() |
e89a961c02 | ||
![]() |
766c29b7a9 | ||
![]() |
507b671448 | ||
![]() |
3118ffaeb5 | ||
![]() |
0abe29bd77 | ||
![]() |
f3a7831390 | ||
![]() |
37cd58f7ba | ||
![]() |
7dd80a8ef7 | ||
![]() |
c78636264b | ||
![]() |
035506a5a3 | ||
![]() |
4cf46ef062 | ||
![]() |
c7b8063171 | ||
![]() |
0a8b149c9a | ||
![]() |
9240a27791 | ||
![]() |
e90d5b903c | ||
![]() |
50b4a9f1b9 | ||
![]() |
9783c3b5fe | ||
![]() |
7a837e3237 | ||
![]() |
c8f6714373 | ||
![]() |
bc0313aa6a | ||
![]() |
0f98668bcd | ||
![]() |
c4206e58bf | ||
![]() |
630ededf3b | ||
![]() |
8d1195ac96 | ||
![]() |
df731ac1b3 | ||
![]() |
bd784fa13d | ||
![]() |
a6bc5e657c | ||
![]() |
56c4cdb321 | ||
![]() |
42a4a83c7d | ||
![]() |
fe3933e154 | ||
![]() |
3efe130ee8 | ||
![]() |
5808857749 | ||
![]() |
a7397c3316 | ||
![]() |
d12f936898 | ||
![]() |
67f7d74bb9 | ||
![]() |
b0d0f06073 | ||
![]() |
67ee571c27 | ||
![]() |
a360695271 | ||
![]() |
149857a516 | ||
![]() |
fb8ffb802f | ||
![]() |
e957073457 | ||
![]() |
da86b0f50b | ||
![]() |
0aa78ffd66 | ||
![]() |
ce0087af99 | ||
![]() |
576bfeecfe | ||
![]() |
c0e2f34b79 | ||
![]() |
84d0c32610 | ||
![]() |
40184dbd55 | ||
![]() |
2d17bdde19 | ||
![]() |
e2babde1fa | ||
![]() |
e1f26fb045 | ||
![]() |
adbbfa0ac1 | ||
![]() |
37a013135e | ||
![]() |
acc6ea7f85 | ||
![]() |
62f012713a | ||
![]() |
0d726c1789 | ||
![]() |
f162e868b9 | ||
![]() |
0a1f95653f | ||
![]() |
27451825c6 | ||
![]() |
bdd6f1033e | ||
![]() |
c0413f9b74 | ||
![]() |
59d6fc8fdb | ||
![]() |
c500245647 | ||
![]() |
026a263f10 | ||
![]() |
839e6d3cb4 | ||
![]() |
735f4caf89 | ||
![]() |
11af71ef82 | ||
![]() |
e09577d17f | ||
![]() |
c1dbf171f5 | ||
![]() |
4ca4ec10be | ||
![]() |
77fded4964 | ||
![]() |
578491b1c7 | ||
![]() |
eee3ffd861 | ||
![]() |
89696d7f0d | ||
![]() |
e5d28f0979 | ||
![]() |
0e581a66c5 | ||
![]() |
a202c76bf0 | ||
![]() |
c9936ab76b | ||
![]() |
7ac6f7ed51 | ||
![]() |
ceb31c54b1 | ||
![]() |
42d8be593e | ||
![]() |
313adb6c3e | ||
![]() |
668ba4cdee | ||
![]() |
a36bfa7ff5 | ||
![]() |
26c37bcd2a | ||
![]() |
1980f05a7c | ||
![]() |
dbf10ba9fb | ||
![]() |
4be18d8373 | ||
![]() |
831b290d81 | ||
![]() |
9d4c15f7bc | ||
![]() |
4c4afa792d | ||
![]() |
8e256ac94d | ||
![]() |
65ff09f866 | ||
![]() |
8e9c2824cf | ||
![]() |
92b8ff5c8d | ||
![]() |
223c3bfb8e | ||
![]() |
b4e03a8374 | ||
![]() |
fb2df35d37 | ||
![]() |
345dad5d04 | ||
![]() |
50d6598b02 | ||
![]() |
90f04b76f4 | ||
![]() |
8b4314c394 | ||
![]() |
17241bc422 | ||
![]() |
c4a73bf107 | ||
![]() |
e76f3999b6 | ||
![]() |
0567bfe645 | ||
![]() |
6043bdbc48 | ||
![]() |
4ba40ba24f | ||
![]() |
e2711b709d | ||
![]() |
4764b15e75 | ||
![]() |
1b389ef12e | ||
![]() |
b32c2dbc7e | ||
![]() |
f06937dab3 | ||
![]() |
14efce62ff | ||
![]() |
3c8b530e2e | ||
![]() |
9939e07b7d | ||
![]() |
ecf416febc | ||
![]() |
f949e6e389 | ||
![]() |
15bf08f5e6 | ||
![]() |
fa69f38ab1 | ||
![]() |
d3b06080eb | ||
![]() |
749ab330ff | ||
![]() |
677c6555e8 | ||
![]() |
c62f6ef139 | ||
![]() |
0c34625782 | ||
![]() |
e86fa6f9fa | ||
![]() |
e2e975f357 | ||
![]() |
8eaf6d3f88 | ||
![]() |
1cb036941e | ||
![]() |
a53ff37e89 | ||
![]() |
dc3ee35c8b | ||
![]() |
e05fe94650 | ||
![]() |
b0cb0b06a2 | ||
![]() |
a9fed1c203 | ||
![]() |
6d8407676d | ||
![]() |
1157716c9c | ||
![]() |
861615b7a4 | ||
![]() |
e12d11264e | ||
![]() |
6d7b4810da | ||
![]() |
585b747612 | ||
![]() |
55887e1a89 | ||
![]() |
39a7a1298a | ||
![]() |
90059c5ae6 | ||
![]() |
ad63179484 | ||
![]() |
6eaba9d3a8 | ||
![]() |
11ce68902c | ||
![]() |
70ca059e0f | ||
![]() |
6588f40007 | ||
![]() |
67aaba0656 | ||
![]() |
2d8eac4f12 | ||
![]() |
00d822ad4b | ||
![]() |
5cf15b26b9 | ||
![]() |
07f08a8851 | ||
![]() |
d2e0ae6394 | ||
![]() |
cbae7c38cf | ||
![]() |
15656109bc | ||
![]() |
93e415120a | ||
![]() |
c47e7c03f9 | ||
![]() |
125512d2c3 | ||
![]() |
65b0d31762 | ||
![]() |
9103529b64 | ||
![]() |
349952cb52 | ||
![]() |
305cf6b050 | ||
![]() |
78ff49a6d4 | ||
![]() |
9cd8996aeb | ||
![]() |
25232a4146 | ||
![]() |
5266d2f985 | ||
![]() |
ae35d5873a | ||
![]() |
fe9aaa0d29 | ||
![]() |
076bde7669 | ||
![]() |
592bee1ac1 | ||
![]() |
c9a7d56da4 | ||
![]() |
2157cc8e4a | ||
![]() |
2cd11ba50e | ||
![]() |
eddcedd00b | ||
![]() |
0d4fe11cfb | ||
![]() |
ecbf4e511d | ||
![]() |
16bbae832e | ||
![]() |
571da788d0 | ||
![]() |
f2eed5ece0 | ||
![]() |
2c5516310f | ||
![]() |
5550dffab8 | ||
![]() |
b9744dd6b5 | ||
![]() |
82fedb3526 | ||
![]() |
cc4f0a3dec | ||
![]() |
cdfa48d942 | ||
![]() |
c4edc871b3 | ||
![]() |
ed6d1d2aaf | ||
![]() |
b0f56dbb2c | ||
![]() |
c794efe899 | ||
![]() |
c2fb4f103d | ||
![]() |
18b192bc42 | ||
![]() |
522fc9816d | ||
![]() |
3be4fb8460 | ||
![]() |
7ca07814bb | ||
![]() |
aaea8ed956 | ||
![]() |
822ccdc349 | ||
![]() |
dbc1b9553a | ||
![]() |
04c5f08f5f | ||
![]() |
5c10385246 | ||
![]() |
90f9b6f414 | ||
![]() |
b555194d8e | ||
![]() |
0e7c4eced7 | ||
![]() |
816a40d0ec | ||
![]() |
75a819b7b4 | ||
![]() |
cf0e5be55c | ||
![]() |
492fb404fe | ||
![]() |
6453d215eb | ||
![]() |
35f13eff53 | ||
![]() |
fe2c5185eb | ||
![]() |
f1429c0d0d | ||
![]() |
d6e30b805d | ||
![]() |
e8aeaf71d4 | ||
![]() |
1500d635e9 | ||
![]() |
27798ea073 | ||
![]() |
891918269e | ||
![]() |
0cf8ec67da | ||
![]() |
217a3d107d | ||
![]() |
38a229cb78 | ||
![]() |
0598d49ba0 | ||
![]() |
f8f2dbc7f4 | ||
![]() |
7449d5dbb1 | ||
![]() |
a890b0f66e | ||
![]() |
1647ed455e | ||
![]() |
a383847d5b | ||
![]() |
3fb2a824cf | ||
![]() |
dd7579ce7c | ||
![]() |
49c51ceea4 | ||
![]() |
a5370793cb | ||
![]() |
6f72020607 | ||
![]() |
6a7c61ea3c | ||
![]() |
46c1854481 | ||
![]() |
72030a4749 | ||
![]() |
1c18884527 | ||
![]() |
1c5c695f4f | ||
![]() |
a1cef1ccda | ||
![]() |
4dfcbbf62a | ||
![]() |
d0e1a15673 | ||
![]() |
8fc9324be5 | ||
![]() |
4f4724804e | ||
![]() |
533d92509f | ||
![]() |
96960ef376 | ||
![]() |
46194317a8 | ||
![]() |
c4d6e18759 | ||
![]() |
ee41a600b1 | ||
![]() |
07562cc5a9 | ||
![]() |
0f5b411dc7 | ||
![]() |
7577e3064c | ||
![]() |
d33e1f266c | ||
![]() |
aeda21f163 | ||
![]() |
4d1142df4d | ||
![]() |
4c632d0c72 | ||
![]() |
deb3701ebf | ||
![]() |
980df2b3a7 | ||
![]() |
f001d1fa54 |
45
.github/workflows/build.yml
vendored
@@ -78,7 +78,7 @@ jobs:
|
|||||||
|
|
||||||
# - name: Build keepass2android (net)
|
# - name: Build keepass2android (net)
|
||||||
# run: |
|
# run: |
|
||||||
# make msbuild Flavor=Net
|
# make dotnetbuild Flavor=Net
|
||||||
|
|
||||||
# - name: Build APK (net)
|
# - name: Build APK (net)
|
||||||
# run: |
|
# run: |
|
||||||
@@ -96,7 +96,7 @@ jobs:
|
|||||||
|
|
||||||
# - name: Build keepass2android (nonet)
|
# - name: Build keepass2android (nonet)
|
||||||
# run: |
|
# run: |
|
||||||
# make msbuild Flavor=NoNet
|
# make dotnetbuild Flavor=NoNet
|
||||||
|
|
||||||
# - name: Build APK (nonet)
|
# - name: Build APK (nonet)
|
||||||
# run: |
|
# run: |
|
||||||
@@ -212,7 +212,7 @@ jobs:
|
|||||||
|
|
||||||
# - name: Build keepass2android (net)
|
# - name: Build keepass2android (net)
|
||||||
# run: |
|
# run: |
|
||||||
# make msbuild Flavor=Net
|
# make dotnetbuild Flavor=Net
|
||||||
|
|
||||||
# - name: Build APK (net)
|
# - name: Build APK (net)
|
||||||
# run: |
|
# run: |
|
||||||
@@ -230,7 +230,7 @@ jobs:
|
|||||||
|
|
||||||
# - name: Build keepass2android (nonet)
|
# - name: Build keepass2android (nonet)
|
||||||
# run: |
|
# run: |
|
||||||
# make msbuild Flavor=NoNet
|
# make dotnetbuild Flavor=NoNet
|
||||||
|
|
||||||
# - name: Build APK (nonet)
|
# - name: Build APK (nonet)
|
||||||
# run: |
|
# run: |
|
||||||
@@ -279,7 +279,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
minimum-size: 8GB
|
minimum-size: 8GB
|
||||||
|
|
||||||
- name: Add msbuild to PATH
|
- name: Add dotnetbuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v2
|
uses: microsoft/setup-msbuild@v2
|
||||||
# If we want to also have nmake, use this instead
|
# If we want to also have nmake, use this instead
|
||||||
#uses: ilammy/msvc-dev-cmd@v1
|
#uses: ilammy/msvc-dev-cmd@v1
|
||||||
@@ -309,30 +309,49 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
make java
|
make java
|
||||||
|
|
||||||
|
- name: Update dotnet workloads
|
||||||
|
run: |
|
||||||
|
dotnet workload update
|
||||||
|
|
||||||
|
- name: Select the manifest
|
||||||
|
run: |
|
||||||
|
make manifestlink Flavor=Net
|
||||||
|
|
||||||
- name: Install NuGet dependencies (net)
|
- name: Install NuGet dependencies (net)
|
||||||
run: make nuget Flavor=Net
|
run: make nuget Flavor=Net
|
||||||
|
|
||||||
- name: Build keepass2android (net)
|
- name: Build keepass2android (net)
|
||||||
run: |
|
run: |
|
||||||
make msbuild Flavor=Net
|
make dotnetbuild Flavor=Net
|
||||||
|
|
||||||
- name: Build APK (net)
|
- name: Build APK (net)
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
env:
|
||||||
|
DropboxAppKey: ${{ secrets.DROPBOX_APP_KEY }}
|
||||||
|
DropboxAppSecret: ${{ secrets.DROPBOX_APP_SECRET }}
|
||||||
|
DropboxAppFolderAppKey: ${{ secrets.DROPBOX_APP_FOLDER_APP_KEY }}
|
||||||
|
DropboxAppFolderAppSecret: ${{ secrets.DROPBOX_APP_FOLDER_APP_SECRET }}
|
||||||
run: |
|
run: |
|
||||||
make apk Flavor=Net
|
make apk Configuration=Release Flavor=Net
|
||||||
|
|
||||||
- name: Archive production artifacts (net)
|
- name: Archive production artifacts (net)
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: signed APK ('net' built on ${{ github.job }})
|
name: archive APK ('net' built on ${{ github.job }})
|
||||||
path: |
|
path: |
|
||||||
src/keepass2android/bin/*/*-Signed.apk
|
src/keepass2android-app/bin/Release/net8.0-android/publish/*.apk
|
||||||
|
|
||||||
|
- name: Select the manifest
|
||||||
|
run: |
|
||||||
|
make manifestlink Flavor=NoNet
|
||||||
|
|
||||||
- name: Install NuGet dependencies (nonet)
|
- name: Install NuGet dependencies (nonet)
|
||||||
run: make nuget Flavor=NoNet
|
run: make nuget Flavor=NoNet
|
||||||
|
|
||||||
- name: Build keepass2android (nonet)
|
- name: Build keepass2android (nonet)
|
||||||
run: |
|
run: |
|
||||||
make msbuild Flavor=NoNet
|
make dotnetbuild Flavor=NoNet
|
||||||
|
|
||||||
- name: Test Autofill
|
- name: Test Autofill
|
||||||
working-directory: ./src/Kp2aAutofillParser.Tests
|
working-directory: ./src/Kp2aAutofillParser.Tests
|
||||||
run: dotnet test
|
run: dotnet test
|
||||||
@@ -344,9 +363,7 @@ jobs:
|
|||||||
- name: Archive production artifacts (nonet)
|
- name: Archive production artifacts (nonet)
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: signed APK ('nonet' built on ${{ github.job }})
|
name: archive APK ('nonet' built on ${{ github.job }})
|
||||||
path: |
|
path: |
|
||||||
src/keepass2android/bin/*/*-Signed.apk
|
src/keepass2android-app/bin/Release/net8.0-android/publish/*.apk
|
||||||
|
|
||||||
- name: Perform "make distclean"
|
|
||||||
run: make distclean
|
|
||||||
|
147
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
name: Create keepass2android release
|
||||||
|
env:
|
||||||
|
NAME: 'Release'
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v1.*"
|
||||||
|
workflow_dispatch: # Allows manual triggering of the workflow
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build-release:
|
||||||
|
|
||||||
|
runs-on: windows-2022
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
flavor: [Net, NoNet]
|
||||||
|
target: [apk, apk_split]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Extract key store
|
||||||
|
env:
|
||||||
|
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
|
||||||
|
KeyStore: "${{ github.workspace }}/kp2a.keystore"
|
||||||
|
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo $KeyStore
|
||||||
|
echo $KEYSTORE_BASE64 | base64 --decode > $KeyStore
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v3
|
||||||
|
|
||||||
|
- name: Cache NuGet packages
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.nuget/packages
|
||||||
|
key: ${{ runner.os }}-nuget-${{ hashFiles('src/**/*.csproj', 'src/**/packages.config') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-nuget-
|
||||||
|
|
||||||
|
# Workaround an issue when building on windows-2022. Error was
|
||||||
|
# D8 : OpenJDK 64-Bit Server VM warning : INFO: os::commit_memory(0x00000000ae400000, 330301440, 0) failed; error='The paging file is too small for this operation to complete' (DOS error/errno=1455) [D:\a\keepass2android\keepass2android\src\keepass2android\keepass2android-app.csproj]
|
||||||
|
# C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.D8.targets(81,5): error MSB6006: "java.exe" exited with code 1. [D:\a\keepass2android\keepass2android\src\keepass2android\keepass2android-app.csproj]
|
||||||
|
- name: Configure Pagefile
|
||||||
|
uses: al-cheb/configure-pagefile-action@a3b6ebd6b634da88790d9c58d4b37a7f4a7b8708 # v1.4
|
||||||
|
with:
|
||||||
|
minimum-size: 8GB
|
||||||
|
|
||||||
|
- name: Add msbuild/dotnet to PATH
|
||||||
|
uses: microsoft/setup-msbuild@v2
|
||||||
|
# If we want to also have nmake, use this instead
|
||||||
|
#uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
|
||||||
|
- name: Switch to JDK-17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
|
- name: Display java version
|
||||||
|
run: java -version
|
||||||
|
|
||||||
|
- name: Build native dependencies
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
make native
|
||||||
|
|
||||||
|
- name: Build java dependencies
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
make java
|
||||||
|
|
||||||
|
- name: List apks
|
||||||
|
run: find . -type f -name "*.apk"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Update dotnet workloads
|
||||||
|
run: |
|
||||||
|
dotnet workload update
|
||||||
|
|
||||||
|
- name: List apks
|
||||||
|
run: find . -type f -name "*.apk"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
|
||||||
|
- name: Select the manifest
|
||||||
|
run: |
|
||||||
|
make manifestlink Flavor=${{ matrix.flavor }}
|
||||||
|
|
||||||
|
- name: List apks
|
||||||
|
run: find . -type f -name "*.apk"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
|
||||||
|
- name: Install NuGet dependencies
|
||||||
|
run: make nuget Flavor=${{ matrix.flavor }}
|
||||||
|
|
||||||
|
- name: List apks
|
||||||
|
run: find . -type f -name "*.apk"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Build APK (net)
|
||||||
|
env:
|
||||||
|
KeyStore: "${{ github.workspace }}/kp2a.keystore"
|
||||||
|
MyAndroidSigningStorePass: ${{ secrets.KEY_STORE_PASSWORD }}
|
||||||
|
MyAndroidSigningKeyPass: ${{ secrets.KEY_PASSWORD }}
|
||||||
|
DropboxAppKey: ${{ secrets.DROPBOX_APP_KEY }}
|
||||||
|
DropboxAppSecret: ${{ secrets.DROPBOX_APP_SECRET }}
|
||||||
|
DropboxAppFolderAppKey: ${{ secrets.DROPBOX_APP_FOLDER_APP_KEY }}
|
||||||
|
DropboxAppFolderAppSecret: ${{ secrets.DROPBOX_APP_FOLDER_APP_SECRET }}
|
||||||
|
|
||||||
|
run: |
|
||||||
|
make ${{ matrix.target }} Configuration=Release Flavor=${{ matrix.flavor }}
|
||||||
|
|
||||||
|
- name: List apks
|
||||||
|
run: find . -type f -name "*.apk"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Archive production artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: keepass2android_${{ matrix.target }}_${{ matrix.flavor }}
|
||||||
|
# the first line is for "apk" target, the second line is for "apk_split" target
|
||||||
|
path: |
|
||||||
|
src/keepass2android-app/bin/Release/net8.0-android/publish/*.apk
|
||||||
|
src/keepass2android-app/bin/Release/net8.0-android/*/publish/*.apk
|
||||||
|
|
||||||
|
- name: List apks
|
||||||
|
run: find . -type f -name "*.apk"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Upload APK to GitHub Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
draft: true
|
||||||
|
files: |
|
||||||
|
src/keepass2android-app/bin/Release/net8.0-android/publish/*.apk
|
||||||
|
src/keepass2android-app/bin/Release/net8.0-android/*/publish/*.apk
|
2
.gitignore
vendored
@@ -64,7 +64,7 @@ Thumbs.db
|
|||||||
/src/java/android-filechooser/code/projectzip/project.zip
|
/src/java/android-filechooser/code/projectzip/project.zip
|
||||||
/src/java/android-filechooser/code/unused.txt
|
/src/java/android-filechooser/code/unused.txt
|
||||||
|
|
||||||
/src/Kp2aBusinessLogic/Io/DropboxFileStorageKeys.cs
|
/src/Kp2aBusinessLogic/Io/DropboxFileStorage.g.cs
|
||||||
|
|
||||||
/src/java/workspace/DriveTest
|
/src/java/workspace/DriveTest
|
||||||
|
|
||||||
|
90
Makefile
@@ -4,10 +4,10 @@
|
|||||||
# This Makefile can be used on both unix-like (use make) & windows (with GNU make)
|
# This Makefile can be used on both unix-like (use make) & windows (with GNU make)
|
||||||
#
|
#
|
||||||
# append the Configuration variable to 'make' call with value to use in '/p:Configuration='
|
# append the Configuration variable to 'make' call with value to use in '/p:Configuration='
|
||||||
# of msbuild command.
|
# of dotnetbuild command.
|
||||||
#
|
#
|
||||||
# append the Flavor variable to 'make' call with value to use in '/p:Flavor='
|
# append the Flavor variable to 'make' call with value to use in '/p:Flavor='
|
||||||
# of msbuild command.
|
# of dotnetbuild command.
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
# make Configuration=Release Flavor=NoNet
|
# make Configuration=Release Flavor=NoNet
|
||||||
@@ -18,15 +18,16 @@
|
|||||||
# - native: build the native libs
|
# - native: build the native libs
|
||||||
# - java: build the java libs
|
# - java: build the java libs
|
||||||
# - nuget: restore NuGet packages
|
# - nuget: restore NuGet packages
|
||||||
# - msbuild: build the project
|
# - dotnetbuild: build the project
|
||||||
# - apk: same as all
|
# - apk: same as all
|
||||||
|
# - manifestlink: creates a symlink (to be used in building) to the AndroidManifest corresponding to the selected Flavor
|
||||||
#
|
#
|
||||||
# - distclean: run a 'git clean -xdff'. Remove everyhing that is not in the git tree.
|
# - distclean: run a 'git clean -xdff'. Remove everyhing that is not in the git tree.
|
||||||
# - clean: all clean_* targets below
|
# - clean: all clean_* targets below
|
||||||
# - clean_native: clean native lib
|
# - clean_native: clean native lib
|
||||||
# - clean_java: call clean target of java libs
|
# - clean_java: call clean target of java libs
|
||||||
# - clean_nuget: cleanup the 'nuget restore'
|
# - clean_nuget: cleanup the 'nuget restore'
|
||||||
# - clean_msbuild: call clean target of msbuild
|
# - clean_dotnet: call clean target of dotnetbuild
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@@ -59,45 +60,23 @@ $(info MAKESHELL: $(MAKESHELL))
|
|||||||
$(info SHELL: $(SHELL))
|
$(info SHELL: $(SHELL))
|
||||||
$(info )
|
$(info )
|
||||||
|
|
||||||
# On linux use xabuild, on Windows use MSBuild.exe, otherwise (macos?) use msbuild.
|
|
||||||
ifeq ($(detected_OS),Linux)
|
ifeq ($(detected_OS),Linux)
|
||||||
MSBUILD_binary := xabuild
|
DOTNET_binary := dotnet
|
||||||
MSBUILD := $(shell $(WHICH) $(MSBUILD_binary))
|
DOTNET := $(shell $(WHICH) $(DOTNET_binary))
|
||||||
else ifeq ($(detected_OS),Windows)
|
else ifeq ($(detected_OS),Windows)
|
||||||
MSBUILD_binary := MSBuild.exe
|
DOTNET_binary := dotnet
|
||||||
MSBUILD := $(shell $(WHICH) $(MSBUILD_binary) 2> nul)
|
DOTNET := $(shell $(WHICH) $(DOTNET_binary) 2> nul)
|
||||||
ifeq ($(MSBUILD),)
|
|
||||||
# Additional heuristic to find MSBUILD_BINARY on Windows
|
|
||||||
VSWHERE := "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
|
|
||||||
VSWHERE_CHECK := $(shell @echo off & $(VSWHERE) 2> nul || echo VSWHERE_NOT_FOUND)
|
|
||||||
ifneq ($(VSWHERE_CHECK),VSWHERE_NOT_FOUND)
|
|
||||||
MSBUILD := $(shell @echo off & $(VSWHERE) -latest -prerelease -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe)
|
|
||||||
VS_INSTALL_PATH := $(shell @echo off & $(VSWHERE) -property installationPath)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
else
|
else
|
||||||
MSBUILD_binary := msbuild
|
DOTNET_binary := dotnet
|
||||||
MSBUILD := $(shell $(WHICH) $(MSBUILD_binary))
|
DOTNET := $(shell $(WHICH) $(DOTNET_binary))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(MSBUILD),)
|
ifeq ($(DOTNET),)
|
||||||
$(info )
|
$(info )
|
||||||
$(info '$(MSBUILD_binary)' binary could not be found. Check it is in your PATH.)
|
$(info '$(DOTNET_binary)' binary could not be found. Check it is in your PATH.)
|
||||||
ifeq ($(detected_OS),Windows)
|
|
||||||
ifneq ($(VSWHERE_CHECK),VSWHERE_NOT_FOUND)
|
|
||||||
$(info )
|
|
||||||
$(info You may retry after running in the command prompt:)
|
|
||||||
$(info )
|
|
||||||
$(info "$(VS_INSTALL_PATH)\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64)
|
|
||||||
$(info )
|
|
||||||
$(info If this doesn't work, install/find the location of vcvarsall.bat)
|
|
||||||
$(info or install and add msbuild.exe to your PATH)
|
|
||||||
$(info )
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
$(error )
|
$(error )
|
||||||
endif
|
endif
|
||||||
$(info MSBUILD: $(MSBUILD))
|
$(info DOTNET: $(DOTNET))
|
||||||
$(info )
|
$(info )
|
||||||
|
|
||||||
ifeq ($(ANDROID_SDK_ROOT),)
|
ifeq ($(ANDROID_SDK_ROOT),)
|
||||||
@@ -116,7 +95,7 @@ endif
|
|||||||
$(info ANDROID_NDK_ROOT: $(ANDROID_NDK_ROOT))
|
$(info ANDROID_NDK_ROOT: $(ANDROID_NDK_ROOT))
|
||||||
|
|
||||||
ifneq ($(Configuration),)
|
ifneq ($(Configuration),)
|
||||||
MSBUILD_PARAM = -p:Configuration="$(Configuration)"
|
DOTNET_PARAM = -p:Configuration="$(Configuration)"
|
||||||
else
|
else
|
||||||
$(warning Configuration environment variable not set.)
|
$(warning Configuration environment variable not set.)
|
||||||
endif
|
endif
|
||||||
@@ -126,7 +105,7 @@ CREATE_MANIFEST_LINK :=
|
|||||||
|
|
||||||
MANIFEST_FILE :=
|
MANIFEST_FILE :=
|
||||||
ifneq ($(Flavor),)
|
ifneq ($(Flavor),)
|
||||||
MSBUILD_PARAM += -p:Flavor="$(Flavor)"
|
DOTNET_PARAM += -p:Flavor="$(Flavor)"
|
||||||
ifneq ($(Flavor),)
|
ifneq ($(Flavor),)
|
||||||
ifeq ($(Flavor),Debug)
|
ifeq ($(Flavor),Debug)
|
||||||
MANIFEST_FILE := AndroidManifest_debug.xml
|
MANIFEST_FILE := AndroidManifest_debug.xml
|
||||||
@@ -151,7 +130,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(KeyStore),)
|
ifneq ($(KeyStore),)
|
||||||
MSBUILD_PARAM += -p:AndroidKeyStore=True -p:AndroidSigningKeyStore="$(KeyStore)" -p:AndroidSigningStorePass=env:MyAndroidSigningStorePass -p:AndroidSigningKeyPass=env:MyAndroidSigningKeyPass -p:AndroidSigningKeyAlias="kp2a"
|
DOTNET_PARAM += -p:AndroidKeyStore=True -p:AndroidSigningKeyStore="$(KeyStore)" -p:AndroidSigningStorePass=env:MyAndroidSigningStorePass -p:AndroidSigningKeyPass=env:MyAndroidSigningKeyPass -p:AndroidSigningKeyAlias="kp2a"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(detected_OS),Windows)
|
ifeq ($(detected_OS),Windows)
|
||||||
@@ -175,7 +154,7 @@ endif
|
|||||||
# Recursive wildcard: https://stackoverflow.com/a/18258352
|
# Recursive wildcard: https://stackoverflow.com/a/18258352
|
||||||
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
|
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
|
||||||
|
|
||||||
$(info MSBUILD_PARAM: $(MSBUILD_PARAM))
|
$(info DOTNET_PARAM: $(DOTNET_PARAM))
|
||||||
$(info nuget path: $(shell $(WHICH) nuget))
|
$(info nuget path: $(shell $(WHICH) nuget))
|
||||||
$(info )
|
$(info )
|
||||||
|
|
||||||
@@ -253,7 +232,7 @@ OUTPUT_PluginQR = src/java/Keepass2AndroidPluginSDK2/app/build/outputs/aar/Keepa
|
|||||||
.PHONY: native $(NATIVE_COMPONENTS) clean_native $(NATIVE_CLEAN_TARGETS) \
|
.PHONY: native $(NATIVE_COMPONENTS) clean_native $(NATIVE_CLEAN_TARGETS) \
|
||||||
java $(JAVA_COMPONENTS) clean_java $(JAVA_CLEAN_TARGETS) \
|
java $(JAVA_COMPONENTS) clean_java $(JAVA_CLEAN_TARGETS) \
|
||||||
nuget clean_nuget \
|
nuget clean_nuget \
|
||||||
msbuild clean_msbuild \
|
dotnetbuild clean_dotnet \
|
||||||
apk all clean
|
apk all clean
|
||||||
|
|
||||||
all: apk
|
all: apk
|
||||||
@@ -302,7 +281,7 @@ ifeq ($(shell $(WHICH) nuget),)
|
|||||||
endif
|
endif
|
||||||
$(RMFILE) stamp.nuget_*
|
$(RMFILE) stamp.nuget_*
|
||||||
nuget restore src/KeePass.sln
|
nuget restore src/KeePass.sln
|
||||||
$(MSBUILD) src/KeePass.sln -t:restore $(MSBUILD_PARAM) -p:RestorePackagesConfig=true
|
$(DOTNET) restore src/KeePass.sln $(DOTNET_PARAM) -p:RestorePackagesConfig=true
|
||||||
@echo "" > stamp.nuget_$(Flavor)
|
@echo "" > stamp.nuget_$(Flavor)
|
||||||
|
|
||||||
manifestlink:
|
manifestlink:
|
||||||
@@ -311,20 +290,21 @@ manifestlink:
|
|||||||
$(CREATE_MANIFEST_LINK)
|
$(CREATE_MANIFEST_LINK)
|
||||||
|
|
||||||
#####
|
#####
|
||||||
src/Kp2aBusinessLogic/Io/DropboxFileStorageKeys.cs:
|
|
||||||
ifeq ($(detected_OS),Windows)
|
|
||||||
$(CP) src\Kp2aBusinessLogic\Io\DropboxFileStorageKeysDummy.cs src\Kp2aBusinessLogic\Io\DropboxFileStorageKeys.cs
|
|
||||||
else
|
|
||||||
$(CP) src/Kp2aBusinessLogic/Io/DropboxFileStorageKeysDummy.cs $@
|
|
||||||
endif
|
|
||||||
|
|
||||||
msbuild: manifestlink native java nuget src/Kp2aBusinessLogic/Io/DropboxFileStorageKeys.cs
|
dotnetbuild: manifestlink native java nuget
|
||||||
$(MSBUILD) src/KeePass.sln -target:keepass2android-app -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -p:BuildProjectReferences=true $(MSBUILD_PARAM) -p:Platform="Any CPU" -m
|
$(DOTNET) build src/KeePass.sln -target:keepass2android-app -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -p:BuildProjectReferences=true $(DOTNET_PARAM) -p:Platform="Any CPU" -m
|
||||||
|
|
||||||
apk: msbuild
|
apk: manifestlink native java nuget
|
||||||
$(MSBUILD) src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(MSBUILD_PARAM) -p:Platform=AnyCPU -m
|
$(DOTNET) publish src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(DOTNET_PARAM) -p:Platform=AnyCPU -m
|
||||||
|
|
||||||
build_all: msbuild
|
apk_split: manifestlink native java nuget
|
||||||
|
$(DOTNET) publish src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(DOTNET_PARAM) -p:Platform=AnyCPU -m -p:RuntimeIdentifier=android-arm
|
||||||
|
$(DOTNET) publish src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(DOTNET_PARAM) -p:Platform=AnyCPU -m -p:RuntimeIdentifier=android-arm64
|
||||||
|
$(DOTNET) publish src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(DOTNET_PARAM) -p:Platform=AnyCPU -m -p:RuntimeIdentifier=android-x86
|
||||||
|
$(DOTNET) publish src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(DOTNET_PARAM) -p:Platform=AnyCPU -m -p:RuntimeIdentifier=android-x64
|
||||||
|
src/build-scripts/rename-output-apks.sh src/keepass2android-app/bin/Release/net8.0-android/
|
||||||
|
|
||||||
|
build_all: dotnetbuild
|
||||||
|
|
||||||
##### Cleanup targets
|
##### Cleanup targets
|
||||||
|
|
||||||
@@ -368,10 +348,10 @@ else
|
|||||||
endif
|
endif
|
||||||
$(RMFILE) stamp.nuget_*
|
$(RMFILE) stamp.nuget_*
|
||||||
|
|
||||||
clean_msbuild:
|
clean_dotnet:
|
||||||
$(MSBUILD) src/KeePass.sln -target:clean $(MSBUILD_PARAM)
|
$(DOTNET) clean src/KeePass.sln $(DOTNET_PARAM)
|
||||||
|
|
||||||
clean: clean_native clean_java clean_nuget clean_msbuild
|
clean: clean_native clean_java clean_nuget clean_dotnet
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
ifneq ("$(wildcard ./allow_git_clean)","")
|
ifneq ("$(wildcard ./allow_git_clean)","")
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
files:
|
files:
|
||||||
- source: src/keepass2android/Resources/values/strings.xml
|
- source: src/keepass2android-app/Resources/values/strings.xml
|
||||||
translation: >-
|
translation: >-
|
||||||
/src/keepass2android/Resources/values-%two_letters_code%/%original_file_name%
|
/src/keepass2android-app/Resources/values-%two_letters_code%/%original_file_name%
|
||||||
translate_attributes: '0'
|
translate_attributes: '0'
|
||||||
content_segmentation: '0'
|
content_segmentation: '0'
|
||||||
languages_mapping:
|
languages_mapping:
|
||||||
|
@@ -1,5 +0,0 @@
|
|||||||
As of December 2017, Google does not accept the use of Accessibility services for anything except helping people with disabilities. This means that Keepass2Android can no longer provide the accessibility service based AutoFill feature. Otherwise, Google would remove Keepass2Android from Play Store.
|
|
||||||
|
|
||||||
If you want to continue using this feature, please [install the Accessibility service based AutoFill plugin](https://github.com/PhilippC/kp2a_accservice_autofill/releases/).
|
|
||||||
|
|
||||||
After installation, please enable the accessibility service "KP2A AutoFillPlugin" in the Android system settings. When trying to use the plugin for the first time, KP2A will ask you if the plugin may access the Keepass database. Please accept this to use the plugin.
|
|
@@ -1,18 +0,0 @@
|
|||||||
# Installing dictionaries
|
|
||||||
Keepass2Android will load dictionaries for your current language both from AnySoftKeyboard and from Hacker's keyboard.
|
|
||||||
* For AnySoftKeyboard dictionaries visit: [https://play.google.com/store/search?q=anysoftkeyboard+dictionary&c=apps](https://play.google.com/store/search?q=anysoftkeyboard+dictionary&c=apps)
|
|
||||||
* For Hacker's Keyboard dictionaries visit: [https://play.google.com/store/search?q=hacker%27s%20keyboard%20dictionary&c=apps](https://play.google.com/store/search?q=hacker%27s%20keyboard%20dictionary&c=apps)
|
|
||||||
|
|
||||||
# Automatic keyboard switching (requires ADB)
|
|
||||||
Starting with Keepass2Android 1.02-pre1, you can use the [KeyboardSwap Plugin](https://play.google.com/store/apps/details?id=keepass2android.plugin.keyboardswap2) to switch to the KP2A keyboard automatically instead of bringing up the Input method selection dialog (e.g. after using the Share URL feature). To setup the plugin please follow the instructions on [the PlayStore website](https://play.google.com/store/apps/details?id=keepass2android.plugin.keyboardswap2)
|
|
||||||
|
|
||||||
# Deprecated: Automatic keyboard switching on rooted devices
|
|
||||||
|
|
||||||
In order to automatically switch to the KP2A keyboard and back, you need to
|
|
||||||
* have a rooted device (per Android security policies)
|
|
||||||
* have at least KP2A version 0.9.3-pre2
|
|
||||||
* install the Secure Settings app with the "System+" module available in Secure Settings v. 1.3.4 and above. **Note:** This is no longer available for recent Android versions.
|
|
||||||
* Go to the KP2A keyboard settings. Enable auto-switch on rooted devices.
|
|
||||||
|
|
||||||
If you go to a website, select "Share URL" -> Keepass2Android, the keyboard should be switched as soon as you locate the entry or when it's found automatically.
|
|
||||||
|
|
@@ -1,239 +0,0 @@
|
|||||||
# How to build Keepass2Android
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
Keepass2Android is a Mono for Android app. This means that you need Xamarin's Mono for Android to build it. However, it also uses several components written in Java, so there are also Android-Studio projects involved. To make things even worse, parts of the keyboard and kdb-library are written in native code.
|
|
||||||
|
|
||||||
To build KP2A from scratch, you need:
|
|
||||||
- Xamarin's Mono for Android (also included in Visual Studio)
|
|
||||||
- Android SDK & NDK
|
|
||||||
|
|
||||||
Prior to building Keepass2Android, you need to build some of its components (from command line). Then you can build the full project either through Visual Studio, or through command line.
|
|
||||||
|
|
||||||
By using the command line, you can build on Windows, macOS or Linux.
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
|
|
||||||
### Common to all architectures
|
|
||||||
- Install Android SDK & NDK (either manually with Google's [sdkmanager](https://developer.android.com/studio/command-line/sdkmanager), or through Android Studio). Visual Studio also installs a version of it, but in the end the directory must be writable and in a path without spaces (see below) so as to be able to build the components.
|
|
||||||
- Fetch the main repository of Keepass2Android and all submodules
|
|
||||||
- Note that VisualStudio can do this for you, otherwise run:
|
|
||||||
- `git submodule init && git submodule update`
|
|
||||||
|
|
||||||
### On Windows or macOS
|
|
||||||
- Install Visual Studio (for example 2019) with Xamarin.Android (ie. with capability to build Android apps). This should provide the needed tools like
|
|
||||||
- Xamarin.Android
|
|
||||||
- MSBuild
|
|
||||||
- Java JDK
|
|
||||||
- If you plan to build also from the command line:
|
|
||||||
- Install the MSVC build tools of visual studio. They provide the `vcvarsall.bat` file which among other things adds MSBuild to the PATH.
|
|
||||||
- Install [NuGet](https://www.nuget.org/downloads) to build also with "make". Alternatively, on Windows, if you use [chocolatey](https://chocolatey.org), run as administrator:
|
|
||||||
- `choco install nuget.commandline`
|
|
||||||
- Check that you have access to 'GNU make'.
|
|
||||||
- On Windows, it is usually not available by default. But the Android NDK provides it. You can find it in `%ANDROID_NDK_ROOT%\prebuilt\windows-x86_64\bin\make.exe`. Alternatively, on Windows, if you use [chocolatey](https://chocolatey.org), run as administrator:
|
|
||||||
- `choco install make`
|
|
||||||
- On macOS, it is usually only installed if you have developer command line tools installed or if you use [homebrew](https://brew.sh) or [macports](https://www.macports.org/). As an alternative it may be available in the Android NDK at `%ANDROID_NDK_ROOT%/prebuilt/darwin-x86_64/bin/make`.
|
|
||||||
|
|
||||||
### On Linux
|
|
||||||
- Install Java's JDK
|
|
||||||
- On Debian, for example: `apt install default-jdk-headless`.
|
|
||||||
|
|
||||||
- Install [Mono](https://www.mono-project.com/)
|
|
||||||
- This should provide `msbuild` & `xabuild` binary
|
|
||||||
- On Debian, after having added the repo from above, install with `apt install -t <repo_name> mono-devel msbuild`. A value for `<repo_name>` could be `stable-buster` for example, depending on which one you chose. You could also install the `mono-complete` package if you prefer.
|
|
||||||
|
|
||||||
- Install Xamarin.Android
|
|
||||||
- ~~Option 1: Use the mono-project [CI builds](https://dev.azure.com/xamarin/public/_build/latest?definitionId=48&branchName=main&stageName=Linux)~~ **NOTE:** KP2A now requires Xamarin.Android v13, which is newer than the current CI build; until a more recent CI build is available, this option is unfortunately no longer viable.
|
|
||||||
- Option 2: [Build it from source](https://github.com/xamarin/xamarin-android/blob/master/Documentation/README.md#building-from-source)
|
|
||||||
|
|
||||||
- Install NuGet package of your distribution
|
|
||||||
- On Debian/Ubuntu: `apt install nuget`
|
|
||||||
|
|
||||||
- Install [libzip](https://libzip.org/) for your distribution for some Xamarin.Android versions
|
|
||||||
- This may not be relevant anymore: for example, with Xamarin.Android 11.4.99. this is not needed.
|
|
||||||
- Some versions of Xamarin may require `libzip4`. If you are in this case:
|
|
||||||
- On Debian/Ubuntu, install it with `apt install libzip4`.
|
|
||||||
- Other distributions ship only `libzip5`. As a dirty workaround, it's possible to symlink `libzip.so.5` to `libzip.so.4`. Luckily, it appears to be working. For example:
|
|
||||||
- `sudo ln -s /usr/lib/libzip.so.5 /usr/lib/libzip.so.4`
|
|
||||||
- or `sudo ln -s /usr/lib64/libzip.so.5 /usr/lib/libzip.so.4`
|
|
||||||
|
|
||||||
## Building the required components:
|
|
||||||
|
|
||||||
This is done on the command line and requires the Android SDK & NDK and Java JDK.
|
|
||||||
|
|
||||||
### On Windows
|
|
||||||
- Setup your environment:
|
|
||||||
- Set these environment variables for Android's SDK & NDK
|
|
||||||
- `ANDROID_HOME` (for example `set ANDROID_HOME=C:\PATH\TO\android-sdk`)
|
|
||||||
- `ANDROID_SDK_ROOT` (for example `set ANDROID_SDK_ROOT=C:\PATH\TO\android-sdk`)
|
|
||||||
- `ANDROID_NDK_ROOT` (for example `set ANDROID_NDK_ROOT=C:\PATH\TO\android-sdk\ndk\version`)
|
|
||||||
|
|
||||||
**Note:** Care must be taken when setting the above variables to **not** include a trailing backslash in the path. A trailing backslash may cause `make` to fail.
|
|
||||||
|
|
||||||
**Note**: If the path to the Android SDK contains spaces, you **must** do one of these:
|
|
||||||
- either put the Android SDK into a path without spaces.
|
|
||||||
- or create a symlink to that path which doesn't contain spaces. Attention: this requires **administrator** priveleges. For example:
|
|
||||||
|
|
||||||
```
|
|
||||||
IF NOT EXIST C:\Android ( MKDIR C:\Android ) &&
|
|
||||||
MKLINK /D C:\Android\android-sdk "C:\Program Files (x86)\Android\android-sdk"
|
|
||||||
```
|
|
||||||
This is because [Android NDK doesn't support being installed in a path with spaces](https://github.com/android/ndk/issues/1400).
|
|
||||||
|
|
||||||
**Note**: The Android SDK path will require to be writeable because during the build, some missing components might be downloaded & installed.
|
|
||||||
|
|
||||||
- If you have "GNU make" available on your windows system, you may build by using the Makefile. You can also find a `make` executable in `%ANDROID_NDK_ROOT%\prebuilt\windows-x86_64\bin\make.exe`. To use it, see the instructions for Linux/macOS. Basically, just run `make` or `mingw32-make` depending on which distribution of GNU make for windows you have installed.
|
|
||||||
|
|
||||||
- Otherwise proceed as below:
|
|
||||||
|
|
||||||
1. Build argon2
|
|
||||||
|
|
||||||
```
|
|
||||||
cd src/java/argon2
|
|
||||||
%ANDROID_NDK_ROOT%/ndk-build.cmd
|
|
||||||
```
|
|
||||||
1. Build the other java components
|
|
||||||
|
|
||||||
```
|
|
||||||
cd src/build-scripts
|
|
||||||
build-java.bat
|
|
||||||
```
|
|
||||||
|
|
||||||
`build-java.bat` will call `gradlew` for several Java modules.
|
|
||||||
|
|
||||||
**Notes:**
|
|
||||||
|
|
||||||
- For building the java parts, it is suggested to keep a short name (e.g. "c:\projects\keepass2android") for the root project directory. Otherwise the Windows path length limit might be hit when building.
|
|
||||||
- Before building the java parts, make sure you have set the ANDROID_HOME variable or create a local.properties file inside the directories with a gradlew file. It is recommended to use the same SDK location as that of the Xamarin build.
|
|
||||||
- On some environments, `make` can fail to properly use the detected `MSBUILD` tools. This seems to be due to long pathnames and/or spaces in pathnames. It may be required to explicitly set the `MSBUILD` path using 8.3 "short" path notation:
|
|
||||||
- Determine the location of `MSBUILD` (e.g. `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe`)
|
|
||||||
- [Generate the "short" path](https://superuser.com/a/728792) of that location (e.g.: `C:\PROGRA~1\MICROS~2\2022\COMMUN~1\MSBuild\Current\Bin\MSBuild.exe`)
|
|
||||||
- When running `make` specify the location of ``MSBUILD` explicitly (e.g.: `make MSBUILD="C:\PROGRA~1\MICROS~2\2022\COMMUN~1\MSBuild\Current\Bin\MSBuild.exe`
|
|
||||||
|
|
||||||
|
|
||||||
### On Linux/macOS
|
|
||||||
|
|
||||||
- Setup your environment:
|
|
||||||
- Set these environment variables for Android's SDK & NDK
|
|
||||||
- `ANDROID_HOME` (for example `export ANDROID_HOME=/path/to/android-sdk/`)
|
|
||||||
- `ANDROID_SDK_ROOT` (for example `export ANDROID_SDK_ROOT=/path/to/android-sdk/`)
|
|
||||||
- `ANDROID_NDK_ROOT` (for example `export ANDROID_NDK_ROOT=/path/to/android-sdk/ndk/version`)
|
|
||||||
|
|
||||||
- Update your PATH environment variable so that it can access `nuget`, `msbuild` or `xabuild` (for linux):
|
|
||||||
- On Linux:
|
|
||||||
- add `xabuild` to your path: `export PATH=/path/to/xamarin.android-oss/bin/Release/bin/:$PATH`
|
|
||||||
- On macOS:
|
|
||||||
- you may similarly need to add `msbuild` & `nuget` to your PATH.
|
|
||||||
|
|
||||||
- Start the build:
|
|
||||||
- This will use the Makefile at the root of the project (requires GNU make). To build everything (components & Keepass2Android APK) in a single command simply run:
|
|
||||||
|
|
||||||
```
|
|
||||||
make
|
|
||||||
```
|
|
||||||
|
|
||||||
- Otherwise, if you prefer to do step by step
|
|
||||||
|
|
||||||
1. Build argon2
|
|
||||||
|
|
||||||
```
|
|
||||||
make native
|
|
||||||
```
|
|
||||||
|
|
||||||
1. Build the other java components
|
|
||||||
|
|
||||||
```
|
|
||||||
make java
|
|
||||||
```
|
|
||||||
|
|
||||||
## Building Keepass2Android:
|
|
||||||
|
|
||||||
These are the basic steps to build Keepass2Android. You can also build Keepass2Android Offline. For this, configure the build by using the [Flavors](#Flavors).
|
|
||||||
|
|
||||||
### With Visual Studio
|
|
||||||
|
|
||||||
- On windows or on macOS open the src/KeePass.sln file with visual studio, and choose to build the project named 'keepass2android-app'
|
|
||||||
|
|
||||||
### Command Line
|
|
||||||
|
|
||||||
#### Windows, Macos & Linux
|
|
||||||
to build the APK, simply run:
|
|
||||||
|
|
||||||
```
|
|
||||||
make
|
|
||||||
```
|
|
||||||
|
|
||||||
or to skip building the APK:
|
|
||||||
|
|
||||||
```
|
|
||||||
make msbuild
|
|
||||||
```
|
|
||||||
|
|
||||||
## Where is the APK ?
|
|
||||||
The Apk can be installed on a device.
|
|
||||||
It is located in `src/keepass2android/bin/*/*-Signed.apk`
|
|
||||||
|
|
||||||
If you build with Visual Studio, the APK is not produced automatically. You need to perform some extra step. See the documentation of Visual Studio on how to proceed.
|
|
||||||
|
|
||||||
## Flavors
|
|
||||||
|
|
||||||
Keepass2Android is distributed in two flavors.
|
|
||||||
- Keepass2Android (aka `net`)
|
|
||||||
- Keepass2Android Offline (aka `nonet`)
|
|
||||||
|
|
||||||
The flavor is set through a MSBuild Property named "`Flavor`". The possible values are '`Net`' and '`NoNet`'.
|
|
||||||
|
|
||||||
The value of the Flavor property is used in 2 projects:
|
|
||||||
- `keepass2android-app` (in `src/keepass2android`)
|
|
||||||
- `Kp2aBusinessLogic` (in `src/keepass2android`)
|
|
||||||
|
|
||||||
Its value is set inside the `*.csproj` file (XML format) of each project in the `Project`/`PropertyGroup`/`Flavor` node.
|
|
||||||
By default its value is set to an empty string so that development is made with `AndroidManifest_debug.xml` on the '`net`' flavor.
|
|
||||||
|
|
||||||
This is the behaviour of the build system depending on the value of Flavor:
|
|
||||||
| Flavor | What is built | `AndroidManifest.xml` used |
|
|
||||||
| ----- | ----- | ----- |
|
|
||||||
| `` (empty string): This is the default value. | Keepass2Android | `AndroidManifest_debug.xml` |
|
|
||||||
| `Net` | Keepass2Android | `AndroidManifest_net.xml` |
|
|
||||||
| `NoNet` | Keepass2Android Offline | `AndroidManifest_nonet.xml` |
|
|
||||||
|
|
||||||
### Select/Change flavor:
|
|
||||||
|
|
||||||
When building, by default, the flavor is not set. So the value used is the value of the Flavor property in *.csproj file. This should result on doing a build of the 'net' flavor.
|
|
||||||
|
|
||||||
You can force the Flavor by setting the Flavor property.
|
|
||||||
|
|
||||||
Proceed this way:
|
|
||||||
|
|
||||||
#### Command line
|
|
||||||
|
|
||||||
##### Windows, Macos & Linux
|
|
||||||
|
|
||||||
To force building 'net' with `make`, run:
|
|
||||||
|
|
||||||
```
|
|
||||||
make Flavor=Net
|
|
||||||
```
|
|
||||||
|
|
||||||
To build 'nonet' with `make`, run:
|
|
||||||
|
|
||||||
```
|
|
||||||
make Flavor=NoNet
|
|
||||||
```
|
|
||||||
|
|
||||||
##### MSBuild
|
|
||||||
|
|
||||||
To build with MSBuild directly on the command line, set the flavor with `-p:Flavor=value` argument. For example:
|
|
||||||
|
|
||||||
```
|
|
||||||
MSBuild src/KeePass.sln ... -p:Flavor=NoNet
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Visual Studio
|
|
||||||
When building with Visual Studio, edit the `*.csproj` file (XML format) and set the value in the `Project`/`PropertyGroup`/`Flavor` node. This is needed only for the projects that use the flavors.
|
|
||||||
|
|
||||||
**Note:** When switching between flavors, be sure to clean the previous build before.
|
|
||||||
|
|
||||||
## Makefile
|
|
||||||
|
|
||||||
It is possible to override the project's default 'Flavor' (Net, NoNet) and 'Configuration' (Release, Debug) by passing it as argument to `make`. See the header of the Makefile to see what can be done.
|
|
@@ -1,118 +0,0 @@
|
|||||||
<div class="wikidoc">
|
|
||||||
<h1>Comparison of Keepass apps for Android</h1>
|
|
||||||
<p>This page was created to give you a short overview of the features of Keepass2Android vs. Keepass2Android Offline. As Keepass2Android is based on Keepassdroid (by Brian Pellin), there are quite a few similarities here, as well, so we added Keepass2Android
|
|
||||||
vs. Keepassdroid comparison as well. "Better" properties are highlighted in bold. The page was created in 12/2013. If any information is out of date, please leave a note in the comments section.</p>
|
|
||||||
<table>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<th> </th>
|
|
||||||
<th>
|
|
||||||
<h3>Keepass2Android</h3>
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<h3>Keepass2Android Offline</h3>
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<h3>Keepassdroid</h3>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Play Store link</strong></td>
|
|
||||||
<td><a href="https://play.google.com/store/apps/details?id=keepass2android.keepass2android">https://play.google.com/store/apps/details?id=keepass2android.keepass2android</a></td>
|
|
||||||
<td><a href="https://play.google.com/store/apps/details?id=keepass2android.keepass2android_nonet">https://play.google.com/store/apps/details?id=keepass2android.keepass2android_nonet</a></td>
|
|
||||||
<td><a href="https://play.google.com/store/apps/details?id=com.android.keepass">https://play.google.com/store/apps/details?id=com.android.keepass</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Technology</strong></td>
|
|
||||||
<td>Mono for Android, Java</td>
|
|
||||||
<td>Mono for Android, Java</td>
|
|
||||||
<td>Java</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Keepass 2.x (kdbx) support</strong></td>
|
|
||||||
<td><strong>write and read</strong></td>
|
|
||||||
<td><strong>write and read</strong></td>
|
|
||||||
<td>read (write in beta)</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Keepass 2.x feature support</strong></td>
|
|
||||||
<td><strong>Viewing and editing of tags, attachments, additional fields, TAN support</strong></td>
|
|
||||||
<td><strong>Viewing and editing of tags, attachments, additional fields, TAN support</strong></td>
|
|
||||||
<td>Edit standard fields only, no display/edit of attachments</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Keepass 1.x (kdb) support</strong></td>
|
|
||||||
<td>currently read-only</td>
|
|
||||||
<td>currently read-only</td>
|
|
||||||
<td><strong>yes</strong></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Storage locations</strong></td>
|
|
||||||
<td>SD Card,<strong> Cloud (Dropbox, Google Drive, OneDrive), Web (FTP/HTTP/HTTPS/WebDav), SFTP</strong></td>
|
|
||||||
<td>SD Card</td>
|
|
||||||
<td>SD Card</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>File choosers</strong></td>
|
|
||||||
<td><strong>Internal or third party</strong></td>
|
|
||||||
<td><strong>Internal or third party</strong></td>
|
|
||||||
<td>Third party</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Required permissions</strong></td>
|
|
||||||
<td>Internet, SD card, Manage accounts</td>
|
|
||||||
<td><strong>SD card</strong></td>
|
|
||||||
<td><strong>SD card</strong></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Android 4.x style</strong></td>
|
|
||||||
<td><strong>yes</strong></td>
|
|
||||||
<td><strong>yes</strong></td>
|
|
||||||
<td>no</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Database locking</strong></td>
|
|
||||||
<td><strong>QuickUnlock</strong> or full lock</td>
|
|
||||||
<td><strong>QuickUnlock</strong> or full lock</td>
|
|
||||||
<td>Full lock only</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Browser integration</strong></td>
|
|
||||||
<td><strong>yes</strong></td>
|
|
||||||
<td><strong>yes</strong></td>
|
|
||||||
<td>no</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Secure keyboard</strong></td>
|
|
||||||
<td><strong>yes</strong></td>
|
|
||||||
<td><strong>yes</strong></td>
|
|
||||||
<td>no</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Database unlocking</strong></td>
|
|
||||||
<td><strong>password, keyfile, One-Time-Passwords (supports Yubikey NEO with NFC), KeeChallenge</strong></td>
|
|
||||||
<td><strong>password, keyfile, One-Time-Passwords (supports Yubikey NEO with NFC), KeeChallenge</strong></td>
|
|
||||||
<td>password, keyfile</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Keepass plugin compatibility</strong></td>
|
|
||||||
<td><strong>Twofish Cipher, KeeChallenge, TrayTOTP, KeeOTP</strong></td>
|
|
||||||
<td><strong>Twofish Cipher, KeeChallenge, TrayTOTP, KeeOTP</strong></td>
|
|
||||||
<td>Twofish Cipher</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Extensible with plugins</strong></td>
|
|
||||||
<td><strong>yes</strong></td>
|
|
||||||
<td><strong>yes</strong></td>
|
|
||||||
<td>no</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Database export</strong></td>
|
|
||||||
<td><strong>yes</strong></td>
|
|
||||||
<td><strong>yes</strong></td>
|
|
||||||
<td>no</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<p> </p>
|
|
||||||
</div><div class="ClearBoth"></div>
|
|
@@ -1,125 +1 @@
|
|||||||
**Note:** This is an incomplete and preliminary documentation. More documentation will be added as requests come in or when the app is more feature stable.
|
This page has been moved to the [wiki](https://github.com/PhilippC/keepass2android/wiki/Documentation)
|
||||||
If you want, I'd be happy if you contribute texts for this place!
|
|
||||||
|
|
||||||
If you think something is missing in the documentation, please create an issue at https://github.com/PhilippC/keepass2android/issues
|
|
||||||
|
|
||||||
# What you should know and think about
|
|
||||||
If you store important information using Keepass2Android, you should know a little bit about what's going on:
|
|
||||||
* Keepass2Android stores your password in an encrypted file. It is *your responsibility* to backup this file regularly and safely.
|
|
||||||
* There is no way for anyone, including the app's author, to access the information stored in your password database without
|
|
||||||
* having the database file
|
|
||||||
* knowing the master password (and additional second factor if you chose one)
|
|
||||||
This means that **if you forget the master password, your database is lost**! So make sure you remember the password and retain any second factor method (if one is used).
|
|
||||||
* You might also want to think about:
|
|
||||||
* What happens if I have an accident? Should any trusted person be able to access my database?
|
|
||||||
* What happens if my phone gets lost or stolen? Do I know how to recover my database from a backup or the cloud?
|
|
||||||
|
|
||||||
|
|
||||||
# Getting started
|
|
||||||
|
|
||||||
## Opening an existing database
|
|
||||||
Many users are already using Keepass 2 on Windows and thus have their passwords stored in a Keepass database, typically a file with ending .kdbx. For opening such an existing database, there are two main options:
|
|
||||||
* You can open the file directly if it is located on a webserver or in the cloud. Use "Open Database" on the startscreen. By default, files from the cloud or servers are cached in the application's cache directory after loading them once. This allows to access your files even when you're offline.
|
|
||||||
* If you don't have your database stored on a webserver or in the cloud (or if you're using KP2A Offline) you need to copy your kdbx-Database to your phone. I suggest to use a sync tool like FolderSync. Such a tool copies your database to your local storage, so you always have it accessible. FolderSync can access your database if you have it on a network share or use any other common storage.
|
|
||||||
|
|
||||||
## Creating a new database
|
|
||||||
Select "Create new database" from the start screen. Tap the integrated help icons for more information. Note that by default, the database is created as a local file. Please consider making backups regularly or select a location in the cloud.
|
|
||||||
|
|
||||||
## Getting passwords into password fields
|
|
||||||
There are many ways how to enter the passwords from your database in the corresponding fields. By default, the clipboard as well as the KP2A keyboard are activated in the settings:
|
|
||||||
* The KP2A keyboard is the recommended way because it's safe against clipboard loggers: Whenever you select an entry, the KP2A keyboard notification will appear in the notification bar. Click it to activate the keyboard. (The first time you do this, you are required to enable the keyboard in the system settings. This must be done by the user for Android security reasons.) As soon as it's activated, you can tap a field where you want to enter data from the selected entry. The KP2A keyboard will come up. Click the KP2A key (on the bottom left) to select whether you want to enter Username/password etc. When you're done, click the Keyboard key (next to the KP2A key) to switch back to your favorite keyboard.
|
|
||||||
* You can enable the Keepass2Android Autofill service in the system's Autofill settings (Android 8+) which allows to fill data using Android's accessibility system. This works with many apps including Firefox browser but is not supported for Chrome (when writing this).
|
|
||||||
* The clipboard based approach can be used as well: Pull the notification bar down and select "Copy username/password to clipboard". Then long-tap the field where you want to paste the data. A small "paste" button should come up. Note, however, that information in the clipboard can be monitored by all apps on your device and clearing the clipboard is not always possible.
|
|
||||||
|
|
||||||
These options can be used in different workflows:
|
|
||||||
### Browser-based workflow
|
|
||||||
If you are browsing the web and need to enter crendentials for a webpage, a simple and powerful workflow is to use the "Share URL" option from the browser's menu. Then select Keepass2Android (or KP2A Offline). Open your database (if it's not already opened) and select the entry you want to enter (if KP2A did not already select the appropriate entry). Use the built-in keyboard or the clipboard to enter the password.
|
|
||||||
### Autofill service based workflow
|
|
||||||
If you have enabled the autofill service and open a (supported) app with a password field, a dropdown appears. Select "Fill with Keepass2Android" to select the appropriate entry. When you return to the app, the password and user field should be filled already.
|
|
||||||
### KP2A based workflow for websites
|
|
||||||
Open KP2A, open your database, select your entry (in this step, the notification bar items should show up already). Now click the URL link of the entry to open a browser window with the website. Use one of the methods described above to enter the credentials.
|
|
||||||
### KP2A Keyboard based workflow
|
|
||||||
When you are in a text field, you can use the Android icon in the notification bar to switch to the KP2A keyboard. Hit the KP2A key to select an icon. After it's selected, hit the KP2A key again to enter the desired field.
|
|
||||||
|
|
||||||
## Creating a new account
|
|
||||||
Assume you want to create an account on a website. If you do not have a database yet, see above. As soon as you have a database, you may proceed as follows:
|
|
||||||
* Go to the website you want to create the account for
|
|
||||||
* Select Share/Share URL from the browser's menu and tap "Keepass2Android"
|
|
||||||
* Log in to your database (if it's not already unlocked)
|
|
||||||
* You will see the search result screen with "No search results"
|
|
||||||
* Tap "Create entry for URL"
|
|
||||||
* Choose the desired group, then tap the "+"-button to add an entry.
|
|
||||||
* Tap the "..." button next to the password field to launch the password generator, create your password and then select "Accept"
|
|
||||||
* Enter a name for the entry
|
|
||||||
* Enter the username you want to use for the entry
|
|
||||||
* Tap "Save" on the top
|
|
||||||
* You should see notifications like "Entry is available through KP2A keyboard" and/or "Copy username/password to clipboard". If not, view the new entry by clicking it.
|
|
||||||
* Return back to the browser.
|
|
||||||
* Use the notifications to enter your new credentials. See "Getting passwords into the password fields" for more details.
|
|
||||||
* If the user name you entered is not available or valid, choose a different one but copy it to clipboard. After creating the account, don't forget to update the new entry.
|
|
||||||
|
|
||||||
# Keepass2Android vs Keepass2Android Offline vs Keepassdroid
|
|
||||||
What's the difference between these apps? There is a short comparison on [Comparison of Keepass apps for Android](Comparison-of-Keepass-apps-for-Android.md) to help you pick the best for you!
|
|
||||||
|
|
||||||
# Advanced topics
|
|
||||||
## YubiKey NEO support for One-Time-Passwords
|
|
||||||
Please see the [How to use Keepass2Android with YubiKey NEO](How-to-use-Keepass2Android-with-YubiKey-NEO.md) page.
|
|
||||||
|
|
||||||
## Advanced usage of the Keepass2Android keyboard
|
|
||||||
Please see the [Advanced usage of the Keepass2Android keyboard](Advanced-usage-of-the-Keepass2Android-keyboard.md) page.
|
|
||||||
|
|
||||||
## Using Keepass2Android like an authenticator app to generate Time-based One-Time-Passwords (TOTPs)
|
|
||||||
Please see [Generating TOTPs with Keepass2Android](Generating-TOTPs.md)
|
|
||||||
|
|
||||||
# FAQ
|
|
||||||
|
|
||||||
## Should I use the KP2A keyboard for entering passwords?
|
|
||||||
The KP2A keyboard is meant to quickly "paste" or "type" values from your database to any text fields by using the KP2A icon. The QUERTY keyboard is just for convenience (if you just have the KP2A keyboard activated and need to enter a few letters). However, every other (trustworthy) keyboard is ok as well to enter sensitive information: Keyboard's aren't unsafe in Android. Only the clipboard is. Thus, the KP2A keyboard allows to get information out of the database without using the clipboard.
|
|
||||||
**You can use any keyboard when you enter the main database password**
|
|
||||||
|
|
||||||
## Is it safe to store my kdbx file in the cloud?
|
|
||||||
While it may happen that someone gets access to your kdbx file in the cloud, there is still no need to worry: the purpose of encryption is to protect the data even in case someone gets the kdbx file! As long as you are using a safe master key, you're safe! [Key files](https://keepass.info/help/base/keys.html#keyfiles) can help with securing the database even more.
|
|
||||||
|
|
||||||
## Doesn't Keepass2Android create automatic backups?
|
|
||||||
Yes and no. Yes: Keepass2Android stores the last successfully opened file as a read-only backup locally on the phone (unless you disable this is in the settings). This should make sure that even if the file gets destroyed during a save operation or gets deleted by accident, you should always have a version that can be opened. (Don't mix this up with the internal file cache which is not meant as a backup and can easily be overwritten even with a corrupt file. This internal file cache is meant for providing writable access even when the original file is not reachable, e.g. when you're offline.)
|
|
||||||
No: The local backup has two shortcomings: It is only one backup and does not allow to revert to older versions. So if you deleted an entry from the database, it might be deleted in the local backup soon as well. The even more important shortcoming is that it is just a local backup. It won't help when your phone gets lost or broken. Please create additional backups on seperate storage!
|
|
||||||
|
|
||||||
## How do I backup the database?
|
|
||||||
If you have stored your database on the cloud, you might rely on your cloud storage providers backups. Make sure they allow you to revert to older revisions in case the file gets corrupted for some reason.
|
|
||||||
If you are working with a local database file, make sure you create regular backups. I suggest you have an aumotated mechanism, e.g. with FolderSync (Lite) which can copy local files from your device to other locations, e.g. your PC in a local network. You can also use USB or tools like MyPhoneExploror to transfer data to your PC. Or, you use a removable storage like an SD card which you keep in a safe place after making the backup.
|
|
||||||
In all cases, you need to verify that your backup is readable! It's even best to test this on another device (e.g. a PC), so you simulate the case that you may lose your phone.
|
|
||||||
|
|
||||||
## I can open my database with fingerprint, but don't remember my master password!
|
|
||||||
It's time for action! As soon as possible, select Settings - Database - Export and choose unencrypted XML (don't put this on the cloud but on a local file). Transfer this file to a PC and import it to a new kdbx file, e.g. with Keepass2. Choose a new master password and make sure you don't forget this password!
|
|
||||||
|
|
||||||
## How can I transfer data from one device to another?
|
|
||||||
* If you are about to get a new Android device, you should make sure you're not losing your passwords in the transition! The first thing you need to make sure is that you can access your .kdbx file (which stores the passwords) on the new device. If it is already stored in the cloud, you only need to make sure you know how to setup the cloud storage on the new device (it might require a password, so make sure you have access to that!).
|
|
||||||
* If the .kdbx-file is stored locally on the old device, make sure you have an up-to-date backup (see above). You can then transfer that backup copy to the new device. (Note: transferring via USB causes data corruption in some cases, use MyPhoneExplorer or similar tools to be sure this does not happen.)
|
|
||||||
* If you are securing your password database with a keyfile, also transfer this key file to the new device.
|
|
||||||
* If you are opening your database with a fingerprint, make sure you also know the master password because fingerprint will not be available immediately on the new device.
|
|
||||||
|
|
||||||
## Why is Keepass2Android's apk so big?
|
|
||||||
Please see [Keepass2Android Apk](Keepass2Android-Apk.md) for more information.
|
|
||||||
|
|
||||||
## I get a message "File is trashed" when reading or writing a file on Google Drive
|
|
||||||
This happens because ocaml-fuse (I guess you are on Linux and use that) moves files to trash and then creates a new one instead of correctly updating the file on Google Drive (each file has a unique ID which Keepass2Android uses). Fortunately, this was fixed: https://github.com/astrada/google-drive-ocamlfuse/issues/494. After activating this option, please select "Change database" in KP2A, tap ,"Open file" and browse to the file on Google Drive again. After that, the message should no longer pop up.
|
|
||||||
|
|
||||||
## I get a message "The name must not be empty: null" when opening from Google Drive
|
|
||||||
Please follow these steps:
|
|
||||||
|
|
||||||
* select "Change database" on the password screen, then "Open database" and browse to your file again
|
|
||||||
* go to Android app settings and disable all permissions for the KP2A app. Then try again to open the database file.
|
|
||||||
* reboot the device
|
|
||||||
|
|
||||||
(Before running the following steps, make sure you don't have local changes in your database which have not been synchronized with Google Drive (this can happen if you worked offline). If you have, please open the database from the local cache and go to settings - database settings - export database and make a backup copy of the data.)
|
|
||||||
|
|
||||||
* clear KP2A's app cache in the Android settings
|
|
||||||
* uninstall & reinstall
|
|
||||||
|
|
||||||
One of these has helped all users so far, but unfortunately it's not totally clear to me why different steps are required (or nothing for most users).
|
|
||||||
|
|
||||||
# For developers
|
|
||||||
If you are interested in adding new features, you have two options:
|
|
||||||
Either your features can be implemented as a plug-in. Please see [How to create a plug-in?](How-to-create-a-plug-in_.md) for more information. Or you add the features directly in the source code of the projects and create a pull request.
|
|
||||||
|
|
||||||
If you want to build Keepass2Android, check the [build guide](Build.readme.md).
|
|
@@ -1,53 +1 @@
|
|||||||
|
This page has been moved to the [wiki](https://github.com/PhilippC/keepass2android/wiki/Generating-TOTPs)
|
||||||
## TOTP in brief
|
|
||||||
TOTP stands for [Time-based One-Time Password algorithm](https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm) which is one of the most common way proposed by websites to do a [two-factor authentication (2FA)](https://en.wikipedia.org/wiki/Multi-factor_authentication).
|
|
||||||
|
|
||||||
On these websites, this option will often be mentioned in the 2FA configuration menu as things like "_use code generated by an application_", "_use [Google] Authenticator app_".
|
|
||||||
|
|
||||||
You're prompted to scan a QR code with the app, which essentially contains a code called "_seed_", usually with a form like "_AZER TYUI OPQS DFGH JKLM_", used to generate TOTPs. The seed can be also directly copied if there is no scanning option on the app.
|
|
||||||
|
|
||||||
Most common apps:
|
|
||||||
|
|
||||||
- Google Authenticator
|
|
||||||
- Authy
|
|
||||||
- Microsoft Authenticator
|
|
||||||
- FreeOTP
|
|
||||||
- LastPass Authenticator
|
|
||||||
|
|
||||||
## TOTP in KeePass and benefits
|
|
||||||
In KeePass (by Dominik Reichl) there is are several ways to enable this Authenticator app ability:
|
|
||||||
|
|
||||||
- built-in TOTP support: https://keepass.info/help/base/placeholders.html#otp
|
|
||||||
- [KeePassOTP plugin](https://keepass.info/plugins.html#kpotp)
|
|
||||||
- [KeeOtp plugin](https://keepass.info/plugins.html#keeotp)
|
|
||||||
- [KeeTrayTOTP plugin](https://keepass.info/plugins.html#keetraytotp) (note the name "_TrayTOTP_" on this one for later)
|
|
||||||
|
|
||||||
KeePassXC also supports TOTP: https://keepassxc.org/docs/KeePassXC_UserGuide#_adding_totp_to_an_entry
|
|
||||||
|
|
||||||
The greatest benefits are:
|
|
||||||
|
|
||||||
- the seed stays available contrary to the above apps (for which it's more or less hard to backup/restore/switch with another app)
|
|
||||||
- TOTPs are available wherever the KeePass database is available. But conceptually it's not really 2FA anymore (all things are stored in the same place).
|
|
||||||
|
|
||||||
The different implementations use different ways of storing the TOTP seed (or secret, or key) and optional settings (e.g. the length of the TOTP to generate) within an entry inside the kdbx database. Keepass2Android attempts to be able to read the different formats, but can only write one:
|
|
||||||
|
|
||||||
## TOTP in Keepass2Android
|
|
||||||
|
|
||||||
If you use any of the tools mentioned above, you can set up TOTP entries with them. Keepass2Android can read those entries and generate TOTPs if any of the following styles are used:
|
|
||||||
|
|
||||||
* Keepass2 style: used when there are TimeOtp-Secret(-XXX) fields in the entry
|
|
||||||
* KeeOtpPlugin style: used when there is an otp field containing a query string in the form of key=abc&step=X&size=Y (step and size are optional)
|
|
||||||
* KeeWebOtp/Key Uri Format style: used when entry contains a URL starting with otpauth://totp/, e.g. otpauth://totp/?secret=abc (https://github.com/google/google-authenticator/wiki/Key-Uri-Format)
|
|
||||||
* KeeTrayTotp style:
|
|
||||||
* requires a non-empty seed field (default key is "TOTP seed", can be changed in KP2A settings), value is base32 encoded data
|
|
||||||
* requires a non-empty settings field (default key is "TOTP Settings", can be changed as well), value is expected to be a csv-separated array with [Duration];Length(;TimeCorrectionURL). Length is either an integer value or "S" to indicate Steam encoding
|
|
||||||
|
|
||||||
In order to view the generated TOTP code in KP2A, open the corresponding entry. You can then
|
|
||||||
* use a dynamically generated field called "_TOTP_" containing the TOTP or
|
|
||||||
* use the "Copy TOTP" button on the system notification for the selected entry or
|
|
||||||
* switch to the KP2A keyboard and use the TOTP button to insert the TOTP value into the target app or browser
|
|
||||||
|
|
||||||
If you want to configure an entry to contain the TOTP fields, it is suggested to enter edit mode for the entry. Then click the "Configure TOTP" button. You can either enter the data manually or scan a QR code with the information.
|
|
||||||
|
|
||||||
### Spaces in otp field
|
|
||||||
Make sure that the URI doesn't contain spaces, otherwise KeePass2Android will fail to generate TOTPs as a space is an invalid character. If your URIs have spaces, check [this comment](https://github.com/PhilippC/keepass2android/issues/1248#issuecomment-628035961)._
|
|
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 87 KiB |
@@ -1,157 +0,0 @@
|
|||||||
# How to create a plug-in or connect from your app
|
|
||||||
|
|
||||||
Creating a plug-in for Keepass2Android or enabling your app to query credentials from Keepass2Android is pretty simple. Please follow the steps below to get started. In case you have any questions, please contact me.
|
|
||||||
|
|
||||||
## Preparations
|
|
||||||
First check out the source code and import the Keepass2AndroidPluginSDK from [https://github.com/PhilippC/keepass2android/tree/master/src/java/Keepass2AndroidPluginSDK2](https://github.com/PhilippC/keepass2android/tree/master/src/java/Keepass2AndroidPluginSDK2/) into your workspace. You should be able to build this library project.
|
|
||||||
|
|
||||||
Now add a reference to the PluginSDK library from your existing app or add a new plug-in app and then add the reference.
|
|
||||||
|
|
||||||
## Authorization
|
|
||||||
|
|
||||||
Keepass2Android stores very sensitive user data and therefore implements a plug-in authorization scheme based on broadcasts sent between the plug-in and the host app (=Keepass2Android or Keepass2Android Offline). Before your app/plug-in gets any information from KP2A, the user will have to grant your app/plug-in access to KP2A. As not every app/plug-in requires access to all information, you must specify which scopes are required by your app. The implemented scopes can be found in [https://github.com/PhilippC/keepass2android/tree/master/src/java/Keepass2AndroidPluginSDK2/src/keepass2android/pluginsdk/Strings.java](https://github.com/PhilippC/keepass2android/tree/master/src/java/Keepass2AndroidPluginSDK2/src/keepass2android/pluginsdk/Strings.java).
|
|
||||||
|
|
||||||
To tell Kp2a that you're a plug-in, you need to add a simple BroadcastReceiver like this:
|
|
||||||
|
|
||||||
```java
|
|
||||||
|
|
||||||
public class PluginAAccessReceiver extends keepass2android.pluginsdk.PluginAccessBroadcastReceiver
|
|
||||||
{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ArrayList<String> getScopes() {
|
|
||||||
ArrayList<String> scopes = new ArrayList<String>();
|
|
||||||
scopes.add(Strings.SCOPE_DATABASE_ACTIONS);
|
|
||||||
scopes.add(Strings.SCOPE_CURRENT_ENTRY);
|
|
||||||
return scopes;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Here, you define the method getScopes where the list of scopes is created which must be granted by the user. The actual logic of the authorization process is implemented by the base class in the sdk.
|
|
||||||
|
|
||||||
In order to make this broadcast receiver visible to KP2A, add the following lines (probably with the name adapted to your class name) in the AndroidManifest.xml:
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<receiver android:name="PluginAAccessReceiver" android:exported="true">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="keepass2android.ACTION_TRIGGER_REQUEST_ACCESS" />
|
|
||||||
<action android:name="keepass2android.ACTION_RECEIVE_ACCESS" />
|
|
||||||
<action android:name="keepass2android.ACTION_REVOKE_ACCESS" />
|
|
||||||
</intent-filter>
|
|
||||||
</receiver>
|
|
||||||
```
|
|
||||||
|
|
||||||
Please also add a few strings in your resource files (e.g. strings.xml) with the following keys:
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<string name="kp2aplugin_title">The Great PluginA</string>
|
|
||||||
<string name="kp2aplugin_shortdesc">Test plugin to demonstrate how plugins work</string>
|
|
||||||
<string name="kp2aplugin_author">[your name here](your-name-here)</string>
|
|
||||||
```
|
|
||||||
These strings will be displayed to the user when KP2A asks if access should be granted.
|
|
||||||
|
|
||||||
## Modifying the entry view
|
|
||||||
You can add menu options for the full entry or for individual fields of the entry when displayed to the user. This is done, for example, by the QR plugin ([https://play.google.com/store/apps/details?id=keepass2android.plugin.qr](https://play.google.com/store/apps/details?id=keepass2android.plugin.qr)).
|
|
||||||
In addition, it is even possible to add new fields or modify existing fields. Please see the sample plugin "PluginA" for a simple example on how to do this:
|
|
||||||
[https://github.com/PhilippC/keepass2android-sampleplugin/blob/main/src/keepass2android/plugina/PluginAAccessReceiver.java](https://github.com/PhilippC/keepass2android-sampleplugin/blob/main/src/keepass2android/plugina/PluginAAccessReceiver.java)
|
|
||||||
|
|
||||||
## Querying credentials
|
|
||||||
KP2A 0.9.4 adds a great opportunity for third party apps: Instead of prompting the user to enter credentials or a passphrase, the app should try to get the data from KP2A if it is installed: If the user grants (or previously granted) access for the app, KP2A will automatically retrieve the matching entry. User action is only required if the KP2A database is locked (user will usually unlock it with the short QuickUnlock code) or if no matching entry is found (user can then create a new entry or select an existing one. in the latter case KP2A will offer to add entry information so that the entry will be found automatically next time).
|
|
||||||
|
|
||||||
To implement this, simply follow the steps descrIbed above in the sections Preparation and Authorization. Then, wherever appropriate in your app, do something like this:
|
|
||||||
|
|
||||||
```java
|
|
||||||
try
|
|
||||||
{
|
|
||||||
PlaceholderFragment.this.startActivityForResult(
|
|
||||||
Kp2aControl.getQueryEntryIntentForOwnPackage(),
|
|
||||||
1);
|
|
||||||
}
|
|
||||||
catch (ActivityNotFoundException e)
|
|
||||||
{
|
|
||||||
Toast.makeText(
|
|
||||||
PlaceholderFragment.this.getActivity(),
|
|
||||||
"no KP2A host app found",
|
|
||||||
Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
(of course you can use `PacketManager` to check if the intent can be started instead of catching the `Exception`).
|
|
||||||
|
|
||||||
Instead of querying credentials associated with your own app, you might want to query other credentials as well. instead of `KpControl.getQueryEntryIntentForOwnPackage()` use
|
|
||||||
`Kp2aControl.getQueryEntryIntent("google.com")`
|
|
||||||
This requires \{"SCOPE_QUERY_CREDENTIALS (whereas getQueryEntryIntentForOwnPackage() requires SCOPE_QUERY_CREDENTIALS_FOR_OWN_PACKAGE)"\}.
|
|
||||||
|
|
||||||
The credential data can be retrieved in onActivityResult():
|
|
||||||
|
|
||||||
```java
|
|
||||||
if ((requestCode == 1) //queryEntry for own package
|
|
||||||
&& (resultCode == RESULT_OK)) // ensure user granted access and selected something
|
|
||||||
{
|
|
||||||
HashMap<String, String> credentials = Kp2aControl.getEntryFieldsFromIntent(data);
|
|
||||||
if (!credentials.isEmpty())
|
|
||||||
{
|
|
||||||
//here we go!
|
|
||||||
Toast.makeText(
|
|
||||||
getActivity(),
|
|
||||||
"retrieved credenitals! Username="+credentials.get(KeepassDefs.UserNameField),
|
|
||||||
Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that you get access to all strings (Title, Username, Password, URL, Notes + any user defined strings) in the entry. This may be in intersting in combination with the following section:
|
|
||||||
|
|
||||||
## Storing data in KP2A
|
|
||||||
If you allow the user to set up an account in your app or create a password, e.g. for encryption, please add an option to store this data in the Keepass2Android database, as this will lead to great workflows for the user. It's as simple as
|
|
||||||
|
|
||||||
```java
|
|
||||||
try {
|
|
||||||
HashMap<String, String> fields = new HashMap<String, String>();
|
|
||||||
//standard fields
|
|
||||||
fields.put(KeepassDefs.TitleField, "plugin A");
|
|
||||||
fields.put(KeepassDefs.UserNameField, "John Doe");
|
|
||||||
fields.put(KeepassDefs.PasswordField, "top secret");
|
|
||||||
//associate entry with our app. If we would require the URL field for a web URL,
|
|
||||||
//this string could be added in any other (e.g. a custom) field
|
|
||||||
fields.put(KeepassDefs.UrlField, "androidapp://"+getActivity().getPackageName());
|
|
||||||
//custom field:
|
|
||||||
fields.put(PLUGIN_A_PASSPHRASE, "some long text");
|
|
||||||
//mark custom field as protected (i.e. display masked, enable memory protection in Keepass2)
|
|
||||||
ArrayList<String> protectedFields = new ArrayList<String>();
|
|
||||||
protectedFields.add(PLUGIN_A_PASSPHRASE);
|
|
||||||
|
|
||||||
//add to KP2A
|
|
||||||
PlaceholderFragment.this.startActivityForResult(
|
|
||||||
Kp2aControl.getAddEntryIntent(fields, protectedFields),
|
|
||||||
2);
|
|
||||||
} catch (ActivityNotFoundException e) {
|
|
||||||
Toast.makeText(
|
|
||||||
PlaceholderFragment.this.getActivity(),
|
|
||||||
"no KP2A host app found",
|
|
||||||
Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that this does not even require access authorization because the user will actively save the entry anyways (after selecting the group where to create it.)
|
|
||||||
|
|
||||||
## Get information about database actions
|
|
||||||
With {"SCOPE_DATABASE_ACTIONS"}, you will be informed when the user opens, closes, locks or unlocks the database including the file name information.
|
|
||||||
|
|
||||||
PluginA uses this to simply display a toast message in its ActionReceiver:
|
|
||||||
|
|
||||||
```java
|
|
||||||
@Override
|
|
||||||
protected void dbAction(DatabaseAction db) {
|
|
||||||
|
|
||||||
Log.d("PluginA", db.getAction() + " in file " + db.getFileDisplayName() + " ("+db.getFilePath()+")");
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Sample plugin
|
|
||||||
Most example code from above is taken from the simple sample plugin "PluginA" as can be found on [https://keepass2android.codeplex.com/SourceControl/latest#src/java/PluginA/](https://keepass2android.codeplex.com/SourceControl/latest#src/java/PluginA/)
|
|
@@ -1,31 +0,0 @@
|
|||||||
<div class="wikidoc">
|
|
||||||
<h1>How to use Keepass2Android with YubiKey NEO</h1>
|
|
||||||
<p>Please refer to the documentation on the Keepass website (<a href="http://keepass.info/help/kb/yubikey.html">http://keepass.info/help/kb/yubikey.html</a>) or the Yubico website (<a href="http://www.yubico.com/applications/password-management/consumer/keepass/">http://www.yubico.com/applications/password-management/consumer/keepass/</a>)
|
|
||||||
on how to set up a Keepass 2 database with Yubikey/OTP protection.<br>
|
|
||||||
<br>
|
|
||||||
After successful setup you should have the database file, e.g. yubi.kdbx, and the OTP auxiliary file, e.g. yubi.otp.xml, both in the same folder.<br>
|
|
||||||
<a href="How to use Keepass2Android with YubiKey NEO_OTPAuxFile_2.png"><img title="OTPAuxFile" src="How to use Keepass2Android with YubiKey NEO_OTPAuxFile_thumb.png" alt="OTPAuxFile" width="513" height="40" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a></p>
|
|
||||||
<p>Make sure you make <strong>both files</strong> available to Keepass2Android, e.g. by placing them both in your Dropbox.</p>
|
|
||||||
<p>Now you should check your NDEF setup of the Yubikey NEO. Therefore, go to the Tools menu in the Yubico Personalization Utility. Select the same slot as used for OTPs with Keepass 2. The default setting for NDEF type and payload should work. If you experience
|
|
||||||
problems, you may use the configuration as shown in this screenshot or simply press the “Reset” button:</p>
|
|
||||||
<p><a href="How to use Keepass2Android with YubiKey NEO_image_2.png"><img title="image" src="How to use Keepass2Android with YubiKey NEO_image_thumb.png" alt="image" width="760" height="622" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a></p>
|
|
||||||
<p><br>
|
|
||||||
<br>
|
|
||||||
In Keepass2Android, select "Open file" and locate your database file, e.g. yubi.kdbx.<br>
|
|
||||||
<br>
|
|
||||||
In the password screen under "Select master key type" select "Password + OTP".</p>
|
|
||||||
<p><a href="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-38-50_2.png"><img title="Screenshot_2013-12-13-06-38-50" src="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-38-50_thumb.png" alt="Screenshot_2013-12-13-06-38-50" width="204" height="360" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a></p>
|
|
||||||
<p>Click "Load auxiliary OTP file". This is required to load the information how many OTPs must be entered. As loading the file might require user action in some cases, this is not performed automatically.<br>
|
|
||||||
<a href="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-38-12_2.png"><img title="Screenshot_2013-12-13-06-38-12" src="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-38-12_thumb.png" alt="Screenshot_2013-12-13-06-38-12" width="204" height="360" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a><br>
|
|
||||||
After loading the OTP auxiliary file, you should see a few text fields for entering the OTPs. Now swipe your YubiKey NEO at the back of your Android device. If you have multiple apps which can handle NFC actions, you might be prompted to select which app to
|
|
||||||
use. Select Keepass2Android in this case. Swipe your YubiKey again until all OTP fields are filled. Note: You don't need to select the next text field, this is done automatically!<br>
|
|
||||||
<a href="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-38-36_2.png"><img title="Screenshot_2013-12-13-06-38-36" src="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-38-36_thumb.png" alt="Screenshot_2013-12-13-06-38-36" width="204" height="360" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a><br>
|
|
||||||
Don't forget to also enter your password and click OK. You will see the “Saving auxiliary OTP file…” dialog. Note that there is some encryption envolved which is probably fast on your PC but might take some time on your mobile device. You
|
|
||||||
can reduce the look-ahead window length to speed this up.<br>
|
|
||||||
<a href="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-39-47_2.png"><img title="Screenshot_2013-12-13-06-39-47" src="How to use Keepass2Android with YubiKey NEO_Screenshot_2013-12-13-06-39-47_thumb.png" alt="Screenshot_2013-12-13-06-39-47" width="204" height="360" border="0" style="padding-top:0px; padding-left:0px; display:inline; padding-right:0px; border:0px"></a></p>
|
|
||||||
<h2> </h2>
|
|
||||||
<h2>A note about offline access</h2>
|
|
||||||
<p>If your database is stored in the cloud or on the web, you can still access it if you have enabled file caching (which is on by default). With OTPs, this becomes a little bit more complicated: If you repeatedly open your datbase while being offline, the
|
|
||||||
OTP counter stored on the Yubikey will be increased. Don’t forget to synchronize the database (which will also synchronize the OTP auxiliary file) as soon as possible to avoid problems with accessing your database on other devices! If you often need
|
|
||||||
to open the database while you’re offline, consider increasing the look-ahead window length!</p>
|
|
||||||
</div><div class="ClearBoth"></div>
|
|
@@ -1,25 +0,0 @@
|
|||||||
Keepass2Android's apk is pretty big, e.g. when comparing to Keepassdroid. The main difference is that Keepass2Android is built on Mono for Android. Mono is an open-source implementation of the Microsoft .Net Framework (installed on pretty much every Windows PC). On Windows, the .net framework requires several hundred MB (but only once, not for every application). On Android devices, Mono is not installed globally. Instead, it is packaged into every app. The more features from Mono are required, the bigger the package becomes.
|
|
||||||
|
|
||||||
Here's a list of what is contained in the Keepass2Android 0.9.1 application package:
|
|
||||||
|
|
||||||
```
|
|
||||||
Mono for Android
|
|
||||||
.net dlls 5.0 MB
|
|
||||||
Runtime 2.5 MB
|
|
||||||
Google libraries 0.8 MB
|
|
||||||
(for Drive support)
|
|
||||||
|
|
||||||
Resources Strings, Icons.. 2.1 MB
|
|
||||||
Password Font 0.2 MB
|
|
||||||
Java Code including Dropbox 1.1 MB
|
|
||||||
GDrive, SkyDrive
|
|
||||||
libraries
|
|
||||||
|
|
||||||
Keepass library 0.2 MB
|
|
||||||
Keepass2Android Code 0.3 MB
|
|
||||||
Java/Mono bindings 0.5 MB
|
|
||||||
|
|
||||||
rest 0.3 MB
|
|
||||||
|
|
||||||
TOTAL 13 MB
|
|
||||||
```
|
|
@@ -1,20 +0,0 @@
|
|||||||
Google has introduced the Android Autofill interface in Android 8. Keepass2Android supports this interface. In most Android apps and all Autofill-enabled browsers, this is the most convenient way of entering passwords. As soon as you focus a field, you will see a popup "Fill with Keepass2Android".
|
|
||||||
|
|
||||||
<img src="autofill-facebook.png" />
|
|
||||||
|
|
||||||
After clicking this popup, you can unlock your KP2A database. If automatic look up succeeds, KP2A will close automatically, if not you are prompted to select the entry you want to auto-fill. When returning to the target app, the fields should be filled automatically already.
|
|
||||||
|
|
||||||
As of January 2018, the following browsers are known to have Android Autofill support:
|
|
||||||
|
|
||||||
* Firefox Focus / Firefox Klar
|
|
||||||
* Opera Mini
|
|
||||||
|
|
||||||
These browsers do not (yet) have autofill support:
|
|
||||||
|
|
||||||
* Google Chrome
|
|
||||||
* Firefox for Android ([bugzilla entry](https://bugzilla.mozilla.org/show_bug.cgi?id=1352011))
|
|
||||||
* Brave-Browser
|
|
||||||
* Opera
|
|
||||||
|
|
||||||
Please use the Share-URL-feature and the built-in KP2A keyboard for these browsers.
|
|
||||||
|
|
@@ -1,25 +1 @@
|
|||||||
# Who we are
|
This page has been moved to the [wiki](https://github.com/PhilippC/keepass2android/wiki/Privacy-Policy)
|
||||||
|
|
||||||
Philipp Crocoll
|
|
||||||
Wallonenstr. 4
|
|
||||||
76297 Stutensee
|
|
||||||
Germany
|
|
||||||
|
|
||||||
is the author of Keepass2Android and Keepass2Android Offline.
|
|
||||||
|
|
||||||
# What data is collected?
|
|
||||||
|
|
||||||
The contents of your password database is yours and is never collected by us. Keepass2Android stores this data on a location chosen by the user and encrypted in the Keepass database format. The app author does not have any access, neither to the files nor the contents. Depending on the user's choice of the storage location, the files may be stored on third-party servers like Dropbox or Google Drive.
|
|
||||||
|
|
||||||
Keepass2Android does not collect personal identifiable information. For debugging purposes, the user may activate creating a debug log. This collects data inside the app and is not accessible to any other app nor the author of the app, unless the user explicitly sends the debug log to the author. Debug logs usually do not contain personal identifiable information, except if such information is part of file or folder names. Debug logs will not be shared with third parties unless explicitly authorized by the sender.
|
|
||||||
|
|
||||||
# What Android permissions are required?
|
|
||||||
|
|
||||||
* **Internet** (Keepass2Android regular only): Required to allow the user to read/store password databases or key files on remote locations, e.g. Dropbox or via WebDav.
|
|
||||||
* **Contacts/Accounts** (Keepass2Android regular only): Required by the Google Drive SDK. If you want to access files on Google Drive, you are prompted to select one of the Google Accounts on your phone to use. The permission is required to query the list of Google accounts on the device. Keepass2Android does not access your personal contacts.
|
|
||||||
* **Storage**: Required to allow the user to read/store password databases or key files on the device locally.
|
|
||||||
* **Fingerprint/Biometric**: Required if you want to use biometric unlock.
|
|
||||||
* **Vibrate**: Required by the built-in keyboard (vibrate on key press)
|
|
||||||
* **Camera**: Required for scanning OTP QR Codes
|
|
||||||
* **Foreground service**: Required to keep the app alive for QuickUnlock (so you don't need to enter your full master password repeatedly)
|
|
||||||
|
|
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
|
|
||||||
# What is Keepass2Android?
|
# What is Keepass2Android?
|
||||||
Keepass2Android is a password manager app. It allows to store and retrieve passwords and other sensitive information in a file called "database". This database is secured with a so-called master password. The master password typically is a strong password and can be complemented with a second factor for additional security.
|
Keepass2Android is a password manager app. It allows to store and retrieve passwords and other sensitive information in a file called "database", secured with a strong key.
|
||||||
The password database file can be synchronized across different devices. This works best using one of the built-in cloud storage options, but can also be performed with third-party apps. Keepass2Android is compatible with Keepass 1 and Keepass 2 on Windows and KeepassX on Linux.
|
The password database file can be synchronized across different devices. This works best using one of the built-in cloud storage options, but can also be performed with third-party apps. Keepass2Android is compatible with KeePass 2.x and KeepassXC on PCs as well as many other KeePass ports for a variety of platforms.
|
||||||
|
|
||||||
# Where to get it?
|
# Where to get it?
|
||||||
Regular stable releases of Keepass2Android are available on [Google Play](https://play.google.com/store/apps/details?id=keepass2android.keepass2android).
|
Regular stable releases of Keepass2Android are available on [Google Play](https://play.google.com/store/apps/details?id=keepass2android.keepass2android).
|
||||||
@@ -11,17 +11,13 @@ Regular stable releases of Keepass2Android are available on [Google Play](https:
|
|||||||
Beta-releases can be obtained by opting in to the [Beta testing channel](https://play.google.com/apps/testing/keepass2android.keepass2android) or [Beta testing channel for Keepass2Android Offline](https://play.google.com/apps/testing/keepass2android.keepass2android_nonet).
|
Beta-releases can be obtained by opting in to the [Beta testing channel](https://play.google.com/apps/testing/keepass2android.keepass2android) or [Beta testing channel for Keepass2Android Offline](https://play.google.com/apps/testing/keepass2android.keepass2android_nonet).
|
||||||
|
|
||||||
# How can I contribute?
|
# How can I contribute?
|
||||||
* Help to translate Keepass2Android into your language or improve translations at [our Crowdin page](http://crowdin.net/project/keepass2android)
|
* Help to translate Keepass2Android into your language or improve translations at [our Crowdin page](https://crowdin.net/project/keepass2android)
|
||||||
* Add features by [creating a plugin](How-to-create-a-plug-in_.md) or creating a pull request. You might want to contact me before you start working so I can coordinate efforts.
|
* Add features by [creating a plugin](How-to-create-a-plug-in_.md) or creating a pull request. You might want to contact me before you start working so I can coordinate efforts.
|
||||||
* [Become a GitHub sponsor to boost 🚀 development](https://github.com/sponsors/PhilippC)
|
* [Become a GitHub sponsor to boost 🚀 development](https://github.com/sponsors/PhilippC)
|
||||||
* [Make a donation](http://philipp.crocoll.net/donate.php)
|
* [Make a donation](https://philipp.crocoll.net/donate.php)
|
||||||
|
|
||||||
# How do I learn more?
|
# How do I learn more?
|
||||||
Please see the [documentation](Documentation.md).
|
Please see the [wiki](https://github.com/PhilippC/keepass2android/wiki/Documentation) for further information.
|
||||||
|
|
||||||
# How do I build the project?
|
|
||||||
If you want to build Keepass2Android, check the [build guide](Build.readme.md).
|
|
||||||
|
|
||||||
The project homepage is https://philipp.crocoll.net/keepass2android/index.php
|
|
||||||
|
|
||||||
<img src="https://github.com/PhilippC/keepass2android/actions/workflows/build.yml/badge.svg" alt="build status" /> [Build status](https://github.com/PhilippC/keepass2android/actions)
|
<img src="https://github.com/PhilippC/keepass2android/actions/workflows/build.yml/badge.svg" alt="build status" /> [Build status](https://github.com/PhilippC/keepass2android/actions)
|
||||||
|
@@ -1,72 +0,0 @@
|
|||||||
# SFTP Open/Create Database Credentials Documentation
|
|
||||||
|
|
||||||
## Basic Settings
|
|
||||||
* **Host** -- the hostname or IP address of the SFTP server to connect to
|
|
||||||
* **Port** -- the listening TCP port of the SFTP server to connect to (default: 22)
|
|
||||||
* **Username** -- the user/account name on the SFTP server that has access to the database
|
|
||||||
* **Initial directory** -- The path on the SFTP server that will be used as a starting point when choosing the remote database file
|
|
||||||
|
|
||||||
### Authentication Modes
|
|
||||||
|
|
||||||
#### Password
|
|
||||||
Authenticate using a password
|
|
||||||
|
|
||||||
* **Password** -- the password associated with **username** used to log into the SFTP server
|
|
||||||
|
|
||||||
#### K2A Private/Public Key
|
|
||||||
Authenticate using a private/public key pair that is generated internally by KP2A
|
|
||||||
|
|
||||||
* **SEND PUBLIC KEY...** -- Opens a standard Android "Share" screen containing the KP2A public key content. This allows for the public key to be sent via email, SMS, etc. This public key will need to be added to the SFTP server's user's "authorized keys" to allow private/public key authentication.
|
|
||||||
|
|
||||||
#### Custom Private Key
|
|
||||||
Authenticate using an existing private/public key pair. Use this option instead of *K2A Private/Public Key* if you wish to use a key pair that is already set up for this **username** on the SFTP server.
|
|
||||||
|
|
||||||
* **Selected private key** -- a combo-box containing a list of custom private keys that KP2A knows about, and a special `[Add new...]` option.
|
|
||||||
##### Add A New Private Key
|
|
||||||
* Select `[Add new...]`
|
|
||||||
* Enter a name for the new key in **New key name**
|
|
||||||
* Enter the private key contents (text) into **New key content**. **TIP:** The easiest way to accomplish this is to open the private key file in a text editor on the device, **Select All**, **Copy** to the clipboard, and paste it into **New key content**.
|
|
||||||
* Tap **SAVE PRIVATE KEY** to add the new key to the known list.
|
|
||||||
|
|
||||||
##### Use An Existing Private Key
|
|
||||||
* To use a private key that has already been imported into KP2A, simply select it from the list of keys.
|
|
||||||
|
|
||||||
##### Remove An Existing Key
|
|
||||||
* To remove a private that has been imported into KP2A, select it from the list and tap **DELETE PRIVATE KEY**.
|
|
||||||
|
|
||||||
A **key passphrase** can be supplied (if the key pair requires it)
|
|
||||||
|
|
||||||
## Advanced Settings
|
|
||||||
* **Connection timeout seconds** -- the number of seconds to wait for a connection to the server before giving up and considering the server as unavailable/unreachable
|
|
||||||
|
|
||||||
### Key Algorithm Manipulation
|
|
||||||
**NOTE: It is very rare that these fields need to be (or should be) specified. Use at your own risk!**
|
|
||||||
|
|
||||||
* **Key Exchange (KEX) Algorithm(s)** -- Explicitly set or modify the ordered list of Key Exchange algorithms that the SSH/SFTP client library will try to use
|
|
||||||
* **Server Host Key Algorithm(s)** -- Explicitly set or modify the ordered list of Server Host Key algorithms that the SSH/SFTP client library will try to use
|
|
||||||
|
|
||||||
#### How It Works
|
|
||||||
The SSH/SFTP client has a pre-defined ordered list of algorithm names that it will use to negotiate with the server to handle key exchange. In rare cases there are compatibility issues where Android OS has not properly implemented full support for algorithms listed. This can result in a connection failure, even if there is a suitable algorithm available (of lesser priority in the list).
|
|
||||||
|
|
||||||
The fields listed above allow these lists to be manipulated in the following ways to overcome/workaround such problems. The value is a comma-separated list of "algorithm spec" entries. Specs can be one of:
|
|
||||||
|
|
||||||
* Direct replacement of values -- Ex: `primary_alg,secondary_alg`
|
|
||||||
* Prepend to values -- Ex: `+try_first_alg`
|
|
||||||
* Append to values -- Ex: `try_last_alg+`
|
|
||||||
* Remove a specific value -- Ex: `-bad_alg`
|
|
||||||
* Remove values matching prefix -- Ex: `-bad_starting_with*`
|
|
||||||
* Remove values matching suffix -- Ex: `-*bad_ending_with`
|
|
||||||
* Remove values matching substring -- Ex: `-*bad_middle*`
|
|
||||||
* Remove values matching prefix and suffix -- Ex: `-alg_begin*end`
|
|
||||||
|
|
||||||
For example, assume the system's KEX algorithm list is:
|
|
||||||
`ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256`
|
|
||||||
|
|
||||||
These are various outcomes (user KEX field -> result):
|
|
||||||
|
|
||||||
* Prefix removal: `-ec*` --> `diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256`
|
|
||||||
* Suffix removal, appending: `-*256,+first_alg,almost_last_alg+,last_alg+` --> `first_alg,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,almost_last_alg,last_alg`
|
|
||||||
* Direct replacement: `first_alg,middle_alg,last_alg` --> `first_alg,middle_alg,last_alg`
|
|
||||||
|
|
||||||
## Selecting A Database
|
|
||||||
Once all applicable fields have been entered and/or options selected, tapping **OK** will attempt to connect to the SFTP server. First time connections may pop up a dialog window asking to accept the host's authenticity (tap **yes** if the host is trusted), as well as potentially creating a new `known_hosts` file (tap **yes** to do so). If the connection is successful, a remote file browser screen will open. Navigate and select the Keepass database to open.
|
|
@@ -1 +0,0 @@
|
|||||||
theme: jekyll-theme-slate
|
|
Before Width: | Height: | Size: 69 KiB |
48
src/DropboxBinding/Additions/AboutAdditions.txt
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
Additions allow you to add arbitrary C# to the generated classes
|
||||||
|
before they are compiled. This can be helpful for providing convenience
|
||||||
|
methods or adding pure C# classes.
|
||||||
|
|
||||||
|
== Adding Methods to Generated Classes ==
|
||||||
|
|
||||||
|
Let's say the library being bound has a Rectangle class with a constructor
|
||||||
|
that takes an x and y position, and a width and length size. It will look like
|
||||||
|
this:
|
||||||
|
|
||||||
|
public partial class Rectangle
|
||||||
|
{
|
||||||
|
public Rectangle (int x, int y, int width, int height)
|
||||||
|
{
|
||||||
|
// JNI bindings
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Imagine we want to add a constructor to this class that takes a Point and
|
||||||
|
Size structure instead of 4 ints. We can add a new file called Rectangle.cs
|
||||||
|
with a partial class containing our new method:
|
||||||
|
|
||||||
|
public partial class Rectangle
|
||||||
|
{
|
||||||
|
public Rectangle (Point location, Size size) :
|
||||||
|
this (location.X, location.Y, size.Width, size.Height)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
At compile time, the additions class will be added to the generated class
|
||||||
|
and the final assembly will a Rectangle class with both constructors.
|
||||||
|
|
||||||
|
|
||||||
|
== Adding C# Classes ==
|
||||||
|
|
||||||
|
Another thing that can be done is adding fully C# managed classes to the
|
||||||
|
generated library. In the above example, let's assume that there isn't a
|
||||||
|
Point class available in Java or our library. The one we create doesn't need
|
||||||
|
to interact with Java, so we'll create it like a normal class in C#.
|
||||||
|
|
||||||
|
By adding a Point.cs file with this class, it will end up in the binding library:
|
||||||
|
|
||||||
|
public class Point
|
||||||
|
{
|
||||||
|
public int X { get; set; }
|
||||||
|
public int Y { get; set; }
|
||||||
|
}
|
8
src/DropboxBinding/DropboxBinding.csproj
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0-android</TargetFramework>
|
||||||
|
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
14
src/DropboxBinding/Transforms/EnumFields.xml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<enum-field-mappings>
|
||||||
|
<!--
|
||||||
|
This example converts the constants Fragment_id, Fragment_name,
|
||||||
|
and Fragment_tag from android.support.v4.app.FragmentActivity.FragmentTag
|
||||||
|
to an enum called Android.Support.V4.App.FragmentTagType with values
|
||||||
|
Id, Name, and Tag.
|
||||||
|
|
||||||
|
<mapping jni-class="android/support/v4/app/FragmentActivity$FragmentTag" clr-enum-type="Android.Support.V4.App.FragmentTagType">
|
||||||
|
<field jni-name="Fragment_name" clr-name="Name" value="0" />
|
||||||
|
<field jni-name="Fragment_id" clr-name="Id" value="1" />
|
||||||
|
<field jni-name="Fragment_tag" clr-name="Tag" value="2" />
|
||||||
|
</mapping>
|
||||||
|
-->
|
||||||
|
</enum-field-mappings>
|
13
src/DropboxBinding/Transforms/EnumMethods.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<enum-method-mappings>
|
||||||
|
<!--
|
||||||
|
This example changes the Java method:
|
||||||
|
android.support.v4.app.Fragment.SavedState.writeToParcel (int flags)
|
||||||
|
to be:
|
||||||
|
android.support.v4.app.Fragment.SavedState.writeToParcel (Android.OS.ParcelableWriteFlags flags)
|
||||||
|
when bound in C#.
|
||||||
|
|
||||||
|
<mapping jni-class="android/support/v4/app/Fragment.SavedState">
|
||||||
|
<method jni-name="writeToParcel" parameter="flags" clr-enum-type="Android.OS.ParcelableWriteFlags" />
|
||||||
|
</mapping>
|
||||||
|
-->
|
||||||
|
</enum-method-mappings>
|
35
src/DropboxBinding/Transforms/Metadata.xml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<metadata>
|
||||||
|
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.http']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.json']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.oauth']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.sdk.android']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.stone']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.util']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v1']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.account']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.callbacks']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.check']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.seenstate']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.teamcommon']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.secondaryemails']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.async']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.auth']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.common']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.contacts']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.fileproperties']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.filerequests']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.files']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.paper']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.openid']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.sharing']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.team']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.teamlog']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.teampolicies']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.users']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.v2.userscommon']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.android']" />
|
||||||
|
<remove-node path="/api/package[@name='com.dropbox.core.android']" />
|
||||||
|
</metadata>
|
BIN
src/DropboxBinding/dropbox-android-sdk-7.0.0.aar
Normal file
@@ -29,6 +29,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PCloudBindings", "PCloudBin
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kp2aAutofillParser.Tests", "Kp2aAutofillParser.Tests\Kp2aAutofillParser.Tests.csproj", "{F5A2A8F9-C084-498F-9603-9D927BA5C626}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kp2aAutofillParser.Tests", "Kp2aAutofillParser.Tests\Kp2aAutofillParser.Tests.csproj", "{F5A2A8F9-C084-498F-9603-9D927BA5C626}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DropboxBinding", "DropboxBinding\DropboxBinding.csproj", "{2FE6E335-E834-4F86-AB83-2C5D225DA929}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -369,6 +371,30 @@ Global
|
|||||||
{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|Win32.Build.0 = Release|Any CPU
|
{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|Win32.Build.0 = Release|Any CPU
|
||||||
{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU
|
{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU
|
||||||
{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|x64.Build.0 = Release|Any CPU
|
{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|x64.Build.0 = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Release|Win32.Build.0 = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.ReleaseNoNet|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.ReleaseNoNet|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.ReleaseNoNet|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.ReleaseNoNet|Mixed Platforms.Build.0 = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.ReleaseNoNet|Win32.ActiveCfg = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.ReleaseNoNet|Win32.Build.0 = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{2FE6E335-E834-4F86-AB83-2C5D225DA929}.ReleaseNoNet|x64.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
KeePass Password Safe - The Open-Source Password Manager
|
KeePass Password Safe - The Open-Source Password Manager
|
||||||
Copyright (C) 2003-2017 Dominik Reichl <dominik.reichl@t-online.de>
|
Copyright (C) 2003-2025 Dominik Reichl <dominik.reichl@t-online.de>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -29,197 +29,226 @@ using KeePassLib.Utility;
|
|||||||
|
|
||||||
namespace KeePassLib.Cryptography
|
namespace KeePassLib.Cryptography
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Algorithms supported by <c>CryptoRandomStream</c>.
|
/// Algorithms supported by <c>CryptoRandomStream</c>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum CrsAlgorithm
|
public enum CrsAlgorithm
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Not supported.
|
/// Not supported.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Null = 0,
|
Null = 0,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A variant of the ARCFour algorithm (RC4 incompatible).
|
/// A variant of the ArcFour algorithm (RC4 incompatible).
|
||||||
/// </summary>
|
/// Insecure; for backward compatibility only.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ArcFourVariant = 1,
|
ArcFourVariant = 1,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Salsa20 stream cipher algorithm.
|
/// Salsa20 stream cipher algorithm.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Salsa20 = 2,
|
Salsa20 = 2,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ChaCha20 stream cipher algorithm.
|
/// ChaCha20 stream cipher algorithm.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ChaCha20 = 3,
|
ChaCha20 = 3,
|
||||||
|
|
||||||
Count = 4
|
Count = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A random stream class. The class is initialized using random
|
/// A random stream class. The class is initialized using random
|
||||||
/// bytes provided by the caller. The produced stream has random
|
/// bytes provided by the caller. The produced stream has random
|
||||||
/// properties, but for the same seed always the same stream
|
/// properties, but for the same seed always the same stream
|
||||||
/// is produced, i.e. this class can be used as stream cipher.
|
/// is produced, i.e. this class can be used as stream cipher.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class CryptoRandomStream : IDisposable
|
public sealed class CryptoRandomStream : IDisposable
|
||||||
{
|
{
|
||||||
private readonly CrsAlgorithm m_crsAlgorithm;
|
private readonly CrsAlgorithm m_alg;
|
||||||
|
private bool m_bDisposed = false;
|
||||||
|
|
||||||
private byte[] m_pbState = null;
|
private readonly byte[] m_pbKey = null;
|
||||||
private byte m_i = 0;
|
private readonly byte[] m_pbIV = null;
|
||||||
private byte m_j = 0;
|
|
||||||
|
|
||||||
private Salsa20Cipher m_salsa20 = null;
|
private readonly ChaCha20Cipher m_chacha20 = null;
|
||||||
private ChaCha20Cipher m_chacha20 = null;
|
private readonly Salsa20Cipher m_salsa20 = null;
|
||||||
|
|
||||||
/// <summary>
|
private readonly byte[] m_pbState = null;
|
||||||
/// Construct a new cryptographically secure random stream object.
|
private byte m_i = 0;
|
||||||
/// </summary>
|
private byte m_j = 0;
|
||||||
/// <param name="genAlgorithm">Algorithm to use.</param>
|
|
||||||
/// <param name="pbKey">Initialization key. Must not be <c>null</c> and
|
|
||||||
/// must contain at least 1 byte.</param>
|
|
||||||
public CryptoRandomStream(CrsAlgorithm a, byte[] pbKey)
|
|
||||||
{
|
|
||||||
if(pbKey == null) { Debug.Assert(false); throw new ArgumentNullException("pbKey"); }
|
|
||||||
/// <exception cref="System.ArgumentNullException">Thrown if the
|
|
||||||
int cbKey = pbKey.Length;
|
|
||||||
if(cbKey <= 0)
|
|
||||||
{
|
|
||||||
Debug.Assert(false); // Need at least one byte
|
|
||||||
throw new ArgumentOutOfRangeException("pbKey");
|
|
||||||
}
|
|
||||||
/// <paramref name="pbKey" /> parameter is <c>null</c>.</exception>
|
|
||||||
m_crsAlgorithm = a;
|
|
||||||
/// <exception cref="System.ArgumentException">Thrown if the
|
|
||||||
if(a == CrsAlgorithm.ChaCha20)
|
|
||||||
{
|
|
||||||
byte[] pbKey32 = new byte[32];
|
|
||||||
byte[] pbIV12 = new byte[12];
|
|
||||||
/// <paramref name="pbKey" /> parameter contains no bytes or the
|
|
||||||
using(SHA512Managed h = new SHA512Managed())
|
|
||||||
{
|
|
||||||
byte[] pbHash = h.ComputeHash(pbKey);
|
|
||||||
Array.Copy(pbHash, pbKey32, 32);
|
|
||||||
Array.Copy(pbHash, 32, pbIV12, 0, 12);
|
|
||||||
MemUtil.ZeroByteArray(pbHash);
|
|
||||||
}
|
|
||||||
/// algorithm is unknown.</exception>
|
|
||||||
m_chacha20 = new ChaCha20Cipher(pbKey32, pbIV12, true);
|
|
||||||
}
|
|
||||||
else if(a == CrsAlgorithm.Salsa20)
|
|
||||||
{
|
|
||||||
byte[] pbKey32 = CryptoUtil.HashSha256(pbKey);
|
|
||||||
byte[] pbIV8 = new byte[8] { 0xE8, 0x30, 0x09, 0x4B,
|
|
||||||
0x97, 0x20, 0x5D, 0x2A }; // Unique constant
|
|
||||||
|
|
||||||
m_salsa20 = new Salsa20Cipher(pbKey32, pbIV8);
|
/// <summary>
|
||||||
}
|
/// Construct a new cryptographically secure random stream object.
|
||||||
else if(a == CrsAlgorithm.ArcFourVariant)
|
/// </summary>
|
||||||
{
|
/// <param name="a">Algorithm to use.</param>
|
||||||
// Fill the state linearly
|
/// <param name="pbKey">Initialization key. Must not be <c>null</c>
|
||||||
m_pbState = new byte[256];
|
/// and must contain at least 1 byte.</param>
|
||||||
for(int w = 0; w < 256; ++w) m_pbState[w] = (byte)w;
|
public CryptoRandomStream(CrsAlgorithm a, byte[] pbKey)
|
||||||
|
{
|
||||||
|
if (pbKey == null) { Debug.Assert(false); throw new ArgumentNullException("pbKey"); }
|
||||||
|
|
||||||
unchecked
|
int cbKey = pbKey.Length;
|
||||||
{
|
if (cbKey <= 0)
|
||||||
byte j = 0, t;
|
{
|
||||||
int inxKey = 0;
|
Debug.Assert(false); // Need at least one byte
|
||||||
for(int w = 0; w < 256; ++w) // Key setup
|
throw new ArgumentOutOfRangeException("pbKey");
|
||||||
{
|
}
|
||||||
j += (byte)(m_pbState[w] + pbKey[inxKey]);
|
|
||||||
|
|
||||||
t = m_pbState[0]; // Swap entries
|
m_alg = a;
|
||||||
m_pbState[0] = m_pbState[j];
|
|
||||||
m_pbState[j] = t;
|
|
||||||
|
|
||||||
++inxKey;
|
if (a == CrsAlgorithm.ChaCha20)
|
||||||
if(inxKey >= cbKey) inxKey = 0;
|
{
|
||||||
}
|
m_pbKey = new byte[32];
|
||||||
}
|
m_pbIV = new byte[12];
|
||||||
|
|
||||||
GetRandomBytes(512); // Increases security, see cryptanalysis
|
using (SHA512Managed h = new SHA512Managed())
|
||||||
}
|
{
|
||||||
else // Unknown algorithm
|
byte[] pbHash = h.ComputeHash(pbKey);
|
||||||
{
|
Array.Copy(pbHash, m_pbKey, 32);
|
||||||
Debug.Assert(false);
|
Array.Copy(pbHash, 32, m_pbIV, 0, 12);
|
||||||
throw new ArgumentOutOfRangeException("a");
|
MemUtil.ZeroByteArray(pbHash);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
m_chacha20 = new ChaCha20Cipher(m_pbKey, m_pbIV, true);
|
||||||
{
|
}
|
||||||
Dispose(true);
|
else if (a == CrsAlgorithm.Salsa20)
|
||||||
GC.SuppressFinalize(this);
|
{
|
||||||
}
|
m_pbKey = CryptoUtil.HashSha256(pbKey);
|
||||||
|
m_pbIV = new byte[8] { 0xE8, 0x30, 0x09, 0x4B,
|
||||||
|
0x97, 0x20, 0x5D, 0x2A }; // Unique constant
|
||||||
|
|
||||||
private void Dispose(bool disposing)
|
m_salsa20 = new Salsa20Cipher(m_pbKey, m_pbIV);
|
||||||
{
|
}
|
||||||
if(disposing)
|
else if (a == CrsAlgorithm.ArcFourVariant)
|
||||||
{
|
{
|
||||||
if(m_crsAlgorithm == CrsAlgorithm.ChaCha20)
|
// Fill the state linearly
|
||||||
m_chacha20.Dispose();
|
m_pbState = new byte[256];
|
||||||
else if(m_crsAlgorithm == CrsAlgorithm.Salsa20)
|
for (int w = 0; w < 256; ++w) m_pbState[w] = (byte)w;
|
||||||
m_salsa20.Dispose();
|
|
||||||
else if(m_crsAlgorithm == CrsAlgorithm.ArcFourVariant)
|
|
||||||
{
|
|
||||||
MemUtil.ZeroByteArray(m_pbState);
|
|
||||||
m_i = 0;
|
|
||||||
m_j = 0;
|
|
||||||
}
|
|
||||||
else { Debug.Assert(false); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
unchecked
|
||||||
/// Get <paramref name="uRequestedCount" /> random bytes.
|
{
|
||||||
/// </summary>
|
byte j = 0, t;
|
||||||
/// <param name="uRequestedCount">Number of random bytes to retrieve.</param>
|
int inxKey = 0;
|
||||||
/// <returns>Returns <paramref name="uRequestedCount" /> random bytes.</returns>
|
for (int w = 0; w < 256; ++w) // Key setup
|
||||||
public byte[] GetRandomBytes(uint uRequestedCount)
|
{
|
||||||
{
|
j += (byte)(m_pbState[w] + pbKey[inxKey]);
|
||||||
if(uRequestedCount == 0) return MemUtil.EmptyByteArray;
|
|
||||||
|
|
||||||
if(uRequestedCount > (uint)int.MaxValue)
|
t = m_pbState[0]; // Swap entries
|
||||||
throw new ArgumentOutOfRangeException("uRequestedCount");
|
m_pbState[0] = m_pbState[j];
|
||||||
int cb = (int)uRequestedCount;
|
m_pbState[j] = t;
|
||||||
|
|
||||||
byte[] pbRet = new byte[cb];
|
++inxKey;
|
||||||
|
if (inxKey >= cbKey) inxKey = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(m_crsAlgorithm == CrsAlgorithm.ChaCha20)
|
GetRandomBytes(512); // Increases security, see cryptanalysis
|
||||||
m_chacha20.Encrypt(pbRet, 0, cb);
|
}
|
||||||
else if(m_crsAlgorithm == CrsAlgorithm.Salsa20)
|
else // Unknown algorithm
|
||||||
m_salsa20.Encrypt(pbRet, 0, cb);
|
{
|
||||||
else if(m_crsAlgorithm == CrsAlgorithm.ArcFourVariant)
|
Debug.Assert(false);
|
||||||
{
|
throw new ArgumentOutOfRangeException("a");
|
||||||
unchecked
|
}
|
||||||
{
|
}
|
||||||
for(int w = 0; w < cb; ++w)
|
|
||||||
{
|
|
||||||
++m_i;
|
|
||||||
m_j += m_pbState[m_i];
|
|
||||||
|
|
||||||
byte t = m_pbState[m_i]; // Swap entries
|
public void Dispose()
|
||||||
m_pbState[m_i] = m_pbState[m_j];
|
{
|
||||||
m_pbState[m_j] = t;
|
Dispose(true);
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
|
}
|
||||||
|
|
||||||
t = (byte)(m_pbState[m_i] + m_pbState[m_j]);
|
private void Dispose(bool disposing)
|
||||||
pbRet[w] = m_pbState[t];
|
{
|
||||||
}
|
if (disposing)
|
||||||
}
|
{
|
||||||
}
|
if (m_alg == CrsAlgorithm.ChaCha20)
|
||||||
else { Debug.Assert(false); }
|
m_chacha20.Dispose();
|
||||||
|
else if (m_alg == CrsAlgorithm.Salsa20)
|
||||||
|
m_salsa20.Dispose();
|
||||||
|
else if (m_alg == CrsAlgorithm.ArcFourVariant)
|
||||||
|
{
|
||||||
|
MemUtil.ZeroByteArray(m_pbState);
|
||||||
|
m_i = 0;
|
||||||
|
m_j = 0;
|
||||||
|
}
|
||||||
|
else { Debug.Assert(false); }
|
||||||
|
|
||||||
return pbRet;
|
if (m_pbKey != null) MemUtil.ZeroByteArray(m_pbKey);
|
||||||
}
|
if (m_pbIV != null) MemUtil.ZeroByteArray(m_pbIV);
|
||||||
|
|
||||||
public ulong GetRandomUInt64()
|
m_bDisposed = true;
|
||||||
{
|
}
|
||||||
byte[] pb = GetRandomBytes(8);
|
}
|
||||||
return MemUtil.BytesToUInt64(pb);
|
|
||||||
}
|
/// <summary>
|
||||||
|
/// Get <paramref name="uRequestedCount" /> random bytes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uRequestedCount">Number of random bytes to retrieve.</param>
|
||||||
|
/// <returns>Returns <paramref name="uRequestedCount" /> random bytes.</returns>
|
||||||
|
public byte[] GetRandomBytes(uint uRequestedCount)
|
||||||
|
{
|
||||||
|
if (m_bDisposed) throw new ObjectDisposedException(null);
|
||||||
|
|
||||||
|
if (uRequestedCount == 0) return MemUtil.EmptyByteArray;
|
||||||
|
if (uRequestedCount > (uint)int.MaxValue)
|
||||||
|
throw new ArgumentOutOfRangeException("uRequestedCount");
|
||||||
|
int cb = (int)uRequestedCount;
|
||||||
|
|
||||||
|
byte[] pbRet = new byte[cb];
|
||||||
|
|
||||||
|
if (m_alg == CrsAlgorithm.ChaCha20)
|
||||||
|
m_chacha20.Encrypt(pbRet, 0, cb);
|
||||||
|
else if (m_alg == CrsAlgorithm.Salsa20)
|
||||||
|
m_salsa20.Encrypt(pbRet, 0, cb);
|
||||||
|
else if (m_alg == CrsAlgorithm.ArcFourVariant)
|
||||||
|
{
|
||||||
|
unchecked
|
||||||
|
{
|
||||||
|
for (int w = 0; w < cb; ++w)
|
||||||
|
{
|
||||||
|
++m_i;
|
||||||
|
m_j += m_pbState[m_i];
|
||||||
|
|
||||||
|
byte t = m_pbState[m_i]; // Swap entries
|
||||||
|
m_pbState[m_i] = m_pbState[m_j];
|
||||||
|
m_pbState[m_j] = t;
|
||||||
|
|
||||||
|
t = (byte)(m_pbState[m_i] + m_pbState[m_j]);
|
||||||
|
pbRet[w] = m_pbState[t];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else { Debug.Assert(false); }
|
||||||
|
|
||||||
|
return pbRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ulong GetRandomUInt64()
|
||||||
|
{
|
||||||
|
byte[] pb = GetRandomBytes(8);
|
||||||
|
return MemUtil.BytesToUInt64(pb);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal ulong GetRandomUInt64(ulong uMaxExcl)
|
||||||
|
{
|
||||||
|
if (uMaxExcl == 0) { Debug.Assert(false); throw new ArgumentOutOfRangeException("uMaxExcl"); }
|
||||||
|
|
||||||
|
ulong uGen, uRem;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
uGen = GetRandomUInt64();
|
||||||
|
uRem = uGen % uMaxExcl;
|
||||||
|
}
|
||||||
|
while ((uGen - uRem) > (ulong.MaxValue - (uMaxExcl - 1UL)));
|
||||||
|
// This ensures that the last number of the block (i.e.
|
||||||
|
// (uGen - uRem) + (uMaxExcl - 1)) is generatable;
|
||||||
|
// for signed longs, overflow to negative number:
|
||||||
|
// while((uGen - uRem) + (uMaxExcl - 1) < 0);
|
||||||
|
|
||||||
|
return uRem;
|
||||||
|
}
|
||||||
|
|
||||||
#if CRSBENCHMARK
|
#if CRSBENCHMARK
|
||||||
public static string Benchmark()
|
public static string Benchmark()
|
||||||
@@ -237,22 +266,21 @@ namespace KeePassLib.Cryptography
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int BenchTime(CrsAlgorithm cra, int nRounds, int nDataSize)
|
private static int BenchTime(CrsAlgorithm a, int nRounds, int cbData)
|
||||||
{
|
{
|
||||||
byte[] pbKey = new byte[4] { 0x00, 0x01, 0x02, 0x03 };
|
byte[] pbKey = new byte[4] { 0x00, 0x01, 0x02, 0x03 };
|
||||||
|
|
||||||
int nStart = Environment.TickCount;
|
int tStart = Environment.TickCount;
|
||||||
for(int i = 0; i < nRounds; ++i)
|
for(int i = 0; i < nRounds; ++i)
|
||||||
{
|
{
|
||||||
using(CryptoRandomStream c = new CryptoRandomStream(cra, pbKey))
|
using(CryptoRandomStream crs = new CryptoRandomStream(a, pbKey))
|
||||||
{
|
{
|
||||||
c.GetRandomBytes((uint)nDataSize);
|
crs.GetRandomBytes((uint)cbData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int nEnd = Environment.TickCount;
|
|
||||||
|
|
||||||
return (nEnd - nStart);
|
return (Environment.TickCount - tStart);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,65 +0,0 @@
|
|||||||
/*
|
|
||||||
KeePass Password Safe - The Open-Source Password Manager
|
|
||||||
Copyright (C) 2003-2017 Dominik Reichl <dominik.reichl@t-online.de>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Diagnostics;
|
|
||||||
|
|
||||||
using KeePassLib.Security;
|
|
||||||
using KeePassLib.Utility;
|
|
||||||
|
|
||||||
namespace KeePassLib.Cryptography.PasswordGenerator
|
|
||||||
{
|
|
||||||
internal static class CharSetBasedGenerator
|
|
||||||
{
|
|
||||||
internal static PwgError Generate(out ProtectedString psOut,
|
|
||||||
PwProfile pwProfile, CryptoRandomStream crsRandomSource)
|
|
||||||
{
|
|
||||||
psOut = ProtectedString.Empty;
|
|
||||||
if(pwProfile.Length == 0) return PwgError.Success;
|
|
||||||
|
|
||||||
PwCharSet pcs = new PwCharSet(pwProfile.CharSet.ToString());
|
|
||||||
char[] vGenerated = new char[pwProfile.Length];
|
|
||||||
|
|
||||||
PwGenerator.PrepareCharSet(pcs, pwProfile);
|
|
||||||
|
|
||||||
for(int nIndex = 0; nIndex < (int)pwProfile.Length; ++nIndex)
|
|
||||||
{
|
|
||||||
char ch = PwGenerator.GenerateCharacter(pwProfile, pcs,
|
|
||||||
crsRandomSource);
|
|
||||||
|
|
||||||
if(ch == char.MinValue)
|
|
||||||
{
|
|
||||||
MemUtil.ZeroArray<char>(vGenerated);
|
|
||||||
return PwgError.TooFewCharacters;
|
|
||||||
}
|
|
||||||
|
|
||||||
vGenerated[nIndex] = ch;
|
|
||||||
}
|
|
||||||
|
|
||||||
byte[] pbUtf8 = StrUtil.Utf8.GetBytes(vGenerated);
|
|
||||||
psOut = new ProtectedString(true, pbUtf8);
|
|
||||||
MemUtil.ZeroByteArray(pbUtf8);
|
|
||||||
MemUtil.ZeroArray<char>(vGenerated);
|
|
||||||
|
|
||||||
return PwgError.Success;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,173 +0,0 @@
|
|||||||
/*
|
|
||||||
KeePass Password Safe - The Open-Source Password Manager
|
|
||||||
Copyright (C) 2003-2017 Dominik Reichl <dominik.reichl@t-online.de>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Diagnostics;
|
|
||||||
|
|
||||||
using KeePassLib.Security;
|
|
||||||
using KeePassLib.Utility;
|
|
||||||
|
|
||||||
namespace KeePassLib.Cryptography.PasswordGenerator
|
|
||||||
{
|
|
||||||
internal static class PatternBasedGenerator
|
|
||||||
{
|
|
||||||
internal static PwgError Generate(out ProtectedString psOut,
|
|
||||||
PwProfile pwProfile, CryptoRandomStream crsRandomSource)
|
|
||||||
{
|
|
||||||
psOut = ProtectedString.Empty;
|
|
||||||
LinkedList<char> vGenerated = new LinkedList<char>();
|
|
||||||
PwCharSet pcsCurrent = new PwCharSet();
|
|
||||||
PwCharSet pcsCustom = new PwCharSet();
|
|
||||||
PwCharSet pcsUsed = new PwCharSet();
|
|
||||||
bool bInCharSetDef = false;
|
|
||||||
|
|
||||||
string strPattern = ExpandPattern(pwProfile.Pattern);
|
|
||||||
if(strPattern.Length == 0) return PwgError.Success;
|
|
||||||
|
|
||||||
CharStream csStream = new CharStream(strPattern);
|
|
||||||
char ch = csStream.ReadChar();
|
|
||||||
|
|
||||||
while(ch != char.MinValue)
|
|
||||||
{
|
|
||||||
pcsCurrent.Clear();
|
|
||||||
|
|
||||||
bool bGenerateChar = false;
|
|
||||||
|
|
||||||
if(ch == '\\')
|
|
||||||
{
|
|
||||||
ch = csStream.ReadChar();
|
|
||||||
if(ch == char.MinValue) // Backslash at the end
|
|
||||||
{
|
|
||||||
vGenerated.AddLast('\\');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(bInCharSetDef) pcsCustom.Add(ch);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vGenerated.AddLast(ch);
|
|
||||||
pcsUsed.Add(ch);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(ch == '[')
|
|
||||||
{
|
|
||||||
pcsCustom.Clear();
|
|
||||||
bInCharSetDef = true;
|
|
||||||
}
|
|
||||||
else if(ch == ']')
|
|
||||||
{
|
|
||||||
pcsCurrent.Add(pcsCustom.ToString());
|
|
||||||
|
|
||||||
bInCharSetDef = false;
|
|
||||||
bGenerateChar = true;
|
|
||||||
}
|
|
||||||
else if(bInCharSetDef)
|
|
||||||
{
|
|
||||||
if(pcsCustom.AddCharSet(ch) == false)
|
|
||||||
pcsCustom.Add(ch);
|
|
||||||
}
|
|
||||||
else if(pcsCurrent.AddCharSet(ch) == false)
|
|
||||||
{
|
|
||||||
vGenerated.AddLast(ch);
|
|
||||||
pcsUsed.Add(ch);
|
|
||||||
}
|
|
||||||
else bGenerateChar = true;
|
|
||||||
|
|
||||||
if(bGenerateChar)
|
|
||||||
{
|
|
||||||
PwGenerator.PrepareCharSet(pcsCurrent, pwProfile);
|
|
||||||
|
|
||||||
if(pwProfile.NoRepeatingCharacters)
|
|
||||||
pcsCurrent.Remove(pcsUsed.ToString());
|
|
||||||
|
|
||||||
char chGen = PwGenerator.GenerateCharacter(pwProfile,
|
|
||||||
pcsCurrent, crsRandomSource);
|
|
||||||
|
|
||||||
if(chGen == char.MinValue) return PwgError.TooFewCharacters;
|
|
||||||
|
|
||||||
vGenerated.AddLast(chGen);
|
|
||||||
pcsUsed.Add(chGen);
|
|
||||||
}
|
|
||||||
|
|
||||||
ch = csStream.ReadChar();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(vGenerated.Count == 0) return PwgError.Success;
|
|
||||||
|
|
||||||
char[] vArray = new char[vGenerated.Count];
|
|
||||||
vGenerated.CopyTo(vArray, 0);
|
|
||||||
|
|
||||||
if(pwProfile.PatternPermutePassword)
|
|
||||||
PwGenerator.ShufflePassword(vArray, crsRandomSource);
|
|
||||||
|
|
||||||
byte[] pbUtf8 = StrUtil.Utf8.GetBytes(vArray);
|
|
||||||
psOut = new ProtectedString(true, pbUtf8);
|
|
||||||
MemUtil.ZeroByteArray(pbUtf8);
|
|
||||||
MemUtil.ZeroArray<char>(vArray);
|
|
||||||
vGenerated.Clear();
|
|
||||||
|
|
||||||
return PwgError.Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string ExpandPattern(string strPattern)
|
|
||||||
{
|
|
||||||
Debug.Assert(strPattern != null); if(strPattern == null) return string.Empty;
|
|
||||||
string str = strPattern;
|
|
||||||
|
|
||||||
while(true)
|
|
||||||
{
|
|
||||||
int nOpen = FindFirstUnescapedChar(str, '{');
|
|
||||||
int nClose = FindFirstUnescapedChar(str, '}');
|
|
||||||
|
|
||||||
if((nOpen >= 0) && (nOpen < nClose))
|
|
||||||
{
|
|
||||||
string strCount = str.Substring(nOpen + 1, nClose - nOpen - 1);
|
|
||||||
str = str.Remove(nOpen, nClose - nOpen + 1);
|
|
||||||
|
|
||||||
uint uRepeat;
|
|
||||||
if(StrUtil.TryParseUInt(strCount, out uRepeat) && (nOpen >= 1))
|
|
||||||
{
|
|
||||||
if(uRepeat == 0)
|
|
||||||
str = str.Remove(nOpen - 1, 1);
|
|
||||||
else
|
|
||||||
str = str.Insert(nOpen, new string(str[nOpen - 1], (int)uRepeat - 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int FindFirstUnescapedChar(string str, char ch)
|
|
||||||
{
|
|
||||||
for(int i = 0; i < str.Length; ++i)
|
|
||||||
{
|
|
||||||
char chCur = str[i];
|
|
||||||
|
|
||||||
if(chCur == '\\') ++i; // Next is escaped, skip it
|
|
||||||
else if(chCur == ch) return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
KeePass Password Safe - The Open-Source Password Manager
|
KeePass Password Safe - The Open-Source Password Manager
|
||||||
Copyright (C) 2003-2017 Dominik Reichl <dominik.reichl@t-online.de>
|
Copyright (C) 2003-2025 Dominik Reichl <dominik.reichl@t-online.de>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,333 +19,311 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
using KeePassLib.Utility;
|
||||||
|
|
||||||
namespace KeePassLib.Cryptography.PasswordGenerator
|
namespace KeePassLib.Cryptography.PasswordGenerator
|
||||||
{
|
{
|
||||||
public sealed class PwCharSet
|
public sealed class PwCharSet : IEquatable<PwCharSet>
|
||||||
{
|
{
|
||||||
public const string UpperCase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
public static readonly string UpperCase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
public const string LowerCase = "abcdefghijklmnopqrstuvwxyz";
|
public static readonly string LowerCase = "abcdefghijklmnopqrstuvwxyz";
|
||||||
public const string Digits = "0123456789";
|
public static readonly string Digits = "0123456789";
|
||||||
|
|
||||||
public const string UpperConsonants = "BCDFGHJKLMNPQRSTVWXYZ";
|
public static readonly string UpperConsonants = "BCDFGHJKLMNPQRSTVWXYZ";
|
||||||
public const string LowerConsonants = "bcdfghjklmnpqrstvwxyz";
|
public static readonly string LowerConsonants = "bcdfghjklmnpqrstvwxyz";
|
||||||
public const string UpperVowels = "AEIOU";
|
public static readonly string UpperVowels = "AEIOU";
|
||||||
public const string LowerVowels = "aeiou";
|
public static readonly string LowerVowels = "aeiou";
|
||||||
|
|
||||||
public const string Punctuation = @",.;:";
|
public static readonly string Punctuation = ",.;:";
|
||||||
public const string Brackets = @"[]{}()<>";
|
public static readonly string Brackets = @"[]{}()<>";
|
||||||
|
|
||||||
public const string PrintableAsciiSpecial = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
|
public static readonly string Special = "!\"#$%&'*+,./:;=?@\\^`|~";
|
||||||
|
public static readonly string PrintableAsciiSpecial = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
|
||||||
|
|
||||||
public const string UpperHex = "0123456789ABCDEF";
|
public static readonly string UpperHex = "0123456789ABCDEF";
|
||||||
public const string LowerHex = "0123456789abcdef";
|
public static readonly string LowerHex = "0123456789abcdef";
|
||||||
|
|
||||||
public const string Invalid = "\t\r\n";
|
public static readonly string LookAlike = "O0Il1|";
|
||||||
public const string LookAlike = @"O0l1I|";
|
|
||||||
|
|
||||||
internal const string MenuAccels = PwCharSet.LowerCase + PwCharSet.Digits;
|
/// <summary>
|
||||||
|
/// Latin-1 Supplement except U+00A0 (NBSP) and U+00AD (SHY).
|
||||||
|
/// </summary>
|
||||||
|
public static readonly string Latin1S =
|
||||||
|
"\u00A1\u00A2\u00A3\u00A4\u00A5\u00A6\u00A7" +
|
||||||
|
"\u00A8\u00A9\u00AA\u00AB\u00AC\u00AE\u00AF" +
|
||||||
|
"\u00B0\u00B1\u00B2\u00B3\u00B4\u00B5\u00B6\u00B7" +
|
||||||
|
"\u00B8\u00B9\u00BA\u00BB\u00BC\u00BD\u00BE\u00BF" +
|
||||||
|
"\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7" +
|
||||||
|
"\u00C8\u00C9\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF" +
|
||||||
|
"\u00D0\u00D1\u00D2\u00D3\u00D4\u00D5\u00D6\u00D7" +
|
||||||
|
"\u00D8\u00D9\u00DA\u00DB\u00DC\u00DD\u00DE\u00DF" +
|
||||||
|
"\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5\u00E6\u00E7" +
|
||||||
|
"\u00E8\u00E9\u00EA\u00EB\u00EC\u00ED\u00EE\u00EF" +
|
||||||
|
"\u00F0\u00F1\u00F2\u00F3\u00F4\u00F5\u00F6\u00F7" +
|
||||||
|
"\u00F8\u00F9\u00FA\u00FB\u00FC\u00FD\u00FE\u00FF";
|
||||||
|
|
||||||
private const int CharTabSize = (0x10000 / 8);
|
// internal static readonly string MenuAccels = PwCharSet.LowerCase + PwCharSet.Digits;
|
||||||
|
|
||||||
private List<char> m_vChars = new List<char>();
|
[Obsolete]
|
||||||
private byte[] m_vTab = new byte[CharTabSize];
|
public static string SpecialChars { get { return PwCharSet.Special; } }
|
||||||
|
[Obsolete]
|
||||||
|
public static string HighAnsiChars { get { return PwCharSet.Latin1S; } }
|
||||||
|
|
||||||
private static string m_strHighAnsi = null;
|
private readonly List<char> m_lChars = new List<char>();
|
||||||
public static string HighAnsiChars
|
private readonly byte[] m_vTab = new byte[0x10000 / 8];
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if(m_strHighAnsi == null) { new PwCharSet(); } // Create string
|
|
||||||
Debug.Assert(m_strHighAnsi != null);
|
|
||||||
return m_strHighAnsi;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string m_strSpecial = null;
|
/// <summary>
|
||||||
public static string SpecialChars
|
/// Create a new, empty character set.
|
||||||
{
|
/// </summary>
|
||||||
get
|
public PwCharSet()
|
||||||
{
|
{
|
||||||
if(m_strSpecial == null) { new PwCharSet(); } // Create string
|
Debug.Assert(PwCharSet.Latin1S.Length == (16 * 6 - 2));
|
||||||
Debug.Assert(m_strSpecial != null);
|
}
|
||||||
return m_strSpecial;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
public PwCharSet(string strCharSet)
|
||||||
/// Create a new, empty character set collection object.
|
{
|
||||||
/// </summary>
|
Add(strCharSet);
|
||||||
public PwCharSet()
|
}
|
||||||
{
|
|
||||||
Initialize(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public PwCharSet(string strCharSet)
|
/// <summary>
|
||||||
{
|
/// Number of characters in this set.
|
||||||
Initialize(true);
|
/// </summary>
|
||||||
Add(strCharSet);
|
public uint Size
|
||||||
}
|
{
|
||||||
|
get { return (uint)m_lChars.Count; }
|
||||||
|
}
|
||||||
|
|
||||||
private PwCharSet(bool bFullInitialize)
|
/// <summary>
|
||||||
{
|
/// Get a character of the set using an index.
|
||||||
Initialize(bFullInitialize);
|
/// </summary>
|
||||||
}
|
/// <param name="uPos">Index of the character to get.</param>
|
||||||
|
/// <returns>Character at the specified position. If the index is invalid,
|
||||||
|
/// an <c>ArgumentOutOfRangeException</c> is thrown.</returns>
|
||||||
|
public char this[uint uPos]
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (uPos >= (uint)m_lChars.Count)
|
||||||
|
throw new ArgumentOutOfRangeException("uPos");
|
||||||
|
|
||||||
private void Initialize(bool bFullInitialize)
|
return m_lChars[(int)uPos];
|
||||||
{
|
}
|
||||||
Clear();
|
}
|
||||||
|
|
||||||
if(!bFullInitialize) return;
|
public bool Equals(PwCharSet other)
|
||||||
|
{
|
||||||
|
if (object.ReferenceEquals(other, this)) return true;
|
||||||
|
if (object.ReferenceEquals(other, null)) return false;
|
||||||
|
|
||||||
if(m_strHighAnsi == null)
|
if (m_lChars.Count != other.m_lChars.Count) return false;
|
||||||
{
|
|
||||||
StringBuilder sbHighAnsi = new StringBuilder();
|
|
||||||
// [U+0080, U+009F] are C1 control characters,
|
|
||||||
// U+00A0 is non-breaking space
|
|
||||||
for(char ch = '\u00A1'; ch <= '\u00AC'; ++ch)
|
|
||||||
sbHighAnsi.Append(ch);
|
|
||||||
// U+00AD is soft hyphen (format character)
|
|
||||||
for(char ch = '\u00AE'; ch < '\u00FF'; ++ch)
|
|
||||||
sbHighAnsi.Append(ch);
|
|
||||||
sbHighAnsi.Append('\u00FF');
|
|
||||||
|
|
||||||
m_strHighAnsi = sbHighAnsi.ToString();
|
return MemUtil.ArraysEqual(m_vTab, other.m_vTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_strSpecial == null)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
PwCharSet pcs = new PwCharSet(false);
|
return Equals(obj as PwCharSet);
|
||||||
pcs.AddRange('!', '/');
|
}
|
||||||
pcs.AddRange(':', '@');
|
|
||||||
pcs.AddRange('[', '`');
|
|
||||||
pcs.Add(@"|~");
|
|
||||||
pcs.Remove(@"-_ ");
|
|
||||||
pcs.Remove(PwCharSet.Brackets);
|
|
||||||
|
|
||||||
m_strSpecial = pcs.ToString();
|
public override int GetHashCode()
|
||||||
}
|
{
|
||||||
}
|
return (int)MemUtil.Hash32(m_vTab, 0, m_vTab.Length);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of characters in this set.
|
/// Remove all characters from this set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint Size
|
public void Clear()
|
||||||
{
|
{
|
||||||
get { return (uint)m_vChars.Count; }
|
m_lChars.Clear();
|
||||||
}
|
Array.Clear(m_vTab, 0, m_vTab.Length);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
public bool Contains(char ch)
|
||||||
/// Get a character of the set using an index.
|
{
|
||||||
/// </summary>
|
return (((m_vTab[ch / 8] >> (ch % 8)) & 1) != char.MinValue);
|
||||||
/// <param name="uPos">Index of the character to get.</param>
|
}
|
||||||
/// <returns>Character at the specified position. If the index is invalid,
|
|
||||||
/// an <c>ArgumentOutOfRangeException</c> is thrown.</returns>
|
|
||||||
public char this[uint uPos]
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if(uPos >= (uint)m_vChars.Count)
|
|
||||||
throw new ArgumentOutOfRangeException("uPos");
|
|
||||||
|
|
||||||
return m_vChars[(int)uPos];
|
public bool Contains(string strCharacters)
|
||||||
}
|
{
|
||||||
}
|
Debug.Assert(strCharacters != null);
|
||||||
|
if (strCharacters == null) throw new ArgumentNullException("strCharacters");
|
||||||
|
|
||||||
/// <summary>
|
foreach (char ch in strCharacters)
|
||||||
/// Remove all characters from this set.
|
{
|
||||||
/// </summary>
|
if (!Contains(ch)) return false;
|
||||||
public void Clear()
|
}
|
||||||
{
|
|
||||||
m_vChars.Clear();
|
|
||||||
Array.Clear(m_vTab, 0, m_vTab.Length);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Contains(char ch)
|
return true;
|
||||||
{
|
}
|
||||||
return (((m_vTab[ch / 8] >> (ch % 8)) & 1) != char.MinValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Contains(string strCharacters)
|
/// <summary>
|
||||||
{
|
/// Add characters to the set.
|
||||||
Debug.Assert(strCharacters != null);
|
/// </summary>
|
||||||
if(strCharacters == null) throw new ArgumentNullException("strCharacters");
|
/// <param name="ch">Character to add.</param>
|
||||||
|
public void Add(char ch)
|
||||||
|
{
|
||||||
|
if (ch == char.MinValue) { Debug.Assert(false); return; }
|
||||||
|
|
||||||
foreach(char ch in strCharacters)
|
if (!Contains(ch))
|
||||||
{
|
{
|
||||||
if(!Contains(ch)) return false;
|
m_lChars.Add(ch);
|
||||||
}
|
m_vTab[ch / 8] |= (byte)(1 << (ch % 8));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
/// <summary>
|
||||||
}
|
/// Add characters to the set.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="strCharSet">String containing characters to add.</param>
|
||||||
|
public void Add(string strCharSet)
|
||||||
|
{
|
||||||
|
Debug.Assert(strCharSet != null);
|
||||||
|
if (strCharSet == null) throw new ArgumentNullException("strCharSet");
|
||||||
|
|
||||||
/// <summary>
|
foreach (char ch in strCharSet)
|
||||||
/// Add characters to the set.
|
Add(ch);
|
||||||
/// </summary>
|
}
|
||||||
/// <param name="ch">Character to add.</param>
|
|
||||||
public void Add(char ch)
|
|
||||||
{
|
|
||||||
if(ch == char.MinValue) { Debug.Assert(false); return; }
|
|
||||||
|
|
||||||
if(!Contains(ch))
|
public void Add(string strCharSet1, string strCharSet2)
|
||||||
{
|
{
|
||||||
m_vChars.Add(ch);
|
Add(strCharSet1);
|
||||||
m_vTab[ch / 8] |= (byte)(1 << (ch % 8));
|
Add(strCharSet2);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
public void Add(string strCharSet1, string strCharSet2, string strCharSet3)
|
||||||
/// Add characters to the set.
|
{
|
||||||
/// </summary>
|
Add(strCharSet1);
|
||||||
/// <param name="strCharSet">String containing characters to add.</param>
|
Add(strCharSet2);
|
||||||
public void Add(string strCharSet)
|
Add(strCharSet3);
|
||||||
{
|
}
|
||||||
Debug.Assert(strCharSet != null);
|
|
||||||
if(strCharSet == null) throw new ArgumentNullException("strCharSet");
|
|
||||||
|
|
||||||
m_vChars.Capacity = m_vChars.Count + strCharSet.Length;
|
public void AddRange(char chMin, char chMax)
|
||||||
|
{
|
||||||
|
for (char ch = chMin; ch < chMax; ++ch)
|
||||||
|
Add(ch);
|
||||||
|
|
||||||
foreach(char ch in strCharSet)
|
Add(chMax);
|
||||||
Add(ch);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void Add(string strCharSet1, string strCharSet2)
|
public bool AddCharSet(char chCharSetIdentifier)
|
||||||
{
|
{
|
||||||
Add(strCharSet1);
|
bool bResult = true;
|
||||||
Add(strCharSet2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Add(string strCharSet1, string strCharSet2, string strCharSet3)
|
switch (chCharSetIdentifier)
|
||||||
{
|
{
|
||||||
Add(strCharSet1);
|
case 'a': Add(PwCharSet.LowerCase, PwCharSet.Digits); break;
|
||||||
Add(strCharSet2);
|
case 'A':
|
||||||
Add(strCharSet3);
|
Add(PwCharSet.LowerCase, PwCharSet.UpperCase,
|
||||||
}
|
PwCharSet.Digits); break;
|
||||||
|
case 'U': Add(PwCharSet.UpperCase, PwCharSet.Digits); break;
|
||||||
|
case 'c': Add(PwCharSet.LowerConsonants); break;
|
||||||
|
case 'C':
|
||||||
|
Add(PwCharSet.LowerConsonants,
|
||||||
|
PwCharSet.UpperConsonants); break;
|
||||||
|
case 'z': Add(PwCharSet.UpperConsonants); break;
|
||||||
|
case 'd': Add(PwCharSet.Digits); break; // Digit
|
||||||
|
case 'h': Add(PwCharSet.LowerHex); break;
|
||||||
|
case 'H': Add(PwCharSet.UpperHex); break;
|
||||||
|
case 'l': Add(PwCharSet.LowerCase); break;
|
||||||
|
case 'L': Add(PwCharSet.LowerCase, PwCharSet.UpperCase); break;
|
||||||
|
case 'u': Add(PwCharSet.UpperCase); break;
|
||||||
|
case 'p': Add(PwCharSet.Punctuation); break;
|
||||||
|
case 'b': Add(PwCharSet.Brackets); break;
|
||||||
|
case 's': Add(PwCharSet.PrintableAsciiSpecial); break;
|
||||||
|
case 'S':
|
||||||
|
Add(PwCharSet.UpperCase, PwCharSet.LowerCase);
|
||||||
|
Add(PwCharSet.Digits, PwCharSet.PrintableAsciiSpecial); break;
|
||||||
|
case 'v': Add(PwCharSet.LowerVowels); break;
|
||||||
|
case 'V': Add(PwCharSet.LowerVowels, PwCharSet.UpperVowels); break;
|
||||||
|
case 'Z': Add(PwCharSet.UpperVowels); break;
|
||||||
|
case 'x': Add(PwCharSet.Latin1S); break;
|
||||||
|
default: bResult = false; break;
|
||||||
|
}
|
||||||
|
|
||||||
public void AddRange(char chMin, char chMax)
|
return bResult;
|
||||||
{
|
}
|
||||||
m_vChars.Capacity = m_vChars.Count + (chMax - chMin) + 1;
|
|
||||||
|
|
||||||
for(char ch = chMin; ch < chMax; ++ch)
|
public bool Remove(char ch)
|
||||||
Add(ch);
|
{
|
||||||
|
m_vTab[ch / 8] &= (byte)(~(1 << (ch % 8)));
|
||||||
|
return m_lChars.Remove(ch);
|
||||||
|
}
|
||||||
|
|
||||||
Add(chMax);
|
public bool Remove(string strCharacters)
|
||||||
}
|
{
|
||||||
|
Debug.Assert(strCharacters != null);
|
||||||
|
if (strCharacters == null) throw new ArgumentNullException("strCharacters");
|
||||||
|
|
||||||
public bool AddCharSet(char chCharSetIdentifier)
|
bool bResult = true;
|
||||||
{
|
foreach (char ch in strCharacters)
|
||||||
bool bResult = true;
|
{
|
||||||
|
if (!Remove(ch)) bResult = false;
|
||||||
|
}
|
||||||
|
|
||||||
switch(chCharSetIdentifier)
|
return bResult;
|
||||||
{
|
}
|
||||||
case 'a': Add(PwCharSet.LowerCase, PwCharSet.Digits); break;
|
|
||||||
case 'A': Add(PwCharSet.LowerCase, PwCharSet.UpperCase,
|
|
||||||
PwCharSet.Digits); break;
|
|
||||||
case 'U': Add(PwCharSet.UpperCase, PwCharSet.Digits); break;
|
|
||||||
case 'c': Add(PwCharSet.LowerConsonants); break;
|
|
||||||
case 'C': Add(PwCharSet.LowerConsonants,
|
|
||||||
PwCharSet.UpperConsonants); break;
|
|
||||||
case 'z': Add(PwCharSet.UpperConsonants); break;
|
|
||||||
case 'd': Add(PwCharSet.Digits); break; // Digit
|
|
||||||
case 'h': Add(PwCharSet.LowerHex); break;
|
|
||||||
case 'H': Add(PwCharSet.UpperHex); break;
|
|
||||||
case 'l': Add(PwCharSet.LowerCase); break;
|
|
||||||
case 'L': Add(PwCharSet.LowerCase, PwCharSet.UpperCase); break;
|
|
||||||
case 'u': Add(PwCharSet.UpperCase); break;
|
|
||||||
case 'p': Add(PwCharSet.Punctuation); break;
|
|
||||||
case 'b': Add(PwCharSet.Brackets); break;
|
|
||||||
case 's': Add(PwCharSet.PrintableAsciiSpecial); break;
|
|
||||||
case 'S': Add(PwCharSet.UpperCase, PwCharSet.LowerCase);
|
|
||||||
Add(PwCharSet.Digits, PwCharSet.PrintableAsciiSpecial); break;
|
|
||||||
case 'v': Add(PwCharSet.LowerVowels); break;
|
|
||||||
case 'V': Add(PwCharSet.LowerVowels, PwCharSet.UpperVowels); break;
|
|
||||||
case 'Z': Add(PwCharSet.UpperVowels); break;
|
|
||||||
case 'x': Add(m_strHighAnsi); break;
|
|
||||||
default: bResult = false; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return bResult;
|
public bool RemoveIfAllExist(string strCharacters)
|
||||||
}
|
{
|
||||||
|
Debug.Assert(strCharacters != null);
|
||||||
|
if (strCharacters == null) throw new ArgumentNullException("strCharacters");
|
||||||
|
|
||||||
public bool Remove(char ch)
|
if (!Contains(strCharacters))
|
||||||
{
|
return false;
|
||||||
m_vTab[ch / 8] &= (byte)(~(1 << (ch % 8)));
|
|
||||||
return m_vChars.Remove(ch);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Remove(string strCharacters)
|
return Remove(strCharacters);
|
||||||
{
|
}
|
||||||
Debug.Assert(strCharacters != null);
|
|
||||||
if(strCharacters == null) throw new ArgumentNullException("strCharacters");
|
|
||||||
|
|
||||||
bool bResult = true;
|
/// <summary>
|
||||||
foreach(char ch in strCharacters)
|
/// Convert the character set to a string containing all its characters.
|
||||||
{
|
/// </summary>
|
||||||
if(!Remove(ch)) bResult = false;
|
/// <returns>String containing all character set characters.</returns>
|
||||||
}
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder(m_lChars.Count);
|
||||||
|
foreach (char ch in m_lChars)
|
||||||
|
sb.Append(ch);
|
||||||
|
|
||||||
return bResult;
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RemoveIfAllExist(string strCharacters)
|
public string PackAndRemoveCharRanges()
|
||||||
{
|
{
|
||||||
Debug.Assert(strCharacters != null);
|
StringBuilder sb = new StringBuilder();
|
||||||
if(strCharacters == null) throw new ArgumentNullException("strCharacters");
|
|
||||||
|
|
||||||
if(!Contains(strCharacters))
|
sb.Append(RemoveIfAllExist(PwCharSet.UpperCase) ? 'U' : '_');
|
||||||
return false;
|
sb.Append(RemoveIfAllExist(PwCharSet.LowerCase) ? 'L' : '_');
|
||||||
|
sb.Append(RemoveIfAllExist(PwCharSet.Digits) ? 'D' : '_');
|
||||||
|
sb.Append(RemoveIfAllExist(PwCharSet.Special) ? 'S' : '_');
|
||||||
|
sb.Append(RemoveIfAllExist(PwCharSet.Punctuation) ? 'P' : '_');
|
||||||
|
sb.Append(RemoveIfAllExist("-") ? 'm' : '_');
|
||||||
|
sb.Append(RemoveIfAllExist("_") ? 'u' : '_');
|
||||||
|
sb.Append(RemoveIfAllExist(" ") ? 's' : '_');
|
||||||
|
sb.Append(RemoveIfAllExist(PwCharSet.Brackets) ? 'B' : '_');
|
||||||
|
sb.Append(RemoveIfAllExist(PwCharSet.Latin1S) ? 'H' : '_');
|
||||||
|
|
||||||
return Remove(strCharacters);
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
public void UnpackCharRanges(string strRanges)
|
||||||
/// Convert the character set to a string containing all its characters.
|
{
|
||||||
/// </summary>
|
if (strRanges == null) { Debug.Assert(false); return; }
|
||||||
/// <returns>String containing all character set characters.</returns>
|
if (strRanges.Length < 10) { Debug.Assert(false); return; }
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
foreach(char ch in m_vChars)
|
|
||||||
sb.Append(ch);
|
|
||||||
|
|
||||||
return sb.ToString();
|
if (strRanges[0] != '_') Add(PwCharSet.UpperCase);
|
||||||
}
|
if (strRanges[1] != '_') Add(PwCharSet.LowerCase);
|
||||||
|
if (strRanges[2] != '_') Add(PwCharSet.Digits);
|
||||||
public string PackAndRemoveCharRanges()
|
if (strRanges[3] != '_') Add(PwCharSet.Special);
|
||||||
{
|
if (strRanges[4] != '_') Add(PwCharSet.Punctuation);
|
||||||
StringBuilder sb = new StringBuilder();
|
if (strRanges[5] != '_') Add('-');
|
||||||
|
if (strRanges[6] != '_') Add('_');
|
||||||
sb.Append(RemoveIfAllExist(PwCharSet.UpperCase) ? 'U' : '_');
|
if (strRanges[7] != '_') Add(' ');
|
||||||
sb.Append(RemoveIfAllExist(PwCharSet.LowerCase) ? 'L' : '_');
|
if (strRanges[8] != '_') Add(PwCharSet.Brackets);
|
||||||
sb.Append(RemoveIfAllExist(PwCharSet.Digits) ? 'D' : '_');
|
if (strRanges[9] != '_') Add(PwCharSet.Latin1S);
|
||||||
sb.Append(RemoveIfAllExist(m_strSpecial) ? 'S' : '_');
|
}
|
||||||
sb.Append(RemoveIfAllExist(PwCharSet.Punctuation) ? 'P' : '_');
|
}
|
||||||
sb.Append(RemoveIfAllExist(@"-") ? 'm' : '_');
|
|
||||||
sb.Append(RemoveIfAllExist(@"_") ? 'u' : '_');
|
|
||||||
sb.Append(RemoveIfAllExist(@" ") ? 's' : '_');
|
|
||||||
sb.Append(RemoveIfAllExist(PwCharSet.Brackets) ? 'B' : '_');
|
|
||||||
sb.Append(RemoveIfAllExist(m_strHighAnsi) ? 'H' : '_');
|
|
||||||
|
|
||||||
return sb.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UnpackCharRanges(string strRanges)
|
|
||||||
{
|
|
||||||
if(strRanges == null) { Debug.Assert(false); return; }
|
|
||||||
if(strRanges.Length < 10) { Debug.Assert(false); return; }
|
|
||||||
|
|
||||||
if(strRanges[0] != '_') Add(PwCharSet.UpperCase);
|
|
||||||
if(strRanges[1] != '_') Add(PwCharSet.LowerCase);
|
|
||||||
if(strRanges[2] != '_') Add(PwCharSet.Digits);
|
|
||||||
if(strRanges[3] != '_') Add(m_strSpecial);
|
|
||||||
if(strRanges[4] != '_') Add(PwCharSet.Punctuation);
|
|
||||||
if(strRanges[5] != '_') Add('-');
|
|
||||||
if(strRanges[6] != '_') Add('_');
|
|
||||||
if(strRanges[7] != '_') Add(' ');
|
|
||||||
if(strRanges[8] != '_') Add(PwCharSet.Brackets);
|
|
||||||
if(strRanges[9] != '_') Add(m_strHighAnsi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
KeePass Password Safe - The Open-Source Password Manager
|
KeePass Password Safe - The Open-Source Password Manager
|
||||||
Copyright (C) 2003-2016 Dominik Reichl <dominik.reichl@t-online.de>
|
Copyright (C) 2003-2025 Dominik Reichl <dominik.reichl@t-online.de>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,133 +20,172 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
#if !KeePassUAP
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using KeePassLib.Resources;
|
||||||
using KeePassLib.Security;
|
using KeePassLib.Security;
|
||||||
using KeePassLib.Utility;
|
using KeePassLib.Utility;
|
||||||
|
|
||||||
namespace KeePassLib.Cryptography.PasswordGenerator
|
namespace KeePassLib.Cryptography.PasswordGenerator
|
||||||
{
|
{
|
||||||
public enum PwgError
|
public enum PwgError
|
||||||
{
|
{
|
||||||
Success = 0,
|
Success = 0,
|
||||||
Unknown = 1,
|
Unknown = 1,
|
||||||
TooFewCharacters = 2,
|
TooFewCharacters = 2,
|
||||||
UnknownAlgorithm = 3
|
UnknownAlgorithm = 3,
|
||||||
}
|
InvalidCharSet = 4,
|
||||||
|
InvalidPattern = 5
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Utility functions for generating random passwords.
|
/// Password generator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class PwGenerator
|
public static class PwGenerator
|
||||||
{
|
{
|
||||||
public static PwgError Generate(out ProtectedString psOut,
|
|
||||||
PwProfile pwProfile, byte[] pbUserEntropy,
|
|
||||||
CustomPwGeneratorPool pwAlgorithmPool)
|
|
||||||
{
|
|
||||||
Debug.Assert(pwProfile != null);
|
|
||||||
if (pwProfile == null) throw new ArgumentNullException("pwProfile");
|
|
||||||
|
|
||||||
CryptoRandomStream crs = CreateCryptoStream(pbUserEntropy);
|
private static CryptoRandomStream CreateRandomStream(byte[] pbAdditionalEntropy,
|
||||||
PwgError e = PwgError.Unknown;
|
out byte[] pbKey)
|
||||||
|
{
|
||||||
|
pbKey = CryptoRandom.Instance.GetRandomBytes(128);
|
||||||
|
|
||||||
if (pwProfile.GeneratorType == PasswordGeneratorType.CharSet)
|
// Mix in additional entropy
|
||||||
e = CharSetBasedGenerator.Generate(out psOut, pwProfile, crs);
|
Debug.Assert(pbKey.Length >= 64);
|
||||||
else if (pwProfile.GeneratorType == PasswordGeneratorType.Pattern)
|
if ((pbAdditionalEntropy != null) && (pbAdditionalEntropy.Length != 0))
|
||||||
e = PatternBasedGenerator.Generate(out psOut, pwProfile, crs);
|
{
|
||||||
else if (pwProfile.GeneratorType == PasswordGeneratorType.Custom)
|
using (SHA512Managed h = new SHA512Managed())
|
||||||
e = GenerateCustom(out psOut, pwProfile, crs, pwAlgorithmPool);
|
{
|
||||||
else { Debug.Assert(false); psOut = ProtectedString.Empty; }
|
byte[] pbHash = h.ComputeHash(pbAdditionalEntropy);
|
||||||
|
MemUtil.XorArray(pbHash, 0, pbKey, 0, pbHash.Length);
|
||||||
|
MemUtil.ZeroByteArray(pbHash);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return e;
|
return new CryptoRandomStream(CrsAlgorithm.ChaCha20, pbKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CryptoRandomStream CreateCryptoStream(byte[] pbAdditionalEntropy)
|
internal static char GenerateCharacter(PwCharSet pwCharSet,
|
||||||
{
|
CryptoRandomStream crsRandomSource)
|
||||||
byte[] pbKey = CryptoRandom.Instance.GetRandomBytes(128);
|
{
|
||||||
|
uint cc = pwCharSet.Size;
|
||||||
|
if (cc == 0) return char.MinValue;
|
||||||
|
|
||||||
// Mix in additional entropy
|
uint i = (uint)crsRandomSource.GetRandomUInt64(cc);
|
||||||
Debug.Assert(pbKey.Length >= 64);
|
return pwCharSet[i];
|
||||||
if ((pbAdditionalEntropy != null) && (pbAdditionalEntropy.Length > 0))
|
}
|
||||||
{
|
|
||||||
using (SHA512Managed h = new SHA512Managed())
|
|
||||||
{
|
|
||||||
byte[] pbHash = h.ComputeHash(pbAdditionalEntropy);
|
|
||||||
MemUtil.XorArray(pbHash, 0, pbKey, 0, pbHash.Length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new CryptoRandomStream(CrsAlgorithm.ChaCha20, pbKey);
|
internal static bool PrepareCharSet(PwCharSet pwCharSet, PwProfile pwProfile)
|
||||||
}
|
{
|
||||||
|
uint cc = pwCharSet.Size;
|
||||||
|
for (uint i = 0; i < cc; ++i)
|
||||||
|
{
|
||||||
|
char ch = pwCharSet[i];
|
||||||
|
if ((ch == char.MinValue) || (ch == '\t') || (ch == '\r') ||
|
||||||
|
(ch == '\n') || char.IsSurrogate(ch))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
internal static char GenerateCharacter(PwProfile pwProfile,
|
if (pwProfile.ExcludeLookAlike) pwCharSet.Remove(PwCharSet.LookAlike);
|
||||||
PwCharSet pwCharSet, CryptoRandomStream crsRandomSource)
|
|
||||||
{
|
|
||||||
if (pwCharSet.Size == 0) return char.MinValue;
|
|
||||||
|
|
||||||
ulong uIndex = crsRandomSource.GetRandomUInt64();
|
if (!string.IsNullOrEmpty(pwProfile.ExcludeCharacters))
|
||||||
uIndex %= (ulong)pwCharSet.Size;
|
pwCharSet.Remove(pwProfile.ExcludeCharacters);
|
||||||
|
|
||||||
char ch = pwCharSet[(uint)uIndex];
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (pwProfile.NoRepeatingCharacters)
|
internal static void Shuffle(char[] v, CryptoRandomStream crsRandomSource)
|
||||||
pwCharSet.Remove(ch);
|
{
|
||||||
|
if (v == null) { Debug.Assert(false); return; }
|
||||||
|
if (crsRandomSource == null) { Debug.Assert(false); return; }
|
||||||
|
|
||||||
return ch;
|
for (int i = v.Length - 1; i >= 1; --i)
|
||||||
}
|
{
|
||||||
|
int j = (int)crsRandomSource.GetRandomUInt64((ulong)(i + 1));
|
||||||
|
|
||||||
internal static void PrepareCharSet(PwCharSet pwCharSet, PwProfile pwProfile)
|
char t = v[i];
|
||||||
{
|
v[i] = v[j];
|
||||||
pwCharSet.Remove(PwCharSet.Invalid);
|
v[j] = t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (pwProfile.ExcludeLookAlike) pwCharSet.Remove(PwCharSet.LookAlike);
|
private static PwgError GenerateCustom(out ProtectedString psOut,
|
||||||
|
PwProfile pwProfile, CryptoRandomStream crs,
|
||||||
|
CustomPwGeneratorPool pwAlgorithmPool)
|
||||||
|
{
|
||||||
|
psOut = ProtectedString.Empty;
|
||||||
|
|
||||||
if (pwProfile.ExcludeCharacters.Length > 0)
|
Debug.Assert(pwProfile.GeneratorType == PasswordGeneratorType.Custom);
|
||||||
pwCharSet.Remove(pwProfile.ExcludeCharacters);
|
if (pwAlgorithmPool == null) return PwgError.UnknownAlgorithm;
|
||||||
}
|
|
||||||
|
|
||||||
internal static void ShufflePassword(char[] pPassword,
|
string strID = pwProfile.CustomAlgorithmUuid;
|
||||||
CryptoRandomStream crsRandomSource)
|
if (string.IsNullOrEmpty(strID)) return PwgError.UnknownAlgorithm;
|
||||||
{
|
|
||||||
Debug.Assert(pPassword != null); if (pPassword == null) return;
|
|
||||||
Debug.Assert(crsRandomSource != null); if (crsRandomSource == null) return;
|
|
||||||
|
|
||||||
if (pPassword.Length <= 1) return; // Nothing to shuffle
|
byte[] pbUuid = Convert.FromBase64String(strID);
|
||||||
|
PwUuid uuid = new PwUuid(pbUuid);
|
||||||
|
CustomPwGenerator pwg = pwAlgorithmPool.Find(uuid);
|
||||||
|
if (pwg == null) { Debug.Assert(false); return PwgError.UnknownAlgorithm; }
|
||||||
|
|
||||||
for (int nSelect = 0; nSelect < pPassword.Length; ++nSelect)
|
ProtectedString pwd = pwg.Generate(pwProfile.CloneDeep(), crs);
|
||||||
{
|
if (pwd == null) return PwgError.Unknown;
|
||||||
ulong uRandomIndex = crsRandomSource.GetRandomUInt64();
|
|
||||||
uRandomIndex %= (ulong)(pPassword.Length - nSelect);
|
|
||||||
|
|
||||||
char chTemp = pPassword[nSelect];
|
psOut = pwd;
|
||||||
pPassword[nSelect] = pPassword[nSelect + (int)uRandomIndex];
|
return PwgError.Success;
|
||||||
pPassword[nSelect + (int)uRandomIndex] = chTemp;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static PwgError GenerateCustom(out ProtectedString psOut,
|
internal static string ErrorToString(PwgError e, bool bHeader)
|
||||||
PwProfile pwProfile, CryptoRandomStream crs,
|
{
|
||||||
CustomPwGeneratorPool pwAlgorithmPool)
|
if (e == PwgError.Success) { Debug.Assert(false); return string.Empty; }
|
||||||
{
|
if ((e == PwgError.Unknown) && bHeader) return KLRes.PwGenFailed;
|
||||||
psOut = ProtectedString.Empty;
|
|
||||||
|
|
||||||
Debug.Assert(pwProfile.GeneratorType == PasswordGeneratorType.Custom);
|
string str = KLRes.UnknownError;
|
||||||
if (pwAlgorithmPool == null) return PwgError.UnknownAlgorithm;
|
switch (e)
|
||||||
|
{
|
||||||
|
// case PwgError.Success:
|
||||||
|
// break;
|
||||||
|
|
||||||
string strID = pwProfile.CustomAlgorithmUuid;
|
case PwgError.Unknown:
|
||||||
if (string.IsNullOrEmpty(strID)) { Debug.Assert(false); return PwgError.UnknownAlgorithm; }
|
break;
|
||||||
|
|
||||||
byte[] pbUuid = Convert.FromBase64String(strID);
|
case PwgError.TooFewCharacters:
|
||||||
PwUuid uuid = new PwUuid(pbUuid);
|
str = KLRes.CharSetTooFewChars;
|
||||||
CustomPwGenerator pwg = pwAlgorithmPool.Find(uuid);
|
break;
|
||||||
if (pwg == null) { Debug.Assert(false); return PwgError.UnknownAlgorithm; }
|
|
||||||
|
|
||||||
ProtectedString pwd = pwg.Generate(pwProfile.CloneDeep(), crs);
|
case PwgError.UnknownAlgorithm:
|
||||||
if (pwd == null) return PwgError.Unknown;
|
str = KLRes.AlgorithmUnknown;
|
||||||
|
break;
|
||||||
|
|
||||||
psOut = pwd;
|
case PwgError.InvalidCharSet:
|
||||||
return PwgError.Success;
|
str = KLRes.CharSetInvalid;
|
||||||
}
|
break;
|
||||||
}
|
|
||||||
|
case PwgError.InvalidPattern:
|
||||||
|
str = KLRes.PatternInvalid;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
Debug.Assert(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bHeader)
|
||||||
|
str = KLRes.PwGenFailed + MessageService.NewParagraph + str;
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static string ErrorToString(Exception ex, bool bHeader)
|
||||||
|
{
|
||||||
|
string str = ((ex == null) ? KLRes.UnknownError :
|
||||||
|
StrUtil.FormatException(ex));
|
||||||
|
|
||||||
|
if (bHeader)
|
||||||
|
str = KLRes.PwGenFailed + MessageService.NewParagraph + str;
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
KeePass Password Safe - The Open-Source Password Manager
|
KeePass Password Safe - The Open-Source Password Manager
|
||||||
Copyright (C) 2003-2017 Dominik Reichl <dominik.reichl@t-online.de>
|
Copyright (C) 2003-2025 Dominik Reichl <dominik.reichl@t-online.de>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,116 +19,115 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
using KeePassLib.Utility;
|
using KeePassLib.Utility;
|
||||||
|
|
||||||
namespace KeePassLib.Cryptography
|
namespace KeePassLib.Cryptography
|
||||||
{
|
{
|
||||||
public static class PopularPasswords
|
public static class PopularPasswords
|
||||||
{
|
{
|
||||||
private static Dictionary<int, Dictionary<string, bool>> m_dicts =
|
private static readonly Dictionary<int, Dictionary<char[], bool>> g_dicts =
|
||||||
new Dictionary<int, Dictionary<string, bool>>();
|
new Dictionary<int, Dictionary<char[], bool>>();
|
||||||
|
|
||||||
internal static int MaxLength
|
internal static int MaxLength
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
Debug.Assert(m_dicts.Count > 0); // Should be initialized
|
Debug.Assert(g_dicts.Count > 0); // Should be initialized
|
||||||
|
|
||||||
int iMaxLen = 0;
|
int iMaxLen = 0;
|
||||||
foreach(int iLen in m_dicts.Keys)
|
foreach (int iLen in g_dicts.Keys)
|
||||||
{
|
{
|
||||||
if(iLen > iMaxLen) iMaxLen = iLen;
|
if (iLen > iMaxLen) iMaxLen = iLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
return iMaxLen;
|
return iMaxLen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static bool ContainsLength(int nLength)
|
internal static bool ContainsLength(int nLength)
|
||||||
{
|
{
|
||||||
Dictionary<string, bool> dDummy;
|
Dictionary<char[], bool> dDummy;
|
||||||
return m_dicts.TryGetValue(nLength, out dDummy);
|
return g_dicts.TryGetValue(nLength, out dDummy);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsPopularPassword(char[] vPassword)
|
public static bool IsPopularPassword(char[] vPassword)
|
||||||
{
|
{
|
||||||
ulong uDummy;
|
ulong uDummy;
|
||||||
return IsPopularPassword(vPassword, out uDummy);
|
return IsPopularPassword(vPassword, out uDummy);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsPopularPassword(char[] vPassword, out ulong uDictSize)
|
public static bool IsPopularPassword(char[] vPassword, out ulong uDictSize)
|
||||||
{
|
{
|
||||||
if(vPassword == null) throw new ArgumentNullException("vPassword");
|
if (vPassword == null) throw new ArgumentNullException("vPassword");
|
||||||
if(vPassword.Length == 0) { uDictSize = 0; return false; }
|
if (vPassword.Length == 0) { uDictSize = 0; return false; }
|
||||||
|
|
||||||
string str = new string(vPassword);
|
#if DEBUG
|
||||||
|
Array.ForEach(vPassword, ch => Debug.Assert(ch == char.ToLower(ch)));
|
||||||
|
#endif
|
||||||
|
|
||||||
try { return IsPopularPasswordPriv(str, out uDictSize); }
|
try { return IsPopularPasswordPriv(vPassword, out uDictSize); }
|
||||||
catch(Exception) { Debug.Assert(false); }
|
catch (Exception) { Debug.Assert(false); }
|
||||||
|
|
||||||
uDictSize = 0;
|
uDictSize = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool IsPopularPasswordPriv(string str, out ulong uDictSize)
|
private static bool IsPopularPasswordPriv(char[] vPassword, out ulong uDictSize)
|
||||||
{
|
{
|
||||||
Debug.Assert(m_dicts.Count > 0); // Should be initialized with data
|
Debug.Assert(g_dicts.Count > 0); // Should be initialized with data
|
||||||
|
|
||||||
Dictionary<string, bool> d;
|
Dictionary<char[], bool> d;
|
||||||
if(!m_dicts.TryGetValue(str.Length, out d))
|
if (!g_dicts.TryGetValue(vPassword.Length, out d))
|
||||||
{
|
{
|
||||||
uDictSize = 0;
|
uDictSize = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uDictSize = (ulong)d.Count;
|
uDictSize = (ulong)d.Count;
|
||||||
return d.ContainsKey(str);
|
return d.ContainsKey(vPassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Add(byte[] pbData, bool bGZipped)
|
public static void Add(byte[] pbData, bool bGZipped)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(bGZipped)
|
if (bGZipped)
|
||||||
pbData = MemUtil.Decompress(pbData);
|
pbData = MemUtil.Decompress(pbData);
|
||||||
|
|
||||||
string strData = StrUtil.Utf8.GetString(pbData, 0, pbData.Length);
|
string strData = StrUtil.Utf8.GetString(pbData, 0, pbData.Length);
|
||||||
if(string.IsNullOrEmpty(strData)) { Debug.Assert(false); return; }
|
if (string.IsNullOrEmpty(strData)) { Debug.Assert(false); return; }
|
||||||
|
|
||||||
if(!char.IsWhiteSpace(strData[strData.Length - 1]))
|
StringBuilder sb = new StringBuilder();
|
||||||
strData += "\n";
|
for (int i = 0; i <= strData.Length; ++i)
|
||||||
|
{
|
||||||
|
char ch = ((i == strData.Length) ? ' ' : strData[i]);
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
if (char.IsWhiteSpace(ch))
|
||||||
for(int i = 0; i < strData.Length; ++i)
|
{
|
||||||
{
|
int cc = sb.Length;
|
||||||
char ch = strData[i];
|
if (cc > 0)
|
||||||
|
{
|
||||||
|
char[] vWord = new char[cc];
|
||||||
|
sb.CopyTo(0, vWord, 0, cc);
|
||||||
|
|
||||||
if(char.IsWhiteSpace(ch))
|
Dictionary<char[], bool> d;
|
||||||
{
|
if (!g_dicts.TryGetValue(cc, out d))
|
||||||
int cc = sb.Length;
|
{
|
||||||
if(cc > 0)
|
d = new Dictionary<char[], bool>(MemUtil.ArrayHelperExOfChar);
|
||||||
{
|
g_dicts[cc] = d;
|
||||||
string strWord = sb.ToString();
|
}
|
||||||
Debug.Assert(strWord.Length == cc);
|
|
||||||
|
|
||||||
Dictionary<string, bool> d;
|
d[vWord] = true;
|
||||||
if(!m_dicts.TryGetValue(cc, out d))
|
sb.Remove(0, cc);
|
||||||
{
|
}
|
||||||
d = new Dictionary<string, bool>();
|
}
|
||||||
m_dicts[cc] = d;
|
else sb.Append(char.ToLower(ch));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
d[strWord] = true;
|
catch (Exception) { Debug.Assert(false); }
|
||||||
sb.Remove(0, cc);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else sb.Append(char.ToLower(ch));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(Exception) { Debug.Assert(false); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -46,4 +46,12 @@ namespace KeePassLib.Delegates
|
|||||||
public delegate void VoidDelegate();
|
public delegate void VoidDelegate();
|
||||||
|
|
||||||
public delegate string StrPwEntryDelegate(string str, PwEntry pe);
|
public delegate string StrPwEntryDelegate(string str, PwEntry pe);
|
||||||
|
|
||||||
|
public delegate TResult GFunc<TResult>();
|
||||||
|
public delegate TResult GFunc<T, TResult>(T o);
|
||||||
|
public delegate TResult GFunc<T1, T2, TResult>(T1 o1, T2 o2);
|
||||||
|
public delegate TResult GFunc<T1, T2, T3, TResult>(T1 o1, T2 o2, T3 o3);
|
||||||
|
public delegate TResult GFunc<T1, T2, T3, T4, TResult>(T1 o1, T2 o2, T3 o3, T4 o4);
|
||||||
|
public delegate TResult GFunc<T1, T2, T3, T4, T5, TResult>(T1 o1, T2 o2, T3 o3, T4 o4, T5 o5);
|
||||||
|
public delegate TResult GFunc<T1, T2, T3, T4, T5, T6, TResult>(T1 o1, T2 o2, T3 o3, T4 o4, T5 o5, T6 o6);
|
||||||
}
|
}
|
||||||
|
@@ -116,12 +116,23 @@ namespace keepass2android
|
|||||||
|
|
||||||
Intent sendIntent = new Intent();
|
Intent sendIntent = new Intent();
|
||||||
sendIntent.SetAction(Intent.ActionSend);
|
sendIntent.SetAction(Intent.ActionSend);
|
||||||
sendIntent.PutExtra(Intent.ExtraText, File.ReadAllText(LogFilename));
|
string logText = File.ReadAllText(LogFilename);
|
||||||
|
|
||||||
|
sendIntent.PutExtra(Intent.ExtraText, logText);
|
||||||
sendIntent.PutExtra(Intent.ExtraEmail, "crocoapps@gmail.com");
|
sendIntent.PutExtra(Intent.ExtraEmail, "crocoapps@gmail.com");
|
||||||
sendIntent.PutExtra(Intent.ExtraSubject, "Keepass2Android log");
|
sendIntent.PutExtra(Intent.ExtraSubject, "Keepass2Android log");
|
||||||
sendIntent.SetType("text/plain");
|
sendIntent.SetType("text/plain");
|
||||||
ctx.StartActivity(Intent.CreateChooser(sendIntent, "Send log to..."));
|
try
|
||||||
}
|
{
|
||||||
|
ctx.StartActivity(Intent.CreateChooser(sendIntent, "Send log to..."));
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Toast.MakeText(ctx, $"Error sending log of length {logText.Length} bytes: " + e.Message, ToastLength.Long)?.Show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static void LogTask(object task, string activityName)
|
public static void LogTask(object task, string activityName)
|
||||||
{
|
{
|
||||||
|
@@ -83,6 +83,7 @@ namespace KeePassLib.Serialization
|
|||||||
if (m_bUsedOnce)
|
if (m_bUsedOnce)
|
||||||
throw new InvalidOperationException("Do not reuse KdbxFile objects!");
|
throw new InvalidOperationException("Do not reuse KdbxFile objects!");
|
||||||
m_bUsedOnce = true;
|
m_bUsedOnce = true;
|
||||||
|
Kp2aLog.Log("Starting to load KDBX file...");
|
||||||
|
|
||||||
#if KDBX_BENCHMARK
|
#if KDBX_BENCHMARK
|
||||||
Stopwatch swTime = Stopwatch.StartNew();
|
Stopwatch swTime = Stopwatch.StartNew();
|
||||||
@@ -257,7 +258,8 @@ namespace KeePassLib.Serialization
|
|||||||
MessageService.ShowInfo("Loading KDBX took " +
|
MessageService.ShowInfo("Loading KDBX took " +
|
||||||
swTime.ElapsedMilliseconds.ToString() + " ms.");
|
swTime.ElapsedMilliseconds.ToString() + " ms.");
|
||||||
#endif
|
#endif
|
||||||
}
|
Kp2aLog.Log("Finished loading KDBX file.");
|
||||||
|
}
|
||||||
|
|
||||||
private void CommonCleanUpRead(List<Stream> lStreams, HashingStreamEx sHashing)
|
private void CommonCleanUpRead(List<Stream> lStreams, HashingStreamEx sHashing)
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,7 @@ namespace Kp2aAutofillParserTest
|
|||||||
StructureParserBase<TestInputField> parser =
|
StructureParserBase<TestInputField> parser =
|
||||||
new StructureParserBase<TestInputField>(new TestLogger(), new TestDalSourceTrustAll());
|
new StructureParserBase<TestInputField>(new TestLogger(), new TestDalSourceTrustAll());
|
||||||
|
|
||||||
var result = parser.ParseForFill(false, autofillView);
|
var result = parser.ParseForFill(autofillView);
|
||||||
if (expectedPackageName != null)
|
if (expectedPackageName != null)
|
||||||
Assert.Equal(expectedPackageName, result.PackageName);
|
Assert.Equal(expectedPackageName, result.PackageName);
|
||||||
if (expectedWebDomain != null)
|
if (expectedWebDomain != null)
|
||||||
|
@@ -58,7 +58,8 @@
|
|||||||
"IsFocused": false,
|
"IsFocused": false,
|
||||||
"InputType": 97,
|
"InputType": 97,
|
||||||
"HtmlInfoTag": null,
|
"HtmlInfoTag": null,
|
||||||
"HtmlInfoTypeAttribute": null
|
"HtmlInfoTypeAttribute": null,
|
||||||
|
"ExpectedAssignedHints": [ "username" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"IdEntry": "password_text_input_layout",
|
"IdEntry": "password_text_input_layout",
|
||||||
@@ -81,6 +82,7 @@
|
|||||||
"InputType": 129,
|
"InputType": 129,
|
||||||
"HtmlInfoTag": null,
|
"HtmlInfoTag": null,
|
||||||
"HtmlInfoTypeAttribute": null,
|
"HtmlInfoTypeAttribute": null,
|
||||||
|
"ExpectedAssignedHints": [ "password" ]
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -445,6 +445,9 @@ namespace Kp2aAutofillParser
|
|||||||
|
|
||||||
public static string ToCanonicalHint(string hint)
|
public static string ToCanonicalHint(string hint)
|
||||||
{
|
{
|
||||||
|
//avoid crash when looking up a null key
|
||||||
|
if (hint == null)
|
||||||
|
return "";
|
||||||
string canonicalHint;
|
string canonicalHint;
|
||||||
if (!hintToCanonicalReplacement.TryGetValue(hint, out canonicalHint))
|
if (!hintToCanonicalReplacement.TryGetValue(hint, out canonicalHint))
|
||||||
canonicalHint = hint;
|
canonicalHint = hint;
|
||||||
@@ -473,8 +476,16 @@ namespace Kp2aAutofillParser
|
|||||||
|
|
||||||
foreach (var field in autofillFields.HintMap.Values.Distinct())
|
foreach (var field in autofillFields.HintMap.Values.Distinct())
|
||||||
{
|
{
|
||||||
|
if (field == null || field.AutofillHints == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
foreach (var hint in field.AutofillHints)
|
foreach (var hint in field.AutofillHints)
|
||||||
{
|
{
|
||||||
|
if (hint == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (GetPartitionIndex(hint) == partitionIndex)
|
if (GetPartitionIndex(hint) == partitionIndex)
|
||||||
{
|
{
|
||||||
filteredCollection.Add(field);
|
filteredCollection.Add(field);
|
||||||
@@ -730,7 +741,7 @@ namespace Kp2aAutofillParser
|
|||||||
{
|
{
|
||||||
public List<TField> InputFields { get; set; } = new List<TField>();
|
public List<TField> InputFields { get; set; } = new List<TField>();
|
||||||
|
|
||||||
public string PackageId { get; set; } = null;
|
public string? PackageId { get; set; } = null;
|
||||||
public string WebDomain { get; set; } = null;
|
public string WebDomain { get; set; } = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -790,14 +801,14 @@ namespace Kp2aAutofillParser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public AutofillTargetId ParseForFill(bool isManual, AutofillView<FieldT> autofillView)
|
public AutofillTargetId ParseForFill(AutofillView<FieldT> autofillView)
|
||||||
{
|
{
|
||||||
return Parse(true, isManual, autofillView);
|
return Parse(true, autofillView);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AutofillTargetId ParseForSave(AutofillView<FieldT> autofillView)
|
public AutofillTargetId ParseForSave(AutofillView<FieldT> autofillView)
|
||||||
{
|
{
|
||||||
return Parse(false, true, autofillView);
|
return Parse(false, autofillView);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -805,8 +816,7 @@ namespace Kp2aAutofillParser
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The parse.</returns>
|
/// <returns>The parse.</returns>
|
||||||
/// <param name="forFill">If set to <c>true</c> for fill.</param>
|
/// <param name="forFill">If set to <c>true</c> for fill.</param>
|
||||||
/// <param name="isManualRequest"></param>
|
protected virtual AutofillTargetId Parse(bool forFill, AutofillView<FieldT> autofillView)
|
||||||
protected virtual AutofillTargetId Parse(bool forFill, bool isManualRequest, AutofillView<FieldT> autofillView)
|
|
||||||
{
|
{
|
||||||
AutofillTargetId result = new AutofillTargetId()
|
AutofillTargetId result = new AutofillTargetId()
|
||||||
{
|
{
|
||||||
@@ -841,6 +851,7 @@ namespace Kp2aAutofillParser
|
|||||||
continue;
|
continue;
|
||||||
if (viewHints.Where(h => h != null).Select(AutofillHintsHelper.ToCanonicalHint).Intersect(_autofillHintsForLogin).Any())
|
if (viewHints.Where(h => h != null).Select(AutofillHintsHelper.ToCanonicalHint).Intersect(_autofillHintsForLogin).Any())
|
||||||
{
|
{
|
||||||
|
|
||||||
AddFieldToHintMap(viewNode, viewHints.Where(h => h != null).Select(AutofillHintsHelper.ToCanonicalHint).ToHashSet().ToArray());
|
AddFieldToHintMap(viewNode, viewHints.Where(h => h != null).Select(AutofillHintsHelper.ToCanonicalHint).ToHashSet().ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -872,8 +883,9 @@ namespace Kp2aAutofillParser
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//for "heuristic determination" we demand that one of the filled fields is focused:
|
//for "heuristic determination" we demand that there is a password field or one of the username fields is focused:
|
||||||
if (passwordFields.Concat(usernameFields).Any(f => f.IsFocused))
|
//Note that "IsFocused" might be false even when tapping the field. It might require long-press to autofill.
|
||||||
|
if (passwordFields.Any() || usernameFields.Any(f => f.IsFocused))
|
||||||
{
|
{
|
||||||
foreach (var uf in usernameFields)
|
foreach (var uf in usernameFields)
|
||||||
AddFieldToHintMap(uf, new string[] { AutofillHintsHelper.AutofillHintUsername });
|
AddFieldToHintMap(uf, new string[] { AutofillHintsHelper.AutofillHintUsername });
|
||||||
|
@@ -29,6 +29,14 @@ namespace keepass2android
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public enum MessageSeverity
|
||||||
|
{
|
||||||
|
Info,
|
||||||
|
Warning,
|
||||||
|
Error
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interface through which Activities and the logic layer can access some app specific functionalities and Application static data
|
/// Interface through which Activities and the logic layer can access some app specific functionalities and Application static data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -102,10 +110,13 @@ namespace keepass2android
|
|||||||
Context ctx,
|
Context ctx,
|
||||||
string messageSuffix = "");
|
string messageSuffix = "");
|
||||||
|
|
||||||
/// <summary>
|
void ShowMessage(Context ctx, int resourceId, MessageSeverity severity);
|
||||||
/// Returns a Handler object which can run tasks on the UI thread
|
void ShowMessage(Context ctx, string text, MessageSeverity severity);
|
||||||
/// </summary>
|
|
||||||
Handler UiThreadHandler { get; }
|
/// <summary>
|
||||||
|
/// Returns a Handler object which can run tasks on the UI thread
|
||||||
|
/// </summary>
|
||||||
|
Handler UiThreadHandler { get; }
|
||||||
|
|
||||||
IProgressDialog CreateProgressDialog(Context ctx);
|
IProgressDialog CreateProgressDialog(Context ctx);
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ using Android.Content.PM;
|
|||||||
using Android.OS;
|
using Android.OS;
|
||||||
using Android.Preferences;
|
using Android.Preferences;
|
||||||
using Java.IO;
|
using Java.IO;
|
||||||
|
using KeePass.Util;
|
||||||
using KeePassLib.Serialization;
|
using KeePassLib.Serialization;
|
||||||
using KeePassLib.Utility;
|
using KeePassLib.Utility;
|
||||||
using File = System.IO.File;
|
using File = System.IO.File;
|
||||||
@@ -121,7 +121,7 @@ namespace keepass2android.Io
|
|||||||
var response = ex.Response as HttpWebResponse;
|
var response = ex.Response as HttpWebResponse;
|
||||||
if ((response != null) && (response.StatusCode == HttpStatusCode.NotFound))
|
if ((response != null) && (response.StatusCode == HttpStatusCode.NotFound))
|
||||||
{
|
{
|
||||||
throw new FileNotFoundException(ex.Message, ioc.Path, ex);
|
throw new FileNotFoundException(ExceptionUtil.GetErrorMessage(ex), ioc.Path, ex);
|
||||||
}
|
}
|
||||||
if (ex.Status == WebExceptionStatus.TrustFailure)
|
if (ex.Status == WebExceptionStatus.TrustFailure)
|
||||||
{
|
{
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
namespace keepass2android.Io
|
|
||||||
{
|
|
||||||
public partial class DropboxFileStorage
|
|
||||||
{
|
|
||||||
private const string AppKey = "dummy";
|
|
||||||
private const string AppSecret = "dummy";
|
|
||||||
}
|
|
||||||
public partial class DropboxAppFolderFileStorage
|
|
||||||
{
|
|
||||||
private const string AppKey = "dummy";
|
|
||||||
private const string AppSecret = "dummy";
|
|
||||||
}
|
|
||||||
}
|
|
27
src/Kp2aBusinessLogic/Io/GenerateSecrets.targets
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<Project>
|
||||||
|
<Target Name="GenerateDropboxSecrets" BeforeTargets="BeforeCompile"
|
||||||
|
Inputs="@(DropboxSecretLines)"
|
||||||
|
Outputs="DropboxFileStorage.g.cs">
|
||||||
|
|
||||||
|
<WriteLinesToFile
|
||||||
|
File="Io/DropboxFileStorage.g.cs"
|
||||||
|
Lines="@(DropboxSecretLines->'%(Text)')"
|
||||||
|
Overwrite="true"
|
||||||
|
/>
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<DropboxSecretLines Include="GeneratedDropboxSecrets">
|
||||||
|
<Text>namespace keepass2android.Io {
|
||||||
|
public partial class DropboxFileStorage {
|
||||||
|
private const string AppKey = "$(DropboxAppKey)";
|
||||||
|
private const string AppSecret = "$(DropboxAppSecret)";
|
||||||
|
}
|
||||||
|
public partial class DropboxAppFolderFileStorage {
|
||||||
|
private const string AppKey = "$(DropboxAppFolderAppKey)";
|
||||||
|
private const string AppSecret = "$(DropboxAppFolderAppSecret)";
|
||||||
|
}
|
||||||
|
}</Text>
|
||||||
|
</DropboxSecretLines>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
@@ -13,6 +13,7 @@ using Keepass2android.Javafilestorage;
|
|||||||
#endif
|
#endif
|
||||||
using Exception = System.Exception;
|
using Exception = System.Exception;
|
||||||
using FileNotFoundException = Java.IO.FileNotFoundException;
|
using FileNotFoundException = Java.IO.FileNotFoundException;
|
||||||
|
using KeePass.Util;
|
||||||
|
|
||||||
namespace keepass2android.Io
|
namespace keepass2android.Io
|
||||||
{
|
{
|
||||||
@@ -42,7 +43,7 @@ namespace keepass2android.Io
|
|||||||
}
|
}
|
||||||
catch (FileNotFoundException e)
|
catch (FileNotFoundException e)
|
||||||
{
|
{
|
||||||
throw new System.IO.FileNotFoundException(e.Message, e);
|
throw new System.IO.FileNotFoundException(ExceptionUtil.GetErrorMessage(e), e);
|
||||||
}
|
}
|
||||||
catch (Java.Lang.Exception e)
|
catch (Java.Lang.Exception e)
|
||||||
{
|
{
|
||||||
@@ -195,7 +196,7 @@ namespace keepass2android.Io
|
|||||||
}
|
}
|
||||||
catch (FileNotFoundException e)
|
catch (FileNotFoundException e)
|
||||||
{
|
{
|
||||||
throw new System.IO.FileNotFoundException(e.Message, e);
|
throw new System.IO.FileNotFoundException(ExceptionUtil.GetErrorMessage(e), e);
|
||||||
}
|
}
|
||||||
catch (Java.Lang.Exception e)
|
catch (Java.Lang.Exception e)
|
||||||
{
|
{
|
||||||
@@ -214,7 +215,7 @@ namespace keepass2android.Io
|
|||||||
}
|
}
|
||||||
catch (FileNotFoundException e)
|
catch (FileNotFoundException e)
|
||||||
{
|
{
|
||||||
throw new System.IO.FileNotFoundException(e.Message, e);
|
throw new System.IO.FileNotFoundException(ExceptionUtil.GetErrorMessage(e), e);
|
||||||
}
|
}
|
||||||
catch (Java.Lang.Exception e)
|
catch (Java.Lang.Exception e)
|
||||||
{
|
{
|
||||||
@@ -244,7 +245,7 @@ namespace keepass2android.Io
|
|||||||
}
|
}
|
||||||
catch (FileNotFoundException e)
|
catch (FileNotFoundException e)
|
||||||
{
|
{
|
||||||
throw new System.IO.FileNotFoundException(e.Message, e);
|
throw new System.IO.FileNotFoundException(ExceptionUtil.GetErrorMessage(e), e);
|
||||||
}
|
}
|
||||||
catch (Java.Lang.Exception e)
|
catch (Java.Lang.Exception e)
|
||||||
{
|
{
|
||||||
|
@@ -8,6 +8,7 @@ using Android.Content;
|
|||||||
using Android.OS;
|
using Android.OS;
|
||||||
using FluentFTP;
|
using FluentFTP;
|
||||||
using FluentFTP.Exceptions;
|
using FluentFTP.Exceptions;
|
||||||
|
using KeePass.Util;
|
||||||
using KeePassLib;
|
using KeePassLib;
|
||||||
using KeePassLib.Serialization;
|
using KeePassLib.Serialization;
|
||||||
using KeePassLib.Utility;
|
using KeePassLib.Utility;
|
||||||
@@ -127,7 +128,7 @@ namespace keepass2android.Io
|
|||||||
var ftpEx = (FtpCommandException) exception;
|
var ftpEx = (FtpCommandException) exception;
|
||||||
|
|
||||||
if (ftpEx.CompletionCode == "550")
|
if (ftpEx.CompletionCode == "550")
|
||||||
throw new FileNotFoundException(exception.Message, exception);
|
throw new FileNotFoundException(ExceptionUtil.GetErrorMessage(exception), exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
return exception;
|
return exception;
|
||||||
|
@@ -3,6 +3,7 @@ using System.Reflection;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Android.Content;
|
using Android.Content;
|
||||||
using Android.Util;
|
using Android.Util;
|
||||||
|
using KeePass.Util;
|
||||||
using keepass2android.Io.ItemLocation;
|
using keepass2android.Io.ItemLocation;
|
||||||
using KeePassLib.Serialization;
|
using KeePassLib.Serialization;
|
||||||
using KeePassLib.Utility;
|
using KeePassLib.Utility;
|
||||||
@@ -522,10 +523,10 @@ namespace keepass2android.Io
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (e.IsMatch(GraphErrorCode.ItemNotFound.ToString()))
|
if (e.IsMatch(GraphErrorCode.ItemNotFound.ToString()))
|
||||||
return new FileNotFoundException(e.Message);
|
return new FileNotFoundException(ExceptionUtil.GetErrorMessage(e));
|
||||||
if (e.Message.Contains("\n\n404 : ")
|
if (e.Message.Contains("\n\n404 : ")
|
||||||
) //hacky solution to check for not found. errorCode was null in my tests so I had to find a workaround.
|
) //hacky solution to check for not found. errorCode was null in my tests so I had to find a workaround.
|
||||||
return new FileNotFoundException(e.Message);
|
return new FileNotFoundException(ExceptionUtil.GetErrorMessage(e));
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1148,30 +1149,46 @@ namespace keepass2android.Io
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
string? driveId = parentPath.DriveId;
|
|
||||||
if ((string.IsNullOrEmpty(driveId)) && (drives?.Any() == true))
|
|
||||||
{
|
|
||||||
driveId = drives.First().Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!CanListShares)
|
if (!CanListShares)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
|
||||||
var sharedWithMeResponse = await client.Drives[driveId].SharedWithMe.GetAsSharedWithMeGetResponseAsync();
|
try
|
||||||
|
|
||||||
foreach (DriveItem i in sharedWithMeResponse?.Value ?? [])
|
|
||||||
{
|
{
|
||||||
var oneDrive2ItemLocation = parentPath.BuildShare(i.RemoteItem.Id, i.RemoteItem.Name, i.RemoteItem.WebUrl, i.RemoteItem.ParentReference.DriveId);
|
string? driveId = parentPath.DriveId;
|
||||||
FileDescription sharedFileEntry = new FileDescription()
|
if (string.IsNullOrEmpty(driveId))
|
||||||
{
|
{
|
||||||
CanWrite = true, CanRead = true, DisplayName = i.Name,
|
driveId = (await client.Me.Drive.GetAsync()).Id;
|
||||||
IsDirectory = true,
|
}
|
||||||
Path = oneDrive2ItemLocation.ToString()
|
if ((string.IsNullOrEmpty(driveId)) && (drives?.Any() == true))
|
||||||
};
|
{
|
||||||
result.Add(sharedFileEntry);
|
driveId = drives.First().Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
var sharedWithMeResponse = await client.Drives[driveId].SharedWithMe.GetAsSharedWithMeGetResponseAsync();
|
||||||
|
|
||||||
|
foreach (DriveItem i in sharedWithMeResponse?.Value ?? [])
|
||||||
|
{
|
||||||
|
var oneDrive2ItemLocation = parentPath.BuildShare(i.RemoteItem.Id, i.RemoteItem.Name, i.RemoteItem.WebUrl, i.RemoteItem.ParentReference.DriveId);
|
||||||
|
FileDescription sharedFileEntry = new FileDescription()
|
||||||
|
{
|
||||||
|
CanWrite = true,
|
||||||
|
CanRead = true,
|
||||||
|
DisplayName = i.Name,
|
||||||
|
IsDirectory = (i.Folder != null) || ((i.RemoteItem != null) && (i.RemoteItem.Folder != null)),
|
||||||
|
Path = oneDrive2ItemLocation.ToString()
|
||||||
|
};
|
||||||
|
result.Add(sharedFileEntry);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
logDebug("Failed to list shares: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -16,20 +16,32 @@ namespace keepass2android.Io
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class OneDriveFileStorage: IFileStorage
|
public class OneDriveFileStorage: IFileStorage
|
||||||
{
|
{
|
||||||
|
public OneDriveFileStorage(IKp2aApp app)
|
||||||
public IEnumerable<string> SupportedProtocols
|
{
|
||||||
|
_app = app;
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly IKp2aApp _app;
|
||||||
|
|
||||||
|
public IEnumerable<string> SupportedProtocols
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
yield return "skydrive";
|
yield return "skydrive";
|
||||||
yield return "onedrive";
|
yield return "onedrive";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Exception GetDeprecatedMessage()
|
string GetDeprecatedMessage()
|
||||||
|
{
|
||||||
|
return
|
||||||
|
"You have opened your file through a deprecated Microsoft API. Please select Change database, Open Database and then select OneDrive again.";
|
||||||
|
}
|
||||||
|
|
||||||
|
private Exception GetDeprecatedException()
|
||||||
{
|
{
|
||||||
return new Exception(
|
return new Exception(
|
||||||
"You have opened your file through a deprecated Microsoft API. Please select Change database, Open Database and then select One Drive again.");
|
GetDeprecatedMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool UserShouldBackup
|
public bool UserShouldBackup
|
||||||
@@ -39,133 +51,132 @@ namespace keepass2android.Io
|
|||||||
|
|
||||||
public void Delete(IOConnectionInfo ioc)
|
public void Delete(IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CheckForFileChangeFast(IOConnectionInfo ioc, string previousFileVersion)
|
public bool CheckForFileChangeFast(IOConnectionInfo ioc, string previousFileVersion)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetCurrentFileVersionFast(IOConnectionInfo ioc)
|
public string GetCurrentFileVersionFast(IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Stream OpenFileForRead(IOConnectionInfo ioc)
|
public Stream OpenFileForRead(IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IWriteTransaction OpenWriteTransaction(IOConnectionInfo ioc, bool useFileTransaction)
|
public IWriteTransaction OpenWriteTransaction(IOConnectionInfo ioc, bool useFileTransaction)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetFilenameWithoutPathAndExt(IOConnectionInfo ioc)
|
public string GetFilenameWithoutPathAndExt(IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetFileExtension(IOConnectionInfo ioc)
|
public string GetFileExtension(IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RequiresCredentials(IOConnectionInfo ioc)
|
public bool RequiresCredentials(IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CreateDirectory(IOConnectionInfo ioc, string newDirName)
|
public void CreateDirectory(IOConnectionInfo ioc, string newDirName)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<FileDescription> ListContents(IOConnectionInfo ioc)
|
public IEnumerable<FileDescription> ListContents(IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileDescription GetFileDescription(IOConnectionInfo ioc)
|
public FileDescription GetFileDescription(IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RequiresSetup(IOConnectionInfo ioConnection)
|
public bool RequiresSetup(IOConnectionInfo ioConnection)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string IocToPath(IOConnectionInfo ioc)
|
public string IocToPath(IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartSelectFile(IFileStorageSetupInitiatorActivity activity, bool isForSave, int requestCode, string protocolId)
|
public void StartSelectFile(IFileStorageSetupInitiatorActivity activity, bool isForSave, int requestCode, string protocolId)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PrepareFileUsage(IFileStorageSetupInitiatorActivity activity, IOConnectionInfo ioc, int requestCode,
|
public void PrepareFileUsage(IFileStorageSetupInitiatorActivity activity, IOConnectionInfo ioc, int requestCode,
|
||||||
bool alwaysReturnSuccess)
|
bool alwaysReturnSuccess)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
_app.ShowMessage(activity.Activity, GetDeprecatedMessage(), MessageSeverity.Error);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PrepareFileUsage(Context ctx, IOConnectionInfo ioc)
|
public void PrepareFileUsage(Context ctx, IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnCreate(IFileStorageSetupActivity activity, Bundle savedInstanceState)
|
public void OnCreate(IFileStorageSetupActivity activity, Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnResume(IFileStorageSetupActivity activity)
|
public void OnResume(IFileStorageSetupActivity activity)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnStart(IFileStorageSetupActivity activity)
|
public void OnStart(IFileStorageSetupActivity activity)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnActivityResult(IFileStorageSetupActivity activity, int requestCode, int resultCode, Intent data)
|
public void OnActivityResult(IFileStorageSetupActivity activity, int requestCode, int resultCode, Intent data)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetDisplayName(IOConnectionInfo ioc)
|
public string GetDisplayName(IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
return "File using deprecated Microsoft API. Please update.";
|
||||||
}
|
}
|
||||||
|
|
||||||
public string CreateFilePath(string parent, string newFilename)
|
public string CreateFilePath(string parent, string newFilename)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IOConnectionInfo GetParentPath(IOConnectionInfo ioc)
|
public IOConnectionInfo GetParentPath(IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IOConnectionInfo GetFilePath(IOConnectionInfo folderPath, string filename)
|
public IOConnectionInfo GetFilePath(IOConnectionInfo folderPath, string filename)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsPermanentLocation(IOConnectionInfo ioc)
|
public bool IsPermanentLocation(IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsReadOnly(IOConnectionInfo ioc, OptionalOut<UiStringKey> reason = null)
|
public bool IsReadOnly(IOConnectionInfo ioc, OptionalOut<UiStringKey> reason = null)
|
||||||
{
|
{
|
||||||
throw GetDeprecatedMessage();
|
throw GetDeprecatedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,31 +4,43 @@
|
|||||||
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
|
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<DefineConstants Condition="'$(Flavor)'=='NoNet'">NO_QR_SCANNER;EXCLUDE_JAVAFILESTORAGE;NoNet</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Resources\" />
|
<Folder Include="Resources\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="FluentFTP" Version="51.1.0" />
|
<PackageReference Include="FluentFTP" Version="51.1.0" Condition="'$(Flavor)'!='NoNet'"/>
|
||||||
<PackageReference Include="MegaApiClient" Version="1.10.4" />
|
<PackageReference Include="MegaApiClient" Version="1.10.4" Condition="'$(Flavor)'!='NoNet'"/>
|
||||||
<PackageReference Include="Microsoft.Graph" Version="5.68.0" />
|
<PackageReference Include="Microsoft.Graph" Version="5.68.0" Condition="'$(Flavor)'!='NoNet'"/>
|
||||||
<PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.7" />
|
<PackageReference Include="Microsoft.Identity.Client" Version="4.67.1" Condition="'$(Flavor)'!='NoNet'"/>
|
||||||
<PackageReference Include="Microsoft.Identity.Client" Version="4.67.1" />
|
|
||||||
<PackageReference Include="Xamarin.AndroidX.Browser" Version="1.8.0" />
|
<PackageReference Include="Xamarin.AndroidX.Browser" Version="1.8.0" />
|
||||||
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.13.1.5" />
|
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.13.1.5" />
|
||||||
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.11.0.3" />
|
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.11.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\AndroidFileChooserBinding\AndroidFileChooserBinding.csproj" />
|
<ProjectReference Include="..\AndroidFileChooserBinding\AndroidFileChooserBinding.csproj" />
|
||||||
<ProjectReference Include="..\JavaFileStorageBindings\JavaFileStorageBindings.csproj" />
|
<ProjectReference Include="..\JavaFileStorageBindings\JavaFileStorageBindings.csproj" Condition="'$(Flavor)'!='NoNet'" />
|
||||||
<ProjectReference Include="..\KeePassLib2Android\KeePassLib2Android.csproj" />
|
<ProjectReference Include="..\KeePassLib2Android\KeePassLib2Android.csproj" />
|
||||||
<ProjectReference Include="..\KP2AKdbLibraryBinding\KP2AKdbLibraryBinding.csproj" />
|
<ProjectReference Include="..\KP2AKdbLibraryBinding\KP2AKdbLibraryBinding.csproj" />
|
||||||
<ProjectReference Include="..\TwofishCipher\TwofishCipher.csproj" />
|
<ProjectReference Include="..\TwofishCipher\TwofishCipher.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Io/DropboxFileStorageKeysDummy.cs" />
|
|
||||||
<Compile Remove="Io/DropboxFileStorageKeysDummy.cs" />
|
|
||||||
<Content Remove="Io/DropboxFileStorageKeysDummy.cs" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition="'$(Flavor)'=='NoNet'">
|
||||||
|
<None Remove="Io/OneDrive2FileStorage.cs" />
|
||||||
|
<Compile Remove="Io/OneDrive2FileStorage.cs" />
|
||||||
|
<Content Remove="Io/OneDrive2FileStorage.cs" />
|
||||||
|
<None Remove="Io/MegaFileStorage.cs" />
|
||||||
|
<Compile Remove="Io/MegaFileStorage.cs" />
|
||||||
|
<Content Remove="Io/MegaFileStorage.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Import Project="Io/GenerateSecrets.targets" />
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Io/DropboxFileStorage.g.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
@@ -138,7 +138,8 @@ namespace keepass2android
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (host.IndexOf(otherHost, StringComparison.InvariantCultureIgnoreCase) > -1)
|
if (string.Equals(host, otherHost, StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
host.EndsWith("." + otherHost, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
pgResults.AddEntry(entry, false);
|
pgResults.AddEntry(entry, false);
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,7 @@ using Android.Content;
|
|||||||
using Android.OS;
|
using Android.OS;
|
||||||
using Android.Widget;
|
using Android.Widget;
|
||||||
using Java.Net;
|
using Java.Net;
|
||||||
|
using KeePass.Util;
|
||||||
using KeePassLib.Serialization;
|
using KeePassLib.Serialization;
|
||||||
using keepass2android.Io;
|
using keepass2android.Io;
|
||||||
|
|
||||||
@@ -94,15 +95,12 @@ namespace keepass2android
|
|||||||
}
|
}
|
||||||
if ((resultCode == Result.Canceled) && (data != null) && (data.HasExtra("EXTRA_ERROR_MESSAGE")))
|
if ((resultCode == Result.Canceled) && (data != null) && (data.HasExtra("EXTRA_ERROR_MESSAGE")))
|
||||||
{
|
{
|
||||||
ShowToast(data.GetStringExtra("EXTRA_ERROR_MESSAGE"));
|
ShowErrorToast(data.GetStringExtra("EXTRA_ERROR_MESSAGE"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resultCode == Result.Ok)
|
if (resultCode == Result.Ok)
|
||||||
{
|
{
|
||||||
Kp2aLog.Log("FileSelection returned "+data.DataString);
|
|
||||||
//TODO: don't try to extract filename if content URI
|
|
||||||
string filename = IntentToFilename(data);
|
string filename = IntentToFilename(data);
|
||||||
Kp2aLog.Log("FileSelection returned filename " + filename);
|
|
||||||
if (filename != null)
|
if (filename != null)
|
||||||
{
|
{
|
||||||
if (filename.StartsWith("file://"))
|
if (filename.StartsWith("file://"))
|
||||||
@@ -150,7 +148,7 @@ namespace keepass2android
|
|||||||
|
|
||||||
protected abstract void StartFileChooser(string path, int requestCode, bool isForSave);
|
protected abstract void StartFileChooser(string path, int requestCode, bool isForSave);
|
||||||
|
|
||||||
protected abstract void ShowToast(string text);
|
protected abstract void ShowErrorToast(string text);
|
||||||
|
|
||||||
protected abstract void ShowInvalidSchemeMessage(string dataString);
|
protected abstract void ShowInvalidSchemeMessage(string dataString);
|
||||||
|
|
||||||
@@ -208,7 +206,7 @@ namespace keepass2android
|
|||||||
{
|
{
|
||||||
return () =>
|
return () =>
|
||||||
{
|
{
|
||||||
ShowToast(_app.GetResourceString(UiStringKey.ErrorOcurred) + " " + e.Message);
|
ShowErrorToast(_app.GetResourceString(UiStringKey.ErrorOcurred) + " " + ExceptionUtil.GetErrorMessage(e));
|
||||||
ReturnCancel();
|
ReturnCancel();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
32
src/Kp2aBusinessLogic/Utils/ExceptionUtil.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
|
||||||
|
namespace KeePass.Util
|
||||||
|
{
|
||||||
|
public class ExceptionUtil
|
||||||
|
{
|
||||||
|
|
||||||
|
public static string GetErrorMessage(Exception e)
|
||||||
|
{
|
||||||
|
string errorMessage = e.Message;
|
||||||
|
if (e is Java.Lang.Exception javaException)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
errorMessage = javaException.LocalizedMessage ?? javaException.Message ?? errorMessage;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -5,6 +5,7 @@ using System.Security.Cryptography;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Android.App;
|
using Android.App;
|
||||||
using Android.Content;
|
using Android.Content;
|
||||||
|
using KeePass.Util;
|
||||||
using KeePassLib.Cryptography;
|
using KeePassLib.Cryptography;
|
||||||
using KeePassLib.Serialization;
|
using KeePassLib.Serialization;
|
||||||
using KeePassLib.Utility;
|
using KeePassLib.Utility;
|
||||||
@@ -65,7 +66,7 @@ namespace keepass2android
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Finish(false, e.Message);
|
Finish(false, ExceptionUtil.GetErrorMessage(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,12 @@ namespace keepass2android
|
|||||||
PwDatabase pwDatabase = new PwDatabase();
|
PwDatabase pwDatabase = new PwDatabase();
|
||||||
|
|
||||||
IFileStorage fileStorage = _app.GetFileStorage(iocInfo);
|
IFileStorage fileStorage = _app.GetFileStorage(iocInfo);
|
||||||
Stream s = databaseData ?? fileStorage.OpenFileForRead(iocInfo);
|
Kp2aLog.Log("LoadData: Retrieving stream");
|
||||||
var fileVersion = _app.GetFileStorage(iocInfo).GetCurrentFileVersionFast(iocInfo);
|
Stream s = databaseData ?? fileStorage.OpenFileForRead(iocInfo);
|
||||||
PopulateDatabaseFromStream(pwDatabase, s, iocInfo, compositeKey, status, databaseFormat);
|
Kp2aLog.Log("LoadData: GetCurrentFileVersion");
|
||||||
|
var fileVersion = _app.GetFileStorage(iocInfo).GetCurrentFileVersionFast(iocInfo);
|
||||||
|
Kp2aLog.Log("LoadData: PopulateDatabaseFromStream");
|
||||||
|
PopulateDatabaseFromStream(pwDatabase, s, iocInfo, compositeKey, status, databaseFormat);
|
||||||
LastFileVersion = fileVersion;
|
LastFileVersion = fileVersion;
|
||||||
|
|
||||||
status.UpdateSubMessage("");
|
status.UpdateSubMessage("");
|
||||||
|
@@ -10,6 +10,7 @@ using Com.Keepassdroid.Database.Exception;
|
|||||||
#endif
|
#endif
|
||||||
using Com.Keepassdroid.Database.Save;
|
using Com.Keepassdroid.Database.Save;
|
||||||
using Java.Util;
|
using Java.Util;
|
||||||
|
using KeePass.Util;
|
||||||
using KeePassLib;
|
using KeePassLib;
|
||||||
using KeePassLib.Cryptography;
|
using KeePassLib.Cryptography;
|
||||||
using KeePassLib.Cryptography.Cipher;
|
using KeePassLib.Cryptography.Cipher;
|
||||||
@@ -82,15 +83,14 @@ namespace keepass2android
|
|||||||
catch (Java.IO.FileNotFoundException e)
|
catch (Java.IO.FileNotFoundException e)
|
||||||
{
|
{
|
||||||
throw new FileNotFoundException(
|
throw new FileNotFoundException(
|
||||||
e.Message, e);
|
ExceptionUtil.GetErrorMessage(e), e);
|
||||||
}
|
}
|
||||||
catch (Java.Lang.Exception e)
|
catch (Java.Lang.Exception e)
|
||||||
{
|
{
|
||||||
if (e.Message == "Invalid key!")
|
if (e.Message == "Invalid key!")
|
||||||
throw new InvalidCompositeKeyException();
|
throw new InvalidCompositeKeyException();
|
||||||
throw new Exception(e.LocalizedMessage ??
|
throw new Exception(ExceptionUtil.GetErrorMessage(e) ??
|
||||||
e.Message ??
|
e.GetType().Name, e);
|
||||||
e.GetType().Name, e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HashOfLastStream = hashingStream.Hash;
|
HashOfLastStream = hashingStream.Hash;
|
||||||
|
@@ -6,6 +6,7 @@ using Android.App;
|
|||||||
using Android.Content;
|
using Android.Content;
|
||||||
using KeePassLib.Serialization;
|
using KeePassLib.Serialization;
|
||||||
using keepass2android.Io;
|
using keepass2android.Io;
|
||||||
|
using KeePass.Util;
|
||||||
|
|
||||||
namespace keepass2android
|
namespace keepass2android
|
||||||
{
|
{
|
||||||
@@ -109,7 +110,7 @@ namespace keepass2android
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Kp2aLog.LogUnexpectedError(e);
|
Kp2aLog.LogUnexpectedError(e);
|
||||||
Finish(false, e.Message);
|
Finish(false, ExceptionUtil.GetErrorMessage(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -21,6 +21,7 @@ using System.Linq;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Android.App;
|
using Android.App;
|
||||||
|
using KeePass.Util;
|
||||||
using keepass2android.database.edit;
|
using keepass2android.database.edit;
|
||||||
using KeePassLib;
|
using KeePassLib;
|
||||||
using KeePassLib.Keys;
|
using KeePassLib.Keys;
|
||||||
@@ -103,10 +104,10 @@ namespace keepass2android
|
|||||||
}
|
}
|
||||||
catch (AggregateException e)
|
catch (AggregateException e)
|
||||||
{
|
{
|
||||||
string message = e.Message;
|
string message = ExceptionUtil.GetErrorMessage(e);
|
||||||
foreach (var innerException in e.InnerExceptions)
|
foreach (var innerException in e.InnerExceptions)
|
||||||
{
|
{
|
||||||
message = innerException.Message;
|
message = ExceptionUtil.GetErrorMessage(innerException);
|
||||||
// Override the message shown with the last (hopefully most recent) inner exception
|
// Override the message shown with the last (hopefully most recent) inner exception
|
||||||
Kp2aLog.LogUnexpectedError(innerException);
|
Kp2aLog.LogUnexpectedError(innerException);
|
||||||
}
|
}
|
||||||
@@ -116,14 +117,14 @@ namespace keepass2android
|
|||||||
catch (DuplicateUuidsException e)
|
catch (DuplicateUuidsException e)
|
||||||
{
|
{
|
||||||
Kp2aLog.Log(e.ToString());
|
Kp2aLog.Log(e.ToString());
|
||||||
Finish(false, _app.GetResourceString(UiStringKey.DuplicateUuidsError) + " " + e.Message + _app.GetResourceString(UiStringKey.DuplicateUuidsErrorAdditional), false, Exception);
|
Finish(false, _app.GetResourceString(UiStringKey.DuplicateUuidsError) + " " + ExceptionUtil.GetErrorMessage(e) + _app.GetResourceString(UiStringKey.DuplicateUuidsErrorAdditional), false, Exception);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
if (!(e is InvalidCompositeKeyException))
|
if (!(e is InvalidCompositeKeyException))
|
||||||
Kp2aLog.LogUnexpectedError(e);
|
Kp2aLog.LogUnexpectedError(e);
|
||||||
Finish(false, _app.GetResourceString(UiStringKey.ErrorOcurred) + " " + (e.Message ?? (e is FileNotFoundException ? _app.GetResourceString(UiStringKey.FileNotFound) : "")), false, Exception);
|
Finish(false, _app.GetResourceString(UiStringKey.ErrorOcurred) + " " + (ExceptionUtil.GetErrorMessage(e) ?? (e is FileNotFoundException ? _app.GetResourceString(UiStringKey.FileNotFound) : "")), false, Exception);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,6 +138,7 @@ namespace keepass2android
|
|||||||
|
|
||||||
Database TryLoad(MemoryStream databaseStream)
|
Database TryLoad(MemoryStream databaseStream)
|
||||||
{
|
{
|
||||||
|
Kp2aLog.Log("LoadDb: Copying database in memory");
|
||||||
//create a copy of the stream so we can try again if we get an exception which indicates we should change parameters
|
//create a copy of the stream so we can try again if we get an exception which indicates we should change parameters
|
||||||
//This is not optimal in terms of (short-time) memory usage but is hard to avoid because the Keepass library closes streams also in case of errors.
|
//This is not optimal in terms of (short-time) memory usage but is hard to avoid because the Keepass library closes streams also in case of errors.
|
||||||
//Alternatives would involve increased traffic (if file is on remote) and slower loading times, so this seems to be the best choice.
|
//Alternatives would involve increased traffic (if file is on remote) and slower loading times, so this seems to be the best choice.
|
||||||
@@ -145,8 +147,9 @@ namespace keepass2android
|
|||||||
workingCopy.Seek(0, SeekOrigin.Begin);
|
workingCopy.Seek(0, SeekOrigin.Begin);
|
||||||
//reset stream if we need to reuse it later:
|
//reset stream if we need to reuse it later:
|
||||||
databaseStream.Seek(0, SeekOrigin.Begin);
|
databaseStream.Seek(0, SeekOrigin.Begin);
|
||||||
//now let's go:
|
Kp2aLog.Log("LoadDb: Ready to start loading");
|
||||||
try
|
//now let's go:
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Database newDb = _app.LoadDatabase(_ioc, workingCopy, _compositeKey, StatusLogger, _format, _makeCurrent);
|
Database newDb = _app.LoadDatabase(_ioc, workingCopy, _compositeKey, StatusLogger, _format, _makeCurrent);
|
||||||
Kp2aLog.Log("LoadDB OK");
|
Kp2aLog.Log("LoadDB OK");
|
||||||
|
@@ -130,24 +130,24 @@ namespace keepass2android
|
|||||||
if ( !String.IsNullOrEmpty(message) ) {
|
if ( !String.IsNullOrEmpty(message) ) {
|
||||||
Kp2aLog.Log("OnFinish message: " + message);
|
Kp2aLog.Log("OnFinish message: " + message);
|
||||||
if (makeDialog && ctx != null)
|
if (makeDialog && ctx != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(ctx);
|
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(ctx);
|
||||||
|
|
||||||
builder.SetMessage(message)
|
builder.SetMessage(message)
|
||||||
.SetPositiveButton(Android.Resource.String.Ok, (sender, args) => ((Dialog)sender).Dismiss())
|
.SetPositiveButton(Android.Resource.String.Ok, (sender, args) => ((Dialog)sender).Dismiss())
|
||||||
.Show();
|
.Show();
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
Toast.MakeText(ctx, message, ToastLength.Long).Show();
|
Toast.MakeText(ctx, message, ToastLength.Long).Show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Toast.MakeText(ctx ?? Application.Context, message, ToastLength.Long).Show();
|
Toast.MakeText(ctx ?? Application.Context, message, ToastLength.Long).Show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,6 +29,7 @@ using KeePassLib.Utility;
|
|||||||
using keepass2android.Io;
|
using keepass2android.Io;
|
||||||
using Debug = System.Diagnostics.Debug;
|
using Debug = System.Diagnostics.Debug;
|
||||||
using Exception = System.Exception;
|
using Exception = System.Exception;
|
||||||
|
using KeePass.Util;
|
||||||
|
|
||||||
namespace keepass2android
|
namespace keepass2android
|
||||||
{
|
{
|
||||||
@@ -187,7 +188,7 @@ namespace keepass2android
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
Kp2aLog.LogUnexpectedError(e);
|
Kp2aLog.LogUnexpectedError(e);
|
||||||
Finish(false, e.Message);
|
Finish(false, ExceptionUtil.GetErrorMessage(e));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -222,8 +223,8 @@ namespace keepass2android
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Kp2aLog.LogUnexpectedError(e);
|
Kp2aLog.LogUnexpectedError(e);
|
||||||
Kp2aLog.Log("Error in worker thread of SaveDb: " + e);
|
Kp2aLog.Log("Error in worker thread of SaveDb: " + ExceptionUtil.GetErrorMessage(e));
|
||||||
Finish(false, e.Message);
|
Finish(false, ExceptionUtil.GetErrorMessage(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -233,7 +234,7 @@ namespace keepass2android
|
|||||||
{
|
{
|
||||||
Kp2aLog.LogUnexpectedError(e);
|
Kp2aLog.LogUnexpectedError(e);
|
||||||
Kp2aLog.Log("Error starting worker thread of SaveDb: "+e);
|
Kp2aLog.Log("Error starting worker thread of SaveDb: "+e);
|
||||||
Finish(false, e.Message);
|
Finish(false, ExceptionUtil.GetErrorMessage(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
25
src/build-scripts/build-java.sh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
#unset ANDROID_NDK_HOME ANDROID_NDK
|
||||||
|
|
||||||
|
pushd ../java/
|
||||||
|
|
||||||
|
pushd JavaFileStorageTest-AS
|
||||||
|
./gradlew assemble
|
||||||
|
popd
|
||||||
|
|
||||||
|
pushd KP2ASoftkeyboard_AS
|
||||||
|
./gradlew assemble
|
||||||
|
popd
|
||||||
|
|
||||||
|
pushd Keepass2AndroidPluginSDK2
|
||||||
|
./gradlew assemble
|
||||||
|
popd
|
||||||
|
|
||||||
|
pushd KP2AKdbLibrary
|
||||||
|
./gradlew assemble
|
||||||
|
popd
|
||||||
|
|
||||||
|
popd
|
6
src/build-scripts/build-native.sh
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
pushd ../java/argon2
|
||||||
|
ndk-build
|
||||||
|
popd
|
28
src/build-scripts/linux-build.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
## Setup build environment
|
||||||
|
* install Android SDK
|
||||||
|
* install Android NDK
|
||||||
|
* install dotnet8
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#from https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-8.0.407-linux-x64-binaries
|
||||||
|
wget https://download.visualstudio.microsoft.com/download/pr/9d07577e-f7bc-4d60-838d-f79c50b5c11a/459ef339396783db369e0432d6dc3d7e/dotnet-sdk-8.0.407-linux-x64.tar.gz
|
||||||
|
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-8.0.407-linux-x64.tar.gz -C $HOME/dotnet
|
||||||
|
export DOTNET_ROOT=$HOME/dotnet
|
||||||
|
export PATH=$PATH:$HOME/dotnet
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Build Keepass2Android
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone --recurse-submodules https://github.com/PhilippC/keepass2android.git
|
||||||
|
cd keepass2android/src/build-scripts
|
||||||
|
./build-java.sh && ./build-native.sh
|
||||||
|
cd ..
|
||||||
|
cd keepass2android-app
|
||||||
|
ln -s Manifests/AndroidManifest_debug.xml AndroidManifest.xml
|
||||||
|
dotnet workload restore
|
||||||
|
dotnet restore
|
||||||
|
dotnet build
|
||||||
|
```
|
22
src/build-scripts/rename-output-apks.sh
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
BASE_DIR="${1}"
|
||||||
|
|
||||||
|
for arch_dir in "$BASE_DIR"/android-*/; do
|
||||||
|
arch=$(basename "$arch_dir")
|
||||||
|
arch=${arch#android-}
|
||||||
|
APK_DIR="${arch_dir}publish"
|
||||||
|
if [[ -d "$APK_DIR" ]]; then
|
||||||
|
apk_path=$(find "$APK_DIR" -maxdepth 1 -type f -name "*.apk" | head -n1)
|
||||||
|
if [[ -n "$apk_path" ]]; then
|
||||||
|
base=$(basename "$apk_path" .apk)
|
||||||
|
new_path="$APK_DIR/${base}-${arch}.apk"
|
||||||
|
mv "$apk_path" "$new_path"
|
||||||
|
echo "Renamed $apk_path to $new_path"
|
||||||
|
else
|
||||||
|
echo "No APK found in $APK_DIR"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Directory $APK_DIR does not exist"
|
||||||
|
fi
|
||||||
|
done
|
@@ -41,7 +41,8 @@ dependencies {
|
|||||||
exclude group: 'com.google.android.google-play-services'
|
exclude group: 'com.google.android.google-play-services'
|
||||||
}
|
}
|
||||||
implementation 'com.google.apis:google-api-services-drive:v2-rev102-1.16.0-rc'
|
implementation 'com.google.apis:google-api-services-drive:v2-rev102-1.16.0-rc'
|
||||||
implementation 'com.dropbox.core:dropbox-core-sdk:5.4.6'
|
implementation 'com.dropbox.core:dropbox-core-sdk:7.0.0'
|
||||||
|
implementation 'com.dropbox.core:dropbox-android-sdk:7.0.0'
|
||||||
implementation 'com.google.api-client:google-api-client:1.30.5'
|
implementation 'com.google.api-client:google-api-client:1.30.5'
|
||||||
implementation 'com.google.api-client:google-api-client-android:1.30.5'
|
implementation 'com.google.api-client:google-api-client-android:1.30.5'
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@ import com.dropbox.core.DbxOAuth1Upgrader;
|
|||||||
import com.dropbox.core.DbxRequestConfig;
|
import com.dropbox.core.DbxRequestConfig;
|
||||||
import com.dropbox.core.InvalidAccessTokenException;
|
import com.dropbox.core.InvalidAccessTokenException;
|
||||||
import com.dropbox.core.android.Auth;
|
import com.dropbox.core.android.Auth;
|
||||||
|
|
||||||
import com.dropbox.core.json.JsonReadException;
|
import com.dropbox.core.json.JsonReadException;
|
||||||
import com.dropbox.core.oauth.DbxCredential;
|
import com.dropbox.core.oauth.DbxCredential;
|
||||||
import com.dropbox.core.v2.DbxClientV2;
|
import com.dropbox.core.v2.DbxClientV2;
|
||||||
@@ -154,7 +155,7 @@ public class DropboxV2Storage extends JavaFileStorageBase
|
|||||||
{
|
{
|
||||||
if ((previousFileVersion == null) || (previousFileVersion.equals("")))
|
if ((previousFileVersion == null) || (previousFileVersion.equals("")))
|
||||||
return false;
|
return false;
|
||||||
path = removeProtocol(path);
|
path = removeProtocol(path);
|
||||||
try {
|
try {
|
||||||
Metadata entry = dbxClient.files().getMetadata(path);
|
Metadata entry = dbxClient.files().getMetadata(path);
|
||||||
return !String.valueOf(entry.hashCode()) .equals(previousFileVersion);
|
return !String.valueOf(entry.hashCode()) .equals(previousFileVersion);
|
||||||
|
@@ -304,6 +304,11 @@ public class WebDavStorage extends JavaFileStorageBase {
|
|||||||
//relative path:
|
//relative path:
|
||||||
e.path = buildPathFromHref(parentPath, r.href);
|
e.path = buildPathFromHref(parentPath, r.href);
|
||||||
}
|
}
|
||||||
|
if ( (parentPath.indexOf("@") != -1) && (e.path.indexOf("@") == -1))
|
||||||
|
{
|
||||||
|
//username/password not contained in .href response. Add it back from parentPath:
|
||||||
|
e.path = parentPath.substring(0, parentPath.indexOf("@")+1) + e.path.substring(e.path.indexOf("://")+3);
|
||||||
|
}
|
||||||
|
|
||||||
if ((depth == 1) && e.isDirectory)
|
if ((depth == 1) && e.isDirectory)
|
||||||
{
|
{
|
||||||
|
@@ -6,8 +6,7 @@
|
|||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true">
|
||||||
android:theme="@style/AppTheme">
|
|
||||||
<activity android:name="com.crocoapps.javafilestoragetest2.MainActivity"
|
<activity android:name="com.crocoapps.javafilestoragetest2.MainActivity"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
@@ -113,4 +113,15 @@ extends Activity implements JavaFileStorage.FileStorageSetupActivity {
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
MainActivity.storageToTest.onRequestPermissionsResult(this, requestCode, permissions, grantResults);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -147,6 +147,7 @@ import java.util.List;
|
|||||||
//import keepass2android.javafilestorage.DropboxCloudRailStorage;
|
//import keepass2android.javafilestorage.DropboxCloudRailStorage;
|
||||||
import keepass2android.javafilestorage.DropboxV2Storage;
|
import keepass2android.javafilestorage.DropboxV2Storage;
|
||||||
import keepass2android.javafilestorage.GoogleDriveAppDataFileStorage;
|
import keepass2android.javafilestorage.GoogleDriveAppDataFileStorage;
|
||||||
|
import keepass2android.javafilestorage.GoogleDriveFullFileStorage;
|
||||||
import keepass2android.javafilestorage.ICertificateErrorHandler;
|
import keepass2android.javafilestorage.ICertificateErrorHandler;
|
||||||
import keepass2android.javafilestorage.JavaFileStorage;
|
import keepass2android.javafilestorage.JavaFileStorage;
|
||||||
import keepass2android.javafilestorage.JavaFileStorage.FileEntry;
|
import keepass2android.javafilestorage.JavaFileStorage.FileEntry;
|
||||||
@@ -547,7 +548,7 @@ public class MainActivity extends Activity implements JavaFileStorage.FileStorag
|
|||||||
|
|
||||||
|
|
||||||
//storageToTest = new GoogleDriveAppDataFileStorage();
|
//storageToTest = new GoogleDriveAppDataFileStorage();
|
||||||
storageToTest = new WebDavStorage(new ICertificateErrorHandler() {
|
/*storageToTest = new WebDavStorage(new ICertificateErrorHandler() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onValidationError(String error) {
|
public boolean onValidationError(String error) {
|
||||||
return false;
|
return false;
|
||||||
@@ -558,10 +559,11 @@ public class MainActivity extends Activity implements JavaFileStorage.FileStorag
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
//storageToTest = new DropboxV2Storage(ctx,"4ybka4p4a1027n6", "1z5lv528un9nre8", !simulateRestart);
|
//storageToTest = new DropboxV2Storage(ctx,"4ybka4p4a1027n6", "1z5lv528un9nre8", !simulateRestart);
|
||||||
//storageToTest = new DropboxFileStorage(ctx,"4ybka4p4a1027n6", "1z5lv528un9nre8", !simulateRestart);
|
//storageToTest = new DropboxFileStorage(ctx,"4ybka4p4a1027n6", "1z5lv528un9nre8", !simulateRestart);
|
||||||
//storageToTest = new DropboxAppFolderFileStorage(ctx,"ax0268uydp1ya57", "3s86datjhkihwyc", true);
|
//storageToTest = new DropboxAppFolderFileStorage(ctx,"ax0268uydp1ya57", "3s86datjhkihwyc", true);
|
||||||
|
storageToTest = new GoogleDriveFullFileStorage();
|
||||||
|
|
||||||
|
|
||||||
return storageToTest;
|
return storageToTest;
|
||||||
@@ -580,6 +582,8 @@ public class MainActivity extends Activity implements JavaFileStorage.FileStorag
|
|||||||
getMenuInflater().inflate(R.menu.main, menu);
|
getMenuInflater().inflate(R.menu.main, menu);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
@@ -356,7 +356,13 @@ public class KP2AKeyboard extends InputMethodService
|
|||||||
pFilter.addAction("android.intent.action.PACKAGE_ADDED");
|
pFilter.addAction("android.intent.action.PACKAGE_ADDED");
|
||||||
pFilter.addAction("android.intent.action.PACKAGE_REPLACED");
|
pFilter.addAction("android.intent.action.PACKAGE_REPLACED");
|
||||||
pFilter.addAction("android.intent.action.PACKAGE_REMOVED");
|
pFilter.addAction("android.intent.action.PACKAGE_REMOVED");
|
||||||
registerReceiver(mPluginManager, pFilter);
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
registerReceiver(mPluginManager, pFilter, RECEIVER_EXPORTED);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
registerReceiver(mPluginManager, pFilter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
LatinIMEUtil.GCUtils.getInstance().reset();
|
LatinIMEUtil.GCUtils.getInstance().reset();
|
||||||
@@ -375,16 +381,28 @@ public class KP2AKeyboard extends InputMethodService
|
|||||||
|
|
||||||
// register to receive ringer mode changes for silent mode
|
// register to receive ringer mode changes for silent mode
|
||||||
IntentFilter filter = new IntentFilter(AudioManager.RINGER_MODE_CHANGED_ACTION);
|
IntentFilter filter = new IntentFilter(AudioManager.RINGER_MODE_CHANGED_ACTION);
|
||||||
registerReceiver(mSilentModeReceiver, filter);
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
registerReceiver(mSilentModeReceiver, filter, RECEIVER_EXPORTED);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
registerReceiver(mSilentModeReceiver, filter);
|
||||||
|
}
|
||||||
|
|
||||||
prefs.registerOnSharedPreferenceChangeListener(this);
|
prefs.registerOnSharedPreferenceChangeListener(this);
|
||||||
|
|
||||||
//check if we have KP2A data available:
|
//check if we have KP2A data available:
|
||||||
mHadKp2aData = mShowKp2aKeyboard = keepass2android.kbbridge.KeyboardData.hasData();
|
mHadKp2aData = mShowKp2aKeyboard = KeyboardData.hasData();
|
||||||
|
|
||||||
mClearKeyboardReceiver = new ClearKeyboardBroadcastReceiver();
|
mClearKeyboardReceiver = new ClearKeyboardBroadcastReceiver();
|
||||||
registerReceiver(mClearKeyboardReceiver, new IntentFilter(get_KEEPASS2ANDROID_KEYBOARD_CLEARED(this)));
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
android.util.Log.d("KP2AK", "registered receiver for clear keyboard broadcast: "+get_KEEPASS2ANDROID_KEYBOARD_CLEARED(this));
|
registerReceiver(mClearKeyboardReceiver, new IntentFilter(get_KEEPASS2ANDROID_KEYBOARD_CLEARED(this)), RECEIVER_EXPORTED);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
registerReceiver(mClearKeyboardReceiver, new IntentFilter(get_KEEPASS2ANDROID_KEYBOARD_CLEARED(this)));
|
||||||
|
}
|
||||||
|
Log.d("KP2AK", "registered receiver for clear keyboard broadcast: "+get_KEEPASS2ANDROID_KEYBOARD_CLEARED(this));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
<!-- Title for Latin keyboard -->
|
<!-- Title for Latin keyboard -->
|
||||||
<string name="english_ime_name">Keepass2Android-Tastatur</string>
|
<string name="english_ime_name">Keepass2Android-Tastatur</string>
|
||||||
<!-- Title for Latin keyboard settings activity / dialog -->
|
<!-- Title for Latin keyboard settings activity / dialog -->
|
||||||
<string name="english_ime_settings">Keepass2Android-Tastatureinstellungen</string>
|
<string name="english_ime_settings">Android-Tastatureinstellungen</string>
|
||||||
<!-- Title for Latin keyboard input options dialog -->
|
<!-- Title for Latin keyboard input options dialog -->
|
||||||
<string name="english_ime_input_options">Eingabeoptionen</string>
|
<string name="english_ime_input_options">Eingabeoptionen</string>
|
||||||
<!-- Option to provide vibrate/haptic feedback on keypress -->
|
<!-- Option to provide vibrate/haptic feedback on keypress -->
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
<!-- Description for text prediction -->
|
<!-- Description for text prediction -->
|
||||||
<string name="prediction_summary">Automatische Vervollständigung während der Eingabe aktivieren</string>
|
<string name="prediction_summary">Automatische Vervollständigung während der Eingabe aktivieren</string>
|
||||||
<!-- Dialog title for auto complete choices -->
|
<!-- Dialog title for auto complete choices -->
|
||||||
<string name="auto_complete_dialog_title">Autom. vervollständigen</string>
|
<string name="auto_complete_dialog_title">Autovervollständigung</string>
|
||||||
<!-- Option to enable text prediction in landscape -->
|
<!-- Option to enable text prediction in landscape -->
|
||||||
<string name="prediction_landscape">Textfeld vergrößern</string>
|
<string name="prediction_landscape">Textfeld vergrößern</string>
|
||||||
<!-- Description for text prediction -->
|
<!-- Description for text prediction -->
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
<string name="auto_punctuate">Autom. Zeichensetzung</string>
|
<string name="auto_punctuate">Autom. Zeichensetzung</string>
|
||||||
<!-- Description for auto punctuate -->
|
<!-- Description for auto punctuate -->
|
||||||
<!-- Option to enable quick fixes -->
|
<!-- Option to enable quick fixes -->
|
||||||
<string name="quick_fixes">Quick Fixes</string>
|
<string name="quick_fixes">Schnelle Korrektur</string>
|
||||||
<!-- Description for quick fixes -->
|
<!-- Description for quick fixes -->
|
||||||
<string name="quick_fixes_summary">Korrigiert gängige Tippfehler</string>
|
<string name="quick_fixes_summary">Korrigiert gängige Tippfehler</string>
|
||||||
<!-- Option to enable showing suggestions -->
|
<!-- Option to enable showing suggestions -->
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
<!-- Description for auto completion -->
|
<!-- Description for auto completion -->
|
||||||
<string name="auto_complete_summary">Leertaste und Interpunktion fügen autom. ein markiertes Wort ein</string>
|
<string name="auto_complete_summary">Leertaste und Interpunktion fügen autom. ein markiertes Wort ein</string>
|
||||||
<!-- Option to show/hide the settings key -->
|
<!-- Option to show/hide the settings key -->
|
||||||
<string name="prefs_settings_key">Einstellungstaste anz.</string>
|
<string name="prefs_settings_key">Einstellungs-Schlüssel anzeigen</string>
|
||||||
<!-- Array of the settings key mode values -->
|
<!-- Array of the settings key mode values -->
|
||||||
<!-- Option to automatically decide to show/hide the settings key -->
|
<!-- Option to automatically decide to show/hide the settings key -->
|
||||||
<string name="settings_key_mode_auto_name">Automatisch</string>
|
<string name="settings_key_mode_auto_name">Automatisch</string>
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
<!-- Tip to long press on typed word to add to dictionary -->
|
<!-- Tip to long press on typed word to add to dictionary -->
|
||||||
<string name="tip_add_to_dictionary">Lange auf das Wort ganz links außen drücken, um es zum Wörterbuch hinzuzufügen</string>
|
<string name="tip_add_to_dictionary">Lange auf das Wort ganz links außen drücken, um es zum Wörterbuch hinzuzufügen</string>
|
||||||
<!-- Instruction to touch the bubble to continue -->
|
<!-- Instruction to touch the bubble to continue -->
|
||||||
<string name="touch_to_continue">Diesen Hinweis berühren, um fortzufahren »</string>
|
<string name="touch_to_continue">Diesen Hinweis antippen, um fortzufahren.»</string>
|
||||||
<!-- Instruction to touch the bubble to start typing -->
|
<!-- Instruction to touch the bubble to start typing -->
|
||||||
<string name="touch_to_finish">Hier berühren, um diesen Hinweis zu schließen und mit dem Tippen zu beginnen!</string>
|
<string name="touch_to_finish">Hier berühren, um diesen Hinweis zu schließen und mit dem Tippen zu beginnen!</string>
|
||||||
<!-- Tutorial tip 1 - The keyboard opens any time you touch a text field -->
|
<!-- Tutorial tip 1 - The keyboard opens any time you touch a text field -->
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
<!-- Label for "switch to symbols" key. Must be short to fit on key! -->
|
<!-- Label for "switch to symbols" key. Must be short to fit on key! -->
|
||||||
<string name="label_symbol_key">\?123</string>
|
<string name="label_symbol_key">\?123</string>
|
||||||
<!-- Label for "switch to numeric" key. Must be short to fit on key! -->
|
<!-- Label for "switch to numeric" key. Must be short to fit on key! -->
|
||||||
<string name="label_phone_key">Num</string>
|
<string name="label_phone_key">123</string>
|
||||||
<!-- Label for "switch to alphabetic" key. Must be short to fit on key! -->
|
<!-- Label for "switch to alphabetic" key. Must be short to fit on key! -->
|
||||||
<string name="label_alpha_key">ABC</string>
|
<string name="label_alpha_key">ABC</string>
|
||||||
<!-- Label for ALT modifier key. Must be short to fit on key! -->
|
<!-- Label for ALT modifier key. Must be short to fit on key! -->
|
||||||
@@ -186,7 +186,7 @@
|
|||||||
<!-- Short hint shown in candidate view to explain voice input. -->
|
<!-- Short hint shown in candidate view to explain voice input. -->
|
||||||
<string name="voice_swipe_hint"><b>„Hinweis:“</b>„ Ziehen Sie zum Sprechen den Finger über die Tastatur.“</string>
|
<string name="voice_swipe_hint"><b>„Hinweis:“</b>„ Ziehen Sie zum Sprechen den Finger über die Tastatur.“</string>
|
||||||
<!-- Short hint shown in candidate view to explain that user can speak punctuation. -->
|
<!-- Short hint shown in candidate view to explain that user can speak punctuation. -->
|
||||||
<string name="voice_punctuation_hint"><b>„Hinweis:“</b>„ Versuchen Sie beim nächsten Mal, Satzzeichen wie „Punkt“, „Komma“ oder „Fragezeichen“ per Sprachbefehl einzugeben.“</string>
|
<string name="voice_punctuation_hint"><b>Hinweis: </b>Versuche beim nächsten Mal, Satzzeichen wie „Punkt“, „Komma“ oder „Fragezeichen“ per Sprachbefehl einzugeben.</string>
|
||||||
<!-- Label on button to stop recognition. Must be short to fit on button. -->
|
<!-- Label on button to stop recognition. Must be short to fit on button. -->
|
||||||
<string name="cancel">Abbrechen</string>
|
<string name="cancel">Abbrechen</string>
|
||||||
<!-- Label on button when an error occurs -->
|
<!-- Label on button when an error occurs -->
|
||||||
@@ -216,7 +216,7 @@
|
|||||||
<!-- appears above image showing the user to click on a TextView to show the IME -->
|
<!-- appears above image showing the user to click on a TextView to show the IME -->
|
||||||
<string name="open_the_keyboard"><font size="17"><b>„Tastatur öffnen“\n</b></font><font size="3">\n</font>„Berühren Sie ein beliebiges Textfeld.“</string>
|
<string name="open_the_keyboard"><font size="17"><b>„Tastatur öffnen“\n</b></font><font size="3">\n</font>„Berühren Sie ein beliebiges Textfeld.“</string>
|
||||||
<!-- appears above the image showing the back button used to close the keyboard -->
|
<!-- appears above the image showing the back button used to close the keyboard -->
|
||||||
<string name="close_the_keyboard"><font size="17"><b>„Tastatur schließen“\n</b></font><font size="3">\n</font>„Drücken Sie die Zurücktaste.“</string>
|
<string name="close_the_keyboard"><font size="17"><b>Tastatur schließen\n</b></font><font size="3">\n</font>Drücken die Zurück-Taste.</string>
|
||||||
<!-- appears above image showing how to use touch and hold -->
|
<!-- appears above image showing how to use touch and hold -->
|
||||||
<string name="touch_and_hold"><font size="17"><b>„Für Optionen eine Taste berühren und gedrückt halten“\n</b></font><font size="3">\n</font>„Greifen Sie auf Satzzeichen und Akzente zu.“</string>
|
<string name="touch_and_hold"><font size="17"><b>„Für Optionen eine Taste berühren und gedrückt halten“\n</b></font><font size="3">\n</font>„Greifen Sie auf Satzzeichen und Akzente zu.“</string>
|
||||||
<!-- appears above image showing how to access keyboard settings -->
|
<!-- appears above image showing how to access keyboard settings -->
|
||||||
|
@@ -19,71 +19,124 @@
|
|||||||
-->
|
-->
|
||||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<!-- Title for Latin keyboard -->
|
<!-- Title for Latin keyboard -->
|
||||||
|
<string name="english_ime_name">מקלדת של Keepass2Android</string>
|
||||||
<!-- Title for Latin keyboard settings activity / dialog -->
|
<!-- Title for Latin keyboard settings activity / dialog -->
|
||||||
|
<string name="english_ime_settings">הגדרות של מקלדת אנדרואיד</string>
|
||||||
<!-- Title for Latin keyboard input options dialog -->
|
<!-- Title for Latin keyboard input options dialog -->
|
||||||
|
<string name="english_ime_input_options">אפשרויות קלט</string>
|
||||||
<!-- Option to provide vibrate/haptic feedback on keypress -->
|
<!-- Option to provide vibrate/haptic feedback on keypress -->
|
||||||
|
<string name="vibrate_on_keypress">רטט בזמן לחיצה על כפתור</string>
|
||||||
<!-- Option to play back sound on keypress in soft keyboard -->
|
<!-- Option to play back sound on keypress in soft keyboard -->
|
||||||
|
<string name="sound_on_keypress">צליל בזמן לחיצה על כפתור</string>
|
||||||
<!-- Option to pop up the character with a larger font above soft keyboard -->
|
<!-- Option to pop up the character with a larger font above soft keyboard -->
|
||||||
|
<string name="popup_on_keypress">אות קופצת בלחיצה על כפתור</string>
|
||||||
<!-- Option to enable using nearby keys when correcting/predicting -->
|
<!-- Option to enable using nearby keys when correcting/predicting -->
|
||||||
|
<string name="hit_correction">תקן שגיאות הקלדה</string>
|
||||||
<!-- Description for hit_correction -->
|
<!-- Description for hit_correction -->
|
||||||
|
<string name="hit_correction_summary">אפשר תיקון שגיאות קלט</string>
|
||||||
<!-- Option to enable using nearby keys when correcting/predicting in landscape-->
|
<!-- Option to enable using nearby keys when correcting/predicting in landscape-->
|
||||||
|
<string name="hit_correction_land">קלט שגוי במצג אופקי</string>
|
||||||
<!-- Description for hit_correction in landscape -->
|
<!-- Description for hit_correction in landscape -->
|
||||||
|
<string name="hit_correction_land_summary">אפשר תיקון שגיאות קלט</string>
|
||||||
<!-- Option to automatically correct word on hitting space -->
|
<!-- Option to automatically correct word on hitting space -->
|
||||||
|
<string name="auto_correction">הצעות של מילים</string>
|
||||||
<!-- Description for auto_correction -->
|
<!-- Description for auto_correction -->
|
||||||
|
<string name="auto_correction_summary">תקן את המילה הקודמת אוטומטית</string>
|
||||||
<!-- Option to enable text prediction -->
|
<!-- Option to enable text prediction -->
|
||||||
|
<string name="prediction">הצעות של מילים</string>
|
||||||
<!-- Category title for text prediction -->
|
<!-- Category title for text prediction -->
|
||||||
|
<string name="prediction_category">הגדרות של הצעות מילים</string>
|
||||||
<!-- Description for text prediction -->
|
<!-- Description for text prediction -->
|
||||||
|
<string name="prediction_summary">אפשר השלמה אוטומטית בזמן הקלדה</string>
|
||||||
<!-- Dialog title for auto complete choices -->
|
<!-- Dialog title for auto complete choices -->
|
||||||
|
<string name="auto_complete_dialog_title">השלמה אוטומטית</string>
|
||||||
<!-- Option to enable text prediction in landscape -->
|
<!-- Option to enable text prediction in landscape -->
|
||||||
|
<string name="prediction_landscape">הגדל את השדה של הטקסט</string>
|
||||||
<!-- Description for text prediction -->
|
<!-- Description for text prediction -->
|
||||||
|
<string name="prediction_landscape_summary">הסתר הצעות מילים במצג לרוחב</string>
|
||||||
<!-- Option to enable auto capitalization of sentences -->
|
<!-- Option to enable auto capitalization of sentences -->
|
||||||
|
<string name="auto_cap">אות ראשית גדולה אוטומטיות</string>
|
||||||
<!-- Description for auto cap -->
|
<!-- Description for auto cap -->
|
||||||
|
<string name="auto_cap_summary">הגדל אוטומטית את האות הראשונה במשפט</string>
|
||||||
<!-- Option to enable auto punctuate -->
|
<!-- Option to enable auto punctuate -->
|
||||||
|
<string name="auto_punctuate">ניקוד אוטומטי</string>
|
||||||
<!-- Description for auto punctuate -->
|
<!-- Description for auto punctuate -->
|
||||||
<!-- Option to enable quick fixes -->
|
<!-- Option to enable quick fixes -->
|
||||||
|
<string name="quick_fixes">תיקונים מהירים</string>
|
||||||
<!-- Description for quick fixes -->
|
<!-- Description for quick fixes -->
|
||||||
|
<string name="quick_fixes_summary">מתקן טעויות נפוצות בהקלדה</string>
|
||||||
<!-- Option to enable showing suggestions -->
|
<!-- Option to enable showing suggestions -->
|
||||||
|
<string name="show_suggestions">הצג הצעות</string>
|
||||||
<!-- Description for show suggestions -->
|
<!-- Description for show suggestions -->
|
||||||
|
<string name="show_suggestions_summary">הצג מילים מוצעות בזמן הקלדה</string>
|
||||||
<!-- Option to enable auto completion -->
|
<!-- Option to enable auto completion -->
|
||||||
|
<string name="auto_complete">השלמה אוטומטית</string>
|
||||||
<!-- Description for auto completion -->
|
<!-- Description for auto completion -->
|
||||||
|
<string name="auto_complete_summary">מקש רווח או מקש הניקוד אוטומטית מכניסים את המילה המודגשת</string>
|
||||||
<!-- Option to show/hide the settings key -->
|
<!-- Option to show/hide the settings key -->
|
||||||
|
<string name="prefs_settings_key">הצג כפתור הגדרות</string>
|
||||||
<!-- Array of the settings key mode values -->
|
<!-- Array of the settings key mode values -->
|
||||||
<!-- Option to automatically decide to show/hide the settings key -->
|
<!-- Option to automatically decide to show/hide the settings key -->
|
||||||
|
<string name="settings_key_mode_auto_name">אוטומטי</string>
|
||||||
<!-- Option to always show the settings key -->
|
<!-- Option to always show the settings key -->
|
||||||
|
<string name="settings_key_mode_always_show_name">הצג תמיד</string>
|
||||||
<!-- Option to always hide the settings key -->
|
<!-- Option to always hide the settings key -->
|
||||||
|
<string name="settings_key_mode_always_hide_name">הסתר תמיד</string>
|
||||||
<!-- Array of the settings key modes -->
|
<!-- Array of the settings key modes -->
|
||||||
<!-- Option to enable bigram completion -->
|
<!-- Option to enable bigram completion -->
|
||||||
|
<string name="bigram_suggestion">הצעות bigram</string>
|
||||||
<!-- Description for auto completion -->
|
<!-- Description for auto completion -->
|
||||||
|
<string name="bigram_suggestion_summary">תשתמש במילה הקודמת כדי לשפר את ההצעה</string>
|
||||||
<!-- Array of prediction modes -->
|
<!-- Array of prediction modes -->
|
||||||
<string-array name="prediction_modes">
|
<string-array name="prediction_modes">
|
||||||
<item>אף אחד</item>
|
<item>אף אחד</item>
|
||||||
<item>Basic</item>
|
<item>בסיסי</item>
|
||||||
<item>Advanced</item>
|
<item>מתקדם</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<!-- Don't translate -->
|
<!-- Don't translate -->
|
||||||
<!-- Don't translate -->
|
<!-- Don't translate -->
|
||||||
<!-- Don't translate -->
|
<!-- Don't translate -->
|
||||||
<!-- Indicates that a word has been added to the dictionary -->
|
<!-- Indicates that a word has been added to the dictionary -->
|
||||||
|
<string name="added_word"><xliff:g id="word">%s</xliff:g> : נשמר</string>
|
||||||
<!-- Tip to long press on keys -->
|
<!-- Tip to long press on keys -->
|
||||||
|
<string name="tip_long_press">החזק כפתור כדי לראות סימנים מיוחדים (ø, ö, וכו\')</string>
|
||||||
<!-- Tip to dismiss keyboard -->
|
<!-- Tip to dismiss keyboard -->
|
||||||
|
<string name="tip_dismiss">הקש על כפתור חזור \u21B6 כדי לסגור את המקלדת בכל שלב</string>
|
||||||
<!-- Tip to press ?123 to access numbers and symbols -->
|
<!-- Tip to press ?123 to access numbers and symbols -->
|
||||||
|
<string name="tip_access_symbols">קבל גישה למספר ולסימנים</string>
|
||||||
<!-- Tip to long press on typed word to add to dictionary -->
|
<!-- Tip to long press on typed word to add to dictionary -->
|
||||||
|
<string name="tip_add_to_dictionary">גע והשאר את המילה הכי שמאלית לחוצה כדי להוסיף אותה למילון
|
||||||
|
</string>
|
||||||
<!-- Instruction to touch the bubble to continue -->
|
<!-- Instruction to touch the bubble to continue -->
|
||||||
|
<string name="touch_to_continue">גע ברמז זה כדי להמשיך »</string>
|
||||||
<!-- Instruction to touch the bubble to start typing -->
|
<!-- Instruction to touch the bubble to start typing -->
|
||||||
|
<string name="touch_to_finish">גע פה כדי לסגור את הרמז הזה ותתחיל להקליד!</string>
|
||||||
<!-- Tutorial tip 1 - The keyboard opens any time you touch a text field -->
|
<!-- Tutorial tip 1 - The keyboard opens any time you touch a text field -->
|
||||||
|
<string name="tip_to_open_keyboard"><b>המקלדת נפתחת בכל רגע שאתה נוגע בשדה עם טקסט</b></string>
|
||||||
<!-- Tutorial tip 2 - Touch and hold a key to view accents (examples) -->
|
<!-- Tutorial tip 2 - Touch and hold a key to view accents (examples) -->
|
||||||
|
<string name="tip_to_view_accents"><b>גע והחזק מקש כדי לראות סימנים\n(<, >, =, ; וכך הלאה)</b></string>
|
||||||
<!-- Tutorial tip 3 - How to switch to number/symbol keyboard -->
|
<!-- Tutorial tip 3 - How to switch to number/symbol keyboard -->
|
||||||
|
<string name="tip_to_open_symbols"><b>עבור למספרים וסימנים בעזרת לחיצה על מקש זה</b></string>
|
||||||
<!-- Tutorial tip 4 - How to switch back to alphabet keyboard -->
|
<!-- Tutorial tip 4 - How to switch back to alphabet keyboard -->
|
||||||
|
<string name="tip_to_close_symbols"><b>חזור להקליד אותיות בעזרת נגיעה על אותו המקש שוב</b></string>
|
||||||
<!-- Tutorial tip 5 - How to launch keyboard settings -->
|
<!-- Tutorial tip 5 - How to launch keyboard settings -->
|
||||||
|
<string name="tip_to_launch_settings"><b>גע והחזק מקש זה כדי לשנות את הגדרות המקלדת כגון השלמה אוטומטית</b></string>
|
||||||
<!-- Tutorial tip 6 - Done with the tutorial -->
|
<!-- Tutorial tip 6 - Done with the tutorial -->
|
||||||
|
<string name="tip_to_start_typing"><b>נסה זאת!</b></string>
|
||||||
<!-- Label for soft enter key when it performs GO action. Must be short to fit on key! -->
|
<!-- Label for soft enter key when it performs GO action. Must be short to fit on key! -->
|
||||||
|
<string name="label_go_key">המשך</string>
|
||||||
<!-- Label for soft enter key when it performs NEXT action. Must be short to fit on key! -->
|
<!-- Label for soft enter key when it performs NEXT action. Must be short to fit on key! -->
|
||||||
|
<string name="label_next_key">הבא</string>
|
||||||
<!-- Label for soft enter key when it performs DONE action. Must be short to fit on key! -->
|
<!-- Label for soft enter key when it performs DONE action. Must be short to fit on key! -->
|
||||||
<string name="label_done_key">בוצע</string>
|
<string name="label_done_key">בוצע</string>
|
||||||
<!-- Label for soft enter key when it performs SEND action. Must be short to fit on key! -->
|
<!-- Label for soft enter key when it performs SEND action. Must be short to fit on key! -->
|
||||||
|
<string name="label_send_key">שלח</string>
|
||||||
<!-- Label for "switch to symbols" key. Must be short to fit on key! -->
|
<!-- Label for "switch to symbols" key. Must be short to fit on key! -->
|
||||||
|
<string name="label_symbol_key">\?123</string>
|
||||||
<!-- Label for "switch to numeric" key. Must be short to fit on key! -->
|
<!-- Label for "switch to numeric" key. Must be short to fit on key! -->
|
||||||
|
<string name="label_phone_key">123</string>
|
||||||
<!-- Label for "switch to alphabetic" key. Must be short to fit on key! -->
|
<!-- Label for "switch to alphabetic" key. Must be short to fit on key! -->
|
||||||
|
<string name="label_alpha_key">אבג</string>
|
||||||
<!-- Label for ALT modifier key. Must be short to fit on key! -->
|
<!-- Label for ALT modifier key. Must be short to fit on key! -->
|
||||||
<!-- Voice related labels -->
|
<!-- Voice related labels -->
|
||||||
<!-- Title of the warning dialog that shows when a user initiates voice input for
|
<!-- Title of the warning dialog that shows when a user initiates voice input for
|
||||||
|
@@ -133,8 +133,11 @@
|
|||||||
<!-- Label for "switch to symbols" key. Must be short to fit on key! -->
|
<!-- Label for "switch to symbols" key. Must be short to fit on key! -->
|
||||||
<string name="label_symbol_key">\?123</string>
|
<string name="label_symbol_key">\?123</string>
|
||||||
<!-- Label for "switch to numeric" key. Must be short to fit on key! -->
|
<!-- Label for "switch to numeric" key. Must be short to fit on key! -->
|
||||||
|
<string name="label_phone_key">123</string>
|
||||||
<!-- Label for "switch to alphabetic" key. Must be short to fit on key! -->
|
<!-- Label for "switch to alphabetic" key. Must be short to fit on key! -->
|
||||||
|
<string name="label_alpha_key">ABC</string>
|
||||||
<!-- Label for ALT modifier key. Must be short to fit on key! -->
|
<!-- Label for ALT modifier key. Must be short to fit on key! -->
|
||||||
|
<string name="label_alt_key">ALT</string>
|
||||||
<!-- Voice related labels -->
|
<!-- Voice related labels -->
|
||||||
<!-- Title of the warning dialog that shows when a user initiates voice input for
|
<!-- Title of the warning dialog that shows when a user initiates voice input for
|
||||||
the first time. -->
|
the first time. -->
|
||||||
@@ -182,6 +185,7 @@
|
|||||||
<!-- Label on button to stop recognition. Must be short to fit on button. -->
|
<!-- Label on button to stop recognition. Must be short to fit on button. -->
|
||||||
<string name="cancel">Anulează</string>
|
<string name="cancel">Anulează</string>
|
||||||
<!-- Label on button when an error occurs -->
|
<!-- Label on button when an error occurs -->
|
||||||
|
<string name="ok">Bine</string>
|
||||||
<!-- Preferences item for enabling speech input -->
|
<!-- Preferences item for enabling speech input -->
|
||||||
<string name="voice_input">Intrare voce</string>
|
<string name="voice_input">Intrare voce</string>
|
||||||
<!-- Array of Voice Input modes -->
|
<!-- Array of Voice Input modes -->
|
||||||
@@ -213,10 +217,15 @@
|
|||||||
<!-- appears above image showing how to access keyboard settings -->
|
<!-- appears above image showing how to access keyboard settings -->
|
||||||
<string name="keyboard_settings"><font size="17"><b>\"Setările tastaturii\"\n</b></font><font size="3">\n</font>\"Atingeţi şi ţineţi apăsată tasta \"<b>\"?123\"</b>\".\"</string>
|
<string name="keyboard_settings"><font size="17"><b>\"Setările tastaturii\"\n</b></font><font size="3">\n</font>\"Atingeţi şi ţineţi apăsată tasta \"<b>\"?123\"</b>\".\"</string>
|
||||||
<!-- popular web domains for the locale - most popular, displayed on the keyboard -->
|
<!-- popular web domains for the locale - most popular, displayed on the keyboard -->
|
||||||
|
<string name="popular_domain_0">".com"</string>
|
||||||
<!-- popular web domains for the locale - item 1, displayed in the popup -->
|
<!-- popular web domains for the locale - item 1, displayed in the popup -->
|
||||||
|
<string name="popular_domain_1">".net"</string>
|
||||||
<!-- popular web domains for the locale - item 2, displayed in the popup -->
|
<!-- popular web domains for the locale - item 2, displayed in the popup -->
|
||||||
|
<string name="popular_domain_2">".org"</string>
|
||||||
<!-- popular web domains for the locale - item 3, displayed in the popup -->
|
<!-- popular web domains for the locale - item 3, displayed in the popup -->
|
||||||
|
<string name="popular_domain_3">".gov"</string>
|
||||||
<!-- popular web domains for the locale - item 4, displayed in the popup -->
|
<!-- popular web domains for the locale - item 4, displayed in the popup -->
|
||||||
|
<string name="popular_domain_4">".edu"</string>
|
||||||
<!-- Menu item for launching Input method picker -->
|
<!-- Menu item for launching Input method picker -->
|
||||||
<string name="selectInputMethod">Selectaţi metoda de introducere a textului</string>
|
<string name="selectInputMethod">Selectaţi metoda de introducere a textului</string>
|
||||||
<!-- Title for input language selection screen -->
|
<!-- Title for input language selection screen -->
|
||||||
@@ -240,4 +249,5 @@
|
|||||||
<string name="subtype_mode_keyboard">tastatură</string>
|
<string name="subtype_mode_keyboard">tastatură</string>
|
||||||
<string name="subtype_mode_voice">voce</string>
|
<string name="subtype_mode_voice">voce</string>
|
||||||
<!-- Title for Latin keyboard debug settings activity / dialog -->
|
<!-- Title for Latin keyboard debug settings activity / dialog -->
|
||||||
|
<string name="kp2a_nextfields"><![CDATA[>]]></string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -133,8 +133,11 @@
|
|||||||
<!-- Label for "switch to symbols" key. Must be short to fit on key! -->
|
<!-- Label for "switch to symbols" key. Must be short to fit on key! -->
|
||||||
<string name="label_symbol_key">\?123</string>
|
<string name="label_symbol_key">\?123</string>
|
||||||
<!-- Label for "switch to numeric" key. Must be short to fit on key! -->
|
<!-- Label for "switch to numeric" key. Must be short to fit on key! -->
|
||||||
|
<string name="label_phone_key">123</string>
|
||||||
<!-- Label for "switch to alphabetic" key. Must be short to fit on key! -->
|
<!-- Label for "switch to alphabetic" key. Must be short to fit on key! -->
|
||||||
|
<string name="label_alpha_key">ABC</string>
|
||||||
<!-- Label for ALT modifier key. Must be short to fit on key! -->
|
<!-- Label for ALT modifier key. Must be short to fit on key! -->
|
||||||
|
<string name="label_alt_key">ALT</string>
|
||||||
<!-- Voice related labels -->
|
<!-- Voice related labels -->
|
||||||
<!-- Title of the warning dialog that shows when a user initiates voice input for
|
<!-- Title of the warning dialog that shows when a user initiates voice input for
|
||||||
the first time. -->
|
the first time. -->
|
||||||
@@ -182,6 +185,7 @@
|
|||||||
<!-- Label on button to stop recognition. Must be short to fit on button. -->
|
<!-- Label on button to stop recognition. Must be short to fit on button. -->
|
||||||
<string name="cancel">Hủy bỏ</string>
|
<string name="cancel">Hủy bỏ</string>
|
||||||
<!-- Label on button when an error occurs -->
|
<!-- Label on button when an error occurs -->
|
||||||
|
<string name="ok">OK</string>
|
||||||
<!-- Preferences item for enabling speech input -->
|
<!-- Preferences item for enabling speech input -->
|
||||||
<string name="voice_input">Nhập liệu bằng giọng nói</string>
|
<string name="voice_input">Nhập liệu bằng giọng nói</string>
|
||||||
<!-- Array of Voice Input modes -->
|
<!-- Array of Voice Input modes -->
|
||||||
@@ -213,10 +217,15 @@
|
|||||||
<!-- appears above image showing how to access keyboard settings -->
|
<!-- appears above image showing how to access keyboard settings -->
|
||||||
<string name="keyboard_settings"><font size="17"><b>\"Cài đặt bàn phím\"\n</b></font><font size="3">\n</font>\"Chạm & giữ phím \"<b>\"?123\"</b>\".\"</string>
|
<string name="keyboard_settings"><font size="17"><b>\"Cài đặt bàn phím\"\n</b></font><font size="3">\n</font>\"Chạm & giữ phím \"<b>\"?123\"</b>\".\"</string>
|
||||||
<!-- popular web domains for the locale - most popular, displayed on the keyboard -->
|
<!-- popular web domains for the locale - most popular, displayed on the keyboard -->
|
||||||
|
<string name="popular_domain_0">".com"</string>
|
||||||
<!-- popular web domains for the locale - item 1, displayed in the popup -->
|
<!-- popular web domains for the locale - item 1, displayed in the popup -->
|
||||||
|
<string name="popular_domain_1">".net"</string>
|
||||||
<!-- popular web domains for the locale - item 2, displayed in the popup -->
|
<!-- popular web domains for the locale - item 2, displayed in the popup -->
|
||||||
|
<string name="popular_domain_2">".org"</string>
|
||||||
<!-- popular web domains for the locale - item 3, displayed in the popup -->
|
<!-- popular web domains for the locale - item 3, displayed in the popup -->
|
||||||
|
<string name="popular_domain_3">".gov"</string>
|
||||||
<!-- popular web domains for the locale - item 4, displayed in the popup -->
|
<!-- popular web domains for the locale - item 4, displayed in the popup -->
|
||||||
|
<string name="popular_domain_4">".edu"</string>
|
||||||
<!-- Menu item for launching Input method picker -->
|
<!-- Menu item for launching Input method picker -->
|
||||||
<string name="selectInputMethod">Chọn phương thức nhập</string>
|
<string name="selectInputMethod">Chọn phương thức nhập</string>
|
||||||
<!-- Title for input language selection screen -->
|
<!-- Title for input language selection screen -->
|
||||||
@@ -240,4 +249,5 @@
|
|||||||
<string name="subtype_mode_keyboard">bàn phím</string>
|
<string name="subtype_mode_keyboard">bàn phím</string>
|
||||||
<string name="subtype_mode_voice">thoại</string>
|
<string name="subtype_mode_voice">thoại</string>
|
||||||
<!-- Title for Latin keyboard debug settings activity / dialog -->
|
<!-- Title for Latin keyboard debug settings activity / dialog -->
|
||||||
|
<string name="kp2a_nextfields"><![CDATA[>]]></string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -0,0 +1,140 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
**
|
||||||
|
** Copyright 2008, The Android Open Source Project
|
||||||
|
**
|
||||||
|
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
** you may not use this file except in compliance with the License.
|
||||||
|
** You may obtain a copy of the License at
|
||||||
|
**
|
||||||
|
** http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
**
|
||||||
|
** Unless required by applicable law or agreed to in writing, software
|
||||||
|
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
** See the License for the specific language governing permissions and
|
||||||
|
** limitations under the License.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
|
<!-- Title for Latin keyboard -->
|
||||||
|
<!-- Title for Latin keyboard settings activity / dialog -->
|
||||||
|
<!-- Title for Latin keyboard input options dialog -->
|
||||||
|
<!-- Option to provide vibrate/haptic feedback on keypress -->
|
||||||
|
<!-- Option to play back sound on keypress in soft keyboard -->
|
||||||
|
<!-- Option to pop up the character with a larger font above soft keyboard -->
|
||||||
|
<!-- Option to enable using nearby keys when correcting/predicting -->
|
||||||
|
<!-- Description for hit_correction -->
|
||||||
|
<!-- Option to enable using nearby keys when correcting/predicting in landscape-->
|
||||||
|
<!-- Description for hit_correction in landscape -->
|
||||||
|
<!-- Option to automatically correct word on hitting space -->
|
||||||
|
<!-- Description for auto_correction -->
|
||||||
|
<!-- Option to enable text prediction -->
|
||||||
|
<!-- Category title for text prediction -->
|
||||||
|
<!-- Description for text prediction -->
|
||||||
|
<!-- Dialog title for auto complete choices -->
|
||||||
|
<!-- Option to enable text prediction in landscape -->
|
||||||
|
<!-- Description for text prediction -->
|
||||||
|
<!-- Option to enable auto capitalization of sentences -->
|
||||||
|
<!-- Description for auto cap -->
|
||||||
|
<!-- Option to enable auto punctuate -->
|
||||||
|
<!-- Description for auto punctuate -->
|
||||||
|
<!-- Option to enable quick fixes -->
|
||||||
|
<!-- Description for quick fixes -->
|
||||||
|
<!-- Option to enable showing suggestions -->
|
||||||
|
<!-- Description for show suggestions -->
|
||||||
|
<!-- Option to enable auto completion -->
|
||||||
|
<!-- Description for auto completion -->
|
||||||
|
<!-- Option to show/hide the settings key -->
|
||||||
|
<!-- Array of the settings key mode values -->
|
||||||
|
<!-- Option to automatically decide to show/hide the settings key -->
|
||||||
|
<!-- Option to always show the settings key -->
|
||||||
|
<!-- Option to always hide the settings key -->
|
||||||
|
<!-- Array of the settings key modes -->
|
||||||
|
<!-- Option to enable bigram completion -->
|
||||||
|
<!-- Description for auto completion -->
|
||||||
|
<!-- Array of prediction modes -->
|
||||||
|
<!-- Don't translate -->
|
||||||
|
<!-- Don't translate -->
|
||||||
|
<!-- Don't translate -->
|
||||||
|
<!-- Indicates that a word has been added to the dictionary -->
|
||||||
|
<!-- Tip to long press on keys -->
|
||||||
|
<!-- Tip to dismiss keyboard -->
|
||||||
|
<!-- Tip to press ?123 to access numbers and symbols -->
|
||||||
|
<!-- Tip to long press on typed word to add to dictionary -->
|
||||||
|
<!-- Instruction to touch the bubble to continue -->
|
||||||
|
<!-- Instruction to touch the bubble to start typing -->
|
||||||
|
<!-- Tutorial tip 1 - The keyboard opens any time you touch a text field -->
|
||||||
|
<!-- Tutorial tip 2 - Touch and hold a key to view accents (examples) -->
|
||||||
|
<!-- Tutorial tip 3 - How to switch to number/symbol keyboard -->
|
||||||
|
<!-- Tutorial tip 4 - How to switch back to alphabet keyboard -->
|
||||||
|
<!-- Tutorial tip 5 - How to launch keyboard settings -->
|
||||||
|
<!-- Tutorial tip 6 - Done with the tutorial -->
|
||||||
|
<!-- Label for soft enter key when it performs GO action. Must be short to fit on key! -->
|
||||||
|
<!-- Label for soft enter key when it performs NEXT action. Must be short to fit on key! -->
|
||||||
|
<!-- Label for soft enter key when it performs DONE action. Must be short to fit on key! -->
|
||||||
|
<!-- Label for soft enter key when it performs SEND action. Must be short to fit on key! -->
|
||||||
|
<!-- Label for "switch to symbols" key. Must be short to fit on key! -->
|
||||||
|
<!-- Label for "switch to numeric" key. Must be short to fit on key! -->
|
||||||
|
<!-- Label for "switch to alphabetic" key. Must be short to fit on key! -->
|
||||||
|
<!-- Label for ALT modifier key. Must be short to fit on key! -->
|
||||||
|
<!-- Voice related labels -->
|
||||||
|
<!-- Title of the warning dialog that shows when a user initiates voice input for
|
||||||
|
the first time. -->
|
||||||
|
<!-- Message that gets put at the top of the warning dialog if the user is attempting to use
|
||||||
|
voice input in a currently unsupported locale. Voice input will work for such a user,
|
||||||
|
but it will only recognize them in English. -->
|
||||||
|
<!-- Message of the warning dialog that shows when a user initiates voice input for
|
||||||
|
the first time, or turns it on in settings. -->
|
||||||
|
<!-- An additional part of the warning dialog for voice input that only shows when the user
|
||||||
|
actually initiates voice input, rather than just turning it on in settings. -->
|
||||||
|
<!-- Message to show when user clicks the swiping hint (which says
|
||||||
|
"Swipe across keyboard to speak"). Also shown when enabling settings. -->
|
||||||
|
<!-- Short message to tell the user the system is ready for them to speak. -->
|
||||||
|
<!-- Short message shown after the user finishes speaking. -->
|
||||||
|
<!-- Short message shown before the user should speak. -->
|
||||||
|
<!-- Short message shown when a generic error occurs. -->
|
||||||
|
<!-- Short message shown for a network error. -->
|
||||||
|
<!-- Short message shown for a network error where the utterance was really long,
|
||||||
|
in which case we should suggest that the user speak less. -->
|
||||||
|
<!-- Short message shown for an audio error. -->
|
||||||
|
<!-- Short message shown for an error with the voice server. -->
|
||||||
|
<!-- Short message shown when no speech is heard. -->
|
||||||
|
<!-- Short message shown when the server couldn't parse any speech. -->
|
||||||
|
<!-- Short message shown when the user initiates voice and voice
|
||||||
|
search is not installed. -->
|
||||||
|
<!-- Short hint shown in candidate view to explain voice input. -->
|
||||||
|
<!-- Short hint shown in candidate view to explain that user can speak punctuation. -->
|
||||||
|
<!-- Label on button to stop recognition. Must be short to fit on button. -->
|
||||||
|
<!-- Label on button when an error occurs -->
|
||||||
|
<!-- Preferences item for enabling speech input -->
|
||||||
|
<!-- Array of Voice Input modes -->
|
||||||
|
<!-- Don't translate -->
|
||||||
|
<!-- Don't translate -->
|
||||||
|
<!-- Don't translate -->
|
||||||
|
<!-- Array of Voice Input modes summary -->
|
||||||
|
<!-- Press the "enter" key after the user speaks. Option on settings.-->
|
||||||
|
<!-- Press the "enter" key after the user speaks. Summary of option in settings.-->
|
||||||
|
<!-- IME Tutorial screen (ROMAN) -->
|
||||||
|
<!-- appears above image showing the user to click on a TextView to show the IME -->
|
||||||
|
<!-- appears above the image showing the back button used to close the keyboard -->
|
||||||
|
<!-- appears above image showing how to use touch and hold -->
|
||||||
|
<!-- appears above image showing how to access keyboard settings -->
|
||||||
|
<!-- popular web domains for the locale - most popular, displayed on the keyboard -->
|
||||||
|
<!-- popular web domains for the locale - item 1, displayed in the popup -->
|
||||||
|
<!-- popular web domains for the locale - item 2, displayed in the popup -->
|
||||||
|
<!-- popular web domains for the locale - item 3, displayed in the popup -->
|
||||||
|
<!-- popular web domains for the locale - item 4, displayed in the popup -->
|
||||||
|
<!-- Menu item for launching Input method picker -->
|
||||||
|
<!-- Title for input language selection screen -->
|
||||||
|
<!-- Title summary for input language selection screen -->
|
||||||
|
<!-- Add to dictionary hint -->
|
||||||
|
<!-- Inform the user that a particular language has an available dictionary -->
|
||||||
|
<!-- Preferences item for enabling to send user statistics to Google -->
|
||||||
|
<!-- Description for enabling to send user statistics to Google -->
|
||||||
|
<!-- Preferences item for enabling to correct suggestions by touching words you have typed -->
|
||||||
|
<!-- The summary for the preferences item for enabling to correct suggestions by touching words you have typed -->
|
||||||
|
<!-- Description for keyboard theme switcher -->
|
||||||
|
<!-- Title for Latin keyboard debug settings activity / dialog -->
|
||||||
|
</resources>
|
@@ -64,8 +64,6 @@ public abstract class Kp2aFileProvider extends BaseFileProvider {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onCreate() {
|
public boolean onCreate() {
|
||||||
|
|
||||||
Log.d("KP2A_FC_P", "onCreate");
|
|
||||||
|
|
||||||
BaseFileProviderUtils.registerProviderInfo(_ID,
|
BaseFileProviderUtils.registerProviderInfo(_ID,
|
||||||
getAuthority());
|
getAuthority());
|
||||||
|
|
||||||
@@ -222,12 +220,12 @@ public abstract class Kp2aFileProvider extends BaseFileProvider {
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
checkConnection(uri);
|
checkConnection(uri);
|
||||||
Log.d("KP2A_FC_P", "checking connection for " + uri + " ok.");
|
if (Utils.doLog()) Log.d("KP2A_FC_P", "checking connection for " + uri + " ok.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.d("KP2A_FC_P","Check connection failed with: " + e.toString());
|
if (Utils.doLog()) Log.d("KP2A_FC_P","Check connection failed with: " + e.toString());
|
||||||
|
|
||||||
MatrixCursor matrixCursor = new MatrixCursor(BaseFileProviderUtils.CONNECTION_CHECK_CURSOR_COLUMNS);
|
MatrixCursor matrixCursor = new MatrixCursor(BaseFileProviderUtils.CONNECTION_CHECK_CURSOR_COLUMNS);
|
||||||
RowBuilder newRow = matrixCursor.newRow();
|
RowBuilder newRow = matrixCursor.newRow();
|
||||||
@@ -255,7 +253,7 @@ public abstract class Kp2aFileProvider extends BaseFileProvider {
|
|||||||
}
|
}
|
||||||
catch (FileNotFoundException ex)
|
catch (FileNotFoundException ex)
|
||||||
{
|
{
|
||||||
Log.d("KP2A_FC_P","File not found. Ignore.");
|
if (Utils.doLog()) Log.d("KP2A_FC_P","File not found. Ignore.");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -276,8 +274,8 @@ public abstract class Kp2aFileProvider extends BaseFileProvider {
|
|||||||
MatrixCursor matrixCursor = null;
|
MatrixCursor matrixCursor = null;
|
||||||
|
|
||||||
String lastPathSegment = uri.getLastPathSegment();
|
String lastPathSegment = uri.getLastPathSegment();
|
||||||
|
|
||||||
Log.d("KP2A_FC_P", "lastPathSegment:" + lastPathSegment);
|
if (Utils.doLog()) Log.d("KP2A_FC_P", "lastPathSegment:" + lastPathSegment);
|
||||||
|
|
||||||
if (BaseFile.CMD_CANCEL.equals(lastPathSegment)) {
|
if (BaseFile.CMD_CANCEL.equals(lastPathSegment)) {
|
||||||
int taskId = ProviderUtils.getIntQueryParam(uri,
|
int taskId = ProviderUtils.getIntQueryParam(uri,
|
||||||
@@ -361,7 +359,7 @@ public abstract class Kp2aFileProvider extends BaseFileProvider {
|
|||||||
|
|
||||||
} else if (BaseFile.CMD_CHECK_CONNECTION.equals(lastPathSegment))
|
} else if (BaseFile.CMD_CHECK_CONNECTION.equals(lastPathSegment))
|
||||||
{
|
{
|
||||||
Log.d("KP2A_FC_P","Check connection...");
|
if (Utils.doLog()) Log.d("KP2A_FC_P","Check connection...");
|
||||||
return getCheckConnectionCursor(uri);
|
return getCheckConnectionCursor(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,7 +468,7 @@ public abstract class Kp2aFileProvider extends BaseFileProvider {
|
|||||||
String displayName = getFileEntryCached(dirName).displayName;
|
String displayName = getFileEntryCached(dirName).displayName;
|
||||||
newRow.add(displayName);
|
newRow.add(displayName);
|
||||||
|
|
||||||
Log.d(CLASSNAME, "Returning name " + displayName+" for " +dirName);
|
if (Utils.doLog()) Log.d(CLASSNAME, "Returning name " + displayName+" for " +dirName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -690,7 +688,7 @@ public abstract class Kp2aFileProvider extends BaseFileProvider {
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.d("KP2A_FC_P", "sortFiles() >> "+e);
|
if (Utils.doLog()) Log.d("KP2A_FC_P", "sortFiles() >> "+e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}// sortFiles()
|
}// sortFiles()
|
||||||
@@ -777,14 +775,14 @@ public abstract class Kp2aFileProvider extends BaseFileProvider {
|
|||||||
path = removeTrailingSlash(path);
|
path = removeTrailingSlash(path);
|
||||||
if (path.indexOf("://") == -1)
|
if (path.indexOf("://") == -1)
|
||||||
{
|
{
|
||||||
Log.d("KP2A_FC_P", "invalid path: " + path);
|
if (Utils.doLog()) Log.d("KP2A_FC_P", "invalid path: " + path);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String pathWithoutProtocol = path.substring(path.indexOf("://") + 3);
|
String pathWithoutProtocol = path.substring(path.indexOf("://") + 3);
|
||||||
int lastSlashPos = path.lastIndexOf("/");
|
int lastSlashPos = path.lastIndexOf("/");
|
||||||
if (pathWithoutProtocol.indexOf("/") == -1)
|
if (pathWithoutProtocol.indexOf("/") == -1)
|
||||||
{
|
{
|
||||||
Log.d("KP2A_FC_P", "parent of " + path + " is null");
|
if (Utils.doLog()) Log.d("KP2A_FC_P", "parent of " + path + " is null");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -793,7 +791,7 @@ public abstract class Kp2aFileProvider extends BaseFileProvider {
|
|||||||
if (params != null) {
|
if (params != null) {
|
||||||
parent += params;
|
parent += params;
|
||||||
}
|
}
|
||||||
Log.d("KP2A_FC_P", "parent of " + path +" is " + parent);
|
if (Utils.doLog()) Log.d("KP2A_FC_P", "parent of " + path +" is " + parent);
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -56,15 +56,15 @@
|
|||||||
<string name="afc_title_sort_by">Sortieren nach…</string>
|
<string name="afc_title_sort_by">Sortieren nach…</string>
|
||||||
<string name="afc_yesterday">Gestern</string>
|
<string name="afc_yesterday">Gestern</string>
|
||||||
<plurals name="afc_title_choose_directories">
|
<plurals name="afc_title_choose_directories">
|
||||||
<item quantity="one">Ordner wählen …</item>
|
<item quantity="one">Ordner wählen…</item>
|
||||||
<item quantity="other">Verzeichnisse wählen…</item>
|
<item quantity="other">Verzeichnisse wählen</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
<plurals name="afc_title_choose_files">
|
<plurals name="afc_title_choose_files">
|
||||||
<item quantity="one">Datei wählen …</item>
|
<item quantity="one">Datei wählen …</item>
|
||||||
<item quantity="other">Dateien wählen …</item>
|
<item quantity="other">Dateien wählen …</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
<plurals name="afc_title_choose_files_directories">
|
<plurals name="afc_title_choose_files_directories">
|
||||||
<item quantity="one">Datei/Ordner wählen …</item>
|
<item quantity="one">Datei/Ordner wählen…</item>
|
||||||
<item quantity="other">Dateien/Ordner wählen …</item>
|
<item quantity="other">Dateien/Ordner wählen …</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -56,15 +56,15 @@
|
|||||||
<string name="afc_title_sort_by">Ordina per…</string>
|
<string name="afc_title_sort_by">Ordina per…</string>
|
||||||
<string name="afc_yesterday">Ieri</string>
|
<string name="afc_yesterday">Ieri</string>
|
||||||
<plurals name="afc_title_choose_directories">
|
<plurals name="afc_title_choose_directories">
|
||||||
<item quantity="one">Scegli la cartella…</item>
|
<item quantity="one">Scegli cartella...</item>
|
||||||
<item quantity="other">Scegli le cartelle…</item>
|
<item quantity="other">Scegli le cartelle...</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
<plurals name="afc_title_choose_files">
|
<plurals name="afc_title_choose_files">
|
||||||
<item quantity="one">Scegli il file…</item>
|
<item quantity="one">Scegli il file</item>
|
||||||
<item quantity="other">Scegli i file…</item>
|
<item quantity="other">Scegli i file</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
<plurals name="afc_title_choose_files_directories">
|
<plurals name="afc_title_choose_files_directories">
|
||||||
<item quantity="one">Scegli file/ cartella…</item>
|
<item quantity="one">Scegli file/cartella</item>
|
||||||
<item quantity="other">Scegli file/ cartelle…</item>
|
<item quantity="other">Scegli file/cartelle</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -55,4 +55,19 @@
|
|||||||
<string name="afc_title_size">Dimensiune</string>
|
<string name="afc_title_size">Dimensiune</string>
|
||||||
<string name="afc_title_sort_by">Sortează după…</string>
|
<string name="afc_title_sort_by">Sortează după…</string>
|
||||||
<string name="afc_yesterday">Ieri</string>
|
<string name="afc_yesterday">Ieri</string>
|
||||||
|
<plurals name="afc_title_choose_directories">
|
||||||
|
<item quantity="one">Alege dosarul…</item>
|
||||||
|
<item quantity="few">Alege dosarele…</item>
|
||||||
|
<item quantity="other">Alege dosarele…</item>
|
||||||
|
</plurals>
|
||||||
|
<plurals name="afc_title_choose_files">
|
||||||
|
<item quantity="one">Alege fișierul…</item>
|
||||||
|
<item quantity="few">Alege fișierele…</item>
|
||||||
|
<item quantity="other">Alege fișierele…</item>
|
||||||
|
</plurals>
|
||||||
|
<plurals name="afc_title_choose_files_directories">
|
||||||
|
<item quantity="one">Alege fișierul/dosarul…</item>
|
||||||
|
<item quantity="few">Alege fișierele/dosarele…</item>
|
||||||
|
<item quantity="other">Alege fișierele/dosarele…</item>
|
||||||
|
</plurals>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -56,12 +56,12 @@
|
|||||||
<string name="afc_title_sort_by">Sắp xếp theo…</string>
|
<string name="afc_title_sort_by">Sắp xếp theo…</string>
|
||||||
<string name="afc_yesterday">Hôm qua</string>
|
<string name="afc_yesterday">Hôm qua</string>
|
||||||
<plurals name="afc_title_choose_directories">
|
<plurals name="afc_title_choose_directories">
|
||||||
<item quantity="other">Chọn thư mục…</item>
|
<item quantity="other">Chọn thư mục…</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
<plurals name="afc_title_choose_files">
|
<plurals name="afc_title_choose_files">
|
||||||
<item quantity="other">Chọn tập tin…</item>
|
<item quantity="other">Chọn tệp…</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
<plurals name="afc_title_choose_files_directories">
|
<plurals name="afc_title_choose_files_directories">
|
||||||
<item quantity="other">Chọn tập tin / thư mục…</item>
|
<item quantity="other">Chọn tệp/thư mục…</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (c) 2012 Hai Bison
|
||||||
|
|
||||||
|
See the file LICENSE at the root directory of this project for copying
|
||||||
|
permission.
|
||||||
|
-->
|
||||||
|
<resources></resources>
|
@@ -59,7 +59,7 @@ namespace keepass2android
|
|||||||
}
|
}
|
||||||
catch (ActivityNotFoundException)
|
catch (ActivityNotFoundException)
|
||||||
{
|
{
|
||||||
Toast.MakeText(Context, Resource.String.no_url_handler, ToastLength.Long).Show();
|
App.Kp2a.ShowMessage(Context, Resource.String.no_url_handler, MessageSeverity.Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -71,7 +71,7 @@ namespace keepass2android
|
|||||||
}
|
}
|
||||||
catch (ActivityNotFoundException)
|
catch (ActivityNotFoundException)
|
||||||
{
|
{
|
||||||
Toast.MakeText(Context, Resource.String.no_url_handler, ToastLength.Long).Show();
|
App.Kp2a.ShowMessage(Context, Resource.String.no_url_handler, MessageSeverity.Error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
FindViewById(Resource.Id.translate).Click += delegate
|
FindViewById(Resource.Id.translate).Click += delegate
|
||||||
@@ -82,7 +82,7 @@ namespace keepass2android
|
|||||||
}
|
}
|
||||||
catch (ActivityNotFoundException)
|
catch (ActivityNotFoundException)
|
||||||
{
|
{
|
||||||
Toast.MakeText(Context, Resource.String.no_url_handler, ToastLength.Long).Show();
|
App.Kp2a.ShowMessage(Context, Resource.String.no_url_handler, MessageSeverity.Error);
|
||||||
}
|
}
|
||||||
}; FindViewById(Resource.Id.donate).Click += delegate
|
}; FindViewById(Resource.Id.donate).Click += delegate
|
||||||
{
|
{
|
||||||
|
@@ -14,7 +14,7 @@ using keepass2android;
|
|||||||
|
|
||||||
namespace keepass2android
|
namespace keepass2android
|
||||||
{
|
{
|
||||||
[Activity(Label = AppNames.AppName)]
|
[Activity(Label = AppNames.AppName, Theme = "@style/Kp2aTheme_BlueNoActionBar")]
|
||||||
public class AppKilledInfo : Activity, IDialogInterfaceOnDismissListener
|
public class AppKilledInfo : Activity, IDialogInterfaceOnDismissListener
|
||||||
{
|
{
|
||||||
protected override void OnCreate(Bundle bundle)
|
protected override void OnCreate(Bundle bundle)
|
||||||
|
10183
src/keepass2android-app/Assets/MostPopularPasswords.txt
Normal file
@@ -14,9 +14,11 @@ using Android.Runtime;
|
|||||||
using Android.Text;
|
using Android.Text;
|
||||||
using Android.Text.Method;
|
using Android.Text.Method;
|
||||||
using Android.Text.Util;
|
using Android.Text.Util;
|
||||||
|
using Android.Util;
|
||||||
using Android.Views;
|
using Android.Views;
|
||||||
using Android.Webkit;
|
using Android.Webkit;
|
||||||
using Android.Widget;
|
using Android.Widget;
|
||||||
|
using AndroidX.Core.Content;
|
||||||
using Google.Android.Material.Dialog;
|
using Google.Android.Material.Dialog;
|
||||||
using keepass2android;
|
using keepass2android;
|
||||||
|
|
||||||
@@ -29,7 +31,18 @@ namespace keepass2android
|
|||||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(ctx);
|
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(ctx);
|
||||||
builder.SetTitle(ctx.GetString(Resource.String.ChangeLog_title));
|
builder.SetTitle(ctx.GetString(Resource.String.ChangeLog_title));
|
||||||
List<string> changeLog = new List<string>{
|
List<string> changeLog = new List<string>{
|
||||||
BuildChangelogString(ctx, new List<int>{Resource.Array.ChangeLog_1_11,Resource.Array.ChangeLog_1_11_net}, "1.11"),
|
BuildChangelogString(ctx, new List<int>{Resource.Array.ChangeLog_1_13}, "1.13"),
|
||||||
|
|
||||||
|
BuildChangelogString(ctx, new List<int>{Resource.Array.ChangeLog_1_12
|
||||||
|
#if !NoNet
|
||||||
|
,Resource.Array.ChangeLog_1_12_net
|
||||||
|
#endif
|
||||||
|
}, "1.12"),
|
||||||
|
BuildChangelogString(ctx, new List<int>{Resource.Array.ChangeLog_1_11
|
||||||
|
#if !NoNet
|
||||||
|
,Resource.Array.ChangeLog_1_11_net
|
||||||
|
#endif
|
||||||
|
}, "1.11"),
|
||||||
BuildChangelogString(ctx, Resource.Array.ChangeLog_1_10, "1.10"),
|
BuildChangelogString(ctx, Resource.Array.ChangeLog_1_10, "1.10"),
|
||||||
BuildChangelogString(ctx, Resource.Array.ChangeLog_1_09e, "1.09e"),
|
BuildChangelogString(ctx, Resource.Array.ChangeLog_1_09e, "1.09e"),
|
||||||
BuildChangelogString(ctx, Resource.Array.ChangeLog_1_09d, "1.09d"),
|
BuildChangelogString(ctx, Resource.Array.ChangeLog_1_09d, "1.09d"),
|
||||||
@@ -99,32 +112,28 @@ namespace keepass2android
|
|||||||
warning = ctx.GetString(Resource.String.PreviewWarning);
|
warning = ctx.GetString(Resource.String.PreviewWarning);
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.SetPositiveButton(Android.Resource.String.Ok, (dlgSender, dlgEvt) => {((AlertDialog)dlgSender).Dismiss(); });
|
builder.SetPositiveButton(Android.Resource.String.Ok, (dlgSender, dlgEvt) => {((AndroidX.AppCompat.App.AlertDialog)dlgSender).Dismiss(); });
|
||||||
builder.SetCancelable(false);
|
builder.SetCancelable(false);
|
||||||
|
|
||||||
WebView wv = new WebView(ctx);
|
WebView wv = new WebView(ctx);
|
||||||
|
|
||||||
wv.SetBackgroundColor(Color.White);
|
|
||||||
wv.LoadDataWithBaseURL(null, GetLog(changeLog, warning, ctx), "text/html", "UTF-8", null);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//builder.SetMessage("");
|
|
||||||
builder.SetView(wv);
|
builder.SetView(wv);
|
||||||
Dialog dialog = builder.Create();
|
Dialog dialog = builder.Create();
|
||||||
dialog.DismissEvent += (sender, e) =>
|
dialog.DismissEvent += (sender, e) =>
|
||||||
{
|
{
|
||||||
onDismiss();
|
onDismiss();
|
||||||
};
|
};
|
||||||
dialog.Show();
|
wv.SetBackgroundColor(Color.Transparent);
|
||||||
/*TextView message = (TextView)dialog.FindViewById(Android.Resource.Id.Message);
|
wv.LoadDataWithBaseURL(null, GetLog(changeLog, warning, dialog.Context), "text/html", "UTF-8", null);
|
||||||
|
|
||||||
|
|
||||||
message.TextFormatted = Html.FromHtml(ConcatChangeLog(ctx, changeLog.ToArray()));
|
|
||||||
message.AutoLinkMask=MatchOptions.WebUrls;*/
|
|
||||||
|
|
||||||
|
dialog.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string BuildChangelogString(Context ctx, int changeLogResId, string version)
|
private static string BuildChangelogString(Context ctx, int changeLogResId, string version)
|
||||||
{
|
{
|
||||||
return BuildChangelogString(ctx, new List<int>() { changeLogResId }, version);
|
return BuildChangelogString(ctx, new List<int>() { changeLogResId }, version);
|
||||||
|
|
||||||
@@ -150,32 +159,44 @@ namespace keepass2android
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private const string HtmlStart = @"<html>
|
private const string HtmlEnd = @"</body>
|
||||||
|
</html>";
|
||||||
|
|
||||||
|
private static string GetLog(List<string> changeLog, string warning, Context ctx)
|
||||||
|
{
|
||||||
|
string secondaryColor = "31628D";
|
||||||
|
string onSurfaceColor = "171D1E";
|
||||||
|
if (((int)ctx.Resources.Configuration.UiMode & (int)UiMode.NightMask) == (int)UiMode.NightYes)
|
||||||
|
{
|
||||||
|
secondaryColor = "99CBFF";
|
||||||
|
onSurfaceColor = "E1E4D6";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string HtmlStart = @"<html>
|
||||||
<head>
|
<head>
|
||||||
<style type='text/css'>
|
<style type='text/css'>
|
||||||
a { color:#000000 }
|
a { color:#"+ onSurfaceColor + @" }
|
||||||
div.title {
|
div.title {
|
||||||
color:287AA9;
|
color:"+ secondaryColor+@";
|
||||||
font-size:1.2em;
|
font-size:1.2em;
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
margin-top:1em;
|
margin-top:1em;
|
||||||
margin-bottom:0.5em;
|
margin-bottom:0.5em;
|
||||||
text-align:center }
|
text-align:center }
|
||||||
div.subtitle {
|
div.subtitle {
|
||||||
color:287AA9;
|
color:"+ secondaryColor+@";
|
||||||
font-size:0.8em;
|
font-size:0.8em;
|
||||||
margin-bottom:1em;
|
margin-bottom:1em;
|
||||||
text-align:center }
|
text-align:center }
|
||||||
div.freetext { color:#000000 }
|
div.freetext { color:#"+ onSurfaceColor + @" }
|
||||||
div.list { color:#000000 }
|
div.list { color:#"+ onSurfaceColor + @" }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>";
|
<body>";
|
||||||
private const string HtmlEnd = @"</body>
|
|
||||||
</html>";
|
|
||||||
private static string GetLog(List<string> changeLog, string warning, Context ctx)
|
StringBuilder sb = new StringBuilder(HtmlStart);
|
||||||
{
|
|
||||||
StringBuilder sb = new StringBuilder(HtmlStart);
|
|
||||||
if (!string.IsNullOrEmpty(warning))
|
if (!string.IsNullOrEmpty(warning))
|
||||||
{
|
{
|
||||||
sb.Append(warning);
|
sb.Append(warning);
|
||||||
|
@@ -183,7 +183,7 @@ namespace keepass2android
|
|||||||
// Verify that a password or keyfile is set
|
// Verify that a password or keyfile is set
|
||||||
if (password.Length == 0 && !keyfileCheckbox.Checked)
|
if (password.Length == 0 && !keyfileCheckbox.Checked)
|
||||||
{
|
{
|
||||||
Toast.MakeText(this, Resource.String.error_nopass, ToastLength.Long).Show();
|
App.Kp2a.ShowMessage(this, Resource.String.error_nopass, MessageSeverity.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,7 +207,7 @@ namespace keepass2android
|
|||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
Toast.MakeText(this, Resource.String.error_adding_keyfile, ToastLength.Long).Show();
|
App.Kp2a.ShowMessage(this, Resource.String.error_adding_keyfile, MessageSeverity.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -235,7 +235,7 @@ namespace keepass2android
|
|||||||
if (! pass.Equals(confpass))
|
if (! pass.Equals(confpass))
|
||||||
{
|
{
|
||||||
// Passwords do not match
|
// Passwords do not match
|
||||||
Toast.MakeText(this, Resource.String.error_pass_match, ToastLength.Long).Show();
|
App.Kp2a.ShowMessage(this, Resource.String.error_pass_match, MessageSeverity.Error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|