commit 9f113b4952d264e83f1e9c93d81f04761acb48bf Author: Samuel Date: Sat Dec 21 15:05:51 2024 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3ed9c74 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +target +out \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..ca1f123 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,774 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-modes" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e2211b0817f061502a8dd9f11a37e879e79763e3c698d2418cf824d8cb2f21e" + +[[package]] +name = "bytes" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cpufeatures" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "hashlink" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +dependencies = [ + "hashbrown 0.14.5", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "indexmap" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libsqlite3-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" +dependencies = [ + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f3e5beed80eb580c68e2c600937ac2c4eedabdfd5ef1e5b7ea4f3fba84497b" +dependencies = [ + "heck", + "itertools", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2f1e56baa61e93533aebc21af4d2134b70f66275e0fcdf3cbe43d77ff7e8fc" +dependencies = [ + "prost", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rpassword" +version = "7.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" +dependencies = [ + "libc", + "rtoolbox", + "windows-sys 0.48.0", +] + +[[package]] +name = "rtoolbox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "rusqlite" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e" +dependencies = [ + "bitflags", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", +] + +[[package]] +name = "rustix" +version = "0.38.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "serde" +version = "1.0.216" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.216" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.133" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signal-decrypt-backup-rust" +version = "0.1.0" +dependencies = [ + "aes", + "base64", + "block-modes", + "cipher", + "ctr", + "hkdf", + "hmac", + "prost", + "prost-build", + "prost-types", + "rpassword", + "rusqlite", + "serde_json", + "sha2", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +dependencies = [ + "cfg-if", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..b693a4b --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "signal-decrypt-backup-rust" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[build-dependencies] +prost-build = "0.13.4" + +[dependencies] +aes = "0.8" +block-modes = "0.9" +hmac = "0.12" +sha2 = "0.10" +serde_json = "1.0" +hkdf = "0.12.4" +base64 = "0.22.1" +rusqlite = "0.32.1" +rpassword = "7.3.1" +prost = "0.13.4" +prost-types = "0.13.4" +ctr = "0.9.2" +cipher = "0.4.4" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..9e3a5b0 --- /dev/null +++ b/build.rs @@ -0,0 +1,29 @@ +// use protobuf_codegen::Codegen; + +// fn main() { +// // Specify the path to your .proto file +// let proto_file = "./src/Backups.proto"; // Adjust the path accordingly + +// // Generate Rust code from the .proto file +// Codegen::new() +// .out_dir("./src/proto") // Output directory for generated code +// .inputs(&[proto_file]) +// .include("./src") // Include path for imports +// .run() +// .expect("protoc failed."); +// } + +use std::io::Result; + +fn main() -> Result<()> { + // Specify the path to your .proto files + let proto_files = &["src/Backups.proto"]; // Adjust the path as necessary + + // Specify the output directory + let _out_dir = [std::env::var("OUT_DIR").unwrap()]; + + // Compile the proto files + prost_build::compile_protos(proto_files, &["src"]).unwrap(); + + Ok(()) +} diff --git a/src/Backups.proto b/src/Backups.proto new file mode 100644 index 0000000..492c9d6 --- /dev/null +++ b/src/Backups.proto @@ -0,0 +1,82 @@ +/** + * Copyright (C) 2018 Open Whisper Systems + * + * Licensed according to the LICENSE file in this repository. + */ + +syntax = "proto2"; + +package signal; + +option java_package = "org.thoughtcrime.securesms.backup.proto"; + +message SqlStatement { + message SqlParameter { + optional string stringParamter = 1; + optional uint64 integerParameter = 2; + optional double doubleParameter = 3; + optional bytes blobParameter = 4; + optional bool nullparameter = 5; + } + + optional string statement = 1; + repeated SqlParameter parameters = 2; +} + +message SharedPreference { + optional string file = 1; + optional string key = 2; + optional string value = 3; + optional bool booleanValue = 4; + repeated string stringSetValue = 5; + optional bool isStringSetValue = 6; +} + +message Attachment { + optional uint64 rowId = 1; + optional uint64 attachmentId = 2; + optional uint32 length = 3; +} + +message Sticker { + optional uint64 rowId = 1; + optional uint32 length = 2; +} + +message Avatar { + optional string name = 1; + optional string recipientId = 3; + optional uint32 length = 2; +} + +message DatabaseVersion { + optional uint32 version = 1; +} + +message Header { + optional bytes iv = 1; + optional bytes salt = 2; + optional uint32 version = 3; +} + +message KeyValue { + optional string key = 1; + optional bytes blobValue = 2; + optional bool booleanValue = 3; + optional float floatValue = 4; + optional int32 integerValue = 5; + optional int64 longValue = 6; + optional string stringValue = 7; +} + +message BackupFrame { + optional Header header = 1; + optional SqlStatement statement = 2; + optional SharedPreference preference = 3; + optional Attachment attachment = 4; + optional DatabaseVersion version = 5; + optional bool end = 6; + optional Avatar avatar = 7; + optional Sticker sticker = 8; + optional KeyValue keyValue = 9; +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..b563ea9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,490 @@ +use std::collections::HashMap; +use std::fs::{self, File}; +use std::io::{self, BufReader, Read, Seek, SeekFrom, Write}; +use std::path::Path; + +use aes::Aes256; +use base64::prelude::*; +use ctr::cipher::{KeyIvInit, StreamCipher}; +use ctr::Ctr32BE; +use hkdf::Hkdf; +use hmac::{Hmac, Mac}; +use prost::Message; +use rusqlite::{Connection, TransactionBehavior}; +use sha2::{Digest, Sha256, Sha512}; + +type HmacSha256 = Hmac; + +pub mod signal { + include!(concat!(env!("OUT_DIR"), "/signal.rs")); +} + +use signal::BackupFrame; + +#[derive(Debug)] +struct HeaderData { + initialisation_vector: Vec, + salt: Vec, + version: Option, +} + +#[derive(Debug)] +struct Keys { + cipher_key: Vec, + hmac_key: Vec, +} + +fn to_io_error(e: rusqlite::Error) -> io::Error { + io::Error::new(io::ErrorKind::Other, e.to_string()) +} + +fn read_backup_header(backup_file: &mut R) -> io::Result { + let mut length_bytes = [0u8; 4]; + backup_file.read_exact(&mut length_bytes)?; + let length = u32::from_be_bytes(length_bytes); + + let mut backup_frame_bytes = vec![0u8; length as usize]; + backup_file.read_exact(&mut backup_frame_bytes)?; + + let backup_frame: BackupFrame = BackupFrame::decode(&backup_frame_bytes[..])?; + + let header = backup_frame + .header + .ok_or_else(|| io::Error::new(io::ErrorKind::InvalidData, "Missing header"))?; + + Ok(HeaderData { + initialisation_vector: header.iv.unwrap(), + salt: header.salt.unwrap(), + version: header.version, + }) +} + +fn derive_keys(passphrase: &str, salt: &[u8]) -> io::Result { + let passphrase_bytes = passphrase.replace(" ", "").as_bytes().to_vec(); + + let mut hash = passphrase_bytes.clone(); + let mut sha512 = Sha512::new(); + + Digest::update(&mut sha512, salt); + + for _ in 0..250000 { + Digest::update(&mut sha512, &hash); + Digest::update(&mut sha512, &passphrase_bytes); + hash = sha512.finalize_reset().to_vec(); + } + + let hkdf = Hkdf::::new(Some(b""), &hash[..32]); + let mut keys = vec![0u8; 64]; + hkdf.expand(b"Backup Export", &mut keys) + .map_err(|_| io::Error::new(io::ErrorKind::InvalidData, "HKDF expand failed"))?; + + Ok(Keys { + cipher_key: keys[..32].to_vec(), + hmac_key: keys[32..].to_vec(), + }) +} + +fn increment_initialisation_vector(initialisation_vector: &[u8]) -> Vec { + let mut counter = u32::from_be_bytes(initialisation_vector[..4].try_into().unwrap()); + counter = (counter + 1) & 0xFFFFFFFF; + let mut new_iv = counter.to_be_bytes().to_vec(); + new_iv.extend_from_slice(&initialisation_vector[4..]); + new_iv +} + +fn parameter_to_native_type( + parameter: &signal::sql_statement::SqlParameter, +) -> rusqlite::Result>> { + if let Some(s) = ¶meter.string_paramter { + Ok(Some(Box::new(s.clone()))) + } else if let Some(i) = parameter.integer_parameter { + let signed_i = if i & (1 << 63) != 0 { + i | (-1_i64 << 63) as u64 + } else { + i + }; + Ok(Some(Box::new(signed_i as i64))) + } else if let Some(d) = parameter.double_parameter { + Ok(Some(Box::new(d))) + } else if let Some(b) = ¶meter.blob_parameter { + Ok(Some(Box::new(b.clone()))) + } else if parameter.nullparameter.is_some() { + Ok(None) + } else { + Ok(None) + } +} +fn decrypt_frame( + backup_file: &mut R, + hmac_key: &[u8], + cipher_key: &[u8], + initialisation_vector: &[u8], + header_version: Option, + ciphertext_buf: &mut Vec, + plaintext_buf: &mut Vec, +) -> io::Result { + let mut hmac = ::new_from_slice(hmac_key) + .map_err(|_| io::Error::new(io::ErrorKind::InvalidData, "Invalid HMAC key"))?; + + let mut ctr = + as KeyIvInit>::new_from_slices(cipher_key, initialisation_vector) + .map_err(|_| io::Error::new(io::ErrorKind::InvalidData, "Invalid CTR parameters"))?; + + let length = match header_version { + None => { + let mut length_bytes = [0u8; 4]; + backup_file.read_exact(&mut length_bytes)?; + u32::from_be_bytes(length_bytes) + } + Some(1) => { + let mut encrypted_length = [0u8; 4]; + backup_file.read_exact(&mut encrypted_length)?; + Mac::update(&mut hmac, &encrypted_length); + + let mut decrypted_length = encrypted_length; + ctr.apply_keystream(&mut decrypted_length); + u32::from_be_bytes(decrypted_length) + } + Some(v) => { + return Err(io::Error::new( + io::ErrorKind::InvalidData, + format!("Unsupported version: {}", v), + )) + } + }; + + if length < 10 { + return Err(io::Error::new( + io::ErrorKind::InvalidData, + "Frame too short", + )); + } + + ciphertext_buf.clear(); + ciphertext_buf.resize((length - 10) as usize, 0); + backup_file.read_exact(ciphertext_buf)?; + + let mut their_mac = [0u8; 10]; + backup_file.read_exact(&mut their_mac)?; + + Mac::update(&mut hmac, ciphertext_buf); + let our_mac = hmac.finalize().into_bytes(); + + if their_mac != our_mac[..10] { + return Err(io::Error::new( + io::ErrorKind::InvalidData, + "MAC verification failed", + )); + } + + plaintext_buf.clear(); + plaintext_buf.extend_from_slice(ciphertext_buf); + ctr.apply_keystream(plaintext_buf); + + BackupFrame::decode(&plaintext_buf[..]) + .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e)) +} + +fn decrypt_frame_payload( + backup_file: &mut R, + length: usize, + hmac_key: &[u8], + cipher_key: &[u8], + initialisation_vector: &[u8], + chunk_size: usize, +) -> io::Result> { + let mut hmac = ::new_from_slice(hmac_key) + .map_err(|_| io::Error::new(io::ErrorKind::InvalidData, "Invalid HMAC key"))?; + Mac::update(&mut hmac, initialisation_vector); + + let mut ctr = + as KeyIvInit>::new_from_slices(cipher_key, initialisation_vector) + .map_err(|_| io::Error::new(io::ErrorKind::InvalidData, "Invalid CTR parameters"))?; + + let mut decrypted_data = Vec::new(); + let mut remaining_length = length; + + while remaining_length > 0 { + let this_chunk_length = remaining_length.min(chunk_size); + remaining_length -= this_chunk_length; + + let mut ciphertext = vec![0u8; this_chunk_length]; + backup_file.read_exact(&mut ciphertext)?; + Mac::update(&mut hmac, &ciphertext); + + let mut decrypted_chunk = ciphertext; + ctr.apply_keystream(&mut decrypted_chunk); + decrypted_data.extend(decrypted_chunk); + } + + let mut their_mac = [0u8; 10]; + backup_file.read_exact(&mut their_mac)?; + let our_mac = hmac.finalize().into_bytes(); + + if &their_mac != &our_mac[..10] { + return Err(io::Error::new( + io::ErrorKind::InvalidData, + "Bad MAC found. Passphrase may be incorrect or file corrupted or incompatible.", + )); + } + + Ok(decrypted_data) +} + +fn decrypt_backup( + backup_file: &mut R, + passphrase: &str, + output_directory: &Path, +) -> io::Result<()> +where + R: Read + Seek, +{ + let mut backup_file = BufReader::with_capacity(32 * 1024, backup_file); + let total_size = backup_file.seek(SeekFrom::End(0))?; + backup_file.seek(SeekFrom::Start(0))?; + let mut last_percentage = 0; + + let database_filename = output_directory.join("database.sqlite"); + let preferences_filename = output_directory.join("preferences.json"); + let key_value_filename = output_directory.join("key_value.json"); + let attachments_directory = output_directory.join("attachments"); + let stickers_directory = output_directory.join("stickers"); + let avatars_directory = output_directory.join("avatars"); + + for directory in [ + output_directory, + &attachments_directory, + &stickers_directory, + &avatars_directory, + ] { + fs::create_dir_all(directory)?; + } + + if database_filename.exists() { + fs::remove_file(&database_filename)?; + } + + let mut db_connection = Connection::open(&database_filename).map_err(to_io_error)?; + + db_connection + .execute_batch( + "PRAGMA journal_mode = WAL; + PRAGMA synchronous = NORMAL; + PRAGMA temp_store = MEMORY; + PRAGMA mmap_size = 30000000000; + PRAGMA page_size = 4096;", + ) + .map_err(to_io_error)?; + + let tx = db_connection + .transaction_with_behavior(TransactionBehavior::Immediate) + .map_err(to_io_error)?; + + let mut preferences: HashMap>> = + HashMap::new(); + let mut key_values: HashMap> = HashMap::new(); + + let header_data = read_backup_header(&mut backup_file)?; + let keys = derive_keys(passphrase, &header_data.salt)?; + let mut initialisation_vector = header_data.initialisation_vector.clone(); + + let mut ciphertext: Vec = Vec::with_capacity(1024 * 1024); + let mut plaintext: Vec = Vec::with_capacity(1024 * 1024); + + loop { + let current_position = backup_file.stream_position()?; + let percentage = ((current_position as f64 / total_size as f64) * 100.0) as u32; + if percentage != last_percentage { + eprintln!("Progress: {}%", percentage); + last_percentage = percentage; + } + + let backup_frame = decrypt_frame( + &mut backup_file, + &keys.hmac_key, + &keys.cipher_key, + &initialisation_vector, + header_data.version, + &mut ciphertext, + &mut plaintext, + )?; + + initialisation_vector = increment_initialisation_vector(&initialisation_vector); + + if backup_frame.end.unwrap_or(false) { + break; + } else if let Some(version) = backup_frame.version { + if let Some(ver_num) = version.version { + let pragma_sql = format!("PRAGMA user_version = {}", ver_num); + tx.execute_batch(&pragma_sql).map_err(to_io_error)?; + } + } else if let Some(statement) = backup_frame.statement { + if let Some(sql) = statement.statement { + if !sql.to_lowercase().starts_with("create table sqlite_") + && !sql.contains("sms_fts_") + && !sql.contains("mms_fts_") + { + let params: Vec>> = statement + .parameters + .iter() + .map(parameter_to_native_type) + .collect::>() + .map_err(to_io_error)?; + + tx.execute( + &sql, + rusqlite::params_from_iter(params.iter().map(|p| p.as_deref())), + ) + .map_err(to_io_error)?; + } + } + } else if let Some(preference) = backup_frame.preference { + let value_dict = preferences + .entry(preference.file.unwrap_or_default()) + .or_default() + .entry(preference.key.unwrap_or_default()) + .or_default(); + + if let Some(value) = preference.value { + value_dict.insert("value".to_string(), serde_json::Value::String(value)); + } + if let Some(boolean_value) = preference.boolean_value { + value_dict.insert( + "booleanValue".to_string(), + serde_json::Value::Bool(boolean_value), + ); + } + if preference.is_string_set_value.unwrap_or(false) { + value_dict.insert( + "stringSetValue".to_string(), + serde_json::Value::Array( + preference + .string_set_value + .into_iter() + .map(serde_json::Value::String) + .collect(), + ), + ); + } + } else if let Some(key_value) = backup_frame.key_value { + let value_dict = key_values + .entry(key_value.key.unwrap_or_default()) + .or_default(); + + if let Some(boolean_value) = key_value.boolean_value { + value_dict.insert( + "booleanValue".to_string(), + serde_json::Value::Bool(boolean_value), + ); + } + if let Some(float_value) = key_value.float_value { + value_dict.insert( + "floatValue".to_string(), + serde_json::Value::Number( + serde_json::Number::from_f64(float_value.into()).unwrap(), + ), + ); + } + if let Some(integer_value) = key_value.integer_value { + value_dict.insert( + "integerValue".to_string(), + serde_json::Value::Number(integer_value.into()), + ); + } + if let Some(long_value) = key_value.long_value { + value_dict.insert( + "longValue".to_string(), + serde_json::Value::Number(long_value.into()), + ); + } + if let Some(string_value) = key_value.string_value { + value_dict.insert( + "stringValue".to_string(), + serde_json::Value::String(string_value), + ); + } + if let Some(blob_value) = key_value.blob_value { + value_dict.insert( + "blobValueBase64".to_string(), + serde_json::Value::String(BASE64_STANDARD.encode(&blob_value)), + ); + } + } else { + let (filename, length) = if let Some(attachment) = backup_frame.attachment { + ( + attachments_directory.join(format!("{}.bin", attachment.row_id.unwrap_or(0))), + attachment.length.unwrap_or(0), + ) + } else if let Some(sticker) = backup_frame.sticker { + ( + stickers_directory.join(format!("{}.bin", sticker.row_id.unwrap_or(0))), + sticker.length.unwrap_or(0), + ) + } else if let Some(avatar) = backup_frame.avatar { + ( + avatars_directory + .join(format!("{}.bin", avatar.recipient_id.unwrap_or_default())), + avatar.length.unwrap_or(0), + ) + } else { + return Err(io::Error::new( + io::ErrorKind::InvalidData, + "Invalid field type found", + )); + }; + + let mut file = File::create(&filename)?; + let payload = decrypt_frame_payload( + &mut backup_file, + length as usize, + &keys.hmac_key, + &keys.cipher_key, + &initialisation_vector, + 8 * 1024, + )?; + file.write_all(&payload)?; + initialisation_vector = increment_initialisation_vector(&initialisation_vector); + } + } + + tx.commit().map_err(to_io_error)?; + + let mut preferences_file = File::create(preferences_filename)?; + serde_json::to_writer_pretty(&mut preferences_file, &preferences) + .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?; + + let mut key_values_file = File::create(key_value_filename)?; + serde_json::to_writer_pretty(&mut key_values_file, &key_values) + .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?; + + Ok(()) +} + +fn main() -> io::Result<()> { + let args: Vec = std::env::args().collect(); + if args.len() < 2 { + eprintln!( + "Usage: {} [output_directory] [-p PASSPHRASE]", + args[0] + ); + std::process::exit(1); + } + + let backup_file_path = &args[1]; + let output_directory = if args.len() > 2 { + Path::new(&args[2]).to_path_buf() + } else { + Path::new("./out").to_path_buf() + }; + + let passphrase = if let Some(pos) = args.iter().position(|arg| arg == "-p") { + args.get(pos + 1).expect("Passphrase not provided").clone() + } else { + rpassword::prompt_password("Backup passphrase: ").expect("Failed to read passphrase") + }; + + let mut backup_file = File::open(backup_file_path)?; + decrypt_backup(&mut backup_file, &passphrase, &output_directory)?; + + Ok(()) +} diff --git a/src/proto/Backups.rs b/src/proto/Backups.rs new file mode 100644 index 0000000..545a541 --- /dev/null +++ b/src/proto/Backups.rs @@ -0,0 +1,2705 @@ +// This file is generated by rust-protobuf 3.7.1. Do not edit +// .proto file is parsed by protoc 3.12.4 +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `Backups.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_1; + +// @@protoc_insertion_point(message:signal.SqlStatement) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SqlStatement { + // message fields + // @@protoc_insertion_point(field:signal.SqlStatement.statement) + pub statement: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:signal.SqlStatement.parameters) + pub parameters: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:signal.SqlStatement.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SqlStatement { + fn default() -> &'a SqlStatement { + ::default_instance() + } +} + +impl SqlStatement { + pub fn new() -> SqlStatement { + ::std::default::Default::default() + } + + // optional string statement = 1; + + pub fn statement(&self) -> &str { + match self.statement.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_statement(&mut self) { + self.statement = ::std::option::Option::None; + } + + pub fn has_statement(&self) -> bool { + self.statement.is_some() + } + + // Param is passed by value, moved + pub fn set_statement(&mut self, v: ::std::string::String) { + self.statement = ::std::option::Option::Some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_statement(&mut self) -> &mut ::std::string::String { + if self.statement.is_none() { + self.statement = ::std::option::Option::Some(::std::string::String::new()); + } + self.statement.as_mut().unwrap() + } + + // Take field + pub fn take_statement(&mut self) -> ::std::string::String { + self.statement.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "statement", + |m: &SqlStatement| { &m.statement }, + |m: &mut SqlStatement| { &mut m.statement }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "parameters", + |m: &SqlStatement| { &m.parameters }, + |m: &mut SqlStatement| { &mut m.parameters }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SqlStatement", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SqlStatement { + const NAME: &'static str = "SqlStatement"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.statement = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.parameters.push(is.read_message()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.statement.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + for value in &self.parameters { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.statement.as_ref() { + os.write_string(1, v)?; + } + for v in &self.parameters { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + }; + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> SqlStatement { + SqlStatement::new() + } + + fn clear(&mut self) { + self.statement = ::std::option::Option::None; + self.parameters.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static SqlStatement { + static instance: SqlStatement = SqlStatement { + statement: ::std::option::Option::None, + parameters: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SqlStatement { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("SqlStatement").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SqlStatement { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SqlStatement { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `SqlStatement` +pub mod sql_statement { + // @@protoc_insertion_point(message:signal.SqlStatement.SqlParameter) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct SqlParameter { + // message fields + // @@protoc_insertion_point(field:signal.SqlStatement.SqlParameter.stringParamter) + pub stringParamter: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:signal.SqlStatement.SqlParameter.integerParameter) + pub integerParameter: ::std::option::Option, + // @@protoc_insertion_point(field:signal.SqlStatement.SqlParameter.doubleParameter) + pub doubleParameter: ::std::option::Option, + // @@protoc_insertion_point(field:signal.SqlStatement.SqlParameter.blobParameter) + pub blobParameter: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:signal.SqlStatement.SqlParameter.nullparameter) + pub nullparameter: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:signal.SqlStatement.SqlParameter.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a SqlParameter { + fn default() -> &'a SqlParameter { + ::default_instance() + } + } + + impl SqlParameter { + pub fn new() -> SqlParameter { + ::std::default::Default::default() + } + + // optional string stringParamter = 1; + + pub fn stringParamter(&self) -> &str { + match self.stringParamter.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_stringParamter(&mut self) { + self.stringParamter = ::std::option::Option::None; + } + + pub fn has_stringParamter(&self) -> bool { + self.stringParamter.is_some() + } + + // Param is passed by value, moved + pub fn set_stringParamter(&mut self, v: ::std::string::String) { + self.stringParamter = ::std::option::Option::Some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_stringParamter(&mut self) -> &mut ::std::string::String { + if self.stringParamter.is_none() { + self.stringParamter = ::std::option::Option::Some(::std::string::String::new()); + } + self.stringParamter.as_mut().unwrap() + } + + // Take field + pub fn take_stringParamter(&mut self) -> ::std::string::String { + self.stringParamter.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint64 integerParameter = 2; + + pub fn integerParameter(&self) -> u64 { + self.integerParameter.unwrap_or(0) + } + + pub fn clear_integerParameter(&mut self) { + self.integerParameter = ::std::option::Option::None; + } + + pub fn has_integerParameter(&self) -> bool { + self.integerParameter.is_some() + } + + // Param is passed by value, moved + pub fn set_integerParameter(&mut self, v: u64) { + self.integerParameter = ::std::option::Option::Some(v); + } + + // optional double doubleParameter = 3; + + pub fn doubleParameter(&self) -> f64 { + self.doubleParameter.unwrap_or(0.) + } + + pub fn clear_doubleParameter(&mut self) { + self.doubleParameter = ::std::option::Option::None; + } + + pub fn has_doubleParameter(&self) -> bool { + self.doubleParameter.is_some() + } + + // Param is passed by value, moved + pub fn set_doubleParameter(&mut self, v: f64) { + self.doubleParameter = ::std::option::Option::Some(v); + } + + // optional bytes blobParameter = 4; + + pub fn blobParameter(&self) -> &[u8] { + match self.blobParameter.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_blobParameter(&mut self) { + self.blobParameter = ::std::option::Option::None; + } + + pub fn has_blobParameter(&self) -> bool { + self.blobParameter.is_some() + } + + // Param is passed by value, moved + pub fn set_blobParameter(&mut self, v: ::std::vec::Vec) { + self.blobParameter = ::std::option::Option::Some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_blobParameter(&mut self) -> &mut ::std::vec::Vec { + if self.blobParameter.is_none() { + self.blobParameter = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.blobParameter.as_mut().unwrap() + } + + // Take field + pub fn take_blobParameter(&mut self) -> ::std::vec::Vec { + self.blobParameter.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool nullparameter = 5; + + pub fn nullparameter(&self) -> bool { + self.nullparameter.unwrap_or(false) + } + + pub fn clear_nullparameter(&mut self) { + self.nullparameter = ::std::option::Option::None; + } + + pub fn has_nullparameter(&self) -> bool { + self.nullparameter.is_some() + } + + // Param is passed by value, moved + pub fn set_nullparameter(&mut self, v: bool) { + self.nullparameter = ::std::option::Option::Some(v); + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(5); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "stringParamter", + |m: &SqlParameter| { &m.stringParamter }, + |m: &mut SqlParameter| { &mut m.stringParamter }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "integerParameter", + |m: &SqlParameter| { &m.integerParameter }, + |m: &mut SqlParameter| { &mut m.integerParameter }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "doubleParameter", + |m: &SqlParameter| { &m.doubleParameter }, + |m: &mut SqlParameter| { &mut m.doubleParameter }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "blobParameter", + |m: &SqlParameter| { &m.blobParameter }, + |m: &mut SqlParameter| { &mut m.blobParameter }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "nullparameter", + |m: &SqlParameter| { &m.nullparameter }, + |m: &mut SqlParameter| { &mut m.nullparameter }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SqlStatement.SqlParameter", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for SqlParameter { + const NAME: &'static str = "SqlParameter"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.stringParamter = ::std::option::Option::Some(is.read_string()?); + }, + 16 => { + self.integerParameter = ::std::option::Option::Some(is.read_uint64()?); + }, + 25 => { + self.doubleParameter = ::std::option::Option::Some(is.read_double()?); + }, + 34 => { + self.blobParameter = ::std::option::Option::Some(is.read_bytes()?); + }, + 40 => { + self.nullparameter = ::std::option::Option::Some(is.read_bool()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.stringParamter.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.integerParameter { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.doubleParameter { + my_size += 1 + 8; + } + if let Some(v) = self.blobParameter.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.nullparameter { + my_size += 1 + 1; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.stringParamter.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.integerParameter { + os.write_uint64(2, v)?; + } + if let Some(v) = self.doubleParameter { + os.write_double(3, v)?; + } + if let Some(v) = self.blobParameter.as_ref() { + os.write_bytes(4, v)?; + } + if let Some(v) = self.nullparameter { + os.write_bool(5, v)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> SqlParameter { + SqlParameter::new() + } + + fn clear(&mut self) { + self.stringParamter = ::std::option::Option::None; + self.integerParameter = ::std::option::Option::None; + self.doubleParameter = ::std::option::Option::None; + self.blobParameter = ::std::option::Option::None; + self.nullparameter = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SqlParameter { + static instance: SqlParameter = SqlParameter { + stringParamter: ::std::option::Option::None, + integerParameter: ::std::option::Option::None, + doubleParameter: ::std::option::Option::None, + blobParameter: ::std::option::Option::None, + nullparameter: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for SqlParameter { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("SqlStatement.SqlParameter").unwrap()).clone() + } + } + + impl ::std::fmt::Display for SqlParameter { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for SqlParameter { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } +} + +// @@protoc_insertion_point(message:signal.SharedPreference) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SharedPreference { + // message fields + // @@protoc_insertion_point(field:signal.SharedPreference.file) + pub file: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:signal.SharedPreference.key) + pub key: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:signal.SharedPreference.value) + pub value: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:signal.SharedPreference.booleanValue) + pub booleanValue: ::std::option::Option, + // @@protoc_insertion_point(field:signal.SharedPreference.stringSetValue) + pub stringSetValue: ::std::vec::Vec<::std::string::String>, + // @@protoc_insertion_point(field:signal.SharedPreference.isStringSetValue) + pub isStringSetValue: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:signal.SharedPreference.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SharedPreference { + fn default() -> &'a SharedPreference { + ::default_instance() + } +} + +impl SharedPreference { + pub fn new() -> SharedPreference { + ::std::default::Default::default() + } + + // optional string file = 1; + + pub fn file(&self) -> &str { + match self.file.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_file(&mut self) { + self.file = ::std::option::Option::None; + } + + pub fn has_file(&self) -> bool { + self.file.is_some() + } + + // Param is passed by value, moved + pub fn set_file(&mut self, v: ::std::string::String) { + self.file = ::std::option::Option::Some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_file(&mut self) -> &mut ::std::string::String { + if self.file.is_none() { + self.file = ::std::option::Option::Some(::std::string::String::new()); + } + self.file.as_mut().unwrap() + } + + // Take field + pub fn take_file(&mut self) -> ::std::string::String { + self.file.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string key = 2; + + pub fn key(&self) -> &str { + match self.key.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_key(&mut self) { + self.key = ::std::option::Option::None; + } + + pub fn has_key(&self) -> bool { + self.key.is_some() + } + + // Param is passed by value, moved + pub fn set_key(&mut self, v: ::std::string::String) { + self.key = ::std::option::Option::Some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_key(&mut self) -> &mut ::std::string::String { + if self.key.is_none() { + self.key = ::std::option::Option::Some(::std::string::String::new()); + } + self.key.as_mut().unwrap() + } + + // Take field + pub fn take_key(&mut self) -> ::std::string::String { + self.key.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string value = 3; + + pub fn value(&self) -> &str { + match self.value.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_value(&mut self) { + self.value = ::std::option::Option::None; + } + + pub fn has_value(&self) -> bool { + self.value.is_some() + } + + // Param is passed by value, moved + pub fn set_value(&mut self, v: ::std::string::String) { + self.value = ::std::option::Option::Some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_value(&mut self) -> &mut ::std::string::String { + if self.value.is_none() { + self.value = ::std::option::Option::Some(::std::string::String::new()); + } + self.value.as_mut().unwrap() + } + + // Take field + pub fn take_value(&mut self) -> ::std::string::String { + self.value.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool booleanValue = 4; + + pub fn booleanValue(&self) -> bool { + self.booleanValue.unwrap_or(false) + } + + pub fn clear_booleanValue(&mut self) { + self.booleanValue = ::std::option::Option::None; + } + + pub fn has_booleanValue(&self) -> bool { + self.booleanValue.is_some() + } + + // Param is passed by value, moved + pub fn set_booleanValue(&mut self, v: bool) { + self.booleanValue = ::std::option::Option::Some(v); + } + + // optional bool isStringSetValue = 6; + + pub fn isStringSetValue(&self) -> bool { + self.isStringSetValue.unwrap_or(false) + } + + pub fn clear_isStringSetValue(&mut self) { + self.isStringSetValue = ::std::option::Option::None; + } + + pub fn has_isStringSetValue(&self) -> bool { + self.isStringSetValue.is_some() + } + + // Param is passed by value, moved + pub fn set_isStringSetValue(&mut self, v: bool) { + self.isStringSetValue = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "file", + |m: &SharedPreference| { &m.file }, + |m: &mut SharedPreference| { &mut m.file }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "key", + |m: &SharedPreference| { &m.key }, + |m: &mut SharedPreference| { &mut m.key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "value", + |m: &SharedPreference| { &m.value }, + |m: &mut SharedPreference| { &mut m.value }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "booleanValue", + |m: &SharedPreference| { &m.booleanValue }, + |m: &mut SharedPreference| { &mut m.booleanValue }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "stringSetValue", + |m: &SharedPreference| { &m.stringSetValue }, + |m: &mut SharedPreference| { &mut m.stringSetValue }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "isStringSetValue", + |m: &SharedPreference| { &m.isStringSetValue }, + |m: &mut SharedPreference| { &mut m.isStringSetValue }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SharedPreference", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SharedPreference { + const NAME: &'static str = "SharedPreference"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.file = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.key = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.value = ::std::option::Option::Some(is.read_string()?); + }, + 32 => { + self.booleanValue = ::std::option::Option::Some(is.read_bool()?); + }, + 42 => { + self.stringSetValue.push(is.read_string()?); + }, + 48 => { + self.isStringSetValue = ::std::option::Option::Some(is.read_bool()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.file.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.key.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.value.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.booleanValue { + my_size += 1 + 1; + } + for value in &self.stringSetValue { + my_size += ::protobuf::rt::string_size(5, &value); + }; + if let Some(v) = self.isStringSetValue { + my_size += 1 + 1; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.file.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.key.as_ref() { + os.write_string(2, v)?; + } + if let Some(v) = self.value.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.booleanValue { + os.write_bool(4, v)?; + } + for v in &self.stringSetValue { + os.write_string(5, &v)?; + }; + if let Some(v) = self.isStringSetValue { + os.write_bool(6, v)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> SharedPreference { + SharedPreference::new() + } + + fn clear(&mut self) { + self.file = ::std::option::Option::None; + self.key = ::std::option::Option::None; + self.value = ::std::option::Option::None; + self.booleanValue = ::std::option::Option::None; + self.stringSetValue.clear(); + self.isStringSetValue = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SharedPreference { + static instance: SharedPreference = SharedPreference { + file: ::std::option::Option::None, + key: ::std::option::Option::None, + value: ::std::option::Option::None, + booleanValue: ::std::option::Option::None, + stringSetValue: ::std::vec::Vec::new(), + isStringSetValue: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SharedPreference { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("SharedPreference").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SharedPreference { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SharedPreference { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:signal.Attachment) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Attachment { + // message fields + // @@protoc_insertion_point(field:signal.Attachment.rowId) + pub rowId: ::std::option::Option, + // @@protoc_insertion_point(field:signal.Attachment.attachmentId) + pub attachmentId: ::std::option::Option, + // @@protoc_insertion_point(field:signal.Attachment.length) + pub length: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:signal.Attachment.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Attachment { + fn default() -> &'a Attachment { + ::default_instance() + } +} + +impl Attachment { + pub fn new() -> Attachment { + ::std::default::Default::default() + } + + // optional uint64 rowId = 1; + + pub fn rowId(&self) -> u64 { + self.rowId.unwrap_or(0) + } + + pub fn clear_rowId(&mut self) { + self.rowId = ::std::option::Option::None; + } + + pub fn has_rowId(&self) -> bool { + self.rowId.is_some() + } + + // Param is passed by value, moved + pub fn set_rowId(&mut self, v: u64) { + self.rowId = ::std::option::Option::Some(v); + } + + // optional uint64 attachmentId = 2; + + pub fn attachmentId(&self) -> u64 { + self.attachmentId.unwrap_or(0) + } + + pub fn clear_attachmentId(&mut self) { + self.attachmentId = ::std::option::Option::None; + } + + pub fn has_attachmentId(&self) -> bool { + self.attachmentId.is_some() + } + + // Param is passed by value, moved + pub fn set_attachmentId(&mut self, v: u64) { + self.attachmentId = ::std::option::Option::Some(v); + } + + // optional uint32 length = 3; + + pub fn length(&self) -> u32 { + self.length.unwrap_or(0) + } + + pub fn clear_length(&mut self) { + self.length = ::std::option::Option::None; + } + + pub fn has_length(&self) -> bool { + self.length.is_some() + } + + // Param is passed by value, moved + pub fn set_length(&mut self, v: u32) { + self.length = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "rowId", + |m: &Attachment| { &m.rowId }, + |m: &mut Attachment| { &mut m.rowId }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "attachmentId", + |m: &Attachment| { &m.attachmentId }, + |m: &mut Attachment| { &mut m.attachmentId }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "length", + |m: &Attachment| { &m.length }, + |m: &mut Attachment| { &mut m.length }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Attachment", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Attachment { + const NAME: &'static str = "Attachment"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 8 => { + self.rowId = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.attachmentId = ::std::option::Option::Some(is.read_uint64()?); + }, + 24 => { + self.length = ::std::option::Option::Some(is.read_uint32()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.rowId { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.attachmentId { + my_size += ::protobuf::rt::uint64_size(2, v); + } + if let Some(v) = self.length { + my_size += ::protobuf::rt::uint32_size(3, v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.rowId { + os.write_uint64(1, v)?; + } + if let Some(v) = self.attachmentId { + os.write_uint64(2, v)?; + } + if let Some(v) = self.length { + os.write_uint32(3, v)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> Attachment { + Attachment::new() + } + + fn clear(&mut self) { + self.rowId = ::std::option::Option::None; + self.attachmentId = ::std::option::Option::None; + self.length = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Attachment { + static instance: Attachment = Attachment { + rowId: ::std::option::Option::None, + attachmentId: ::std::option::Option::None, + length: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Attachment { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("Attachment").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Attachment { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Attachment { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:signal.Sticker) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Sticker { + // message fields + // @@protoc_insertion_point(field:signal.Sticker.rowId) + pub rowId: ::std::option::Option, + // @@protoc_insertion_point(field:signal.Sticker.length) + pub length: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:signal.Sticker.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Sticker { + fn default() -> &'a Sticker { + ::default_instance() + } +} + +impl Sticker { + pub fn new() -> Sticker { + ::std::default::Default::default() + } + + // optional uint64 rowId = 1; + + pub fn rowId(&self) -> u64 { + self.rowId.unwrap_or(0) + } + + pub fn clear_rowId(&mut self) { + self.rowId = ::std::option::Option::None; + } + + pub fn has_rowId(&self) -> bool { + self.rowId.is_some() + } + + // Param is passed by value, moved + pub fn set_rowId(&mut self, v: u64) { + self.rowId = ::std::option::Option::Some(v); + } + + // optional uint32 length = 2; + + pub fn length(&self) -> u32 { + self.length.unwrap_or(0) + } + + pub fn clear_length(&mut self) { + self.length = ::std::option::Option::None; + } + + pub fn has_length(&self) -> bool { + self.length.is_some() + } + + // Param is passed by value, moved + pub fn set_length(&mut self, v: u32) { + self.length = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "rowId", + |m: &Sticker| { &m.rowId }, + |m: &mut Sticker| { &mut m.rowId }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "length", + |m: &Sticker| { &m.length }, + |m: &mut Sticker| { &mut m.length }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Sticker", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Sticker { + const NAME: &'static str = "Sticker"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 8 => { + self.rowId = ::std::option::Option::Some(is.read_uint64()?); + }, + 16 => { + self.length = ::std::option::Option::Some(is.read_uint32()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.rowId { + my_size += ::protobuf::rt::uint64_size(1, v); + } + if let Some(v) = self.length { + my_size += ::protobuf::rt::uint32_size(2, v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.rowId { + os.write_uint64(1, v)?; + } + if let Some(v) = self.length { + os.write_uint32(2, v)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> Sticker { + Sticker::new() + } + + fn clear(&mut self) { + self.rowId = ::std::option::Option::None; + self.length = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Sticker { + static instance: Sticker = Sticker { + rowId: ::std::option::Option::None, + length: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Sticker { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("Sticker").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Sticker { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Sticker { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:signal.Avatar) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Avatar { + // message fields + // @@protoc_insertion_point(field:signal.Avatar.name) + pub name: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:signal.Avatar.recipientId) + pub recipientId: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:signal.Avatar.length) + pub length: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:signal.Avatar.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Avatar { + fn default() -> &'a Avatar { + ::default_instance() + } +} + +impl Avatar { + pub fn new() -> Avatar { + ::std::default::Default::default() + } + + // optional string name = 1; + + pub fn name(&self) -> &str { + match self.name.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_name(&mut self) { + self.name = ::std::option::Option::None; + } + + pub fn has_name(&self) -> bool { + self.name.is_some() + } + + // Param is passed by value, moved + pub fn set_name(&mut self, v: ::std::string::String) { + self.name = ::std::option::Option::Some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_name(&mut self) -> &mut ::std::string::String { + if self.name.is_none() { + self.name = ::std::option::Option::Some(::std::string::String::new()); + } + self.name.as_mut().unwrap() + } + + // Take field + pub fn take_name(&mut self) -> ::std::string::String { + self.name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string recipientId = 3; + + pub fn recipientId(&self) -> &str { + match self.recipientId.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_recipientId(&mut self) { + self.recipientId = ::std::option::Option::None; + } + + pub fn has_recipientId(&self) -> bool { + self.recipientId.is_some() + } + + // Param is passed by value, moved + pub fn set_recipientId(&mut self, v: ::std::string::String) { + self.recipientId = ::std::option::Option::Some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_recipientId(&mut self) -> &mut ::std::string::String { + if self.recipientId.is_none() { + self.recipientId = ::std::option::Option::Some(::std::string::String::new()); + } + self.recipientId.as_mut().unwrap() + } + + // Take field + pub fn take_recipientId(&mut self) -> ::std::string::String { + self.recipientId.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional uint32 length = 2; + + pub fn length(&self) -> u32 { + self.length.unwrap_or(0) + } + + pub fn clear_length(&mut self) { + self.length = ::std::option::Option::None; + } + + pub fn has_length(&self) -> bool { + self.length.is_some() + } + + // Param is passed by value, moved + pub fn set_length(&mut self, v: u32) { + self.length = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "name", + |m: &Avatar| { &m.name }, + |m: &mut Avatar| { &mut m.name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "recipientId", + |m: &Avatar| { &m.recipientId }, + |m: &mut Avatar| { &mut m.recipientId }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "length", + |m: &Avatar| { &m.length }, + |m: &mut Avatar| { &mut m.length }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Avatar", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Avatar { + const NAME: &'static str = "Avatar"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.name = ::std::option::Option::Some(is.read_string()?); + }, + 26 => { + self.recipientId = ::std::option::Option::Some(is.read_string()?); + }, + 16 => { + self.length = ::std::option::Option::Some(is.read_uint32()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.name.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.recipientId.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.length { + my_size += ::protobuf::rt::uint32_size(2, v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.name.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.recipientId.as_ref() { + os.write_string(3, v)?; + } + if let Some(v) = self.length { + os.write_uint32(2, v)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> Avatar { + Avatar::new() + } + + fn clear(&mut self) { + self.name = ::std::option::Option::None; + self.recipientId = ::std::option::Option::None; + self.length = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Avatar { + static instance: Avatar = Avatar { + name: ::std::option::Option::None, + recipientId: ::std::option::Option::None, + length: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Avatar { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("Avatar").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Avatar { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Avatar { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:signal.DatabaseVersion) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DatabaseVersion { + // message fields + // @@protoc_insertion_point(field:signal.DatabaseVersion.version) + pub version: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:signal.DatabaseVersion.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DatabaseVersion { + fn default() -> &'a DatabaseVersion { + ::default_instance() + } +} + +impl DatabaseVersion { + pub fn new() -> DatabaseVersion { + ::std::default::Default::default() + } + + // optional uint32 version = 1; + + pub fn version(&self) -> u32 { + self.version.unwrap_or(0) + } + + pub fn clear_version(&mut self) { + self.version = ::std::option::Option::None; + } + + pub fn has_version(&self) -> bool { + self.version.is_some() + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: u32) { + self.version = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "version", + |m: &DatabaseVersion| { &m.version }, + |m: &mut DatabaseVersion| { &mut m.version }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DatabaseVersion", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DatabaseVersion { + const NAME: &'static str = "DatabaseVersion"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 8 => { + self.version = ::std::option::Option::Some(is.read_uint32()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.version { + my_size += ::protobuf::rt::uint32_size(1, v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.version { + os.write_uint32(1, v)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> DatabaseVersion { + DatabaseVersion::new() + } + + fn clear(&mut self) { + self.version = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DatabaseVersion { + static instance: DatabaseVersion = DatabaseVersion { + version: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DatabaseVersion { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("DatabaseVersion").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DatabaseVersion { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DatabaseVersion { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:signal.Header) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct Header { + // message fields + // @@protoc_insertion_point(field:signal.Header.iv) + pub iv: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:signal.Header.salt) + pub salt: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:signal.Header.version) + pub version: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:signal.Header.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Header { + fn default() -> &'a Header { +
::default_instance() + } +} + +impl Header { + pub fn new() -> Header { + ::std::default::Default::default() + } + + // optional bytes iv = 1; + + pub fn iv(&self) -> &[u8] { + match self.iv.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_iv(&mut self) { + self.iv = ::std::option::Option::None; + } + + pub fn has_iv(&self) -> bool { + self.iv.is_some() + } + + // Param is passed by value, moved + pub fn set_iv(&mut self, v: ::std::vec::Vec) { + self.iv = ::std::option::Option::Some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_iv(&mut self) -> &mut ::std::vec::Vec { + if self.iv.is_none() { + self.iv = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.iv.as_mut().unwrap() + } + + // Take field + pub fn take_iv(&mut self) -> ::std::vec::Vec { + self.iv.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bytes salt = 2; + + pub fn salt(&self) -> &[u8] { + match self.salt.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_salt(&mut self) { + self.salt = ::std::option::Option::None; + } + + pub fn has_salt(&self) -> bool { + self.salt.is_some() + } + + // Param is passed by value, moved + pub fn set_salt(&mut self, v: ::std::vec::Vec) { + self.salt = ::std::option::Option::Some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_salt(&mut self) -> &mut ::std::vec::Vec { + if self.salt.is_none() { + self.salt = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.salt.as_mut().unwrap() + } + + // Take field + pub fn take_salt(&mut self) -> ::std::vec::Vec { + self.salt.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional uint32 version = 3; + + pub fn version(&self) -> u32 { + self.version.unwrap_or(0) + } + + pub fn clear_version(&mut self) { + self.version = ::std::option::Option::None; + } + + pub fn has_version(&self) -> bool { + self.version.is_some() + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: u32) { + self.version = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "iv", + |m: &Header| { &m.iv }, + |m: &mut Header| { &mut m.iv }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "salt", + |m: &Header| { &m.salt }, + |m: &mut Header| { &mut m.salt }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "version", + |m: &Header| { &m.version }, + |m: &mut Header| { &mut m.version }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::
( + "Header", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Header { + const NAME: &'static str = "Header"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.iv = ::std::option::Option::Some(is.read_bytes()?); + }, + 18 => { + self.salt = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.version = ::std::option::Option::Some(is.read_uint32()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.iv.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.salt.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.version { + my_size += ::protobuf::rt::uint32_size(3, v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.iv.as_ref() { + os.write_bytes(1, v)?; + } + if let Some(v) = self.salt.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.version { + os.write_uint32(3, v)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> Header { + Header::new() + } + + fn clear(&mut self) { + self.iv = ::std::option::Option::None; + self.salt = ::std::option::Option::None; + self.version = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Header { + static instance: Header = Header { + iv: ::std::option::Option::None, + salt: ::std::option::Option::None, + version: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Header { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("Header").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Header { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Header { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:signal.KeyValue) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct KeyValue { + // message fields + // @@protoc_insertion_point(field:signal.KeyValue.key) + pub key: ::std::option::Option<::std::string::String>, + // @@protoc_insertion_point(field:signal.KeyValue.blobValue) + pub blobValue: ::std::option::Option<::std::vec::Vec>, + // @@protoc_insertion_point(field:signal.KeyValue.booleanValue) + pub booleanValue: ::std::option::Option, + // @@protoc_insertion_point(field:signal.KeyValue.floatValue) + pub floatValue: ::std::option::Option, + // @@protoc_insertion_point(field:signal.KeyValue.integerValue) + pub integerValue: ::std::option::Option, + // @@protoc_insertion_point(field:signal.KeyValue.longValue) + pub longValue: ::std::option::Option, + // @@protoc_insertion_point(field:signal.KeyValue.stringValue) + pub stringValue: ::std::option::Option<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:signal.KeyValue.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a KeyValue { + fn default() -> &'a KeyValue { + ::default_instance() + } +} + +impl KeyValue { + pub fn new() -> KeyValue { + ::std::default::Default::default() + } + + // optional string key = 1; + + pub fn key(&self) -> &str { + match self.key.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_key(&mut self) { + self.key = ::std::option::Option::None; + } + + pub fn has_key(&self) -> bool { + self.key.is_some() + } + + // Param is passed by value, moved + pub fn set_key(&mut self, v: ::std::string::String) { + self.key = ::std::option::Option::Some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_key(&mut self) -> &mut ::std::string::String { + if self.key.is_none() { + self.key = ::std::option::Option::Some(::std::string::String::new()); + } + self.key.as_mut().unwrap() + } + + // Take field + pub fn take_key(&mut self) -> ::std::string::String { + self.key.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bytes blobValue = 2; + + pub fn blobValue(&self) -> &[u8] { + match self.blobValue.as_ref() { + Some(v) => v, + None => &[], + } + } + + pub fn clear_blobValue(&mut self) { + self.blobValue = ::std::option::Option::None; + } + + pub fn has_blobValue(&self) -> bool { + self.blobValue.is_some() + } + + // Param is passed by value, moved + pub fn set_blobValue(&mut self, v: ::std::vec::Vec) { + self.blobValue = ::std::option::Option::Some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_blobValue(&mut self) -> &mut ::std::vec::Vec { + if self.blobValue.is_none() { + self.blobValue = ::std::option::Option::Some(::std::vec::Vec::new()); + } + self.blobValue.as_mut().unwrap() + } + + // Take field + pub fn take_blobValue(&mut self) -> ::std::vec::Vec { + self.blobValue.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional bool booleanValue = 3; + + pub fn booleanValue(&self) -> bool { + self.booleanValue.unwrap_or(false) + } + + pub fn clear_booleanValue(&mut self) { + self.booleanValue = ::std::option::Option::None; + } + + pub fn has_booleanValue(&self) -> bool { + self.booleanValue.is_some() + } + + // Param is passed by value, moved + pub fn set_booleanValue(&mut self, v: bool) { + self.booleanValue = ::std::option::Option::Some(v); + } + + // optional float floatValue = 4; + + pub fn floatValue(&self) -> f32 { + self.floatValue.unwrap_or(0.) + } + + pub fn clear_floatValue(&mut self) { + self.floatValue = ::std::option::Option::None; + } + + pub fn has_floatValue(&self) -> bool { + self.floatValue.is_some() + } + + // Param is passed by value, moved + pub fn set_floatValue(&mut self, v: f32) { + self.floatValue = ::std::option::Option::Some(v); + } + + // optional int32 integerValue = 5; + + pub fn integerValue(&self) -> i32 { + self.integerValue.unwrap_or(0) + } + + pub fn clear_integerValue(&mut self) { + self.integerValue = ::std::option::Option::None; + } + + pub fn has_integerValue(&self) -> bool { + self.integerValue.is_some() + } + + // Param is passed by value, moved + pub fn set_integerValue(&mut self, v: i32) { + self.integerValue = ::std::option::Option::Some(v); + } + + // optional int64 longValue = 6; + + pub fn longValue(&self) -> i64 { + self.longValue.unwrap_or(0) + } + + pub fn clear_longValue(&mut self) { + self.longValue = ::std::option::Option::None; + } + + pub fn has_longValue(&self) -> bool { + self.longValue.is_some() + } + + // Param is passed by value, moved + pub fn set_longValue(&mut self, v: i64) { + self.longValue = ::std::option::Option::Some(v); + } + + // optional string stringValue = 7; + + pub fn stringValue(&self) -> &str { + match self.stringValue.as_ref() { + Some(v) => v, + None => "", + } + } + + pub fn clear_stringValue(&mut self) { + self.stringValue = ::std::option::Option::None; + } + + pub fn has_stringValue(&self) -> bool { + self.stringValue.is_some() + } + + // Param is passed by value, moved + pub fn set_stringValue(&mut self, v: ::std::string::String) { + self.stringValue = ::std::option::Option::Some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_stringValue(&mut self) -> &mut ::std::string::String { + if self.stringValue.is_none() { + self.stringValue = ::std::option::Option::Some(::std::string::String::new()); + } + self.stringValue.as_mut().unwrap() + } + + // Take field + pub fn take_stringValue(&mut self) -> ::std::string::String { + self.stringValue.take().unwrap_or_else(|| ::std::string::String::new()) + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "key", + |m: &KeyValue| { &m.key }, + |m: &mut KeyValue| { &mut m.key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "blobValue", + |m: &KeyValue| { &m.blobValue }, + |m: &mut KeyValue| { &mut m.blobValue }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "booleanValue", + |m: &KeyValue| { &m.booleanValue }, + |m: &mut KeyValue| { &mut m.booleanValue }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "floatValue", + |m: &KeyValue| { &m.floatValue }, + |m: &mut KeyValue| { &mut m.floatValue }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "integerValue", + |m: &KeyValue| { &m.integerValue }, + |m: &mut KeyValue| { &mut m.integerValue }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "longValue", + |m: &KeyValue| { &m.longValue }, + |m: &mut KeyValue| { &mut m.longValue }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "stringValue", + |m: &KeyValue| { &m.stringValue }, + |m: &mut KeyValue| { &mut m.stringValue }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "KeyValue", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for KeyValue { + const NAME: &'static str = "KeyValue"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.key = ::std::option::Option::Some(is.read_string()?); + }, + 18 => { + self.blobValue = ::std::option::Option::Some(is.read_bytes()?); + }, + 24 => { + self.booleanValue = ::std::option::Option::Some(is.read_bool()?); + }, + 37 => { + self.floatValue = ::std::option::Option::Some(is.read_float()?); + }, + 40 => { + self.integerValue = ::std::option::Option::Some(is.read_int32()?); + }, + 48 => { + self.longValue = ::std::option::Option::Some(is.read_int64()?); + }, + 58 => { + self.stringValue = ::std::option::Option::Some(is.read_string()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.key.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.blobValue.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.booleanValue { + my_size += 1 + 1; + } + if let Some(v) = self.floatValue { + my_size += 1 + 4; + } + if let Some(v) = self.integerValue { + my_size += ::protobuf::rt::int32_size(5, v); + } + if let Some(v) = self.longValue { + my_size += ::protobuf::rt::int64_size(6, v); + } + if let Some(v) = self.stringValue.as_ref() { + my_size += ::protobuf::rt::string_size(7, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.key.as_ref() { + os.write_string(1, v)?; + } + if let Some(v) = self.blobValue.as_ref() { + os.write_bytes(2, v)?; + } + if let Some(v) = self.booleanValue { + os.write_bool(3, v)?; + } + if let Some(v) = self.floatValue { + os.write_float(4, v)?; + } + if let Some(v) = self.integerValue { + os.write_int32(5, v)?; + } + if let Some(v) = self.longValue { + os.write_int64(6, v)?; + } + if let Some(v) = self.stringValue.as_ref() { + os.write_string(7, v)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> KeyValue { + KeyValue::new() + } + + fn clear(&mut self) { + self.key = ::std::option::Option::None; + self.blobValue = ::std::option::Option::None; + self.booleanValue = ::std::option::Option::None; + self.floatValue = ::std::option::Option::None; + self.integerValue = ::std::option::Option::None; + self.longValue = ::std::option::Option::None; + self.stringValue = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static KeyValue { + static instance: KeyValue = KeyValue { + key: ::std::option::Option::None, + blobValue: ::std::option::Option::None, + booleanValue: ::std::option::Option::None, + floatValue: ::std::option::Option::None, + integerValue: ::std::option::Option::None, + longValue: ::std::option::Option::None, + stringValue: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for KeyValue { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("KeyValue").unwrap()).clone() + } +} + +impl ::std::fmt::Display for KeyValue { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for KeyValue { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:signal.BackupFrame) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct BackupFrame { + // message fields + // @@protoc_insertion_point(field:signal.BackupFrame.header) + pub header: ::protobuf::MessageField
, + // @@protoc_insertion_point(field:signal.BackupFrame.statement) + pub statement: ::protobuf::MessageField, + // @@protoc_insertion_point(field:signal.BackupFrame.preference) + pub preference: ::protobuf::MessageField, + // @@protoc_insertion_point(field:signal.BackupFrame.attachment) + pub attachment: ::protobuf::MessageField, + // @@protoc_insertion_point(field:signal.BackupFrame.version) + pub version: ::protobuf::MessageField, + // @@protoc_insertion_point(field:signal.BackupFrame.end) + pub end: ::std::option::Option, + // @@protoc_insertion_point(field:signal.BackupFrame.avatar) + pub avatar: ::protobuf::MessageField, + // @@protoc_insertion_point(field:signal.BackupFrame.sticker) + pub sticker: ::protobuf::MessageField, + // @@protoc_insertion_point(field:signal.BackupFrame.keyValue) + pub keyValue: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:signal.BackupFrame.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a BackupFrame { + fn default() -> &'a BackupFrame { + ::default_instance() + } +} + +impl BackupFrame { + pub fn new() -> BackupFrame { + ::std::default::Default::default() + } + + // optional bool end = 6; + + pub fn end(&self) -> bool { + self.end.unwrap_or(false) + } + + pub fn clear_end(&mut self) { + self.end = ::std::option::Option::None; + } + + pub fn has_end(&self) -> bool { + self.end.is_some() + } + + // Param is passed by value, moved + pub fn set_end(&mut self, v: bool) { + self.end = ::std::option::Option::Some(v); + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(9); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Header>( + "header", + |m: &BackupFrame| { &m.header }, + |m: &mut BackupFrame| { &mut m.header }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, SqlStatement>( + "statement", + |m: &BackupFrame| { &m.statement }, + |m: &mut BackupFrame| { &mut m.statement }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, SharedPreference>( + "preference", + |m: &BackupFrame| { &m.preference }, + |m: &mut BackupFrame| { &mut m.preference }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Attachment>( + "attachment", + |m: &BackupFrame| { &m.attachment }, + |m: &mut BackupFrame| { &mut m.attachment }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, DatabaseVersion>( + "version", + |m: &BackupFrame| { &m.version }, + |m: &mut BackupFrame| { &mut m.version }, + )); + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( + "end", + |m: &BackupFrame| { &m.end }, + |m: &mut BackupFrame| { &mut m.end }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Avatar>( + "avatar", + |m: &BackupFrame| { &m.avatar }, + |m: &mut BackupFrame| { &mut m.avatar }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Sticker>( + "sticker", + |m: &BackupFrame| { &m.sticker }, + |m: &mut BackupFrame| { &mut m.sticker }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, KeyValue>( + "keyValue", + |m: &BackupFrame| { &m.keyValue }, + |m: &mut BackupFrame| { &mut m.keyValue }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "BackupFrame", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for BackupFrame { + const NAME: &'static str = "BackupFrame"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.header)?; + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.statement)?; + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.preference)?; + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.attachment)?; + }, + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.version)?; + }, + 48 => { + self.end = ::std::option::Option::Some(is.read_bool()?); + }, + 58 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.avatar)?; + }, + 66 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.sticker)?; + }, + 74 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.keyValue)?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.header.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.statement.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.preference.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.attachment.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.version.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.end { + my_size += 1 + 1; + } + if let Some(v) = self.avatar.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.sticker.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.keyValue.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.header.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if let Some(v) = self.statement.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.preference.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.attachment.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + if let Some(v) = self.version.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + } + if let Some(v) = self.end { + os.write_bool(6, v)?; + } + if let Some(v) = self.avatar.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(7, v, os)?; + } + if let Some(v) = self.sticker.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(8, v, os)?; + } + if let Some(v) = self.keyValue.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(9, v, os)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> BackupFrame { + BackupFrame::new() + } + + fn clear(&mut self) { + self.header.clear(); + self.statement.clear(); + self.preference.clear(); + self.attachment.clear(); + self.version.clear(); + self.end = ::std::option::Option::None; + self.avatar.clear(); + self.sticker.clear(); + self.keyValue.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static BackupFrame { + static instance: BackupFrame = BackupFrame { + header: ::protobuf::MessageField::none(), + statement: ::protobuf::MessageField::none(), + preference: ::protobuf::MessageField::none(), + attachment: ::protobuf::MessageField::none(), + version: ::protobuf::MessageField::none(), + end: ::std::option::Option::None, + avatar: ::protobuf::MessageField::none(), + sticker: ::protobuf::MessageField::none(), + keyValue: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for BackupFrame { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("BackupFrame").unwrap()).clone() + } +} + +impl ::std::fmt::Display for BackupFrame { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for BackupFrame { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\rBackups.proto\x12\x06signal\"\xca\x02\n\x0cSqlStatement\x12\x1c\n\ts\ + tatement\x18\x01\x20\x01(\tR\tstatement\x12A\n\nparameters\x18\x02\x20\ + \x03(\x0b2!.signal.SqlStatement.SqlParameterR\nparameters\x1a\xd8\x01\n\ + \x0cSqlParameter\x12&\n\x0estringParamter\x18\x01\x20\x01(\tR\x0estringP\ + aramter\x12*\n\x10integerParameter\x18\x02\x20\x01(\x04R\x10integerParam\ + eter\x12(\n\x0fdoubleParameter\x18\x03\x20\x01(\x01R\x0fdoubleParameter\ + \x12$\n\rblobParameter\x18\x04\x20\x01(\x0cR\rblobParameter\x12$\n\rnull\ + parameter\x18\x05\x20\x01(\x08R\rnullparameter\"\xc6\x01\n\x10SharedPref\ + erence\x12\x12\n\x04file\x18\x01\x20\x01(\tR\x04file\x12\x10\n\x03key\ + \x18\x02\x20\x01(\tR\x03key\x12\x14\n\x05value\x18\x03\x20\x01(\tR\x05va\ + lue\x12\"\n\x0cbooleanValue\x18\x04\x20\x01(\x08R\x0cbooleanValue\x12&\n\ + \x0estringSetValue\x18\x05\x20\x03(\tR\x0estringSetValue\x12*\n\x10isStr\ + ingSetValue\x18\x06\x20\x01(\x08R\x10isStringSetValue\"^\n\nAttachment\ + \x12\x14\n\x05rowId\x18\x01\x20\x01(\x04R\x05rowId\x12\"\n\x0cattachment\ + Id\x18\x02\x20\x01(\x04R\x0cattachmentId\x12\x16\n\x06length\x18\x03\x20\ + \x01(\rR\x06length\"7\n\x07Sticker\x12\x14\n\x05rowId\x18\x01\x20\x01(\ + \x04R\x05rowId\x12\x16\n\x06length\x18\x02\x20\x01(\rR\x06length\"V\n\ + \x06Avatar\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\x20\n\x0bre\ + cipientId\x18\x03\x20\x01(\tR\x0brecipientId\x12\x16\n\x06length\x18\x02\ + \x20\x01(\rR\x06length\"+\n\x0fDatabaseVersion\x12\x18\n\x07version\x18\ + \x01\x20\x01(\rR\x07version\"F\n\x06Header\x12\x0e\n\x02iv\x18\x01\x20\ + \x01(\x0cR\x02iv\x12\x12\n\x04salt\x18\x02\x20\x01(\x0cR\x04salt\x12\x18\ + \n\x07version\x18\x03\x20\x01(\rR\x07version\"\xe2\x01\n\x08KeyValue\x12\ + \x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12\x1c\n\tblobValue\x18\x02\ + \x20\x01(\x0cR\tblobValue\x12\"\n\x0cbooleanValue\x18\x03\x20\x01(\x08R\ + \x0cbooleanValue\x12\x1e\n\nfloatValue\x18\x04\x20\x01(\x02R\nfloatValue\ + \x12\"\n\x0cintegerValue\x18\x05\x20\x01(\x05R\x0cintegerValue\x12\x1c\n\ + \tlongValue\x18\x06\x20\x01(\x03R\tlongValue\x12\x20\n\x0bstringValue\ + \x18\x07\x20\x01(\tR\x0bstringValue\"\x9d\x03\n\x0bBackupFrame\x12&\n\ + \x06header\x18\x01\x20\x01(\x0b2\x0e.signal.HeaderR\x06header\x122\n\tst\ + atement\x18\x02\x20\x01(\x0b2\x14.signal.SqlStatementR\tstatement\x128\n\ + \npreference\x18\x03\x20\x01(\x0b2\x18.signal.SharedPreferenceR\nprefere\ + nce\x122\n\nattachment\x18\x04\x20\x01(\x0b2\x12.signal.AttachmentR\natt\ + achment\x121\n\x07version\x18\x05\x20\x01(\x0b2\x17.signal.DatabaseVersi\ + onR\x07version\x12\x10\n\x03end\x18\x06\x20\x01(\x08R\x03end\x12&\n\x06a\ + vatar\x18\x07\x20\x01(\x0b2\x0e.signal.AvatarR\x06avatar\x12)\n\x07stick\ + er\x18\x08\x20\x01(\x0b2\x0f.signal.StickerR\x07sticker\x12,\n\x08keyVal\ + ue\x18\t\x20\x01(\x0b2\x10.signal.KeyValueR\x08keyValueB)\n'org.thoughtc\ + rime.securesms.backup.proto\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(0); + let mut messages = ::std::vec::Vec::with_capacity(10); + messages.push(SqlStatement::generated_message_descriptor_data()); + messages.push(SharedPreference::generated_message_descriptor_data()); + messages.push(Attachment::generated_message_descriptor_data()); + messages.push(Sticker::generated_message_descriptor_data()); + messages.push(Avatar::generated_message_descriptor_data()); + messages.push(DatabaseVersion::generated_message_descriptor_data()); + messages.push(Header::generated_message_descriptor_data()); + messages.push(KeyValue::generated_message_descriptor_data()); + messages.push(BackupFrame::generated_message_descriptor_data()); + messages.push(sql_statement::SqlParameter::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/src/proto/mod.rs b/src/proto/mod.rs new file mode 100644 index 0000000..584181c --- /dev/null +++ b/src/proto/mod.rs @@ -0,0 +1,3 @@ +// @generated + +pub mod Backups;