Add an encrypted key-value store.

SignalStore is backed by SQLCipher and is intended to be used instead of
TextSecurePreferences moving forward.
This commit is contained in:
Greyson Parrelli
2020-01-10 01:08:39 -05:00
parent 711d22a0ed
commit 4b5b9fbde8
13 changed files with 791 additions and 25 deletions

View File

@@ -0,0 +1,24 @@
package org.thoughtcrime.securesms.logging;
import androidx.annotation.NonNull;
import org.thoughtcrime.securesms.keyvalue.SignalStore;
public class SignalUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
private static final String TAG = SignalUncaughtExceptionHandler.class.getSimpleName();
private final Thread.UncaughtExceptionHandler originalHandler;
public SignalUncaughtExceptionHandler(@NonNull Thread.UncaughtExceptionHandler originalHandler) {
this.originalHandler = originalHandler;
}
@Override
public void uncaughtException(Thread t, Throwable e) {
Log.e(TAG, "", e);
SignalStore.blockUntilAllWritesFinished();
Log.blockUntilAllWritesFinished();
originalHandler.uncaughtException(t, e);
}
}

View File

@@ -1,21 +0,0 @@
package org.thoughtcrime.securesms.logging;
import androidx.annotation.NonNull;
public class UncaughtExceptionLogger implements Thread.UncaughtExceptionHandler {
private static final String TAG = UncaughtExceptionLogger.class.getSimpleName();
private final Thread.UncaughtExceptionHandler originalHandler;
public UncaughtExceptionLogger(@NonNull Thread.UncaughtExceptionHandler originalHandler) {
this.originalHandler = originalHandler;
}
@Override
public void uncaughtException(Thread t, Throwable e) {
Log.e(TAG, "", e);
Log.blockUntilAllWritesFinished();
originalHandler.uncaughtException(t, e);
}
}