diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 0cceefb..6d0f83a 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -61,6 +70,49 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "anime-game-core" +version = "1.15.1" +source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.15.1#347a4ce274a2842a59ed049749503976affb2e74" +dependencies = [ + "anyhow", + "bzip2", + "cached", + "dns-lookup", + "flate2", + "fs_extra", + "kinda-virtual-fs", + "lazy_static", + "md-5", + "minreq", + "serde", + "serde_json", + "sysinfo 0.29.2", + "tar", + "thiserror", + "tracing", + "xz", + "zip 0.6.2", +] + +[[package]] +name = "anime-launcher-sdk" +version = "1.11.1" +source = "git+https://github.com/an-anime-team/anime-launcher-sdk.git?tag=1.11.1#4193fb94c81c6fea052397744c936a8f4c1a8232" +dependencies = [ + "anime-game-core", + "anyhow", + "cached", + "discord-rich-presence", + "enum-ordinalize", + "lazy_static", + "md-5", + "serde", + "serde_json", + "tracing", + "wincompatlib", +] + [[package]] name = "ansi_term" version = "0.12.1" @@ -75,6 +127,9 @@ name = "anyhow" version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704" +dependencies = [ + "backtrace", +] [[package]] name = "args" @@ -126,7 +181,7 @@ checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", "synstructure", ] @@ -138,7 +193,7 @@ checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", "synstructure", ] @@ -150,7 +205,7 @@ checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -183,7 +238,7 @@ dependencies = [ "parking", "polling", "slab", - "socket2", + "socket2 0.4.4", "waker-fn", "winapi", ] @@ -199,13 +254,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.56" +version = "0.1.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] @@ -256,6 +311,27 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide 0.6.2", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + [[package]] name = "base64" version = "0.13.0" @@ -412,6 +488,42 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" +[[package]] +name = "cached" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b195e4fbc4b6862bbd065b991a34750399c119797efff72492f28a5864de8700" +dependencies = [ + "async-trait", + "cached_proc_macro", + "cached_proc_macro_types", + "futures", + "hashbrown 0.13.2", + "instant", + "once_cell", + "thiserror", + "tokio", +] + +[[package]] +name = "cached_proc_macro" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b48814962d2fd604c50d2b9433c2a41a0ab567779ee2c02f7fba6eca1221f082" +dependencies = [ + "cached_proc_macro_types", + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.98", +] + +[[package]] +name = "cached_proc_macro_types" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" + [[package]] name = "cairo-rs" version = "0.15.12" @@ -747,7 +859,7 @@ dependencies = [ "proc-macro2", "quote", "smallvec", - "syn", + "syn 1.0.98", ] [[package]] @@ -757,7 +869,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e" dependencies = [ "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -767,7 +879,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" dependencies = [ "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -790,6 +902,7 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" name = "cultivation" version = "1.1.1" dependencies = [ + "anime-launcher-sdk", "args", "cc", "ctrlc", @@ -811,7 +924,7 @@ dependencies = [ "serde_json", "sevenz-rust", "sudo", - "sysinfo", + "sysinfo 0.28.4", "tauri", "tauri-build", "tokio", @@ -830,8 +943,18 @@ version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", ] [[package]] @@ -845,7 +968,21 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 1.0.98", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.98", ] [[package]] @@ -854,9 +991,20 @@ version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ - "darling_core", + "darling_core 0.13.4", "quote", - "syn", + "syn 1.0.98", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote", + "syn 1.0.98", ] [[package]] @@ -933,7 +1081,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn", + "syn 1.0.98", ] [[package]] @@ -977,6 +1125,18 @@ dependencies = [ "winapi", ] +[[package]] +name = "discord-rich-presence" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47fc4beffb85ee1461588499073a4d9c20dcc7728c4b13d6b282ab6c508947e5" +dependencies = [ + "serde", + "serde_derive", + "serde_json", + "uuid 0.8.2", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -991,7 +1151,7 @@ checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -1000,6 +1160,18 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" +[[package]] +name = "dns-lookup" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f332aa79f9e9de741ac013237294ef42ce2e9c6394dc7d766725812f1238812" +dependencies = [ + "cfg-if", + "libc", + "socket2 0.5.3", + "windows-sys 0.48.0", +] + [[package]] name = "dtoa" version = "0.4.8" @@ -1049,6 +1221,19 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enum-ordinalize" +version = "3.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4f76552f53cefc9a7f64987c3701b99d982f7690606fd67de1d09712fbf52f1" +dependencies = [ + "num-bigint 0.4.3", + "num-traits 0.2.15", + "proc-macro2", + "quote", + "syn 2.0.18", +] + [[package]] name = "enum_primitive" version = "0.1.1" @@ -1128,7 +1313,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.5.3", ] [[package]] @@ -1162,6 +1347,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -1249,7 +1440,7 @@ checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -1417,6 +1608,12 @@ dependencies = [ "wasi 0.11.0+wasi-snapshot-preview1", ] +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + [[package]] name = "gio" version = "0.15.12" @@ -1479,7 +1676,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -1574,7 +1771,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -1605,6 +1802,12 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + [[package]] name = "heck" version = "0.3.3" @@ -1649,7 +1852,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -1694,9 +1897,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hudsucker" -version = "0.19.1" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655326a6a1f44e52c64ee30a4fdfd86e4de893b2ed6757250391ec6c9a8f93a8" +checksum = "d1f3686f2987b902c5fafb0ee2ff369fd7f869822da20deed181d1d846a858bc" dependencies = [ "async-compression", "async-trait", @@ -1736,7 +1939,7 @@ dependencies = [ "httpdate", "itoa 1.0.2", "pin-project-lite", - "socket2", + "socket2 0.4.4", "tokio", "tower-service", "tracing", @@ -1850,7 +2053,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -1993,6 +2196,12 @@ dependencies = [ "treediff", ] +[[package]] +name = "kinda-virtual-fs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca9325aac17917b5650f25d477ce2909f2e9539688227fdee3ceb5093f666c9e" + [[package]] name = "kuchiki" version = "0.8.1" @@ -2013,9 +2222,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.132" +version = "0.2.146" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" +checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" [[package]] name = "libdbus-sys" @@ -2078,6 +2287,17 @@ dependencies = [ "byteorder", ] +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "mac" version = "0.1.1" @@ -2144,6 +2364,25 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +[[package]] +name = "md-5" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +dependencies = [ + "digest 0.10.6", + "md5-asm", +] + +[[package]] +name = "md5-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b9a6f25ec11ea27e22d7fc8beafda909da44ece95f63e94f1eeb23d19bb5c7" +dependencies = [ + "cc", +] + [[package]] name = "memchr" version = "2.5.0" @@ -2180,6 +2419,32 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "minreq" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3de406eeb24aba36ed3829532fa01649129677186b44a49debec0ec574ca7da7" +dependencies = [ + "base64 0.12.3", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "serde", + "serde_json", + "webpki", + "webpki-roots", +] + [[package]] name = "mio" version = "0.8.4" @@ -2455,7 +2720,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -2506,6 +2771,15 @@ dependencies = [ "objc", ] +[[package]] +name = "object" +version = "0.30.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +dependencies = [ + "memchr", +] + [[package]] name = "oid-registry" version = "0.4.0" @@ -2569,7 +2843,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -2597,7 +2871,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" dependencies = [ "dlv-list", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -2741,7 +3015,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03c64931a1a212348ec4f3b4362585eca7159d0d09cbdf4a7f74f02173596fd4" dependencies = [ - "base64", + "base64 0.13.0", ] [[package]] @@ -2822,7 +3096,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -2836,7 +3110,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -2874,7 +3148,7 @@ checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -2901,7 +3175,7 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" dependencies = [ - "base64", + "base64 0.13.0", "indexmap", "line-wrap", "serde", @@ -2930,7 +3204,7 @@ dependencies = [ "bitflags", "crc32fast", "deflate 1.0.0", - "miniz_oxide", + "miniz_oxide 0.5.3", ] [[package]] @@ -2977,7 +3251,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.98", "version_check", ] @@ -3000,9 +3274,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] @@ -3036,9 +3310,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.20" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] @@ -3303,7 +3577,7 @@ version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" dependencies = [ - "base64", + "base64 0.13.0", "bytes", "encoding_rs", "futures-core", @@ -3385,6 +3659,12 @@ dependencies = [ "ordered-multimap", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustc-serialize" version = "0.3.24" @@ -3430,13 +3710,25 @@ dependencies = [ "webpki", ] +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" dependencies = [ - "base64", + "base64 0.13.0", ] [[package]] @@ -3594,7 +3886,7 @@ checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -3616,7 +3908,7 @@ checksum = "a2ad84e47328a31223de7fed7a4f5087f2d6ddfe586cf3ca25b7a165bc0a5aed" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -3647,10 +3939,10 @@ version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ - "darling", + "darling 0.13.4", "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -3672,7 +3964,7 @@ checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -3818,6 +4110,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "soup2" version = "0.2.1" @@ -3917,7 +4219,7 @@ dependencies = [ "heck 0.3.3", "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -3947,6 +4249,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -3955,7 +4268,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", "unicode-xid", ] @@ -3974,6 +4287,21 @@ dependencies = [ "winapi", ] +[[package]] +name = "sysinfo" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9557d0845b86eea8182f7b10dff120214fb6cd9fd937b6f4917714e546a38695" +dependencies = [ + "cfg-if", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "rayon", + "winapi", +] + [[package]] name = "system-deps" version = "5.0.0" @@ -4138,7 +4466,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16d62a3c8790d6cba686cea6e3f7f569d12c662c3274c2d165a4fd33e3871b72" dependencies = [ - "base64", + "base64 0.13.0", "brotli", "ico", "json-patch", @@ -4167,7 +4495,7 @@ dependencies = [ "heck 0.4.0", "proc-macro2", "quote", - "syn", + "syn 1.0.98", "tauri-codegen", "tauri-utils", ] @@ -4289,7 +4617,7 @@ checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -4356,12 +4684,25 @@ dependencies = [ "memchr", "mio", "num_cpus", + "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.4.4", + "tokio-macros", "windows-sys 0.45.0", ] +[[package]] +name = "tokio-macros" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.98", +] + [[package]] name = "tokio-native-tls" version = "0.3.0" @@ -4461,7 +4802,7 @@ checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -4530,7 +4871,7 @@ version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" dependencies = [ - "base64", + "base64 0.13.0", "byteorder", "bytes", "http", @@ -4549,7 +4890,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" dependencies = [ - "base64", + "base64 0.13.0", "byteorder", "bytes", "http", @@ -4814,7 +5155,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.98", "wasm-bindgen-shared", ] @@ -4848,7 +5189,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4955,7 +5296,7 @@ checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -5024,6 +5365,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "wincompatlib" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89cd8dd63a2925273bdc4efd837ac5b847b06b23f141ce73664e274d54bbfa83" +dependencies = [ + "anyhow", + "minreq", +] + [[package]] name = "windows" version = "0.24.0" @@ -5079,7 +5430,7 @@ version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67a1062e555f7d9d66fd1130ed4f7c6ec41a47529ee0850cd0e926d95b26bb14" dependencies = [ - "syn", + "syn 1.0.98", "windows-tokens", ] @@ -5454,7 +5805,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" dependencies = [ "asn1-rs 0.3.1", - "base64", + "base64 0.13.0", "data-encoding", "der-parser 7.0.0", "lazy_static", @@ -5473,7 +5824,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ "asn1-rs 0.5.1", - "base64", + "base64 0.13.0", "data-encoding", "der-parser 8.1.0", "lazy_static", @@ -5500,6 +5851,24 @@ version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52839dc911083a8ef63efa4d039d1f58b5e409f923e44c80828f206f66e5541c" +[[package]] +name = "xz" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c887690ff2a2e233e8e49633461521f98ec57fbff9d59a884c9a4f04ec1da34" +dependencies = [ + "xz2", +] + +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", +] + [[package]] name = "yasna" version = "0.5.0" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 91e6b3e..93a8c0c 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -53,7 +53,7 @@ serde_json = "1" # Dependencies for the HTTP(S) proxy. http = "0.2" -hudsucker = "0.19.1" +hudsucker = "0.19.2" tracing = "0.1.21" tokio-rustls = "0.23.0" tokio-tungstenite = "0.17.0" @@ -71,6 +71,12 @@ file_diff = "1.0.0" rust-ini = "0.18.0" ctrlc = "3.2.3" +[target.'cfg(target_os = "linux")'.dependencies.anime-launcher-sdk] +git = "https://github.com/an-anime-team/anime-launcher-sdk.git" +tag = "1.11.1" +default-features = false +features = ["all", "genshin"] + [features] # by default Tauri runs in production mode # when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL diff --git a/src-tauri/lang/en.json b/src-tauri/lang/en.json index 17d4390..b50f94a 100644 --- a/src-tauri/lang/en.json +++ b/src-tauri/lang/en.json @@ -33,7 +33,8 @@ "horny_mode": "Horny Mode", "auto_mongodb": "Automatically Start MongoDB", "un_elevated": "Run the game non-elevated (no admin)", - "redirect_more": "Also redirect other MHY games" + "redirect_more": "Also redirect other MHY games", + "check_aagl": "For more options, check the other launcher" }, "downloads": { "grasscutter_fullbuild": "Download Grasscutter All-in-One", diff --git a/src-tauri/lang/pl.json b/src-tauri/lang/pl.json index f3fab11..7a536fc 100644 --- a/src-tauri/lang/pl.json +++ b/src-tauri/lang/pl.json @@ -33,7 +33,8 @@ "horny_mode": "Tryb 34", "auto_mongodb": "Automatycznie uruchamiaj MongoDB", "un_elevated": "Uruchamiaj grę bez uprawnień administratora/roota", - "redirect_more": "Przekieruj też inne gry MHY" + "redirect_more": "Przekieruj też inne gry MHY", + "check_aagl": "Więcej opcji znajdziesz w drugim launcherze" }, "downloads": { "grasscutter_fullbuild": "Pobierz Grasscutter (wszystko w jednym)", diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index b982350..0af1361 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -22,6 +22,12 @@ use crate::admin::reopen_as_admin; #[cfg(target_os = "windows")] use system_helpers::is_elevated; +#[cfg(target_os = "linux")] +use std::{ + thread::{sleep, JoinHandle}, + time::{Duration, Instant}, +}; + mod admin; mod config; mod downloader; @@ -39,6 +45,9 @@ static WATCH_GAME_PROCESS: Lazy> = Lazy::new(|| Mutex::new(String: static WATCH_GRASSCUTTER_PROCESS: Lazy> = Lazy::new(|| Mutex::new(String::new())); static GC_PID: std::sync::Mutex = Mutex::new(696969); +#[cfg(target_os = "linux")] +pub static AAGL_THREAD: Lazy>>> = Lazy::new(|| Mutex::new(None)); + fn try_flush() { std::io::stdout().flush().unwrap_or(()) } @@ -270,6 +279,7 @@ fn is_game_running() -> bool { !proc.is_empty() } +#[cfg(target_os = "windows")] #[tauri::command] fn enable_process_watcher(window: tauri::Window, process: String) { *WATCH_GAME_PROCESS.lock().unwrap() = process; @@ -315,6 +325,41 @@ fn enable_process_watcher(window: tauri::Window, process: String) { }); } +// The library takes care of it +#[cfg(target_os = "linux")] +#[tauri::command] +fn enable_process_watcher(window: tauri::Window, process: String) { + drop(process); + thread::spawn(move || { + let end_time = Instant::now() + Duration::from_secs(60); + let game_thread = loop { + let mut lock = AAGL_THREAD.lock().unwrap(); + if lock.is_some() { + break lock.take().unwrap(); + } + drop(lock); + if end_time < Instant::now() { + // If more than 60 seconds pass something has gone wrong + println!("Waiting for game thread timed out"); + return; + } + // Otherwhise wait in order to not use too many CPU cycles + sleep(Duration::from_millis(128)); + }; + game_thread.join().unwrap(); + println!("Game closed"); + + *WATCH_GAME_PROCESS.lock().unwrap() = "".to_string(); + disconnect(); + + window.emit("game_closed", &()).unwrap(); + }); +} + +#[cfg(target_os = "macos")] +#[tauri::command] +fn enable_process_watcher(window: tauri::Window, process: String) {} + #[tauri::command] fn is_grasscutter_running() -> bool { // Grab the grasscutter process name diff --git a/src-tauri/src/proxy.rs b/src-tauri/src/proxy.rs index 72ed1c2..4548cd2 100644 --- a/src-tauri/src/proxy.rs +++ b/src-tauri/src/proxy.rs @@ -26,6 +26,9 @@ use tauri::{api::path::data_dir, http::Uri}; #[cfg(windows)] use registry::{Data, Hive, Security}; +#[cfg(target_os = "linux")] +use anime_launcher_sdk::{config::ConfigExt, genshin::config::Config}; + async fn shutdown_signal() { tokio::signal::ctrl_c() .await @@ -281,24 +284,23 @@ pub fn connect_to_proxy(proxy_port: u16) { println!("Connected to the proxy."); } -#[cfg(unix)] +#[cfg(target_os = "linux")] pub fn connect_to_proxy(proxy_port: u16) { - // Edit /etc/environment to set $http_proxy and $https_proxy - let mut env_file = match fs::read_to_string("/etc/environment") { - Ok(f) => f, - Err(e) => { - println!("Error opening /etc/environment: {}", e); - return; - } - }; - - // Append the proxy configuration. - // We will not remove the current proxy config if it exists, so we can just remove these last lines when we disconnect - env_file += format!("\nhttps_proxy=127.0.0.1:{}", proxy_port).as_str(); - env_file += format!("\nhttp_proxy=127.0.0.1:{}", proxy_port).as_str(); - - // Save - fs::write("/etc/environment", env_file).unwrap(); + let mut config = Config::get().unwrap(); + let proxy_addr = format!("127.0.0.1:{}", proxy_port); + if !config.game.environment.contains_key("http_proxy") { + config + .game + .environment + .insert("http_proxy".to_string(), proxy_addr.clone()); + } + if !config.game.environment.contains_key("https_proxy") { + config + .game + .environment + .insert("https_proxy".to_string(), proxy_addr); + } + Config::update(config); } #[cfg(target_od = "macos")] @@ -327,21 +329,14 @@ pub fn disconnect_from_proxy() { #[cfg(target_os = "linux")] pub fn disconnect_from_proxy() { - println!("Re-writing environment variables"); - - let regexp = regex::Regex::new( - // This has to be specific as possible or we risk fuckin up their environment LOL - r"(https|http)_proxy=.*127.0.0.1:.*", - ) - .unwrap(); - let environment = &fs::read_to_string("/etc/environment").expect("Failed to open environment"); - - let new_environment = regexp.replace_all(environment, "").to_string(); - - // Write new environment - fs::write("/etc/environment", new_environment.trim_end()).expect( - "Could not write environment, remove proxy declarations manually if they are still set", - ); + let mut config = Config::get().unwrap(); + if config.game.environment.contains_key("http_proxy") { + config.game.environment.remove("http_proxy"); + } + if config.game.environment.contains_key("https_proxy") { + config.game.environment.remove("https_proxy"); + } + Config::update(config); } #[cfg(target_os = "macos")] diff --git a/src-tauri/src/system_helpers.rs b/src-tauri/src/system_helpers.rs index a7f8338..365d2f3 100644 --- a/src-tauri/src/system_helpers.rs +++ b/src-tauri/src/system_helpers.rs @@ -10,6 +10,13 @@ use { windows_service::service_manager::{ServiceManager, ServiceManagerAccess}, }; +#[cfg(target_os = "linux")] +use crate::AAGL_THREAD; +#[cfg(target_os = "linux")] +use anime_launcher_sdk::genshin::game; +#[cfg(target_os = "linux")] +use std::thread; + #[tauri::command] pub fn run_program(path: String, args: Option) { // Without unwrap_or, this can crash when UAC prompt is denied @@ -22,6 +29,7 @@ pub fn run_program(path: String, args: Option) { }; } +#[cfg(target_os = "windows")] #[tauri::command] pub fn run_program_relative(path: String, args: Option) { // Save the current working directory @@ -41,6 +49,13 @@ pub fn run_program_relative(path: String, args: Option) { std::env::set_current_dir(cwd).unwrap(); } +#[cfg(target_os = "linux")] +#[tauri::command] +pub fn run_program_relative(path: String, args: Option) { + // This program should not run as root + run_un_elevated(path, args) +} + #[tauri::command] pub fn run_command(program: &str, args: Vec<&str>, relative: Option) { let prog = program.to_string(); @@ -90,6 +105,7 @@ pub fn run_jar(path: String, execute_in: String, java_path: String) { }; } +#[cfg(target_os = "windows")] #[tauri::command] pub fn run_un_elevated(path: String, args: Option) { // Open the program non-elevated. @@ -106,6 +122,20 @@ pub fn run_un_elevated(path: String, args: Option) { }; } +#[cfg(target_os = "linux")] +#[tauri::command] +pub fn run_un_elevated(path: String, args: Option) { + drop(path); + drop(args); + let t = thread::spawn(|| { + game::run().expect("doo doo"); + }); + { + let mut l = AAGL_THREAD.lock().unwrap(); + l.replace(t); + } +} + #[tauri::command] pub fn open_in_browser(url: String) { // Open the URL in the default browser. diff --git a/src/ui/components/menu/Options.tsx b/src/ui/components/menu/Options.tsx index 4a9e741..0836dfa 100644 --- a/src/ui/components/menu/Options.tsx +++ b/src/ui/components/menu/Options.tsx @@ -434,6 +434,16 @@ export default class Options extends React.Component { + {this.state.platform === 'linux' && ( + <> + + + + )} {this.state.swag && ( <>