From 48ab42bfa64304d030badd694ca5005d905ba1e8 Mon Sep 17 00:00:00 2001 From: MidKnightXI Date: Sun, 4 Jun 2023 14:30:06 +0900 Subject: [PATCH 1/6] refac: now using cfg for plateform specific fn --- src-tauri/src/patcher.rs | 140 +++++++++++++++++++-------------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/src-tauri/src/patcher.rs b/src-tauri/src/patcher.rs index 8ba6891..e7d7222 100644 --- a/src-tauri/src/patcher.rs +++ b/src-tauri/src/patcher.rs @@ -1,3 +1,5 @@ +use std::path::PathBuf; + use asar::{AsarReader, AsarWriter}; /// Remove ads from the file. @@ -8,22 +10,56 @@ use asar::{AsarReader, AsarWriter}; /// /// ## Example /// ``` -/// let path = std::path::PathBuf::from("/path/to/file"); +/// let path = String::from("/path/to/file"); /// /// patch_file(path); ///``` +#[cfg(target_os = "windows")] fn patch_file(file: String) -> String { - let gist: &str = "https://gist.githubusercontent.com"; - let cloudflare: &str = "https://op-gg-remove-ads.shyim.workers.dev"; + const GIST: &str = "https://gist.githubusercontent.com"; + const CLOUDFLARE: &str = "https://op-gg-remove-ads.shyim.workers.dev"; let patched_file: String = file .replace(r#"checkIfChromeDirectoryExists("Default")"#, r#"checkIfChromeDirectoryExists("NoChrome:((((??")"#) .replace(r#"AppData\Local\Google\Chrome\User Data"#, r#"AppData\Local\Google\Carbon\Privacy?"#) - .replace("https://desktop.op.gg/api/tracking/ow", &gist) - .replace("https://geo-internal.op.gg/api/current-ip", &gist) + .replace("https://desktop.op.gg/api/tracking/ow", GIST) + .replace("https://geo-internal.op.gg/api/current-ip", GIST) .replace("app.labs.sydney", "op-gg-remove-ads.shyim.workers.dev") - .replace("https://opgg-desktop-data.akamaized.net", &cloudflare); + .replace("https://opgg-desktop-data.akamaized.net", CLOUDFLARE); + + return patched_file; +} + +/// Replace the content of the specified file to delete advertisements' links. +/// +/// ## Arguments +/// +/// * `path` - `String` containing the path of the file to patch. +/// +/// ## Example +/// ``` +/// let path = String::from("/path/to/file"); +/// +/// patch_file(path); +///``` +#[cfg(target_os = "macos")] +fn patch_file(file: String) -> String +{ + const ADSENSE_URI: &str = "https://gist.githubusercontent.com/MidKnightXI/7ecf3cdd0a5804466cb790855e2524ae/raw/9b88cf64f3bb955edfff27bdfba72f5181d8748b/remover.txt"; + const NA: &str = r#"["US","CA"].includes"#; + const EU: &str = r#"["AD","AL","AT","AX","BA","BE","BG","BY","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GB","GG","GI","GR","HR","HU","IE","IM","IS","IT","JE","LI","LT","LU","LV","MC","MD","ME","MK","MT","NL","NO","PL","PT","RO","RS","RU","SE","SI","SJ","SK","SM","UA","VA","XK"].includes"#; + + let patched_file: String = file + .replace("https://dtapp-player.op.gg/adsense.txt", ADSENSE_URI) + .replace("google-analytics.com/mp/collect", "gist.githubusercontent.com") + .replace(NA, "[].includes") + .replace(EU, "[].includes") + .replace(r#"exports\.countryHasAds=\w;"#, "exports.countryHasAds=[];") + .replace(r#"exports\.countryHasAdsAdsense=\w;"#, "exports.countryHasAdsAdsense=[];") + .replace(r#"exports\.adsenseAds=\w;"#, "exports.adsenseAds=[];") + .replace(r#"exports\.playwireAds=\w;"#, "exports.playwireAds=[];") + .replace(r#"exports\.nitropayAds=\w;"#, "exports.nitropayAds=[];"); return patched_file; } @@ -40,11 +76,12 @@ fn patch_file(file: String) -> String /// /// scan_all(asar_path); /// ``` -fn scan_all(asar_path: std::path::PathBuf) -> asar::Result<()> +#[cfg(target_os = "windows")] +fn scan_all(asar_path: PathBuf) -> asar::Result<()> { let asar_file: Vec = std::fs::read(asar_path.clone())?; - let asar_r: AsarReader = AsarReader::new(&asar_file, asar_path.clone())?; - let mut asar_w: AsarWriter = AsarWriter::new(); + let asar_r = AsarReader::new(&asar_file, asar_path.clone())?; + let mut asar_w = AsarWriter::new(); let paths = asar_r.files(); println!("scan_all: scanning files from the archive."); @@ -66,42 +103,12 @@ fn scan_all(asar_path: std::path::PathBuf) -> asar::Result<()> asar_w.write_file(path.as_path(), file.data(), false)?; } } + println!("scan_all: rebuilding asar archive"); asar_w.finalize(std::fs::File::create(asar_path)?)?; Ok(()) } -/// Replace the content of the specified file to delete advertisements' links. -/// -/// ## Arguments -/// -/// * `path` - `std::path::PathBuf` containing the path of the file to patch. -/// -/// ## Example -/// ``` -/// let path = std::path::PathBuf::from("/path/to/file"); -/// -/// patch_file(path); -///``` -fn patch_file_old(file: String) -> String -{ - let adsense_uri_patch: &str = "https://gist.githubusercontent.com/MidKnightXI/7ecf3cdd0a5804466cb790855e2524ae/raw/9b88cf64f3bb955edfff27bdfba72f5181d8748b/remover.txt"; - let na: &str = r#"["US","CA"].includes"#; - let eu: &str = r#"["AD","AL","AT","AX","BA","BE","BG","BY","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GB","GG","GI","GR","HR","HU","IE","IM","IS","IT","JE","LI","LT","LU","LV","MC","MD","ME","MK","MT","NL","NO","PL","PT","RO","RS","RU","SE","SI","SJ","SK","SM","UA","VA","XK"].includes"#; - - let patched_file: String = file - .replace("https://dtapp-player.op.gg/adsense.txt", adsense_uri_patch) - .replace("google-analytics.com/mp/collect", "gist.githubusercontent.com") - .replace(na, "[].includes") - .replace(eu, "[].includes") - .replace(r#"exports\.countryHasAds=\w;"#, "exports.countryHasAds=[];") - .replace(r#"exports\.countryHasAdsAdsense=\w;"#, "exports.countryHasAdsAdsense=[];") - .replace(r#"exports\.adsenseAds=\w;"#, "exports.adsenseAds=[];") - .replace(r#"exports\.playwireAds=\w;"#, "exports.playwireAds=[];") - .replace(r#"exports\.nitropayAds=\w;"#, "exports.nitropayAds=[];"); - return patched_file; -} - /// Scan the asar archive located at `asar_path` /// /// ## Arguments @@ -114,22 +121,25 @@ fn patch_file_old(file: String) -> String /// /// scan_all_old(asar_path); /// ``` -fn scan_all_old(asar_path: std::path::PathBuf) -> asar::Result<()> +#[cfg(target_os = "macos")] +fn scan_all(asar_path: PathBuf) -> asar::Result<()> { let asar_file: Vec = std::fs::read(asar_path.clone())?; - let asar_r: AsarReader = AsarReader::new(&asar_file, asar_path.clone())?; - let mut asar_w: AsarWriter = AsarWriter::new(); + let asar_r = AsarReader::new(&asar_file, asar_path.clone())?; + let mut asar_w = AsarWriter::new(); let files = asar_r.files(); - println!("extract_all: scanning files of the archive."); + println!("scan_all: scanning files of the archive."); for path in files.keys() { - let path_str = path.to_str().unwrap(); let file = asar_r.files().get(path).unwrap(); - if (path_str.starts_with("assets/react") || path_str.starts_with(r"assets\react")) && path_str.ends_with(".js") + + if path.starts_with("assets/react") && path.ends_with(".js") { - println!("patch_file: removing ads from {}", path_str); - let patched = patch_file_old(String::from_utf8(file.data().to_vec()).unwrap()); + println!("patch_file: removing ads from {}", path.to_str().unwrap()); + let patched = patch_file( + String::from_utf8(file.data().to_vec()).unwrap() + ); asar_w.write_file(path.as_path(), patched.as_bytes(), false)?; } else @@ -137,6 +147,8 @@ fn scan_all_old(asar_path: std::path::PathBuf) -> asar::Result<()> asar_w.write_file(path.as_path(), file.data(), false)?; } } + + println!("scan_all: rebuilding asar archive"); asar_w.finalize(std::fs::File::create(asar_path)?)?; Ok(()) } @@ -174,14 +186,14 @@ fn kill_opgg() /// /// * Success - returns the canonicalize version of the path to OP.GG app directory /// * Failure - returns a String containing the error -fn format_asar_path() -> Result +fn format_asar_path() -> Result { - let path: std::path::PathBuf; + let path: PathBuf; println!("format_asar_path: determining platform."); if std::env::consts::OS == "macos" { - path = std::path::PathBuf::from("/Applications/OP.GG.app/Contents/Resources/app.asar"); + path = PathBuf::from("/Applications/OP.GG.app/Contents/Resources/app.asar"); } else if std::env::consts::OS == "windows" { @@ -189,7 +201,7 @@ fn format_asar_path() -> Result Ok(v) => v, Err(e) => return Err(format!("format_asar_path: {e}")) }; - path = std::path::PathBuf::from(appdata).join("Programs/OP.GG/resources/app.asar"); + path = PathBuf::from(appdata).join("Programs/OP.GG/resources/app.asar"); } else { @@ -210,10 +222,8 @@ fn format_asar_path() -> Result /// * Failure - returns a String containing the error pub fn remove_ads() -> Result { - let path: std::path::PathBuf; - - match format_asar_path() { - Ok(val) => path = val, + let path: PathBuf = match format_asar_path() { + Ok(path) => path, Err(e) => return Err(e) }; @@ -223,21 +233,11 @@ pub fn remove_ads() -> Result } kill_opgg(); - if std::env::consts::OS == "windows" + match scan_all(path) { - match scan_all(path) - { - Ok(_) => {}, - Err(e) => return Err(format!("extract_all: {e}")) - } - } - else - { - match scan_all_old(path) - { - Ok(_) => {}, - Err(e) => return Err(format!("extract_all: {e}")) - } + Ok(_) => {}, + Err(e) => return Err(format!("extract_all: {e}")) } + Ok(true) } \ No newline at end of file From 6b3c0f03647228fd52f603c7a313641fa2241c2f Mon Sep 17 00:00:00 2001 From: MidKnightXI Date: Sun, 4 Jun 2023 14:42:50 +0900 Subject: [PATCH 2/6] doc: updating doc to be up to date --- src-tauri/src/patcher.rs | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src-tauri/src/patcher.rs b/src-tauri/src/patcher.rs index e7d7222..6a42c12 100644 --- a/src-tauri/src/patcher.rs +++ b/src-tauri/src/patcher.rs @@ -5,14 +5,14 @@ use asar::{AsarReader, AsarWriter}; /// Remove ads from the file. /// /// ## Arguments -/// -/// * `path` - `std::path::PathBuf` containing the path of the file to patch. +/// * `file` - [`String`] containing the content of the file to patch. /// /// ## Example /// ``` -/// let path = String::from("/path/to/file"); +/// let file_path = "path/to/file.js"; +/// let contents = fs::read_to_string(file_path).unwrap(); /// -/// patch_file(path); +/// patch_file(content); ///``` #[cfg(target_os = "windows")] fn patch_file(file: String) -> String @@ -34,14 +34,14 @@ fn patch_file(file: String) -> String /// Replace the content of the specified file to delete advertisements' links. /// /// ## Arguments -/// -/// * `path` - `String` containing the path of the file to patch. +/// * `file` - [`String`] containing the content of the file to patch. /// /// ## Example /// ``` -/// let path = String::from("/path/to/file"); +/// let file_path = "path/to/file.js"; +/// let contents = fs::read_to_string(file_path).unwrap(); /// -/// patch_file(path); +/// patch_file(content); ///``` #[cfg(target_os = "macos")] fn patch_file(file: String) -> String @@ -67,12 +67,11 @@ fn patch_file(file: String) -> String /// Scan the asar archive located at `asar_path` /// /// ## Arguments +/// * `asar_path` - [`PathBuf`] containing the path to the asar archive. /// -/// * `asar_path` - `std::path::PathBuf` containing the path to the asar archive. -/// -/// # Example +/// ## Example /// ``` -/// let asar_path = std::path::PathBuf::from("/path/to/archive"); +/// let asar_path = std::path::PathBuf::from("/path/to/archive.asar"); /// /// scan_all(asar_path); /// ``` @@ -112,12 +111,11 @@ fn scan_all(asar_path: PathBuf) -> asar::Result<()> /// Scan the asar archive located at `asar_path` /// /// ## Arguments +/// * `asar_path` - [`PathBuf`] containing the path to the asar archive. /// -/// * `asar_path` - `std::path::PathBuf` containing the path to the asar archive. -/// -/// # Example +/// ## Example /// ``` -/// let asar_path = std::path::PathBuf::from("/path/to/file"); +/// let asar_path = std::path::PathBuf::from("/path/to/archive.asar"); /// /// scan_all_old(asar_path); /// ``` @@ -167,7 +165,7 @@ fn kill_opgg() } else if std::env::consts::OS == "windows" { - // let CREATE_NO_WINDOW = 0x08000000; + // const CREATE_NO_WINDOW = 0x08000000; process = Command::new("taskkill"); process.args(&["/im", "OP.GG.exe", "/F"]); } @@ -183,7 +181,6 @@ fn kill_opgg() /// Returns the path to OP.GG based on which platform the user is using /// /// ## Returns -/// /// * Success - returns the canonicalize version of the path to OP.GG app directory /// * Failure - returns a String containing the error fn format_asar_path() -> Result @@ -217,7 +214,6 @@ fn format_asar_path() -> Result /// Main function for the patcher mod /// /// ## Returns -/// /// * Success - returns `true` /// * Failure - returns a String containing the error pub fn remove_ads() -> Result From f1511a153a8372d2378447b8404911152f9c6201 Mon Sep 17 00:00:00 2001 From: MidKnightXI Date: Mon, 5 Jun 2023 13:24:53 +0900 Subject: [PATCH 3/6] feat: removing useless conditions in scan_all --- src-tauri/src/patcher.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/src/patcher.rs b/src-tauri/src/patcher.rs index 6a42c12..03ccc78 100644 --- a/src-tauri/src/patcher.rs +++ b/src-tauri/src/patcher.rs @@ -89,7 +89,7 @@ fn scan_all(asar_path: PathBuf) -> asar::Result<()> let path_str = path.to_str().unwrap(); let file = asar_r.files().get(path).unwrap(); - if (path_str.starts_with("assets/main") || path_str.starts_with(r"assets\main\main.js")) && path_str.ends_with(".js") + if path_str.eq(r"assets\main\main.js") { println!("scan_all: removing ads of {}", path_str); let patched = patch_file( From 29fdf9d46b001207df86907d2a97771680eebcc8 Mon Sep 17 00:00:00 2001 From: MidKnightXI Date: Tue, 6 Jun 2023 14:50:22 +0900 Subject: [PATCH 4/6] lint: used cargo fmt on the project --- package.json | 6 +- src-tauri/Cargo.lock | 892 +++++++++++++++++++++++++++----------- src-tauri/Cargo.toml | 4 +- src-tauri/build.rs | 2 +- src-tauri/src/main.rs | 4 +- src-tauri/src/patcher.rs | 110 ++--- src-tauri/tauri.conf.json | 2 +- yarn.lock | 116 ++--- 8 files changed, 749 insertions(+), 387 deletions(-) diff --git a/package.json b/package.json index 9f42310..6ac50f0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "opgg-patcher", - "version": "2.1.1", - "description": "", + "version": "2.1.2", + "description": "Tool to Remove Ads from OP-GG Desktop Client", "scripts": { "start": "vite", "dev": "vite", @@ -11,7 +11,7 @@ }, "license": "MIT", "devDependencies": { - "@tauri-apps/cli": "^1.1.0", + "@tauri-apps/cli": "^1.3.1", "vite": "^3.0.0", "vite-plugin-solid": "^2.3.0" }, diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 65cbdf1..917faf1 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -18,16 +18,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] -name = "adler32" -version = "1.2.0" +name = "aho-corasick" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +dependencies = [ + "memchr", +] [[package]] name = "aho-corasick" -version = "0.7.19" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" dependencies = [ "memchr", ] @@ -81,13 +84,106 @@ dependencies = [ "is_executable", "serde", "serde_json", - "serde_with 2.0.1", + "serde_with", "sha2", "thiserror", "walkdir", "wax", ] +[[package]] +name = "async-broadcast" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d26004fe83b2d1cd3a97609b21e39f9a31535822210fe83205d2ce48866ea61" +dependencies = [ + "event-listener", + "futures-core", + "parking_lot", +] + +[[package]] +name = "async-channel" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +dependencies = [ + "async-lock", + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-io" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" +dependencies = [ + "async-lock", + "autocfg", + "concurrent-queue", + "futures-lite", + "libc", + "log", + "parking", + "polling", + "slab", + "socket2", + "waker-fn", + "windows-sys 0.42.0", +] + +[[package]] +name = "async-lock" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-recursion" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.103", +] + +[[package]] +name = "async-task" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + [[package]] name = "atk" version = "0.15.1" @@ -155,6 +251,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[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" @@ -290,12 +392,13 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfb" -version = "0.6.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f89d248799e3f15f91b70917f65381062a01bb8e222700ea0e5a7ff9785f9c" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" dependencies = [ "byteorder", - "uuid 0.8.2", + "fnv", + "uuid", ] [[package]] @@ -360,7 +463,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -456,6 +559,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "concurrent-queue" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "const_format" version = "0.2.30" @@ -584,7 +696,7 @@ dependencies = [ "proc-macro2", "quote", "smallvec", - "syn", + "syn 1.0.103", ] [[package]] @@ -594,7 +706,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e" dependencies = [ "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -604,7 +716,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -637,7 +749,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.103", ] [[package]] @@ -654,17 +766,7 @@ checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" dependencies = [ "proc-macro2", "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "syn 1.0.103", ] [[package]] @@ -673,22 +775,8 @@ version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" dependencies = [ - "darling_core 0.14.2", - "darling_macro 0.14.2", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", + "darling_core", + "darling_macro", ] [[package]] @@ -702,18 +790,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core 0.13.4", - "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -722,30 +799,20 @@ version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" dependencies = [ - "darling_core 0.14.2", + "darling_core", "quote", - "syn", -] - -[[package]] -name = "dbus" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8bcdd56d2e5c4ed26a529c5a9029f5db8290d433497506f958eae3be148eb6" -dependencies = [ - "libc", - "libdbus-sys", - "winapi", + "syn 1.0.103", ] [[package]] -name = "deflate" -version = "0.7.20" +name = "derivative" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "adler32", - "byteorder", + "proc-macro2", + "quote", + "syn 1.0.103", ] [[package]] @@ -758,7 +825,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn", + "syn 1.0.103", ] [[package]] @@ -771,6 +838,15 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + [[package]] name = "dirs-next" version = "2.0.0" @@ -781,6 +857,17 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -813,6 +900,12 @@ dependencies = [ "dtoa", ] +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + [[package]] name = "either" version = "1.8.0" @@ -834,6 +927,27 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enumflags2" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + [[package]] name = "errno" version = "0.2.8" @@ -855,6 +969,12 @@ dependencies = [ "libc", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + [[package]] name = "eyre" version = "0.6.8" @@ -978,6 +1098,21 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + [[package]] name = "futures-macro" version = "0.3.25" @@ -986,9 +1121,15 @@ checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + [[package]] name = "futures-task" version = "0.3.25" @@ -1003,6 +1144,7 @@ checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-core", "futures-macro", + "futures-sink", "futures-task", "pin-project-lite", "pin-utils", @@ -1077,6 +1219,20 @@ dependencies = [ "system-deps 6.0.3", ] +[[package]] +name = "gdkwayland-sys" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cca49a59ad8cfdf36ef7330fe7bdfbe1d34323220cc16a0de2679ee773aee2c2" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps 6.0.3", +] + [[package]] name = "gdkx11-sys" version = "0.15.1" @@ -1203,7 +1359,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -1228,7 +1384,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" dependencies = [ - "aho-corasick", + "aho-corasick 0.7.19", "bstr", "fnv", "log", @@ -1298,7 +1454,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -1357,7 +1513,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -1403,12 +1559,12 @@ dependencies = [ [[package]] name = "ico" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a4b3331534254a9b64095ae60d3dc2a8225a7a70229cd5888be127cdc1f6804" +checksum = "e3804960be0bb5e4edb1e1ad67afd321a9ecfd875c3e65c099468fd2717d7cae" dependencies = [ "byteorder", - "png 0.11.0", + "png", ] [[package]] @@ -1483,22 +1639,13 @@ dependencies = [ [[package]] name = "infer" -version = "0.7.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20b2b533137b9cad970793453d4f921c2e91312a6d88b1085c07bc15fc51bb3b" +checksum = "a898e4b7951673fce96614ce5751d13c40fc5674bc2d759288e46c3ab62598b3" dependencies = [ "cfb", ] -[[package]] -name = "inflate" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f9f47468e9a76a6452271efadc88fe865a82be91fe75e6c0c57b87ccea59d4" -dependencies = [ - "adler32", -] - [[package]] name = "instant" version = "0.1.12" @@ -1585,9 +1732,9 @@ dependencies = [ [[package]] name = "jni" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c" dependencies = [ "cesu8", "combine", @@ -1626,7 +1773,19 @@ checksum = "f995a3c8f2bc3dd52a18a583e90f9ec109c047fa1603a853e46bcda14d2e279d" dependencies = [ "serde", "serde_json", - "treediff", + "treediff 3.0.2", +] + +[[package]] +name = "json-patch" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f54898088ccb91df1b492cc80029a6fdf1c48ca0db7c6822a8babad69c94658" +dependencies = [ + "serde", + "serde_json", + "thiserror", + "treediff 4.0.2", ] [[package]] @@ -1653,15 +1812,6 @@ version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" -[[package]] -name = "libdbus-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c185b5b7ad900923ef3a8ff594083d4d9b5aea80bb4f32b8342363138c0d456b" -dependencies = [ - "pkg-config", -] - [[package]] name = "line-wrap" version = "0.1.1" @@ -1868,6 +2018,19 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +[[package]] +name = "nix" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" +dependencies = [ + "bitflags", + "cc", + "cfg-if", + "libc", + "memoffset", +] + [[package]] name = "nodrop" version = "0.1.14" @@ -1903,9 +2066,12 @@ version = "4.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "368e89ea58df747ce88be669ae44e79783c1d30bfd540ad0fc520b3f41f0b3b0" dependencies = [ - "dbus", "mac-notification-sys", + "serde", "tauri-winrt-notification", + "zbus", + "zvariant", + "zvariant_derive", ] [[package]] @@ -1928,17 +2094,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" version = "0.4.1" @@ -1987,7 +2142,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -2055,12 +2210,12 @@ checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "open" -version = "3.0.3" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a3100141f1733ea40b53381b0ae3117330735ef22309a190ac57b9576ea716" +checksum = "2078c0039e6a54a0c42c28faa984e115fb4c2d5bf2208f77d1961002df8576f8" dependencies = [ "pathdiff", - "windows-sys 0.36.1", + "windows-sys 0.42.0", ] [[package]] @@ -2086,7 +2241,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -2110,7 +2265,7 @@ dependencies = [ [[package]] name = "opgg-patcher" -version = "2.1.1" +version = "2.1.2" dependencies = [ "asar", "serde", @@ -2119,6 +2274,16 @@ dependencies = [ "tauri-build", ] +[[package]] +name = "ordered-stream" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44630c059eacfd6e08bdaa51b1db2ce33119caa4ddc1235e923109aa5f25ccb1" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "os_info" version = "3.5.1" @@ -2183,6 +2348,12 @@ dependencies = [ "system-deps 6.0.3", ] +[[package]] +name = "parking" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" + [[package]] name = "parking_lot" version = "0.12.1" @@ -2206,12 +2377,6 @@ dependencies = [ "windows-sys 0.42.0", ] -[[package]] -name = "paste" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" - [[package]] name = "pathdiff" version = "0.2.1" @@ -2297,7 +2462,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -2311,7 +2476,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -2356,7 +2521,7 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" dependencies = [ - "base64", + "base64 0.13.1", "indexmap", "line-wrap", "serde", @@ -2366,26 +2531,30 @@ dependencies = [ [[package]] name = "png" -version = "0.11.0" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b0cabbbd20c2d7f06dbf015e06aad59b6ca3d9ed14848783e98af9aaf19925" +checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" dependencies = [ "bitflags", - "deflate", - "inflate", - "num-iter", + "crc32fast", + "flate2", + "miniz_oxide 0.6.2", ] [[package]] -name = "png" -version = "0.17.7" +name = "polling" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ + "autocfg", "bitflags", - "crc32fast", - "flate2", - "miniz_oxide 0.6.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", ] [[package]] @@ -2429,7 +2598,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.103", "version_check", ] @@ -2452,9 +2621,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" dependencies = [ "unicode-ident", ] @@ -2470,9 +2639,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.21" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] @@ -2589,13 +2758,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" dependencies = [ - "aho-corasick", + "aho-corasick 1.0.2", "memchr", - "regex-syntax", + "regex-syntax 0.7.2", ] [[package]] @@ -2604,7 +2773,7 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.27", ] [[package]] @@ -2613,6 +2782,12 @@ version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + [[package]] name = "remove_dir_all" version = "0.5.3" @@ -2811,29 +2986,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.147" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.147" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "serde_json" -version = "1.0.87" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa 1.0.4", "ryu", @@ -2848,7 +3023,7 @@ checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -2863,54 +3038,32 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_with" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" -dependencies = [ - "serde", - "serde_with_macros 1.5.2", -] - [[package]] name = "serde_with" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "368f2d60d049ea019a84dcd6687b0d1e0030fe663ae105039bdf967ed5e6a9a7" dependencies = [ - "base64", + "base64 0.13.1", "chrono", "hex", "indexmap", "serde", "serde_json", - "serde_with_macros 2.0.1", + "serde_with_macros", "time", ] -[[package]] -name = "serde_with_macros" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" -dependencies = [ - "darling 0.13.4", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "serde_with_macros" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ccadfacf6cf10faad22bbadf55986bdd0856edfb5d9210aa1dcf1f516e84e93" dependencies = [ - "darling 0.14.2", + "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -2932,7 +3085,7 @@ checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -2945,6 +3098,21 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "sha1" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + [[package]] name = "sha2" version = "0.10.6" @@ -2996,6 +3164,16 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "soup2" version = "0.2.1" @@ -3039,6 +3217,12 @@ dependencies = [ "loom", ] +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "string_cache" version = "0.8.4" @@ -3089,7 +3273,7 @@ dependencies = [ "heck 0.3.3", "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -3103,6 +3287,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 = "system-deps" version = "5.0.0" @@ -3131,9 +3326,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.14.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43336f5d1793543ba96e2a1e75f3a5c7dcd592743be06a0ab3a190f4fcb4b934" +checksum = "6a6d198e01085564cea63e976ad1566c1ba2c2e4cc79578e35d9f05521505e31" dependencies = [ "bitflags", "cairo-rs", @@ -3146,6 +3341,7 @@ dependencies = [ "gdk", "gdk-pixbuf", "gdk-sys", + "gdkwayland-sys", "gdkx11-sys", "gio", "glib", @@ -3163,18 +3359,29 @@ dependencies = [ "objc", "once_cell", "parking_lot", - "paste", - "png 0.17.7", + "png", "raw-window-handle", "scopeguard", "serde", + "tao-macros", "unicode-segmentation", - "uuid 1.2.1", + "uuid", "windows 0.39.0", "windows-implement", "x11-dl", ] +[[package]] +name = "tao-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b27a4bcc5eb524658234589bdffc7e7bfb996dbae6ce9393bfd39cb4159b445" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.103", +] + [[package]] name = "tar" version = "0.4.38" @@ -3188,9 +3395,9 @@ dependencies = [ [[package]] name = "tauri" -version = "1.1.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbf22abd61d95ca9b2becd77f9db4c093892f73e8a07d21d8b0b2bf71a7bcea" +checksum = "d42ba3a2e8556722f31336a0750c10dbb6a81396a1c452977f515da83f69f842" dependencies = [ "anyhow", "attohttpc", @@ -3233,7 +3440,7 @@ dependencies = [ "thiserror", "tokio", "url", - "uuid 1.2.1", + "uuid", "webkit2gtk", "webview2-com", "win7-notifications", @@ -3249,7 +3456,7 @@ dependencies = [ "anyhow", "cargo_toml", "heck 0.4.0", - "json-patch", + "json-patch 0.2.6", "semver 1.0.14", "serde_json", "tauri-utils", @@ -3258,16 +3465,16 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "1.1.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "356fa253e40ae4d6ff02075011f2f2bb4066f5c9d8c1e16ca6912d7b75903ba6" +checksum = "e5a2105f807c6f50b2fa2ce5abd62ef207bc6f14c9fcc6b8caec437f6fb13bde" dependencies = [ - "base64", + "base64 0.21.2", "brotli", "ico", - "json-patch", + "json-patch 1.0.0", "plist", - "png 0.17.7", + "png", "proc-macro2", "quote", "regex", @@ -3278,50 +3485,50 @@ dependencies = [ "tauri-utils", "thiserror", "time", - "uuid 1.2.1", + "uuid", "walkdir", ] [[package]] name = "tauri-macros" -version = "1.1.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6051fd6940ddb22af452340d03c66a3e2f5d72e0788d4081d91e31528ccdc4d" +checksum = "8784cfe6f5444097e93c69107d1ac5e8f13d02850efa8d8f2a40fe79674cef46" dependencies = [ "heck 0.4.0", "proc-macro2", "quote", - "syn", + "syn 1.0.103", "tauri-codegen", "tauri-utils", ] [[package]] name = "tauri-runtime" -version = "0.11.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d49439a5ea47f474572b854972f42eda2e02a470be5ca9609cc83bb66945abe2" +checksum = "b3b80ea3fcd5fefb60739a3b577b277e8fc30434538a2f5bba82ad7d4368c422" dependencies = [ "gtk", "http", "http-range", - "infer", "rand 0.8.5", "raw-window-handle", "serde", "serde_json", "tauri-utils", "thiserror", - "uuid 1.2.1", + "url", + "uuid", "webview2-com", "windows 0.39.0", ] [[package]] name = "tauri-runtime-wry" -version = "0.11.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dce920995fd49907aa9bea7249ed1771454f11f7611924c920a1f75fb614d4" +checksum = "d1c396950b1ba06aee1b4ffe6c7cd305ff433ca0e30acbc5fa1a2f92a4ce70f1" dependencies = [ "cocoa", "gtk", @@ -3330,7 +3537,7 @@ dependencies = [ "raw-window-handle", "tauri-runtime", "tauri-utils", - "uuid 1.2.1", + "uuid", "webkit2gtk", "webview2-com", "windows 0.39.0", @@ -3339,16 +3546,17 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.1.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8fdae6f29cef959809a3c3afef510c5b715a446a597ab8b791497585363f39" +checksum = "5a6f9c2dafef5cbcf52926af57ce9561bd33bb41d7394f8bb849c0330260d864" dependencies = [ "brotli", "ctor", "glob", "heck 0.4.0", "html5ever", - "json-patch", + "infer", + "json-patch 1.0.0", "kuchiki", "memchr", "phf 0.10.1", @@ -3357,7 +3565,7 @@ dependencies = [ "semver 1.0.14", "serde", "serde_json", - "serde_with 1.14.0", + "serde_with", "thiserror", "url", "walkdir", @@ -3417,22 +3625,22 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] @@ -3446,31 +3654,14 @@ dependencies = [ [[package]] name = "time" -version = "0.3.16" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fab5c8b9980850e06d92ddbe3ab839c062c801f3927c0fb8abd6fc8e918fbca" +checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" dependencies = [ "itoa 1.0.4", "libc", "num_threads", "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" - -[[package]] -name = "time-macros" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bb801831d812c562ae7d2bfb531f26e66e4e1f6b17307ba4149c5064710e5b" -dependencies = [ - "time-core", ] [[package]] @@ -3530,7 +3721,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -3591,6 +3782,15 @@ dependencies = [ "serde_json", ] +[[package]] +name = "treediff" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303" +dependencies = [ + "serde_json", +] + [[package]] name = "typenum" version = "1.15.0" @@ -3603,6 +3803,16 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +[[package]] +name = "uds_windows" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" +dependencies = [ + "tempfile", + "winapi", +] + [[package]] name = "unicode-bidi" version = "0.3.8" @@ -3660,12 +3870,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" - [[package]] name = "uuid" version = "1.2.1" @@ -3705,6 +3909,12 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + [[package]] name = "walkdir" version = "2.3.2" @@ -3749,7 +3959,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.103", "wasm-bindgen-shared", ] @@ -3783,7 +3993,7 @@ checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3889,7 +4099,7 @@ checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -4004,7 +4214,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba01f98f509cb5dc05f4e5fc95e535f78260f15fea8fe1a8abdd08f774f1cee7" dependencies = [ - "syn", + "syn 1.0.103", "windows-tokens", ] @@ -4033,15 +4243,39 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", + "windows_aarch64_gnullvm 0.42.0", "windows_aarch64_msvc 0.42.0", "windows_i686_gnu 0.42.0", "windows_i686_msvc 0.42.0", "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm", + "windows_x86_64_gnullvm 0.42.0", "windows_x86_64_msvc 0.42.0", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "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-tokens" version = "0.39.0" @@ -4054,6 +4288,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +[[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.32.0" @@ -4084,6 +4324,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +[[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.32.0" @@ -4114,6 +4360,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +[[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.32.0" @@ -4144,6 +4396,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +[[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.32.0" @@ -4174,12 +4432,24 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +[[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +[[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.32.0" @@ -4210,6 +4480,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + [[package]] name = "winres" version = "0.1.12" @@ -4221,15 +4497,16 @@ dependencies = [ [[package]] name = "wry" -version = "0.21.1" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff5c1352b4266fdf92c63479d2f58ab4cd29dc4e78fbc1b62011ed1227926945" +checksum = "33748f35413c8a98d45f7a08832d848c0c5915501803d1faade5a4ebcd258cea" dependencies = [ - "base64", + "base64 0.13.1", "block", "cocoa", "core-graphics", "crossbeam-channel", + "dunce", "gdk", "gio", "glib", @@ -4245,6 +4522,7 @@ dependencies = [ "serde", "serde_json", "sha2", + "soup2", "tao", "thiserror", "url", @@ -4290,3 +4568,105 @@ name = "xml-rs" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" + +[[package]] +name = "zbus" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d8f1a037b2c4a67d9654dc7bdfa8ff2e80555bbefdd3c1833c1d1b27c963a6b" +dependencies = [ + "async-broadcast", + "async-channel", + "async-executor", + "async-io", + "async-lock", + "async-recursion", + "async-task", + "async-trait", + "byteorder", + "derivative", + "dirs", + "enumflags2", + "event-listener", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "lazy_static", + "nix", + "once_cell", + "ordered-stream", + "rand 0.8.5", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tracing", + "uds_windows", + "winapi", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8fb5186d1c87ae88cf234974c240671238b4a679158ad3b94ec465237349a6" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "regex", + "syn 1.0.103", +] + +[[package]] +name = "zbus_names" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82441e6033be0a741157a72951a3e4957d519698f3a824439cc131c5ba77ac2a" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + +[[package]] +name = "zvariant" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622cc473f10cef1b0d73b7b34a266be30ebdcfaea40ec297dd8cbda088f9f93c" +dependencies = [ + "byteorder", + "enumflags2", + "libc", + "serde", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d9c1b57352c25b778257c661f3c4744b7cefb7fc09dd46909a153cce7773da2" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.103", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.103", +] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index ebac084..fad925d 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "opgg-patcher" -version = "2.1.1" +version = "2.1.2" description = "Tool to Remove Ads from OP-GG Desktop Client" authors = ["MidKnightXI"] license = "" @@ -16,7 +16,7 @@ tauri-build = { version = "1.1", features = [] } [dependencies] serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } -tauri = { version = "1.1", features = ["api-all", "windows7-compat"] } +tauri = { version = "1.3.0", features = ["api-all", "windows7-compat"] } asar = "0.2.0" [features] diff --git a/src-tauri/build.rs b/src-tauri/build.rs index 795b9b7..d860e1e 100644 --- a/src-tauri/build.rs +++ b/src-tauri/build.rs @@ -1,3 +1,3 @@ fn main() { - tauri_build::build() + tauri_build::build() } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 14337db..579a3fd 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -9,7 +9,7 @@ mod patcher; fn patch() -> String { match patcher::remove_ads() { Ok(_v) => return "Patched Successfully".to_string(), - Err(e) => return e + Err(e) => return e, } } @@ -18,4 +18,4 @@ fn main() { .invoke_handler(tauri::generate_handler![patch]) .run(tauri::generate_context!()) .expect("error while running tauri application"); -} \ No newline at end of file +} diff --git a/src-tauri/src/patcher.rs b/src-tauri/src/patcher.rs index 03ccc78..30ae456 100644 --- a/src-tauri/src/patcher.rs +++ b/src-tauri/src/patcher.rs @@ -15,14 +15,19 @@ use asar::{AsarReader, AsarWriter}; /// patch_file(content); ///``` #[cfg(target_os = "windows")] -fn patch_file(file: String) -> String -{ +fn patch_file(file: String) -> String { const GIST: &str = "https://gist.githubusercontent.com"; const CLOUDFLARE: &str = "https://op-gg-remove-ads.shyim.workers.dev"; let patched_file: String = file - .replace(r#"checkIfChromeDirectoryExists("Default")"#, r#"checkIfChromeDirectoryExists("NoChrome:((((??")"#) - .replace(r#"AppData\Local\Google\Chrome\User Data"#, r#"AppData\Local\Google\Carbon\Privacy?"#) + .replace( + r#"checkIfChromeDirectoryExists("Default")"#, + r#"checkIfChromeDirectoryExists("NoChrome:((((??")"#, + ) + .replace( + r#"AppData\Local\Google\Chrome\User Data"#, + r#"AppData\Local\Google\Carbon\Privacy?"#, + ) .replace("https://desktop.op.gg/api/tracking/ow", GIST) .replace("https://geo-internal.op.gg/api/current-ip", GIST) .replace("app.labs.sydney", "op-gg-remove-ads.shyim.workers.dev") @@ -44,19 +49,24 @@ fn patch_file(file: String) -> String /// patch_file(content); ///``` #[cfg(target_os = "macos")] -fn patch_file(file: String) -> String -{ +fn patch_file(file: String) -> String { const ADSENSE_URI: &str = "https://gist.githubusercontent.com/MidKnightXI/7ecf3cdd0a5804466cb790855e2524ae/raw/9b88cf64f3bb955edfff27bdfba72f5181d8748b/remover.txt"; const NA: &str = r#"["US","CA"].includes"#; const EU: &str = r#"["AD","AL","AT","AX","BA","BE","BG","BY","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GB","GG","GI","GR","HR","HU","IE","IM","IS","IT","JE","LI","LT","LU","LV","MC","MD","ME","MK","MT","NL","NO","PL","PT","RO","RS","RU","SE","SI","SJ","SK","SM","UA","VA","XK"].includes"#; let patched_file: String = file + .replace( + "google-analytics.com/mp/collect", + "gist.githubusercontent.com", + ) + .replace( + r#"exports\.countryHasAdsAdsense=\w;"#, + "exports.countryHasAdsAdsense=[];", + ) .replace("https://dtapp-player.op.gg/adsense.txt", ADSENSE_URI) - .replace("google-analytics.com/mp/collect", "gist.githubusercontent.com") .replace(NA, "[].includes") .replace(EU, "[].includes") .replace(r#"exports\.countryHasAds=\w;"#, "exports.countryHasAds=[];") - .replace(r#"exports\.countryHasAdsAdsense=\w;"#, "exports.countryHasAdsAdsense=[];") .replace(r#"exports\.adsenseAds=\w;"#, "exports.adsenseAds=[];") .replace(r#"exports\.playwireAds=\w;"#, "exports.playwireAds=[];") .replace(r#"exports\.nitropayAds=\w;"#, "exports.nitropayAds=[];"); @@ -76,29 +86,22 @@ fn patch_file(file: String) -> String /// scan_all(asar_path); /// ``` #[cfg(target_os = "windows")] -fn scan_all(asar_path: PathBuf) -> asar::Result<()> -{ +fn scan_all(asar_path: PathBuf) -> asar::Result<()> { let asar_file: Vec = std::fs::read(asar_path.clone())?; let asar_r = AsarReader::new(&asar_file, asar_path.clone())?; let mut asar_w = AsarWriter::new(); let paths = asar_r.files(); println!("scan_all: scanning files from the archive."); - for path in paths.keys() - { + for path in paths.keys() { let path_str = path.to_str().unwrap(); let file = asar_r.files().get(path).unwrap(); - if path_str.eq(r"assets\main\main.js") - { + if path_str.eq(r"assets\main\main.js") { println!("scan_all: removing ads of {}", path_str); - let patched = patch_file( - String::from_utf8(file.data().to_vec()).unwrap() - ); + let patched = patch_file(String::from_utf8(file.data().to_vec()).unwrap()); asar_w.write_file(path.as_path(), patched.as_bytes(), false)?; - } - else - { + } else { asar_w.write_file(path.as_path(), file.data(), false)?; } } @@ -120,28 +123,21 @@ fn scan_all(asar_path: PathBuf) -> asar::Result<()> /// scan_all_old(asar_path); /// ``` #[cfg(target_os = "macos")] -fn scan_all(asar_path: PathBuf) -> asar::Result<()> -{ +fn scan_all(asar_path: PathBuf) -> asar::Result<()> { let asar_file: Vec = std::fs::read(asar_path.clone())?; let asar_r = AsarReader::new(&asar_file, asar_path.clone())?; let mut asar_w = AsarWriter::new(); let files = asar_r.files(); println!("scan_all: scanning files of the archive."); - for path in files.keys() - { + for path in files.keys() { let file = asar_r.files().get(path).unwrap(); - if path.starts_with("assets/react") && path.ends_with(".js") - { + if path.starts_with("assets/react") && path.ends_with(".js") { println!("patch_file: removing ads from {}", path.to_str().unwrap()); - let patched = patch_file( - String::from_utf8(file.data().to_vec()).unwrap() - ); + let patched = patch_file(String::from_utf8(file.data().to_vec()).unwrap()); asar_w.write_file(path.as_path(), patched.as_bytes(), false)?; - } - else - { + } else { asar_w.write_file(path.as_path(), file.data(), false)?; } } @@ -152,25 +148,19 @@ fn scan_all(asar_path: PathBuf) -> asar::Result<()> } /// Spawn a process to kill OP.GG process -fn kill_opgg() -{ +fn kill_opgg() { use std::process::Command; let mut process: Command; - if std::env::consts::OS == "macos" - { + if std::env::consts::OS == "macos" { process = Command::new("killall"); process.args(&["-9", "OP.GG"]); - } - else if std::env::consts::OS == "windows" - { + } else if std::env::consts::OS == "windows" { // const CREATE_NO_WINDOW = 0x08000000; process = Command::new("taskkill"); process.args(&["/im", "OP.GG.exe", "/F"]); - } - else - { + } else { return; } @@ -183,31 +173,25 @@ fn kill_opgg() /// ## Returns /// * Success - returns the canonicalize version of the path to OP.GG app directory /// * Failure - returns a String containing the error -fn format_asar_path() -> Result -{ +fn format_asar_path() -> Result { let path: PathBuf; println!("format_asar_path: determining platform."); - if std::env::consts::OS == "macos" - { + if std::env::consts::OS == "macos" { path = PathBuf::from("/Applications/OP.GG.app/Contents/Resources/app.asar"); - } - else if std::env::consts::OS == "windows" - { + } else if std::env::consts::OS == "windows" { let appdata = match std::env::var("LOCALAPPDATA") { Ok(v) => v, - Err(e) => return Err(format!("format_asar_path: {e}")) + Err(e) => return Err(format!("format_asar_path: {e}")), }; path = PathBuf::from(appdata).join("Programs/OP.GG/resources/app.asar"); - } - else - { + } else { return Err("format_asar_path: Platform not compatible.".to_string()); } match std::fs::canonicalize(path) { Ok(val) => return Ok(val), - Err(e) => return Err(format!("format_asar_path: {e}")) + Err(e) => return Err(format!("format_asar_path: {e}")), } } @@ -216,24 +200,22 @@ fn format_asar_path() -> Result /// ## Returns /// * Success - returns `true` /// * Failure - returns a String containing the error -pub fn remove_ads() -> Result -{ +pub fn remove_ads() -> Result { let path: PathBuf = match format_asar_path() { Ok(path) => path, - Err(e) => return Err(e) + Err(e) => return Err(e), }; - if !path.exists() - { + if !path.exists() { return Err("remove_ads: OP.GG not found, make sure the app is installed.".to_string()); } kill_opgg(); - match scan_all(path) - { - Ok(_) => {}, - Err(e) => return Err(format!("extract_all: {e}")) + + match scan_all(path) { + Ok(_) => {} + Err(e) => return Err(format!("extract_all: {e}")), } Ok(true) -} \ No newline at end of file +} diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index a13c2d6..7f396dd 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "OPGG Patcher", - "version": "2.1.1" + "version": "2.1.2" }, "tauri": { "allowlist": { diff --git a/yarn.lock b/yarn.lock index 3788dcd..29247c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -336,65 +336,65 @@ resolved "https://registry.yarnpkg.com/@tauri-apps/api/-/api-1.2.0.tgz#1f196b3e012971227f41b98214c846430a4eb477" integrity sha512-lsI54KI6HGf7VImuf/T9pnoejfgkNoXveP14pVV7XarrQ46rOejIVJLFqHI9sRReJMGdh2YuCoI3cc/yCWCsrw== -"@tauri-apps/cli-darwin-arm64@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-1.2.2.tgz#f18b0689b399b64dc67da41c0fd4da474be324fe" - integrity sha512-W+Cp2weUMlvmGkRJeUjypbz9Lpl6o98xkgKAtobZSum5SNwpsBQfawJTESakNoD+FXyVg/snIk5sRdHge+tAaA== - -"@tauri-apps/cli-darwin-x64@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-1.2.2.tgz#4450bd244f586da346651f62a5a41686cee36db7" - integrity sha512-vmVAqt+ECH2d6cbcGJ7ddcCAZgmKe5xmxlL5r4xoaphu7OqU4gnv4VFURYkVltOfwzIFQVOPVSqwYyIDToCYNQ== - -"@tauri-apps/cli-linux-arm-gnueabihf@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-1.2.2.tgz#a4d5b95665620605fb0f54cb77f8134239b58370" - integrity sha512-yYTdQurgi4QZR8z+fANjl522jdQz/VtesFpw+C/A0+zXg7tiRjicsywBDdPsvNzCqFeGKKkmTR+Lny5qxhGaeQ== - -"@tauri-apps/cli-linux-arm64-gnu@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-1.2.2.tgz#c992907586b42e2085160d45b3a17316c99febea" - integrity sha512-ZSOVT6Eq1ay2+27B8KfA0MnpO7KYzONU6TjenH7DNcQki6eWGG5JoNu8QQ9Mdn3dAzY0XBP9i1ZHQOFu4iPtEg== - -"@tauri-apps/cli-linux-arm64-musl@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.2.2.tgz#f8bd7901ce525b8433919e2cfe7ec22aace0f776" - integrity sha512-/NHSkqNQ+Pr4PshvyD1CeNFaPCaCpe1OeuAQgVi0rboSecC9fXN96G5dQbSBoxOUcCo6f8aTVE7zkZ4WchFVog== - -"@tauri-apps/cli-linux-x64-gnu@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-1.2.2.tgz#a558862d7101b0a641c5a994c9ee74edb8300fc5" - integrity sha512-4YTmfPuyvlHsvCkATDMwhklfuQm3HKxYXv/IOW9H0ra6pS9efVhrFYIC9Vfv6XaKN85Vnn/FYTEGMJLwCxZw2Q== - -"@tauri-apps/cli-linux-x64-musl@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-1.2.2.tgz#573e965a638864a65b606783d3dbd34114939277" - integrity sha512-wr46tbscwFuCcA931R+ItOiUTT0djMmgKLd1HFCmFF82V9BKE2reIjr6O9l0NCXCo2WeD4pe3jA/Pt1dxDu+JA== - -"@tauri-apps/cli-win32-ia32-msvc@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-1.2.2.tgz#0fe38283ffeb71acac6a6a317951dc75ec2d3dad" - integrity sha512-6VmbVJOWUZJK5/JKhb3mNFKrKGfq0KV7lJGumfN95WJgkHeyL61p8bZit+o6ZgUGUhrOabkAawhDkrRY+ZQhIw== - -"@tauri-apps/cli-win32-x64-msvc@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-1.2.2.tgz#9b8ea7c63f2883af105e204fc4f1f11a83990a59" - integrity sha512-YRPJguJma+zSuRZpFoSZqls6+laggG1vqG0FPQWQTi+ywATgMpai2b2RZnffDlpHKp9mt4V/s2dtqOy6bpGZHg== - -"@tauri-apps/cli@^1.1.0": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@tauri-apps/cli/-/cli-1.2.2.tgz#cf7cb90d11c3c3b757efe07b7e2c48abde045ada" - integrity sha512-D8zib3A0vWCvPPSyYLxww/OdDlVcY7fpcDVBH6qUvheOjj2aCyU7H9AYMRBwpgCfz8zY5+vomee+laLeB0H13w== +"@tauri-apps/cli-darwin-arm64@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-1.3.1.tgz#ef0fe290e0a6e3e53fa2cc4f1a72a0c87921427c" + integrity sha512-QlepYVPgOgspcwA/u4kGG4ZUijlXfdRtno00zEy+LxinN/IRXtk+6ErVtsmoLi1ZC9WbuMwzAcsRvqsD+RtNAg== + +"@tauri-apps/cli-darwin-x64@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-1.3.1.tgz#4c84ea0f08a5b636b067943d637a38e091a4aad3" + integrity sha512-fKcAUPVFO3jfDKXCSDGY0MhZFF/wDtx3rgFnogWYu4knk38o9RaqRkvMvqJhLYPuWaEM5h6/z1dRrr9KKCbrVg== + +"@tauri-apps/cli-linux-arm-gnueabihf@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-1.3.1.tgz#a4f1b237189e4f8f89cc890e1dc2eec76d4345be" + integrity sha512-+4H0dv8ltJHYu/Ma1h9ixUPUWka9EjaYa8nJfiMsdCI4LJLNE6cPveE7RmhZ59v9GW1XB108/k083JUC/OtGvA== + +"@tauri-apps/cli-linux-arm64-gnu@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-1.3.1.tgz#e2391326b64dfe13c7442bdcc13c4988ce5e6df9" + integrity sha512-Pj3odVO1JAxLjYmoXKxcrpj/tPxcA8UP8N06finhNtBtBaxAjrjjxKjO4968KB0BUH7AASIss9EL4Tr0FGnDuw== + +"@tauri-apps/cli-linux-arm64-musl@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.3.1.tgz#49354349f80f879ffc6950c0c03c0aea1395efa5" + integrity sha512-tA0JdDLPFaj42UDIVcF2t8V0tSha40rppcmAR/MfQpTCxih6399iMjwihz9kZE1n4b5O4KTq9GliYo50a8zYlQ== + +"@tauri-apps/cli-linux-x64-gnu@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-1.3.1.tgz#9a33ffe9e0d9b1b3825db57cbcfcddeb773682c6" + integrity sha512-FDU+Mnvk6NLkqQimcNojdKpMN4Y3W51+SQl+NqG9AFCWprCcSg62yRb84751ujZuf2MGT8HQOfmd0i77F4Q3tQ== + +"@tauri-apps/cli-linux-x64-musl@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-1.3.1.tgz#5283731e894c17bc070c499e73145cfe2633ef21" + integrity sha512-MpO3akXFmK8lZYEbyQRDfhdxz1JkTBhonVuz5rRqxwA7gnGWHa1aF1+/2zsy7ahjB2tQ9x8DDFDMdVE20o9HrA== + +"@tauri-apps/cli-win32-ia32-msvc@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-1.3.1.tgz#f31538abfd94f27ade1f17d01f30da6be1660c6f" + integrity sha512-9Boeo3K5sOrSBAZBuYyGkpV2RfnGQz3ZhGJt4hE6P+HxRd62lS6+qDKAiw1GmkZ0l1drc2INWrNeT50gwOKwIQ== + +"@tauri-apps/cli-win32-x64-msvc@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-1.3.1.tgz#1eb09d55b99916a3cd84cb91c75ef906db67d35d" + integrity sha512-wMrTo91hUu5CdpbElrOmcZEoJR4aooTG+fbtcc87SMyPGQy1Ux62b+ZdwLvL1sVTxnIm//7v6QLRIWGiUjCPwA== + +"@tauri-apps/cli@^1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@tauri-apps/cli/-/cli-1.3.1.tgz#4c5259bf1f9c97084dd016e6b34dca53de380e24" + integrity sha512-o4I0JujdITsVRm3/0spfJX7FcKYrYV1DXJqzlWIn6IY25/RltjU6qbC1TPgVww3RsRX63jyVUTcWpj5wwFl+EQ== optionalDependencies: - "@tauri-apps/cli-darwin-arm64" "1.2.2" - "@tauri-apps/cli-darwin-x64" "1.2.2" - "@tauri-apps/cli-linux-arm-gnueabihf" "1.2.2" - "@tauri-apps/cli-linux-arm64-gnu" "1.2.2" - "@tauri-apps/cli-linux-arm64-musl" "1.2.2" - "@tauri-apps/cli-linux-x64-gnu" "1.2.2" - "@tauri-apps/cli-linux-x64-musl" "1.2.2" - "@tauri-apps/cli-win32-ia32-msvc" "1.2.2" - "@tauri-apps/cli-win32-x64-msvc" "1.2.2" + "@tauri-apps/cli-darwin-arm64" "1.3.1" + "@tauri-apps/cli-darwin-x64" "1.3.1" + "@tauri-apps/cli-linux-arm-gnueabihf" "1.3.1" + "@tauri-apps/cli-linux-arm64-gnu" "1.3.1" + "@tauri-apps/cli-linux-arm64-musl" "1.3.1" + "@tauri-apps/cli-linux-x64-gnu" "1.3.1" + "@tauri-apps/cli-linux-x64-musl" "1.3.1" + "@tauri-apps/cli-win32-ia32-msvc" "1.3.1" + "@tauri-apps/cli-win32-x64-msvc" "1.3.1" ansi-styles@^3.2.1: version "3.2.1" From b47474a1d56966cd2bfc850e424096b8b552d76a Mon Sep 17 00:00:00 2001 From: MidKnightXI Date: Fri, 9 Jun 2023 13:17:29 +0900 Subject: [PATCH 5/6] feat: switching to rust 1.69 --- src-tauri/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index fad925d..1d0b808 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -6,7 +6,7 @@ authors = ["MidKnightXI"] license = "" repository = "https://github.com/MidKnightXI/opgg-ads-remover" edition = "2021" -rust-version = "1.57" +rust-version = "1.69" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From e6178dc80b2464f6108914a25a09555e9b6abf76 Mon Sep 17 00:00:00 2001 From: MidKnightXI Date: Fri, 9 Jun 2023 13:48:29 +0900 Subject: [PATCH 6/6] refac: improved code readability --- src-tauri/src/patcher.rs | 78 +++++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 20 deletions(-) diff --git a/src-tauri/src/patcher.rs b/src-tauri/src/patcher.rs index 30ae456..70dcea6 100644 --- a/src-tauri/src/patcher.rs +++ b/src-tauri/src/patcher.rs @@ -1,6 +1,13 @@ -use std::path::PathBuf; +use std::{ + path::PathBuf, + env::consts::OS +}; -use asar::{AsarReader, AsarWriter}; +use asar::{ + AsarReader, + AsarWriter, + reader::AsarFile +}; /// Remove ads from the file. /// @@ -94,14 +101,23 @@ fn scan_all(asar_path: PathBuf) -> asar::Result<()> { println!("scan_all: scanning files from the archive."); for path in paths.keys() { - let path_str = path.to_str().unwrap(); - let file = asar_r.files().get(path).unwrap(); + let file: &AsarFile; - if path_str.eq(r"assets\main\main.js") { - println!("scan_all: removing ads of {}", path_str); - let patched = patch_file(String::from_utf8(file.data().to_vec()).unwrap()); + file = match asar_r.files().get(path) { + Some(v) => v, + None => continue + }; + + if path.to_str().unwrap().eq(r"assets\main\main.js") + { + let patched: String; + + println!("scan_all: removing ads of {:?}", path); + patched = patch_file(String::from_utf8(file.data().to_vec()).unwrap()); asar_w.write_file(path.as_path(), patched.as_bytes(), false)?; - } else { + } + else + { asar_w.write_file(path.as_path(), file.data(), false)?; } } @@ -131,13 +147,23 @@ fn scan_all(asar_path: PathBuf) -> asar::Result<()> { println!("scan_all: scanning files of the archive."); for path in files.keys() { - let file = asar_r.files().get(path).unwrap(); + let file: &AsarFile; + + file = match asar_r.files().get(path) { + Some(v) => v, + None => continue + }; + + if path.starts_with("assets/react") && path.ends_with(".js") + { + let patched: String; - if path.starts_with("assets/react") && path.ends_with(".js") { println!("patch_file: removing ads from {}", path.to_str().unwrap()); - let patched = patch_file(String::from_utf8(file.data().to_vec()).unwrap()); + patched = patch_file(String::from_utf8(file.data().to_vec()).unwrap()); asar_w.write_file(path.as_path(), patched.as_bytes(), false)?; - } else { + } + else + { asar_w.write_file(path.as_path(), file.data(), false)?; } } @@ -153,14 +179,19 @@ fn kill_opgg() { let mut process: Command; - if std::env::consts::OS == "macos" { + if OS == "macos" + { process = Command::new("killall"); process.args(&["-9", "OP.GG"]); - } else if std::env::consts::OS == "windows" { + } + else if OS == "windows" + { // const CREATE_NO_WINDOW = 0x08000000; process = Command::new("taskkill"); process.args(&["/im", "OP.GG.exe", "/F"]); - } else { + } + else + { return; } @@ -177,15 +208,20 @@ fn format_asar_path() -> Result { let path: PathBuf; println!("format_asar_path: determining platform."); - if std::env::consts::OS == "macos" { + if OS == "macos" { path = PathBuf::from("/Applications/OP.GG.app/Contents/Resources/app.asar"); - } else if std::env::consts::OS == "windows" { - let appdata = match std::env::var("LOCALAPPDATA") { + } + else if OS == "windows" { + let appdata: String; + + appdata = match std::env::var("LOCALAPPDATA") { Ok(v) => v, Err(e) => return Err(format!("format_asar_path: {e}")), }; + path = PathBuf::from(appdata).join("Programs/OP.GG/resources/app.asar"); - } else { + } + else { return Err("format_asar_path: Platform not compatible.".to_string()); } @@ -201,7 +237,9 @@ fn format_asar_path() -> Result { /// * Success - returns `true` /// * Failure - returns a String containing the error pub fn remove_ads() -> Result { - let path: PathBuf = match format_asar_path() { + let path: PathBuf; + + path = match format_asar_path() { Ok(path) => path, Err(e) => return Err(e), };