From e3495c2d7db1ea3bf7c199ab5d263e19ee559ede Mon Sep 17 00:00:00 2001 From: Christopher Sardegna Date: Sat, 23 Nov 2024 18:58:31 -0800 Subject: [PATCH 1/4] Update test fixture --- imessage-exporter/src/exporters/html.rs | 8 ++------ imessage-exporter/src/exporters/txt.rs | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/imessage-exporter/src/exporters/html.rs b/imessage-exporter/src/exporters/html.rs index dfc5e637..f6630f3e 100644 --- a/imessage-exporter/src/exporters/html.rs +++ b/imessage-exporter/src/exporters/html.rs @@ -2227,9 +2227,7 @@ mod tests { let config = Config::fake_app(options); let exporter = HTML::new(&config).unwrap(); - let mut message = Config::fake_message(); - // Set message to sticker variant - message.associated_message_type = Some(1000); + let message = Config::fake_message(); let mut attachment = Config::fake_attachment(); attachment.is_sticker = true; @@ -2263,9 +2261,7 @@ mod tests { let config = Config::fake_app(options); let exporter = HTML::new(&config).unwrap(); - let mut message = Config::fake_message(); - // Set message to sticker variant - message.associated_message_type = Some(1000); + let message = Config::fake_message(); let mut attachment = Config::fake_attachment(); attachment.is_sticker = true; diff --git a/imessage-exporter/src/exporters/txt.rs b/imessage-exporter/src/exporters/txt.rs index ff6de437..90371603 100644 --- a/imessage-exporter/src/exporters/txt.rs +++ b/imessage-exporter/src/exporters/txt.rs @@ -1667,9 +1667,7 @@ mod tests { let exporter = TXT::new(&config).unwrap(); - let mut message = Config::fake_message(); - // Set message to sticker variant - message.associated_message_type = Some(1000); + let message = Config::fake_message(); let mut attachment = Config::fake_attachment(); attachment.is_sticker = true; @@ -1708,9 +1706,7 @@ mod tests { let exporter = TXT::new(&config).unwrap(); - let mut message = Config::fake_message(); - // Set message to sticker variant - message.associated_message_type = Some(1000); + let message = Config::fake_message(); let mut attachment = Config::fake_attachment(); attachment.is_sticker = true; From 5d75f8a4f122d2c94dcdcfb88aedfb3d763997fa Mon Sep 17 00:00:00 2001 From: Christopher Sardegna Date: Sat, 23 Nov 2024 18:59:18 -0800 Subject: [PATCH 2/4] Bump deps to latest --- Cargo.lock | 163 ++++++++++-------- imessage-database/Cargo.toml | 6 +- .../digital_touch/digital_touch_proto.rs | 4 +- .../handwriting/handwriting_proto.rs | 4 +- imessage-exporter/Cargo.toml | 6 +- 5 files changed, 102 insertions(+), 81 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c619c73..bcc3e0bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -55,9 +55,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" @@ -105,12 +105,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.6.0" @@ -161,23 +155,23 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] name = "clap" -version = "4.5.11" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.11" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", @@ -198,7 +192,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" dependencies = [ "termcolor", - "unicode-width", + "unicode-width 0.1.10", ] [[package]] @@ -218,7 +212,7 @@ dependencies = [ "once_cell", "regex", "terminal_size", - "unicode-width", + "unicode-width 0.1.10", "winapi", ] @@ -383,14 +377,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] @@ -502,24 +496,15 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.17.8" +version = "0.17.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" +checksum = "cbf675b85ed934d3c67b5c5469701eec7db22689d0a2139d856e0925fa28b281" dependencies = [ "console", - "instant", "number_prefix", "portable-atomic", - "unicode-width", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", + "unicode-width 0.2.0", + "web-time", ] [[package]] @@ -549,6 +534,17 @@ version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags", + "libc", + "redox_syscall", +] + [[package]] name = "libsqlite3-sys" version = "0.30.1" @@ -669,9 +665,9 @@ dependencies = [ [[package]] name = "protobuf" -version = "3.5.1" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bcc343da15609eaecd65f8aa76df8dc4209d325131d8219358c0aaaebab0bf6" +checksum = "a3a7c64d9bf75b1b8d981124c14c179074e8caa7dfe7b6a12e6222ddcd0c8f72" dependencies = [ "once_cell", "protobuf-support", @@ -680,9 +676,9 @@ dependencies = [ [[package]] name = "protobuf-codegen" -version = "3.5.1" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d0cde5642ea4df842b13eb9f59ea6fafa26dcb43e3e1ee49120e9757556189" +checksum = "e26b833f144769a30e04b1db0146b2aaa53fd2fd83acf10a6b5f996606c18144" dependencies = [ "anyhow", "once_cell", @@ -695,9 +691,9 @@ dependencies = [ [[package]] name = "protobuf-parse" -version = "3.5.1" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b0e9b447d099ae2c4993c0cbb03c7a9d6c937b17f2d56cfc0b1550e6fcfdb76" +checksum = "322330e133eab455718444b4e033ebfac7c6528972c784fcde28d2cc783c6257" dependencies = [ "anyhow", "indexmap", @@ -711,9 +707,9 @@ dependencies = [ [[package]] name = "protobuf-support" -version = "3.5.1" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0766e3675a627c327e4b3964582594b0e8741305d628a98a5de75a1d15f99b9" +checksum = "b088fd20b938a875ea00843b6faf48579462630015c3788d397ad6a786663252" dependencies = [ "thiserror", ] @@ -738,11 +734,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] @@ -780,7 +776,7 @@ version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e" dependencies = [ - "bitflags 2.6.0", + "bitflags", "fallible-iterator", "fallible-streaming-iterator", "hashlink", @@ -794,7 +790,7 @@ version = "0.38.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" dependencies = [ - "bitflags 2.6.0", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -973,6 +969,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "utf8parse" version = "0.2.1" @@ -1045,6 +1047,16 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +[[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.4.2" @@ -1103,7 +1115,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -1123,18 +1144,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -1145,9 +1166,9 @@ checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -1157,9 +1178,9 @@ checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -1169,15 +1190,15 @@ checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -1187,9 +1208,9 @@ checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -1199,9 +1220,9 @@ checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -1211,9 +1232,9 @@ checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -1223,9 +1244,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "zerocopy" diff --git a/imessage-database/Cargo.toml b/imessage-database/Cargo.toml index ada42dbe..c96872e5 100644 --- a/imessage-database/Cargo.toml +++ b/imessage-database/Cargo.toml @@ -14,9 +14,9 @@ chrono = "=0.4.38" plist = "=1.7.0" rusqlite = { version = "=0.32.1", features = ["blob", "bundled"] } sha1 = "=0.10.6" -protobuf = "=3.5.1" +protobuf = "=3.7.1" lzma-rs = "=0.3.0" [build-dependencies] -protobuf = "=3.5.1" -protobuf-codegen = "=3.5.1" +protobuf = "=3.7.1" +protobuf-codegen = "=3.7.1" diff --git a/imessage-database/src/message_types/digital_touch/digital_touch_proto.rs b/imessage-database/src/message_types/digital_touch/digital_touch_proto.rs index 4104d5f5..0fb1e935 100644 --- a/imessage-database/src/message_types/digital_touch/digital_touch_proto.rs +++ b/imessage-database/src/message_types/digital_touch/digital_touch_proto.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.5.1. Do not edit +// This file is generated by rust-protobuf 3.7.1. Do not edit // .proto file is parsed by pure // @generated @@ -22,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_5_1; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_1; // @@protoc_insertion_point(message:digital_touch.BaseMessage) #[derive(PartialEq,Clone,Default,Debug)] diff --git a/imessage-database/src/message_types/handwriting/handwriting_proto.rs b/imessage-database/src/message_types/handwriting/handwriting_proto.rs index 2f310f82..a66b8b6b 100644 --- a/imessage-database/src/message_types/handwriting/handwriting_proto.rs +++ b/imessage-database/src/message_types/handwriting/handwriting_proto.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.5.1. Do not edit +// This file is generated by rust-protobuf 3.7.1. Do not edit // .proto file is parsed by pure // @generated @@ -22,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_5_1; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_1; // @@protoc_insertion_point(message:handwriting.BaseMessage) #[derive(PartialEq,Clone,Default,Debug)] diff --git a/imessage-exporter/Cargo.toml b/imessage-exporter/Cargo.toml index 7c18633e..235bf780 100644 --- a/imessage-exporter/Cargo.toml +++ b/imessage-exporter/Cargo.toml @@ -10,10 +10,10 @@ repository = "https://github.com/ReagentX/imessage-exporter" version = "0.0.0" [dependencies] -clap = { version = "=4.5.11", features = ["cargo"] } -filetime = "=0.2.23" +clap = { version = "=4.5.21", features = ["cargo"] } +filetime = "=0.2.25" fdlimit = "=0.3.0" fs2 = "=0.4.3" imessage-database = { path = "../imessage-database" } -indicatif = "=0.17.8" +indicatif = "=0.17.9" rusqlite = { version = "0.32.1", features = ["blob", "bundled"] } From 0cb67e1a805908834fb9ee3366e7bc2a2dbad585 Mon Sep 17 00:00:00 2001 From: Christopher Sardegna Date: Sat, 23 Nov 2024 19:11:35 -0800 Subject: [PATCH 3/4] Increase function scope --- imessage-database/src/tables/messages/message.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imessage-database/src/tables/messages/message.rs b/imessage-database/src/tables/messages/message.rs index 5c024a37..bdfe4c88 100644 --- a/imessage-database/src/tables/messages/message.rs +++ b/imessage-database/src/tables/messages/message.rs @@ -751,7 +751,7 @@ impl Message { } /// See [`Tapback`] for details on this data. - pub(crate) fn clean_associated_guid(&self) -> Option<(usize, &str)> { + pub fn clean_associated_guid(&self) -> Option<(usize, &str)> { if let Some(guid) = &self.associated_message_guid { if guid.starts_with("p:") { let mut split = guid.split('/'); @@ -867,7 +867,7 @@ impl Message { /// /// For example, a Bundle ID like `com.apple.messages.MSMessageExtensionBalloonPlugin:0000000000:com.apple.SafetyMonitorApp.SafetyMonitorMessages` /// should get parsed into `com.apple.SafetyMonitorApp.SafetyMonitorMessages`. - pub(crate) fn parse_balloon_bundle_id(&self) -> Option<&str> { + pub fn parse_balloon_bundle_id(&self) -> Option<&str> { if let Some(bundle_id) = &self.balloon_bundle_id { let mut parts = bundle_id.split(':'); let bundle_id = parts.next(); From ac3bc28d1572a3d303b61cb43f69e1ffdda5e68c Mon Sep 17 00:00:00 2001 From: Christopher Sardegna Date: Sat, 23 Nov 2024 19:19:52 -0800 Subject: [PATCH 4/4] Simplify imports --- .../src/app/compatibility/attachment_manager.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/imessage-exporter/src/app/compatibility/attachment_manager.rs b/imessage-exporter/src/app/compatibility/attachment_manager.rs index 7f63f1ea..3c48b0d0 100644 --- a/imessage-exporter/src/app/compatibility/attachment_manager.rs +++ b/imessage-exporter/src/app/compatibility/attachment_manager.rs @@ -19,10 +19,12 @@ use crate::app::{ runtime::Config, }; -use imessage_database::message_types::handwriting::HandwrittenMessage; -use imessage_database::tables::{ - attachment::{Attachment, MediaType}, - messages::Message, +use imessage_database::{ + message_types::handwriting::HandwrittenMessage, + tables::{ + attachment::{Attachment, MediaType}, + messages::Message, + }, }; use filetime::{set_file_times, FileTime};