Merge branch 'master' of c:/ph/keepass2android
This commit is contained in:
5
.gitmodules
vendored
5
.gitmodules
vendored
@@ -1,6 +1,9 @@
|
||||
[submodule "src/SamsungPass"]
|
||||
path = src/SamsungPass
|
||||
url = https://github.com/PhilippC/Xamarin-Samsung-Pass.git
|
||||
url = https://github.com/gilbsgilbs/Xamarin-Samsung-Pass.git
|
||||
[submodule "src/netftpandroid"]
|
||||
path = src/netftpandroid
|
||||
url = https://github.com/PhilippC/netftpandroid.git
|
||||
[submodule "src/java/argon2/phc-winner-argon2"]
|
||||
path = src/java/argon2/phc-winner-argon2
|
||||
url = https://github.com/P-H-C/phc-winner-argon2
|
||||
|
@@ -75,9 +75,23 @@ The KP2A keyboard is meant to quickly "paste" or "type" values from your databas
|
||||
**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!
|
||||
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.
|
||||
|
||||
* Why is Keepass2Android so big?
|
||||
* 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.
|
||||
|
||||
# For developers
|
||||
|
@@ -20,6 +20,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace KeePassLib.Cryptography.KeyDerivation
|
||||
@@ -127,8 +128,44 @@ namespace KeePassLib.Cryptography.KeyDerivation
|
||||
byte[] pbSecretKey = p.GetByteArray(ParamSecretKey);
|
||||
byte[] pbAssocData = p.GetByteArray(ParamAssocData);
|
||||
|
||||
if (pbSecretKey != null) {
|
||||
throw new ArgumentOutOfRangeException("Unsupported configuration: non-null pbSecretKey");
|
||||
}
|
||||
|
||||
if (pbAssocData != null) {
|
||||
throw new ArgumentOutOfRangeException("Unsupported configuration: non-null pbAssocData");
|
||||
}
|
||||
|
||||
/*
|
||||
byte[] pbRet = Argon2d(pbMsg, pbSalt, uPar, uMem, uIt,
|
||||
32, v, pbSecretKey, pbAssocData);
|
||||
*/
|
||||
|
||||
IntPtr msgPtr = Marshal.AllocHGlobal(pbMsg.Length);
|
||||
IntPtr saltPtr = Marshal.AllocHGlobal(pbSalt.Length);
|
||||
IntPtr retPtr = Marshal.AllocHGlobal(32);
|
||||
Marshal.Copy(pbMsg, 0, msgPtr, pbMsg.Length);
|
||||
Marshal.Copy(pbSalt, 0, saltPtr, pbSalt.Length);
|
||||
|
||||
const UInt32 Argon2_d = 0;
|
||||
|
||||
int ret = argon2_hash(
|
||||
(UInt32)uIt, (UInt32)(uMem / 1024), uPar,
|
||||
msgPtr, (IntPtr)pbMsg.Length,
|
||||
saltPtr, (IntPtr)pbSalt.Length,
|
||||
retPtr, (IntPtr)32,
|
||||
(IntPtr)0, (IntPtr)0, Argon2_d, v);
|
||||
|
||||
if (ret != 0) {
|
||||
throw new Exception("argon2_hash failed with " + ret);
|
||||
}
|
||||
|
||||
byte[] pbRet = new byte[32];
|
||||
Marshal.Copy(retPtr, pbRet, 0, 32);
|
||||
|
||||
Marshal.FreeHGlobal(msgPtr);
|
||||
Marshal.FreeHGlobal(saltPtr);
|
||||
Marshal.FreeHGlobal(retPtr);
|
||||
|
||||
if(uMem > (100UL * 1024UL * 1024UL)) GC.Collect();
|
||||
return pbRet;
|
||||
@@ -143,5 +180,14 @@ namespace KeePassLib.Cryptography.KeyDerivation
|
||||
MaxIterations, uMilliseconds, true);
|
||||
return p;
|
||||
}
|
||||
|
||||
[DllImport("argon2")]
|
||||
static extern int argon2_hash(
|
||||
UInt32 t_cost, UInt32 m_cost, UInt32 parallelism,
|
||||
IntPtr pwd, IntPtr pwdlen,
|
||||
IntPtr salt, IntPtr saltlen,
|
||||
IntPtr hash, IntPtr hashlen,
|
||||
IntPtr encoded, IntPtr encodedlen,
|
||||
UInt32 type, UInt32 version);
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
BIN
src/PCloudBindings/Jars/pcloud-sdk-android-1.1.0.aar
Normal file
BIN
src/PCloudBindings/Jars/pcloud-sdk-android-1.1.0.aar
Normal file
Binary file not shown.
Binary file not shown.
BIN
src/PCloudBindings/Jars/pcloud-sdk-java-core-1.1.0.jar
Normal file
BIN
src/PCloudBindings/Jars/pcloud-sdk-java-core-1.1.0.jar
Normal file
Binary file not shown.
@@ -67,7 +67,7 @@
|
||||
|
||||
<None Include="Jars\AboutJars.txt" />
|
||||
<None Include="Additions\AboutAdditions.txt" />
|
||||
<LibraryProjectZip Include="Jars\pcloud-sdk-android-1.0.1.aar" />
|
||||
<LibraryProjectZip Include="Jars\pcloud-sdk-android-1.1.0.aar" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<TransformFile Include="Transforms\Metadata.xml" />
|
||||
@@ -84,7 +84,7 @@
|
||||
</Target>
|
||||
-->
|
||||
<ItemGroup>
|
||||
<EmbeddedReferenceJar Include="Jars\pcloud-sdk-java-core-1.0.1.jar" />
|
||||
<EmbeddedReferenceJar Include="Jars\pcloud-sdk-java-core-1.1.0.jar" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@@ -26,5 +26,5 @@ using Android.App;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("1.1.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.1.0.0")]
|
||||
|
Submodule src/SamsungPass updated: f3c6bbe224...dbfbf6d488
@@ -1,6 +1,11 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo '*****************************************'
|
||||
echo '******* Building native libraries *******'
|
||||
echo '*****************************************'
|
||||
./build-native.sh
|
||||
|
||||
echo '*****************************************'
|
||||
echo '********** Building Java parts **********'
|
||||
echo '*****************************************'
|
||||
|
@@ -3,6 +3,12 @@ set -e
|
||||
|
||||
pushd ../keepass2android
|
||||
|
||||
xabuild keepass2android.csproj /t:SignAndroidPackage "$@"
|
||||
# check if ANDROID_HOME is defined
|
||||
if [ -z ${ANDROID_HOME+x} ];
|
||||
then
|
||||
xabuild keepass2android.csproj /t:SignAndroidPackage "$@"
|
||||
else
|
||||
xabuild keepass2android.csproj /p:AndroidSdkDirectory=$ANDROID_HOME /t:SignAndroidPackage "$@"
|
||||
fi
|
||||
|
||||
popd
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
unset ANDROID_NDK_HOME ANDROID_NDK
|
||||
|
||||
pushd ../java/
|
||||
|
||||
pushd JavaFileStorageTest-AS
|
||||
|
6
src/build-scripts/build-native.sh
Executable file
6
src/build-scripts/build-native.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
pushd ../java/argon2
|
||||
ndk-build
|
||||
popd
|
@@ -20,6 +20,12 @@ popd
|
||||
|
||||
# call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64
|
||||
|
||||
xabuild KeePass.sln /target:keepass2android /p:BuildProjectReferences=true /p:Configuration="Debug" /p:Platform="Any CPU" "$@"
|
||||
# check if ANDROID_HOME is defined
|
||||
if [ -z ${ANDROID_HOME+x} ];
|
||||
then
|
||||
xabuild KeePass.sln /target:keepass2android /p:BuildProjectReferences=true /p:Configuration="Debug" /p:Platform="Any CPU" "$@"
|
||||
else
|
||||
xabuild KeePass.sln /target:keepass2android /p:AndroidSdkDirectory=$ANDROID_HOME /p:BuildProjectReferences=true /p:Configuration="Debug" /p:Platform="Any CPU" "$@"
|
||||
fi
|
||||
|
||||
popd
|
||||
|
@@ -43,6 +43,7 @@ build-java.bat will call gradlew for several Java modules. build-xamarin.bat wil
|
||||
- Install [libzip](https://libzip.org/) for your distribution.
|
||||
- Note: Xamarin seems to require `libzip4`, yet most distributions only ships `libzip5`. As a dirty workaround, it's possible to symlink `libzip.so.5` to `libzip.so.4`. Luckily, it appears to be working.
|
||||
- `sudo ln -s /usr/lib/libzip.so.5 /usr/lib/libzip.so.4`
|
||||
- or `sudo ln -s /usr/lib64/libzip.so.5 /usr/lib/libzip.so.4`
|
||||
- Install NuGet dependencies:
|
||||
- `cd src/ && nuget restore KeePass.sln`
|
||||
- Build:
|
||||
|
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 26
|
||||
buildToolsVersion '26.0.2'
|
||||
buildToolsVersion '28.0.3'
|
||||
defaultConfig {
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 23
|
||||
@@ -30,13 +30,13 @@ dependencies {
|
||||
exclude group: 'com.google.android.google-play-services'
|
||||
}
|
||||
compile 'com.google.apis:google-api-services-drive:v2-rev102-1.16.0-rc'
|
||||
compile 'com.dropbox.core:dropbox-core-sdk:3.0.3'
|
||||
compile 'com.dropbox.core:dropbox-core-sdk:3.1.1'
|
||||
//onedrive:
|
||||
compile('com.onedrive.sdk:onedrive-sdk-android:1.2.0') {
|
||||
transitive = false
|
||||
}
|
||||
compile 'com.pcloud.sdk:java-core:1.0.1'
|
||||
compile 'com.pcloud.sdk:android:1.0.1'
|
||||
compile 'com.pcloud.sdk:java-core:1.1.0'
|
||||
compile 'com.pcloud.sdk:android:1.1.0'
|
||||
compile('com.microsoft.graph:msgraph-sdk-android:1.2.+')
|
||||
compile ('com.microsoft.identity.client:msal:0.1.+') {
|
||||
exclude group: 'com.android.support', module: 'appcompat-v7'
|
||||
|
@@ -186,7 +186,8 @@ public class GoogleDriveFileStorage extends JavaFileStorageBase {
|
||||
return displayName;
|
||||
|
||||
String[] parts = mAccountLocalPath.split("/");
|
||||
|
||||
if (parts.length == 0)
|
||||
return "";
|
||||
String part = parts[parts.length-1];
|
||||
logDebug("parsing part " + part);
|
||||
int indexOfSeparator = part.lastIndexOf(NAME_ID_SEP);
|
||||
|
@@ -28,6 +28,7 @@ import com.pcloud.sdk.PCloudSdk;
|
||||
import com.pcloud.sdk.RemoteEntry;
|
||||
import com.pcloud.sdk.RemoteFile;
|
||||
import com.pcloud.sdk.RemoteFolder;
|
||||
import com.pcloud.sdk.UploadOptions;
|
||||
|
||||
/**
|
||||
* FileStorage implementation for PCloud provider.
|
||||
@@ -136,10 +137,10 @@ public class PCloudFileStorage extends JavaFileStorageBase
|
||||
String filePath = path.substring(0, path.lastIndexOf("/") + 1);
|
||||
RemoteFolder remoteFolder = this.getRemoteFolderByPath(filePath);
|
||||
|
||||
String tempName = "." + UUID.randomUUID().toString();
|
||||
try {
|
||||
RemoteFile remoteFile = this.apiClient.createFile(remoteFolder, tempName, dataSource).execute();
|
||||
this.apiClient.rename(remoteFile, filename).execute();
|
||||
RemoteFile remoteFile = this.apiClient.createFile(
|
||||
remoteFolder, filename, dataSource, null, null, UploadOptions.OVERRIDE_FILE
|
||||
).execute();
|
||||
} catch (ApiError e) {
|
||||
throw convertApiError(e);
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 26
|
||||
buildToolsVersion '26.0.2'
|
||||
buildToolsVersion '28.0.3'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.crocoapps.javafilestoragetest"
|
||||
|
@@ -1,7 +1,7 @@
|
||||
apply plugin: 'com.android.library'
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion '26.0.2'
|
||||
buildToolsVersion '28.0.3'
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 18
|
||||
|
@@ -1,7 +1,7 @@
|
||||
apply plugin: 'com.android.library'
|
||||
android {
|
||||
compileSdkVersion 'Google Inc.:Google APIs:23'
|
||||
buildToolsVersion '26.0.2'
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion '28.0.3'
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 8
|
||||
@@ -17,4 +17,4 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 26
|
||||
buildToolsVersion '26.0.2'
|
||||
buildToolsVersion '28.0.3'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "keepass2android.plugin.qr"
|
||||
|
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 26
|
||||
buildToolsVersion '26.0.2'
|
||||
buildToolsVersion '28.0.3'
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 15
|
||||
|
1
src/java/argon2/.gitignore
vendored
Normal file
1
src/java/argon2/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/libs/
|
18
src/java/argon2/jni/Android.mk
Normal file
18
src/java/argon2/jni/Android.mk
Normal file
@@ -0,0 +1,18 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := argon2
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
../phc-winner-argon2/src/argon2.c \
|
||||
../phc-winner-argon2/src/core.c \
|
||||
../phc-winner-argon2/src/blake2/blake2b.c \
|
||||
../phc-winner-argon2/src/thread.c \
|
||||
../phc-winner-argon2/src/encoding.c \
|
||||
../phc-winner-argon2/src/ref.c
|
||||
|
||||
LOCAL_CFLAGS += -I $(LOCAL_PATH)/../phc-winner-argon2/include
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
3
src/java/argon2/jni/Application.mk
Normal file
3
src/java/argon2/jni/Application.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
APP_OPTIM := release
|
||||
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
|
||||
APP_PLATFORM := android-16
|
1
src/java/argon2/phc-winner-argon2
Submodule
1
src/java/argon2/phc-winner-argon2
Submodule
Submodule src/java/argon2/phc-winner-argon2 added at 62358ba212
@@ -148,8 +148,9 @@ namespace keepass2android
|
||||
|
||||
private void MakePasswordMaskedOrVisible()
|
||||
{
|
||||
TextView password = (TextView)FindViewById(Resource.Id.entry_password);
|
||||
TextView confpassword = (TextView)FindViewById(Resource.Id.entry_confpassword);
|
||||
EditText password = (EditText)FindViewById(Resource.Id.entry_password);
|
||||
TextView confpassword = (TextView)FindViewById(Resource.Id.entry_confpassword);
|
||||
int selStart = password.SelectionStart, selEnd = password.SelectionEnd;
|
||||
if (_showPassword)
|
||||
{
|
||||
password.InputType = InputTypes.ClassText | InputTypes.TextVariationVisiblePassword;
|
||||
@@ -161,7 +162,7 @@ namespace keepass2android
|
||||
password.InputType = InputTypes.ClassText | InputTypes.TextVariationPassword;
|
||||
confpassword.Visibility = ViewStates.Visible;
|
||||
}
|
||||
|
||||
password.SetSelection(selStart, selEnd);
|
||||
}
|
||||
|
||||
private void CreateDatabase(bool makeCurrent)
|
||||
|
@@ -391,8 +391,9 @@ namespace keepass2android
|
||||
|
||||
private void MakePasswordVisibleOrHidden()
|
||||
{
|
||||
TextView password = (TextView) FindViewById(Resource.Id.entry_password);
|
||||
EditText password = (EditText) FindViewById(Resource.Id.entry_password);
|
||||
TextView confpassword = (TextView) FindViewById(Resource.Id.entry_confpassword);
|
||||
int selStart = password.SelectionStart, selEnd = password.SelectionEnd;
|
||||
if (State.ShowPassword)
|
||||
{
|
||||
password.InputType = InputTypes.ClassText | InputTypes.TextVariationVisiblePassword;
|
||||
@@ -403,6 +404,7 @@ namespace keepass2android
|
||||
password.InputType = InputTypes.ClassText | InputTypes.TextVariationPassword;
|
||||
confpassword.Visibility = ViewStates.Visible;
|
||||
}
|
||||
password.SetSelection(selStart, selEnd);
|
||||
}
|
||||
|
||||
void SaveEntry()
|
||||
|
@@ -138,6 +138,8 @@ namespace keepass2android
|
||||
TrimFields = true
|
||||
};
|
||||
|
||||
bool hasEnabledDevices = devices.Any(kvp => kvp.Value);
|
||||
|
||||
string result = "";
|
||||
foreach (var deviceWithEnabled in devices)
|
||||
{
|
||||
@@ -145,6 +147,9 @@ namespace keepass2android
|
||||
{
|
||||
result += opt.FieldSeparator;
|
||||
}
|
||||
//if the list of devices has enabled devices, we do not need to include a negated expression
|
||||
if (hasEnabledDevices && !deviceWithEnabled.Value)
|
||||
continue;
|
||||
string deviceValue = (deviceWithEnabled.Value ? "" : "!") + deviceWithEnabled.Key;
|
||||
if (deviceValue.Contains(opt.FieldSeparator) || deviceValue.Contains("\\") ||
|
||||
deviceValue.Contains("\""))
|
||||
|
@@ -905,6 +905,22 @@ namespace keepass2android
|
||||
b.SetTitle(Resource.String.fingerprint_prefs);
|
||||
b.SetMessage(btn.Tag.ToString());
|
||||
b.SetPositiveButton(Android.Resource.String.Ok, (o, eventArgs) => ((Dialog)o).Dismiss());
|
||||
if (_fingerprintDec != null)
|
||||
{
|
||||
b.SetNegativeButton(Resource.String.disable_sensor, (senderAlert, alertArgs) =>
|
||||
{
|
||||
btn.SetImageResource(Resource.Drawable.ic_fingerprint_error);
|
||||
_fingerprintDec?.StopListening();
|
||||
_fingerprintDec = null;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
b.SetNegativeButton(Resource.String.enable_sensor, (senderAlert, alertArgs) =>
|
||||
{
|
||||
InitFingerprintUnlock();
|
||||
});
|
||||
}
|
||||
b.Show();
|
||||
};
|
||||
_fingerprintPermissionGranted = true;
|
||||
@@ -919,7 +935,6 @@ namespace keepass2android
|
||||
edit.Commit();
|
||||
}
|
||||
|
||||
|
||||
public void OnFingerprintError(string message)
|
||||
{
|
||||
var btn = FindViewById<ImageButton>(Resource.Id.fingerprintbtn);
|
||||
@@ -999,7 +1014,7 @@ namespace keepass2android
|
||||
|
||||
if (_appnameclickCount == 7)
|
||||
{
|
||||
throw new Exception("this is an easter egg crash (to test uncaught exceptions.");
|
||||
throw new Exception("this is an easter egg crash (to test uncaught exceptions.)");
|
||||
}
|
||||
|
||||
|
||||
@@ -1112,7 +1127,7 @@ namespace keepass2android
|
||||
|
||||
var changeDbButton = FindViewById<Button>(Resource.Id.change_db);
|
||||
string label = changeDbButton.Text;
|
||||
if (label.EndsWith("<EFBFBD>"))
|
||||
if (label.EndsWith(""))
|
||||
changeDbButton.Text = label.Substring(0, label.Length - 1);
|
||||
changeDbButton.Click += (sender, args) => GoToFileSelectActivity();
|
||||
|
||||
@@ -1497,7 +1512,8 @@ namespace keepass2android
|
||||
|
||||
private void MakePasswordMaskedOrVisible()
|
||||
{
|
||||
TextView password = (TextView) FindViewById(Resource.Id.password_edit);
|
||||
EditText password = (EditText) FindViewById(Resource.Id.password_edit);
|
||||
int selStart = password.SelectionStart, selEnd = password.SelectionEnd;
|
||||
if (_showPassword)
|
||||
{
|
||||
password.InputType = InputTypes.ClassText | InputTypes.TextVariationVisiblePassword;
|
||||
@@ -1507,7 +1523,7 @@ namespace keepass2android
|
||||
{
|
||||
password.InputType = InputTypes.ClassText | InputTypes.TextVariationPassword;
|
||||
}
|
||||
|
||||
password.SetSelection(selStart, selEnd);
|
||||
}
|
||||
|
||||
protected override void OnPause()
|
||||
@@ -1793,12 +1809,12 @@ namespace keepass2android
|
||||
if ((int) Build.VERSION.SdkInt >= 26)
|
||||
{
|
||||
Android.Content.ClipboardManager clipboardManager = (ClipboardManager)GetSystemService(Context.ClipboardService);
|
||||
if (clipboardManager.PrimaryClip.Description.Timestamp <
|
||||
Java.Lang.JavaSystem.CurrentTimeMillis() - 5000)
|
||||
if (clipboardManager?.PrimaryClip?.Description == null || (clipboardManager.PrimaryClip.Description.Timestamp <
|
||||
Java.Lang.JavaSystem.CurrentTimeMillis() - 5000))
|
||||
return; //data older than 5 seconds
|
||||
}
|
||||
string clipboardContent = Util.GetClipboard(this);
|
||||
if (_otpInfo.OtpLength != clipboardContent.Length)
|
||||
if (clipboardContent == null || (_otpInfo.OtpLength != clipboardContent.Length))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1814,7 +1830,7 @@ namespace keepass2android
|
||||
foreach (int otpId in _otpTextViewIds)
|
||||
{
|
||||
EditText otpEdit = FindViewById<EditText>(otpId);
|
||||
if (otpEdit.Visibility == ViewStates.Visible)
|
||||
if (otpEdit?.Visibility == ViewStates.Visible)
|
||||
{
|
||||
if (string.IsNullOrEmpty(otpEdit.Text))
|
||||
{
|
||||
|
@@ -108,7 +108,7 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<uses-library required="false" name="com.sec.android.app.multiwindow" />
|
||||
<uses-library android:required="false" android:name="com.sec.android.app.multiwindow" />
|
||||
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:value="632.0dip" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:value="598.0dip" />
|
||||
@@ -127,4 +127,4 @@
|
||||
<!-- Samsung Pass permission -->
|
||||
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />
|
||||
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@@ -132,7 +132,7 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<uses-library required="false" name="com.sec.android.app.multiwindow" />
|
||||
<uses-library android:required="false" android:name="com.sec.android.app.multiwindow" />
|
||||
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:value="632.0dip" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:value="598.0dip" />
|
||||
@@ -153,4 +153,4 @@
|
||||
|
||||
<!-- Samsung Pass permission -->
|
||||
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@@ -123,7 +123,7 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<uses-library required="false" name="com.sec.android.app.multiwindow" />
|
||||
<uses-library android:required="false" android:name="com.sec.android.app.multiwindow" />
|
||||
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:value="632.0dip" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:value="598.0dip" />
|
||||
@@ -138,4 +138,4 @@
|
||||
<uses-permission android:name="keepass2android.keepass2android.permission.KP2aInternalSearch" />
|
||||
<!-- Samsung Pass permission -->
|
||||
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@@ -182,6 +182,22 @@ namespace keepass2android
|
||||
b.SetTitle(Resource.String.fingerprint_prefs);
|
||||
b.SetMessage(btn.Tag.ToString());
|
||||
b.SetPositiveButton(Android.Resource.String.Ok, (o, eventArgs) => ((Dialog)o).Dismiss());
|
||||
if (_fingerprintIdentifier != null)
|
||||
{
|
||||
b.SetNegativeButton(Resource.String.disable_sensor, (senderAlert, alertArgs) =>
|
||||
{
|
||||
btn.SetImageResource(Resource.Drawable.ic_fingerprint_error);
|
||||
_fingerprintIdentifier?.StopListening();
|
||||
_fingerprintIdentifier = null;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
b.SetNegativeButton(Resource.String.enable_sensor, (senderAlert, alertArgs) =>
|
||||
{
|
||||
InitFingerprintUnlock();
|
||||
});
|
||||
}
|
||||
b.Show();
|
||||
};
|
||||
_fingerprintPermissionGranted = true;
|
||||
|
@@ -62,6 +62,8 @@
|
||||
<string name="brackets">Parentesi</string>
|
||||
<string name="cancel">Annulla</string>
|
||||
<string name="Ok">Ok</string>
|
||||
<string name="disable_sensor">Disabilita sensore</string>
|
||||
<string name="enable_sensor">Abilita sensore</string>
|
||||
<string name="ClearClipboard">Appunti eliminati.</string>
|
||||
<string name="clipboard_timeout">Scadenza appunti</string>
|
||||
<string name="clipboard_timeout_summary">Durata degli appunti dopo la copia di nome utente o password</string>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--Generated by crowdin.net-->
|
||||
<resources>
|
||||
<string name="about_feedback">Feedback</string>
|
||||
@@ -67,10 +67,12 @@
|
||||
<string name="brackets">Brackets</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="Ok">Ok</string>
|
||||
<string name="disable_sensor">Disable sensor</string>
|
||||
<string name="enable_sensor">Enable sensor</string>
|
||||
<string name="ClearClipboard">Clipboard cleared.</string>
|
||||
|
||||
|
||||
|
||||
|
||||
<string name="clipboard_timeout">Clipboard timeout</string>
|
||||
<string name="clipboard_timeout_summary">Time before clearing clipboard after copying username or password</string>
|
||||
<string name="copy_username">Select to copy username to clipboard</string>
|
||||
@@ -548,6 +550,7 @@
|
||||
<string name="filestoragehelp_dropboxKP2A">If you do not want to give KP2A access to your full Dropbox, you may select this option. It will request only access to the folder Apps/Keepass2Android. This is especially suited when creating a new database. If you already have a database, select this option to create the folder, then place your file inside the folder (from your PC) and then select this option again for opening the file.</string>
|
||||
<string name="filestoragename_gdrive">Google Drive</string>
|
||||
<string name="filestoragename_pcloud">PCloud</string>
|
||||
<string name="filestoragehelp_pcloud">This storage type will only request access to the "Applications/Keepass2Android" folder. If you want to use an existing database from your PCloud account, please make sure the file is placed in this folder.</string>
|
||||
<string name="filestoragename_onedrive">OneDrive</string>
|
||||
<string name="filestoragename_sftp">SFTP (SSH File Transfer)</string>
|
||||
<string name="filestoragename_content">System file picker</string>
|
||||
|
@@ -61,7 +61,7 @@ namespace PluginTOTP
|
||||
App.Kp2a.LastOpenedEntry.OutputStrings.Set(_totp, new ProtectedString(true, totp));
|
||||
Intent updateKeyboardIntent = new Intent(_context, typeof(CopyToClipboardService));
|
||||
updateKeyboardIntent.SetAction(Intents.UpdateKeyboard);
|
||||
updateKeyboardIntent.PutExtra("entry", App.Kp2a.LastOpenedEntry.Uuid.ToHexString());
|
||||
updateKeyboardIntent.PutExtra(EntryActivity.KeyEntry, new ElementAndDatabaseId(App.Kp2a.FindDatabaseForElement(App.Kp2a.LastOpenedEntry.Entry), App.Kp2a.LastOpenedEntry.Entry).FullId);
|
||||
_context.StartService(updateKeyboardIntent);
|
||||
|
||||
}
|
||||
|
@@ -1036,7 +1036,7 @@ namespace keepass2android
|
||||
if (IoUtil.IocAsHexString(db.Ioc) == databaseId)
|
||||
return db;
|
||||
}
|
||||
throw new Exception("Database not found for databaseId!");
|
||||
throw new Exception("Database not found for databaseId " + databaseId + "!");
|
||||
}
|
||||
|
||||
public PwGroup FindGroup(PwUuid uuid)
|
||||
|
@@ -40,7 +40,7 @@
|
||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
||||
<Debugger>Xamarin</Debugger>
|
||||
<DevInstrumentationEnabled>True</DevInstrumentationEnabled>
|
||||
<AndroidSupportedAbis>armeabi,armeabi-v7a,x86</AndroidSupportedAbis>
|
||||
<AndroidSupportedAbis>armeabi-v7a,x86</AndroidSupportedAbis>
|
||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
|
||||
<BundleAssemblies>false</BundleAssemblies>
|
||||
@@ -58,7 +58,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<AndroidSupportedAbis>armeabi,armeabi-v7a,x86,x86_64</AndroidSupportedAbis>
|
||||
<AndroidSupportedAbis>armeabi-v7a,x86,x86_64</AndroidSupportedAbis>
|
||||
<CustomCommands>
|
||||
<CustomCommands>
|
||||
<Command type="BeforeBuild" command="UseManifestNet.bat" />
|
||||
@@ -93,7 +93,7 @@
|
||||
<Command type="BeforeBuild" command="UseManifestNoNet.bat" workingdir="" />
|
||||
</CustomCommands>
|
||||
</CustomCommands>
|
||||
<AndroidSupportedAbis>armeabi,armeabi-v7a</AndroidSupportedAbis>
|
||||
<AndroidSupportedAbis>armeabi-v7a</AndroidSupportedAbis>
|
||||
<DeployExternal>True</DeployExternal>
|
||||
<JavaOptions>
|
||||
</JavaOptions>
|
||||
@@ -1920,6 +1920,12 @@
|
||||
<ItemGroup>
|
||||
<AndroidAsset Include="Assets\publicsuffix.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidNativeLibrary Include="..\java\argon2\libs\armeabi-v7a\libargon2.so" />
|
||||
<AndroidNativeLibrary Include="..\java\argon2\libs\arm64-v8a\libargon2.so" />
|
||||
<AndroidNativeLibrary Include="..\java\argon2\libs\x86\libargon2.so" />
|
||||
<AndroidNativeLibrary Include="..\java\argon2\libs\x86_64\libargon2.so" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
|
||||
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
|
||||
@@ -1968,4 +1974,4 @@
|
||||
<Import Project="..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Animated.Vector.Drawable.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Animated.Vector.Drawable.targets')" />
|
||||
<Import Project="..\packages\Xamarin.Android.Support.v7.AppCompat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.v7.AppCompat.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v7.AppCompat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.v7.AppCompat.targets')" />
|
||||
<Import Project="..\packages\Xamarin.Android.Support.Design.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Design.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Design.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Design.targets')" />
|
||||
</Project>
|
||||
</Project>
|
||||
|
@@ -3,7 +3,7 @@ using Android.Content;
|
||||
|
||||
namespace keepass2android.services.AutofillBase
|
||||
{
|
||||
|
||||
|
||||
internal class Kp2aDigitalAssetLinksDataSource
|
||||
{
|
||||
private static Kp2aDigitalAssetLinksDataSource instance;
|
||||
@@ -30,12 +30,14 @@ namespace keepass2android.services.AutofillBase
|
||||
|
||||
static readonly HashSet<string> _trustedBrowsers = new HashSet<string>
|
||||
{
|
||||
"org.mozilla.klar","org.mozilla.focus","org.mozilla.firefox","org.mozilla.firefox_beta","com.microsoft.emmx",
|
||||
"com.android.chrome","com.chrome.beta","com.android.browser","com.brave.browser","com.opera.browser",
|
||||
"com.opera.browser.beta","com.opera.mini.native","com.chrome.dev","com.chrome.canary",
|
||||
"com.google.android.apps.chrome","com.google.android.apps.chrome_dev","com.yandex.browser",
|
||||
"org.mozilla.firefox","org.mozilla.firefox_beta","org.mozilla.klar","org.mozilla.focus",
|
||||
"org.mozilla.fenix","org.mozilla.fenix.nightly","org.mozilla.reference.browser",
|
||||
"com.android.browser","com.android.chrome","com.chrome.beta","com.chrome.dev","com.chrome.canary",
|
||||
"com.google.android.apps.chrome","com.google.android.apps.chrome_dev",
|
||||
"com.opera.browser","com.opera.browser.beta","com.opera.mini.native",
|
||||
"com.brave.browser","com.yandex.browser","com.microsoft.emmx","com.amazon.cloud9",
|
||||
"com.sec.android.app.sbrowser","com.sec.android.app.sbrowser.beta","org.codeaurora.swe.browser",
|
||||
"com.amazon.cloud9"
|
||||
"mark.via.gp"
|
||||
};
|
||||
|
||||
private bool IsTrustedBrowser(string packageName)
|
||||
@@ -43,4 +45,4 @@ namespace keepass2android.services.AutofillBase
|
||||
return _trustedBrowsers.Contains(packageName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user