Merge branch 'master' 2.2.1 of https://github.com/bpellin/keepassdroid into upstream-update

This commit is contained in:
J-Jamet
2018-01-03 12:16:49 +01:00
6 changed files with 53 additions and 5 deletions

View File

@@ -1,3 +1,6 @@
KeepassDX (2.5.0.0beta4)
* Merge KeePassDroid 2.2.1
KeepassDX (2.5.0.0beta3)
* Merge KeePassDroid 2.2.0.9
@@ -13,6 +16,10 @@ KeepassDX (2.5.0.0beta1)
* Update French translation
* Change donation (see KeepassDroid to contribute on both projects)
KeePassDroid (2.2.1)
* Fix kdbx4 date corruption
* Updated German translations
KeePassDroid (2.2.0.9)
* Update build tools version to workaround CM/Lineage bug (closes: #249)
* Update Russian translations

View File

@@ -21,7 +21,7 @@ Diego Pierotto - Italian
Laurent, Norman Obry, Nam, Bruno Parmentier, Credomo - French
Maciej Bieniek, cod3r - Polish
Максим Сёмочкин, i.nedoboy, filimonic, bboa - Russian
MaWi, rvs2008, meviox, MaDill - German
MaWi, rvs2008, meviox, MaDill, EdlerProgrammierer - German
yslandro - Norwegian Nynorsk
王科峰 - Chinese
Typhoon - Slovak

View File

@@ -19,12 +19,13 @@
*/
package com.keepassdroid;
import android.app.SearchManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
@@ -285,6 +286,24 @@ public abstract class GroupBaseActivity extends LockCloseListActivity {
}
}
}
@Override
public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
/*
* ACTION_SEARCH automatically forces a new task. This occurs when you open a kdb file in
* another app such as Files or GoogleDrive and then Search for an entry. Here we remove the
* FLAG_ACTIVITY_NEW_TASK flag bit allowing search to open it's activity in the current task.
*/
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
int flags = intent.getFlags();
flags &= ~Intent.FLAG_ACTIVITY_NEW_TASK;
intent.setFlags(flags);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
super.startActivityForResult(intent, requestCode, options);
}
}
public class AfterDeleteGroup extends OnFinish {
public AfterDeleteGroup(Handler handler) {

View File

@@ -922,7 +922,7 @@ public class ImporterV4 extends Importer {
byte[] buf = Base64Coder.decode(sDate);
if (buf.length != 8) {
byte[] buf8 = new byte[8];
System.arraycopy(buf, 0, buf8, 0, buf.length);
System.arraycopy(buf, 0, buf8, 0, Math.min(buf.length, 8));
buf = buf8;
}

View File

@@ -21,17 +21,37 @@ package com.keepassdroid.utils;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Seconds;
import java.util.Date;
public class DateUtil {
private static final DateTime dotNetEpoch = new DateTime(1, 1, 1, 0, 0, 0, DateTimeZone.UTC);
private static final DateTime javaEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeZone.UTC);
private static final long epochOffset;
static {
Date dotNet = dotNetEpoch.toDate();
Date java = javaEpoch.toDate();
epochOffset = (javaEpoch.getMillis() - dotNetEpoch.getMillis()) / 1000L;
}
public static Date convertKDBX4Time(long seconds) {
return dotNetEpoch.plus(seconds).toDate();
DateTime dt = dotNetEpoch.plus(seconds * 1000L);
// Switch corrupted dates to a more recent date that won't cause issues on the client
if (dt.isBefore(javaEpoch)) {
return javaEpoch.toDate();
}
return dt.toDate();
}
public static long convertDateToKDBX4Time(DateTime dt) {
return (dt.getMillis() / 1000) - (dotNetEpoch.getMillis() / 1000);
Seconds secs = Seconds.secondsBetween(javaEpoch, dt);
return secs.getSeconds() + epochOffset;
}
}

View File

@@ -174,6 +174,8 @@
<string name="root">Start</string>
<string name="rounds">Schlüsseltransformationen</string>
<string name="rounds_explaination">Je höher die Anzahl der Schlüsseltransformationen, desto besser ist der Schutz gegen Wörterbuch- oder Brute-Force-Angriffe. Allerdings dauert dann auch das Laden und Speichern der Datenbank entsprechend länger.</string>
<string name="rounds_fix">Schlüsseltransformationen vor der Datenkorruption</string>
<string name="rounds_fix_explaination">Wenn ihre Datenbank durch KeePassDroid Version 2.2.0.0 bis 2.2.0.6 beschädigt wurde, können sie die Anzahl der vorher verwendeten Schlüsseltransformationen eingeben und damit ihre Datenbank wieder öffnen.</string>
<string name="rounds_hint">Schlüsseltransformationen</string>
<string name="saving_database">Speichere Datenbank\u2026</string>
<string name="space">Leerzeichen</string>