${getRemoteBackup()} +
+ ${getLocalBackups()} +
+| Field | Value |
|---|---|
| Version | ${header.version} |
| Backup Time | ${formatTimestamp(header.backupTimeMs)} |
| Media Root Backup Key | ${formatBytes(header.mediaRootBackupKey)} |
| Current App Version | ${header.currentAppVersion ?: "N/A"} |
| First App Version | ${header.firstAppVersion ?: "N/A"} |
No header found
") + } + + // Collect frame data on the fly + Log.i(TAG, "Starting to process backup frames") + var accountData: AccountData? = null + + // Store only essential data + val recipientNames = mutableMapOf| Attachment Details | |
|---|---|
| Not Started | ${details.notStartedCount} |
| Upload In Progress | ${details.uploadInProgressCount} |
| Copy Pending | ${details.copyPendingCount} |
| Finished | ${details.finishedCount} |
| Permanent Failure | ${details.permanentFailureCount} |
| Temporary Failure | ${details.temporaryFailureCount} |
| Field | Value |
|---|---|
| Given Name | ${account.givenName} |
| Family Name | ${account.familyName} |
| Username | ${account.username ?: "N/A"} |
| Profile Key | ${formatBytes(account.profileKey)} |
| Avatar URL Path | ${account.avatarUrlPath.ifEmpty { "N/A" }} |
| Bio Text | ${account.bioText.ifEmpty { "N/A" }} |
| Bio Emoji | ${account.bioEmoji.ifEmpty { "N/A" }} |
| Type | Count |
|---|---|
| Total Recipients | $totalRecipients |
| 1:1 Contacts | $contactCount |
| Groups | $groupCount |
| Distribution Lists | $distributionListCount |
| Self | $selfCount |
| Release Notes | $releaseNotesCount |
| Call Links | $callLinkCount |
Total Chats: ${chatInfos.size}
+ """.trimIndent() + ) + + if (chatInfos.isNotEmpty()) { + output.append( + """ +| Chat | +Recipient | +Messages | +Attachments | +Archived | +Pinned | +
|---|---|---|---|---|---|
| ${chatInfo.chatId} | +$recipientName | +${chatInfo.messageCount} | +${chatInfo.attachmentCount} | +${if (chatInfo.archived) "Yes" else "No"} | +${chatInfo.pinnedOrder?.let { "Yes (#$it)" } ?: "No"} | +
| Property | Count |
|---|---|
| Total File Pointers | ${counters.total} |
| With FilePointer LocatorInfo PlaintextHash | ${counters.withPlaintextHash} |
| With LocalKey | ${counters.withLocalKey} |
| Type | +Without PlaintextHash | +Without LocalKey | +
|---|---|---|
| $label | $withoutHash | $withoutKey |
| Total | +$totalWithoutPlaintextHash | +$totalWithoutLocalKey | +
Loading local backups...
+ + + + """.trimIndent() + } + + private data class ChatInfo( + val chatId: Long, + val recipientId: Long, + val archived: Boolean, + val pinnedOrder: Int?, + var messageCount: Int, + var attachmentCount: Int + ) + + private enum class FilePointerType { + LINK_PREVIEW, + ATTACHMENT, + LONG_TEXT, + QUOTE, + STICKER, + CONTACT_AVATAR, + WALLPAPER + } + + private data class AttachmentCounters( + var total: Int = 0, + var withPlaintextHash: Int = 0, + var withLocalKey: Int = 0, + val withoutPlaintextHashByType: MutableMap