From 69c32bc7e729531c742b8cec4655be9bbb02a07c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 20:37:48 +0000 Subject: [PATCH 1/6] Initial plan From f6f3c02d787aa4826ea11ac98b94a9c29e92d7d2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 20:39:39 +0000 Subject: [PATCH 2/6] Add VS Code dev container configuration with all required dependencies Co-authored-by: Yelinz <30687616+Yelinz@users.noreply.github.com> --- .devcontainer/Dockerfile | 33 +++++++++++++++++ .devcontainer/README.md | 63 +++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 21 +++++++++++ 3 files changed, 117 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/README.md create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..a949645 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,33 @@ +# Use the official Rust image as base +FROM rust:1.75-bookworm + +# Install system dependencies required by signal-backup-decode +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends \ + libsqlite3-dev \ + libssl-dev \ + pkg-config \ + protobuf-compiler \ + git \ + # Additional useful tools + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + +# Install rustfmt and clippy for development +RUN rustup component add rustfmt clippy + +# Create a non-root user +ARG USERNAME=vscode +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +RUN groupadd --gid $USER_GID $USERNAME \ + && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ + && apt-get update \ + && apt-get install -y sudo \ + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME \ + && rm -rf /var/lib/apt/lists/* + +USER $USERNAME diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 0000000..e4d4f27 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,63 @@ +# VS Code Dev Container for Signal Backup Decode + +This dev container provides a complete development environment for the signal-backup-decode project with all required dependencies pre-installed. + +## Features + +- **Rust toolchain**: Latest stable Rust compiler (1.75+) +- **System dependencies**: + - `libsqlite3-dev` - SQLite development libraries + - `libssl-dev` - OpenSSL development libraries + - `pkg-config` - Package configuration tool + - `protobuf-compiler` - Protocol Buffers compiler (for regenerating proto files) +- **Development tools**: + - `rustfmt` - Rust code formatter + - `clippy` - Rust linter +- **VS Code extensions**: + - Rust Analyzer - Language server for Rust + - Even Better TOML - TOML file support + - Crates - Cargo.toml dependency management + +## Prerequisites + +- [VS Code](https://code.visualstudio.com/) +- [Docker](https://www.docker.com/products/docker-desktop) +- [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) + +## Usage + +1. Open this repository in VS Code +2. When prompted, click "Reopen in Container" (or run the command "Remote-Containers: Reopen in Container") +3. Wait for the container to build (first time only) +4. Once the container is ready, you can start developing! + +## Building and Testing + +Inside the dev container, you can use standard Cargo commands: + +```bash +# Build the project +cargo build + +# Run tests +cargo test + +# Build with verbose output +cargo build --verbose + +# Run with clippy (linter) +cargo clippy + +# Format code +cargo fmt +``` + +## Rebuilding Protobuf Files + +If you need to regenerate the protobuf files, use the `rebuild-protobuf` feature: + +```bash +cargo build --features "rebuild-protobuf" +``` + +The `protobuf-compiler` is already installed in the container for this purpose. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f331cfb --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,21 @@ +{ +"name": "Signal Backup Decode", +"build": { +"dockerfile": "Dockerfile" +}, +"customizations": { +"vscode": { +"extensions": [ +"rust-lang.rust-analyzer", +"tamasfe.even-better-toml", +"serayuzgur.crates" +], +"settings": { +"rust-analyzer.checkOnSave.command": "clippy" +} +} +}, +"forwardPorts": [], +"postCreateCommand": "rustc --version && cargo --version", +"remoteUser": "vscode" +} From 5e11ca03ceceea2e4254a1a23cb67f109f77062f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 20:40:06 +0000 Subject: [PATCH 3/6] Update README with dev container documentation Co-authored-by: Yelinz <30687616+Yelinz@users.noreply.github.com> --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 4c3aaaa..03ca133 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,18 @@ This repository contains a small programm to decode a backup produced by [Signal Android](https://github.com/signalapp/Signal-Android). +## Development + +### VS Code Dev Container + +This repository includes a VS Code dev container configuration that provides a complete development environment with all required dependencies pre-installed. To use it: + +1. Install [Docker](https://www.docker.com/products/docker-desktop) and [VS Code](https://code.visualstudio.com/) +2. Install the [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) +3. Open this repository in VS Code and click "Reopen in Container" when prompted + +See [.devcontainer/README.md](.devcontainer/README.md) for more details. + ## Installation **Rust v1.41 or higher is required**. Install From 91834b2e411269cd53bbd0a569ee948e9e9247cf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 20:41:34 +0000 Subject: [PATCH 4/6] Fix code review feedback: improve Dockerfile efficiency and JSON formatting Co-authored-by: Yelinz <30687616+Yelinz@users.noreply.github.com> --- .devcontainer/Dockerfile | 7 ++---- .devcontainer/devcontainer.json | 38 ++++++++++++++++----------------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a949645..ca86604 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ pkg-config \ protobuf-compiler \ git \ - # Additional useful tools + sudo \ && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* @@ -24,10 +24,7 @@ ARG USER_GID=$USER_UID RUN groupadd --gid $USER_GID $USERNAME \ && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ - && apt-get update \ - && apt-get install -y sudo \ && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ - && chmod 0440 /etc/sudoers.d/$USERNAME \ - && rm -rf /var/lib/apt/lists/* + && chmod 0440 /etc/sudoers.d/$USERNAME USER $USERNAME diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f331cfb..d82f1fb 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,21 +1,21 @@ { -"name": "Signal Backup Decode", -"build": { -"dockerfile": "Dockerfile" -}, -"customizations": { -"vscode": { -"extensions": [ -"rust-lang.rust-analyzer", -"tamasfe.even-better-toml", -"serayuzgur.crates" -], -"settings": { -"rust-analyzer.checkOnSave.command": "clippy" -} -} -}, -"forwardPorts": [], -"postCreateCommand": "rustc --version && cargo --version", -"remoteUser": "vscode" + "name": "Signal Backup Decode", + "build": { + "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { + "extensions": [ + "rust-lang.rust-analyzer", + "tamasfe.even-better-toml", + "serayuzgur.crates" + ], + "settings": { + "rust-analyzer.checkOnSave.command": "clippy" + } + } + }, + "forwardPorts": [], + "postCreateCommand": "rustc --version && cargo --version", + "remoteUser": "vscode" } From e76ebbdc5c94f0b9014fe05f88cb47323ac7c143 Mon Sep 17 00:00:00 2001 From: Yelinz <30687616+Yelinz@users.noreply.github.com> Date: Sun, 8 Feb 2026 12:19:40 +0000 Subject: [PATCH 5/6] Fix code to working state and update crates --- .devcontainer/Dockerfile | 5 +- .devcontainer/devcontainer.json | 3 +- .gitignore | 3 +- Cargo.lock | 1072 ++++++++++++++++++++----------- Cargo.toml | 48 +- src/Backups.rs | 6 +- src/decrypter.rs | 50 +- src/display.rs | 10 +- src/input.rs | 100 ++- src/main.rs | 1 + src/output_raw.rs | 4 +- 11 files changed, 884 insertions(+), 418 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ca86604..be571d8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # Use the official Rust image as base -FROM rust:1.75-bookworm +FROM rust:1-slim # Install system dependencies required by signal-backup-decode RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ @@ -28,3 +28,6 @@ RUN groupadd --gid $USER_GID $USERNAME \ && chmod 0440 /etc/sudoers.d/$USERNAME USER $USERNAME + +# Set the default shell to bash +SHELL ["/bin/bash", "-c"] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d82f1fb..d74d7af 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,8 +7,7 @@ "vscode": { "extensions": [ "rust-lang.rust-analyzer", - "tamasfe.even-better-toml", - "serayuzgur.crates" + "tamasfe.even-better-toml" ], "settings": { "rust-analyzer.checkOnSave.command": "clippy" diff --git a/.gitignore b/.gitignore index 6bb7ad1..c6a3f0a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /target **/*.rs.bk Cargo.lock -*~ \ No newline at end of file +*~ +/decoded* \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 5fc0e12..fef0d27 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,25 +1,42 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 4 + [[package]] name = "ahash" -version = "0.4.7" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] [[package]] name = "ansi_term" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ "winapi", ] [[package]] name = "anyhow" -version = "1.0.38" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" +checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" [[package]] name = "atty" @@ -34,172 +51,240 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "bitflags" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "1.2.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "block-buffer" -version = "0.9.0" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] -name = "bstr" -version = "0.2.15" +name = "bumpalo" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" -dependencies = [ - "lazy_static", - "memchr", - "regex-automata", - "serde", -] +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "byteorder" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.0.67" +version = "1.2.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" +checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29" +dependencies = [ + "find-msvc-tools", + "shlex", +] [[package]] -name = "cfg-if" -version = "0.1.10" +name = "cfb" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" dependencies = [ - "libc", - "num-integer", + "iana-time-zone", + "js-sys", "num-traits", "serde", - "time", - "winapi", + "wasm-bindgen", + "windows-link", ] [[package]] name = "clap" -version = "2.33.3" +version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "ansi_term", "atty", - "bitflags", + "bitflags 1.3.2", "strsim", "textwrap", - "unicode-width", + "unicode-width 0.1.14", "vec_map", ] [[package]] name = "console" -version = "0.14.0" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc80946b3480f421c2f17ed1cb841753a371c7c5104f51d507e13f532c856aa" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" dependencies = [ "encode_unicode", - "lazy_static", "libc", - "regex", - "terminal_size", - "unicode-width", - "winapi", + "once_cell", + "unicode-width 0.2.2", + "windows-sys 0.59.0", ] [[package]] -name = "cpuid-bool" -version = "0.1.2" +name = "const-random" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] [[package]] -name = "crypto-mac" -version = "0.10.0" +name = "const-random-macro" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "generic-array", - "subtle", + "getrandom 0.2.17", + "once_cell", + "tiny-keccak", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array 0.14.7", + "typenum", ] [[package]] name = "csv" -version = "1.1.5" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d58633299b24b515ac72a3f869f8b91306a3cec616a602843a383acd6f9e97" +checksum = "52cd9d68cf7efc6ddfaaee42e7288d3a99d613d4b50f76ce9827ae0c6e14f938" dependencies = [ - "bstr", "csv-core", "itoa", "ryu", - "serde", + "serde_core", ] [[package]] name = "csv-core" -version = "0.1.10" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +checksum = "704a3c26996a80471189265814dbc2c257598b96b8a7feae2d31ace646bb9782" dependencies = [ "memchr", ] +[[package]] +name = "deranged" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" +dependencies = [ + "powerfmt", +] + [[package]] name = "digest" -version = "0.9.0" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "generic-array", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] name = "dlv-list" -version = "0.2.2" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b391911b9a786312a10cb9d2b3d0735adfd5a8113eb3648de26a75e91b0826c" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" dependencies = [ - "rand 0.7.3", + "const-random", ] +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + [[package]] name = "encode_unicode" -version = "0.3.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fallible-streaming-iterator" @@ -207,6 +292,24 @@ 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 = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "foreign-types" version = "0.3.2" @@ -224,196 +327,271 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", ] +[[package]] +name = "generic-array" +version = "1.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf57c49a95fd1fe24b90b3033bee6dc7e8f1288d51494cb44e627c295e38542" +dependencies = [ + "rustversion", + "typenum", +] + [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", ] [[package]] name = "getrandom" -version = "0.2.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "r-efi", + "wasip2", ] [[package]] name = "hashbrown" -version = "0.9.1" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", ] [[package]] name = "hashlink" -version = "0.6.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d99cf782f0dc4372d26846bec3de7804ceb5df083c2d4462c0b8d2330e894fa8" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ "hashbrown", ] [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] name = "hkdf" -version = "0.10.0" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ - "digest", "hmac", ] [[package]] name = "hmac" -version = "0.10.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "crypto-mac", "digest", ] +[[package]] +name = "home" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "indicatif" -version = "0.15.0" +version = "0.17.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" +checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" dependencies = [ "console", - "lazy_static", "number_prefix", - "regex", + "portable-atomic", + "unicode-width 0.2.2", + "web-time", ] [[package]] name = "infer" -version = "0.3.4" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8906512588cd815b8f759fd0ac11de2a84c985c0f792f70df611e9325c270c1f" +checksum = "bc150e5ce2330295b8616ce0e3f53250e53af31759a9dbedad1621ba29151847" +dependencies = [ + "cfb", +] [[package]] name = "itoa" -version = "0.4.7" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] -name = "lazy_static" -version = "1.4.0" +name = "js-sys" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" +dependencies = [ + "once_cell", + "wasm-bindgen", +] [[package]] name = "libc" -version = "0.2.86" +version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" [[package]] name = "libsqlite3-sys" -version = "0.20.1" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d31059f22935e6c31830db5249ba2b7ecd54fd73a9909286f0a67aa55c2fbd" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" dependencies = [ "pkg-config", "vcpkg", ] +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + [[package]] name = "log" -version = "0.4.14" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "memchr" -version = "2.3.4" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] -name = "num-integer" -version = "0.1.44" +name = "num-conv" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" + +[[package]] +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "num-traits", ] [[package]] -name = "num-traits" -version = "0.2.14" +name = "num_threads" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" dependencies = [ - "autocfg", + "libc", ] [[package]] name = "number_prefix" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "once_cell" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "openssl" -version = "0.10.32" +version = "0.10.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038d43985d1ddca7a9900630d8cd031b56e4794eecc2e9ea39dd17aa04399a70" +checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" dependencies = [ - "bitflags", - "cfg-if 1.0.0", + "bitflags 2.10.0", + "cfg-if", "foreign-types", - "lazy_static", "libc", + "once_cell", + "openssl-macros", "openssl-sys", ] +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "openssl-sys" -version = "0.9.60" +version = "0.9.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "921fc71883267538946025deffb622905ecad223c28efbfdef9bb59a0175f3e6" +checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" dependencies = [ - "autocfg", "cc", "libc", "pkg-config", @@ -422,9 +600,9 @@ dependencies = [ [[package]] name = "ordered-multimap" -version = "0.3.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c672c7ad9ec066e428c00eb917124a06f08db19e2584de982cc34b1f4c12485" +checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" dependencies = [ "dlv-list", "hashbrown", @@ -432,45 +610,51 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] -name = "ppv-lite86" -version = "0.2.10" +name = "portable-atomic" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "protobuf" -version = "2.22.0" +version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f72884896d22e0da0e5b266cb9a780b791f6c3b2f5beab6368d6cd4f0dbb86" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] name = "protobuf-codegen" -version = "2.22.0" +version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8217a1652dbc91d19c509c558234145faed729191a966896414e5889f62d543" +checksum = "033460afb75cf755fcfc16dfaed20b86468082a2ea24e05ac35ab4a099a017d6" dependencies = [ "protobuf", ] [[package]] name = "protoc" -version = "2.22.0" +version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57628f7456fe5fff1591901fb8b594e1584750cb857da23b65c456b42670524d" +checksum = "a0218039c514f9e14a5060742ecd50427f8ac4f85a6dc58f2ddb806e318c55ee" dependencies = [ "log", "which", @@ -478,9 +662,9 @@ dependencies = [ [[package]] name = "protoc-rust" -version = "2.22.0" +version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4f7f814511b67bcbef52cb4ac9160766d087de35245d2fba08d6ee87fb5ecd" +checksum = "22f8a182bb17c485f20bdc4274a8c39000a61024cfe461c799b50fec77267838" dependencies = [ "protobuf", "protobuf-codegen", @@ -490,181 +674,105 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.9" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" dependencies = [ "proc-macro2", ] [[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", -] - -[[package]] -name = "rand" -version = "0.8.3" +name = "r-efi" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" -dependencies = [ - "libc", - "rand_chacha 0.3.0", - "rand_core 0.6.2", - "rand_hc 0.3.0", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] -name = "rand_chacha" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.2", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" -dependencies = [ - "getrandom 0.2.2", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_hc" -version = "0.3.0" +name = "rusqlite" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e" dependencies = [ - "rand_core 0.6.2", + "bitflags 2.10.0", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", ] [[package]] -name = "redox_syscall" -version = "0.2.5" +name = "rust-ini" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +checksum = "796e8d2b6696392a43bea58116b667fb4c29727dc5abd27d6acf338bb4f688c7" dependencies = [ - "bitflags", + "cfg-if", + "ordered-multimap", ] [[package]] -name = "regex" -version = "1.4.3" +name = "rustix" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "regex-syntax", + "bitflags 2.10.0", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", ] [[package]] -name = "regex-automata" -version = "0.1.9" +name = "rustix" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" dependencies = [ - "byteorder", + "bitflags 2.10.0", + "errno", + "libc", + "linux-raw-sys 0.11.0", + "windows-sys 0.61.2", ] [[package]] -name = "regex-syntax" -version = "0.6.22" +name = "rustversion" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "ryu" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] +checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" [[package]] -name = "rusqlite" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38ee71cbab2c827ec0ac24e76f82eca723cee92c509a65f67dee393c25112" -dependencies = [ - "bitflags", - "fallible-iterator", - "fallible-streaming-iterator", - "hashlink", - "libsqlite3-sys", - "memchr", - "smallvec", -] - -[[package]] -name = "rust-ini" -version = "0.16.1" +name = "serde" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55b134767a87e0b086f73a4ce569ac9ce7d202f39c8eab6caa266e2617e73ac6" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ - "cfg-if 0.1.10", - "ordered-multimap", + "serde_core", + "serde_derive", ] [[package]] -name = "ryu" -version = "1.0.5" +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - -[[package]] -name = "serde" -version = "1.0.123" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.123" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -673,17 +781,21 @@ dependencies = [ [[package]] name = "sha2" -version = "0.9.3" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ - "block-buffer", - "cfg-if 1.0.0", - "cpuid-bool", + "cfg-if", + "cpufeatures", "digest", - "opaque-debug", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-backup-decode" version = "0.2.3" @@ -693,7 +805,7 @@ dependencies = [ "chrono", "clap", "csv", - "generic-array", + "generic-array 1.3.5", "hkdf", "hmac", "indicatif", @@ -712,20 +824,20 @@ dependencies = [ [[package]] name = "simplelog" -version = "0.9.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bc0ffd69814a9b251d43afcabf96dad1b29f5028378056257be9e3fecc9f720" +checksum = "16257adbfaef1ee58b1363bdc0664c9b8e1e30aed86049635fb5f147d065a9c0" dependencies = [ - "chrono", "log", "termcolor", + "time", ] [[package]] name = "smallvec" -version = "1.6.1" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "strsim" @@ -735,116 +847,133 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "subtle" -version = "2.4.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "1.0.60" +version = "2.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] name = "tempfile" -version = "3.2.0" +version = "3.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" dependencies = [ - "cfg-if 1.0.0", - "libc", - "rand 0.8.3", - "redox_syscall", - "remove_dir_all", - "winapi", + "fastrand", + "getrandom 0.3.4", + "once_cell", + "rustix 1.1.3", + "windows-sys 0.61.2", ] [[package]] name = "termcolor" -version = "1.1.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] -[[package]] -name = "terminal_size" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ca8ced750734db02076f44132d802af0b33b09942331f4459dde8636fd2406" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "textwrap" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ - "unicode-width", + "unicode-width 0.1.14", ] [[package]] -name = "thiserror" -version = "1.0.24" +name = "time" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" dependencies = [ - "thiserror-impl", + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde_core", + "time-core", + "time-macros", ] [[package]] -name = "thiserror-impl" -version = "1.0.24" +name = "time-core" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + +[[package]] +name = "time-macros" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" dependencies = [ - "proc-macro2", - "quote", - "syn", + "num-conv", + "time-core", ] [[package]] -name = "time" -version = "0.1.43" +name = "tiny-keccak" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" dependencies = [ - "libc", - "winapi", + "crunchy", ] [[package]] name = "typenum" -version = "1.12.0" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "unicode-ident" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "unicode-width" -version = "0.1.8" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] -name = "unicode-xid" -version = "0.2.1" +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "uuid" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] name = "vcpkg" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vec_map" @@ -854,30 +983,90 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] name = "which" -version = "4.0.2" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ - "libc", - "thiserror", + "either", + "home", + "once_cell", + "rustix 0.38.44", ] [[package]] @@ -898,11 +1087,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "winapi", + "windows-sys 0.61.2", ] [[package]] @@ -910,3 +1099,170 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[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.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[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.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[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.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" + +[[package]] +name = "zerocopy" +version = "0.8.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml index 65ecf22..5155291 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,37 +1,37 @@ [package] name = "signal-backup-decode" -version = "0.2.3" -authors = ["pajowu "] +version = "0.2.4" +authors = ["Yelinz <30687616+Yelinz@users.noreply.github.com>", "pajowu "] build = "build.rs" description = "A simple tool to decode signal backups" readme = "README.md" license = "GPL-3.0" -repository = "https://github.com/pajowu/signal-backup-decode" -edition = "2018" +repository = "https://github.com/Yelinz/signal-backup-decode" +edition = "2024" [dependencies] -protobuf = "=2.22" -byteorder = "^1" -rust-ini = "^0.16" -clap = "^2.33" -simplelog = "^0.9" -anyhow = "^1.0" -log = "^0.4" -rusqlite = "^0.24" -hkdf = "^0.10" -sha2 = "^0.9" -hmac = "^0.10" -generic-array = "^0.14" -subtle = "^2.2" -indicatif = "^0.15" -infer = "^0.3" -csv = "^1.1" -serde = { version = "^1.0", features = ["derive"] } -chrono = { version = "^0.4", features = ["serde"] } -openssl = "^0.10" +protobuf = "2.28" +byteorder = "1.5" +rust-ini = "0.21" +clap = "2.34" +simplelog = "0.12" +anyhow = "1.0" +log = "0.4" +rusqlite = "0.32" +hkdf = "0.12" +sha2 = "0.10" +hmac = "0.12" +generic-array = "1.1" +subtle = "2.6" +indicatif = "0.17" +infer = "0.16" +csv = "1.3" +serde = { version = "1.0", features = ["derive"] } +chrono = { version = "0.4", features = ["serde"] } +openssl = "0.10" [build-dependencies] -protoc-rust = {version = "^2.22", optional = true} +protoc-rust = {version = "2.28", optional = true} [features] default = [] diff --git a/src/Backups.rs b/src/Backups.rs index 09e221d..b8968d3 100644 --- a/src/Backups.rs +++ b/src/Backups.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 2.22.0. Do not edit +// This file is generated by rust-protobuf 2.28.0. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -6,7 +6,7 @@ #![allow(clippy::all)] #![allow(unused_attributes)] -#![rustfmt::skip] +#![cfg_attr(rustfmt, rustfmt::skip)] #![allow(box_pointers)] #![allow(dead_code)] @@ -21,7 +21,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_0; +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; #[derive(PartialEq,Clone,Default)] pub struct SqlStatement { diff --git a/src/decrypter.rs b/src/decrypter.rs index 0247fd0..97d4fe5 100644 --- a/src/decrypter.rs +++ b/src/decrypter.rs @@ -1,5 +1,4 @@ -use hmac::crypto_mac::Mac; -use hmac::crypto_mac::NewMac; +use hmac::Mac; use openssl; use sha2::Digest; use subtle::ConstantTimeEq; @@ -10,6 +9,7 @@ pub const LENGTH_HMAC: usize = 10; /// Decrypt bytes pub struct Decrypter { mac: Option>, + mac_key: Option>, key: Vec, iv: Vec, } @@ -36,7 +36,12 @@ impl Decrypter { // create hmac and cipher Self { mac: if verify_mac { - Some(hmac::Hmac::::new_varkey(&okm[32..]).unwrap()) + Some(hmac::Hmac::::new_from_slice(&okm[32..]).unwrap()) + } else { + None + }, + mac_key: if verify_mac { + Some(okm[32..].to_vec()) } else { None }, @@ -45,7 +50,7 @@ impl Decrypter { } } - pub fn decrypt(&mut self, data_encrypted: &[u8]) -> Vec { + pub fn decrypt(&mut self, data_encrypted: &[u8]) -> Result, DecryptError> { // check hmac? if let Some(ref mut hmac) = self.mac { // calculate hmac of frame data @@ -59,7 +64,10 @@ impl Decrypter { Some(&self.iv), data_encrypted, ) - .unwrap() + .map_err(|e| DecryptError::DecryptionFailed { + error: e.to_string(), + data_length: data_encrypted.len() + }) } pub fn mac_update_with_iv(&mut self) { @@ -70,18 +78,25 @@ impl Decrypter { pub fn verify_mac(&mut self, hmac_control: &[u8]) -> Result<(), DecryptError> { if let Some(ref mut hmac) = self.mac { - let result = hmac.finalize_reset(); + // Clone the HMAC, finalize it, and compare + let hmac_clone = hmac.clone(); + let result = hmac_clone.finalize(); let code_bytes = &result.into_bytes()[..LENGTH_HMAC]; // compare to given hmac - let result = code_bytes.ct_eq(&hmac_control); + let cmp_result = code_bytes.ct_eq(&hmac_control); - if result.unwrap_u8() == 0 { + if cmp_result.unwrap_u8() == 0 { return Err(DecryptError::MacVerificationFailed { their_mac: hmac_control.to_vec(), our_mac: code_bytes.to_vec(), }); } + + // Reset the HMAC by creating a new one + if let Some(ref mac_key) = self.mac_key { + *hmac = hmac::Hmac::::new_from_slice(mac_key).unwrap(); + } } Ok(()) @@ -98,6 +113,14 @@ impl Decrypter { } } } + + pub fn get_key(&self) -> &[u8] { + &self.key + } + + pub fn get_iv(&self) -> &[u8] { + &self.iv + } } #[derive(Debug)] @@ -106,6 +129,10 @@ pub enum DecryptError { their_mac: Vec, our_mac: Vec, }, + DecryptionFailed { + error: String, + data_length: usize, + }, } impl std::error::Error for DecryptError {} @@ -118,6 +145,11 @@ impl std::fmt::Display for DecryptError { "HMAC verification failed (their mac: {:02X?}, our mac: {:02X?})", their_mac, our_mac ), + Self::DecryptionFailed { error, data_length } => write!( + f, + "Decryption failed for data of length {} bytes: {}. This may indicate an incorrect password or corrupted backup file.", + data_length, error + ), } } } @@ -134,6 +166,7 @@ mod tests { // test increase at position 3 let mut dec = Decrypter { mac: None, + mac_key: None, key: key.to_vec(), iv: iv.to_vec(), }; @@ -147,6 +180,7 @@ mod tests { iv[2] = 255; let mut dec = Decrypter { mac: None, + mac_key: None, key: key.to_vec(), iv: iv.to_vec(), }; diff --git a/src/display.rs b/src/display.rs index 53a1aa5..24df619 100644 --- a/src/display.rs +++ b/src/display.rs @@ -9,10 +9,10 @@ pub struct Progress { impl Progress { pub fn new(bytes_to_read: u64, frames_to_read: u64, hidden: bool) -> Self { let sty_bytes = indicatif::ProgressStyle::default_bar() - .template(" Bytes read: [{elapsed_precise}] [{bar:50.blue/blue}] {bytes}/{total_bytes}") + .template(" Bytes read: [{elapsed_precise}] [{bar:50.blue/blue}] {bytes}/{total_bytes}").unwrap() .progress_chars("#>-"); let sty_frames = indicatif::ProgressStyle::default_bar() - .template("Read vs. written frames: [{elapsed_precise}] [{bar:50.cyan/cyan}] {pos:>5}/{len:5}") + .template("Read vs. written frames: [{elapsed_precise}] [{bar:50.cyan/cyan}] {pos:>5}/{len:5}").unwrap() .progress_chars("#>-"); let bar_multi = indicatif::MultiProgress::new(); @@ -56,17 +56,17 @@ impl Progress { pub fn finish_frames(&self) { if let Some(ref x) = self.bar_frames { - x.finish_at_current_pos() + x.finish_with_message("done") }; } pub fn finish_bytes(&self) { if let Some(ref x) = self.bar_bytes { - x.finish_at_current_pos() + x.finish_with_message("done") }; } pub fn finish_multi(&self) { - self.bar_multi.join().unwrap(); + // join() was removed in indicatif 0.17, no longer needed } } diff --git a/src/input.rs b/src/input.rs index 78142b4..ae5fd7c 100644 --- a/src/input.rs +++ b/src/input.rs @@ -31,9 +31,9 @@ impl InputFile { // - read first frame let len: usize = reader .read_u32::() - .unwrap() + .context("Failed to read frame length from backup file")? .try_into() - .unwrap(); + .context("Frame length too large to fit in memory")?; let mut frame = vec![0u8; len]; reader.read_exact(&mut frame)?; let frame: crate::frame::Frame = frame.try_into()?; @@ -75,7 +75,7 @@ impl InputFile { // read data and decrypt self.reader.read_exact(&mut data)?; - let data = self.decrypter.decrypt(&mut data); + let data = self.decrypter.decrypt(&mut data)?; // read hmac self.reader.read_exact(&mut hmac)?; @@ -97,21 +97,93 @@ impl InputFile { } pub fn read_frame(&mut self) -> Result { - // read frame length from input file - let len: usize = self - .reader - .read_u32::() - .unwrap() + // Read frame length (4 encrypted bytes) + let mut frame_len_bytes = [0u8; 4]; + self.reader.read_exact(&mut frame_len_bytes) + .context("Failed to read frame length from backup file")?; + + debug!( + "Raw encrypted frame length bytes for frame {}: {:02X?}", + self.count_frame + 1, + frame_len_bytes + ); + + // Preview decrypt the length WITHOUT updating HMAC + // We use openssl directly to avoid HMAC side effects + let decrypted_len_bytes = openssl::symm::decrypt( + openssl::symm::Cipher::aes_256_ctr(), + self.decrypter.get_key(), + Some(self.decrypter.get_iv()), + &frame_len_bytes, + ).map_err(|e| anyhow!("Failed to decrypt frame length: {}", e))?; + + let frame_len_raw = u32::from_be_bytes([ + decrypted_len_bytes[0], + decrypted_len_bytes[1], + decrypted_len_bytes[2], + decrypted_len_bytes[3], + ]); + + debug!( + "Decrypted frame length for frame {}: {} bytes (0x{:08X})", + self.count_frame + 1, + frame_len_raw, + frame_len_raw + ); + + let len: usize = frame_len_raw .try_into() - .unwrap(); + .context(format!("Frame length {} is too large to fit in memory", frame_len_raw))?; + + // Validate frame length is reasonable (max 100MB per frame) + const MAX_FRAME_SIZE: usize = 100 * 1024 * 1024; + if len > MAX_FRAME_SIZE { + return Err(anyhow!( + "Frame {} has unreasonably large length of {} bytes (max {} bytes). This likely indicates a corrupted backup file or incorrect password.", + self.count_frame + 1, + len, + MAX_FRAME_SIZE + )); + } + debug!( - "Read frame number {} with length of {} bytes", - self.count_frame, len + "Reading frame {} with length of {} bytes", + self.count_frame + 1, len ); - // create frame - let frame = self.read_data(len, false)?; - let mut frame: crate::frame::Frame = frame.try_into()?; + // len includes the 10-byte HMAC, so actual encrypted data is len - 10 + let data_len = len.checked_sub(crate::decrypter::LENGTH_HMAC) + .ok_or_else(|| anyhow!("Frame length {} is too small to contain HMAC", len))?; + + // Read the encrypted frame data + let mut encrypted_data = vec![0u8; data_len]; + self.reader.read_exact(&mut encrypted_data)?; + + // Concatenate length + data and decrypt as ONE continuous stream + // This is crucial for CTR mode to work correctly + let mut all_encrypted = Vec::with_capacity(4 + data_len); + all_encrypted.extend_from_slice(&frame_len_bytes); + all_encrypted.extend_from_slice(&encrypted_data); + + // Decrypt everything together (length + data) - this also updates HMAC + let all_decrypted = self.decrypter.decrypt(&all_encrypted)?; + + // Extract just the frame data part (skip the 4-byte length prefix) + let data = all_decrypted[4..].to_vec(); + + // Read and verify HMAC + let mut hmac = [0u8; crate::decrypter::LENGTH_HMAC]; + self.reader.read_exact(&mut hmac)?; + self.decrypter.verify_mac(&hmac)?; + + // Increment IV for next frame + self.decrypter.increase_iv(); + + // Update byte counter (4 bytes length + len bytes for data+hmac) + self.count_byte += 4 + len; + + // Parse frame from decrypted data + let mut frame: crate::frame::Frame = data.try_into()?; debug!("Frame type: {}", &frame); match frame { diff --git a/src/main.rs b/src/main.rs index 4fceb8a..c1840a4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -118,6 +118,7 @@ fn main() { config.log_level, simplelog::Config::default(), simplelog::TerminalMode::Mixed, + simplelog::ColorChoice::Auto, ) .unwrap(); diff --git a/src/output_raw.rs b/src/output_raw.rs index c05ea1d..dc44fc4 100644 --- a/src/output_raw.rs +++ b/src/output_raw.rs @@ -145,7 +145,7 @@ impl crate::output::SignalOutput for SignalOutputRaw { .sqlite_connection .prepare_cached(statement) .with_context(|| format!("failed to prepare database statement: {}", statement))?; - stmt.execute(parameters) + stmt.execute(rusqlite::params_from_iter(parameters.iter())) .with_context(|| format!("failed to execute database statement: {}", statement))?; self.written_frames += 1; @@ -263,7 +263,7 @@ impl crate::output::SignalOutput for SignalOutputRaw { self.sqlite_connection .execute( &format!("VACUUM INTO \"{}\";", path_sqlite.to_string_lossy()), - rusqlite::NO_PARAMS, + [], ) .with_context(|| { format!( From e04b101b21908598b9d0fb4d04cdc6353aade1b9 Mon Sep 17 00:00:00 2001 From: Yelinz <30687616+Yelinz@users.noreply.github.com> Date: Sun, 8 Feb 2026 12:29:08 +0000 Subject: [PATCH 6/6] update protobuf to v3 and clap to v4 --- Cargo.lock | 424 ++++--- Cargo.toml | 16 +- build.rs | 4 +- src/Backups.rs | 2927 +++++++++++++++++++-------------------------- src/args.rs | 176 ++- src/frame.rs | 69 +- src/mod.rs | 3 + src/output_raw.rs | 4 +- 8 files changed, 1635 insertions(+), 1988 deletions(-) create mode 100644 src/mod.rs diff --git a/Cargo.lock b/Cargo.lock index fef0d27..2362420 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,15 +3,12 @@ version = 4 [[package]] -name = "ahash" -version = "0.8.12" +name = "aho-corasick" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", + "memchr", ] [[package]] @@ -24,42 +21,66 @@ dependencies = [ ] [[package]] -name = "ansi_term" -version = "0.12.1" +name = "anstream" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ - "winapi", + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", ] [[package]] -name = "anyhow" -version = "1.0.101" +name = "anstyle" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] -name = "atty" -version = "0.2.14" +name = "anstyle-parse" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ - "hermit-abi", - "libc", - "winapi", + "utf8parse", ] [[package]] -name = "autocfg" -version = "1.5.0" +name = "anstyle-query" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] [[package]] -name = "bitflags" -version = "1.3.2" +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" + +[[package]] +name = "autocfg" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "bitflags" @@ -131,30 +152,61 @@ dependencies = [ [[package]] name = "clap" -version = "2.34.0" +version = "4.5.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "6899ea499e3fb9305a65d5ebf6e3d2248c5fab291f300ad0a704fbe142eae31a" dependencies = [ - "ansi_term", - "atty", - "bitflags 1.3.2", + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b12c8b680195a62a8364d16b8447b01b6c2c8f9aaf68bee653be34d4245e238" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", "strsim", - "textwrap", - "unicode-width 0.1.14", - "vec_map", ] +[[package]] +name = "clap_derive" +version = "4.5.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + [[package]] name = "console" -version = "0.15.11" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +checksum = "03e45a4a8926227e4197636ba97a9fc9b00477e9f4bd711395687c5f0734bec4" dependencies = [ "encode_unicode", "libc", "once_cell", - "unicode-width 0.2.2", - "windows-sys 0.59.0", + "unicode-width", + "windows-sys 0.61.2", ] [[package]] @@ -270,6 +322,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + [[package]] name = "errno" version = "0.3.14" @@ -310,6 +368,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "foreign-types" version = "0.3.2" @@ -373,27 +437,30 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" dependencies = [ - "ahash", + "foldhash", ] [[package]] name = "hashlink" -version = "0.9.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +checksum = "ea0b22561a9c04a7cb1a302c013e0259cd3b4bb619f145b32f72b8b4bcbed230" dependencies = [ - "hashbrown", + "hashbrown 0.16.1", ] [[package]] -name = "hermit-abi" -version = "0.1.19" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hkdf" @@ -446,28 +513,44 @@ dependencies = [ "cc", ] +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", +] + [[package]] name = "indicatif" -version = "0.17.11" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" +checksum = "9375e112e4b463ec1b1c6c011953545c65a30164fbab5b581df32b3abf0dcb88" dependencies = [ "console", - "number_prefix", "portable-atomic", - "unicode-width 0.2.2", + "unicode-width", + "unit-prefix", "web-time", ] [[package]] name = "infer" -version = "0.16.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc150e5ce2330295b8616ce0e3f53250e53af31759a9dbedad1621ba29151847" +checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" dependencies = [ "cfb", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + [[package]] name = "itoa" version = "1.0.17" @@ -492,9 +575,9 @@ checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" [[package]] name = "libsqlite3-sys" -version = "0.30.1" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" +checksum = "95b4103cffefa72eb8428cb6b47d6627161e51c2739fc5e3b734584157bc642a" dependencies = [ "pkg-config", "vcpkg", @@ -548,25 +631,25 @@ dependencies = [ "libc", ] -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - [[package]] name = "once_cell" version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + [[package]] name = "openssl" version = "0.10.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" dependencies = [ - "bitflags 2.10.0", + "bitflags", "cfg-if", "foreign-types", "libc", @@ -605,7 +688,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" dependencies = [ "dlv-list", - "hashbrown", + "hashbrown 0.14.5", ] [[package]] @@ -637,39 +720,53 @@ dependencies = [ [[package]] name = "protobuf" -version = "2.28.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" +checksum = "d65a1d4ddae7d8b5de68153b48f6aa3bba8cb002b243dbdbc55a5afbc98f99f4" +dependencies = [ + "once_cell", + "protobuf-support", + "thiserror 1.0.69", +] [[package]] name = "protobuf-codegen" -version = "2.28.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033460afb75cf755fcfc16dfaed20b86468082a2ea24e05ac35ab4a099a017d6" +checksum = "5d3976825c0014bbd2f3b34f0001876604fe87e0c86cd8fa54251530f1544ace" dependencies = [ + "anyhow", + "once_cell", "protobuf", + "protobuf-parse", + "regex", + "tempfile", + "thiserror 1.0.69", ] [[package]] -name = "protoc" -version = "2.28.0" +name = "protobuf-parse" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0218039c514f9e14a5060742ecd50427f8ac4f85a6dc58f2ddb806e318c55ee" +checksum = "b4aeaa1f2460f1d348eeaeed86aea999ce98c1bded6f089ff8514c9d9dbdc973" dependencies = [ + "anyhow", + "indexmap", "log", + "protobuf", + "protobuf-support", + "tempfile", + "thiserror 1.0.69", "which", ] [[package]] -name = "protoc-rust" -version = "2.28.0" +name = "protobuf-support" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f8a182bb17c485f20bdc4274a8c39000a61024cfe461c799b50fec77267838" +checksum = "3e36c2f31e0a47f9280fb347ef5e461ffcd2c52dd520d8e216b52f93b0b0d7d6" dependencies = [ - "protobuf", - "protobuf-codegen", - "protoc", - "tempfile", + "thiserror 1.0.69", ] [[package]] @@ -687,18 +784,58 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" + +[[package]] +name = "rsqlite-vfs" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a1f2315036ef6b1fbacd1972e8ee7688030b0a2121edfc2a6550febd41574d" +dependencies = [ + "hashbrown 0.16.1", + "thiserror 2.0.18", +] + [[package]] name = "rusqlite" -version = "0.32.1" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e" +checksum = "f1c93dd1c9683b438c392c492109cb702b8090b2bfc8fed6f6e4eb4523f17af3" dependencies = [ - "bitflags 2.10.0", + "bitflags", "fallible-iterator", "fallible-streaming-iterator", "hashlink", "libsqlite3-sys", "smallvec", + "sqlite-wasm-rs", ] [[package]] @@ -717,7 +854,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.10.0", + "bitflags", "errno", "libc", "linux-raw-sys 0.4.15", @@ -730,7 +867,7 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" dependencies = [ - "bitflags 2.10.0", + "bitflags", "errno", "libc", "linux-raw-sys 0.11.0", @@ -798,7 +935,7 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-backup-decode" -version = "0.2.3" +version = "0.2.4" dependencies = [ "anyhow", "byteorder", @@ -813,7 +950,7 @@ dependencies = [ "log", "openssl", "protobuf", - "protoc-rust", + "protobuf-codegen", "rusqlite", "rust-ini", "serde", @@ -839,11 +976,23 @@ version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +[[package]] +name = "sqlite-wasm-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4206ed3a67690b9c29b77d728f6acc3ce78f16bf846d83c94f76400320181b" +dependencies = [ + "cc", + "js-sys", + "rsqlite-vfs", + "wasm-bindgen", +] + [[package]] name = "strsim" -version = "0.8.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" @@ -885,12 +1034,43 @@ dependencies = [ ] [[package]] -name = "textwrap" -version = "0.11.0" +name = "thiserror" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "unicode-width 0.1.14", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -949,15 +1129,21 @@ checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "unicode-width" -version = "0.1.14" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" [[package]] -name = "unicode-width" +name = "unit-prefix" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" + +[[package]] +name = "utf8parse" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -975,12 +1161,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" version = "0.9.5" @@ -1069,22 +1249,6 @@ dependencies = [ "rustix 0.38.44", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" version = "0.1.11" @@ -1094,12 +1258,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" version = "0.62.2" @@ -1246,23 +1404,3 @@ name = "wit-bindgen" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" - -[[package]] -name = "zerocopy" -version = "0.8.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/Cargo.toml b/Cargo.toml index 5155291..5afaffb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,29 +10,29 @@ repository = "https://github.com/Yelinz/signal-backup-decode" edition = "2024" [dependencies] -protobuf = "2.28" +protobuf = "3" byteorder = "1.5" rust-ini = "0.21" -clap = "2.34" +clap = { version = "4", features = ["derive", "cargo"] } simplelog = "0.12" anyhow = "1.0" log = "0.4" -rusqlite = "0.32" +rusqlite = "0.38" hkdf = "0.12" sha2 = "0.10" hmac = "0.12" -generic-array = "1.1" +generic-array = "1.3.5" subtle = "2.6" -indicatif = "0.17" -infer = "0.16" +indicatif = "0.18" +infer = "0.19" csv = "1.3" serde = { version = "1.0", features = ["derive"] } chrono = { version = "0.4", features = ["serde"] } openssl = "0.10" [build-dependencies] -protoc-rust = {version = "2.28", optional = true} +protobuf-codegen = { version = "3", optional = true } [features] default = [] -rebuild-protobuf = ["protoc-rust"] +rebuild-protobuf = ["protobuf-codegen"] diff --git a/build.rs b/build.rs index 0653dfb..baa3fba 100644 --- a/build.rs +++ b/build.rs @@ -1,9 +1,9 @@ #[cfg(feature = "rebuild-protobuf")] -extern crate protoc_rust; +extern crate protobuf_codegen; #[cfg(feature = "rebuild-protobuf")] fn main() { - protoc_rust::Codegen::new() + protobuf_codegen::Codegen::new() .out_dir("src") .inputs(&["proto/Backups.proto"]) .include("proto") diff --git a/src/Backups.rs b/src/Backups.rs index b8968d3..665f938 100644 --- a/src/Backups.rs +++ b/src/Backups.rs @@ -1,4 +1,5 @@ -// This file is generated by rust-protobuf 2.28.0. Do not edit +// This file is generated by rust-protobuf 3.7.2. Do not edit +// .proto file is parsed by protoc 3.21.12 // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -8,29 +9,32 @@ #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] -#![allow(box_pointers)] #![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_imports)] #![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_2_28_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2; -#[derive(PartialEq,Clone,Default)] +// @@protoc_insertion_point(message:signal.SqlStatement) +#[derive(PartialEq,Clone,Default,Debug)] pub struct SqlStatement { // message fields - statement: ::protobuf::SingularField<::std::string::String>, - pub parameters: ::protobuf::RepeatedField, + // @@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 - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, + // @@protoc_insertion_point(special_field:signal.SqlStatement.special_fields) + pub special_fields: ::protobuf::SpecialFields, } impl<'a> ::std::default::Default for &'a SqlStatement { @@ -46,15 +50,15 @@ impl SqlStatement { // optional string statement = 1; - - pub fn get_statement(&self) -> &str { + pub fn statement(&self) -> &str { match self.statement.as_ref() { - Some(v) => &v, + Some(v) => v, None => "", } } + pub fn clear_statement(&mut self) { - self.statement.clear(); + self.statement = ::std::option::Option::None; } pub fn has_statement(&self) -> bool { @@ -63,14 +67,14 @@ impl SqlStatement { // Param is passed by value, moved pub fn set_statement(&mut self, v: ::std::string::String) { - self.statement = ::protobuf::SingularField::some(v); + 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.set_default(); + self.statement = ::std::option::Option::Some(::std::string::String::new()); } self.statement.as_mut().unwrap() } @@ -80,54 +84,45 @@ impl SqlStatement { self.statement.take().unwrap_or_else(|| ::std::string::String::new()) } - // repeated .signal.SqlStatement.SqlParameter parameters = 2; - - - pub fn get_parameters(&self) -> &[SqlStatement_SqlParameter] { - &self.parameters - } - pub fn clear_parameters(&mut self) { - self.parameters.clear(); - } - - // Param is passed by value, moved - pub fn set_parameters(&mut self, v: ::protobuf::RepeatedField) { - self.parameters = v; - } - - // Mutable pointer to the field. - pub fn mut_parameters(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.parameters - } - - // Take field - pub fn take_parameters(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.parameters, ::protobuf::RepeatedField::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 { - for v in &self.parameters { - if !v.is_initialized() { - return false; - } - }; true } - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.statement)?; + 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()?); }, - 2 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.parameters)?; + 18 => { + self.parameters.push(is.read_message()?); }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; }, }; } @@ -136,461 +131,421 @@ impl ::protobuf::Message for SqlStatement { // Compute sizes of nested messages #[allow(unused_variables)] - fn compute_size(&self) -> u32 { + fn compute_size(&self) -> u64 { let mut my_size = 0; - if let Some(ref v) = self.statement.as_ref() { + 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_varint32_size(len) + len; + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; }; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); + 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::ProtobufResult<()> { - if let Some(ref v) = self.statement.as_ref() { - os.write_string(1, &v)?; + 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 { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; }; - os.write_unknown_fields(self.get_unknown_fields())?; + os.write_unknown_fields(self.special_fields.unknown_fields())?; ::std::result::Result::Ok(()) } - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields } - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields } fn new() -> SqlStatement { SqlStatement::new() } - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "statement", - |m: &SqlStatement| { &m.statement }, - |m: &mut SqlStatement| { &mut m.statement }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "parameters", - |m: &SqlStatement| { &m.parameters }, - |m: &mut SqlStatement| { &mut m.parameters }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SqlStatement", - fields, - file_descriptor_proto() - ) - }) + fn clear(&mut self) { + self.statement = ::std::option::Option::None; + self.parameters.clear(); + self.special_fields.clear(); } fn default_instance() -> &'static SqlStatement { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SqlStatement::new) + static instance: SqlStatement = SqlStatement { + statement: ::std::option::Option::None, + parameters: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance } } -impl ::protobuf::Clear for SqlStatement { - fn clear(&mut self) { - self.statement.clear(); - self.parameters.clear(); - self.unknown_fields.clear(); +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::Debug for SqlStatement { +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 { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default)] -pub struct SqlStatement_SqlParameter { - // message fields - stringParamter: ::protobuf::SingularField<::std::string::String>, - integerParameter: ::std::option::Option, - doubleParameter: ::std::option::Option, - blobParameter: ::protobuf::SingularField<::std::vec::Vec>, - nullparameter: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SqlStatement_SqlParameter { - fn default() -> &'a SqlStatement_SqlParameter { - ::default_instance() - } -} - -impl SqlStatement_SqlParameter { - pub fn new() -> SqlStatement_SqlParameter { - ::std::default::Default::default() +/// 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, } - // optional string stringParamter = 1; - - - pub fn get_stringParamter(&self) -> &str { - match self.stringParamter.as_ref() { - Some(v) => &v, - None => "", + impl<'a> ::std::default::Default for &'a SqlParameter { + fn default() -> &'a SqlParameter { + ::default_instance() } } - pub fn clear_stringParamter(&mut self) { - self.stringParamter.clear(); - } - - 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 = ::protobuf::SingularField::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.set_default(); + impl SqlParameter { + pub fn new() -> SqlParameter { + ::std::default::Default::default() } - 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; + // optional string stringParamter = 1; - pub fn get_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 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 get_doubleParameter(&self) -> f64 { - self.doubleParameter.unwrap_or(0.) - } - pub fn clear_doubleParameter(&mut self) { - self.doubleParameter = ::std::option::Option::None; - } + pub fn has_stringParamter(&self) -> bool { + self.stringParamter.is_some() + } - pub fn has_doubleParameter(&self) -> bool { - self.doubleParameter.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); + } - // Param is passed by value, moved - pub fn set_doubleParameter(&mut self, v: f64) { - self.doubleParameter = ::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() + } - // optional bytes blobParameter = 4; + // 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 get_blobParameter(&self) -> &[u8] { - match self.blobParameter.as_ref() { - Some(v) => &v, - None => &[], + pub fn integerParameter(&self) -> u64 { + self.integerParameter.unwrap_or(0) } - } - pub fn clear_blobParameter(&mut self) { - self.blobParameter.clear(); - } - 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 = ::protobuf::SingularField::some(v); - } + pub fn clear_integerParameter(&mut self) { + self.integerParameter = ::std::option::Option::None; + } - // 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.set_default(); + pub fn has_integerParameter(&self) -> bool { + self.integerParameter.is_some() } - 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()) - } + // Param is passed by value, moved + pub fn set_integerParameter(&mut self, v: u64) { + self.integerParameter = ::std::option::Option::Some(v); + } - // optional bool nullparameter = 5; + // optional double doubleParameter = 3; + pub fn doubleParameter(&self) -> f64 { + self.doubleParameter.unwrap_or(0.) + } - pub fn get_nullparameter(&self) -> bool { - self.nullparameter.unwrap_or(false) - } - pub fn clear_nullparameter(&mut self) { - self.nullparameter = ::std::option::Option::None; - } + pub fn clear_doubleParameter(&mut self) { + self.doubleParameter = ::std::option::Option::None; + } - pub fn has_nullparameter(&self) -> bool { - self.nullparameter.is_some() - } + pub fn has_doubleParameter(&self) -> bool { + self.doubleParameter.is_some() + } - // Param is passed by value, moved - pub fn set_nullparameter(&mut self, v: bool) { - self.nullparameter = ::std::option::Option::Some(v); - } -} + // Param is passed by value, moved + pub fn set_doubleParameter(&mut self, v: f64) { + self.doubleParameter = ::std::option::Option::Some(v); + } -impl ::protobuf::Message for SqlStatement_SqlParameter { - fn is_initialized(&self) -> bool { - true - } + // optional bytes blobParameter = 4; - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.stringParamter)?; - }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_uint64()?; - self.integerParameter = ::std::option::Option::Some(tmp); - }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeFixed64 { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_double()?; - self.doubleParameter = ::std::option::Option::Some(tmp); - }, - 4 => { - ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.blobParameter)?; - }, - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.nullparameter = ::std::option::Option::Some(tmp); - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; + pub fn blobParameter(&self) -> &[u8] { + match self.blobParameter.as_ref() { + Some(v) => v, + None => &[], + } } - ::std::result::Result::Ok(()) - } - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.stringParamter.as_ref() { - my_size += ::protobuf::rt::string_size(1, &v); - } - if let Some(v) = self.integerParameter { - my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); - } - if let Some(v) = self.doubleParameter { - my_size += 9; + pub fn clear_blobParameter(&mut self) { + self.blobParameter = ::std::option::Option::None; } - if let Some(ref v) = self.blobParameter.as_ref() { - my_size += ::protobuf::rt::bytes_size(4, &v); - } - if let Some(v) = self.nullparameter { - my_size += 2; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.stringParamter.as_ref() { - os.write_string(1, &v)?; + pub fn has_blobParameter(&self) -> bool { + self.blobParameter.is_some() } - 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(ref v) = self.blobParameter.as_ref() { - os.write_bytes(4, &v)?; + + // Param is passed by value, moved + pub fn set_blobParameter(&mut self, v: ::std::vec::Vec) { + self.blobParameter = ::std::option::Option::Some(v); } - if let Some(v) = self.nullparameter { - os.write_bool(5, 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() } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } + // Take field + pub fn take_blobParameter(&mut self) -> ::std::vec::Vec { + self.blobParameter.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } + // optional bool nullparameter = 5; - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } + pub fn nullparameter(&self) -> bool { + self.nullparameter.unwrap_or(false) + } - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } + pub fn clear_nullparameter(&mut self) { + self.nullparameter = ::std::option::Option::None; + } - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } + pub fn has_nullparameter(&self) -> bool { + self.nullparameter.is_some() + } - fn new() -> SqlStatement_SqlParameter { - SqlStatement_SqlParameter::new() - } + // Param is passed by value, moved + pub fn set_nullparameter(&mut self, v: bool) { + self.nullparameter = ::std::option::Option::Some(v); + } - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + 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: &SqlStatement_SqlParameter| { &m.stringParamter }, - |m: &mut SqlStatement_SqlParameter| { &mut m.stringParamter }, + |m: &SqlParameter| { &m.stringParamter }, + |m: &mut SqlParameter| { &mut m.stringParamter }, )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( "integerParameter", - |m: &SqlStatement_SqlParameter| { &m.integerParameter }, - |m: &mut SqlStatement_SqlParameter| { &mut m.integerParameter }, + |m: &SqlParameter| { &m.integerParameter }, + |m: &mut SqlParameter| { &mut m.integerParameter }, )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeDouble>( + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( "doubleParameter", - |m: &SqlStatement_SqlParameter| { &m.doubleParameter }, - |m: &mut SqlStatement_SqlParameter| { &mut m.doubleParameter }, + |m: &SqlParameter| { &m.doubleParameter }, + |m: &mut SqlParameter| { &mut m.doubleParameter }, )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( "blobParameter", - |m: &SqlStatement_SqlParameter| { &m.blobParameter }, - |m: &mut SqlStatement_SqlParameter| { &mut m.blobParameter }, + |m: &SqlParameter| { &m.blobParameter }, + |m: &mut SqlParameter| { &mut m.blobParameter }, )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( "nullparameter", - |m: &SqlStatement_SqlParameter| { &m.nullparameter }, - |m: &mut SqlStatement_SqlParameter| { &mut m.nullparameter }, + |m: &SqlParameter| { &m.nullparameter }, + |m: &mut SqlParameter| { &mut m.nullparameter }, )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( "SqlStatement.SqlParameter", fields, - file_descriptor_proto() + oneofs, ) - }) + } } - fn default_instance() -> &'static SqlStatement_SqlParameter { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SqlStatement_SqlParameter::new) + 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::Clear for SqlStatement_SqlParameter { - fn clear(&mut self) { - self.stringParamter.clear(); - self.integerParameter = ::std::option::Option::None; - self.doubleParameter = ::std::option::Option::None; - self.blobParameter.clear(); - self.nullparameter = ::std::option::Option::None; - self.unknown_fields.clear(); + 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::Debug for SqlStatement_SqlParameter { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) + 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 SqlStatement_SqlParameter { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) + impl ::protobuf::reflect::ProtobufValue for SqlParameter { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } } -#[derive(PartialEq,Clone,Default)] +// @@protoc_insertion_point(message:signal.SharedPreference) +#[derive(PartialEq,Clone,Default,Debug)] pub struct SharedPreference { // message fields - file: ::protobuf::SingularField<::std::string::String>, - key: ::protobuf::SingularField<::std::string::String>, - value: ::protobuf::SingularField<::std::string::String>, - booleanValue: ::std::option::Option, - pub stringSetValue: ::protobuf::RepeatedField<::std::string::String>, - isStringSetValue: ::std::option::Option, + // @@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 - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, + // @@protoc_insertion_point(special_field:signal.SharedPreference.special_fields) + pub special_fields: ::protobuf::SpecialFields, } impl<'a> ::std::default::Default for &'a SharedPreference { @@ -606,15 +561,15 @@ impl SharedPreference { // optional string file = 1; - - pub fn get_file(&self) -> &str { + pub fn file(&self) -> &str { match self.file.as_ref() { - Some(v) => &v, + Some(v) => v, None => "", } } + pub fn clear_file(&mut self) { - self.file.clear(); + self.file = ::std::option::Option::None; } pub fn has_file(&self) -> bool { @@ -623,14 +578,14 @@ impl SharedPreference { // Param is passed by value, moved pub fn set_file(&mut self, v: ::std::string::String) { - self.file = ::protobuf::SingularField::some(v); + 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.set_default(); + self.file = ::std::option::Option::Some(::std::string::String::new()); } self.file.as_mut().unwrap() } @@ -642,15 +597,15 @@ impl SharedPreference { // optional string key = 2; - - pub fn get_key(&self) -> &str { + pub fn key(&self) -> &str { match self.key.as_ref() { - Some(v) => &v, + Some(v) => v, None => "", } } + pub fn clear_key(&mut self) { - self.key.clear(); + self.key = ::std::option::Option::None; } pub fn has_key(&self) -> bool { @@ -659,14 +614,14 @@ impl SharedPreference { // Param is passed by value, moved pub fn set_key(&mut self, v: ::std::string::String) { - self.key = ::protobuf::SingularField::some(v); + 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.set_default(); + self.key = ::std::option::Option::Some(::std::string::String::new()); } self.key.as_mut().unwrap() } @@ -678,15 +633,15 @@ impl SharedPreference { // optional string value = 3; - - pub fn get_value(&self) -> &str { + pub fn value(&self) -> &str { match self.value.as_ref() { - Some(v) => &v, + Some(v) => v, None => "", } } + pub fn clear_value(&mut self) { - self.value.clear(); + self.value = ::std::option::Option::None; } pub fn has_value(&self) -> bool { @@ -695,14 +650,14 @@ impl SharedPreference { // Param is passed by value, moved pub fn set_value(&mut self, v: ::std::string::String) { - self.value = ::protobuf::SingularField::some(v); + 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.set_default(); + self.value = ::std::option::Option::Some(::std::string::String::new()); } self.value.as_mut().unwrap() } @@ -714,10 +669,10 @@ impl SharedPreference { // optional bool booleanValue = 4; - - pub fn get_booleanValue(&self) -> bool { + pub fn booleanValue(&self) -> bool { self.booleanValue.unwrap_or(false) } + pub fn clear_booleanValue(&mut self) { self.booleanValue = ::std::option::Option::None; } @@ -731,37 +686,12 @@ impl SharedPreference { self.booleanValue = ::std::option::Option::Some(v); } - // repeated string stringSetValue = 5; - - - pub fn get_stringSetValue(&self) -> &[::std::string::String] { - &self.stringSetValue - } - pub fn clear_stringSetValue(&mut self) { - self.stringSetValue.clear(); - } - - // Param is passed by value, moved - pub fn set_stringSetValue(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { - self.stringSetValue = v; - } - - // Mutable pointer to the field. - pub fn mut_stringSetValue(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.stringSetValue - } - - // Take field - pub fn take_stringSetValue(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { - ::std::mem::replace(&mut self.stringSetValue, ::protobuf::RepeatedField::new()) - } - // optional bool isStringSetValue = 6; - - pub fn get_isStringSetValue(&self) -> bool { + pub fn isStringSetValue(&self) -> bool { self.isStringSetValue.unwrap_or(false) } + pub fn clear_isStringSetValue(&mut self) { self.isStringSetValue = ::std::option::Option::None; } @@ -774,45 +704,78 @@ impl SharedPreference { 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::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.file)?; + 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()?); }, - 2 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.key)?; + 18 => { + self.key = ::std::option::Option::Some(is.read_string()?); }, - 3 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.value)?; + 26 => { + self.value = ::std::option::Option::Some(is.read_string()?); }, - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.booleanValue = ::std::option::Option::Some(tmp); + 32 => { + self.booleanValue = ::std::option::Option::Some(is.read_bool()?); }, - 5 => { - ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.stringSetValue)?; + 42 => { + self.stringSetValue.push(is.read_string()?); }, - 6 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.isStringSetValue = ::std::option::Option::Some(tmp); + 48 => { + self.isStringSetValue = ::std::option::Option::Some(is.read_bool()?); }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; }, }; } @@ -821,40 +784,40 @@ impl ::protobuf::Message for SharedPreference { // Compute sizes of nested messages #[allow(unused_variables)] - fn compute_size(&self) -> u32 { + fn compute_size(&self) -> u64 { let mut my_size = 0; - if let Some(ref v) = self.file.as_ref() { + if let Some(v) = self.file.as_ref() { my_size += ::protobuf::rt::string_size(1, &v); } - if let Some(ref v) = self.key.as_ref() { + if let Some(v) = self.key.as_ref() { my_size += ::protobuf::rt::string_size(2, &v); } - if let Some(ref v) = self.value.as_ref() { + if let Some(v) = self.value.as_ref() { my_size += ::protobuf::rt::string_size(3, &v); } if let Some(v) = self.booleanValue { - my_size += 2; + 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 += 2; + my_size += 1 + 1; } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); + 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::ProtobufResult<()> { - if let Some(ref v) = self.file.as_ref() { - os.write_string(1, &v)?; + 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(ref v) = self.key.as_ref() { - os.write_string(2, &v)?; + if let Some(v) = self.key.as_ref() { + os.write_string(2, v)?; } - if let Some(ref v) = self.value.as_ref() { - os.write_string(3, &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)?; @@ -865,121 +828,76 @@ impl ::protobuf::Message for SharedPreference { if let Some(v) = self.isStringSetValue { os.write_bool(6, v)?; } - os.write_unknown_fields(self.get_unknown_fields())?; + os.write_unknown_fields(self.special_fields.unknown_fields())?; ::std::result::Result::Ok(()) } - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields } - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields } fn new() -> SharedPreference { SharedPreference::new() } - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "file", - |m: &SharedPreference| { &m.file }, - |m: &mut SharedPreference| { &mut m.file }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "key", - |m: &SharedPreference| { &m.key }, - |m: &mut SharedPreference| { &mut m.key }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "value", - |m: &SharedPreference| { &m.value }, - |m: &mut SharedPreference| { &mut m.value }, - )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "booleanValue", - |m: &SharedPreference| { &m.booleanValue }, - |m: &mut SharedPreference| { &mut m.booleanValue }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "stringSetValue", - |m: &SharedPreference| { &m.stringSetValue }, - |m: &mut SharedPreference| { &mut m.stringSetValue }, - )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "isStringSetValue", - |m: &SharedPreference| { &m.isStringSetValue }, - |m: &mut SharedPreference| { &mut m.isStringSetValue }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SharedPreference", - fields, - file_descriptor_proto() - ) - }) + 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: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SharedPreference::new) + 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::Clear for SharedPreference { - fn clear(&mut self) { - self.file.clear(); - self.key.clear(); - self.value.clear(); - self.booleanValue = ::std::option::Option::None; - self.stringSetValue.clear(); - self.isStringSetValue = ::std::option::Option::None; - self.unknown_fields.clear(); +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::Debug for SharedPreference { +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 { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default)] +// @@protoc_insertion_point(message:signal.Attachment) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Attachment { // message fields - rowId: ::std::option::Option, - attachmentId: ::std::option::Option, - length: ::std::option::Option, + // @@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 - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, + // @@protoc_insertion_point(special_field:signal.Attachment.special_fields) + pub special_fields: ::protobuf::SpecialFields, } impl<'a> ::std::default::Default for &'a Attachment { @@ -995,10 +913,10 @@ impl Attachment { // optional uint64 rowId = 1; - - pub fn get_rowId(&self) -> u64 { + pub fn rowId(&self) -> u64 { self.rowId.unwrap_or(0) } + pub fn clear_rowId(&mut self) { self.rowId = ::std::option::Option::None; } @@ -1014,10 +932,10 @@ impl Attachment { // optional uint64 attachmentId = 2; - - pub fn get_attachmentId(&self) -> u64 { + pub fn attachmentId(&self) -> u64 { self.attachmentId.unwrap_or(0) } + pub fn clear_attachmentId(&mut self) { self.attachmentId = ::std::option::Option::None; } @@ -1033,10 +951,10 @@ impl Attachment { // optional uint32 length = 3; - - pub fn get_length(&self) -> u32 { + pub fn length(&self) -> u32 { self.length.unwrap_or(0) } + pub fn clear_length(&mut self) { self.length = ::std::option::Option::None; } @@ -1049,40 +967,54 @@ impl Attachment { 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::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_uint64()?; - self.rowId = ::std::option::Option::Some(tmp); + 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()?); }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_uint64()?; - self.attachmentId = ::std::option::Option::Some(tmp); + 16 => { + self.attachmentId = ::std::option::Option::Some(is.read_uint64()?); }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_uint32()?; - self.length = ::std::option::Option::Some(tmp); + 24 => { + self.length = ::std::option::Option::Some(is.read_uint32()?); }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; }, }; } @@ -1091,23 +1023,23 @@ impl ::protobuf::Message for Attachment { // Compute sizes of nested messages #[allow(unused_variables)] - fn compute_size(&self) -> u32 { + fn compute_size(&self) -> u64 { let mut my_size = 0; if let Some(v) = self.rowId { - my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + my_size += ::protobuf::rt::uint64_size(1, v); } if let Some(v) = self.attachmentId { - my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); + my_size += ::protobuf::rt::uint64_size(2, v); } if let Some(v) = self.length { - my_size += ::protobuf::rt::value_size(3, v, ::protobuf::wire_format::WireTypeVarint); + my_size += ::protobuf::rt::uint32_size(3, v); } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); + 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::ProtobufResult<()> { + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { if let Some(v) = self.rowId { os.write_uint64(1, v)?; } @@ -1117,102 +1049,68 @@ impl ::protobuf::Message for Attachment { if let Some(v) = self.length { os.write_uint32(3, v)?; } - os.write_unknown_fields(self.get_unknown_fields())?; + os.write_unknown_fields(self.special_fields.unknown_fields())?; ::std::result::Result::Ok(()) } - fn get_cached_size(&self) -> u32 { - self.cached_size.get() + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields } - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields } - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields + fn new() -> Attachment { + Attachment::new() } - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> Attachment { - Attachment::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( - "rowId", - |m: &Attachment| { &m.rowId }, - |m: &mut Attachment| { &mut m.rowId }, - )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( - "attachmentId", - |m: &Attachment| { &m.attachmentId }, - |m: &mut Attachment| { &mut m.attachmentId }, - )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( - "length", - |m: &Attachment| { &m.length }, - |m: &mut Attachment| { &mut m.length }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "Attachment", - fields, - file_descriptor_proto() - ) - }) + 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: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(Attachment::new) + 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::Clear for Attachment { - fn clear(&mut self) { - self.rowId = ::std::option::Option::None; - self.attachmentId = ::std::option::Option::None; - self.length = ::std::option::Option::None; - self.unknown_fields.clear(); +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::Debug for Attachment { +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 { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default)] +// @@protoc_insertion_point(message:signal.Sticker) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Sticker { // message fields - rowId: ::std::option::Option, - length: ::std::option::Option, + // @@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 - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, + // @@protoc_insertion_point(special_field:signal.Sticker.special_fields) + pub special_fields: ::protobuf::SpecialFields, } impl<'a> ::std::default::Default for &'a Sticker { @@ -1228,10 +1126,10 @@ impl Sticker { // optional uint64 rowId = 1; - - pub fn get_rowId(&self) -> u64 { + pub fn rowId(&self) -> u64 { self.rowId.unwrap_or(0) } + pub fn clear_rowId(&mut self) { self.rowId = ::std::option::Option::None; } @@ -1247,10 +1145,10 @@ impl Sticker { // optional uint32 length = 2; - - pub fn get_length(&self) -> u32 { + pub fn length(&self) -> u32 { self.length.unwrap_or(0) } + pub fn clear_length(&mut self) { self.length = ::std::option::Option::None; } @@ -1263,33 +1161,46 @@ impl Sticker { 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::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_uint64()?; - self.rowId = ::std::option::Option::Some(tmp); + 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()?); }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_uint32()?; - self.length = ::std::option::Option::Some(tmp); + 16 => { + self.length = ::std::option::Option::Some(is.read_uint32()?); }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; }, }; } @@ -1298,117 +1209,88 @@ impl ::protobuf::Message for Sticker { // Compute sizes of nested messages #[allow(unused_variables)] - fn compute_size(&self) -> u32 { + fn compute_size(&self) -> u64 { let mut my_size = 0; if let Some(v) = self.rowId { - my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + my_size += ::protobuf::rt::uint64_size(1, v); } if let Some(v) = self.length { - my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); + my_size += ::protobuf::rt::uint32_size(2, v); } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); + 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::ProtobufResult<()> { + 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.get_unknown_fields())?; + os.write_unknown_fields(self.special_fields.unknown_fields())?; ::std::result::Result::Ok(()) } - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields } - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields } fn new() -> Sticker { Sticker::new() } - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( - "rowId", - |m: &Sticker| { &m.rowId }, - |m: &mut Sticker| { &mut m.rowId }, - )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( - "length", - |m: &Sticker| { &m.length }, - |m: &mut Sticker| { &mut m.length }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "Sticker", - fields, - file_descriptor_proto() - ) - }) + 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: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(Sticker::new) + static instance: Sticker = Sticker { + rowId: ::std::option::Option::None, + length: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance } } -impl ::protobuf::Clear for Sticker { - fn clear(&mut self) { - self.rowId = ::std::option::Option::None; - self.length = ::std::option::Option::None; - self.unknown_fields.clear(); +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::Debug for Sticker { +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 { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default)] +// @@protoc_insertion_point(message:signal.Avatar) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Avatar { // message fields - name: ::protobuf::SingularField<::std::string::String>, - recipientId: ::protobuf::SingularField<::std::string::String>, - length: ::std::option::Option, + // @@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 - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, + // @@protoc_insertion_point(special_field:signal.Avatar.special_fields) + pub special_fields: ::protobuf::SpecialFields, } impl<'a> ::std::default::Default for &'a Avatar { @@ -1424,15 +1306,15 @@ impl Avatar { // optional string name = 1; - - pub fn get_name(&self) -> &str { + pub fn name(&self) -> &str { match self.name.as_ref() { - Some(v) => &v, + Some(v) => v, None => "", } } + pub fn clear_name(&mut self) { - self.name.clear(); + self.name = ::std::option::Option::None; } pub fn has_name(&self) -> bool { @@ -1441,14 +1323,14 @@ impl Avatar { // Param is passed by value, moved pub fn set_name(&mut self, v: ::std::string::String) { - self.name = ::protobuf::SingularField::some(v); + 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.set_default(); + self.name = ::std::option::Option::Some(::std::string::String::new()); } self.name.as_mut().unwrap() } @@ -1460,15 +1342,15 @@ impl Avatar { // optional string recipientId = 3; - - pub fn get_recipientId(&self) -> &str { + pub fn recipientId(&self) -> &str { match self.recipientId.as_ref() { - Some(v) => &v, + Some(v) => v, None => "", } } + pub fn clear_recipientId(&mut self) { - self.recipientId.clear(); + self.recipientId = ::std::option::Option::None; } pub fn has_recipientId(&self) -> bool { @@ -1477,14 +1359,14 @@ impl Avatar { // Param is passed by value, moved pub fn set_recipientId(&mut self, v: ::std::string::String) { - self.recipientId = ::protobuf::SingularField::some(v); + 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.set_default(); + self.recipientId = ::std::option::Option::Some(::std::string::String::new()); } self.recipientId.as_mut().unwrap() } @@ -1496,10 +1378,10 @@ impl Avatar { // optional uint32 length = 2; - - pub fn get_length(&self) -> u32 { + pub fn length(&self) -> u32 { self.length.unwrap_or(0) } + pub fn clear_length(&mut self) { self.length = ::std::option::Option::None; } @@ -1512,32 +1394,54 @@ impl Avatar { 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::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)?; + 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()?); }, - 3 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.recipientId)?; + 26 => { + self.recipientId = ::std::option::Option::Some(is.read_string()?); }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_uint32()?; - self.length = ::std::option::Option::Some(tmp); + 16 => { + self.length = ::std::option::Option::Some(is.read_uint32()?); }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; }, }; } @@ -1546,127 +1450,92 @@ impl ::protobuf::Message for Avatar { // Compute sizes of nested messages #[allow(unused_variables)] - fn compute_size(&self) -> u32 { + fn compute_size(&self) -> u64 { let mut my_size = 0; - if let Some(ref v) = self.name.as_ref() { + if let Some(v) = self.name.as_ref() { my_size += ::protobuf::rt::string_size(1, &v); } - if let Some(ref v) = self.recipientId.as_ref() { + 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::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); + my_size += ::protobuf::rt::uint32_size(2, v); } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); + 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::ProtobufResult<()> { - if let Some(ref v) = self.name.as_ref() { - os.write_string(1, &v)?; + 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(ref v) = self.recipientId.as_ref() { - os.write_string(3, &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.get_unknown_fields())?; + os.write_unknown_fields(self.special_fields.unknown_fields())?; ::std::result::Result::Ok(()) } - fn get_cached_size(&self) -> u32 { - self.cached_size.get() + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields } - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields } fn new() -> Avatar { Avatar::new() } - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "name", - |m: &Avatar| { &m.name }, - |m: &mut Avatar| { &mut m.name }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "recipientId", - |m: &Avatar| { &m.recipientId }, - |m: &mut Avatar| { &mut m.recipientId }, - )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( - "length", - |m: &Avatar| { &m.length }, - |m: &mut Avatar| { &mut m.length }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "Avatar", - fields, - file_descriptor_proto() - ) - }) + 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: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(Avatar::new) + 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::Clear for Avatar { - fn clear(&mut self) { - self.name.clear(); - self.recipientId.clear(); - self.length = ::std::option::Option::None; - self.unknown_fields.clear(); +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::Debug for Avatar { +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 { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default)] +// @@protoc_insertion_point(message:signal.DatabaseVersion) +#[derive(PartialEq,Clone,Default,Debug)] pub struct DatabaseVersion { // message fields - version: ::std::option::Option, + // @@protoc_insertion_point(field:signal.DatabaseVersion.version) + pub version: ::std::option::Option, // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, + // @@protoc_insertion_point(special_field:signal.DatabaseVersion.special_fields) + pub special_fields: ::protobuf::SpecialFields, } impl<'a> ::std::default::Default for &'a DatabaseVersion { @@ -1682,10 +1551,10 @@ impl DatabaseVersion { // optional uint32 version = 1; - - pub fn get_version(&self) -> u32 { + pub fn version(&self) -> u32 { self.version.unwrap_or(0) } + pub fn clear_version(&mut self) { self.version = ::std::option::Option::None; } @@ -1698,26 +1567,38 @@ impl DatabaseVersion { 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::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_uint32()?; - self.version = ::std::option::Option::Some(tmp); + 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()?); }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; }, }; } @@ -1726,104 +1607,78 @@ impl ::protobuf::Message for DatabaseVersion { // Compute sizes of nested messages #[allow(unused_variables)] - fn compute_size(&self) -> u32 { + fn compute_size(&self) -> u64 { let mut my_size = 0; if let Some(v) = self.version { - my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + my_size += ::protobuf::rt::uint32_size(1, v); } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); + 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::ProtobufResult<()> { + 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.get_unknown_fields())?; + os.write_unknown_fields(self.special_fields.unknown_fields())?; ::std::result::Result::Ok(()) } - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields } - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields } fn new() -> DatabaseVersion { DatabaseVersion::new() } - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( - "version", - |m: &DatabaseVersion| { &m.version }, - |m: &mut DatabaseVersion| { &mut m.version }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "DatabaseVersion", - fields, - file_descriptor_proto() - ) - }) + fn clear(&mut self) { + self.version = ::std::option::Option::None; + self.special_fields.clear(); } fn default_instance() -> &'static DatabaseVersion { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(DatabaseVersion::new) + static instance: DatabaseVersion = DatabaseVersion { + version: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance } } -impl ::protobuf::Clear for DatabaseVersion { - fn clear(&mut self) { - self.version = ::std::option::Option::None; - self.unknown_fields.clear(); +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::Debug for DatabaseVersion { +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 { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default)] +// @@protoc_insertion_point(message:signal.Header) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Header { // message fields - iv: ::protobuf::SingularField<::std::vec::Vec>, - salt: ::protobuf::SingularField<::std::vec::Vec>, + // @@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>, // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, + // @@protoc_insertion_point(special_field:signal.Header.special_fields) + pub special_fields: ::protobuf::SpecialFields, } impl<'a> ::std::default::Default for &'a Header { @@ -1839,15 +1694,15 @@ impl Header { // optional bytes iv = 1; - - pub fn get_iv(&self) -> &[u8] { + pub fn iv(&self) -> &[u8] { match self.iv.as_ref() { - Some(v) => &v, + Some(v) => v, None => &[], } } + pub fn clear_iv(&mut self) { - self.iv.clear(); + self.iv = ::std::option::Option::None; } pub fn has_iv(&self) -> bool { @@ -1856,14 +1711,14 @@ impl Header { // Param is passed by value, moved pub fn set_iv(&mut self, v: ::std::vec::Vec) { - self.iv = ::protobuf::SingularField::some(v); + 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.set_default(); + self.iv = ::std::option::Option::Some(::std::vec::Vec::new()); } self.iv.as_mut().unwrap() } @@ -1875,15 +1730,15 @@ impl Header { // optional bytes salt = 2; - - pub fn get_salt(&self) -> &[u8] { + pub fn salt(&self) -> &[u8] { match self.salt.as_ref() { - Some(v) => &v, + Some(v) => v, None => &[], } } + pub fn clear_salt(&mut self) { - self.salt.clear(); + self.salt = ::std::option::Option::None; } pub fn has_salt(&self) -> bool { @@ -1892,14 +1747,14 @@ impl Header { // Param is passed by value, moved pub fn set_salt(&mut self, v: ::std::vec::Vec) { - self.salt = ::protobuf::SingularField::some(v); + 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.set_default(); + self.salt = ::std::option::Option::Some(::std::vec::Vec::new()); } self.salt.as_mut().unwrap() } @@ -1908,25 +1763,46 @@ impl Header { pub fn take_salt(&mut self) -> ::std::vec::Vec { self.salt.take().unwrap_or_else(|| ::std::vec::Vec::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::<_, _>( + "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 }, + )); + ::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::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.iv)?; + 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()?); }, - 2 => { - ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.salt)?; + 18 => { + self.salt = ::std::option::Option::Some(is.read_bytes()?); }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; }, }; } @@ -1935,121 +1811,96 @@ impl ::protobuf::Message for Header { // Compute sizes of nested messages #[allow(unused_variables)] - fn compute_size(&self) -> u32 { + fn compute_size(&self) -> u64 { let mut my_size = 0; - if let Some(ref v) = self.iv.as_ref() { + if let Some(v) = self.iv.as_ref() { my_size += ::protobuf::rt::bytes_size(1, &v); } - if let Some(ref v) = self.salt.as_ref() { + if let Some(v) = self.salt.as_ref() { my_size += ::protobuf::rt::bytes_size(2, &v); } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); + 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::ProtobufResult<()> { - if let Some(ref v) = self.iv.as_ref() { - os.write_bytes(1, &v)?; + 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(ref v) = self.salt.as_ref() { - os.write_bytes(2, &v)?; + if let Some(v) = self.salt.as_ref() { + os.write_bytes(2, v)?; } - os.write_unknown_fields(self.get_unknown_fields())?; + os.write_unknown_fields(self.special_fields.unknown_fields())?; ::std::result::Result::Ok(()) } - fn get_cached_size(&self) -> u32 { - self.cached_size.get() + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields } - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields } fn new() -> Header { Header::new() } - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "iv", - |m: &Header| { &m.iv }, - |m: &mut Header| { &mut m.iv }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "salt", - |m: &Header| { &m.salt }, - |m: &mut Header| { &mut m.salt }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::
( - "Header", - fields, - file_descriptor_proto() - ) - }) + fn clear(&mut self) { + self.iv = ::std::option::Option::None; + self.salt = ::std::option::Option::None; + self.special_fields.clear(); } fn default_instance() -> &'static Header { - static instance: ::protobuf::rt::LazyV2
= ::protobuf::rt::LazyV2::INIT; - instance.get(Header::new) + static instance: Header = Header { + iv: ::std::option::Option::None, + salt: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance } } -impl ::protobuf::Clear for Header { - fn clear(&mut self) { - self.iv.clear(); - self.salt.clear(); - self.unknown_fields.clear(); +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::Debug for Header { +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 { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default)] +// @@protoc_insertion_point(message:signal.KeyValue) +#[derive(PartialEq,Clone,Default,Debug)] pub struct KeyValue { // message fields - key: ::protobuf::SingularField<::std::string::String>, - blobValue: ::protobuf::SingularField<::std::vec::Vec>, - booleanValue: ::std::option::Option, - floatValue: ::std::option::Option, - integerValue: ::std::option::Option, - longValue: ::std::option::Option, - stringValue: ::protobuf::SingularField<::std::string::String>, + // @@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 - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, + // @@protoc_insertion_point(special_field:signal.KeyValue.special_fields) + pub special_fields: ::protobuf::SpecialFields, } impl<'a> ::std::default::Default for &'a KeyValue { @@ -2065,15 +1916,15 @@ impl KeyValue { // optional string key = 1; - - pub fn get_key(&self) -> &str { + pub fn key(&self) -> &str { match self.key.as_ref() { - Some(v) => &v, + Some(v) => v, None => "", } } + pub fn clear_key(&mut self) { - self.key.clear(); + self.key = ::std::option::Option::None; } pub fn has_key(&self) -> bool { @@ -2082,14 +1933,14 @@ impl KeyValue { // Param is passed by value, moved pub fn set_key(&mut self, v: ::std::string::String) { - self.key = ::protobuf::SingularField::some(v); + 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.set_default(); + self.key = ::std::option::Option::Some(::std::string::String::new()); } self.key.as_mut().unwrap() } @@ -2101,15 +1952,15 @@ impl KeyValue { // optional bytes blobValue = 2; - - pub fn get_blobValue(&self) -> &[u8] { + pub fn blobValue(&self) -> &[u8] { match self.blobValue.as_ref() { - Some(v) => &v, + Some(v) => v, None => &[], } } + pub fn clear_blobValue(&mut self) { - self.blobValue.clear(); + self.blobValue = ::std::option::Option::None; } pub fn has_blobValue(&self) -> bool { @@ -2118,14 +1969,14 @@ impl KeyValue { // Param is passed by value, moved pub fn set_blobValue(&mut self, v: ::std::vec::Vec) { - self.blobValue = ::protobuf::SingularField::some(v); + 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.set_default(); + self.blobValue = ::std::option::Option::Some(::std::vec::Vec::new()); } self.blobValue.as_mut().unwrap() } @@ -2137,10 +1988,10 @@ impl KeyValue { // optional bool booleanValue = 3; - - pub fn get_booleanValue(&self) -> bool { + pub fn booleanValue(&self) -> bool { self.booleanValue.unwrap_or(false) } + pub fn clear_booleanValue(&mut self) { self.booleanValue = ::std::option::Option::None; } @@ -2156,10 +2007,10 @@ impl KeyValue { // optional float floatValue = 4; - - pub fn get_floatValue(&self) -> f32 { + pub fn floatValue(&self) -> f32 { self.floatValue.unwrap_or(0.) } + pub fn clear_floatValue(&mut self) { self.floatValue = ::std::option::Option::None; } @@ -2175,10 +2026,10 @@ impl KeyValue { // optional int32 integerValue = 5; - - pub fn get_integerValue(&self) -> i32 { + pub fn integerValue(&self) -> i32 { self.integerValue.unwrap_or(0) } + pub fn clear_integerValue(&mut self) { self.integerValue = ::std::option::Option::None; } @@ -2194,10 +2045,10 @@ impl KeyValue { // optional int64 longValue = 6; - - pub fn get_longValue(&self) -> i64 { + pub fn longValue(&self) -> i64 { self.longValue.unwrap_or(0) } + pub fn clear_longValue(&mut self) { self.longValue = ::std::option::Option::None; } @@ -2213,15 +2064,15 @@ impl KeyValue { // optional string stringValue = 7; - - pub fn get_stringValue(&self) -> &str { + pub fn stringValue(&self) -> &str { match self.stringValue.as_ref() { - Some(v) => &v, + Some(v) => v, None => "", } } + pub fn clear_stringValue(&mut self) { - self.stringValue.clear(); + self.stringValue = ::std::option::Option::None; } pub fn has_stringValue(&self) -> bool { @@ -2230,14 +2081,14 @@ impl KeyValue { // Param is passed by value, moved pub fn set_stringValue(&mut self, v: ::std::string::String) { - self.stringValue = ::protobuf::SingularField::some(v); + 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.set_default(); + self.stringValue = ::std::option::Option::Some(::std::string::String::new()); } self.stringValue.as_mut().unwrap() } @@ -2246,56 +2097,86 @@ impl KeyValue { 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::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.key)?; + 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()?); }, - 2 => { - ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.blobValue)?; + 18 => { + self.blobValue = ::std::option::Option::Some(is.read_bytes()?); }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.booleanValue = ::std::option::Option::Some(tmp); + 24 => { + self.booleanValue = ::std::option::Option::Some(is.read_bool()?); }, - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeFixed32 { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_float()?; - self.floatValue = ::std::option::Option::Some(tmp); + 37 => { + self.floatValue = ::std::option::Option::Some(is.read_float()?); }, - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int32()?; - self.integerValue = ::std::option::Option::Some(tmp); + 40 => { + self.integerValue = ::std::option::Option::Some(is.read_int32()?); }, - 6 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int64()?; - self.longValue = ::std::option::Option::Some(tmp); + 48 => { + self.longValue = ::std::option::Option::Some(is.read_int64()?); }, - 7 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.stringValue)?; + 58 => { + self.stringValue = ::std::option::Option::Some(is.read_string()?); }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; }, }; } @@ -2304,40 +2185,40 @@ impl ::protobuf::Message for KeyValue { // Compute sizes of nested messages #[allow(unused_variables)] - fn compute_size(&self) -> u32 { + fn compute_size(&self) -> u64 { let mut my_size = 0; - if let Some(ref v) = self.key.as_ref() { + if let Some(v) = self.key.as_ref() { my_size += ::protobuf::rt::string_size(1, &v); } - if let Some(ref v) = self.blobValue.as_ref() { + if let Some(v) = self.blobValue.as_ref() { my_size += ::protobuf::rt::bytes_size(2, &v); } if let Some(v) = self.booleanValue { - my_size += 2; + my_size += 1 + 1; } if let Some(v) = self.floatValue { - my_size += 5; + my_size += 1 + 4; } if let Some(v) = self.integerValue { - my_size += ::protobuf::rt::value_size(5, v, ::protobuf::wire_format::WireTypeVarint); + my_size += ::protobuf::rt::int32_size(5, v); } if let Some(v) = self.longValue { - my_size += ::protobuf::rt::value_size(6, v, ::protobuf::wire_format::WireTypeVarint); + my_size += ::protobuf::rt::int64_size(6, v); } - if let Some(ref v) = self.stringValue.as_ref() { + if let Some(v) = self.stringValue.as_ref() { my_size += ::protobuf::rt::string_size(7, &v); } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); + 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::ProtobufResult<()> { - if let Some(ref v) = self.key.as_ref() { - os.write_string(1, &v)?; + 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(ref v) = self.blobValue.as_ref() { - os.write_bytes(2, &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)?; @@ -2351,136 +2232,93 @@ impl ::protobuf::Message for KeyValue { if let Some(v) = self.longValue { os.write_int64(6, v)?; } - if let Some(ref v) = self.stringValue.as_ref() { - os.write_string(7, &v)?; + if let Some(v) = self.stringValue.as_ref() { + os.write_string(7, v)?; } - os.write_unknown_fields(self.get_unknown_fields())?; + os.write_unknown_fields(self.special_fields.unknown_fields())?; ::std::result::Result::Ok(()) } - fn get_cached_size(&self) -> u32 { - self.cached_size.get() + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields } - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields } fn new() -> KeyValue { KeyValue::new() } - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "key", - |m: &KeyValue| { &m.key }, - |m: &mut KeyValue| { &mut m.key }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "blobValue", - |m: &KeyValue| { &m.blobValue }, - |m: &mut KeyValue| { &mut m.blobValue }, - )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "booleanValue", - |m: &KeyValue| { &m.booleanValue }, - |m: &mut KeyValue| { &mut m.booleanValue }, - )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeFloat>( - "floatValue", - |m: &KeyValue| { &m.floatValue }, - |m: &mut KeyValue| { &mut m.floatValue }, - )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( - "integerValue", - |m: &KeyValue| { &m.integerValue }, - |m: &mut KeyValue| { &mut m.integerValue }, - )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( - "longValue", - |m: &KeyValue| { &m.longValue }, - |m: &mut KeyValue| { &mut m.longValue }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "stringValue", - |m: &KeyValue| { &m.stringValue }, - |m: &mut KeyValue| { &mut m.stringValue }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "KeyValue", - fields, - file_descriptor_proto() - ) - }) + 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: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(KeyValue::new) + 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::Clear for KeyValue { - fn clear(&mut self) { - self.key.clear(); - self.blobValue.clear(); - 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.clear(); - self.unknown_fields.clear(); +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::Debug for KeyValue { +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 { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default)] +// @@protoc_insertion_point(message:signal.BackupFrame) +#[derive(PartialEq,Clone,Default,Debug)] pub struct BackupFrame { // message fields - pub header: ::protobuf::SingularPtrField
, - pub statement: ::protobuf::SingularPtrField, - pub preference: ::protobuf::SingularPtrField, - pub attachment: ::protobuf::SingularPtrField, - pub version: ::protobuf::SingularPtrField, - end: ::std::option::Option, - pub avatar: ::protobuf::SingularPtrField, - pub sticker: ::protobuf::SingularPtrField, - pub keyValue: ::protobuf::SingularPtrField, + // @@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 - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, + // @@protoc_insertion_point(special_field:signal.BackupFrame.special_fields) + pub special_fields: ::protobuf::SpecialFields, } impl<'a> ::std::default::Default for &'a BackupFrame { @@ -2494,177 +2332,12 @@ impl BackupFrame { ::std::default::Default::default() } - // optional .signal.Header header = 1; - - - pub fn get_header(&self) -> &Header { - self.header.as_ref().unwrap_or_else(||
::default_instance()) - } - pub fn clear_header(&mut self) { - self.header.clear(); - } - - pub fn has_header(&self) -> bool { - self.header.is_some() - } - - // Param is passed by value, moved - pub fn set_header(&mut self, v: Header) { - self.header = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_header(&mut self) -> &mut Header { - if self.header.is_none() { - self.header.set_default(); - } - self.header.as_mut().unwrap() - } - - // Take field - pub fn take_header(&mut self) -> Header { - self.header.take().unwrap_or_else(|| Header::new()) - } - - // optional .signal.SqlStatement statement = 2; - - - pub fn get_statement(&self) -> &SqlStatement { - self.statement.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_statement(&mut self) { - self.statement.clear(); - } - - pub fn has_statement(&self) -> bool { - self.statement.is_some() - } - - // Param is passed by value, moved - pub fn set_statement(&mut self, v: SqlStatement) { - self.statement = ::protobuf::SingularPtrField::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 SqlStatement { - if self.statement.is_none() { - self.statement.set_default(); - } - self.statement.as_mut().unwrap() - } - - // Take field - pub fn take_statement(&mut self) -> SqlStatement { - self.statement.take().unwrap_or_else(|| SqlStatement::new()) - } - - // optional .signal.SharedPreference preference = 3; - - - pub fn get_preference(&self) -> &SharedPreference { - self.preference.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_preference(&mut self) { - self.preference.clear(); - } - - pub fn has_preference(&self) -> bool { - self.preference.is_some() - } - - // Param is passed by value, moved - pub fn set_preference(&mut self, v: SharedPreference) { - self.preference = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_preference(&mut self) -> &mut SharedPreference { - if self.preference.is_none() { - self.preference.set_default(); - } - self.preference.as_mut().unwrap() - } - - // Take field - pub fn take_preference(&mut self) -> SharedPreference { - self.preference.take().unwrap_or_else(|| SharedPreference::new()) - } - - // optional .signal.Attachment attachment = 4; - - - pub fn get_attachment(&self) -> &Attachment { - self.attachment.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_attachment(&mut self) { - self.attachment.clear(); - } - - pub fn has_attachment(&self) -> bool { - self.attachment.is_some() - } - - // Param is passed by value, moved - pub fn set_attachment(&mut self, v: Attachment) { - self.attachment = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_attachment(&mut self) -> &mut Attachment { - if self.attachment.is_none() { - self.attachment.set_default(); - } - self.attachment.as_mut().unwrap() - } - - // Take field - pub fn take_attachment(&mut self) -> Attachment { - self.attachment.take().unwrap_or_else(|| Attachment::new()) - } - - // optional .signal.DatabaseVersion version = 5; - - - pub fn get_version(&self) -> &DatabaseVersion { - self.version.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_version(&mut self) { - self.version.clear(); - } - - pub fn has_version(&self) -> bool { - self.version.is_some() - } - - // Param is passed by value, moved - pub fn set_version(&mut self, v: DatabaseVersion) { - self.version = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_version(&mut self) -> &mut DatabaseVersion { - if self.version.is_none() { - self.version.set_default(); - } - self.version.as_mut().unwrap() - } - - // Take field - pub fn take_version(&mut self) -> DatabaseVersion { - self.version.take().unwrap_or_else(|| DatabaseVersion::new()) - } - // optional bool end = 6; - - pub fn get_end(&self) -> bool { + pub fn end(&self) -> bool { self.end.unwrap_or(false) } + pub fn clear_end(&mut self) { self.end = ::std::option::Option::None; } @@ -2678,188 +2351,101 @@ impl BackupFrame { self.end = ::std::option::Option::Some(v); } - // optional .signal.Avatar avatar = 7; - - - pub fn get_avatar(&self) -> &Avatar { - self.avatar.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_avatar(&mut self) { - self.avatar.clear(); - } - - pub fn has_avatar(&self) -> bool { - self.avatar.is_some() - } - - // Param is passed by value, moved - pub fn set_avatar(&mut self, v: Avatar) { - self.avatar = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_avatar(&mut self) -> &mut Avatar { - if self.avatar.is_none() { - self.avatar.set_default(); - } - self.avatar.as_mut().unwrap() - } - - // Take field - pub fn take_avatar(&mut self) -> Avatar { - self.avatar.take().unwrap_or_else(|| Avatar::new()) - } - - // optional .signal.Sticker sticker = 8; - - - pub fn get_sticker(&self) -> &Sticker { - self.sticker.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_sticker(&mut self) { - self.sticker.clear(); - } - - pub fn has_sticker(&self) -> bool { - self.sticker.is_some() - } - - // Param is passed by value, moved - pub fn set_sticker(&mut self, v: Sticker) { - self.sticker = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_sticker(&mut self) -> &mut Sticker { - if self.sticker.is_none() { - self.sticker.set_default(); - } - self.sticker.as_mut().unwrap() - } - - // Take field - pub fn take_sticker(&mut self) -> Sticker { - self.sticker.take().unwrap_or_else(|| Sticker::new()) - } - - // optional .signal.KeyValue keyValue = 9; - - - pub fn get_keyValue(&self) -> &KeyValue { - self.keyValue.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_keyValue(&mut self) { - self.keyValue.clear(); - } - - pub fn has_keyValue(&self) -> bool { - self.keyValue.is_some() - } - - // Param is passed by value, moved - pub fn set_keyValue(&mut self, v: KeyValue) { - self.keyValue = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_keyValue(&mut self) -> &mut KeyValue { - if self.keyValue.is_none() { - self.keyValue.set_default(); - } - self.keyValue.as_mut().unwrap() - } - - // Take field - pub fn take_keyValue(&mut self) -> KeyValue { - self.keyValue.take().unwrap_or_else(|| KeyValue::new()) + 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 { - for v in &self.header { - if !v.is_initialized() { - return false; - } - }; - for v in &self.statement { - if !v.is_initialized() { - return false; - } - }; - for v in &self.preference { - if !v.is_initialized() { - return false; - } - }; - for v in &self.attachment { - if !v.is_initialized() { - return false; - } - }; - for v in &self.version { - if !v.is_initialized() { - return false; - } - }; - for v in &self.avatar { - if !v.is_initialized() { - return false; - } - }; - for v in &self.sticker { - if !v.is_initialized() { - return false; - } - }; - for v in &self.keyValue { - if !v.is_initialized() { - return false; - } - }; true } - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.header)?; + 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)?; }, - 2 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.statement)?; + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.statement)?; }, - 3 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.preference)?; + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.preference)?; }, - 4 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.attachment)?; + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.attachment)?; }, - 5 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.version)?; + 42 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.version)?; }, - 6 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.end = ::std::option::Option::Some(tmp); + 48 => { + self.end = ::std::option::Option::Some(is.read_bool()?); }, - 7 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.avatar)?; + 58 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.avatar)?; }, - 8 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.sticker)?; + 66 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.sticker)?; }, - 9 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.keyValue)?; + 74 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.keyValue)?; }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; }, }; } @@ -2868,190 +2454,92 @@ impl ::protobuf::Message for BackupFrame { // Compute sizes of nested messages #[allow(unused_variables)] - fn compute_size(&self) -> u32 { + fn compute_size(&self) -> u64 { let mut my_size = 0; - if let Some(ref v) = self.header.as_ref() { + if let Some(v) = self.header.as_ref() { let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; } - if let Some(ref v) = self.statement.as_ref() { + if let Some(v) = self.statement.as_ref() { let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; } - if let Some(ref v) = self.preference.as_ref() { + if let Some(v) = self.preference.as_ref() { let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; } - if let Some(ref v) = self.attachment.as_ref() { + if let Some(v) = self.attachment.as_ref() { let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; } - if let Some(ref v) = self.version.as_ref() { + if let Some(v) = self.version.as_ref() { let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; } if let Some(v) = self.end { - my_size += 2; + my_size += 1 + 1; } - if let Some(ref v) = self.avatar.as_ref() { + if let Some(v) = self.avatar.as_ref() { let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; } - if let Some(ref v) = self.sticker.as_ref() { + if let Some(v) = self.sticker.as_ref() { let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; } - if let Some(ref v) = self.keyValue.as_ref() { + if let Some(v) = self.keyValue.as_ref() { let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); + 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::ProtobufResult<()> { - if let Some(ref v) = self.header.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; + 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(ref v) = self.statement.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; + if let Some(v) = self.statement.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; } - if let Some(ref v) = self.preference.as_ref() { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; + if let Some(v) = self.preference.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; } - if let Some(ref v) = self.attachment.as_ref() { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; + if let Some(v) = self.attachment.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; } - if let Some(ref v) = self.version.as_ref() { - os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(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(ref v) = self.avatar.as_ref() { - os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; + if let Some(v) = self.avatar.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(7, v, os)?; } - if let Some(ref v) = self.sticker.as_ref() { - os.write_tag(8, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; + if let Some(v) = self.sticker.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(8, v, os)?; } - if let Some(ref v) = self.keyValue.as_ref() { - os.write_tag(9, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(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.get_unknown_fields())?; + os.write_unknown_fields(self.special_fields.unknown_fields())?; ::std::result::Result::Ok(()) } - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields } - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields } fn new() -> BackupFrame { BackupFrame::new() } - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage
>( - "header", - |m: &BackupFrame| { &m.header }, - |m: &mut BackupFrame| { &mut m.header }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "statement", - |m: &BackupFrame| { &m.statement }, - |m: &mut BackupFrame| { &mut m.statement }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "preference", - |m: &BackupFrame| { &m.preference }, - |m: &mut BackupFrame| { &mut m.preference }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "attachment", - |m: &BackupFrame| { &m.attachment }, - |m: &mut BackupFrame| { &mut m.attachment }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "version", - |m: &BackupFrame| { &m.version }, - |m: &mut BackupFrame| { &mut m.version }, - )); - fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "end", - |m: &BackupFrame| { &m.end }, - |m: &mut BackupFrame| { &mut m.end }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "avatar", - |m: &BackupFrame| { &m.avatar }, - |m: &mut BackupFrame| { &mut m.avatar }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "sticker", - |m: &BackupFrame| { &m.sticker }, - |m: &mut BackupFrame| { &mut m.sticker }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "keyValue", - |m: &BackupFrame| { &m.keyValue }, - |m: &mut BackupFrame| { &mut m.keyValue }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "BackupFrame", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static BackupFrame { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(BackupFrame::new) - } -} - -impl ::protobuf::Clear for BackupFrame { fn clear(&mut self) { self.header.clear(); self.statement.clear(); @@ -3062,20 +2550,41 @@ impl ::protobuf::Clear for BackupFrame { self.avatar.clear(); self.sticker.clear(); self.keyValue.clear(); - self.unknown_fields.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::Debug for BackupFrame { +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 { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } static file_descriptor_proto_data: &'static [u8] = b"\ @@ -3119,14 +2628,40 @@ static file_descriptor_proto_data: &'static [u8] = b"\ org.thoughtcrime.securesms.backupB\x0cBackupProtos\ "; -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +/// `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() + }) } -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| { - parse_descriptor_proto() +/// `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/args.rs b/src/args.rs index 8e16d38..ace4cc6 100644 --- a/src/args.rs +++ b/src/args.rs @@ -1,9 +1,56 @@ // imports use anyhow::anyhow; use anyhow::Context; -use clap::{crate_authors, crate_description, crate_name, crate_version}; +use clap::Parser; use std::io::BufRead; +#[derive(Parser)] +#[command(name = clap::crate_name!())] +#[command(version = clap::crate_version!())] +#[command(about = clap::crate_description!())] +#[command(author = clap::crate_authors!())] +struct Args { + /// Sets the input file to use + #[arg(value_name = "INPUT", required = true)] + input_file: std::path::PathBuf, + + /// Directory to save output to. If not given, input file directory is used + #[arg(short = 'o', long = "output-path", value_name = "FOLDER")] + output_path: Option, + + /// Output type, either RAW, CSV or NONE + #[arg(short = 't', long = "output-type", value_name = "TYPE")] + output_type: Option, + + /// Verbosity level, either DEBUG, INFO, WARN, or ERROR + #[arg(short = 'v', long = "verbosity", value_name = "LEVEL")] + log_level: Option, + + /// Overwrite existing output files + #[arg(short = 'f', long = "force")] + force_overwrite: bool, + + /// Do not verify the HMAC of each frame in the backup + #[arg(long = "no-verify-mac")] + no_verify_mac: bool, + + /// Do not use in memory sqlite database. Database is immediately created on disk (only considered with output type RAW). + #[arg(long = "no-in-memory-db")] + no_in_memory_db: bool, + + /// Backup password (30 digits, with or without spaces) + #[arg(short = 'p', long = "password", value_name = "PASSWORD", group = "password")] + password_string: Option, + + /// File to read the backup password from + #[arg(long = "password-file", value_name = "FILE", group = "password")] + password_file: Option, + + /// Read backup password from stdout from COMMAND + #[arg(long = "password-command", value_name = "COMMAND", group = "password")] + password_command: Option, +} + /// Config struct /// /// Stores all global variables @@ -29,119 +76,42 @@ pub struct Config { impl Config { /// Create new config object pub fn new() -> Result { - let matches = clap::App::new(crate_name!()) - .version(crate_version!()) - .about(crate_description!()) - .author(crate_authors!()) - .arg( - clap::Arg::with_name("input-file") - .help("Sets the input file to use") - .takes_value(true) - .value_name("INPUT") - .required(true) - .index(1), - ) - .arg( - clap::Arg::with_name("output-path") - .help("Directory to save output to. If not given, input file directory is used") - .long("output-path") - .short("o") - .takes_value(true) - .value_name("FOLDER"), - ) - .arg( - clap::Arg::with_name("output-type") - .help("Output type, either RAW, CSV or NONE") - .long("output-type") - .short("t") - .takes_value(true) - .value_name("TYPE"), - ) - .arg( - clap::Arg::with_name("log-level") - .help("Verbosity level, either DEBUG, INFO, WARN, or ERROR") - .long("verbosity") - .short("v") - .takes_value(true) - .value_name("LEVEL"), - ) - .arg( - clap::Arg::with_name("force-overwrite") - .help("Overwrite existing output files") - .long("force") - .short("f"), - ) - .arg( - clap::Arg::with_name("no-verify-mac") - .help("Do not verify the HMAC of each frame in the backup") - .long("no-verify-mac"), - ) - .arg( - clap::Arg::with_name("no-in-memory-db") - .help("Do not use in memory sqlite database. Database is immediately created on disk (only considered with output type RAW).") - .long("no-in-memory-db"), - ) - .arg( - clap::Arg::with_name("password-string") - .help("Backup password (30 digits, with or without spaces)") - .long("password") - .takes_value(true) - .value_name("PASSWORD") - .short("p"), - ) - .arg( - clap::Arg::with_name("password-file") - .help("File to read the backup password from") - .long("password-file") - .takes_value(true) - .value_name("FILE"), - ) - .arg( - clap::Arg::with_name("password-command") - .help("Read backup password from stdout from COMMAND") - .long("password-command") - .takes_value(true) - .value_name("COMMAND"), - ) - .group( - clap::ArgGroup::with_name("password") - .args(&["password-string", "password-file", "password-command"]) - .required(true) - .multiple(false), - ) - .get_matches(); + let args = Args::parse(); // input file handling - let input_file = std::path::PathBuf::from(matches.value_of("input-file").unwrap()); + let input_file = args.input_file; // output path handling - let output_path = std::path::PathBuf::from(matches.value_of("output-path").unwrap_or({ - input_file - .file_stem() - .unwrap() - .to_str() - .context("output-path is not given and path to input file could not be read.")? - })); + let output_path = if let Some(path) = args.output_path { + path + } else { + std::path::PathBuf::from( + input_file + .file_stem() + .context("Could not determine output path from input file")? + .to_str() + .context("Output path contains invalid characters")?, + ) + }; // password handling let mut password = { - if matches.is_present("password-string") { - String::from(matches.value_of("password-string").unwrap()) - } else if matches.is_present("password-file") { + if let Some(pwd) = args.password_string { + pwd + } else if let Some(file_path) = args.password_file { let password_file = std::io::BufReader::new( - std::fs::File::open(matches.value_of("password-file").unwrap()) - .context("Unable to open password file")?, + std::fs::File::open(file_path).context("Unable to open password file")?, ); password_file .lines() .next() .context("Password file is empty")? .context("Unable to read from password file")? - } else if matches.is_present("password-command") { + } else if let Some(command) = args.password_command { let shell = std::env::var("SHELL").context("Could not determine current shell")?; let output = std::process::Command::new(shell) .arg("-c") - .arg(matches.value_of("password-command").unwrap()) + .arg(command) .output() .context("Failed to execute password command")?; @@ -157,7 +127,7 @@ impl Config { return Err(anyhow!("Password command returned error code")); } } else { - unreachable!() + return Err(anyhow!("No password provided")); } }; password.retain(|c| c >= '0' && c <= '9'); @@ -169,7 +139,7 @@ impl Config { } // verbosity handling - let log_level = if let Some(x) = matches.value_of("log-level") { + let log_level = if let Some(x) = args.log_level { match x.to_lowercase().as_str() { "debug" => log::LevelFilter::Debug, "info" => log::LevelFilter::Info, @@ -182,7 +152,7 @@ impl Config { }; // determine output type - let output_type = if let Some(x) = matches.value_of("output-type") { + let output_type = if let Some(x) = args.output_type { match x.to_lowercase().as_str() { "none" => crate::output::SignalOutputType::None, "raw" => crate::output::SignalOutputType::Raw, @@ -197,11 +167,11 @@ impl Config { path_input: input_file, path_output: output_path, password, - verify_mac: !matches.is_present("no_verify_mac"), + verify_mac: !args.no_verify_mac, log_level, - force_overwrite: matches.is_present("force-overwrite"), + force_overwrite: args.force_overwrite, output_type, - output_raw_db_in_memory: !matches.is_present("no-in-memory-db"), + output_raw_db_in_memory: !args.no_in_memory_db, }) } } diff --git a/src/frame.rs b/src/frame.rs index ed57c8f..64228a1 100644 --- a/src/frame.rs +++ b/src/frame.rs @@ -51,31 +51,31 @@ impl Frame { let mut fields_count = 0; let mut ret: Option = None; - if frame.has_header() { + if frame.header.is_some() { fields_count += 1; - let mut header = frame.take_header(); + let header = frame.header.take().unwrap(); ret = Some(Self::Header { - salt: header.take_salt(), - iv: header.take_iv(), + salt: header.salt.unwrap_or_default(), + iv: header.iv.unwrap_or_default(), }); }; - if frame.has_statement() { + if frame.statement.is_some() { fields_count += 1; - let mut statement = frame.take_statement(); + let statement = frame.statement.take().unwrap(); ret = Some(Self::Statement { - statement: statement.take_statement(), + statement: statement.statement.clone().unwrap_or_default(), parameter: { let mut params: Vec = Vec::new(); - for param in statement.take_parameters().iter_mut() { + for param in statement.parameters.iter() { if param.has_stringParamter() { - params.push(param.take_stringParamter().into()); + params.push(param.stringParamter().to_string().into()); } else if param.has_integerParameter() { - params.push((param.get_integerParameter() as i64).into()); + params.push((param.integerParameter() as i64).into()); } else if param.has_doubleParameter() { - params.push(param.get_doubleParameter().into()); + params.push(param.doubleParameter().into()); } else if param.has_blobParameter() { - params.push(param.take_blobParameter().into()); + params.push(param.blobParameter().to_vec().into()); } else if param.has_nullparameter() { params.push(rusqlite::types::Null.into()); } else { @@ -87,28 +87,29 @@ impl Frame { }); }; - if frame.has_preference() { + if frame.preference.is_some() { fields_count += 1; ret = Some(Self::Preference { - preference: frame.take_preference(), + preference: frame.preference.take().unwrap(), }); }; - if frame.has_attachment() { + if frame.attachment.is_some() { fields_count += 1; - let attachment = frame.take_attachment(); + let attachment = frame.attachment.as_ref().unwrap(); ret = Some(Self::Attachment { - data_length: attachment.get_length().try_into().unwrap(), - id: attachment.get_attachmentId(), - row: attachment.get_rowId(), + data_length: attachment.length.unwrap_or(0).try_into().unwrap(), + id: attachment.attachmentId.unwrap_or(0), + row: attachment.rowId.unwrap_or(0), data: None, }); }; - if frame.has_version() { + if frame.version.is_some() { fields_count += 1; + let version = frame.version.as_ref().unwrap(); ret = Some(Self::Version { - version: frame.get_version().get_version(), + version: version.version.unwrap_or(0), }); }; @@ -117,29 +118,29 @@ impl Frame { ret = Some(Self::End); }; - if frame.has_avatar() { + if frame.avatar.is_some() { fields_count += 1; - let mut avatar = frame.take_avatar(); + let avatar = frame.avatar.as_ref().unwrap(); ret = Some(Self::Avatar { - data_length: avatar.get_length().try_into().unwrap(), - name: avatar.take_name(), + data_length: avatar.length.unwrap_or(0).try_into().unwrap(), + name: avatar.name.clone().unwrap_or_default(), data: None, }); }; - if frame.has_sticker() { + if frame.sticker.is_some() { fields_count += 1; - let sticker = frame.take_sticker(); + let sticker = frame.sticker.as_ref().unwrap(); ret = Some(Self::Sticker { - data_length: sticker.get_length().try_into().unwrap(), - row: sticker.get_rowId(), + data_length: sticker.length.unwrap_or(0).try_into().unwrap(), + row: sticker.rowId.unwrap_or(0), data: None, }); }; - if frame.has_keyValue() { + if frame.keyValue.is_some() { fields_count += 1; - let key_value = frame.take_keyValue(); + let key_value = frame.keyValue.take().unwrap(); ret = Some(Self::KeyValue { key_value }); @@ -157,9 +158,9 @@ impl Frame { pub fn set_data(&mut self, data_add: Vec) { match self { - Frame::Attachment { ref mut data, .. } => *data = Some(data_add), - Frame::Avatar { ref mut data, .. } => *data = Some(data_add), - Frame::Sticker { ref mut data, .. } => *data = Some(data_add), + Frame::Attachment { data, .. } => *data = Some(data_add), + Frame::Avatar { data, .. } => *data = Some(data_add), + Frame::Sticker { data, .. } => *data = Some(data_add), _ => panic!("Cannot set data on variant without data field."), } } diff --git a/src/mod.rs b/src/mod.rs new file mode 100644 index 0000000..584181c --- /dev/null +++ b/src/mod.rs @@ -0,0 +1,3 @@ +// @generated + +pub mod Backups; diff --git a/src/output_raw.rs b/src/output_raw.rs index dc44fc4..1ad1f53 100644 --- a/src/output_raw.rs +++ b/src/output_raw.rs @@ -213,7 +213,7 @@ impl crate::output::SignalOutput for SignalOutputRaw { .with_context(|| format!("Failed to create path: {}", path.to_string_lossy()))?; // open connection to file - let path = path.join(pref.get_file()); + let path = path.join(pref.file()); if path.exists() && !self.force_write && !self.created_files.contains(&path) { return Err(anyhow!( "Config file does already exist: {}. Try -f", @@ -224,7 +224,7 @@ impl crate::output::SignalOutput for SignalOutputRaw { // write to file let mut conf = ini::Ini::load_from_file(&path).unwrap_or_default(); conf.with_section(None::) - .set(pref.get_key(), pref.get_value()); + .set(pref.key(), pref.value()); conf.write_to_file(&path).with_context(|| { format!( "Could not write to preference file: {}",