Merge branch 'release/2.5.0.0beta6'

This commit is contained in:
J-Jamet
2018-03-10 13:55:52 +01:00
12 changed files with 75 additions and 42 deletions

View File

@@ -8,8 +8,8 @@ android {
applicationId "com.kunzisoft.keepass"
minSdkVersion 14
targetSdkVersion 27
versionCode = 5
versionName = "2.5.0.0beta5"
versionCode = 6
versionName = "2.5.0.0beta6"
multiDexEnabled true
testApplicationId = "com.keepassdroid.tests"

View File

@@ -50,16 +50,15 @@ public abstract class LockingActivity extends StylishActivity {
@Override
protected void onResume() {
super.onResume();
TimeoutHelper.checkShutdown(this);
TimeoutHelper.resume(this);
TimeoutHelper.recordTime(this);
}
@Override
protected void onPause() {
super.onPause();
TimeoutHelper.pause(this);
TimeoutHelper.checkTime(this);
TimeoutHelper.checkShutdown(this);
}
@Override

View File

@@ -93,7 +93,9 @@ public class NodeAdapter extends RecyclerView.Adapter<BasicViewHolder> {
*/
public void rebuildList(PwGroup group) {
this.nodeSortedList.clear();
this.nodeSortedList.addAll(group.getDirectChildren());
if (group != null) {
this.nodeSortedList.addAll(group.getDirectChildren());
}
}
/**

View File

@@ -31,6 +31,7 @@ import java.util.Calendar;
public class App extends MultiDexApplication {
private static Database db = null;
private static boolean shutdown = false;
private static CharSequence mMessage = "";
private static Calendar calendar = null;
private static RecentFileHistory fileHistory = null;
@@ -38,7 +39,6 @@ public class App extends MultiDexApplication {
if ( db == null ) {
db = new Database();
}
return db;
}
@@ -56,17 +56,27 @@ public class App extends MultiDexApplication {
public static void setShutdown() {
shutdown = true;
mMessage = "";
}
public static void setShutdown(CharSequence message) {
shutdown = true;
mMessage = message;
}
public static CharSequence getMessage() {
return mMessage;
}
public static void clearShutdown() {
shutdown = false;
mMessage = "";
}
public static Calendar getCalendar() {
if ( calendar == null ) {
calendar = Calendar.getInstance();
}
return calendar;
}
@@ -75,9 +85,7 @@ public class App extends MultiDexApplication {
super.onCreate();
Stylish.init(this);
fileHistory = new RecentFileHistory(this);
PRNGFixes.apply();
}
@@ -86,7 +94,6 @@ public class App extends MultiDexApplication {
if ( db != null ) {
db.clear();
}
super.onTerminate();
}
}

View File

@@ -221,18 +221,16 @@ public class PwDatabaseV3 extends PwDatabase {
public byte[] getMasterKey(String key, InputStream keyInputStream)
throws InvalidKeyFileException, IOException {
assert (key != null);
if (key.length() > 0 && keyInputStream != null) {
if (key != null && key.length() > 0 && keyInputStream != null) {
return getCompositeKey(key, keyInputStream);
} else if (key.length() > 0) {
} else if (key != null && key.length() > 0) {
return getPasswordKey(key);
} else if (keyInputStream != null) {
return getFileKey(keyInputStream);
} else {
throw new IllegalArgumentException("Key cannot be empty.");
}
}
@Override

View File

@@ -381,26 +381,32 @@ public class FileSelectActivity extends StylishActivity implements
boolean masterPasswordChecked, String masterPassword,
boolean keyFileChecked, Uri keyFile) {
String databaseFilename = databaseUri.getPath();
try {
String databaseFilename = databaseUri.getPath();
// Prep an object to collect a password once the database has
// been created
FileOnFinish launchActivityOnFinish = new FileOnFinish(
new LaunchGroupActivity(databaseFilename));
AssignPasswordOnFinish assignPasswordOnFinish =
new AssignPasswordOnFinish(launchActivityOnFinish);
// Prep an object to collect a password once the database has
// been created
FileOnFinish launchActivityOnFinish = new FileOnFinish(
new LaunchGroupActivity(databaseFilename));
AssignPasswordOnFinish assignPasswordOnFinish =
new AssignPasswordOnFinish(launchActivityOnFinish);
// Create the new database
CreateDB create = new CreateDB(FileSelectActivity.this,
databaseFilename, assignPasswordOnFinish, true);
// Create the new database
CreateDB create = new CreateDB(FileSelectActivity.this,
databaseFilename, assignPasswordOnFinish, true);
ProgressTask createTask = new ProgressTask(
FileSelectActivity.this, create,
R.string.progress_create);
createTask.run();
assignPasswordHelper =
new AssignPasswordHelper(this,
masterPassword, keyFile);
ProgressTask createTask = new ProgressTask(
FileSelectActivity.this, create,
R.string.progress_create);
createTask.run();
assignPasswordHelper =
new AssignPasswordHelper(this,
masterPassword, keyFile);
} catch (Exception e) {
String error = "Unable to create database with this password and key file";
Toast.makeText(this, error, Toast.LENGTH_LONG).show();
Log.e(TAG, error + " " + e.getMessage());
}
}
@Override

View File

@@ -308,6 +308,11 @@ public class PasswordActivity extends StylishActivity
setEmptyViews();
}
// Show message if exists
CharSequence appMessage = App.getMessage();
if (! appMessage.toString().isEmpty())
Toast.makeText(this, appMessage, Toast.LENGTH_SHORT).show();
// Clear the shutdown flag
App.clearShutdown();

View File

@@ -23,9 +23,9 @@ import android.app.ProgressDialog;
import android.content.Context;
import android.os.Handler;
import com.kunzisoft.keepass.R;
import com.keepassdroid.database.edit.OnFinish;
import com.keepassdroid.database.edit.RunnableOnFinish;
import com.kunzisoft.keepass.R;
/** Designed to Pop up a progress dialog, run a thread in the background,
* run cleanup in the current thread, close the dialog. Without blocking
@@ -82,11 +82,11 @@ public class ProgressTask implements Runnable {
}
private class CloseProcessDialog implements Runnable {
public void run() {
mPd.dismiss();
if (mPd != null && mPd.isShowing()) {
mPd.dismiss();
}
}
}
}

View File

@@ -33,7 +33,7 @@ public class TimeoutHelper {
private static final long DEFAULT_TIMEOUT = 5 * 60 * 1000; // 5 minutes
public static void pause(Activity act) {
public static void recordTime(Activity act) {
// Record timeout time in case timeout service is killed
long time = System.currentTimeMillis();
@@ -46,14 +46,12 @@ public class TimeoutHelper {
if ( App.getDB().Loaded() ) {
Timeout.start(act);
}
}
public static void resume(Activity act) {
public static void checkTime(Activity act) {
if ( App.getDB().Loaded() ) {
Timeout.cancel(act);
}
// Check whether the timeout has expired
long cur_time = System.currentTimeMillis();
@@ -82,7 +80,7 @@ public class TimeoutHelper {
long diff = cur_time - timeout_start;
if (diff >= timeout) {
// We have timed out
App.setShutdown();
App.setShutdown(act.getString(R.string.app_timeout));
}
}

View File

@@ -262,6 +262,8 @@
<string name="permission_external_storage_rationale_read_database">KeePass DX a besoin d\'une permission de stockage externe pour lire une URI non fournie par un Content Provider</string>
<string name="permission_external_storage_denied">Permission de stockage externe refusée</string>
<string name="permission_external_storage_never_ask">Impossible d\'effectuer l\'action sans autorisation de stockage externe</string>
<string name="monospace_font_fields_enable_title">Police des champs</string>
<string name="monospace_font_fields_enable_summary">Change la police de caractères des champs pour une meilleure visibilité</string>
<string-array name="clipboard_timeout_options">
<item>5 secondes</item>

View File

@@ -0,0 +1,8 @@
* Autofill (Android O)
* Fix timeout and other bugs
* Deletion for group
* New sorts with (Asc/Dsc, Groups before or after)
* Setting to change font of field (monospace for a better visibility)
* Hide empty fields
* Add copy button for Username / Password and extra field
* New list to add and delete node with animation

View File

@@ -0,0 +1,8 @@
* Remplissage automatique (Android O)
* Correction du timeout et d'autres bugs
* Suppression pour les groupes
* Nouveau tri avec (Asc / Dsc, Groupes avant ou après)
* Réglage pour changer la police de champ (monospace pour une meilleure visibilité)
* Masquage des champs vides
* Ajout d'un bouton de copie pour le nom d'utilisateur / mot de passe et champ supplémentaire
* Nouvelle liste pour ajouter et supprimer un noeud avec animation