├── .cargo └── config ├── .gitignore ├── .vscode └── settings.json ├── Cargo.lock ├── Cargo.toml ├── Note.md ├── README.md ├── dprint.json ├── env.toml ├── notion-zh_CN.js ├── notion-zh_TW.js ├── release ├── macos │ ├── env.toml │ ├── update_asar_intel_mac │ └── update_asar_m1_mac └── windows │ ├── env.toml │ └── update_asar.exe ├── src └── main.rs ├── template ├── notion-zh_CN.template,.backup.js ├── notion-zh_CN.template.js └── notion-zh_TW.template.js ├── update.ps1 ├── update.sh ├── update_asar ├── Cargo.toml ├── build_aarch64-apple-darwin.sh ├── build_x86_64-pc-windows-gnu.sh ├── build_x86_64-unknown-linux-gnu.sh ├── env.toml └── src │ └── main.rs ├── update_github.sh └── update_intl ├── Cargo.lock ├── Cargo.toml └── src ├── main.rs ├── sync_assest_js_script.rs ├── update_script.rs └── update_version.rs /.cargo/config: -------------------------------------------------------------------------------- 1 | [source.crates-io] 2 | registry = "https://github.com/rust-lang/crates.io-index" 3 | replace-with = 'tuna' 4 | [source.ustc] 5 | registry = "git://mirrors.ustc.edu.cn/crates.io-index" 6 | [source.tuna] 7 | registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | buffer 3 | util/credential.json 4 | /util/credential.json 5 | 6 | 7 | # Added by cargo 8 | 9 | target 10 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "asar" 4 | ] 5 | } -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.21.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "aho-corasick" 22 | version = "1.0.5" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" 25 | dependencies = [ 26 | "memchr", 27 | ] 28 | 29 | [[package]] 30 | name = "android-tzdata" 31 | version = "0.1.1" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 34 | 35 | [[package]] 36 | name = "android_system_properties" 37 | version = "0.1.5" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 40 | dependencies = [ 41 | "libc", 42 | ] 43 | 44 | [[package]] 45 | name = "anstream" 46 | version = "0.5.0" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" 49 | dependencies = [ 50 | "anstyle", 51 | "anstyle-parse", 52 | "anstyle-query", 53 | "anstyle-wincon", 54 | "colorchoice", 55 | "utf8parse", 56 | ] 57 | 58 | [[package]] 59 | name = "anstyle" 60 | version = "1.0.3" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" 63 | 64 | [[package]] 65 | name = "anstyle-parse" 66 | version = "0.2.1" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" 69 | dependencies = [ 70 | "utf8parse", 71 | ] 72 | 73 | [[package]] 74 | name = "anstyle-query" 75 | version = "1.0.0" 76 | source = "registry+https://github.com/rust-lang/crates.io-index" 77 | checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" 78 | dependencies = [ 79 | "windows-sys", 80 | ] 81 | 82 | [[package]] 83 | name = "anstyle-wincon" 84 | version = "2.1.0" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" 87 | dependencies = [ 88 | "anstyle", 89 | "windows-sys", 90 | ] 91 | 92 | [[package]] 93 | name = "anyhow" 94 | version = "1.0.75" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" 97 | 98 | [[package]] 99 | name = "arrayvec" 100 | version = "0.7.4" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" 103 | 104 | [[package]] 105 | name = "asar" 106 | version = "0.2.0" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "b7386663b76ee42bd2a0c0314948e129fa29092cf7135e0566c520e69c5b4320" 109 | dependencies = [ 110 | "byteorder", 111 | "clap", 112 | "color-eyre", 113 | "hex", 114 | "is_executable", 115 | "serde", 116 | "serde_json", 117 | "serde_with", 118 | "sha2", 119 | "thiserror", 120 | "walkdir", 121 | "wax", 122 | ] 123 | 124 | [[package]] 125 | name = "autocfg" 126 | version = "1.1.0" 127 | source = "registry+https://github.com/rust-lang/crates.io-index" 128 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 129 | 130 | [[package]] 131 | name = "backtrace" 132 | version = "0.3.69" 133 | source = "registry+https://github.com/rust-lang/crates.io-index" 134 | checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" 135 | dependencies = [ 136 | "addr2line", 137 | "cc", 138 | "cfg-if", 139 | "libc", 140 | "miniz_oxide", 141 | "object", 142 | "rustc-demangle", 143 | ] 144 | 145 | [[package]] 146 | name = "base64" 147 | version = "0.13.1" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" 150 | 151 | [[package]] 152 | name = "base64" 153 | version = "0.21.4" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" 156 | 157 | [[package]] 158 | name = "bitflags" 159 | version = "1.3.2" 160 | source = "registry+https://github.com/rust-lang/crates.io-index" 161 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 162 | 163 | [[package]] 164 | name = "bitflags" 165 | version = "2.4.0" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" 168 | 169 | [[package]] 170 | name = "block-buffer" 171 | version = "0.10.4" 172 | source = "registry+https://github.com/rust-lang/crates.io-index" 173 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 174 | dependencies = [ 175 | "generic-array", 176 | ] 177 | 178 | [[package]] 179 | name = "brownstone" 180 | version = "3.0.0" 181 | source = "registry+https://github.com/rust-lang/crates.io-index" 182 | checksum = "c5839ee4f953e811bfdcf223f509cb2c6a3e1447959b0bff459405575bc17f22" 183 | dependencies = [ 184 | "arrayvec", 185 | ] 186 | 187 | [[package]] 188 | name = "bstr" 189 | version = "0.2.17" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" 192 | dependencies = [ 193 | "lazy_static", 194 | "memchr", 195 | "regex-automata 0.1.10", 196 | ] 197 | 198 | [[package]] 199 | name = "bumpalo" 200 | version = "3.14.0" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" 203 | 204 | [[package]] 205 | name = "byteorder" 206 | version = "1.4.3" 207 | source = "registry+https://github.com/rust-lang/crates.io-index" 208 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 209 | 210 | [[package]] 211 | name = "bytes" 212 | version = "1.5.0" 213 | source = "registry+https://github.com/rust-lang/crates.io-index" 214 | checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" 215 | 216 | [[package]] 217 | name = "cc" 218 | version = "1.0.83" 219 | source = "registry+https://github.com/rust-lang/crates.io-index" 220 | checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" 221 | dependencies = [ 222 | "libc", 223 | ] 224 | 225 | [[package]] 226 | name = "cfg-if" 227 | version = "1.0.0" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 230 | 231 | [[package]] 232 | name = "chrono" 233 | version = "0.4.31" 234 | source = "registry+https://github.com/rust-lang/crates.io-index" 235 | checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" 236 | dependencies = [ 237 | "android-tzdata", 238 | "iana-time-zone", 239 | "num-traits", 240 | "serde", 241 | "windows-targets", 242 | ] 243 | 244 | [[package]] 245 | name = "clap" 246 | version = "4.4.3" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" 249 | dependencies = [ 250 | "clap_builder", 251 | "clap_derive", 252 | ] 253 | 254 | [[package]] 255 | name = "clap_builder" 256 | version = "4.4.2" 257 | source = "registry+https://github.com/rust-lang/crates.io-index" 258 | checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" 259 | dependencies = [ 260 | "anstream", 261 | "anstyle", 262 | "clap_lex", 263 | "strsim", 264 | ] 265 | 266 | [[package]] 267 | name = "clap_derive" 268 | version = "4.4.2" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" 271 | dependencies = [ 272 | "heck", 273 | "proc-macro2", 274 | "quote", 275 | "syn", 276 | ] 277 | 278 | [[package]] 279 | name = "clap_lex" 280 | version = "0.5.1" 281 | source = "registry+https://github.com/rust-lang/crates.io-index" 282 | checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" 283 | 284 | [[package]] 285 | name = "color-eyre" 286 | version = "0.6.2" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204" 289 | dependencies = [ 290 | "backtrace", 291 | "color-spantrace", 292 | "eyre", 293 | "indenter", 294 | "once_cell", 295 | "owo-colors", 296 | "tracing-error", 297 | ] 298 | 299 | [[package]] 300 | name = "color-spantrace" 301 | version = "0.2.0" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | checksum = "1ba75b3d9449ecdccb27ecbc479fdc0b87fa2dd43d2f8298f9bf0e59aacc8dce" 304 | dependencies = [ 305 | "once_cell", 306 | "owo-colors", 307 | "tracing-core", 308 | "tracing-error", 309 | ] 310 | 311 | [[package]] 312 | name = "colorchoice" 313 | version = "1.0.0" 314 | source = "registry+https://github.com/rust-lang/crates.io-index" 315 | checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" 316 | 317 | [[package]] 318 | name = "colored" 319 | version = "2.0.4" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" 322 | dependencies = [ 323 | "is-terminal", 324 | "lazy_static", 325 | "windows-sys", 326 | ] 327 | 328 | [[package]] 329 | name = "const_format" 330 | version = "0.2.31" 331 | source = "registry+https://github.com/rust-lang/crates.io-index" 332 | checksum = "c990efc7a285731f9a4378d81aff2f0e85a2c8781a05ef0f8baa8dac54d0ff48" 333 | dependencies = [ 334 | "const_format_proc_macros", 335 | ] 336 | 337 | [[package]] 338 | name = "const_format_proc_macros" 339 | version = "0.2.31" 340 | source = "registry+https://github.com/rust-lang/crates.io-index" 341 | checksum = "e026b6ce194a874cb9cf32cd5772d1ef9767cc8fcb5765948d74f37a9d8b2bf6" 342 | dependencies = [ 343 | "proc-macro2", 344 | "quote", 345 | "unicode-xid", 346 | ] 347 | 348 | [[package]] 349 | name = "core-foundation" 350 | version = "0.9.3" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 353 | dependencies = [ 354 | "core-foundation-sys", 355 | "libc", 356 | ] 357 | 358 | [[package]] 359 | name = "core-foundation-sys" 360 | version = "0.8.4" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" 363 | 364 | [[package]] 365 | name = "cpufeatures" 366 | version = "0.2.9" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" 369 | dependencies = [ 370 | "libc", 371 | ] 372 | 373 | [[package]] 374 | name = "crypto-common" 375 | version = "0.1.6" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 378 | dependencies = [ 379 | "generic-array", 380 | "typenum", 381 | ] 382 | 383 | [[package]] 384 | name = "darling" 385 | version = "0.20.3" 386 | source = "registry+https://github.com/rust-lang/crates.io-index" 387 | checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" 388 | dependencies = [ 389 | "darling_core", 390 | "darling_macro", 391 | ] 392 | 393 | [[package]] 394 | name = "darling_core" 395 | version = "0.20.3" 396 | source = "registry+https://github.com/rust-lang/crates.io-index" 397 | checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" 398 | dependencies = [ 399 | "fnv", 400 | "ident_case", 401 | "proc-macro2", 402 | "quote", 403 | "strsim", 404 | "syn", 405 | ] 406 | 407 | [[package]] 408 | name = "darling_macro" 409 | version = "0.20.3" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" 412 | dependencies = [ 413 | "darling_core", 414 | "quote", 415 | "syn", 416 | ] 417 | 418 | [[package]] 419 | name = "deranged" 420 | version = "0.3.8" 421 | source = "registry+https://github.com/rust-lang/crates.io-index" 422 | checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" 423 | dependencies = [ 424 | "serde", 425 | ] 426 | 427 | [[package]] 428 | name = "digest" 429 | version = "0.10.7" 430 | source = "registry+https://github.com/rust-lang/crates.io-index" 431 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 432 | dependencies = [ 433 | "block-buffer", 434 | "crypto-common", 435 | ] 436 | 437 | [[package]] 438 | name = "directories" 439 | version = "5.0.1" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" 442 | dependencies = [ 443 | "dirs-sys", 444 | ] 445 | 446 | [[package]] 447 | name = "dirs-sys" 448 | version = "0.4.1" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" 451 | dependencies = [ 452 | "libc", 453 | "option-ext", 454 | "redox_users", 455 | "windows-sys", 456 | ] 457 | 458 | [[package]] 459 | name = "either" 460 | version = "1.9.0" 461 | source = "registry+https://github.com/rust-lang/crates.io-index" 462 | checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" 463 | 464 | [[package]] 465 | name = "encoding_rs" 466 | version = "0.8.33" 467 | source = "registry+https://github.com/rust-lang/crates.io-index" 468 | checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" 469 | dependencies = [ 470 | "cfg-if", 471 | ] 472 | 473 | [[package]] 474 | name = "equivalent" 475 | version = "1.0.1" 476 | source = "registry+https://github.com/rust-lang/crates.io-index" 477 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 478 | 479 | [[package]] 480 | name = "errno" 481 | version = "0.3.3" 482 | source = "registry+https://github.com/rust-lang/crates.io-index" 483 | checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" 484 | dependencies = [ 485 | "errno-dragonfly", 486 | "libc", 487 | "windows-sys", 488 | ] 489 | 490 | [[package]] 491 | name = "errno-dragonfly" 492 | version = "0.1.2" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 495 | dependencies = [ 496 | "cc", 497 | "libc", 498 | ] 499 | 500 | [[package]] 501 | name = "eyre" 502 | version = "0.6.8" 503 | source = "registry+https://github.com/rust-lang/crates.io-index" 504 | checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" 505 | dependencies = [ 506 | "indenter", 507 | "once_cell", 508 | ] 509 | 510 | [[package]] 511 | name = "fastrand" 512 | version = "2.0.0" 513 | source = "registry+https://github.com/rust-lang/crates.io-index" 514 | checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" 515 | 516 | [[package]] 517 | name = "fnv" 518 | version = "1.0.7" 519 | source = "registry+https://github.com/rust-lang/crates.io-index" 520 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 521 | 522 | [[package]] 523 | name = "foreign-types" 524 | version = "0.3.2" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 527 | dependencies = [ 528 | "foreign-types-shared", 529 | ] 530 | 531 | [[package]] 532 | name = "foreign-types-shared" 533 | version = "0.1.1" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 536 | 537 | [[package]] 538 | name = "form_urlencoded" 539 | version = "1.2.0" 540 | source = "registry+https://github.com/rust-lang/crates.io-index" 541 | checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" 542 | dependencies = [ 543 | "percent-encoding", 544 | ] 545 | 546 | [[package]] 547 | name = "futures-channel" 548 | version = "0.3.28" 549 | source = "registry+https://github.com/rust-lang/crates.io-index" 550 | checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" 551 | dependencies = [ 552 | "futures-core", 553 | ] 554 | 555 | [[package]] 556 | name = "futures-core" 557 | version = "0.3.28" 558 | source = "registry+https://github.com/rust-lang/crates.io-index" 559 | checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" 560 | 561 | [[package]] 562 | name = "futures-sink" 563 | version = "0.3.28" 564 | source = "registry+https://github.com/rust-lang/crates.io-index" 565 | checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" 566 | 567 | [[package]] 568 | name = "futures-task" 569 | version = "0.3.28" 570 | source = "registry+https://github.com/rust-lang/crates.io-index" 571 | checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" 572 | 573 | [[package]] 574 | name = "futures-util" 575 | version = "0.3.28" 576 | source = "registry+https://github.com/rust-lang/crates.io-index" 577 | checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" 578 | dependencies = [ 579 | "futures-core", 580 | "futures-task", 581 | "pin-project-lite", 582 | "pin-utils", 583 | ] 584 | 585 | [[package]] 586 | name = "generic-array" 587 | version = "0.14.7" 588 | source = "registry+https://github.com/rust-lang/crates.io-index" 589 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 590 | dependencies = [ 591 | "typenum", 592 | "version_check", 593 | ] 594 | 595 | [[package]] 596 | name = "getrandom" 597 | version = "0.2.10" 598 | source = "registry+https://github.com/rust-lang/crates.io-index" 599 | checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" 600 | dependencies = [ 601 | "cfg-if", 602 | "libc", 603 | "wasi", 604 | ] 605 | 606 | [[package]] 607 | name = "gimli" 608 | version = "0.28.0" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" 611 | 612 | [[package]] 613 | name = "h2" 614 | version = "0.3.21" 615 | source = "registry+https://github.com/rust-lang/crates.io-index" 616 | checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" 617 | dependencies = [ 618 | "bytes", 619 | "fnv", 620 | "futures-core", 621 | "futures-sink", 622 | "futures-util", 623 | "http", 624 | "indexmap 1.9.3", 625 | "slab", 626 | "tokio", 627 | "tokio-util", 628 | "tracing", 629 | ] 630 | 631 | [[package]] 632 | name = "hashbrown" 633 | version = "0.12.3" 634 | source = "registry+https://github.com/rust-lang/crates.io-index" 635 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 636 | 637 | [[package]] 638 | name = "hashbrown" 639 | version = "0.14.0" 640 | source = "registry+https://github.com/rust-lang/crates.io-index" 641 | checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" 642 | 643 | [[package]] 644 | name = "heck" 645 | version = "0.4.1" 646 | source = "registry+https://github.com/rust-lang/crates.io-index" 647 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 648 | 649 | [[package]] 650 | name = "hermit-abi" 651 | version = "0.3.2" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" 654 | 655 | [[package]] 656 | name = "hex" 657 | version = "0.4.3" 658 | source = "registry+https://github.com/rust-lang/crates.io-index" 659 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 660 | 661 | [[package]] 662 | name = "http" 663 | version = "0.2.9" 664 | source = "registry+https://github.com/rust-lang/crates.io-index" 665 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 666 | dependencies = [ 667 | "bytes", 668 | "fnv", 669 | "itoa", 670 | ] 671 | 672 | [[package]] 673 | name = "http-body" 674 | version = "0.4.5" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 677 | dependencies = [ 678 | "bytes", 679 | "http", 680 | "pin-project-lite", 681 | ] 682 | 683 | [[package]] 684 | name = "httparse" 685 | version = "1.8.0" 686 | source = "registry+https://github.com/rust-lang/crates.io-index" 687 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 688 | 689 | [[package]] 690 | name = "httpdate" 691 | version = "1.0.3" 692 | source = "registry+https://github.com/rust-lang/crates.io-index" 693 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 694 | 695 | [[package]] 696 | name = "hyper" 697 | version = "0.14.27" 698 | source = "registry+https://github.com/rust-lang/crates.io-index" 699 | checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" 700 | dependencies = [ 701 | "bytes", 702 | "futures-channel", 703 | "futures-core", 704 | "futures-util", 705 | "h2", 706 | "http", 707 | "http-body", 708 | "httparse", 709 | "httpdate", 710 | "itoa", 711 | "pin-project-lite", 712 | "socket2 0.4.9", 713 | "tokio", 714 | "tower-service", 715 | "tracing", 716 | "want", 717 | ] 718 | 719 | [[package]] 720 | name = "hyper-tls" 721 | version = "0.5.0" 722 | source = "registry+https://github.com/rust-lang/crates.io-index" 723 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 724 | dependencies = [ 725 | "bytes", 726 | "hyper", 727 | "native-tls", 728 | "tokio", 729 | "tokio-native-tls", 730 | ] 731 | 732 | [[package]] 733 | name = "iana-time-zone" 734 | version = "0.1.57" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" 737 | dependencies = [ 738 | "android_system_properties", 739 | "core-foundation-sys", 740 | "iana-time-zone-haiku", 741 | "js-sys", 742 | "wasm-bindgen", 743 | "windows", 744 | ] 745 | 746 | [[package]] 747 | name = "iana-time-zone-haiku" 748 | version = "0.1.2" 749 | source = "registry+https://github.com/rust-lang/crates.io-index" 750 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 751 | dependencies = [ 752 | "cc", 753 | ] 754 | 755 | [[package]] 756 | name = "ident_case" 757 | version = "1.0.1" 758 | source = "registry+https://github.com/rust-lang/crates.io-index" 759 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 760 | 761 | [[package]] 762 | name = "idna" 763 | version = "0.4.0" 764 | source = "registry+https://github.com/rust-lang/crates.io-index" 765 | checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" 766 | dependencies = [ 767 | "unicode-bidi", 768 | "unicode-normalization", 769 | ] 770 | 771 | [[package]] 772 | name = "indent_write" 773 | version = "2.2.0" 774 | source = "registry+https://github.com/rust-lang/crates.io-index" 775 | checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3" 776 | 777 | [[package]] 778 | name = "indenter" 779 | version = "0.3.3" 780 | source = "registry+https://github.com/rust-lang/crates.io-index" 781 | checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" 782 | 783 | [[package]] 784 | name = "indexmap" 785 | version = "1.9.3" 786 | source = "registry+https://github.com/rust-lang/crates.io-index" 787 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 788 | dependencies = [ 789 | "autocfg", 790 | "hashbrown 0.12.3", 791 | "serde", 792 | ] 793 | 794 | [[package]] 795 | name = "indexmap" 796 | version = "2.0.0" 797 | source = "registry+https://github.com/rust-lang/crates.io-index" 798 | checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" 799 | dependencies = [ 800 | "equivalent", 801 | "hashbrown 0.14.0", 802 | ] 803 | 804 | [[package]] 805 | name = "ipnet" 806 | version = "2.8.0" 807 | source = "registry+https://github.com/rust-lang/crates.io-index" 808 | checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" 809 | 810 | [[package]] 811 | name = "is-terminal" 812 | version = "0.4.9" 813 | source = "registry+https://github.com/rust-lang/crates.io-index" 814 | checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" 815 | dependencies = [ 816 | "hermit-abi", 817 | "rustix", 818 | "windows-sys", 819 | ] 820 | 821 | [[package]] 822 | name = "is_executable" 823 | version = "1.0.1" 824 | source = "registry+https://github.com/rust-lang/crates.io-index" 825 | checksum = "fa9acdc6d67b75e626ad644734e8bc6df893d9cd2a834129065d3dd6158ea9c8" 826 | dependencies = [ 827 | "winapi", 828 | ] 829 | 830 | [[package]] 831 | name = "itertools" 832 | version = "0.10.5" 833 | source = "registry+https://github.com/rust-lang/crates.io-index" 834 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 835 | dependencies = [ 836 | "either", 837 | ] 838 | 839 | [[package]] 840 | name = "itoa" 841 | version = "1.0.9" 842 | source = "registry+https://github.com/rust-lang/crates.io-index" 843 | checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" 844 | 845 | [[package]] 846 | name = "joinery" 847 | version = "2.1.0" 848 | source = "registry+https://github.com/rust-lang/crates.io-index" 849 | checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" 850 | 851 | [[package]] 852 | name = "js-sys" 853 | version = "0.3.64" 854 | source = "registry+https://github.com/rust-lang/crates.io-index" 855 | checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" 856 | dependencies = [ 857 | "wasm-bindgen", 858 | ] 859 | 860 | [[package]] 861 | name = "lazy_static" 862 | version = "1.4.0" 863 | source = "registry+https://github.com/rust-lang/crates.io-index" 864 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 865 | 866 | [[package]] 867 | name = "libc" 868 | version = "0.2.148" 869 | source = "registry+https://github.com/rust-lang/crates.io-index" 870 | checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" 871 | 872 | [[package]] 873 | name = "linux-raw-sys" 874 | version = "0.4.7" 875 | source = "registry+https://github.com/rust-lang/crates.io-index" 876 | checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" 877 | 878 | [[package]] 879 | name = "lock_api" 880 | version = "0.4.10" 881 | source = "registry+https://github.com/rust-lang/crates.io-index" 882 | checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" 883 | dependencies = [ 884 | "autocfg", 885 | "scopeguard", 886 | ] 887 | 888 | [[package]] 889 | name = "log" 890 | version = "0.4.20" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" 893 | 894 | [[package]] 895 | name = "memchr" 896 | version = "2.6.3" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" 899 | 900 | [[package]] 901 | name = "mime" 902 | version = "0.3.17" 903 | source = "registry+https://github.com/rust-lang/crates.io-index" 904 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 905 | 906 | [[package]] 907 | name = "minimal-lexical" 908 | version = "0.2.1" 909 | source = "registry+https://github.com/rust-lang/crates.io-index" 910 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 911 | 912 | [[package]] 913 | name = "miniz_oxide" 914 | version = "0.7.1" 915 | source = "registry+https://github.com/rust-lang/crates.io-index" 916 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 917 | dependencies = [ 918 | "adler", 919 | ] 920 | 921 | [[package]] 922 | name = "mio" 923 | version = "0.8.8" 924 | source = "registry+https://github.com/rust-lang/crates.io-index" 925 | checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" 926 | dependencies = [ 927 | "libc", 928 | "wasi", 929 | "windows-sys", 930 | ] 931 | 932 | [[package]] 933 | name = "native-tls" 934 | version = "0.2.11" 935 | source = "registry+https://github.com/rust-lang/crates.io-index" 936 | checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" 937 | dependencies = [ 938 | "lazy_static", 939 | "libc", 940 | "log", 941 | "openssl", 942 | "openssl-probe", 943 | "openssl-sys", 944 | "schannel", 945 | "security-framework", 946 | "security-framework-sys", 947 | "tempfile", 948 | ] 949 | 950 | [[package]] 951 | name = "nom" 952 | version = "7.1.3" 953 | source = "registry+https://github.com/rust-lang/crates.io-index" 954 | checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" 955 | dependencies = [ 956 | "memchr", 957 | "minimal-lexical", 958 | ] 959 | 960 | [[package]] 961 | name = "nom-supreme" 962 | version = "0.8.0" 963 | source = "registry+https://github.com/rust-lang/crates.io-index" 964 | checksum = "2bd3ae6c901f1959588759ff51c95d24b491ecb9ff91aa9c2ef4acc5b1dcab27" 965 | dependencies = [ 966 | "brownstone", 967 | "indent_write", 968 | "joinery", 969 | "memchr", 970 | "nom", 971 | ] 972 | 973 | [[package]] 974 | name = "notion-zh_CN" 975 | version = "1.0.0" 976 | 977 | [[package]] 978 | name = "num-traits" 979 | version = "0.2.16" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" 982 | dependencies = [ 983 | "autocfg", 984 | ] 985 | 986 | [[package]] 987 | name = "num_cpus" 988 | version = "1.16.0" 989 | source = "registry+https://github.com/rust-lang/crates.io-index" 990 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 991 | dependencies = [ 992 | "hermit-abi", 993 | "libc", 994 | ] 995 | 996 | [[package]] 997 | name = "object" 998 | version = "0.32.1" 999 | source = "registry+https://github.com/rust-lang/crates.io-index" 1000 | checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" 1001 | dependencies = [ 1002 | "memchr", 1003 | ] 1004 | 1005 | [[package]] 1006 | name = "once_cell" 1007 | version = "1.18.0" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" 1010 | 1011 | [[package]] 1012 | name = "openssl" 1013 | version = "0.10.57" 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" 1015 | checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" 1016 | dependencies = [ 1017 | "bitflags 2.4.0", 1018 | "cfg-if", 1019 | "foreign-types", 1020 | "libc", 1021 | "once_cell", 1022 | "openssl-macros", 1023 | "openssl-sys", 1024 | ] 1025 | 1026 | [[package]] 1027 | name = "openssl-macros" 1028 | version = "0.1.1" 1029 | source = "registry+https://github.com/rust-lang/crates.io-index" 1030 | checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 1031 | dependencies = [ 1032 | "proc-macro2", 1033 | "quote", 1034 | "syn", 1035 | ] 1036 | 1037 | [[package]] 1038 | name = "openssl-probe" 1039 | version = "0.1.5" 1040 | source = "registry+https://github.com/rust-lang/crates.io-index" 1041 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 1042 | 1043 | [[package]] 1044 | name = "openssl-sys" 1045 | version = "0.9.93" 1046 | source = "registry+https://github.com/rust-lang/crates.io-index" 1047 | checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" 1048 | dependencies = [ 1049 | "cc", 1050 | "libc", 1051 | "pkg-config", 1052 | "vcpkg", 1053 | ] 1054 | 1055 | [[package]] 1056 | name = "option-ext" 1057 | version = "0.2.0" 1058 | source = "registry+https://github.com/rust-lang/crates.io-index" 1059 | checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" 1060 | 1061 | [[package]] 1062 | name = "owo-colors" 1063 | version = "3.5.0" 1064 | source = "registry+https://github.com/rust-lang/crates.io-index" 1065 | checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" 1066 | 1067 | [[package]] 1068 | name = "parking_lot" 1069 | version = "0.12.1" 1070 | source = "registry+https://github.com/rust-lang/crates.io-index" 1071 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 1072 | dependencies = [ 1073 | "lock_api", 1074 | "parking_lot_core", 1075 | ] 1076 | 1077 | [[package]] 1078 | name = "parking_lot_core" 1079 | version = "0.9.8" 1080 | source = "registry+https://github.com/rust-lang/crates.io-index" 1081 | checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" 1082 | dependencies = [ 1083 | "cfg-if", 1084 | "libc", 1085 | "redox_syscall 0.3.5", 1086 | "smallvec", 1087 | "windows-targets", 1088 | ] 1089 | 1090 | [[package]] 1091 | name = "percent-encoding" 1092 | version = "2.3.0" 1093 | source = "registry+https://github.com/rust-lang/crates.io-index" 1094 | checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" 1095 | 1096 | [[package]] 1097 | name = "pin-project-lite" 1098 | version = "0.2.13" 1099 | source = "registry+https://github.com/rust-lang/crates.io-index" 1100 | checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" 1101 | 1102 | [[package]] 1103 | name = "pin-utils" 1104 | version = "0.1.0" 1105 | source = "registry+https://github.com/rust-lang/crates.io-index" 1106 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1107 | 1108 | [[package]] 1109 | name = "pkg-config" 1110 | version = "0.3.27" 1111 | source = "registry+https://github.com/rust-lang/crates.io-index" 1112 | checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" 1113 | 1114 | [[package]] 1115 | name = "pori" 1116 | version = "0.0.0" 1117 | source = "registry+https://github.com/rust-lang/crates.io-index" 1118 | checksum = "a4a63d338dec139f56dacc692ca63ad35a6be6a797442479b55acd611d79e906" 1119 | dependencies = [ 1120 | "nom", 1121 | ] 1122 | 1123 | [[package]] 1124 | name = "proc-macro2" 1125 | version = "1.0.67" 1126 | source = "registry+https://github.com/rust-lang/crates.io-index" 1127 | checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" 1128 | dependencies = [ 1129 | "unicode-ident", 1130 | ] 1131 | 1132 | [[package]] 1133 | name = "quote" 1134 | version = "1.0.33" 1135 | source = "registry+https://github.com/rust-lang/crates.io-index" 1136 | checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" 1137 | dependencies = [ 1138 | "proc-macro2", 1139 | ] 1140 | 1141 | [[package]] 1142 | name = "redox_syscall" 1143 | version = "0.2.16" 1144 | source = "registry+https://github.com/rust-lang/crates.io-index" 1145 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 1146 | dependencies = [ 1147 | "bitflags 1.3.2", 1148 | ] 1149 | 1150 | [[package]] 1151 | name = "redox_syscall" 1152 | version = "0.3.5" 1153 | source = "registry+https://github.com/rust-lang/crates.io-index" 1154 | checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" 1155 | dependencies = [ 1156 | "bitflags 1.3.2", 1157 | ] 1158 | 1159 | [[package]] 1160 | name = "redox_users" 1161 | version = "0.4.3" 1162 | source = "registry+https://github.com/rust-lang/crates.io-index" 1163 | checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 1164 | dependencies = [ 1165 | "getrandom", 1166 | "redox_syscall 0.2.16", 1167 | "thiserror", 1168 | ] 1169 | 1170 | [[package]] 1171 | name = "regex" 1172 | version = "1.9.5" 1173 | source = "registry+https://github.com/rust-lang/crates.io-index" 1174 | checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" 1175 | dependencies = [ 1176 | "aho-corasick", 1177 | "memchr", 1178 | "regex-automata 0.3.8", 1179 | "regex-syntax", 1180 | ] 1181 | 1182 | [[package]] 1183 | name = "regex-automata" 1184 | version = "0.1.10" 1185 | source = "registry+https://github.com/rust-lang/crates.io-index" 1186 | checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" 1187 | 1188 | [[package]] 1189 | name = "regex-automata" 1190 | version = "0.3.8" 1191 | source = "registry+https://github.com/rust-lang/crates.io-index" 1192 | checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" 1193 | dependencies = [ 1194 | "aho-corasick", 1195 | "memchr", 1196 | "regex-syntax", 1197 | ] 1198 | 1199 | [[package]] 1200 | name = "regex-syntax" 1201 | version = "0.7.5" 1202 | source = "registry+https://github.com/rust-lang/crates.io-index" 1203 | checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" 1204 | 1205 | [[package]] 1206 | name = "reqwest" 1207 | version = "0.11.20" 1208 | source = "registry+https://github.com/rust-lang/crates.io-index" 1209 | checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" 1210 | dependencies = [ 1211 | "base64 0.21.4", 1212 | "bytes", 1213 | "encoding_rs", 1214 | "futures-core", 1215 | "futures-util", 1216 | "h2", 1217 | "http", 1218 | "http-body", 1219 | "hyper", 1220 | "hyper-tls", 1221 | "ipnet", 1222 | "js-sys", 1223 | "log", 1224 | "mime", 1225 | "native-tls", 1226 | "once_cell", 1227 | "percent-encoding", 1228 | "pin-project-lite", 1229 | "serde", 1230 | "serde_json", 1231 | "serde_urlencoded", 1232 | "tokio", 1233 | "tokio-native-tls", 1234 | "tower-service", 1235 | "url", 1236 | "wasm-bindgen", 1237 | "wasm-bindgen-futures", 1238 | "web-sys", 1239 | "winreg", 1240 | ] 1241 | 1242 | [[package]] 1243 | name = "rustc-demangle" 1244 | version = "0.1.23" 1245 | source = "registry+https://github.com/rust-lang/crates.io-index" 1246 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 1247 | 1248 | [[package]] 1249 | name = "rustix" 1250 | version = "0.38.13" 1251 | source = "registry+https://github.com/rust-lang/crates.io-index" 1252 | checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" 1253 | dependencies = [ 1254 | "bitflags 2.4.0", 1255 | "errno", 1256 | "libc", 1257 | "linux-raw-sys", 1258 | "windows-sys", 1259 | ] 1260 | 1261 | [[package]] 1262 | name = "ryu" 1263 | version = "1.0.15" 1264 | source = "registry+https://github.com/rust-lang/crates.io-index" 1265 | checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" 1266 | 1267 | [[package]] 1268 | name = "same-file" 1269 | version = "1.0.6" 1270 | source = "registry+https://github.com/rust-lang/crates.io-index" 1271 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 1272 | dependencies = [ 1273 | "winapi-util", 1274 | ] 1275 | 1276 | [[package]] 1277 | name = "schannel" 1278 | version = "0.1.22" 1279 | source = "registry+https://github.com/rust-lang/crates.io-index" 1280 | checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" 1281 | dependencies = [ 1282 | "windows-sys", 1283 | ] 1284 | 1285 | [[package]] 1286 | name = "scopeguard" 1287 | version = "1.2.0" 1288 | source = "registry+https://github.com/rust-lang/crates.io-index" 1289 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1290 | 1291 | [[package]] 1292 | name = "security-framework" 1293 | version = "2.9.2" 1294 | source = "registry+https://github.com/rust-lang/crates.io-index" 1295 | checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" 1296 | dependencies = [ 1297 | "bitflags 1.3.2", 1298 | "core-foundation", 1299 | "core-foundation-sys", 1300 | "libc", 1301 | "security-framework-sys", 1302 | ] 1303 | 1304 | [[package]] 1305 | name = "security-framework-sys" 1306 | version = "2.9.1" 1307 | source = "registry+https://github.com/rust-lang/crates.io-index" 1308 | checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" 1309 | dependencies = [ 1310 | "core-foundation-sys", 1311 | "libc", 1312 | ] 1313 | 1314 | [[package]] 1315 | name = "serde" 1316 | version = "1.0.188" 1317 | source = "registry+https://github.com/rust-lang/crates.io-index" 1318 | checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" 1319 | dependencies = [ 1320 | "serde_derive", 1321 | ] 1322 | 1323 | [[package]] 1324 | name = "serde_derive" 1325 | version = "1.0.188" 1326 | source = "registry+https://github.com/rust-lang/crates.io-index" 1327 | checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" 1328 | dependencies = [ 1329 | "proc-macro2", 1330 | "quote", 1331 | "syn", 1332 | ] 1333 | 1334 | [[package]] 1335 | name = "serde_json" 1336 | version = "1.0.107" 1337 | source = "registry+https://github.com/rust-lang/crates.io-index" 1338 | checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" 1339 | dependencies = [ 1340 | "itoa", 1341 | "ryu", 1342 | "serde", 1343 | ] 1344 | 1345 | [[package]] 1346 | name = "serde_urlencoded" 1347 | version = "0.7.1" 1348 | source = "registry+https://github.com/rust-lang/crates.io-index" 1349 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1350 | dependencies = [ 1351 | "form_urlencoded", 1352 | "itoa", 1353 | "ryu", 1354 | "serde", 1355 | ] 1356 | 1357 | [[package]] 1358 | name = "serde_with" 1359 | version = "2.3.3" 1360 | source = "registry+https://github.com/rust-lang/crates.io-index" 1361 | checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" 1362 | dependencies = [ 1363 | "base64 0.13.1", 1364 | "chrono", 1365 | "hex", 1366 | "indexmap 1.9.3", 1367 | "serde", 1368 | "serde_json", 1369 | "serde_with_macros", 1370 | "time", 1371 | ] 1372 | 1373 | [[package]] 1374 | name = "serde_with_macros" 1375 | version = "2.3.3" 1376 | source = "registry+https://github.com/rust-lang/crates.io-index" 1377 | checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" 1378 | dependencies = [ 1379 | "darling", 1380 | "proc-macro2", 1381 | "quote", 1382 | "syn", 1383 | ] 1384 | 1385 | [[package]] 1386 | name = "sha2" 1387 | version = "0.10.7" 1388 | source = "registry+https://github.com/rust-lang/crates.io-index" 1389 | checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" 1390 | dependencies = [ 1391 | "cfg-if", 1392 | "cpufeatures", 1393 | "digest", 1394 | ] 1395 | 1396 | [[package]] 1397 | name = "sharded-slab" 1398 | version = "0.1.4" 1399 | source = "registry+https://github.com/rust-lang/crates.io-index" 1400 | checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" 1401 | dependencies = [ 1402 | "lazy_static", 1403 | ] 1404 | 1405 | [[package]] 1406 | name = "signal-hook-registry" 1407 | version = "1.4.1" 1408 | source = "registry+https://github.com/rust-lang/crates.io-index" 1409 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 1410 | dependencies = [ 1411 | "libc", 1412 | ] 1413 | 1414 | [[package]] 1415 | name = "slab" 1416 | version = "0.4.9" 1417 | source = "registry+https://github.com/rust-lang/crates.io-index" 1418 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1419 | dependencies = [ 1420 | "autocfg", 1421 | ] 1422 | 1423 | [[package]] 1424 | name = "smallvec" 1425 | version = "1.11.0" 1426 | source = "registry+https://github.com/rust-lang/crates.io-index" 1427 | checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" 1428 | 1429 | [[package]] 1430 | name = "socket2" 1431 | version = "0.4.9" 1432 | source = "registry+https://github.com/rust-lang/crates.io-index" 1433 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 1434 | dependencies = [ 1435 | "libc", 1436 | "winapi", 1437 | ] 1438 | 1439 | [[package]] 1440 | name = "socket2" 1441 | version = "0.5.4" 1442 | source = "registry+https://github.com/rust-lang/crates.io-index" 1443 | checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" 1444 | dependencies = [ 1445 | "libc", 1446 | "windows-sys", 1447 | ] 1448 | 1449 | [[package]] 1450 | name = "strsim" 1451 | version = "0.10.0" 1452 | source = "registry+https://github.com/rust-lang/crates.io-index" 1453 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 1454 | 1455 | [[package]] 1456 | name = "syn" 1457 | version = "2.0.36" 1458 | source = "registry+https://github.com/rust-lang/crates.io-index" 1459 | checksum = "91e02e55d62894af2a08aca894c6577281f76769ba47c94d5756bec8ac6e7373" 1460 | dependencies = [ 1461 | "proc-macro2", 1462 | "quote", 1463 | "unicode-ident", 1464 | ] 1465 | 1466 | [[package]] 1467 | name = "tempfile" 1468 | version = "3.8.0" 1469 | source = "registry+https://github.com/rust-lang/crates.io-index" 1470 | checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" 1471 | dependencies = [ 1472 | "cfg-if", 1473 | "fastrand", 1474 | "redox_syscall 0.3.5", 1475 | "rustix", 1476 | "windows-sys", 1477 | ] 1478 | 1479 | [[package]] 1480 | name = "thiserror" 1481 | version = "1.0.48" 1482 | source = "registry+https://github.com/rust-lang/crates.io-index" 1483 | checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" 1484 | dependencies = [ 1485 | "thiserror-impl", 1486 | ] 1487 | 1488 | [[package]] 1489 | name = "thiserror-impl" 1490 | version = "1.0.48" 1491 | source = "registry+https://github.com/rust-lang/crates.io-index" 1492 | checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" 1493 | dependencies = [ 1494 | "proc-macro2", 1495 | "quote", 1496 | "syn", 1497 | ] 1498 | 1499 | [[package]] 1500 | name = "thread_local" 1501 | version = "1.1.7" 1502 | source = "registry+https://github.com/rust-lang/crates.io-index" 1503 | checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" 1504 | dependencies = [ 1505 | "cfg-if", 1506 | "once_cell", 1507 | ] 1508 | 1509 | [[package]] 1510 | name = "time" 1511 | version = "0.3.28" 1512 | source = "registry+https://github.com/rust-lang/crates.io-index" 1513 | checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" 1514 | dependencies = [ 1515 | "deranged", 1516 | "itoa", 1517 | "serde", 1518 | "time-core", 1519 | "time-macros", 1520 | ] 1521 | 1522 | [[package]] 1523 | name = "time-core" 1524 | version = "0.1.1" 1525 | source = "registry+https://github.com/rust-lang/crates.io-index" 1526 | checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" 1527 | 1528 | [[package]] 1529 | name = "time-macros" 1530 | version = "0.2.14" 1531 | source = "registry+https://github.com/rust-lang/crates.io-index" 1532 | checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" 1533 | dependencies = [ 1534 | "time-core", 1535 | ] 1536 | 1537 | [[package]] 1538 | name = "tinyvec" 1539 | version = "1.6.0" 1540 | source = "registry+https://github.com/rust-lang/crates.io-index" 1541 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1542 | dependencies = [ 1543 | "tinyvec_macros", 1544 | ] 1545 | 1546 | [[package]] 1547 | name = "tinyvec_macros" 1548 | version = "0.1.1" 1549 | source = "registry+https://github.com/rust-lang/crates.io-index" 1550 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1551 | 1552 | [[package]] 1553 | name = "tokio" 1554 | version = "1.32.0" 1555 | source = "registry+https://github.com/rust-lang/crates.io-index" 1556 | checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" 1557 | dependencies = [ 1558 | "backtrace", 1559 | "bytes", 1560 | "libc", 1561 | "mio", 1562 | "num_cpus", 1563 | "parking_lot", 1564 | "pin-project-lite", 1565 | "signal-hook-registry", 1566 | "socket2 0.5.4", 1567 | "tokio-macros", 1568 | "windows-sys", 1569 | ] 1570 | 1571 | [[package]] 1572 | name = "tokio-macros" 1573 | version = "2.1.0" 1574 | source = "registry+https://github.com/rust-lang/crates.io-index" 1575 | checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" 1576 | dependencies = [ 1577 | "proc-macro2", 1578 | "quote", 1579 | "syn", 1580 | ] 1581 | 1582 | [[package]] 1583 | name = "tokio-native-tls" 1584 | version = "0.3.1" 1585 | source = "registry+https://github.com/rust-lang/crates.io-index" 1586 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 1587 | dependencies = [ 1588 | "native-tls", 1589 | "tokio", 1590 | ] 1591 | 1592 | [[package]] 1593 | name = "tokio-util" 1594 | version = "0.7.8" 1595 | source = "registry+https://github.com/rust-lang/crates.io-index" 1596 | checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" 1597 | dependencies = [ 1598 | "bytes", 1599 | "futures-core", 1600 | "futures-sink", 1601 | "pin-project-lite", 1602 | "tokio", 1603 | "tracing", 1604 | ] 1605 | 1606 | [[package]] 1607 | name = "toml_datetime" 1608 | version = "0.6.3" 1609 | source = "registry+https://github.com/rust-lang/crates.io-index" 1610 | checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" 1611 | 1612 | [[package]] 1613 | name = "toml_edit" 1614 | version = "0.20.0" 1615 | source = "registry+https://github.com/rust-lang/crates.io-index" 1616 | checksum = "8ff63e60a958cefbb518ae1fd6566af80d9d4be430a33f3723dfc47d1d411d95" 1617 | dependencies = [ 1618 | "indexmap 2.0.0", 1619 | "toml_datetime", 1620 | "winnow", 1621 | ] 1622 | 1623 | [[package]] 1624 | name = "tower-service" 1625 | version = "0.3.2" 1626 | source = "registry+https://github.com/rust-lang/crates.io-index" 1627 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 1628 | 1629 | [[package]] 1630 | name = "tracing" 1631 | version = "0.1.37" 1632 | source = "registry+https://github.com/rust-lang/crates.io-index" 1633 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 1634 | dependencies = [ 1635 | "cfg-if", 1636 | "pin-project-lite", 1637 | "tracing-core", 1638 | ] 1639 | 1640 | [[package]] 1641 | name = "tracing-core" 1642 | version = "0.1.31" 1643 | source = "registry+https://github.com/rust-lang/crates.io-index" 1644 | checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" 1645 | dependencies = [ 1646 | "once_cell", 1647 | "valuable", 1648 | ] 1649 | 1650 | [[package]] 1651 | name = "tracing-error" 1652 | version = "0.2.0" 1653 | source = "registry+https://github.com/rust-lang/crates.io-index" 1654 | checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" 1655 | dependencies = [ 1656 | "tracing", 1657 | "tracing-subscriber", 1658 | ] 1659 | 1660 | [[package]] 1661 | name = "tracing-subscriber" 1662 | version = "0.3.17" 1663 | source = "registry+https://github.com/rust-lang/crates.io-index" 1664 | checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" 1665 | dependencies = [ 1666 | "sharded-slab", 1667 | "thread_local", 1668 | "tracing-core", 1669 | ] 1670 | 1671 | [[package]] 1672 | name = "try-lock" 1673 | version = "0.2.4" 1674 | source = "registry+https://github.com/rust-lang/crates.io-index" 1675 | checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" 1676 | 1677 | [[package]] 1678 | name = "typenum" 1679 | version = "1.17.0" 1680 | source = "registry+https://github.com/rust-lang/crates.io-index" 1681 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 1682 | 1683 | [[package]] 1684 | name = "unicode-bidi" 1685 | version = "0.3.13" 1686 | source = "registry+https://github.com/rust-lang/crates.io-index" 1687 | checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" 1688 | 1689 | [[package]] 1690 | name = "unicode-ident" 1691 | version = "1.0.12" 1692 | source = "registry+https://github.com/rust-lang/crates.io-index" 1693 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1694 | 1695 | [[package]] 1696 | name = "unicode-normalization" 1697 | version = "0.1.22" 1698 | source = "registry+https://github.com/rust-lang/crates.io-index" 1699 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 1700 | dependencies = [ 1701 | "tinyvec", 1702 | ] 1703 | 1704 | [[package]] 1705 | name = "unicode-xid" 1706 | version = "0.2.4" 1707 | source = "registry+https://github.com/rust-lang/crates.io-index" 1708 | checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" 1709 | 1710 | [[package]] 1711 | name = "update_asar" 1712 | version = "0.1.0" 1713 | dependencies = [ 1714 | "anyhow", 1715 | "asar", 1716 | "colored", 1717 | "directories", 1718 | "reqwest", 1719 | "tokio", 1720 | "toml_edit", 1721 | ] 1722 | 1723 | [[package]] 1724 | name = "update_intl" 1725 | version = "1.0.0" 1726 | dependencies = [ 1727 | "anyhow", 1728 | "regex", 1729 | "reqwest", 1730 | "serde", 1731 | "serde_json", 1732 | "tokio", 1733 | "toml_edit", 1734 | ] 1735 | 1736 | [[package]] 1737 | name = "url" 1738 | version = "2.4.1" 1739 | source = "registry+https://github.com/rust-lang/crates.io-index" 1740 | checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" 1741 | dependencies = [ 1742 | "form_urlencoded", 1743 | "idna", 1744 | "percent-encoding", 1745 | ] 1746 | 1747 | [[package]] 1748 | name = "utf8parse" 1749 | version = "0.2.1" 1750 | source = "registry+https://github.com/rust-lang/crates.io-index" 1751 | checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" 1752 | 1753 | [[package]] 1754 | name = "valuable" 1755 | version = "0.1.0" 1756 | source = "registry+https://github.com/rust-lang/crates.io-index" 1757 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 1758 | 1759 | [[package]] 1760 | name = "vcpkg" 1761 | version = "0.2.15" 1762 | source = "registry+https://github.com/rust-lang/crates.io-index" 1763 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1764 | 1765 | [[package]] 1766 | name = "version_check" 1767 | version = "0.9.4" 1768 | source = "registry+https://github.com/rust-lang/crates.io-index" 1769 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1770 | 1771 | [[package]] 1772 | name = "walkdir" 1773 | version = "2.4.0" 1774 | source = "registry+https://github.com/rust-lang/crates.io-index" 1775 | checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" 1776 | dependencies = [ 1777 | "same-file", 1778 | "winapi-util", 1779 | ] 1780 | 1781 | [[package]] 1782 | name = "want" 1783 | version = "0.3.1" 1784 | source = "registry+https://github.com/rust-lang/crates.io-index" 1785 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 1786 | dependencies = [ 1787 | "try-lock", 1788 | ] 1789 | 1790 | [[package]] 1791 | name = "wasi" 1792 | version = "0.11.0+wasi-snapshot-preview1" 1793 | source = "registry+https://github.com/rust-lang/crates.io-index" 1794 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1795 | 1796 | [[package]] 1797 | name = "wasm-bindgen" 1798 | version = "0.2.87" 1799 | source = "registry+https://github.com/rust-lang/crates.io-index" 1800 | checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" 1801 | dependencies = [ 1802 | "cfg-if", 1803 | "wasm-bindgen-macro", 1804 | ] 1805 | 1806 | [[package]] 1807 | name = "wasm-bindgen-backend" 1808 | version = "0.2.87" 1809 | source = "registry+https://github.com/rust-lang/crates.io-index" 1810 | checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" 1811 | dependencies = [ 1812 | "bumpalo", 1813 | "log", 1814 | "once_cell", 1815 | "proc-macro2", 1816 | "quote", 1817 | "syn", 1818 | "wasm-bindgen-shared", 1819 | ] 1820 | 1821 | [[package]] 1822 | name = "wasm-bindgen-futures" 1823 | version = "0.4.37" 1824 | source = "registry+https://github.com/rust-lang/crates.io-index" 1825 | checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" 1826 | dependencies = [ 1827 | "cfg-if", 1828 | "js-sys", 1829 | "wasm-bindgen", 1830 | "web-sys", 1831 | ] 1832 | 1833 | [[package]] 1834 | name = "wasm-bindgen-macro" 1835 | version = "0.2.87" 1836 | source = "registry+https://github.com/rust-lang/crates.io-index" 1837 | checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" 1838 | dependencies = [ 1839 | "quote", 1840 | "wasm-bindgen-macro-support", 1841 | ] 1842 | 1843 | [[package]] 1844 | name = "wasm-bindgen-macro-support" 1845 | version = "0.2.87" 1846 | source = "registry+https://github.com/rust-lang/crates.io-index" 1847 | checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" 1848 | dependencies = [ 1849 | "proc-macro2", 1850 | "quote", 1851 | "syn", 1852 | "wasm-bindgen-backend", 1853 | "wasm-bindgen-shared", 1854 | ] 1855 | 1856 | [[package]] 1857 | name = "wasm-bindgen-shared" 1858 | version = "0.2.87" 1859 | source = "registry+https://github.com/rust-lang/crates.io-index" 1860 | checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" 1861 | 1862 | [[package]] 1863 | name = "wax" 1864 | version = "0.5.0" 1865 | source = "registry+https://github.com/rust-lang/crates.io-index" 1866 | checksum = "06c7a3bac6110ac062b7b422a442b7ee23e07209e2784a036654cab1e71bbafc" 1867 | dependencies = [ 1868 | "bstr", 1869 | "const_format", 1870 | "itertools", 1871 | "nom", 1872 | "nom-supreme", 1873 | "pori", 1874 | "regex", 1875 | "smallvec", 1876 | "thiserror", 1877 | "walkdir", 1878 | ] 1879 | 1880 | [[package]] 1881 | name = "web-sys" 1882 | version = "0.3.64" 1883 | source = "registry+https://github.com/rust-lang/crates.io-index" 1884 | checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" 1885 | dependencies = [ 1886 | "js-sys", 1887 | "wasm-bindgen", 1888 | ] 1889 | 1890 | [[package]] 1891 | name = "winapi" 1892 | version = "0.3.9" 1893 | source = "registry+https://github.com/rust-lang/crates.io-index" 1894 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1895 | dependencies = [ 1896 | "winapi-i686-pc-windows-gnu", 1897 | "winapi-x86_64-pc-windows-gnu", 1898 | ] 1899 | 1900 | [[package]] 1901 | name = "winapi-i686-pc-windows-gnu" 1902 | version = "0.4.0" 1903 | source = "registry+https://github.com/rust-lang/crates.io-index" 1904 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1905 | 1906 | [[package]] 1907 | name = "winapi-util" 1908 | version = "0.1.5" 1909 | source = "registry+https://github.com/rust-lang/crates.io-index" 1910 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1911 | dependencies = [ 1912 | "winapi", 1913 | ] 1914 | 1915 | [[package]] 1916 | name = "winapi-x86_64-pc-windows-gnu" 1917 | version = "0.4.0" 1918 | source = "registry+https://github.com/rust-lang/crates.io-index" 1919 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1920 | 1921 | [[package]] 1922 | name = "windows" 1923 | version = "0.48.0" 1924 | source = "registry+https://github.com/rust-lang/crates.io-index" 1925 | checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" 1926 | dependencies = [ 1927 | "windows-targets", 1928 | ] 1929 | 1930 | [[package]] 1931 | name = "windows-sys" 1932 | version = "0.48.0" 1933 | source = "registry+https://github.com/rust-lang/crates.io-index" 1934 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1935 | dependencies = [ 1936 | "windows-targets", 1937 | ] 1938 | 1939 | [[package]] 1940 | name = "windows-targets" 1941 | version = "0.48.5" 1942 | source = "registry+https://github.com/rust-lang/crates.io-index" 1943 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1944 | dependencies = [ 1945 | "windows_aarch64_gnullvm", 1946 | "windows_aarch64_msvc", 1947 | "windows_i686_gnu", 1948 | "windows_i686_msvc", 1949 | "windows_x86_64_gnu", 1950 | "windows_x86_64_gnullvm", 1951 | "windows_x86_64_msvc", 1952 | ] 1953 | 1954 | [[package]] 1955 | name = "windows_aarch64_gnullvm" 1956 | version = "0.48.5" 1957 | source = "registry+https://github.com/rust-lang/crates.io-index" 1958 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1959 | 1960 | [[package]] 1961 | name = "windows_aarch64_msvc" 1962 | version = "0.48.5" 1963 | source = "registry+https://github.com/rust-lang/crates.io-index" 1964 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1965 | 1966 | [[package]] 1967 | name = "windows_i686_gnu" 1968 | version = "0.48.5" 1969 | source = "registry+https://github.com/rust-lang/crates.io-index" 1970 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1971 | 1972 | [[package]] 1973 | name = "windows_i686_msvc" 1974 | version = "0.48.5" 1975 | source = "registry+https://github.com/rust-lang/crates.io-index" 1976 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1977 | 1978 | [[package]] 1979 | name = "windows_x86_64_gnu" 1980 | version = "0.48.5" 1981 | source = "registry+https://github.com/rust-lang/crates.io-index" 1982 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1983 | 1984 | [[package]] 1985 | name = "windows_x86_64_gnullvm" 1986 | version = "0.48.5" 1987 | source = "registry+https://github.com/rust-lang/crates.io-index" 1988 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1989 | 1990 | [[package]] 1991 | name = "windows_x86_64_msvc" 1992 | version = "0.48.5" 1993 | source = "registry+https://github.com/rust-lang/crates.io-index" 1994 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1995 | 1996 | [[package]] 1997 | name = "winnow" 1998 | version = "0.5.15" 1999 | source = "registry+https://github.com/rust-lang/crates.io-index" 2000 | checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" 2001 | dependencies = [ 2002 | "memchr", 2003 | ] 2004 | 2005 | [[package]] 2006 | name = "winreg" 2007 | version = "0.50.0" 2008 | source = "registry+https://github.com/rust-lang/crates.io-index" 2009 | checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" 2010 | dependencies = [ 2011 | "cfg-if", 2012 | "windows-sys", 2013 | ] 2014 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "notion-zh_CN" 3 | version = "1.0.0" 4 | edition = "2021" 5 | 6 | [workspace] 7 | members = [ 8 | "update_intl", 9 | "update_asar" 10 | ] 11 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 12 | 13 | -------------------------------------------------------------------------------- /Note.md: -------------------------------------------------------------------------------- 1 | 查看MACOS 支持的架构 ` rustc --print target-list | grep "darwin" ` 2 | 查看 windows 支持的架构 `rustc --print target-list | grep "windows"` 3 | rustc --version --verbose 4 | ``` 5 | rustc 1.72.0 (5680fa18f 2023-08-23) 6 | binary: rustc 7 | commit-hash: 5680fa18feaa87f3ff04063800aec256c3d4b4be 8 | commit-date: 2023-08-23 9 | host: x86_64-unknown-linux-gnu 10 | release: 1.72.0 11 | LLVM version: 16.0.5 12 | ``` 13 | 14 | ``` 15 | rustc 1.74.0-nightly (b3aa8e716 2023-09-21) 16 | binary: rustc 17 | commit-hash: b3aa8e7168a3d940122db3561289ffbf3f587262 18 | commit-date: 2023-09-21 19 | host: aarch64-apple-darwin 20 | release: 1.74.0-nightly 21 | LLVM version: 17.0.0 22 | ``` 23 | rustup target add x86_64-apple-darwin 24 | 25 | rustup toolchain install stable-x86_64-apple-darwin 26 | 27 | cargo build --release --target x86_64-apple-darwin 28 | 29 | cargo build --release --target x86_64-pc-windows-gnu -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Window / Mac 版本已经更新3.1.0,请使用更新版本 2 | 3 | # notion-zh_CN 是什么? 4 | 5 | notion-zh_CN 是对notion的汉化脚本。 6 | 7 | ## 功能 8 | 9 | - 支持 网页端 ( 油猴脚本 ) + 桌面端 ( win / mac ) + 安卓端 汉化脚本 10 | - (很久没有维护)提供cloudflare worker 版本代理 notion.so 域名 11 | 这是一个**平台无关**(IOS 上的safari也能直接使用)的汉化方式,只要你自己部署cloudflare worker,就可以使用。附带cf代理**加速**的能力。 12 | > 其实这里应该可以做域名映射到notion.so的访问的。(从而实现全平台汉化) 13 | 14 | # 为什么要做这个项目? 15 | 16 | Notion 已经有了中文语料,让用户能够提前使用中文语料 17 | 18 | # 如何使用? 19 | 20 | ## 网页端 21 | 1. ### 安装油猴插件 22 | 此处提供搜索到知乎的一篇教程:https://zhuanlan.zhihu.com/p/128453110 23 | 24 | 2. ### 安装油猴脚本 25 | 打开链接:https://greasyfork.org/zh-CN/scripts/430116-notion-%E5%AE%8C%E5%85%A8%E4%B8%AD%E6%96%87%E5%8C%96-%E5%9F%BA%E4%BA%8E%E9%9F%A9%E8%AF%AD%E7%89%88%E6%9C%AC-%E4%BD%BF%E7%94%A8%E8%85%BE%E8%AE%AFapi%E6%9C%BA%E7%BF%BB 。然后点击安装。 26 | 27 | 3. ### 体验汉化效果 28 | https://www.notion.so 29 | 30 | ## 桌面端 31 | 32 | notion 客户端迎来了巨大更新,文件结构发生完全不一致的变化(没有了可以注入的preload.js了) 33 | 34 | **有问题发issue,最好是贴录屏,gif 能直接贴在issue** 35 | 36 | ### 预处理版本 37 | 38 | [https://github.com/Reamd7/notion-zh_CN/releases/tag/3.0.0](https://github.com/Reamd7/notion-zh_CN/releases/tag/3.1.0) 39 | 40 | - `app.win.zip` 41 | - `app.mac.zip` 42 | 43 | 都已经有了app文件夹 44 | 45 | 打开 `Notion安装目录/resources` 46 | 解压 `预处理压缩包` 到 `Notion安装目录/resources` 下 47 | 删除 `app.asar` 或 重命名为其他名字 48 | 49 | 50 | ### **(修改原理):** windows / mac 51 | 52 | 打开 `Notion安装目录/resources` 53 | 解压 `app.asar` 到相同目录的 `app` 文件夹下 54 | 找到 `.webpack/main/index.js` 55 | 1. 搜索 `localeHtml` 56 | 看到一个 `localeHtml[r]` 57 | 将 `r` 替换为 `zh-CN` / `zh-TW` 58 | 59 | 目的是直接使用缓存资源文件中 zh-CN 的 html 60 | 61 | 2. 搜索 requestReturnedAsIndexV2 62 | 63 | 看到 const e = l.default.join(i, u.path); 是文件的绝对路径 64 | 在下方直接注入以下代码, 目的是修改 renderer 中 localStorage 的 locale 缓存值 65 | ```js 66 | if (u.path.endsWith('.html')) { 67 | const fs = require('fs'); 68 | const htmlContent = fs.readFileSync(e, 'utf-8') 69 | if (!htmlContent.includes(`{"id":"KeyValueStore2:preferredLocale","value":"zh-CN","timestamp":Date.now(),"important":true}`)) { 70 | (() => { 71 | fs.writeFileSync(e, htmlContent.replace("", ` 87 | `)) 88 | })(); 89 | } 90 | } 91 | ``` 92 | 93 | 保存 94 | 95 | 96 | 删除 `app.asar` 或 重命名为其他名字 97 | 打开应用 98 | 99 | 100 | ### More 101 | 102 | 如果你不想修改软件源码,还有如下方案(之后可能会写成自动化脚本) 103 | 104 | 1. 打开Notion的资源缓存文件 105 | 106 | windows: `C:\Users\[用户名]\AppData\Roaming\Notion\notionAssetCache-v2` 107 | mac 108 | 109 | 2. 找到热更新资源最新的版本 110 | 基于语义化版本规则可以判断,或者看 `latestVersion.json` 内部 `version` 字段 111 | 112 | 以下以当前最新版本 `23.13.0.23` 举例子 113 | 114 | 3. 打开最新版本所在文件夹 `23.13.0.23/assets.json` 115 | 116 | 搜索到 `localeHtml` 字段, 117 | 将下级`en-US` 字段的值改为和 `zh-CN` 或 `zh-TW` 一致 118 | 保存 119 | 重启 120 | 121 | 该方案问题是 Notion 经常热更新会更新缓存,那就要一个自动化的脚本自动做如上的事情解决问题 122 | 123 | ## cloudflare worker 124 | 125 | > 不建议使用。不希望推广。有风险。你需要知道你在干什么。 126 | 127 | 1. 首页:https://workers.cloudflare.com 128 | 129 | 2. 注册,登陆,`Start building`,取一个子域名,`Create a Worker`。 130 | 131 | 3. 复制 [worker.js](https://github.com/Reamd7/notion-zh_CN/blob/main/worker.js) 到左侧代码框,修改 132 | ```js 133 | const BaseUrl = "xxxx.子域名.workers.dev" // 修改为自己的子域名 134 | ``` 135 | 136 | 4. `Save and deploy`。如果正常,右侧应显示提示框: 137 | Mismatch between origin and baseUrl (dev). 138 | 好的(这里就证明汉化成功了) 139 | 5. 以后可直接访问 `https://xxxx.子域名.workers.dev`。 140 | 141 | ## 安卓端 142 | 143 | - 下载apk:[https://github.com/Reamd7/notion-zh_CN/blob/main/apk/Notion_0.6.1122.beta(7122)_zh_cn.apk](https://github.com/Reamd7/notion-zh_CN/blob/main/apk/Notion_0.6.1122.beta(7122)_zh_cn.apk) 144 | 145 | # 大家可以做什么? 146 | 147 | 1. **优化汉化语言**。都是机器翻译,看到不通畅的句子欢迎提issue/pr直接改了 (修改 **`json/zh.json`** 文件,了解之前,先找到原有的英文,韩文对照一下再更新翻译。) 148 | 149 | # 呼吁: 150 | 提高付费率,支持你所支持的软让他发展更好,这样国内市场才会更受重视,而不是只是白嫖,买淘宝,搞教育账户。 151 | 152 | ## Star History 153 | 154 | [![Star History Chart](https://api.star-history.com/svg?repos=Reamd7/notion-zh_CN&type=Date)](https://star-history.com/#Reamd7/notion-zh_CN&Date) 155 | 156 | 157 | > 风险提示:使用 cloudflare worker 的同学,被官方检测出来并封号与我无关,希望自己看明白代码做了什么,以及为什么会被检测出来。 158 | > 其他方式的,都是使用官方国际化方案进行国际化的,而且在本地进行操作不通过任何服务器——理论上除非故意钓鱼否则不会封你。 159 | > 钓鱼:主动收集你是不是用了中文版国际化字段,而且,对比你并没有中文版权限。 160 | > 161 | > 如果担心有问题,可以等待官方中文版,可以稍微学习网页开发,可以询问网页开发朋友,项目都是开源的。究竟做了什么操作,对notion 应用本体有什么影响,没有理由的担心只能体现对别人的不信任。 162 | > 163 | > 该项目仅用于学习,如有侵权24h内会马上删除。 164 | 165 | 166 | # 更新日志: 167 | - 2.4.20 补充 window 更新目录文件之后的 自动注入软件 / 手动注入教程 168 | - 2.4.2 **翻译开始跟随着官方中文词条啦!!!!!** 169 | - 2.4.1 支持 ios / macos user script 170 | - 2.3.1 权衡后,安卓版本使用新的 runtime 注入方式,实现全部的(包括键盘都能够汉化的方式)但有首页白屏事件较长的问题。 171 | - 2.3.0 支持使用 cloudflare worker 进行代理 notion.so 域名进行加速及国际化 172 | - 2.2.0 支持 安卓版本notion,与官方版共存 的汉化! 173 | - 2.1.0:支持中文版快捷命令!支持拼音输入的时候显示快捷命令! 174 | ![](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/205477fc-c9df-48f2-a816-50c8809f244b/%E6%97%A0%E6%A0%87%E9%A2%98.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAT73L2G45O3KS52Y5%2F20210821%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210821T053807Z&X-Amz-Expires=86400&X-Amz-Signature=916007db665a09560b8cde53c10480377a1f58eed05a57f99853496dfb6c8729&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22%25E6%2597%25A0%25E6%25A0%2587%25E9%25A2%2598.png%22) 175 | - 2.0.4: 彻底支持无论是默认英文还是韩文都会生效的汉化脚本(2021/08/19 油猴剧本 + win 客户端 + mac 客户端测试通过),统一 win mac 网页端实现。 176 | - 2.0.3:支持切换到韩文之后帮助文档还原到默认英文版本 177 | - 2.0.1:支持mac客户端(英文) 178 | - 2.0.0: 支持win客户端(韩文) + 油猴脚本 179 | -------------------------------------------------------------------------------- /dprint.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript": { 3 | }, 4 | "json": { 5 | }, 6 | "markdown": { 7 | }, 8 | "toml": { 9 | }, 10 | "excludes": [ 11 | "**/node_modules", 12 | "**/*-lock.json" 13 | ], 14 | "plugins": [ 15 | "https://plugins.dprint.dev/typescript-0.87.1.wasm", 16 | "https://plugins.dprint.dev/json-0.17.4.wasm", 17 | "https://plugins.dprint.dev/markdown-0.16.1.wasm", 18 | "https://plugins.dprint.dev/toml-0.5.4.wasm" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /env.toml: -------------------------------------------------------------------------------- 1 | version = "3.0.2" 2 | notionVersion = "23.13.0.198" 3 | # Default `%appdata%/../Local/Programs/Notion` 4 | # window 下指定Notion路径,修改 folder,注意 不能为 C:\Users\用户名\AppData\Local\Programs\Notion,必须为 C:/Users/用户名/AppData/Local/Programs/Notion 5 | folder = "C:/Users/用户名/AppData/Local/Programs/Notion" 6 | # mac 下指定Notion路径 7 | # folder = "/Applications/Notion.app/" 8 | # 通用自动识别 9 | # folder = "~" 10 | 11 | # Use local 12 | # - zh_CN - 13 | # local_url="Notion-zh_CN.js" 14 | 15 | # - zh_TW - 16 | # local_url="Notion-zh_TW.js" 17 | 18 | 19 | # Use remote 20 | # - zh_CN - 21 | remote_url="https://greasyfork.org/scripts/430116-notion-zh-cn-notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC/code/Notion-zh_CN%20notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC.user.js" 22 | # remote_url="https://raw.githubusercontent.com/Reamd7/notion-zh_CN/main/notion-zh_CN.js" 23 | 24 | # - zh_TW - 25 | # remote_url="https://raw.githubusercontent.com/Reamd7/notion-zh_CN/main/notion-zh_TW.js" 26 | -------------------------------------------------------------------------------- /release/macos/env.toml: -------------------------------------------------------------------------------- 1 | version = "2.4.20" 2 | # Default `%appdata%/../Local/Programs/Notion` 3 | # window 下指定Notion路径,修改 folder,注意 不能为 C:\Users\用户名\AppData\Local\Programs\Notion,必须为 C:/Users/用户名/AppData/Local/Programs/Notion 4 | folder = "C:/Users/用户名/AppData/Local/Programs/Notion" 5 | # mac 下指定Notion路径 6 | # folder = "/Applications/Notion.app/" 7 | # 通用自动识别 8 | # folder = "~" 9 | 10 | # Use local 11 | # - zh_CN - 12 | # local_url="Notion-zh_CN.js" 13 | 14 | # - zh_TW - 15 | # local_url="Notion-zh_TW.js" 16 | 17 | 18 | # Use remote 19 | # - zh_CN - 20 | remote_url="https://greasyfork.org/scripts/430116-notion-zh-cn-notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC/code/Notion-zh_CN%20notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC.user.js" 21 | # remote_url="https://raw.githubusercontent.com/Reamd7/notion-zh_CN/main/notion-zh_CN.js" 22 | 23 | # - zh_TW - 24 | # remote_url="https://raw.githubusercontent.com/Reamd7/notion-zh_CN/main/notion-zh_TW.js" 25 | -------------------------------------------------------------------------------- /release/macos/update_asar_intel_mac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Reamd7/notion-zh_CN/11833ccc163d24e5a9b63078a0f163871bb25b64/release/macos/update_asar_intel_mac -------------------------------------------------------------------------------- /release/macos/update_asar_m1_mac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Reamd7/notion-zh_CN/11833ccc163d24e5a9b63078a0f163871bb25b64/release/macos/update_asar_m1_mac -------------------------------------------------------------------------------- /release/windows/env.toml: -------------------------------------------------------------------------------- 1 | version = "2.4.20" 2 | # Default `%appdata%/../Local/Programs/Notion` 3 | # window 下指定Notion路径,修改 folder,注意 不能为 C:\Users\用户名\AppData\Local\Programs\Notion,必须为 C:/Users/用户名/AppData/Local/Programs/Notion 4 | folder = "C:/Users/用户名/AppData/Local/Programs/Notion" 5 | # mac 下指定Notion路径 6 | # folder = "/Applications/Notion.app/" 7 | # 通用自动识别 8 | # folder = "~" 9 | 10 | # Use local 11 | # - zh_CN - 12 | # local_url="Notion-zh_CN.js" 13 | 14 | # - zh_TW - 15 | # local_url="Notion-zh_TW.js" 16 | 17 | 18 | # Use remote 19 | # - zh_CN - 20 | remote_url="https://greasyfork.org/scripts/430116-notion-zh-cn-notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC/code/Notion-zh_CN%20notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC.user.js" 21 | # remote_url="https://raw.githubusercontent.com/Reamd7/notion-zh_CN/main/notion-zh_CN.js" 22 | 23 | # - zh_TW - 24 | # remote_url="https://raw.githubusercontent.com/Reamd7/notion-zh_CN/main/notion-zh_TW.js" 25 | -------------------------------------------------------------------------------- /release/windows/update_asar.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Reamd7/notion-zh_CN/11833ccc163d24e5a9b63078a0f163871bb25b64/release/windows/update_asar.exe -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello, world!"); 3 | } 4 | -------------------------------------------------------------------------------- /template/notion-zh_CN.template,.backup.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Notion-zh_CN notion的汉化脚本 3 | // @namespace http://tampermonkey.net/ 4 | // @version %version% 5 | // @description notion的100%汉化脚本,基于官方中文+机器翻译韩文,支持app版本以及网页油猴,地址:https://github.com/reamd7/notion-zh_CN 6 | // @author reamd7 7 | // @match *://www.notion.so/* 8 | // @match *://*.notion.site/* 9 | // @grant none 10 | // @run-at document-start 11 | // @copyright 2021, reamd7 12 | // @license MIT 13 | // ==/UserScript== 14 | (function () { 15 | "use strict"; 16 | var lang = "zh-CN"; 17 | var isSafari = navigator.userAgent.includes('Safari/') && !navigator.userAgent.includes('Chrome/') 18 | var isElectron = "undefined" != typeof global || window.__isElectron; 19 | 20 | const scriptList = document.querySelectorAll(('script[defer]')); 21 | const scriptSrcList = Array.from(scriptList).map(v => v.src) 22 | if (isSafari) { 23 | scriptList.forEach(v => v.remove()) 24 | document.getElementById("notion-app").remove(); 25 | } 26 | 27 | %zh% 28 | 29 | function insertMoment() { 30 | try { 31 | moment.updateLocale(lang.toLowerCase(), { 32 | longDateFormat: { 33 | LT: "h:mm A", 34 | LTS: "h:mm:ss A", 35 | L: "YYYY/MM/DD", 36 | LL: "YYYY年M月D日", 37 | LLL: "YYYY年M月D日Ah点mm分", 38 | LLLL: "YYYY年M月D日ddddAh点mm分", 39 | l: "YYYY/M/D", 40 | ll: "YYYY年M月D日", 41 | lll: "YYYY年M月D日 HH:mm", 42 | llll: "YYYY年M月D日dddd HH:mm", 43 | }, 44 | }); 45 | moment.locale(lang.toLowerCase()) 46 | } catch (e) { 47 | requestAnimationFrame(() => { 48 | insertMoment(); 49 | }); 50 | } 51 | } 52 | 53 | try { 54 | const preferredLocaleStr = window.localStorage.getItem("LRU:KeyValueStore2:preferredLocale") 55 | const preferredLocale = JSON.parse(preferredLocaleStr); 56 | if (preferredLocale.value) { 57 | preferredLocale.value = lang 58 | window.localStorage.setItem("LRU:KeyValueStore2:preferredLocale", JSON.stringify(preferredLocale)) // search window.document.querySelector("#messages") 请阅读 59 | } 60 | } catch (e) {} 61 | 62 | if (isElectron) { 63 | var observer = new MutationObserver(function(callback) { 64 | if (callback.filter(v => { 65 | return v.target === document.head; 66 | }).length > 0) { 67 | document.head.insertAdjacentElement("afterbegin", script); 68 | document.head.insertAdjacentElement("afterbegin", routes); 69 | observer.disconnect() 70 | } 71 | }); 72 | observer.observe(document, { 73 | childList: true, // 观察目标子节点的变化,是否有添加或者删除 74 | attributes: false, // 观察属性变动 75 | subtree: true // 观察后代节点,默认为 false 76 | }); 77 | insertMoment(); 78 | } else { 79 | function insert() { 80 | try { 81 | document.body.appendChild(script); 82 | document.body.appendChild(routes); 83 | } catch(e) { 84 | requestAnimationFrame(()=>{ 85 | insert() 86 | }) 87 | } 88 | } 89 | insert(); 90 | insertMoment(); 91 | 92 | // for UserScript 93 | if (isSafari) { 94 | const notionRoot = document.createElement('div'); 95 | notionRoot.id = "notion-app" 96 | notionRoot.setAttribute("data-inject", true); 97 | document.body.append(notionRoot); 98 | scriptSrcList.forEach(url => { 99 | const script = document.createElement("script"); 100 | script.type= 'text/javascript'; 101 | script.defer = "defer"; 102 | script.src = url; 103 | script.setAttribute("data-inject", true) 104 | document.head.append(script) 105 | }) 106 | if (!window.__console || !window.__console.push) { 107 | window.__console = { 108 | push: (msg) => { 109 | 110 | } 111 | } 112 | } 113 | } 114 | } 115 | })(); 116 | -------------------------------------------------------------------------------- /template/notion-zh_CN.template.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Notion-zh_CN notion的汉化脚本 3 | // @namespace http://tampermonkey.net/ 4 | // @version %version% 5 | // @description notion的100%汉化脚本,基于官方中文+机器翻译韩文,支持app版本以及网页油猴,地址:https://github.com/reamd7/notion-zh_CN 6 | // @author reamd7 7 | // @match *://www.notion.so/* 8 | // @match *://*.notion.site/* 9 | // @grant none 10 | // @run-at document-start 11 | // @copyright 2021, reamd7 12 | // @license MIT 13 | // ==/UserScript== 14 | (function () { 15 | "use strict"; 16 | %zh%; 17 | var isSafari = 18 | navigator.userAgent.includes("Safari/") && 19 | !navigator.userAgent.includes("Chrome/"); 20 | var isElectron = "undefined" != typeof global || window.__isElectron; 21 | 22 | const scriptList = document.querySelectorAll("script[defer]"); 23 | const scriptSrcList = Array.from(scriptList).map((v) => v.src); 24 | if (isSafari) { 25 | scriptList.forEach((v) => v.remove()); 26 | document.getElementById("notion-app").remove(); 27 | } 28 | const LOCALE_SETUP = window.LOCALE_SETUP; 29 | var lang = LOCALE_SETUP.locale; 30 | const call = function () { 31 | Object.defineProperty(window, "LOCALE_SETUP", { 32 | get() { 33 | debugger; 34 | return LOCALE_SETUP; 35 | }, 36 | set() {}, 37 | }); 38 | }; 39 | call(); 40 | 41 | const script = document.createElement("script"); 42 | if (isElectron) { 43 | script.id = "messages"; 44 | script.type = "text/javascript"; 45 | script.defer = "defer"; 46 | script.setAttribute("data-locale", lang); 47 | const translateText = JSON.stringify(LOCALE_SETUP.messages) 48 | script.text = ` 49 | window.LOCALE_SETUP={locale: "${LOCALE_SETUP.locale}", messages: ${translateText}, routes: {}} 50 | const LOCALE_SETUP = window.LOCALE_SETUP; 51 | Object.defineProperty(window, "LOCALE_SETUP", { 52 | get() { 53 | debugger; 54 | return LOCALE_SETUP; 55 | }, 56 | set() {}, 57 | }); 58 | ` 59 | } 60 | 61 | function insertMoment() { 62 | try { 63 | moment.updateLocale(lang.toLowerCase(), { 64 | longDateFormat: { 65 | LT: "h:mm A", 66 | LTS: "h:mm:ss A", 67 | L: "YYYY/MM/DD", 68 | LL: "YYYY年M月D日", 69 | LLL: "YYYY年M月D日Ah点mm分", 70 | LLLL: "YYYY年M月D日ddddAh点mm分", 71 | l: "YYYY/M/D", 72 | ll: "YYYY年M月D日", 73 | lll: "YYYY年M月D日 HH:mm", 74 | llll: "YYYY年M月D日dddd HH:mm", 75 | }, 76 | }); 77 | moment.locale(lang.toLowerCase()); 78 | } catch (e) { 79 | requestAnimationFrame(() => { 80 | insertMoment(); 81 | }); 82 | } 83 | } 84 | 85 | try { 86 | const preferredLocaleStr = window.localStorage.getItem( 87 | "LRU:KeyValueStore2:preferredLocale" 88 | ); 89 | const preferredLocale = JSON.parse(preferredLocaleStr) || {"id":"KeyValueStore2:preferredLocale","value":"zh-CN","timestamp":Date.now(),"important":true}; 90 | if (preferredLocale.value) { 91 | preferredLocale.value = lang; 92 | } 93 | window.localStorage.setItem( 94 | "LRU:KeyValueStore2:preferredLocale", 95 | JSON.stringify(preferredLocale) 96 | ); // search window.document.querySelector("#messages") 请阅读 97 | } catch (e) {} 98 | 99 | if (isElectron) { 100 | var observer = new MutationObserver(function (callback) { 101 | if ( 102 | callback.filter((v) => { 103 | return v.target === document.head; 104 | }).length > 0 105 | ) { 106 | document.head.insertAdjacentElement("afterbegin", script); 107 | observer.disconnect(); 108 | } 109 | }); 110 | observer.observe(document, { 111 | childList: true, // 观察目标子节点的变化,是否有添加或者删除 112 | attributes: false, // 观察属性变动 113 | subtree: true, // 观察后代节点,默认为 false 114 | }); 115 | insertMoment(); 116 | } else { 117 | function insert() { 118 | try { 119 | document.body.appendChild(script); 120 | } catch (e) { 121 | requestAnimationFrame(() => { 122 | insert(); 123 | }); 124 | } 125 | } 126 | insert(); 127 | insertMoment(); 128 | 129 | // for UserScript 130 | if (isSafari) { 131 | const notionRoot = document.createElement("div"); 132 | notionRoot.id = "notion-app"; 133 | notionRoot.setAttribute("data-inject", true); 134 | document.body.append(notionRoot); 135 | scriptSrcList.forEach((url) => { 136 | const script = document.createElement("script"); 137 | script.type = "text/javascript"; 138 | script.defer = "defer"; 139 | script.src = url; 140 | script.setAttribute("data-inject", true); 141 | document.head.append(script); 142 | }); 143 | if (!window.__console || !window.__console.push) { 144 | window.__console = { 145 | push: (msg) => { }, 146 | }; 147 | } 148 | } 149 | } 150 | })(); 151 | -------------------------------------------------------------------------------- /template/notion-zh_TW.template.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Notion-zh_TW notion的汉化脚本 3 | // @namespace http://tampermonkey.net/ 4 | // @version %version% 5 | // @description notion的100%汉化脚本,基于官方中文+机器翻译韩文,支持app版本以及网页油猴,地址:https://github.com/reamd7/notion-zh_CN 6 | // @author reamd7 7 | // @match *://www.notion.so/* 8 | // @match *://*.notion.site/* 9 | // @grant none 10 | // @run-at document-start 11 | // @copyright 2021, reamd7 12 | // @license MIT 13 | // ==/UserScript== 14 | (function () { 15 | "use strict"; 16 | %zh%; 17 | 18 | var isSafari = 19 | navigator.userAgent.includes("Safari/") && 20 | !navigator.userAgent.includes("Chrome/"); 21 | var isElectron = "undefined" != typeof global || window.__isElectron; 22 | 23 | const scriptList = document.querySelectorAll("script[defer]"); 24 | const scriptSrcList = Array.from(scriptList).map((v) => v.src); 25 | if (isSafari) { 26 | scriptList.forEach((v) => v.remove()); 27 | document.getElementById("notion-app").remove(); 28 | } 29 | const LOCALE_SETUP = window.LOCALE_SETUP; 30 | var lang = LOCALE_SETUP.locale; 31 | const call = function () { 32 | Object.defineProperty(window, "LOCALE_SETUP", { 33 | get() { 34 | debugger; 35 | return LOCALE_SETUP; 36 | }, 37 | set() {}, 38 | }); 39 | }; 40 | call(); 41 | 42 | const script = document.createElement("script"); 43 | if (isElectron) { 44 | script.id = "messages"; 45 | script.type = "text/javascript"; 46 | script.defer = "defer"; 47 | script.setAttribute("data-locale", lang); 48 | const translateText = JSON.stringify(LOCALE_SETUP.messages) 49 | script.text = ` 50 | window.LOCALE_SETUP={locale: "${LOCALE_SETUP.locale}", messages: ${translateText}, routes: {}} 51 | const LOCALE_SETUP = window.LOCALE_SETUP; 52 | Object.defineProperty(window, "LOCALE_SETUP", { 53 | get() { 54 | debugger; 55 | return LOCALE_SETUP; 56 | }, 57 | set() {}, 58 | }); 59 | ` 60 | } 61 | 62 | function insertMoment() { 63 | try { 64 | moment.updateLocale(lang.toLowerCase(), { 65 | longDateFormat: { 66 | LT: "h:mm A", 67 | LTS: "h:mm:ss A", 68 | L: "YYYY/MM/DD", 69 | LL: "YYYY年M月D日", 70 | LLL: "YYYY年M月D日Ah点mm分", 71 | LLLL: "YYYY年M月D日ddddAh点mm分", 72 | l: "YYYY/M/D", 73 | ll: "YYYY年M月D日", 74 | lll: "YYYY年M月D日 HH:mm", 75 | llll: "YYYY年M月D日dddd HH:mm", 76 | }, 77 | }); 78 | moment.locale(lang.toLowerCase()); 79 | } catch (e) { 80 | requestAnimationFrame(() => { 81 | insertMoment(); 82 | }); 83 | } 84 | } 85 | 86 | try { 87 | const preferredLocaleStr = window.localStorage.getItem( 88 | "LRU:KeyValueStore2:preferredLocale" 89 | ); 90 | const preferredLocale = JSON.parse(preferredLocaleStr) || {"id":"KeyValueStore2:preferredLocale","value":"zh-CN","timestamp":Date.now(),"important":true}; 91 | if (preferredLocale.value) { 92 | preferredLocale.value = lang; 93 | } 94 | window.localStorage.setItem( 95 | "LRU:KeyValueStore2:preferredLocale", 96 | JSON.stringify(preferredLocale) 97 | ); // search window.document.querySelector("#messages") 请阅读 98 | } catch (e) {} 99 | 100 | if (isElectron) { 101 | var observer = new MutationObserver(function (callback) { 102 | if ( 103 | callback.filter((v) => { 104 | return v.target === document.head; 105 | }).length > 0 106 | ) { 107 | document.head.insertAdjacentElement("afterbegin", script); 108 | observer.disconnect(); 109 | } 110 | }); 111 | observer.observe(document, { 112 | childList: true, // 观察目标子节点的变化,是否有添加或者删除 113 | attributes: false, // 观察属性变动 114 | subtree: true, // 观察后代节点,默认为 false 115 | }); 116 | insertMoment(); 117 | } else { 118 | function insert() { 119 | try { 120 | document.body.appendChild(script); 121 | } catch (e) { 122 | requestAnimationFrame(() => { 123 | insert(); 124 | }); 125 | } 126 | } 127 | insert(); 128 | insertMoment(); 129 | 130 | // for UserScript 131 | if (isSafari) { 132 | const notionRoot = document.createElement("div"); 133 | notionRoot.id = "notion-app"; 134 | notionRoot.setAttribute("data-inject", true); 135 | document.body.append(notionRoot); 136 | scriptSrcList.forEach((url) => { 137 | const script = document.createElement("script"); 138 | script.type = "text/javascript"; 139 | script.defer = "defer"; 140 | script.src = url; 141 | script.setAttribute("data-inject", true); 142 | document.head.append(script); 143 | }); 144 | if (!window.__console || !window.__console.push) { 145 | window.__console = { 146 | push: (msg) => { }, 147 | }; 148 | } 149 | } 150 | } 151 | })(); 152 | -------------------------------------------------------------------------------- /update.ps1: -------------------------------------------------------------------------------- 1 | Invoke-WebRequest -Uri "https://greasyfork.org/scripts/430116-notion-zh-cn-notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC/code/Notion-zh_CN%20notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC.user.js" -OutFile "$HOME\AppData\Local\Programs\Notion\resources\app\renderer\notion-zh_CN.js" 2 | [string]$content=Get-Content "$HOME\AppData\Local\Programs\Notion\resources\app\renderer\preload.js" 3 | If(!$content.Contains("notion-zh_CN")) 4 | { 5 | Add-Content "$HOME\AppData\Local\Programs\Notion\resources\app\renderer\preload.js" `n'require("./notion-zh_CN")' 6 | } 7 | -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | folder="/Applications/Notion.app/Contents/Resources/app.asar/renderer" 4 | preloadJs="/Applications/Notion.app/Contents/Resources/app.asar/renderer/preload.js" 5 | remoteUrl="https://greasyfork.org/scripts/430116-notion-zh-cn-notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC/code/Notion-zh_CN%20notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC.user.js" 6 | 7 | if [ -w "/Applications/Notion.app/Contents/Resources/app.asar/renderer/preload.js" ]; then 8 | curl -# -o "$folder/Notion-zh_CN.js" "$remoteUrl" 9 | 10 | listLine="tail -n 1 $preloadJs" 11 | if [ "$($listLine)" != "require('./Notion-zh_CN')" ]; then 12 | echo "require('./Notion-zh_CN')" >> $preloadJs 13 | fi 14 | fi 15 | -------------------------------------------------------------------------------- /update_asar/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "update_asar" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | anyhow = "1.0.75" 10 | asar = "0.2.0" 11 | reqwest = { version = "0.11.20", features = ["json"] } 12 | tokio = { version = "1.32.0", features = ["full"] } 13 | toml_edit = "0.20.0" 14 | directories = "5.0.1" 15 | colored = "2.0.4" 16 | -------------------------------------------------------------------------------- /update_asar/build_aarch64-apple-darwin.sh: -------------------------------------------------------------------------------- 1 | cargo build --release --target aarch64-apple-darwin -------------------------------------------------------------------------------- /update_asar/build_x86_64-pc-windows-gnu.sh: -------------------------------------------------------------------------------- 1 | cargo build --release --target x86_64-pc-windows-gnu -------------------------------------------------------------------------------- /update_asar/build_x86_64-unknown-linux-gnu.sh: -------------------------------------------------------------------------------- 1 | cargo build --release --target x86_64-unknown-linux-gnu -------------------------------------------------------------------------------- /update_asar/env.toml: -------------------------------------------------------------------------------- 1 | version = "2.4.20" 2 | # Default `%appdata%/../Local/Programs/Notion` 3 | folder = "~" 4 | 5 | # Use local 6 | # - zh_CN - 7 | # local_url="Notion-zh_CN.js" 8 | 9 | # - zh_TW - 10 | # local_url="Notion-zh_TW.js" 11 | 12 | 13 | # Use remote 14 | # - zh_CN - 15 | remote_url="https://greasyfork.org/scripts/430116-notion-zh-cn-notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC/code/Notion-zh_CN%20notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC.user.js" 16 | # remote_url="https://raw.githubusercontent.com/Reamd7/notion-zh_CN/main/notion-zh_CN.js" 17 | 18 | # - zh_TW - 19 | # remote_url="https://raw.githubusercontent.com/Reamd7/notion-zh_CN/main/notion-zh_TW.js" 20 | -------------------------------------------------------------------------------- /update_asar/src/main.rs: -------------------------------------------------------------------------------- 1 | #![feature(is_terminal)] 2 | 3 | use anyhow::Result; 4 | use asar::AsarReader; 5 | use colored::Colorize; 6 | use directories::BaseDirs; 7 | use std::fs; 8 | use std::io::Read; 9 | use std::path::Path; 10 | use toml_edit::Document; 11 | 12 | struct UpdateScriptEnv { 13 | version: String, 14 | folder: String, 15 | url: Option, 16 | __doc__: Document, 17 | } 18 | 19 | enum URL { 20 | Local(String), 21 | Remote(String), 22 | } 23 | 24 | impl UpdateScriptEnv { 25 | fn new() -> UpdateScriptEnv { 26 | let cwd = std::env::current_dir().unwrap(); 27 | println!("[log] 当前执行路径 {}", cwd.to_str().unwrap().green()); 28 | let toml_path = cwd.join(Path::new("env.toml")); 29 | println!("[log] 配置文件路径 {}", toml_path.to_str().unwrap().green()); 30 | let mut toml_file = fs::File::open(toml_path) 31 | .unwrap_or_else(|_| panic!("{}", "[Error] 找不到配置文件".red())); 32 | let mut toml = String::new(); 33 | toml_file 34 | .read_to_string(&mut toml) 35 | .unwrap_or_else(|_| panic!("{}", "[Error] 配置文件读取失败".red())); 36 | 37 | let doc = toml 38 | .parse::() 39 | .unwrap_or_else(|_| panic!("{}", "[Error] 解析配置文件失败".red())); 40 | UpdateScriptEnv { 41 | version: doc["version"] 42 | .as_str() 43 | .unwrap_or_else(|| panic!("{}", "[Error] 解析配置 version 失败".red().to_string())) 44 | .to_string(), 45 | folder: match doc["folder"].as_str() { 46 | Some("~") => UpdateScriptEnv::find_notion_install_path(), 47 | Some(dir) => dir.to_string(), 48 | None => panic!("{}", "[Error] 解析配置 folder 失败".red().to_string()), 49 | }, 50 | url: match doc.get("local_url") { 51 | Some(local) => Some(URL::Local(match local.as_str() { 52 | Some(s) => s.to_string(), 53 | None => panic!("{}", "[Error] 解析配置 local_url 失败".red().to_string()), 54 | })), 55 | None => doc.get("remote_url").map(|remote| { 56 | URL::Remote( 57 | remote 58 | .as_str() 59 | .unwrap_or_else(|| { 60 | panic!("{}", "[Error] 解析配置 remote_url 失败".red().to_string()) 61 | }) 62 | .to_string(), 63 | ) 64 | }), 65 | }, 66 | __doc__: doc, 67 | } 68 | } 69 | pub fn update_version(&mut self, next_version: &str) { 70 | self.__doc__["version"] = toml_edit::value(next_version); 71 | self.version = next_version.to_string(); 72 | } 73 | 74 | fn find_notion_install_path() -> String { 75 | if cfg!(target_os = "windows") { 76 | // windows系统要执行的代码段 77 | if let Some(d) = BaseDirs::new() { 78 | let mut x = String::from(d.data_local_dir().to_str().unwrap()); 79 | x.push_str("/Programs/Notion"); 80 | return x; 81 | } else { 82 | panic!() 83 | } 84 | } 85 | if cfg!(target_os = "macos") { 86 | return String::from("/Applications/Notion.app/"); 87 | } 88 | // linux系统要执行的代码段 89 | panic!(); 90 | } 91 | } 92 | 93 | #[tokio::main] 94 | async fn main() -> Result<()> { 95 | let env = UpdateScriptEnv::new(); 96 | 97 | let notion_install_path = Path::new(&env.folder); 98 | 99 | let notion_resource_path = notion_install_path.join("resources"); 100 | 101 | let notion_app_asar = notion_resource_path.join("app.asar"); 102 | let app_asar_copy = notion_resource_path.join("app.asar.backup"); 103 | 104 | if notion_app_asar.is_file() { 105 | // 先备份 106 | fs::copy(¬ion_app_asar, &app_asar_copy)?; 107 | fs::remove_file(¬ion_app_asar)?; 108 | println!("备份 app.asar"); 109 | } 110 | if app_asar_copy.is_file() { 111 | let asar_file = fs::read(&app_asar_copy) 112 | .unwrap_or_else(|_| { panic!("{}", "读取 asar 文件失败".red().to_string()) }); 113 | 114 | let asar = AsarReader::new(&asar_file, notion_app_asar.clone()) 115 | .unwrap_or_else(|_| { panic!("{}", "解析 asar 文件失败".red().to_string()) }); 116 | 117 | if !notion_app_asar.is_dir() { 118 | fs::create_dir(¬ion_app_asar).unwrap_or_else(|_| { panic!("{}", "创建 app.asar 文件夹失败".red().to_string()) });; 119 | // unzip 120 | for file_path in asar.files().keys() { 121 | let file = asar.files().get(file_path).unwrap(); 122 | 123 | let extra_path = notion_app_asar.join(file_path); 124 | let extra_parent_path = extra_path.parent(); 125 | if let Some(extra_parent_path) = extra_parent_path { 126 | if !extra_parent_path.is_dir() { 127 | if let Err(err) = fs::create_dir_all(extra_parent_path) { 128 | println!("CreateDirError {:?}", err); 129 | } 130 | } 131 | } 132 | // 涉及系统平台的内容不一定是标准的utf-8 格式,所以是不可以直接转换的 133 | let content = file.data(); 134 | fs::write(extra_path, content)?; 135 | } 136 | println!("解压 app.asar"); 137 | } 138 | 139 | // let files = asar.files().keys().collect::>(); 140 | let preload_path = Path::new("renderer/preload.js"); 141 | let preload_js_file = asar.files().get(preload_path).unwrap(); 142 | let preload_js_contents = std::str::from_utf8(preload_js_file.data()).unwrap(); 143 | 144 | fs::write( 145 | notion_app_asar.join(preload_path), 146 | format!("{}\n{}", preload_js_contents, "require('./Notion-zh_CN');"), 147 | )?; 148 | 149 | let text: String = match &env.url { 150 | Some(url) => match url { 151 | URL::Local(local) => match fs::read_to_string(local) { 152 | Ok(r) => r.to_string(), 153 | Err(_) => panic!(), 154 | }, 155 | URL::Remote(remote) => match reqwest::Client::new() 156 | .get(remote) 157 | .send() 158 | .await? 159 | .text() 160 | .await 161 | { 162 | Ok(r) => r, 163 | Err(_) => panic!(), 164 | }, 165 | }, 166 | _ => panic!(), 167 | }; 168 | 169 | let i18n_path = Path::new("renderer/notion-zh_CN.js"); 170 | 171 | fs::write(notion_app_asar.join(i18n_path), text)?; 172 | 173 | println!("完成 i18n 注入"); 174 | } 175 | Ok(()) 176 | } 177 | -------------------------------------------------------------------------------- /update_github.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export ALL_PROXY="http://127.0.0.1:7890" 3 | 4 | folder="/Applications/Notion.app/Contents/Resources/app/renderer" 5 | preloadJs="/Applications/Notion.app/Contents/Resources/app/renderer/preload.js" 6 | remoteUrl="https://raw.githubusercontent.com/Reamd7/notion-zh_CN/main/notion-zh_CN.js" 7 | 8 | if [ -w "/Applications/Notion.app/Contents/Resources/app/renderer/preload.js" ]; then 9 | curl -# -o "$folder/Notion-zh_CN.js" "$remoteUrl" 10 | 11 | listLine="tail -n 1 $preloadJs" 12 | if [ "$($listLine)" != "require('./Notion-zh_CN')" ]; then 13 | echo "require('./Notion-zh_CN')" >> $preloadJs 14 | fi 15 | fi 16 | -------------------------------------------------------------------------------- /update_intl/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.21.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "autocfg" 22 | version = "1.1.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 25 | 26 | [[package]] 27 | name = "backtrace" 28 | version = "0.3.69" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" 31 | dependencies = [ 32 | "addr2line", 33 | "cc", 34 | "cfg-if", 35 | "libc", 36 | "miniz_oxide", 37 | "object", 38 | "rustc-demangle", 39 | ] 40 | 41 | [[package]] 42 | name = "base64" 43 | version = "0.21.4" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" 46 | 47 | [[package]] 48 | name = "bitflags" 49 | version = "1.3.2" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 52 | 53 | [[package]] 54 | name = "bitflags" 55 | version = "2.4.0" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" 58 | 59 | [[package]] 60 | name = "bumpalo" 61 | version = "3.14.0" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" 64 | 65 | [[package]] 66 | name = "bytes" 67 | version = "1.5.0" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" 70 | 71 | [[package]] 72 | name = "cc" 73 | version = "1.0.83" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" 76 | dependencies = [ 77 | "libc", 78 | ] 79 | 80 | [[package]] 81 | name = "cfg-if" 82 | version = "1.0.0" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 85 | 86 | [[package]] 87 | name = "core-foundation" 88 | version = "0.9.3" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 91 | dependencies = [ 92 | "core-foundation-sys", 93 | "libc", 94 | ] 95 | 96 | [[package]] 97 | name = "core-foundation-sys" 98 | version = "0.8.4" 99 | source = "registry+https://github.com/rust-lang/crates.io-index" 100 | checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" 101 | 102 | [[package]] 103 | name = "encoding_rs" 104 | version = "0.8.33" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" 107 | dependencies = [ 108 | "cfg-if", 109 | ] 110 | 111 | [[package]] 112 | name = "errno" 113 | version = "0.3.3" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" 116 | dependencies = [ 117 | "errno-dragonfly", 118 | "libc", 119 | "windows-sys", 120 | ] 121 | 122 | [[package]] 123 | name = "errno-dragonfly" 124 | version = "0.1.2" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 127 | dependencies = [ 128 | "cc", 129 | "libc", 130 | ] 131 | 132 | [[package]] 133 | name = "fastrand" 134 | version = "2.0.0" 135 | source = "registry+https://github.com/rust-lang/crates.io-index" 136 | checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" 137 | 138 | [[package]] 139 | name = "fnv" 140 | version = "1.0.7" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 143 | 144 | [[package]] 145 | name = "foreign-types" 146 | version = "0.3.2" 147 | source = "registry+https://github.com/rust-lang/crates.io-index" 148 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 149 | dependencies = [ 150 | "foreign-types-shared", 151 | ] 152 | 153 | [[package]] 154 | name = "foreign-types-shared" 155 | version = "0.1.1" 156 | source = "registry+https://github.com/rust-lang/crates.io-index" 157 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 158 | 159 | [[package]] 160 | name = "form_urlencoded" 161 | version = "1.2.0" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" 164 | dependencies = [ 165 | "percent-encoding", 166 | ] 167 | 168 | [[package]] 169 | name = "futures-channel" 170 | version = "0.3.28" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" 173 | dependencies = [ 174 | "futures-core", 175 | ] 176 | 177 | [[package]] 178 | name = "futures-core" 179 | version = "0.3.28" 180 | source = "registry+https://github.com/rust-lang/crates.io-index" 181 | checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" 182 | 183 | [[package]] 184 | name = "futures-sink" 185 | version = "0.3.28" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" 188 | 189 | [[package]] 190 | name = "futures-task" 191 | version = "0.3.28" 192 | source = "registry+https://github.com/rust-lang/crates.io-index" 193 | checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" 194 | 195 | [[package]] 196 | name = "futures-util" 197 | version = "0.3.28" 198 | source = "registry+https://github.com/rust-lang/crates.io-index" 199 | checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" 200 | dependencies = [ 201 | "futures-core", 202 | "futures-task", 203 | "pin-project-lite", 204 | "pin-utils", 205 | ] 206 | 207 | [[package]] 208 | name = "gimli" 209 | version = "0.28.0" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" 212 | 213 | [[package]] 214 | name = "h2" 215 | version = "0.3.21" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" 218 | dependencies = [ 219 | "bytes", 220 | "fnv", 221 | "futures-core", 222 | "futures-sink", 223 | "futures-util", 224 | "http", 225 | "indexmap", 226 | "slab", 227 | "tokio", 228 | "tokio-util", 229 | "tracing", 230 | ] 231 | 232 | [[package]] 233 | name = "hashbrown" 234 | version = "0.12.3" 235 | source = "registry+https://github.com/rust-lang/crates.io-index" 236 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 237 | 238 | [[package]] 239 | name = "hermit-abi" 240 | version = "0.3.2" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" 243 | 244 | [[package]] 245 | name = "http" 246 | version = "0.2.9" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 249 | dependencies = [ 250 | "bytes", 251 | "fnv", 252 | "itoa", 253 | ] 254 | 255 | [[package]] 256 | name = "http-body" 257 | version = "0.4.5" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 260 | dependencies = [ 261 | "bytes", 262 | "http", 263 | "pin-project-lite", 264 | ] 265 | 266 | [[package]] 267 | name = "httparse" 268 | version = "1.8.0" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 271 | 272 | [[package]] 273 | name = "httpdate" 274 | version = "1.0.3" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 277 | 278 | [[package]] 279 | name = "hyper" 280 | version = "0.14.27" 281 | source = "registry+https://github.com/rust-lang/crates.io-index" 282 | checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" 283 | dependencies = [ 284 | "bytes", 285 | "futures-channel", 286 | "futures-core", 287 | "futures-util", 288 | "h2", 289 | "http", 290 | "http-body", 291 | "httparse", 292 | "httpdate", 293 | "itoa", 294 | "pin-project-lite", 295 | "socket2 0.4.9", 296 | "tokio", 297 | "tower-service", 298 | "tracing", 299 | "want", 300 | ] 301 | 302 | [[package]] 303 | name = "hyper-tls" 304 | version = "0.5.0" 305 | source = "registry+https://github.com/rust-lang/crates.io-index" 306 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 307 | dependencies = [ 308 | "bytes", 309 | "hyper", 310 | "native-tls", 311 | "tokio", 312 | "tokio-native-tls", 313 | ] 314 | 315 | [[package]] 316 | name = "idna" 317 | version = "0.4.0" 318 | source = "registry+https://github.com/rust-lang/crates.io-index" 319 | checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" 320 | dependencies = [ 321 | "unicode-bidi", 322 | "unicode-normalization", 323 | ] 324 | 325 | [[package]] 326 | name = "indexmap" 327 | version = "1.9.3" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 330 | dependencies = [ 331 | "autocfg", 332 | "hashbrown", 333 | ] 334 | 335 | [[package]] 336 | name = "ipnet" 337 | version = "2.8.0" 338 | source = "registry+https://github.com/rust-lang/crates.io-index" 339 | checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" 340 | 341 | [[package]] 342 | name = "itoa" 343 | version = "1.0.9" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" 346 | 347 | [[package]] 348 | name = "js-sys" 349 | version = "0.3.64" 350 | source = "registry+https://github.com/rust-lang/crates.io-index" 351 | checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" 352 | dependencies = [ 353 | "wasm-bindgen", 354 | ] 355 | 356 | [[package]] 357 | name = "lazy_static" 358 | version = "1.4.0" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 361 | 362 | [[package]] 363 | name = "libc" 364 | version = "0.2.148" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" 367 | 368 | [[package]] 369 | name = "linux-raw-sys" 370 | version = "0.4.7" 371 | source = "registry+https://github.com/rust-lang/crates.io-index" 372 | checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" 373 | 374 | [[package]] 375 | name = "lock_api" 376 | version = "0.4.10" 377 | source = "registry+https://github.com/rust-lang/crates.io-index" 378 | checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" 379 | dependencies = [ 380 | "autocfg", 381 | "scopeguard", 382 | ] 383 | 384 | [[package]] 385 | name = "log" 386 | version = "0.4.20" 387 | source = "registry+https://github.com/rust-lang/crates.io-index" 388 | checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" 389 | 390 | [[package]] 391 | name = "memchr" 392 | version = "2.6.3" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" 395 | 396 | [[package]] 397 | name = "mime" 398 | version = "0.3.17" 399 | source = "registry+https://github.com/rust-lang/crates.io-index" 400 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 401 | 402 | [[package]] 403 | name = "miniz_oxide" 404 | version = "0.7.1" 405 | source = "registry+https://github.com/rust-lang/crates.io-index" 406 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 407 | dependencies = [ 408 | "adler", 409 | ] 410 | 411 | [[package]] 412 | name = "mio" 413 | version = "0.8.8" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" 416 | dependencies = [ 417 | "libc", 418 | "wasi", 419 | "windows-sys", 420 | ] 421 | 422 | [[package]] 423 | name = "native-tls" 424 | version = "0.2.11" 425 | source = "registry+https://github.com/rust-lang/crates.io-index" 426 | checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" 427 | dependencies = [ 428 | "lazy_static", 429 | "libc", 430 | "log", 431 | "openssl", 432 | "openssl-probe", 433 | "openssl-sys", 434 | "schannel", 435 | "security-framework", 436 | "security-framework-sys", 437 | "tempfile", 438 | ] 439 | 440 | [[package]] 441 | name = "num_cpus" 442 | version = "1.16.0" 443 | source = "registry+https://github.com/rust-lang/crates.io-index" 444 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 445 | dependencies = [ 446 | "hermit-abi", 447 | "libc", 448 | ] 449 | 450 | [[package]] 451 | name = "object" 452 | version = "0.32.1" 453 | source = "registry+https://github.com/rust-lang/crates.io-index" 454 | checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" 455 | dependencies = [ 456 | "memchr", 457 | ] 458 | 459 | [[package]] 460 | name = "once_cell" 461 | version = "1.18.0" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" 464 | 465 | [[package]] 466 | name = "openssl" 467 | version = "0.10.57" 468 | source = "registry+https://github.com/rust-lang/crates.io-index" 469 | checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" 470 | dependencies = [ 471 | "bitflags 2.4.0", 472 | "cfg-if", 473 | "foreign-types", 474 | "libc", 475 | "once_cell", 476 | "openssl-macros", 477 | "openssl-sys", 478 | ] 479 | 480 | [[package]] 481 | name = "openssl-macros" 482 | version = "0.1.1" 483 | source = "registry+https://github.com/rust-lang/crates.io-index" 484 | checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 485 | dependencies = [ 486 | "proc-macro2", 487 | "quote", 488 | "syn", 489 | ] 490 | 491 | [[package]] 492 | name = "openssl-probe" 493 | version = "0.1.5" 494 | source = "registry+https://github.com/rust-lang/crates.io-index" 495 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 496 | 497 | [[package]] 498 | name = "openssl-sys" 499 | version = "0.9.93" 500 | source = "registry+https://github.com/rust-lang/crates.io-index" 501 | checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" 502 | dependencies = [ 503 | "cc", 504 | "libc", 505 | "pkg-config", 506 | "vcpkg", 507 | ] 508 | 509 | [[package]] 510 | name = "parking_lot" 511 | version = "0.12.1" 512 | source = "registry+https://github.com/rust-lang/crates.io-index" 513 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 514 | dependencies = [ 515 | "lock_api", 516 | "parking_lot_core", 517 | ] 518 | 519 | [[package]] 520 | name = "parking_lot_core" 521 | version = "0.9.8" 522 | source = "registry+https://github.com/rust-lang/crates.io-index" 523 | checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" 524 | dependencies = [ 525 | "cfg-if", 526 | "libc", 527 | "redox_syscall", 528 | "smallvec", 529 | "windows-targets", 530 | ] 531 | 532 | [[package]] 533 | name = "percent-encoding" 534 | version = "2.3.0" 535 | source = "registry+https://github.com/rust-lang/crates.io-index" 536 | checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" 537 | 538 | [[package]] 539 | name = "pin-project-lite" 540 | version = "0.2.13" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" 543 | 544 | [[package]] 545 | name = "pin-utils" 546 | version = "0.1.0" 547 | source = "registry+https://github.com/rust-lang/crates.io-index" 548 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 549 | 550 | [[package]] 551 | name = "pkg-config" 552 | version = "0.3.27" 553 | source = "registry+https://github.com/rust-lang/crates.io-index" 554 | checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" 555 | 556 | [[package]] 557 | name = "proc-macro2" 558 | version = "1.0.67" 559 | source = "registry+https://github.com/rust-lang/crates.io-index" 560 | checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" 561 | dependencies = [ 562 | "unicode-ident", 563 | ] 564 | 565 | [[package]] 566 | name = "quote" 567 | version = "1.0.33" 568 | source = "registry+https://github.com/rust-lang/crates.io-index" 569 | checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" 570 | dependencies = [ 571 | "proc-macro2", 572 | ] 573 | 574 | [[package]] 575 | name = "redox_syscall" 576 | version = "0.3.5" 577 | source = "registry+https://github.com/rust-lang/crates.io-index" 578 | checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" 579 | dependencies = [ 580 | "bitflags 1.3.2", 581 | ] 582 | 583 | [[package]] 584 | name = "reqwest" 585 | version = "0.11.20" 586 | source = "registry+https://github.com/rust-lang/crates.io-index" 587 | checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" 588 | dependencies = [ 589 | "base64", 590 | "bytes", 591 | "encoding_rs", 592 | "futures-core", 593 | "futures-util", 594 | "h2", 595 | "http", 596 | "http-body", 597 | "hyper", 598 | "hyper-tls", 599 | "ipnet", 600 | "js-sys", 601 | "log", 602 | "mime", 603 | "native-tls", 604 | "once_cell", 605 | "percent-encoding", 606 | "pin-project-lite", 607 | "serde", 608 | "serde_json", 609 | "serde_urlencoded", 610 | "tokio", 611 | "tokio-native-tls", 612 | "tower-service", 613 | "url", 614 | "wasm-bindgen", 615 | "wasm-bindgen-futures", 616 | "web-sys", 617 | "winreg", 618 | ] 619 | 620 | [[package]] 621 | name = "rustc-demangle" 622 | version = "0.1.23" 623 | source = "registry+https://github.com/rust-lang/crates.io-index" 624 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 625 | 626 | [[package]] 627 | name = "rustix" 628 | version = "0.38.13" 629 | source = "registry+https://github.com/rust-lang/crates.io-index" 630 | checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" 631 | dependencies = [ 632 | "bitflags 2.4.0", 633 | "errno", 634 | "libc", 635 | "linux-raw-sys", 636 | "windows-sys", 637 | ] 638 | 639 | [[package]] 640 | name = "ryu" 641 | version = "1.0.15" 642 | source = "registry+https://github.com/rust-lang/crates.io-index" 643 | checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" 644 | 645 | [[package]] 646 | name = "schannel" 647 | version = "0.1.22" 648 | source = "registry+https://github.com/rust-lang/crates.io-index" 649 | checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" 650 | dependencies = [ 651 | "windows-sys", 652 | ] 653 | 654 | [[package]] 655 | name = "scopeguard" 656 | version = "1.2.0" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 659 | 660 | [[package]] 661 | name = "security-framework" 662 | version = "2.9.2" 663 | source = "registry+https://github.com/rust-lang/crates.io-index" 664 | checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" 665 | dependencies = [ 666 | "bitflags 1.3.2", 667 | "core-foundation", 668 | "core-foundation-sys", 669 | "libc", 670 | "security-framework-sys", 671 | ] 672 | 673 | [[package]] 674 | name = "security-framework-sys" 675 | version = "2.9.1" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" 678 | dependencies = [ 679 | "core-foundation-sys", 680 | "libc", 681 | ] 682 | 683 | [[package]] 684 | name = "serde" 685 | version = "1.0.188" 686 | source = "registry+https://github.com/rust-lang/crates.io-index" 687 | checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" 688 | dependencies = [ 689 | "serde_derive", 690 | ] 691 | 692 | [[package]] 693 | name = "serde_derive" 694 | version = "1.0.188" 695 | source = "registry+https://github.com/rust-lang/crates.io-index" 696 | checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" 697 | dependencies = [ 698 | "proc-macro2", 699 | "quote", 700 | "syn", 701 | ] 702 | 703 | [[package]] 704 | name = "serde_json" 705 | version = "1.0.107" 706 | source = "registry+https://github.com/rust-lang/crates.io-index" 707 | checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" 708 | dependencies = [ 709 | "itoa", 710 | "ryu", 711 | "serde", 712 | ] 713 | 714 | [[package]] 715 | name = "serde_urlencoded" 716 | version = "0.7.1" 717 | source = "registry+https://github.com/rust-lang/crates.io-index" 718 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 719 | dependencies = [ 720 | "form_urlencoded", 721 | "itoa", 722 | "ryu", 723 | "serde", 724 | ] 725 | 726 | [[package]] 727 | name = "signal-hook-registry" 728 | version = "1.4.1" 729 | source = "registry+https://github.com/rust-lang/crates.io-index" 730 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 731 | dependencies = [ 732 | "libc", 733 | ] 734 | 735 | [[package]] 736 | name = "slab" 737 | version = "0.4.9" 738 | source = "registry+https://github.com/rust-lang/crates.io-index" 739 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 740 | dependencies = [ 741 | "autocfg", 742 | ] 743 | 744 | [[package]] 745 | name = "smallvec" 746 | version = "1.11.0" 747 | source = "registry+https://github.com/rust-lang/crates.io-index" 748 | checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" 749 | 750 | [[package]] 751 | name = "socket2" 752 | version = "0.4.9" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 755 | dependencies = [ 756 | "libc", 757 | "winapi", 758 | ] 759 | 760 | [[package]] 761 | name = "socket2" 762 | version = "0.5.4" 763 | source = "registry+https://github.com/rust-lang/crates.io-index" 764 | checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" 765 | dependencies = [ 766 | "libc", 767 | "windows-sys", 768 | ] 769 | 770 | [[package]] 771 | name = "syn" 772 | version = "2.0.35" 773 | source = "registry+https://github.com/rust-lang/crates.io-index" 774 | checksum = "59bf04c28bee9043ed9ea1e41afc0552288d3aba9c6efdd78903b802926f4879" 775 | dependencies = [ 776 | "proc-macro2", 777 | "quote", 778 | "unicode-ident", 779 | ] 780 | 781 | [[package]] 782 | name = "tempfile" 783 | version = "3.8.0" 784 | source = "registry+https://github.com/rust-lang/crates.io-index" 785 | checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" 786 | dependencies = [ 787 | "cfg-if", 788 | "fastrand", 789 | "redox_syscall", 790 | "rustix", 791 | "windows-sys", 792 | ] 793 | 794 | [[package]] 795 | name = "tinyvec" 796 | version = "1.6.0" 797 | source = "registry+https://github.com/rust-lang/crates.io-index" 798 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 799 | dependencies = [ 800 | "tinyvec_macros", 801 | ] 802 | 803 | [[package]] 804 | name = "tinyvec_macros" 805 | version = "0.1.1" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 808 | 809 | [[package]] 810 | name = "tokio" 811 | version = "1.32.0" 812 | source = "registry+https://github.com/rust-lang/crates.io-index" 813 | checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" 814 | dependencies = [ 815 | "backtrace", 816 | "bytes", 817 | "libc", 818 | "mio", 819 | "num_cpus", 820 | "parking_lot", 821 | "pin-project-lite", 822 | "signal-hook-registry", 823 | "socket2 0.5.4", 824 | "tokio-macros", 825 | "windows-sys", 826 | ] 827 | 828 | [[package]] 829 | name = "tokio-macros" 830 | version = "2.1.0" 831 | source = "registry+https://github.com/rust-lang/crates.io-index" 832 | checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" 833 | dependencies = [ 834 | "proc-macro2", 835 | "quote", 836 | "syn", 837 | ] 838 | 839 | [[package]] 840 | name = "tokio-native-tls" 841 | version = "0.3.1" 842 | source = "registry+https://github.com/rust-lang/crates.io-index" 843 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 844 | dependencies = [ 845 | "native-tls", 846 | "tokio", 847 | ] 848 | 849 | [[package]] 850 | name = "tokio-util" 851 | version = "0.7.8" 852 | source = "registry+https://github.com/rust-lang/crates.io-index" 853 | checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" 854 | dependencies = [ 855 | "bytes", 856 | "futures-core", 857 | "futures-sink", 858 | "pin-project-lite", 859 | "tokio", 860 | "tracing", 861 | ] 862 | 863 | [[package]] 864 | name = "tower-service" 865 | version = "0.3.2" 866 | source = "registry+https://github.com/rust-lang/crates.io-index" 867 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 868 | 869 | [[package]] 870 | name = "tracing" 871 | version = "0.1.37" 872 | source = "registry+https://github.com/rust-lang/crates.io-index" 873 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 874 | dependencies = [ 875 | "cfg-if", 876 | "pin-project-lite", 877 | "tracing-core", 878 | ] 879 | 880 | [[package]] 881 | name = "tracing-core" 882 | version = "0.1.31" 883 | source = "registry+https://github.com/rust-lang/crates.io-index" 884 | checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" 885 | dependencies = [ 886 | "once_cell", 887 | ] 888 | 889 | [[package]] 890 | name = "try-lock" 891 | version = "0.2.4" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" 894 | 895 | [[package]] 896 | name = "unicode-bidi" 897 | version = "0.3.13" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" 900 | 901 | [[package]] 902 | name = "unicode-ident" 903 | version = "1.0.12" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 906 | 907 | [[package]] 908 | name = "unicode-normalization" 909 | version = "0.1.22" 910 | source = "registry+https://github.com/rust-lang/crates.io-index" 911 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 912 | dependencies = [ 913 | "tinyvec", 914 | ] 915 | 916 | [[package]] 917 | name = "update_intl" 918 | version = "0.1.0" 919 | dependencies = [ 920 | "reqwest", 921 | "serde", 922 | "serde_json", 923 | "tokio", 924 | ] 925 | 926 | [[package]] 927 | name = "url" 928 | version = "2.4.1" 929 | source = "registry+https://github.com/rust-lang/crates.io-index" 930 | checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" 931 | dependencies = [ 932 | "form_urlencoded", 933 | "idna", 934 | "percent-encoding", 935 | ] 936 | 937 | [[package]] 938 | name = "vcpkg" 939 | version = "0.2.15" 940 | source = "registry+https://github.com/rust-lang/crates.io-index" 941 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 942 | 943 | [[package]] 944 | name = "want" 945 | version = "0.3.1" 946 | source = "registry+https://github.com/rust-lang/crates.io-index" 947 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 948 | dependencies = [ 949 | "try-lock", 950 | ] 951 | 952 | [[package]] 953 | name = "wasi" 954 | version = "0.11.0+wasi-snapshot-preview1" 955 | source = "registry+https://github.com/rust-lang/crates.io-index" 956 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 957 | 958 | [[package]] 959 | name = "wasm-bindgen" 960 | version = "0.2.87" 961 | source = "registry+https://github.com/rust-lang/crates.io-index" 962 | checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" 963 | dependencies = [ 964 | "cfg-if", 965 | "wasm-bindgen-macro", 966 | ] 967 | 968 | [[package]] 969 | name = "wasm-bindgen-backend" 970 | version = "0.2.87" 971 | source = "registry+https://github.com/rust-lang/crates.io-index" 972 | checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" 973 | dependencies = [ 974 | "bumpalo", 975 | "log", 976 | "once_cell", 977 | "proc-macro2", 978 | "quote", 979 | "syn", 980 | "wasm-bindgen-shared", 981 | ] 982 | 983 | [[package]] 984 | name = "wasm-bindgen-futures" 985 | version = "0.4.37" 986 | source = "registry+https://github.com/rust-lang/crates.io-index" 987 | checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" 988 | dependencies = [ 989 | "cfg-if", 990 | "js-sys", 991 | "wasm-bindgen", 992 | "web-sys", 993 | ] 994 | 995 | [[package]] 996 | name = "wasm-bindgen-macro" 997 | version = "0.2.87" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" 1000 | dependencies = [ 1001 | "quote", 1002 | "wasm-bindgen-macro-support", 1003 | ] 1004 | 1005 | [[package]] 1006 | name = "wasm-bindgen-macro-support" 1007 | version = "0.2.87" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" 1010 | dependencies = [ 1011 | "proc-macro2", 1012 | "quote", 1013 | "syn", 1014 | "wasm-bindgen-backend", 1015 | "wasm-bindgen-shared", 1016 | ] 1017 | 1018 | [[package]] 1019 | name = "wasm-bindgen-shared" 1020 | version = "0.2.87" 1021 | source = "registry+https://github.com/rust-lang/crates.io-index" 1022 | checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" 1023 | 1024 | [[package]] 1025 | name = "web-sys" 1026 | version = "0.3.64" 1027 | source = "registry+https://github.com/rust-lang/crates.io-index" 1028 | checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" 1029 | dependencies = [ 1030 | "js-sys", 1031 | "wasm-bindgen", 1032 | ] 1033 | 1034 | [[package]] 1035 | name = "winapi" 1036 | version = "0.3.9" 1037 | source = "registry+https://github.com/rust-lang/crates.io-index" 1038 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1039 | dependencies = [ 1040 | "winapi-i686-pc-windows-gnu", 1041 | "winapi-x86_64-pc-windows-gnu", 1042 | ] 1043 | 1044 | [[package]] 1045 | name = "winapi-i686-pc-windows-gnu" 1046 | version = "0.4.0" 1047 | source = "registry+https://github.com/rust-lang/crates.io-index" 1048 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1049 | 1050 | [[package]] 1051 | name = "winapi-x86_64-pc-windows-gnu" 1052 | version = "0.4.0" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1055 | 1056 | [[package]] 1057 | name = "windows-sys" 1058 | version = "0.48.0" 1059 | source = "registry+https://github.com/rust-lang/crates.io-index" 1060 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1061 | dependencies = [ 1062 | "windows-targets", 1063 | ] 1064 | 1065 | [[package]] 1066 | name = "windows-targets" 1067 | version = "0.48.5" 1068 | source = "registry+https://github.com/rust-lang/crates.io-index" 1069 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1070 | dependencies = [ 1071 | "windows_aarch64_gnullvm", 1072 | "windows_aarch64_msvc", 1073 | "windows_i686_gnu", 1074 | "windows_i686_msvc", 1075 | "windows_x86_64_gnu", 1076 | "windows_x86_64_gnullvm", 1077 | "windows_x86_64_msvc", 1078 | ] 1079 | 1080 | [[package]] 1081 | name = "windows_aarch64_gnullvm" 1082 | version = "0.48.5" 1083 | source = "registry+https://github.com/rust-lang/crates.io-index" 1084 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1085 | 1086 | [[package]] 1087 | name = "windows_aarch64_msvc" 1088 | version = "0.48.5" 1089 | source = "registry+https://github.com/rust-lang/crates.io-index" 1090 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1091 | 1092 | [[package]] 1093 | name = "windows_i686_gnu" 1094 | version = "0.48.5" 1095 | source = "registry+https://github.com/rust-lang/crates.io-index" 1096 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1097 | 1098 | [[package]] 1099 | name = "windows_i686_msvc" 1100 | version = "0.48.5" 1101 | source = "registry+https://github.com/rust-lang/crates.io-index" 1102 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1103 | 1104 | [[package]] 1105 | name = "windows_x86_64_gnu" 1106 | version = "0.48.5" 1107 | source = "registry+https://github.com/rust-lang/crates.io-index" 1108 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1109 | 1110 | [[package]] 1111 | name = "windows_x86_64_gnullvm" 1112 | version = "0.48.5" 1113 | source = "registry+https://github.com/rust-lang/crates.io-index" 1114 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1115 | 1116 | [[package]] 1117 | name = "windows_x86_64_msvc" 1118 | version = "0.48.5" 1119 | source = "registry+https://github.com/rust-lang/crates.io-index" 1120 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1121 | 1122 | [[package]] 1123 | name = "winreg" 1124 | version = "0.50.0" 1125 | source = "registry+https://github.com/rust-lang/crates.io-index" 1126 | checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" 1127 | dependencies = [ 1128 | "cfg-if", 1129 | "windows-sys", 1130 | ] 1131 | -------------------------------------------------------------------------------- /update_intl/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "update_intl" 3 | version = "1.0.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | reqwest = { version = "0.11.20", features = ["json"] } 10 | tokio = { version = "1.32.0", features = ["full"] } 11 | serde = { version = "1.0.188", features = ["derive"] } 12 | serde_json = "1.0.107" 13 | regex = "1.9.5" 14 | toml_edit = "0.20.0" 15 | anyhow = "1.0.75" 16 | 17 | -------------------------------------------------------------------------------- /update_intl/src/main.rs: -------------------------------------------------------------------------------- 1 | mod sync_assest_js_script; 2 | mod update_version; 3 | use std::{path::Path, collections::HashMap}; 4 | use anyhow::Result; 5 | use reqwest::RequestBuilder; 6 | use tokio::join; 7 | 8 | use crate::{update_script::ScriptTemplate, update_version::EnvToml, sync_assest_js_script::{JSScript, get_js_script}}; 9 | mod update_script; 10 | 11 | #[tokio::main] 12 | async fn main() -> Result<(), Box> { 13 | println!("Hello, world!"); 14 | let mut doc = EnvToml::of(); 15 | 16 | let res: sync_assest_js_script::AssetsScript = sync_assest_js_script::get_js_intl_script().await?; 17 | 18 | if !doc.compare_and_update_notion_version(&res.version) { 19 | return Ok(()) 20 | } 21 | 22 | let res = get_js_script(res).await?; 23 | 24 | let next_version = doc.update_version(); 25 | let zh_cn = ScriptTemplate { 26 | version: next_version.clone(), 27 | script: res.zh_cn, 28 | template_file_path: Path::new("./template/notion-zh_CN.template.js").to_path_buf(), 29 | target_path: Path::new("./notion-zh_CN.js").to_path_buf(), 30 | }; 31 | let zh_tw = ScriptTemplate { 32 | version: next_version.clone(), 33 | script: res.zh_tw, 34 | template_file_path: Path::new("./template/notion-zh_TW.template.js").to_path_buf(), 35 | target_path: Path::new("./notion-zh_TW.js").to_path_buf(), 36 | }; 37 | zh_cn.generator()?; 38 | zh_tw.generator()?; 39 | doc.write()?; 40 | // deps dprint format 41 | std::process::Command::new("dprint").arg("fmt ./*.js").output().expect("Failed to execute command"); 42 | Ok(()) 43 | } 44 | -------------------------------------------------------------------------------- /update_intl/src/sync_assest_js_script.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use serde::{Deserialize, Serialize}; 3 | use reqwest::RequestBuilder; 4 | use tokio::join; 5 | use anyhow::{ 6 | Result, anyhow 7 | }; 8 | 9 | use crate::update_version::EnvToml; 10 | 11 | // Example code that deserializes and serializes the model. 12 | // extern crate serde; 13 | // #[macro_use] 14 | // extern crate serde_derive; 15 | // extern crate serde_json; 16 | // 17 | // use generated_module::AssetsScript; 18 | // 19 | // fn main() { 20 | // let json = r#"{"answer": 42}"#; 21 | // let model: AssetsScript = serde_json::from_str(&json).unwrap(); 22 | // } 23 | 24 | 25 | /// Request 26 | #[derive(Serialize, Deserialize)] 27 | #[serde(rename_all = "camelCase")] 28 | pub struct AssetsScript { 29 | // entry: String, 30 | 31 | pub files: Vec, 32 | 33 | // hash: String, 34 | 35 | // headers_whitelist: Vec, 36 | 37 | // locale_html: AssetsScriptLocaleHtml, 38 | 39 | // proxy_server_path_prefixes: Vec, 40 | 41 | // server_paths: ServerPaths, 42 | 43 | // sqlite_migration_version: i64, 44 | 45 | pub version: String, 46 | } 47 | 48 | #[derive(Serialize, Deserialize)] 49 | pub struct File { 50 | hash: String, 51 | 52 | pub path: String, 53 | 54 | size: i64, 55 | } 56 | 57 | #[derive(Serialize, Deserialize)] 58 | pub struct AssetsScriptLocaleHtml { 59 | #[serde(rename = "da-DK")] 60 | da_dk: String, 61 | 62 | #[serde(rename = "de-DE")] 63 | de_de: String, 64 | 65 | #[serde(rename = "en-US")] 66 | en_us: String, 67 | 68 | #[serde(rename = "es-ES")] 69 | es_es: String, 70 | 71 | #[serde(rename = "es-LA")] 72 | es_la: String, 73 | 74 | #[serde(rename = "fi-FI")] 75 | fi_fi: String, 76 | 77 | #[serde(rename = "fr-FR")] 78 | fr_fr: String, 79 | 80 | #[serde(rename = "ja-JP")] 81 | ja_jp: String, 82 | 83 | #[serde(rename = "ko-KR")] 84 | ko_kr: String, 85 | 86 | #[serde(rename = "nb-NO")] 87 | nb_no: String, 88 | 89 | #[serde(rename = "nl-NL")] 90 | nl_nl: String, 91 | 92 | pseudo: String, 93 | 94 | #[serde(rename = "pt-BR")] 95 | pt_br: String, 96 | 97 | #[serde(rename = "sv-SE")] 98 | sv_se: String, 99 | 100 | #[serde(rename = "zh-CN")] 101 | zh_cn: String, 102 | 103 | #[serde(rename = "zh-TW")] 104 | zh_tw: String, 105 | } 106 | 107 | #[derive(Serialize, Deserialize)] 108 | #[serde(rename_all = "camelCase")] 109 | pub struct ServerPaths { 110 | locale_html: ServerPathsLocaleHtml, 111 | } 112 | 113 | #[derive(Serialize, Deserialize)] 114 | pub struct ServerPathsLocaleHtml { 115 | #[serde(rename = "da-DK")] 116 | da_dk: String, 117 | 118 | #[serde(rename = "de-DE")] 119 | de_de: String, 120 | 121 | #[serde(rename = "en-US")] 122 | en_us: String, 123 | 124 | #[serde(rename = "es-ES")] 125 | es_es: String, 126 | 127 | #[serde(rename = "es-LA")] 128 | es_la: String, 129 | 130 | #[serde(rename = "fi-FI")] 131 | fi_fi: String, 132 | 133 | #[serde(rename = "fr-FR")] 134 | fr_fr: String, 135 | 136 | #[serde(rename = "ja-JP")] 137 | ja_jp: String, 138 | 139 | #[serde(rename = "ko-KR")] 140 | ko_kr: String, 141 | 142 | #[serde(rename = "nb-NO")] 143 | nb_no: String, 144 | 145 | #[serde(rename = "nl-NL")] 146 | nl_nl: String, 147 | 148 | pseudo: String, 149 | 150 | #[serde(rename = "pt-BR")] 151 | pt_br: String, 152 | 153 | #[serde(rename = "sv-SE")] 154 | sv_se: String, 155 | 156 | #[serde(rename = "zh-CN")] 157 | zh_cn: String, 158 | 159 | #[serde(rename = "zh-TW")] 160 | zh_tw: String, 161 | } 162 | 163 | 164 | #[allow(non_snake_case)] 165 | #[derive(Deserialize, Serialize, Debug)] 166 | struct AssetsScriptFile { 167 | // hash: String, 168 | path: String, 169 | // size: i64, 170 | } 171 | 172 | 173 | #[allow(non_snake_case)] 174 | #[derive(Deserialize, Serialize, Debug)] 175 | struct AssetsScriptContent { 176 | // hash: String, 177 | data: String, 178 | // size: i64, 179 | } 180 | 181 | #[allow(non_snake_case)] 182 | #[derive(Deserialize, Serialize, Debug)] 183 | pub struct JSScript { 184 | pub ko_kr: String, 185 | pub zh_cn: String, 186 | pub zh_tw: String, 187 | } 188 | 189 | pub async fn get_js_intl_script() -> Result { 190 | let mut fetch_config = HashMap::new(); 191 | fetch_config.insert("hash", ""); 192 | 193 | let client = reqwest::Client::new(); 194 | let res = client 195 | .post("https://www.notion.so/api/v3/getAssetsJsonV2") 196 | .json(&fetch_config) 197 | .send() 198 | .await?; 199 | 200 | let text = res.text().await?; 201 | // 为了在解析json失败的时候可以重新解析, 202 | let parse_assets = serde_json::from_str::(&text); 203 | 204 | match parse_assets { 205 | Ok(res) => { 206 | return Ok(res); 207 | } 208 | Err(assets_err_content) => { 209 | println!("assets actual result is: {:?}", text); 210 | Err(anyhow!(Box::new(assets_err_content))) 211 | } 212 | } 213 | } 214 | 215 | pub async fn get_js_script(res: AssetsScript) -> Result { 216 | let mut assets_locale_setup_js = HashMap::new(); 217 | let locale_setup_regex = regex::Regex::new( 218 | r"localeSetup\-([a-zA-Z]{2}\-[a-zA-Z]{2})" 219 | )?; 220 | 221 | res.files.into_iter().filter(|item| { 222 | item.path.starts_with("/_assets/localeSetup") 223 | }).for_each( |item| { 224 | let path = &item.path; 225 | let res = locale_setup_regex.captures(path); 226 | if let Some(res) = res { 227 | if let Some(locale) = res.get(1) { 228 | if !locale.is_empty() { 229 | assets_locale_setup_js.insert(locale.as_str().to_string(), item.path); 230 | } 231 | } 232 | } 233 | }); 234 | 235 | // println!("{:?}", assets_locale_setup_js); 236 | 237 | let gen_client = |key: &str| -> RequestBuilder { 238 | let client = reqwest::Client::new(); 239 | let mut url = String::from("https://www.notion.so"); 240 | url.push_str(assets_locale_setup_js.get(key).unwrap()); 241 | 242 | client.get( 243 | url 244 | ) 245 | .header("Cache-Control", "no-cache") 246 | .header("upgrade-insecure-requests", "1") 247 | .header("sec-fetch-user", "?1") 248 | .header("authority", "www.notion.so") 249 | .header("if-modified-since", "Tue, 06 Jun 2023 22:49:53 GMT") 250 | .header("if-none-match", "W/\"4b79efc8d01ace001fb68165f049cf0d\"") 251 | }; 252 | 253 | let ko_kr_client = gen_client("ko-KR"); 254 | let zh_cn_client = gen_client("zh-CN"); 255 | let zh_tw_client = gen_client("zh-TW"); 256 | 257 | let (ko_kr_res, zh_cn_res, zh_tw_res) = join!( 258 | ko_kr_client.send(), 259 | zh_cn_client.send(), 260 | zh_tw_client.send() 261 | ); 262 | let (ko_kr_res, zh_cn_res, zh_tw_res) = join!( 263 | ko_kr_res?.text(), 264 | zh_cn_res?.text(), 265 | zh_tw_res?.text() 266 | ); 267 | 268 | Ok(JSScript { 269 | ko_kr: ko_kr_res?, 270 | zh_cn: zh_cn_res?, 271 | zh_tw: zh_tw_res?, 272 | }) 273 | } -------------------------------------------------------------------------------- /update_intl/src/update_script.rs: -------------------------------------------------------------------------------- 1 | use std::{io::Read, fs, path::{PathBuf}}; 2 | use anyhow::{Result, Ok}; 3 | 4 | pub struct ScriptTemplate { 5 | pub version: String, 6 | pub script: String, 7 | pub template_file_path: PathBuf, 8 | pub target_path: PathBuf, 9 | } 10 | 11 | impl ScriptTemplate { 12 | fn get_template_content(self: &ScriptTemplate)-> Result { 13 | let mut template_file = std::fs::File::open(&self.template_file_path)?; 14 | let mut template_content = String::new(); 15 | template_file.read_to_string(&mut template_content)?; 16 | 17 | Ok(template_content) 18 | } 19 | 20 | pub fn generator(self: &ScriptTemplate) -> Result<()> { 21 | let version = self.version.as_str(); 22 | let script = self.script.as_str(); 23 | let template_content = self.get_template_content()?; 24 | 25 | let new_script_content = template_content 26 | .replace("%version%", version) 27 | .replace("%zh%", script); 28 | fs::write(&self.target_path, new_script_content)?; 29 | Ok(()) 30 | } 31 | } -------------------------------------------------------------------------------- /update_intl/src/update_version.rs: -------------------------------------------------------------------------------- 1 | use std::{fs, io::Read}; 2 | use anyhow::Result; 3 | use toml_edit::{Document, value}; 4 | 5 | fn get_env_toml() -> Document { 6 | let env_toml = String::from_utf8(fs::read("./env.toml").unwrap()).unwrap(); 7 | let env_toml = env_toml.parse::().unwrap(); 8 | env_toml 9 | } 10 | 11 | pub struct EnvToml { 12 | doc: Document 13 | } 14 | 15 | impl EnvToml { 16 | pub fn of() -> EnvToml{ 17 | let mut doc = get_env_toml(); 18 | EnvToml { 19 | doc 20 | } 21 | } 22 | 23 | fn get_next_version(&self) -> String { 24 | let env_toml: &Document = &self.doc; 25 | // todo 在这个库中补充一个 ToString 的 trait 以正确实现 26 | let version = env_toml["version"].as_str().unwrap().to_string(); 27 | let version = version.split('.').collect::>(); 28 | let major = version[0]; 29 | let minor = version[1]; 30 | let patch = (version[2].parse::().unwrap() + 1).to_string(); 31 | let next_version = format!("{}.{}.{}", major, minor, patch); 32 | next_version 33 | } 34 | 35 | pub fn update_version(&mut self) -> String { 36 | let next_version = &self.get_next_version(); 37 | 38 | let doc = &mut self.doc; 39 | doc["version"] = value(next_version); 40 | 41 | next_version.clone() 42 | } 43 | 44 | pub fn compare_and_update_notion_version(&mut self, remote_version: &str) -> bool { 45 | let doc = &mut self.doc; 46 | let version = doc["notionVersion"].as_str().unwrap().to_string(); 47 | if version == remote_version { 48 | false 49 | } else { 50 | doc["notionVersion"] = value(remote_version); 51 | true 52 | } 53 | } 54 | 55 | pub fn write(&self) -> Result<()> { 56 | let doc = &self.doc; 57 | fs::write("./env.toml", doc.to_string())?; 58 | Ok(()) 59 | } 60 | } 61 | 62 | 63 | 64 | // fn get_next_version(env_toml: &Document) -> String { 65 | 66 | // } 67 | 68 | // fn update_version() -> Result { 69 | // let mut doc = get_env_toml(); 70 | // let next_version = get_next_version(&mut doc); 71 | // doc["version"] = value(&next_version); 72 | // fs::write("./env.toml", doc.to_string())?; 73 | // Ok(next_version) 74 | // } 75 | --------------------------------------------------------------------------------