diff --git a/Cargo.lock b/Cargo.lock index 0da1cd0..b2b77f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,6 +46,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "base64" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + [[package]] name = "bitflags" version = "1.3.2" @@ -70,6 +76,12 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + [[package]] name = "cairo-rs" version = "0.17.10" @@ -231,6 +243,36 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "expect-dialog" version = "1.0.0" @@ -240,6 +282,15 @@ dependencies = [ "native-dialog", ] +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + [[package]] name = "field-offset" version = "0.3.6" @@ -273,6 +324,12 @@ dependencies = [ "spin", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "foreign-types" version = "0.3.2" @@ -288,6 +345,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + [[package]] name = "fragile" version = "2.0.0" @@ -697,6 +763,25 @@ dependencies = [ "zvariant", ] +[[package]] +name = "h2" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -718,6 +803,93 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -728,6 +900,32 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnet" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" + [[package]] name = "itoa" version = "1.0.6" @@ -788,6 +986,12 @@ version = "0.2.145" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc86cde3ff845662b8f4ef6cb50ea0e20c524eb3d29ae048287e06a1b3fa6a81" +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + [[package]] name = "locale_config" version = "0.3.0" @@ -859,6 +1063,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + [[package]] name = "miniz_oxide" version = "0.7.1" @@ -868,6 +1078,17 @@ dependencies = [ "adler", ] +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + [[package]] name = "nanorand" version = "0.7.0" @@ -898,6 +1119,24 @@ dependencies = [ "winapi", ] +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "nix" version = "0.26.2" @@ -918,7 +1157,7 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] @@ -957,6 +1196,50 @@ version = "1.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" +[[package]] +name = "openssl" +version = "0.10.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b3f656a17a6cbc115b5c7a40c616947d213ba182135b014d6051b73ab6f019" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "pango" version = "0.17.10" @@ -983,6 +1266,12 @@ dependencies = [ "system-deps", ] +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + [[package]] name = "pin-project" version = "1.1.0" @@ -1101,6 +1390,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -1108,7 +1406,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom", - "redox_syscall", + "redox_syscall 0.2.16", "thiserror", ] @@ -1179,6 +1477,43 @@ dependencies = [ "syn 2.0.18", ] +[[package]] +name = "reqwest" +version = "0.11.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + [[package]] name = "rex2" version = "0.1.0" @@ -1191,6 +1526,7 @@ dependencies = [ "relm4", "relm4-components", "relm4-icons", + "reqwest", "serde", "serde_json", "tracker", @@ -1205,6 +1541,20 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.37.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + [[package]] name = "ryu" version = "1.0.13" @@ -1226,12 +1576,44 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] + [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "security-framework" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.17" @@ -1278,6 +1660,18 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "slab" version = "0.4.8" @@ -1293,6 +1687,16 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "spin" version = "0.9.8" @@ -1355,6 +1759,20 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af547b166dd1ea4b472165569fc456cfb6818116f854690b0ff205e636523dab" +[[package]] +name = "tempfile" +version = "3.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +dependencies = [ + "autocfg", + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "thiserror" version = "1.0.40" @@ -1375,6 +1793,21 @@ dependencies = [ "syn 2.0.18", ] +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "tokio" version = "1.28.2" @@ -1382,9 +1815,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ "autocfg", + "bytes", + "libc", + "mio", "num_cpus", "pin-project-lite", - "windows-sys", + "socket2", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", ] [[package]] @@ -1421,6 +1882,12 @@ dependencies = [ "winnow", ] +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + [[package]] name = "tracing" version = "0.1.37" @@ -1473,12 +1940,50 @@ dependencies = [ "syn 2.0.18", ] +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + [[package]] name = "unicode-ident" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version-compare" version = "0.1.1" @@ -1501,6 +2006,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1532,6 +2046,18 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.86" @@ -1561,6 +2087,16 @@ version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +[[package]] +name = "web-sys" +version = "0.3.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "wfd" version = "0.1.7" @@ -1613,6 +2149,21 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -1628,51 +2179,93 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.0" @@ -1688,6 +2281,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + [[package]] name = "zvariant" version = "3.14.0" diff --git a/Cargo.toml b/Cargo.toml index d1470b1..b3b52a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,9 @@ relm4-components = "0.6.0" relm4-icons = { version = "0.6.0", features = [ "menu", "loupe", "copy" ] } +reqwest = { version = "0.11.18", features = [ + "blocking" +] } serde = { version = "1.0.163", features = [ "derive" ] } diff --git a/src/adb.rs b/src/adb.rs new file mode 100644 index 0000000..5e61550 --- /dev/null +++ b/src/adb.rs @@ -0,0 +1,13 @@ +use std::path::Path; +use expect_dialog::ExpectDialog; + +use crate::runner::Runner; + +pub fn get_adb_install_runner(apk_path: &String) -> Runner { + let path = Path::new(apk_path); + path.try_exists().expect_dialog("APK file provided does not exist"); + let runner = Runner::new(None, "adb".into(), vec![ + "install".into(), path.to_str().unwrap().to_string() + ]); + runner +} diff --git a/src/downloader.rs b/src/downloader.rs new file mode 100644 index 0000000..b781243 --- /dev/null +++ b/src/downloader.rs @@ -0,0 +1,50 @@ +use crate::file_utils::get_writer; +use expect_dialog::ExpectDialog; +use reqwest::{ + header::{HeaderMap, USER_AGENT}, + Method, +}; +use std::{io::prelude::*, thread::JoinHandle}; +use std::{thread, time::Duration}; + +const TIMEOUT: Duration = Duration::from_secs(60); +const CHUNK_SIZE: usize = 1024; + +fn headers() -> HeaderMap { + let mut headers = HeaderMap::new(); + headers.insert(USER_AGENT, "org.gabmus.rex2/1.0".parse().unwrap()); + headers +} + +fn client() -> reqwest::blocking::Client { + reqwest::blocking::Client::builder() + .timeout(TIMEOUT) + .default_headers(headers()) + .build() + .expect_dialog("Failed to build reqwest::Client") +} + +pub fn download_file(url: String, path: String) -> JoinHandle> { + thread::spawn(move || { + let client = client(); + match client.request(Method::GET, url).send() { + Ok(res) => { + let status = res.status(); + if status.is_client_error() || status.is_server_error() { + return Err(res.error_for_status().unwrap_err()); + } + let mut writer = get_writer(&path); + for chunk in res + .bytes() + .expect_dialog("Could not get HTTP response bytes") + .chunks(CHUNK_SIZE) + { + writer.write(chunk).expect_dialog("Failed to write chunk"); + } + writer.flush().expect_dialog("Failed to flush download writer"); + Ok(()) + } + Err(e) => Err(e) + } + }) +} diff --git a/src/file_utils.rs b/src/file_utils.rs index 95840de..17e1bf7 100644 --- a/src/file_utils.rs +++ b/src/file_utils.rs @@ -44,6 +44,13 @@ pub fn get_xdg_data_dir() -> String { } } +pub fn get_xdg_cache_dir() -> String { + match env::var("XDG_CACHE_HOME") { + Ok(cache_home) => cache_home, + Err(_) => format!("{home}/.cache", home = get_home_dir()), + } +} + pub fn get_config_dir() -> String { format!( "{config}/{name}", @@ -56,6 +63,10 @@ pub fn get_data_dir() -> String { format!("{data}/{name}", data = get_xdg_data_dir(), name = CMD_NAME) } +pub fn get_cache_dir() -> String { + format!("{cache}/{name}", cache = get_xdg_cache_dir(), name = CMD_NAME) +} + pub fn set_file_radonly(path_s: &String, readonly: bool) { let path = Path::new(&path_s); if !path.is_file() { diff --git a/src/main.rs b/src/main.rs index ae0c0e6..006a31b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,6 +21,8 @@ pub mod profiles; pub mod runner; pub mod runner_pipeline; pub mod ui; +pub mod adb; +pub mod downloader; fn main() -> Result<()> { // Prepare i18n diff --git a/src/paths.rs b/src/paths.rs index 934b4a7..62a8fc7 100644 --- a/src/paths.rs +++ b/src/paths.rs @@ -1,4 +1,4 @@ -use crate::file_utils::get_data_dir; +use crate::file_utils::{get_data_dir, get_cache_dir}; pub fn data_opencomposite_path() -> String { format!("{data}/opencomposite", data = get_data_dir()) @@ -16,6 +16,10 @@ pub fn data_libsurvive_path() -> String { format!("{data}/libsurvive", data = get_data_dir()) } +pub fn wivrn_apk_download_path() -> String { + format!("{cache}/wivrn.apk", cache = get_cache_dir()) +} + pub const SYSTEM_PREFIX: &str = "/usr"; /** System prefix inside a bubblewrap environment (flatpak or pressure vessel) */ diff --git a/src/ui/app.rs b/src/ui/app.rs index 6bc1112..b3d8d20 100644 --- a/src/ui/app.rs +++ b/src/ui/app.rs @@ -2,7 +2,8 @@ use super::about_dialog::AboutDialog; use super::build_window::{BuildStatus, BuildWindow}; use super::debug_view::{DebugView, DebugViewMsg}; use super::libsurvive_setup_window::LibsurviveSetupWindow; -use super::main_view::MainViewMsg; +use super::main_view::{InstallWivrnStatus, MainViewMsg}; +use crate::adb::get_adb_install_runner; use crate::builders::build_basalt::get_build_basalt_runner; use crate::builders::build_libsurvive::get_build_libsurvive_runner; use crate::builders::build_monado::get_build_monado_runner; @@ -14,6 +15,7 @@ use crate::dependencies::basalt_deps::get_missing_basalt_deps; use crate::dependencies::libsurvive_deps::get_missing_libsurvive_deps; use crate::dependencies::monado_deps::get_missing_monado_deps; use crate::dependencies::wivrn_deps::get_missing_wivrn_deps; +use crate::downloader::download_file; use crate::file_builders::active_runtime_json::{ set_current_active_runtime_to_profile, set_current_active_runtime_to_steam, }; @@ -21,6 +23,7 @@ use crate::file_builders::openvrpaths_vrpath::{ set_current_openvrpaths_to_profile, set_current_openvrpaths_to_steam, }; use crate::file_utils::setcap_cap_sys_nice_eip; +use crate::paths::wivrn_apk_download_path; use crate::profile::{Profile, XRServiceType}; use crate::profiles::system_valve_index::system_valve_index_profile; use crate::profiles::valve_index::valve_index_profile; @@ -39,6 +42,8 @@ use relm4::adw::ResponseAppearance; use relm4::gtk::glib; use relm4::{new_action_group, new_stateful_action, new_stateless_action, prelude::*}; use relm4::{ComponentParts, ComponentSender, SimpleComponent}; +use std::cell::Cell; +use std::thread::JoinHandle; use std::time::Duration; #[tracker::track] @@ -70,6 +75,11 @@ pub struct App { build_pipeline: Option, #[tracker::do_not_track] profiles: Vec, + + #[tracker::do_not_track] + download_wivrn_thread: Cell>>>, + #[tracker::do_not_track] + install_wivrn_runner: Option, } #[derive(Debug)] @@ -82,6 +92,8 @@ pub enum Msg { SetXRServiceRuntime(bool), RunSetCap, OpenLibsurviveSetup, + DownloadWivrnApk, + InstallWivrnApk, } impl App { @@ -209,6 +221,49 @@ impl SimpleComponent for App { } } }; + if self.download_wivrn_thread.get_mut().is_some() { + let finished = self + .download_wivrn_thread + .get_mut() + .as_ref() + .unwrap() + .is_finished(); + if finished { + let joinh = self.download_wivrn_thread.take().unwrap(); + match joinh.join().unwrap() { + Ok(_) => { + sender.input(Msg::InstallWivrnApk); + } + Err(_) => { + self.main_view.sender().emit( + MainViewMsg::UpdateInstallWivrnStatus( + InstallWivrnStatus::Done(Some( + "Error downloading WiVRn APK".into(), + )), + ), + ); + } + } + } + } + match &mut self.install_wivrn_runner { + None => {} + Some(runner) => match runner.status() { + RunnerStatus::Running => {} + RunnerStatus::Stopped(status) => { + self.install_wivrn_runner.take(); + self.main_view + .sender() + .emit(MainViewMsg::UpdateInstallWivrnStatus(match status { + None | Some(0) => InstallWivrnStatus::Success, + Some(err_code) => InstallWivrnStatus::Done(Some(format!( + "ADB exited with code \"{c}\"", + c = err_code + ))), + })); + } + }, + } } Msg::EnableDebugViewChanged(val) => { self.set_enable_debug_view(val); @@ -331,6 +386,12 @@ impl SimpleComponent for App { } self.config.selected_profile_name = prof_name; save_config(&self.config); + let profile = self.get_selected_profile(); + self.main_view + .sender() + .emit(MainViewMsg::UpdateXRServiceType( + profile.clone().xrservice_type, + )); } Msg::SetXRServiceRuntime(is_rex) => { if is_rex { @@ -350,6 +411,23 @@ impl SimpleComponent for App { )) .expect_dialog("Failed to present Libsurvive Setup Window"); } + Msg::DownloadWivrnApk => { + self.main_view + .sender() + .emit(MainViewMsg::UpdateInstallWivrnStatus( + InstallWivrnStatus::InProgress, + )); + self.download_wivrn_thread.set(Some(download_file( + // TODO: always download latest + "https://github.com/Meumeu/WiVRn/releases/download/v0.4/WiVRn-oculus-release.apk".into(), + wivrn_apk_download_path() + ))); + } + Msg::InstallWivrnApk => { + let mut runner = get_adb_install_runner(&wivrn_apk_download_path()); + runner.start(); + self.install_wivrn_runner = Some(runner); + } } } @@ -407,6 +485,7 @@ impl SimpleComponent for App { MainViewOutMsg::DoStartStopXRService => Msg::DoStartStopXRService, MainViewOutMsg::ProfileSelected(name) => Msg::ProfileSelected(name), MainViewOutMsg::SetXRServiceRuntime(is_rex) => Msg::SetXRServiceRuntime(is_rex), + MainViewOutMsg::InstallWivrnApk => Msg::DownloadWivrnApk, }), debug_view: DebugView::builder() .launch(DebugViewInit { @@ -436,6 +515,8 @@ impl SimpleComponent for App { xrservice_runner: None, xrservice_log: vec![], build_pipeline: None, + download_wivrn_thread: Cell::new(None), + install_wivrn_runner: None, }; let widgets = view_output!(); diff --git a/src/ui/main_view.rs b/src/ui/main_view.rs index 2fee28e..e08647c 100644 --- a/src/ui/main_view.rs +++ b/src/ui/main_view.rs @@ -1,6 +1,9 @@ +use std::rc::Rc; + use crate::config::Config; use crate::constants::APP_NAME; use crate::file_builders::active_runtime_json::{self, get_current_active_runtime}; +use crate::profile::XRServiceType; use crate::ui::app::{ AboutAction, BuildProfileAction, DebugViewToggleAction, LibsurviveSetupAction, }; @@ -10,14 +13,23 @@ use relm4::prelude::*; use relm4::{ComponentParts, ComponentSender, SimpleComponent}; use relm4_icons::icon_name; +#[derive(PartialEq, Eq, Debug, Clone)] +pub enum InstallWivrnStatus { + Success, + Done(Option), + InProgress, +} + #[tracker::track] pub struct MainView { xrservice_active: bool, + xrservice_type: XRServiceType, enable_debug_view: bool, profile_names: Vec, steam_launch_options: String, #[tracker::do_not_track] profiles_dropdown: Option, + install_wivrn_status: InstallWivrnStatus, } #[derive(Debug)] @@ -30,6 +42,8 @@ pub enum MainViewMsg { ProfileSelected(u32), SteamLaunchOptionsChanged(String), CopySteamLaunchOptions, + UpdateXRServiceType(XRServiceType), + UpdateInstallWivrnStatus(InstallWivrnStatus), } #[derive(Debug)] @@ -39,6 +53,7 @@ pub enum MainViewOutMsg { DoStartStopXRService, ProfileSelected(String), SetXRServiceRuntime(bool), + InstallWivrnApk, } pub struct MainViewInit { @@ -228,7 +243,89 @@ impl SimpleComponent for MainView { } }, }, - } + }, + gtk::Box { + set_orientation: gtk::Orientation::Vertical, + set_spacing: 12, + set_margin_top: 12, + set_margin_bottom: 12, + #[track = "model.changed(MainView::xrservice_type())"] + set_visible: match model.xrservice_type { + XRServiceType::Wivrn => true, + _ => false, + }, + gtk::Separator { + set_orientation: gtk::Orientation::Horizontal, + set_hexpand: true, + }, + gtk::Label { + add_css_class: "heading", + set_hexpand: true, + set_xalign: 0.0, + set_margin_start: 12, + set_margin_end: 12, + set_label: "Install WiVRn APK", + set_wrap: true, + set_wrap_mode: gtk::pango::WrapMode::Word, + }, + gtk::Label { + add_css_class: "dim-label", + set_hexpand: true, + set_xalign: 0.0, + set_margin_start: 12, + set_margin_end: 12, + set_label: concat!( + "Install the WiVRn APK on your standalong Android headset. ", + "You will need to enable Developer Mode on your headset, ", + "then press the \"Install WiVRn\" button." + ), + set_wrap: true, + set_wrap_mode: gtk::pango::WrapMode::Word, + }, + gtk::Button { + add_css_class: "suggested-action", + set_label: "Install WiVRn", + set_margin_start: 12, + set_margin_end: 12, + set_halign: gtk::Align::Start, + #[track = "model.changed(MainView::install_wivrn_status())"] + set_sensitive: match model.install_wivrn_status { + InstallWivrnStatus::InProgress => false, + _ => true, + }, + connect_clicked[sender] => move |_| { + sender.output(MainViewOutMsg::InstallWivrnApk); + }, + }, + gtk::Label { + add_css_class: "error", + set_margin_start: 12, + set_margin_end: 12, + set_xalign: 0.0, + #[track = "model.changed(MainView::install_wivrn_status())"] + set_visible: match &model.install_wivrn_status { + InstallWivrnStatus::Done(Some(_)) => true, + _ => false, + }, + #[track = "model.changed(MainView::install_wivrn_status())"] + set_label: match &model.install_wivrn_status { + InstallWivrnStatus::Done(Some(err)) => err.as_str(), + _ => "", + }, + }, + gtk::Label { + add_css_class: "success", + set_margin_start: 12, + set_margin_end: 12, + set_xalign: 0.0, + #[track = "model.changed(MainView::install_wivrn_status())"] + set_visible: match &model.install_wivrn_status { + InstallWivrnStatus::Success => true, + _ => false, + }, + set_label: "WiVRn Installed Successfully", + }, + }, } } } @@ -247,6 +344,9 @@ impl SimpleComponent for MainView { MainViewMsg::EnableDebugViewChanged(val) => { self.set_enable_debug_view(val); } + MainViewMsg::UpdateXRServiceType(typ) => { + self.set_xrservice_type(typ); + } MainViewMsg::UpdateProfileNames(names, config) => { self.set_profile_names(names); // why send another message to set the dropdown selection? @@ -281,6 +381,9 @@ impl SimpleComponent for MainView { self.profile_names.get(position as usize).unwrap().clone(), )); } + MainViewMsg::UpdateInstallWivrnStatus(status) => { + self.set_install_wivrn_status(status); + } } } @@ -291,10 +394,12 @@ impl SimpleComponent for MainView { ) -> ComponentParts { let mut model = MainView { xrservice_active: false, + xrservice_type: XRServiceType::Monado, enable_debug_view: init.config.debug_view_enabled, profiles_dropdown: None, profile_names: vec![], steam_launch_options: "".into(), + install_wivrn_status: InstallWivrnStatus::Done(None), tracker: 0, }; let widgets = view_output!();