mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-24 19:56:00 +00:00
Update SQLCipher to 4.5.3-FTS-S3
This commit is contained in:
@@ -27,8 +27,8 @@ public final class SqlCipherDeletingErrorHandler implements DatabaseErrorHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCorruption(SQLiteDatabase db) {
|
||||
Log.e(TAG, "Database '" + databaseName + "' corrupted! Going to try to run some diagnostics.");
|
||||
public void onCorruption(SQLiteDatabase db, String message) {
|
||||
Log.e(TAG, "Database '" + databaseName + "' corrupted! Message: " + message + ". Going to try to run some diagnostics.");
|
||||
|
||||
Log.w(TAG, " ===== PRAGMA integrity_check =====");
|
||||
try (Cursor cursor = db.rawQuery("PRAGMA integrity_check", null)) {
|
||||
|
||||
@@ -18,15 +18,14 @@ import java.util.concurrent.atomic.AtomicReference
|
||||
*/
|
||||
class SqlCipherErrorHandler(private val databaseName: String) : DatabaseErrorHandler {
|
||||
|
||||
override fun onCorruption(db: SQLiteDatabase) {
|
||||
val output = StringBuilder()
|
||||
output.append("Database '$databaseName' corrupted! Going to try to run some diagnostics.\n")
|
||||
|
||||
override fun onCorruption(db: SQLiteDatabase, message: String) {
|
||||
val result: DiagnosticResults = runDiagnostics(ApplicationDependencies.getApplication(), db)
|
||||
var lines: List<String> = result.logs.split("\n")
|
||||
lines = listOf("Database '$databaseName' corrupted!. Diagnostics results:\n") + lines
|
||||
lines = listOf("Database '$databaseName' corrupted!", "[sqlite] $message", "Diagnostics results:") + lines
|
||||
|
||||
Log.e(TAG, "Database '$databaseName' corrupted!. Diagnostics results:\n ${result.logs}")
|
||||
Log.e(TAG, "Database '$databaseName' corrupted!")
|
||||
Log.e(TAG, "[sqlite] $message")
|
||||
Log.e(TAG, "Diagnostic results:\n ${result.logs}")
|
||||
|
||||
if (result is DiagnosticResults.Success) {
|
||||
if (result.pragma1Passes && result.pragma2Passes) {
|
||||
|
||||
Reference in New Issue
Block a user