From 9862b758e53f6f8927dcd861a8dcbe2f0781c5a3 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Tue, 28 Jan 2025 10:52:53 -0500 Subject: [PATCH] Update to libsignal 0.65.4 --- .../chat_item_direct_story_reply_01.binproto | Bin 712 -> 710 bytes .../chat_item_direct_story_reply_02.binproto | Bin 769 -> 765 bytes .../chat_item_direct_story_reply_04.binproto | Bin 735 -> 729 bytes .../chat_item_direct_story_reply_05.binproto | Bin 754 -> 752 bytes .../chat_item_direct_story_reply_07.binproto | Bin 697 -> 695 bytes .../chat_item_direct_story_reply_08.binproto | Bin 674 -> 672 bytes ..._direct_story_reply_with_edits_01.binproto | Bin 1037 -> 1035 bytes ..._direct_story_reply_with_edits_02.binproto | Bin 890 -> 886 bytes ..._direct_story_reply_with_edits_04.binproto | Bin 861 -> 855 bytes ..._direct_story_reply_with_edits_05.binproto | Bin 1078 -> 1076 bytes ..._direct_story_reply_with_edits_07.binproto | Bin 1025 -> 1023 bytes ..._direct_story_reply_with_edits_08.binproto | Bin 797 -> 795 bytes ...tandard_message_formatted_text_00.binproto | Bin 948 -> 944 bytes ...tandard_message_formatted_text_01.binproto | Bin 964 -> 960 bytes ...tandard_message_formatted_text_02.binproto | Bin 968 -> 962 bytes ...tandard_message_formatted_text_03.binproto | Bin 996 -> 992 bytes ...tandard_message_formatted_text_04.binproto | Bin 1028 -> 1022 bytes ...tandard_message_formatted_text_05.binproto | Bin 1000 -> 996 bytes ...tandard_message_formatted_text_06.binproto | Bin 964 -> 960 bytes ...tandard_message_formatted_text_07.binproto | Bin 996 -> 992 bytes ...tandard_message_formatted_text_08.binproto | Bin 952 -> 946 bytes ...tandard_message_formatted_text_09.binproto | Bin 996 -> 992 bytes ...tandard_message_formatted_text_10.binproto | Bin 1028 -> 1022 bytes ...tandard_message_formatted_text_11.binproto | Bin 1008 -> 1004 bytes ...tandard_message_formatted_text_12.binproto | Bin 964 -> 960 bytes ...tandard_message_formatted_text_13.binproto | Bin 980 -> 974 bytes ...tandard_message_formatted_text_14.binproto | Bin 960 -> 956 bytes ...em_standard_message_with_quote_02.binproto | Bin 1383 -> 1375 bytes ...em_standard_message_with_quote_04.binproto | Bin 714 -> 705 bytes .../backupTests/recipient_groups_00.binproto | Bin 1312 -> 1312 bytes .../backupTests/recipient_groups_01.binproto | Bin 1495 -> 1497 bytes .../backupTests/recipient_groups_02.binproto | Bin 1453 -> 1451 bytes .../backupTests/recipient_groups_03.binproto | Bin 1443 -> 1445 bytes .../securesms/backup/v2/ArchiveErrorCases.kt | 4 + .../v2/exporters/ChatItemArchiveExporter.kt | 29 +++--- .../v2/exporters/GroupArchiveExporter.kt | 1 + .../v2/importer/GroupArchiveImporter.kt | 4 +- app/src/main/protowire/Backup.proto | 88 +++++++++++------- gradle/libs.versions.toml | 2 +- gradle/verification-metadata.xml | 20 ++-- 40 files changed, 92 insertions(+), 56 deletions(-) diff --git a/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_01.binproto b/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_01.binproto index 7980c7cc92fc27abfb79073945e3046fb018f879..7a92826e0b3497712e7f6b486d459ed0c9c43f6e 100644 GIT binary patch delta 53 zcmV-50LuT!1;z!i`T+#W0V2nf{sA5ur~w)g3Iy<3M-Q~ N0weaa?$i?zu{-g#0Mu|yt_e{KIq`=6vhLOv8vMG~} XFdGMh0HXq<5Qt_`U;@#T^O&*$Q|c1E diff --git a/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_05.binproto b/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_05.binproto index 578fc3f2227e929725f72432e714b55e479c8304..41043be7a5f12a7053bfad9bac46a5f2daaf16ff 100644 GIT binary patch delta 37 tcmeyw`hj)BFGiLxj7lFT|6`P3yfImvNrPoQBUjL5XC_}pmdTTu;sF@K47>mU delta 39 vcmeys`iXVJFGiMcj7py;|6`P3yfs;zNrPo0BUi{|XC_}}HV%f#6Pe-xFiZ^4 diff --git a/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_07.binproto b/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_07.binproto index 97994309d044933aa825ce102530fe197e38c573..1258734352e6bc51f1c7e2fea302a05c06413a11 100644 GIT binary patch delta 53 zcmV-50LuTl1-AvT`T+#H0V24Q{sA8vm;o9Q3Iy<$m?3ygfq`{oTWi{D>NtcmjasiVO0NdgUPyhe` delta 38 ucmZ3$x`=hdFGiMSj7p0q|6>$m?3paeq`{oRWi#1J{sCP98n6Kx5efwGpOSzO0T`71{-KLDAOQ-R0SYmb Obpt8`1_%I?paW|n5)sq@ diff --git a/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_with_edits_02.binproto b/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_with_edits_02.binproto index ff5146e13e49aac56834879277c673c48804f193..6605018c81a93f96d0317d9056071d75489d646c 100644 GIT binary patch delta 43 zcmV+`0M!5b2KEN9`T+#`0wVX5{sEN%;gggCC0L)vvDv8uqZGI0qMz~nVJE) Cmk%fa diff --git a/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_with_edits_04.binproto b/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_with_edits_04.binproto index 0ddf3fdd535804687d991cbd512f05b84b55c836..7901c8212177256af550e7627e11c61d0ffb264c 100644 GIT binary patch delta 65 zcmV-H0KWg-2G<6#`T+#n0wUOx{sEO5!T}l)3Iy<rohOxiIK~5@>(V% YVKxp10Y(KzArQ@?zyzWvzhTM-0FTEMs{jB1 diff --git a/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_with_edits_05.binproto b/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_with_edits_05.binproto index e0a88e89a164621cefc1c211e9c0c6f11299eb01..6947eef5b5a419469621657f038807deb4b5ebf3 100644 GIT binary patch delta 38 ucmdnSv4vy9FGiLfEJ|B9|6`10WV}8(hFODU9V1uZ2>%DL`T+!k1R{X5{sCP98lnLj5efwGpOSzO0T`71{-KLDAOQ-D0SYgZ Mbpt8^1e2lzUk;fO>i_@% delta 56 zcmV-80LTCT2Z0E%`T+!m1R{d7{sCP98l(Xl5efwGpOSzO0T`71{-KLDAOQ-F0SYmb Obpt8`1_%I?paWkq!x8@g diff --git a/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_with_edits_08.binproto b/app/src/androidTest/assets/backupTests/chat_item_direct_story_reply_with_edits_08.binproto index 64a55aebbb0b530f7e59693c4d86c1350b1ce4e1..1f0341feb02f48618982aaaaf4a73509c31a6171 100644 GIT binary patch delta 36 ucmV+<0Neka2Ac-3`T+!=0wSD~{sEN%hLe;6C<9&!Ig`HvECB?Q?gB6J5DYB< delta 38 wcmV+>0NMYW2Au}5`T+!?0wSK1{sEN%h?A58C<9;$JCnZxECU7z0F&$jF9z>% diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_00.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_00.binproto index 106b18d28b1544913cf531efb505ac88725512a6..9ebe0ec6d5db0ba8544d49e7d45ac7d505e07af9 100644 GIT binary patch delta 43 ycmdnOzJYy15;L=}lK13PW(9FAAq_4r14AQY6H_yD3risu0WJkbA(6=om_-2GhX}m@ delta 63 zcmdnMzJ+~55;Jq4lK;L88fq|lKbRJW*KoUAq_4r14AQY6H_yD3risu0WJk5A(6=&m_-2P-U$i- delta 63 zcmX@WeuRBP88fr5lK13FW*L1wAssF*14AQY6H_yD3rit34h8`(1tuXe5G^IZz$JK& Mfx&^HfdLE{0h@FQ+5i9m diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_02.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_02.binproto index b513dfa9d62a5bd9ef26f5dd850505885b7ced70..b6a0eb399e75c35f2ed95944fe05c0af72441054 100644 GIT binary patch delta 101 zcmX@Xeu#a80keXqk~;^p0HegoZ*MoxGxg%(V&PzsVgQn?QVdZ#LRympm{mDg1XvUp z-IZJ?*E36LYYAy^aTypI8Jn1znOj&2u?TP}FbjzYa7hU;a0#AcU~ph)U;qO~06vtixC{)9j7?0<%q=X1K+;?a%tB%yT1tR{OYj^6g9AeY0~jy@0G&J$ AuK)l5 diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_03.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_03.binproto index 3a75a45dd306e7925d2d870f30731f3c16c05ef4..7771c3e80f01a6d2e82b5a11cbe9dfbf3dcd7749 100644 GIT binary patch delta 43 ycmaFD{(yZ$8#8mHQuyRfW*u=YAq_4r14AQY6H_yD3risu0WJj=A(6=!m_-2lED5{- delta 63 zcmaFB{)Bx)8#8mPQuO3bW*vP!AssF*14AQY6H_yD3rit34h8`(1r{MO5G^IZz$JK& Mfx&^HfdLE{0lUTuYybcN diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_04.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_04.binproto index 461ac3b3d4ac1d8a3cece616d76e622d0c126b85..b871624dcfd98134f29a8cf58affd338790f7397 100644 GIT binary patch delta 64 zcmZqS_{YA%fSI{msdTb2vj($|kk{lmW>*dt0TuYne5~wS+XdxC{)9j7?0< U%q=X1SOmBfScOC;e_$2?0OXMkf&c&j delta 86 zcmeyz-omlLfSI{cseH0Avj(%Dkk8~eW>+pY4h8`h1;$9F@X4#0HT3m_bhx+-42_IU iOwG(KEQLVQTnem0Vjx;dfPqW!90P*`LjwaCFaiJoTn;1v diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_05.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_05.binproto index e6323a109baa80191f70ed7640aae4d5cee86cb7..dca4f161595f7c82daa8846b435d0433b025cb25 100644 GIT binary patch delta 59 zcmaFC{)BzQ3}$9;CC|yTndP*#gfzIg3=EBoO-#+qEi8pt1h^C!g+v6nqy!ka1kW)r LI50FYfB_=_mI(?& delta 47 zcmaFD{(^nO3}$A3CEv-jndPMQgmk#L3=EBoO-#+qEi8rDI2Z)D6c~lXI2a~hU={%Y DAE*iA diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_06.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_06.binproto index 5ba13ac33a212a126e87fcc793c7d86b8c075898..ac3855bc4c3897044c95bd32835f30e18fc3153d 100644 GIT binary patch delta 43 ycmX@Yet>;L7Bh3GQt;$lW({#IAq_4r14AQY6H_yD3risu0WJk5A(6=&m_-2RE(sO@ delta 63 zcmX@WeuRBP7Bh3CQuyRtW(|EkAssF*14AQY6H_yD3rit34h8`(1tuXe5G^IZz$JK& Mfx&^HfdLE{0iCo7<^TWy diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_07.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_07.binproto index 01bb28f39d254c89888c1ef1794f9a9ef849745f..539fbbb8c02312f90ba425737fe34b47de8bf5d5 100644 GIT binary patch delta 43 ycmaFD{(yZ$8#8mHQuyRfW*u=YAq_4r14AQY6H_yD3risu0WJk*A(6=!m_-2lB?-F# delta 63 zcmaFB{)Bx)8#8mPQuO3bW*vP!AssF*14AQY6H_yD3rit34h8`(1!f^J5G^IZz$JK& Mfx&^HfdLE{0lTdVYXATM diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_08.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_08.binproto index 7cc5fdfc1bcd3759427f0e6b7e12948b20e23c37..a3f185055811881609f84acf450d4123d7a90599 100644 GIT binary patch delta 117 zcmdnNzKMN<0kf^8k~s&n0HehDZ*MoxGxg%(V&PyhVgQn?MhsChLQ-5@28Kq)CZ=ZQ z7M4OR0xSxQLTnt20;~#5?nczwS+X#6mcoA2#E-ANeM7;37%tMaA0U)00Tw< DIP4P9 delta 123 zcmdnQzJq;(0kgfek|hVT0HehDZ*MoxGxg%(V&PyhVgQn?MhsDMLNZ)j28Kq)CZ=ZQ z7M4P691H?13XDLSQGiu}$y>>DaxSx!zMhZ{hB7V%79la9axN(W1}?#K3=9qo4Gdtw F2mqd-6AJ(U diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_09.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_09.binproto index 01e1495d8767b746117c525182f1263b80026b2e..d189e33dc0a546ccdcb57a8df5895672750bba2d 100644 GIT binary patch delta 43 ycmaFD{(yZ$8#8mHQuyRfW*u=YAq_4r14AQY6H_yD3risu0WJkrA(6=!m_-2lGYP!_ delta 63 zcmaFB{)Bx)8#8mPQuO3bW*vP!AssF*14AQY6H_yD3rit34h8`(1y&(35G^IZz$JK& Mfx&^HfdLE{0lVJ{Z2$lO diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_10.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_10.binproto index 3588dedde0a48238578792c2fb790d649ba6a645..6ae6addf2a527506089447a751d181df4bf779d5 100644 GIT binary patch delta 72 zcmZqS_{YA%fSI{msdTb2vj($|kk{lmW?KOk0Tu;DAvO+10agX3P^I9>Yne5~wS+Xd bxC{)9j7?0<%q=X1SOmC$ibN)VU={%YCgcs) delta 94 zcmeyz-omlLfSI{cseH0Avj(%Dkk8~eW?LaP4h8`h1x6svD8Q<~6sZ(Gc{Q_!zMhZ{ o7ngydk+F%XnYo1}SQ!^knHW$xmy`elm*6=D1_y=)1~6a*07=*mcmMzZ diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_11.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_11.binproto index 78cc9dfb8ac63d2253f862911912470b31849612..5563c697efdb02aae4a577c3645675412d000d8e 100644 GIT binary patch delta 80 zcmeys{)TK(v$q1DD`A1_lR)1_m%-1OR5t4|f0n diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_12.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_12.binproto index 1f236803a1ea51ffe7ed0f6a4d105403d3cd8228..331421f7e57518da4d3d4feb38a0d25324382850 100644 GIT binary patch delta 43 ycmX@Yet>;L7Bh3GQt;$lW({#IAq_4r14AQY6H_yD3risu0WJk*A(6=&m_-2RH3=60 delta 63 zcmX@WeuRBP7Bh3CQuyRtW(|EkAssF*14AQY6H_yD3rit34h8`(1!f^J5G^IZz$JK& Mfx&^HfdLE{0iDeW=Kufz diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_13.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_formatted_text_13.binproto index 01394f4bec0a2718dc2bb5d636080962932aecad..70b0e89ccc19e63fd54655ffdb489af794571d15 100644 GIT binary patch delta 72 zcmcb@evW;E0W-6+lH+7!W*rF;At5d<14AQY6H_yD3risu0Tu;L0ds)Ak}n6d0HegO_qR`-HTM$WV&h=(V&Y%|(ySmlN>50Ki_5^!$k@cx i%-q6Kh>e3mfJ=c@NDM?v2{3R8o?~EeU}#_f14aOBO%Eji diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_with_quote_02.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_with_quote_02.binproto index 00daa86160cd396b25e54507c9e20bf7d66bd4ef..8a53345dc58682ac142672fef57e34eeb37bcd02 100644 GIT binary patch delta 118 zcmaFPb)Rd)FGihxEK0jsIG6-jBp998I2Z*OB^aYtu?R_UaTypI8Jn1znOj&2u?Vmz zFbc73)?yN2vRKTdw15eygHdAR*=6rH8hEjBv2d_RF+_DSaUEv_8o?rkRrlm7mbU=9 C!54!7 delta 126 zcmcc5^_*+NFGhnyEK2)XIG6-jBp998I2Z*OB^aaDu?WdXHZB$p7Ac0PJ|?cyj6h>pq;Q%rxrpU0 E07*m_%K!iX diff --git a/app/src/androidTest/assets/backupTests/chat_item_standard_message_with_quote_04.binproto b/app/src/androidTest/assets/backupTests/chat_item_standard_message_with_quote_04.binproto index 57c7445e3aa72c4c8d34f83f6f8234350f6747c3..f79646f12dbcdb27ae6bc1868e540d3ab6f7e5e6 100644 GIT binary patch delta 101 zcmX@bdXRO)FGf)pB_|Fh0Tu~HCpHd70Y(YNC?g?*$^1;J#w-FX3XDP^lBt1FsSc=$ tQDXDiW$!l{c=2*^bFc`kpL=TQYC|Q4s3a~6pk5X!us(LEzR7c#^Z*vy6m0+i delta 110 zcmX@edWv8EF@p5rq=r3OG5W*f{CZW?z99&YzCO5GtGYK$mUdm#`2mq0q2z&ql delta 26 icmcb~eVuzlB@5>nCZUr|99&XICO5GtZ(hz~#0UUy_$PNB@5>QCZV}Z99&W}CO5GtZ(h#A#s~mw=m%W@ delta 29 lcmZ3@y_S1JB@5>wCZYLE99&YfCO5GtGYK$mUdqD82mpSv2Xp`c diff --git a/app/src/androidTest/assets/backupTests/recipient_groups_03.binproto b/app/src/androidTest/assets/backupTests/recipient_groups_03.binproto index 79d027e7409f5b1e09b5f86cb7158feb28de6229..efeac8cb0be087fdfe9597668a568f1e2a7457f3 100644 GIT binary patch delta 41 xcmZ3?y_9=HB@5>)CZXv}99&Y9HaD>dG71?m@=Nh@FbZ&KJm{Zs|Au4$BLLn-3ef-n delta 39 vcmZ3=y_kDLB@5>aCZVZJ99&WpHaD>dG79iZ@p3Q + Text( + body = body, + bodyRanges = bodyRanges + ) + } + val attachments = if (remoteType == Quote.Type.VIEW_ONCE) { + emptyList() + } else { + attachments?.toRemoteQuoteAttachments(mediaArchiveEnabled) ?: emptyList() + } + + if (body == null && attachments.isEmpty()) { + Log.w(TAG, ExportOddities.emptyQuote(this.dateSent)) + return null + } return Quote( targetSentTimestamp = this.quoteTargetSentTimestamp.takeIf { !this.quoteMissing && it != MessageTable.QUOTE_TARGET_MISSING_ID }?.clampToValidBackupRange(), authorId = this.quoteAuthor, - text = this.quoteBody?.let { body -> - Text( - body = body, - bodyRanges = bodyRanges - ) - }, - attachments = if (remoteType == Quote.Type.VIEW_ONCE) { - emptyList() - } else { - attachments?.toRemoteQuoteAttachments(mediaArchiveEnabled) ?: emptyList() - }, + text = body, + attachments = attachments, type = remoteType ) } diff --git a/app/src/main/java/org/thoughtcrime/securesms/backup/v2/exporters/GroupArchiveExporter.kt b/app/src/main/java/org/thoughtcrime/securesms/backup/v2/exporters/GroupArchiveExporter.kt index 82d56442de..8b4719eba9 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/backup/v2/exporters/GroupArchiveExporter.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/backup/v2/exporters/GroupArchiveExporter.kt @@ -56,6 +56,7 @@ class GroupArchiveExporter(private val selfAci: ServiceId.ACI, private val curso group = ArchiveGroup( masterKey = cursor.requireNonNullBlob(GroupTable.V2_MASTER_KEY).toByteString(), whitelisted = cursor.requireBoolean(RecipientTable.PROFILE_SHARING), + blocked = cursor.requireBoolean(RecipientTable.BLOCKED), hideStory = extras?.hideStory() ?: false, storySendMode = showAsStoryState.toRemote(), snapshot = decryptedGroup.toRemote(isActive, selfAci) diff --git a/app/src/main/java/org/thoughtcrime/securesms/backup/v2/importer/GroupArchiveImporter.kt b/app/src/main/java/org/thoughtcrime/securesms/backup/v2/importer/GroupArchiveImporter.kt index ea3597045b..e6d4421adf 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/backup/v2/importer/GroupArchiveImporter.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/backup/v2/importer/GroupArchiveImporter.kt @@ -7,6 +7,7 @@ package org.thoughtcrime.securesms.backup.v2.importer import android.content.ContentValues import org.signal.core.util.Base64 +import org.signal.core.util.toInt import org.signal.libsignal.zkgroup.groups.GroupMasterKey import org.signal.libsignal.zkgroup.groups.GroupSecretParams import org.signal.storageservice.protos.groups.AccessControl @@ -51,7 +52,8 @@ object GroupArchiveImporter { val values = ContentValues().apply { put(RecipientTable.GROUP_ID, groupId.toString()) put(RecipientTable.AVATAR_COLOR, AvatarColorHash.forGroupId(groupId).serialize()) - put(RecipientTable.PROFILE_SHARING, group.whitelisted) + put(RecipientTable.PROFILE_SHARING, group.whitelisted.toInt()) + put(RecipientTable.BLOCKED, group.blocked.toInt()) put(RecipientTable.TYPE, RecipientTable.RecipientType.GV2.id) put(RecipientTable.STORAGE_SERVICE_ID, Base64.encodeWithPadding(StorageSyncHelper.generateKey())) if (group.hideStory) { diff --git a/app/src/main/protowire/Backup.proto b/app/src/main/protowire/Backup.proto index 614042dad2..ca7ecb5410 100644 --- a/app/src/main/protowire/Backup.proto +++ b/app/src/main/protowire/Backup.proto @@ -30,6 +30,7 @@ message BackupInfo { // For example, Chats may all be together at the beginning, // or may each immediately precede its first ChatItem. message Frame { + // If unset, importers should skip this frame without throwing an error. oneof item { AccountData account = 1; Recipient recipient = 2; @@ -44,13 +45,13 @@ message Frame { message AccountData { enum PhoneNumberSharingMode { - UNKNOWN = 0; + UNKNOWN = 0; // Interpret as "Nobody" EVERYBODY = 1; NOBODY = 2; } message UsernameLink { enum Color { - UNKNOWN = 0; + UNKNOWN = 0; // Interpret as "Blue" BLUE = 1; WHITE = 2; GREY = 3; @@ -97,6 +98,7 @@ message AccountData { message IAPSubscriberData { bytes subscriberId = 1; + // If unset, importers should ignore the subscriber data without throwing an error. oneof iapSubscriptionId { // Identifies an Android Play Store IAP subscription. string purchaseToken = 2; @@ -119,6 +121,7 @@ message AccountData { message Recipient { uint64 id = 1; // generated id for reference only within this file + // If unset, importers should skip this frame without throwing an error. oneof destination { Contact contact = 2; Group group = 3; @@ -131,9 +134,9 @@ message Recipient { message Contact { enum IdentityState { - DEFAULT = 0; + DEFAULT = 0; // A valid value -- indicates unset by the user VERIFIED = 1; - UNVERIFIED = 2; + UNVERIFIED = 2; // Was once verified and is now unverified } message Registered {} @@ -142,7 +145,7 @@ message Contact { } enum Visibility { - VISIBLE = 0; + VISIBLE = 0; // A valid value -- the contact is not hidden HIDDEN = 1; HIDDEN_MESSAGE_REQUEST = 2; } @@ -159,6 +162,7 @@ message Contact { bool blocked = 5; Visibility visibility = 6; + // If unset, consider the user to be registered oneof registration { Registered registered = 7; NotRegistered notRegistered = 8; @@ -177,7 +181,7 @@ message Contact { message Group { enum StorySendMode { - DEFAULT = 0; + DEFAULT = 0; // A valid value -- indicates unset by the user DISABLED = 1; ENABLED = 2; } @@ -187,6 +191,7 @@ message Group { bool hideStory = 3; StorySendMode storySendMode = 4; GroupSnapshot snapshot = 5; + bool blocked = 6; // These are simply plaintext copies of the groups proto from Groups.proto. // They should be kept completely in-sync with Groups.proto. @@ -210,6 +215,7 @@ message Group { } message GroupAttributeBlob { + // If unset, consider the field it represents to not be present oneof content { string title = 1; bytes avatar = 2; @@ -220,7 +226,7 @@ message Group { message Member { enum Role { - UNKNOWN = 0; + UNKNOWN = 0; // Intepret as "Default" DEFAULT = 1; ADMINISTRATOR = 2; } @@ -252,7 +258,7 @@ message Group { message AccessControl { enum AccessRequired { - UNKNOWN = 0; + UNKNOWN = 0; // Intepret as "Unsatisfiable" ANY = 1; MEMBER = 2; ADMINISTRATOR = 3; @@ -292,7 +298,7 @@ message Chat { */ message CallLink { enum Restrictions { - UNKNOWN = 0; + UNKNOWN = 0; // Interpret as "Admin Approval" NONE = 1; ADMIN_APPROVAL = 2; } @@ -306,7 +312,7 @@ message CallLink { message AdHocCall { enum State { - UNKNOWN_STATE = 0; + UNKNOWN_STATE = 0; // Interpret as "Generic" GENERIC = 1; } @@ -322,6 +328,7 @@ message DistributionListItem { // by an all-0 UUID (00000000-0000-0000-0000-000000000000). bytes distributionId = 1; // distribution list ids are uuids + // If unset, importers should skip the item entirely without showing an error. oneof item { uint64 deletionTimestamp = 2; DistributionList distributionList = 3; @@ -330,7 +337,7 @@ message DistributionListItem { message DistributionList { enum PrivacyMode { - UNKNOWN = 0; + UNKNOWN = 0; // Interpret as "Only with" ONLY_WITH = 1; ALL_EXCEPT = 2; ALL = 3; @@ -365,12 +372,14 @@ message ChatItem { repeated ChatItem revisions = 6; // ordered from oldest to newest bool sms = 7; + // If unset, importers should skip this item without throwing an error. oneof directionalDetails { IncomingMessageDetails incoming = 8; OutgoingMessageDetails outgoing = 9; DirectionlessMessageDetails directionless = 10; } + // If unset, importers should skip this item without throwing an error. oneof item { StandardMessage standardMessage = 11; ContactMessage contactMessage = 12; @@ -419,6 +428,7 @@ message SendStatus { uint64 recipientId = 1; uint64 timestamp = 2; // the time the status was last updated -- if from a receipt, it should be the sentTime of the receipt + // If unset, importers should consider the status to be "pending" oneof deliveryStatus { Pending pending = 3; Sent sent = 4; @@ -455,6 +465,7 @@ message DirectStoryReplyMessage { FilePointer longText = 2; } + // If unset, importers should ignore the message without throwing an error. oneof reply { TextReply textReply = 1; string emoji = 2; @@ -473,7 +484,7 @@ message PaymentNotification { message FailedTransaction { // Failed payments can't be synced from the ledger enum FailureReason { - GENERIC = 0; + GENERIC = 0; // A valid value -- reason unknown NETWORK = 1; INSUFFICIENT_FUNDS = 2; } @@ -482,7 +493,7 @@ message PaymentNotification { message Transaction { enum Status { - INITIAL = 0; + INITIAL = 0; // A valid value -- state unconfirmed SUBMITTED = 1; SUCCESSFUL = 2; } @@ -499,6 +510,7 @@ message PaymentNotification { optional bytes receipt = 7; // mobile coin blobs } + // If unset, importers should treat the transaction as successful with no metadata. oneof payment { Transaction transaction = 1; FailedTransaction failedTransaction = 2; @@ -513,7 +525,7 @@ message PaymentNotification { message GiftBadge { enum State { - UNOPENED = 0; + UNOPENED = 0; // A valid state OPENED = 1; REDEEMED = 2; FAILED = 3; @@ -541,7 +553,7 @@ message ContactAttachment { message Phone { enum Type { - UNKNOWN = 0; + UNKNOWN = 0; // Interpret as "Home" HOME = 1; MOBILE = 2; WORK = 3; @@ -555,7 +567,7 @@ message ContactAttachment { message Email { enum Type { - UNKNOWN = 0; + UNKNOWN = 0; // Intepret as "Home" HOME = 1; MOBILE = 2; WORK = 3; @@ -569,7 +581,7 @@ message ContactAttachment { message PostalAddress { enum Type { - UNKNOWN = 0; + UNKNOWN = 0; // Interpret as "Home" HOME = 1; WORK = 2; CUSTOM = 3; @@ -629,7 +641,7 @@ message MessageAttachment { // but explicitly mutually exclusive. Note the different raw values // (non-zero starting values are not supported in proto3.) enum Flag { - NONE = 0; + NONE = 0; // A valid value -- no flag applied VOICE_MESSAGE = 1; BORDERLESS = 2; GIF = 3; @@ -680,6 +692,7 @@ message FilePointer { message InvalidAttachmentLocator { } + // If unset, importers should consider it to be an InvalidAttachmentLocator without throwing an error. oneof locator { BackupLocator backupLocator = 1; AttachmentLocator attachmentLocator = 2; @@ -698,7 +711,7 @@ message FilePointer { message Quote { enum Type { - UNKNOWN = 0; + UNKNOWN = 0; // Interpret as "Normal" NORMAL = 1; GIFT_BADGE = 2; VIEW_ONCE = 3; @@ -719,7 +732,7 @@ message Quote { message BodyRange { enum Style { - NONE = 0; + NONE = 0; // Importers should ignore the body range without throwing an error. BOLD = 1; ITALIC = 2; SPOILER = 3; @@ -727,9 +740,12 @@ message BodyRange { MONOSPACE = 5; } - optional uint32 start = 1; - optional uint32 length = 2; + // 'start' and 'length' are measured in UTF-16 code units. + // They may refer to offsets in a longText attachment. + uint32 start = 1; + uint32 length = 2; + // If unset, importers should ignore the body range without throwing an error. oneof associatedValue { bytes mentionAci = 3; Style style = 4; @@ -746,6 +762,7 @@ message Reaction { } message ChatUpdateMessage { + // If unset, importers should ignore the update message without throwing an error. oneof update { SimpleChatUpdate simpleUpdate = 1; GroupChangeChatUpdate groupChange = 2; @@ -761,19 +778,19 @@ message ChatUpdateMessage { message IndividualCall { enum Type { - UNKNOWN_TYPE = 0; + UNKNOWN_TYPE = 0; // Interpret as "Audio call" AUDIO_CALL = 1; VIDEO_CALL = 2; } enum Direction { - UNKNOWN_DIRECTION = 0; + UNKNOWN_DIRECTION = 0; // Interpret as "Incoming" INCOMING = 1; OUTGOING = 2; } enum State { - UNKNOWN_STATE = 0; + UNKNOWN_STATE = 0; // Interpret as "Accepted" ACCEPTED = 1; NOT_ACCEPTED = 2; // An incoming call that is no longer ongoing, which we neither accepted @@ -794,7 +811,7 @@ message IndividualCall { message GroupCall { enum State { - UNKNOWN_STATE = 0; + UNKNOWN_STATE = 0; // Interpret as "Generic" // A group call was started without ringing. GENERIC = 1; // We joined a group call that was started without ringing. @@ -825,7 +842,7 @@ message GroupCall { message SimpleChatUpdate { enum Type { - UNKNOWN = 0; + UNKNOWN = 0; // Importers should skip the update without throwing an error. JOINED_SIGNAL = 1; IDENTITY_UPDATE = 2; IDENTITY_VERIFIED = 3; @@ -859,6 +876,7 @@ message ProfileChangeChatUpdate { } message LearnedProfileChatUpdate { + // If unset, importers should consider the previous name to be an empty string. oneof previousName { uint64 e164 = 1; string username = 2; @@ -875,6 +893,7 @@ message SessionSwitchoverChatUpdate { message GroupChangeChatUpdate { message Update { + // If unset, importers should consider it to be a GenericGroupUpdate with unset updaterAci oneof update { GenericGroupUpdate genericGroupUpdate = 1; GroupCreationUpdate groupCreationUpdate = 2; @@ -944,7 +963,7 @@ message GroupDescriptionUpdate { } enum GroupV2AccessLevel { - UNKNOWN = 0; + UNKNOWN = 0; // Interpret as "Unsatisfiable" ANY = 1; MEMBER = 2; ADMINISTRATOR = 3; @@ -1134,6 +1153,7 @@ message ChatStyle { message CustomChatColor { uint64 id = 1; + // If unset, use the default chat color oneof color { fixed32 solid = 2; // 0xAARRGGBB Gradient gradient = 3; @@ -1144,7 +1164,7 @@ message ChatStyle { } enum WallpaperPreset { - UNKNOWN_WALLPAPER_PRESET = 0; + UNKNOWN_WALLPAPER_PRESET = 0; // Interpret as the wallpaper being unset SOLID_BLUSH = 1; SOLID_COPPER = 2; SOLID_DUST = 3; @@ -1169,7 +1189,7 @@ message ChatStyle { } enum BubbleColorPreset { - UNKNOWN_BUBBLE_COLOR_PRESET = 0; + UNKNOWN_BUBBLE_COLOR_PRESET = 0; // Interpret as the user's default chat bubble color SOLID_ULTRAMARINE = 1; SOLID_CRIMSON = 2; SOLID_VERMILION = 3; @@ -1194,6 +1214,7 @@ message ChatStyle { GRADIENT_TANGERINE = 22; } + // If unset, importers should consider there to be no wallpaper. oneof wallpaper { WallpaperPreset wallpaperPreset = 1; // This `FilePointer` is expected not to contain a `fileName`, `width`, @@ -1201,6 +1222,7 @@ message ChatStyle { FilePointer wallpaperPhoto = 2; } + // If unset, importers should consider it to be AutomaticBubbleColor oneof bubbleColor { // Bubble setting is automatically determined based on the wallpaper setting, // or `SOLID_ULTRAMARINE` for `noWallpaper` @@ -1216,7 +1238,7 @@ message ChatStyle { message NotificationProfile { enum DayOfWeek { - UNKNOWN = 0; + UNKNOWN = 0; // Interpret as "Monday" MONDAY = 1; TUESDAY = 2; WEDNESDAY = 3; @@ -1242,7 +1264,7 @@ message NotificationProfile { message ChatFolder { // Represents the default "All chats" folder record vs all other custom folders enum FolderType { - UNKNOWN = 0; + UNKNOWN = 0; // Interpret as "Custom" ALL = 1; CUSTOM = 2; } @@ -1257,4 +1279,4 @@ message ChatFolder { FolderType folderType = 6; repeated uint64 includedRecipientIds = 7; // generated recipient id of groups, contacts, and/or note to self repeated uint64 excludedRecipientIds = 8; // generated recipient id of groups, contacts, and/or note to self -} +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 66cd33e277..8696aa2b40 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ androidx-window = "1.3.0" glide = "4.15.1" gradle = "8.7.3" kotlin = "2.1.0" -libsignal-client = "0.65.2" +libsignal-client = "0.65.4" mp4parser = "1.9.39" android-gradle-plugin = "8.7.2" accompanist = "0.28.0" diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 0e53bee0f7..ef441f32b4 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -6604,20 +6604,20 @@ https://docs.gradle.org/current/userguide/dependency_verification.html - - - + + + - - + + - - - + + + - - + +