mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Update more libraries.
This commit is contained in:
@@ -291,7 +291,7 @@ class RemoteBackupsSettingsFragment : ComposeFragment() {
|
||||
private inner class AuthListener : BiometricPrompt.AuthenticationCallback() {
|
||||
override fun onAuthenticationFailed() {
|
||||
Log.w(TAG, "onAuthenticationFailed")
|
||||
Toast.makeText(requireContext(), androidx.media3.session.R.string.authentication_required, Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(requireContext(), R.string.RemoteBackupsSettingsFragment__authenticatino_required, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
|
||||
|
||||
@@ -455,7 +455,7 @@ class CallLinkTable(context: Context, databaseHelper: SignalDatabase) : Database
|
||||
$limitOffset
|
||||
""".trimIndent()
|
||||
|
||||
return readableDatabase.query(statement, searchFilter?.whereArgs)
|
||||
return readableDatabase.query(statement, searchFilter?.whereArgs ?: arrayOf())
|
||||
}
|
||||
|
||||
private object CallLinkSerializer : Serializer<CallLink, ContentValues> {
|
||||
|
||||
@@ -190,28 +190,26 @@ open class SignalDatabase(private val context: Application, databaseSecret: Data
|
||||
Log.i(TAG, "Upgrade complete. Took " + (System.currentTimeMillis() - startTime) + " ms.")
|
||||
}
|
||||
|
||||
override fun getReadableDatabase(): net.zetetic.database.sqlcipher.SQLiteDatabase {
|
||||
throw UnsupportedOperationException("Call getSignalReadableDatabase() instead!")
|
||||
}
|
||||
override val readableDatabase: net.zetetic.database.sqlcipher.SQLiteDatabase
|
||||
get() = throw UnsupportedOperationException("Call getSignalReadableDatabase() instead!")
|
||||
|
||||
override fun getWritableDatabase(): net.zetetic.database.sqlcipher.SQLiteDatabase {
|
||||
throw UnsupportedOperationException("Call getSignalWritableDatabase() instead!")
|
||||
}
|
||||
override val writableDatabase: net.zetetic.database.sqlcipher.SQLiteDatabase
|
||||
get() = throw UnsupportedOperationException("Call getSignalWritableDatabase() instead!")
|
||||
|
||||
open val rawReadableDatabase: net.zetetic.database.sqlcipher.SQLiteDatabase
|
||||
get() = super.getReadableDatabase()
|
||||
get() = super.readableDatabase
|
||||
|
||||
open val rawWritableDatabase: net.zetetic.database.sqlcipher.SQLiteDatabase
|
||||
get() = super.getWritableDatabase()
|
||||
get() = super.writableDatabase
|
||||
|
||||
open val signalReadableDatabase: SQLiteDatabase
|
||||
get() = SQLiteDatabase(super.getReadableDatabase())
|
||||
get() = SQLiteDatabase(super.readableDatabase)
|
||||
|
||||
open val signalWritableDatabase: SQLiteDatabase
|
||||
get() = SQLiteDatabase(super.getWritableDatabase())
|
||||
get() = SQLiteDatabase(super.writableDatabase)
|
||||
|
||||
override fun getSqlCipherDatabase(): net.zetetic.database.sqlcipher.SQLiteDatabase {
|
||||
return super.getWritableDatabase()
|
||||
return super.writableDatabase
|
||||
}
|
||||
|
||||
open fun markCurrent(db: net.zetetic.database.sqlcipher.SQLiteDatabase) {
|
||||
@@ -299,7 +297,7 @@ open class SignalDatabase(private val context: Application, databaseSecret: Data
|
||||
database.setForeignKeyConstraintsEnabled(false)
|
||||
database.beginTransaction()
|
||||
try {
|
||||
instance!!.onUpgrade(database, database.getVersion(), -1)
|
||||
instance!!.onUpgrade(database, database.version, -1)
|
||||
instance!!.markCurrent(database)
|
||||
instance!!.messageTable.deleteAbandonedMessages()
|
||||
instance!!.messageTable.trimEntriesForExpiredMessages()
|
||||
|
||||
@@ -8,5 +8,4 @@ import net.zetetic.database.sqlcipher.SQLiteDatabase;
|
||||
*/
|
||||
public interface SignalDatabaseOpenHelper {
|
||||
SQLiteDatabase getSqlCipherDatabase();
|
||||
String getDatabaseName();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ object V162_ThreadUnreadSelfMentionCountFixup : SignalDatabaseMigration {
|
||||
|
||||
@Suppress("SameParameterValue")
|
||||
private fun columnMissing(db: SupportSQLiteDatabase, table: String, column: String): Boolean {
|
||||
db.query("PRAGMA table_info($table)", null).use { cursor ->
|
||||
db.query("PRAGMA table_info($table)", arrayOf()).use { cursor ->
|
||||
val nameColumnIndex = cursor.getColumnIndexOrThrow("name")
|
||||
while (cursor.moveToNext()) {
|
||||
val name = cursor.getString(nameColumnIndex)
|
||||
|
||||
@@ -28,7 +28,7 @@ object V163_RemoteMegaphoneSnoozeSupportMigration : SignalDatabaseMigration {
|
||||
}
|
||||
|
||||
private fun columnMissing(db: SupportSQLiteDatabase, column: String): Boolean {
|
||||
db.query("PRAGMA table_info(remote_megaphone)", null).use { cursor ->
|
||||
db.query("PRAGMA table_info(remote_megaphone)", arrayOf()).use { cursor ->
|
||||
val nameColumnIndex = cursor.getColumnIndexOrThrow("name")
|
||||
while (cursor.moveToNext()) {
|
||||
val name = cursor.getString(nameColumnIndex)
|
||||
|
||||
@@ -63,7 +63,7 @@ object V186_ForeignKeyIndicesMigration : SignalDatabaseMigration {
|
||||
}
|
||||
|
||||
private fun columnExists(db: SQLiteDatabase, table: String, column: String): Boolean {
|
||||
return db.query("PRAGMA table_info($table)", null)
|
||||
return db.query("PRAGMA table_info($table)", arrayOf())
|
||||
.readToList { it.requireNonNullString("name") }
|
||||
.any { it == column }
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ object V188_FixMessageRecipientsAndEditMessageMigration : SignalDatabaseMigratio
|
||||
}
|
||||
|
||||
private fun columnExists(db: SQLiteDatabase, table: String, column: String): Boolean {
|
||||
return db.query("PRAGMA table_info($table)", null)
|
||||
return db.query("PRAGMA table_info($table)", arrayOf())
|
||||
.readToList { it.requireNonNullString("name") }
|
||||
.any { it == column }
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ object V203_PreKeyStaleTimestamp : SignalDatabaseMigration {
|
||||
}
|
||||
|
||||
private fun columnExists(db: SupportSQLiteDatabase, table: String, column: String): Boolean {
|
||||
db.query("PRAGMA table_info($table)", null).use { cursor ->
|
||||
db.query("PRAGMA table_info($table)", arrayOf()).use { cursor ->
|
||||
val nameColumnIndex = cursor.getColumnIndexOrThrow("name")
|
||||
while (cursor.moveToNext()) {
|
||||
val name = cursor.getString(nameColumnIndex)
|
||||
|
||||
Reference in New Issue
Block a user