mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Fix debug tool to insert messages with attachments.
This commit is contained in:
@@ -1986,6 +1986,24 @@ class AttachmentTable(
|
||||
.run()
|
||||
}
|
||||
|
||||
fun debugMakeValidForArchive(attachmentId: AttachmentId) {
|
||||
writableDatabase
|
||||
.execSQL(
|
||||
"""
|
||||
UPDATE $TABLE_NAME
|
||||
SET $DATA_HASH_END = $DATA_HASH_START
|
||||
WHERE $ID = ${attachmentId.id}
|
||||
"""
|
||||
)
|
||||
|
||||
writableDatabase
|
||||
.update(TABLE_NAME)
|
||||
.values(
|
||||
REMOTE_KEY to Base64.encodeWithPadding(Util.getSecretBytes(64)),
|
||||
REMOTE_DIGEST to Util.getSecretBytes(64)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the data file if there's no strong references to other attachments.
|
||||
* If deleted, it will also clear all weak references (i.e. quotes) of the attachment.
|
||||
|
||||
Reference in New Issue
Block a user