Add more info for various spinner results.
This commit is contained in:
parent
a7bdfb6d76
commit
cafa5c9e28
2 changed files with 7 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
package org.thoughtcrime.securesms
|
package org.thoughtcrime.securesms
|
||||||
|
|
||||||
|
import org.signal.core.util.Base64
|
||||||
import org.signal.spinner.Plugin
|
import org.signal.spinner.Plugin
|
||||||
import org.signal.spinner.PluginResult
|
import org.signal.spinner.PluginResult
|
||||||
import org.thoughtcrime.securesms.dependencies.AppDependencies
|
import org.thoughtcrime.securesms.dependencies.AppDependencies
|
||||||
|
@ -10,7 +11,7 @@ class StorageServicePlugin : Plugin {
|
||||||
override val path: String = PATH
|
override val path: String = PATH
|
||||||
|
|
||||||
override fun get(): PluginResult {
|
override fun get(): PluginResult {
|
||||||
val columns = listOf("Type", "Data")
|
val columns = listOf("Type", "Id", "Data")
|
||||||
val rows = mutableListOf<List<String>>()
|
val rows = mutableListOf<List<String>>()
|
||||||
|
|
||||||
val manager = AppDependencies.signalServiceAccountManager
|
val manager = AppDependencies.signalServiceAccountManager
|
||||||
|
@ -44,6 +45,9 @@ class StorageServicePlugin : Plugin {
|
||||||
row += "Unknown"
|
row += "Unknown"
|
||||||
row += ""
|
row += ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
row.add(1, Base64.encodeWithPadding(record.id.raw))
|
||||||
|
|
||||||
rows += row
|
rows += row
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.signal.spinner
|
||||||
|
|
||||||
import android.database.Cursor
|
import android.database.Cursor
|
||||||
import org.signal.core.util.Base64
|
import org.signal.core.util.Base64
|
||||||
|
import org.signal.core.util.Hex
|
||||||
|
|
||||||
object DefaultColumnTransformer : ColumnTransformer {
|
object DefaultColumnTransformer : ColumnTransformer {
|
||||||
override fun matches(tableName: String?, columnName: String): Boolean {
|
override fun matches(tableName: String?, columnName: String): Boolean {
|
||||||
|
@ -11,7 +12,7 @@ object DefaultColumnTransformer : ColumnTransformer {
|
||||||
override fun transform(tableName: String?, columnName: String, cursor: Cursor): String? {
|
override fun transform(tableName: String?, columnName: String, cursor: Cursor): String? {
|
||||||
val index = cursor.getColumnIndex(columnName)
|
val index = cursor.getColumnIndex(columnName)
|
||||||
return when (cursor.getType(index)) {
|
return when (cursor.getType(index)) {
|
||||||
Cursor.FIELD_TYPE_BLOB -> Base64.encodeWithPadding(cursor.getBlob(index))
|
Cursor.FIELD_TYPE_BLOB -> "Base64 with padding:<br>${Base64.encodeWithPadding(cursor.getBlob(index))}<br><br>Hex string:<br>${Hex.toStringCondensed(cursor.getBlob(index))}"
|
||||||
else -> cursor.getString(index)
|
else -> cursor.getString(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue