diff --git a/Cargo.lock b/Cargo.lock index 2f7d55d27..e858a1833 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -663,7 +663,7 @@ dependencies = [ "cocoa-foundation 0.1.2", "core-foundation 0.9.4", "core-graphics 0.23.2", - "foreign-types", + "foreign-types 0.5.0", "libc", "objc", ] @@ -679,7 +679,7 @@ dependencies = [ "cocoa-foundation 0.2.0", "core-foundation 0.10.0", "core-graphics 0.24.0", - "foreign-types", + "foreign-types 0.5.0", "libc", "objc", ] @@ -817,7 +817,7 @@ dependencies = [ "bitflags 1.3.2", "core-foundation 0.9.4", "core-graphics-types 0.1.3", - "foreign-types", + "foreign-types 0.5.0", "libc", ] @@ -830,7 +830,7 @@ dependencies = [ "bitflags 2.6.0", "core-foundation 0.10.0", "core-graphics-types 0.2.0", - "foreign-types", + "foreign-types 0.5.0", "libc", ] @@ -1531,6 +1531,15 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared 0.1.1", +] + [[package]] name = "foreign-types" version = "0.5.0" @@ -1538,7 +1547,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ "foreign-types-macros", - "foreign-types-shared", + "foreign-types-shared 0.3.1", ] [[package]] @@ -1552,6 +1561,12 @@ dependencies = [ "syn 2.0.74", ] +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "foreign-types-shared" version = "0.3.1" @@ -2227,6 +2242,22 @@ dependencies = [ "webpki-roots", ] +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.7" @@ -2841,6 +2872,23 @@ dependencies = [ "winapi", ] +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "ndk" version = "0.9.0" @@ -3221,6 +3269,60 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "openssl" +version = "0.10.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "foreign-types 0.3.2", + "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.74", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-src" +version = "300.3.1+3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" +dependencies = [ + "cc", +] + +[[package]] +name = "openssl-sys" +version = "0.9.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +dependencies = [ + "cc", + "libc", + "openssl-src", + "pkg-config", + "vcpkg", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -4008,11 +4110,13 @@ dependencies = [ "http-body-util", "hyper", "hyper-rustls", + "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -4026,6 +4130,7 @@ dependencies = [ "sync_wrapper", "system-configuration", "tokio", + "tokio-native-tls", "tokio-rustls", "tokio-util", "tower-service", @@ -4220,6 +4325,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "schemars" version = "0.8.21" @@ -4272,6 +4386,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.6.0", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "selectors" version = "0.22.0" @@ -4581,7 +4718,7 @@ dependencies = [ "bytemuck", "cfg_aliases", "core-graphics 0.23.2", - "foreign-types", + "foreign-types 0.5.0", "js-sys", "log", "objc2", @@ -5474,7 +5611,7 @@ dependencies = [ [[package]] name = "theseus" -version = "0.8.3-1" +version = "0.8.3" dependencies = [ "async-recursion", "async-tungstenite", @@ -5525,7 +5662,7 @@ dependencies = [ [[package]] name = "theseus_gui" -version = "0.8.3-1" +version = "0.8.3" dependencies = [ "chrono", "cocoa 0.25.0", @@ -5702,6 +5839,16 @@ dependencies = [ "syn 2.0.74", ] +[[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-rustls" version = "0.26.0" @@ -6882,8 +7029,7 @@ dependencies = [ [[package]] name = "wry" version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b8049c8f239cdbfaaea4bacb9646f6b208938ceec0acd5b3e99cd05f70903f" +source = "git+https://github.com/modrinth/wry?rev=23b0ee4#23b0ee4ea1c1956db7edefac8e4fd710f548c85d" dependencies = [ "base64 0.22.1", "block", diff --git a/Cargo.toml b/Cargo.toml index 94f58399c..a4c663d6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,3 +16,6 @@ strip = true # Remove debug symbols [profile.dev.package.sqlx-macros] opt-level = 3 + +[patch.crates-io] +wry = { git = "https://github.com/modrinth/wry", rev = "23b0ee4" } diff --git a/apps/app-frontend/package.json b/apps/app-frontend/package.json index aa03f4402..4ad3ed451 100644 --- a/apps/app-frontend/package.json +++ b/apps/app-frontend/package.json @@ -1,7 +1,7 @@ { "name": "@modrinth/app-frontend", "private": true, - "version": "0.8.3-1", + "version": "0.8.3", "type": "module", "scripts": { "dev": "vite", diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue index 6f6cd7803..5c62a192a 100644 --- a/apps/app-frontend/src/App.vue +++ b/apps/app-frontend/src/App.vue @@ -31,6 +31,7 @@ import { useInstall } from '@/store/install.js' import { invoke } from '@tauri-apps/api/core' import { open } from '@tauri-apps/plugin-shell' import { get_opening_command, initialize_state } from '@/helpers/state' +import { saveWindowState, StateFlags } from '@tauri-apps/plugin-window-state' const themeStore = useTheming() @@ -126,6 +127,7 @@ initialize_state() }) const handleClose = async () => { + await saveWindowState(StateFlags.ALL) await getCurrentWindow().close() } diff --git a/apps/app-frontend/src/components/ui/PromotionWrapper.vue b/apps/app-frontend/src/components/ui/PromotionWrapper.vue index 80bdcbe79..bd16fb168 100644 --- a/apps/app-frontend/src/components/ui/PromotionWrapper.vue +++ b/apps/app-frontend/src/components/ui/PromotionWrapper.vue @@ -1,12 +1,20 @@ - - + + + 90% of ad revenue goes to creators + + + Support creators and Modrinth ad-free with + Modrinth+ + + + + + diff --git a/apps/app-frontend/src/helpers/ads.js b/apps/app-frontend/src/helpers/ads.js new file mode 100644 index 000000000..e5a0252da --- /dev/null +++ b/apps/app-frontend/src/helpers/ads.js @@ -0,0 +1,9 @@ +import { invoke } from '@tauri-apps/api/core' + +export async function init_ads_window(x, y, width, height) { + return await invoke('plugin:ads|init_ads_window', { x, y, width, height }) +} + +export async function hide_ads_window() { + return await invoke('plugin:ads|hide_ads_window') +} diff --git a/apps/app-frontend/src/pages/Browse.vue b/apps/app-frontend/src/pages/Browse.vue index e9d39327d..ec4ff566d 100644 --- a/apps/app-frontend/src/pages/Browse.vue +++ b/apps/app-frontend/src/pages/Browse.vue @@ -528,7 +528,8 @@ const isModProject = computed(() => ['modpack', 'mod'].includes(projectType.valu -
90% of ad revenue goes to creators