release: v1.7.1 dynamic WFP cleanup and updater polish
This commit is contained in:
parent
05ca194bef
commit
ef36812a8e
11 changed files with 118 additions and 150 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
Tauri v2 · Rust · React · AmneziaWG · SpoofDPI</p>
|
Tauri v2 · Rust · React · AmneziaWG · SpoofDPI</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="https://github.com/L1lDosto/LD-FDPI/releases/latest">
|
<a href="https://github.com/L1lDosto/LD-FDPI/releases/latest">
|
||||||
<img src="https://img.shields.io/badge/İndir-v1.7.0-2ea44f?style=for-the-badge&logo=windows" alt="Download" />
|
<img src="https://img.shields.io/badge/İndir-v1.7.1-2ea44f?style=for-the-badge&logo=windows" alt="Download" />
|
||||||
</a>
|
</a>
|
||||||
<img src="https://img.shields.io/badge/Platform-Windows%2010%20%7C%2011-0078D6?style=for-the-badge&logo=windows" alt="Windows" />
|
<img src="https://img.shields.io/badge/Platform-Windows%2010%20%7C%2011-0078D6?style=for-the-badge&logo=windows" alt="Windows" />
|
||||||
<img src="https://img.shields.io/badge/License-MIT-10B981?style=for-the-badge" alt="MIT" />
|
<img src="https://img.shields.io/badge/License-MIT-10B981?style=for-the-badge" alt="MIT" />
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ def th(token):
|
||||||
|
|
||||||
def rate(c, bucket, limit=5):
|
def rate(c, bucket, limit=5):
|
||||||
now = int(datetime.now(timezone.utc).timestamp())
|
now = int(datetime.now(timezone.utc).timestamp())
|
||||||
|
c.execute("DELETE FROM rate WHERE ts < ?", (now - 600,))
|
||||||
row = c.execute("SELECT ts,count FROM rate WHERE bucket=?", (bucket,)).fetchone()
|
row = c.execute("SELECT ts,count FROM rate WHERE bucket=?", (bucket,)).fetchone()
|
||||||
if not row or now - row[0] > 60:
|
if not row or now - row[0] > 60:
|
||||||
c.execute("INSERT OR REPLACE INTO rate VALUES(?,?,1)", (bucket, now))
|
c.execute("INSERT OR REPLACE INTO rate VALUES(?,?,1)", (bucket, now))
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "ld-fdpi",
|
"name": "ld-fdpi",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.7.0",
|
"version": "1.7.1",
|
||||||
"description": "LD FDPI - zero-touch AmneziaWG VPN and SpoofDPI DPI bypass for Windows (Tauri v2, Rust, React)",
|
"description": "LD FDPI - zero-touch AmneziaWG VPN and SpoofDPI DPI bypass for Windows (Tauri v2, Rust, React)",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -3,20 +3,20 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>LD FDPI — Discord, oyun ve Almanya çıkışı | v1.7.0</title>
|
<title>LD FDPI — Discord, oyun ve Almanya çıkışı | v1.7.1</title>
|
||||||
<meta name="description" content="LD FDPI: Discord ve oyunlarda düşük ping, Almanya çıkışı için AmneziaWG VPN. Token veya .conf yok; kur, BAĞLAN'a bas. DPI bypass, DNS sızıntı koruması, WFP kill-switch ve self-heal.">
|
<meta name="description" content="LD FDPI: Discord ve oyunlarda düşük ping, Almanya çıkışı için AmneziaWG VPN. Token veya .conf yok; kur, BAĞLAN'a bas. DPI bypass, DNS sızıntı koruması, WFP kill-switch ve self-heal.">
|
||||||
<link rel="canonical" href="https://ttmadethat.shop/ld-fdpi">
|
<link rel="canonical" href="https://ttmadethat.shop/ld-fdpi">
|
||||||
<meta property="og:title" content="LD FDPI — Discord, oyun ve Almanya çıkışı">
|
<meta property="og:title" content="LD FDPI — Discord, oyun ve Almanya çıkışı">
|
||||||
<meta property="og:description" content="Kur-çalıştır Windows DPI bypass + AmneziaWG VPN. Token, .conf veya manuel istemci kurulumu yok; cihaz profili ilk bağlantıda otomatik oluşur.">
|
<meta property="og:description" content="Kur-çalıştır Windows DPI bypass + AmneziaWG VPN. Token, .conf veya manuel istemci kurulumu yok; cihaz profili ilk bağlantıda otomatik oluşur.">
|
||||||
<meta property="og:type" content="website">
|
<meta property="og:type" content="website">
|
||||||
<meta property="og:url" content="https://ttmadethat.shop/ld-fdpi">
|
<meta property="og:url" content="https://ttmadethat.shop/ld-fdpi">
|
||||||
<meta property="og:image" content="https://ttmadethat.shop/static/downloads/ld-apps/ld-fdpi-1.7.0-logo.png?v=6d6d7fc">
|
<meta property="og:image" content="https://ttmadethat.shop/static/downloads/ld-apps/ld-fdpi-1.7.1-logo.png?v=63895b0">
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
<meta name="twitter:title" content="LD FDPI — Discord, oyun ve Almanya çıkışı">
|
<meta name="twitter:title" content="LD FDPI — Discord, oyun ve Almanya çıkışı">
|
||||||
<meta name="twitter:description" content="Kur-çalıştır Windows DPI bypass + AmneziaWG VPN. Token/.conf yok.">
|
<meta name="twitter:description" content="Kur-çalıştır Windows DPI bypass + AmneziaWG VPN. Token/.conf yok.">
|
||||||
<meta name="twitter:image" content="https://ttmadethat.shop/static/downloads/ld-apps/ld-fdpi-1.7.0-logo.png?v=6d6d7fc">
|
<meta name="twitter:image" content="https://ttmadethat.shop/static/downloads/ld-apps/ld-fdpi-1.7.1-logo.png?v=63895b0">
|
||||||
<meta name="theme-color" content="#05080b">
|
<meta name="theme-color" content="#05080b">
|
||||||
<link rel="icon" type="image/png" href="/static/downloads/ld-apps/ld-fdpi-1.7.0-logo.png?v=6d6d7fc">
|
<link rel="icon" type="image/png" href="/static/downloads/ld-apps/ld-fdpi-1.7.1-logo.png?v=63895b0">
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--bg: #05080b;
|
--bg: #05080b;
|
||||||
|
|
@ -226,7 +226,7 @@
|
||||||
<header class="nav">
|
<header class="nav">
|
||||||
<div class="wrap nav-in">
|
<div class="wrap nav-in">
|
||||||
<a class="brand" href="/">
|
<a class="brand" href="/">
|
||||||
<img src="/static/downloads/ld-apps/ld-fdpi-1.7.0-logo.png?v=6d6d7fc" alt="LD FDPI">
|
<img src="/static/downloads/ld-apps/ld-fdpi-1.7.1-logo.png?v=63895b0" alt="LD FDPI">
|
||||||
<span>LD FDPI<small>ttmadethat.shop / apps</small></span>
|
<span>LD FDPI<small>ttmadethat.shop / apps</small></span>
|
||||||
</a>
|
</a>
|
||||||
<nav class="nav-links" aria-label="Sayfa gezinmesi">
|
<nav class="nav-links" aria-label="Sayfa gezinmesi">
|
||||||
|
|
@ -234,7 +234,7 @@
|
||||||
<a href="#features">Özellikler</a>
|
<a href="#features">Özellikler</a>
|
||||||
<a href="#security">Güvenlik</a>
|
<a href="#security">Güvenlik</a>
|
||||||
<a href="#install">Kurulum</a>
|
<a href="#install">Kurulum</a>
|
||||||
<a class="btn btn-primary" href="/static/downloads/ld-apps/LD-FDPI_1.7.0_6d6d7fc_x64-setup.exe?v=6d6d7fc" download>İndir · v1.7.0</a>
|
<a class="btn btn-primary" href="/static/downloads/ld-apps/LD-FDPI_1.7.1_63895b0_x64-setup.exe?v=63895b0" download>İndir · v1.7.1</a>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
@ -246,11 +246,11 @@
|
||||||
<h1>Discord açık.<br><span>Ping düşük.</span></h1>
|
<h1>Discord açık.<br><span>Ping düşük.</span></h1>
|
||||||
<p class="lead">DPI engelini tek tıkla geç; Discord, Kick ve tarayıcı çalışsın. Oyun trafiğin doğrudan kalsın, ping'in şişmesin. İstersen Almanya çıkışına geç, farklı kataloglara bak.</p>
|
<p class="lead">DPI engelini tek tıkla geç; Discord, Kick ve tarayıcı çalışsın. Oyun trafiğin doğrudan kalsın, ping'in şişmesin. İstersen Almanya çıkışına geç, farklı kataloglara bak.</p>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<a class="btn btn-primary" href="/static/downloads/ld-apps/LD-FDPI_1.7.0_6d6d7fc_x64-setup.exe?v=6d6d7fc" download>Windows için indir</a>
|
<a class="btn btn-primary" href="/static/downloads/ld-apps/LD-FDPI_1.7.1_63895b0_x64-setup.exe?v=63895b0" download>Windows için indir</a>
|
||||||
<a class="btn btn-ghost" href="#use-cases">Hangi mod bana uygun?</a>
|
<a class="btn btn-ghost" href="#use-cases">Hangi mod bana uygun?</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
<span class="chip live">v1.7.0</span>
|
<span class="chip live">v1.7.1</span>
|
||||||
<span class="chip">Kurulum ~1 dk</span>
|
<span class="chip">Kurulum ~1 dk</span>
|
||||||
<span class="chip">Reklamsız</span>
|
<span class="chip">Reklamsız</span>
|
||||||
<span class="chip">SpoofDPI 0.12.2</span>
|
<span class="chip">SpoofDPI 0.12.2</span>
|
||||||
|
|
@ -387,14 +387,14 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="download-card reveal">
|
<div class="download-card reveal">
|
||||||
<div class="kicker">İndir</div>
|
<div class="kicker">İndir</div>
|
||||||
<div class="big">LD FDPI v1.7.0</div>
|
<div class="big">LD FDPI v1.7.1</div>
|
||||||
<p class="muted" style="font-size:11px;margin:4px 0 14px">NSIS kurulum · Windows 10/11 x64 · yaklaşık 7.5 MB</p>
|
<p class="muted" style="font-size:11px;margin:4px 0 14px">NSIS kurulum · Windows 10/11 x64 · yaklaşık 7.5 MB</p>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<a class="btn btn-primary" href="/static/downloads/ld-apps/LD-FDPI_1.7.0_6d6d7fc_x64-setup.exe?v=6d6d7fc" download>Setup indir</a>
|
<a class="btn btn-primary" href="/static/downloads/ld-apps/LD-FDPI_1.7.1_63895b0_x64-setup.exe?v=63895b0" download>Setup indir</a>
|
||||||
<a class="btn btn-ghost" href="/static/downloads/ld-apps/LD-FDPI_1.7.0_6d6d7fc-source.zip?v=6d6d7fc" download>Kaynak ZIP</a>
|
<a class="btn btn-ghost" href="/static/downloads/ld-apps/LD-FDPI_1.7.1_63895b0-source.zip?v=63895b0" download>Kaynak ZIP</a>
|
||||||
<a class="btn btn-ghost" href="/static/downloads/ld-apps/readmes/ld-fdpi-v1.7.0_6d6d7fc-README.md?v=6d6d7fc" target="_blank" rel="noopener">README</a>
|
<a class="btn btn-ghost" href="/static/downloads/ld-apps/readmes/ld-fdpi-v1.7.1_63895b0-README.md?v=63895b0" target="_blank" rel="noopener">README</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="hash">SHA-256 · 6D6D7FC9DA84E92D53FFD9E84E38EF36A5AF0CE518F063B47F1582F88070AB09</div>
|
<div class="hash">SHA-256 · 63895B0B84C27BE6B9763BE3F91BCCBBC29F25EEF5C42721DCE55B173E187135</div>
|
||||||
<div class="notice"><b>Not:</b> Kod imzası yoktur; SmartScreen “bilinmeyen yayıncı” uyarısı verebilir. Aktivasyon kodu gerekmez.</div>
|
<div class="notice"><b>Not:</b> Kod imzası yoktur; SmartScreen “bilinmeyen yayıncı” uyarısı verebilir. Aktivasyon kodu gerekmez.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -421,7 +421,7 @@
|
||||||
<section>
|
<section>
|
||||||
<div class="cta reveal">
|
<div class="cta reveal">
|
||||||
<div><div class="kicker">Hazır mısın?</div><h2>Discord açık, ping düşük.</h2><p>Windows için indir; kur, bağlan, işine dön. İstersen Almanya çıkışına geç.</p></div>
|
<div><div class="kicker">Hazır mısın?</div><h2>Discord açık, ping düşük.</h2><p>Windows için indir; kur, bağlan, işine dön. İstersen Almanya çıkışına geç.</p></div>
|
||||||
<div class="actions"><a class="btn btn-primary" href="/static/downloads/ld-apps/LD-FDPI_1.7.0_6d6d7fc_x64-setup.exe?v=6d6d7fc" download>Setup indir</a><a class="btn btn-ghost" href="/#ldapps">Tüm uygulamalar</a></div>
|
<div class="actions"><a class="btn btn-primary" href="/static/downloads/ld-apps/LD-FDPI_1.7.1_63895b0_x64-setup.exe?v=63895b0" download>Setup indir</a><a class="btn btn-ghost" href="/#ldapps">Tüm uygulamalar</a></div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
||||||
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
|
|
@ -2112,7 +2112,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ld-fdpi"
|
name = "ld-fdpi"
|
||||||
version = "1.7.0"
|
version = "1.7.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"local-ip-address",
|
"local-ip-address",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ld-fdpi"
|
name = "ld-fdpi"
|
||||||
version = "1.7.0"
|
version = "1.7.1"
|
||||||
description = "LD FDPI  Zor ağlar için yerel proxy ve DPI bypass aracı (Rust, Tauri v2, SpoofDPI 0.12.2)"
|
description = "LD FDPI  Zor ağlar için yerel proxy ve DPI bypass aracı (Rust, Tauri v2, SpoofDPI 0.12.2)"
|
||||||
authors = ["LD FDPI Team"]
|
authors = ["LD FDPI Team"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,8 @@ fn panic_cleanup(info: &std::panic::PanicHookInfo<'_>) {
|
||||||
|
|
||||||
// Restores WinINet, WinHTTP (if we changed it) and clears the dirty sentinel.
|
// Restores WinINet, WinHTTP (if we changed it) and clears the dirty sentinel.
|
||||||
let _ = proxy_sentinel::restore_system_proxy(true);
|
let _ = proxy_sentinel::restore_system_proxy(true);
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
let _ = wfp_killswitch::disable_fdpi_quic_block();
|
||||||
// Restore an MTU left behind by a crash/panic.
|
// Restore an MTU left behind by a crash/panic.
|
||||||
let _ = eduroam::restore_from_backup();
|
let _ = eduroam::restore_from_backup();
|
||||||
|
|
||||||
|
|
@ -513,6 +515,8 @@ fn shutdown_all(app: &AppHandle) {
|
||||||
// Restore a crash-safe MTU backup even if this instance did not apply it.
|
// Restore a crash-safe MTU backup even if this instance did not apply it.
|
||||||
let _ = eduroam::restore_from_backup();
|
let _ = eduroam::restore_from_backup();
|
||||||
let _ = proxy_sentinel::restore_system_proxy(false);
|
let _ = proxy_sentinel::restore_system_proxy(false);
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
let _ = wfp_killswitch::disable_fdpi_quic_block();
|
||||||
vpn::shutdown();
|
vpn::shutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -691,11 +695,13 @@ fn do_start(
|
||||||
}
|
}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
result = Err(error);
|
result = Err(error);
|
||||||
|
let _ = wait_for_port_release(profile_cfg.proxy_port, profile_cfg.lan_sharing, Duration::from_secs(3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let mut result = result;
|
let mut result = result;
|
||||||
if chosen_profile.is_none() {
|
if chosen_profile.is_none() {
|
||||||
|
let _ = wait_for_port_release(cfg.proxy_port, cfg.lan_sharing, Duration::from_secs(3));
|
||||||
// Never leave the user without a working local proxy. The last resort
|
// Never leave the user without a working local proxy. The last resort
|
||||||
// starts the base profile even if Discord TLS verification failed; the
|
// starts the base profile even if Discord TLS verification failed; the
|
||||||
// UI receives an explicit warning and the engine stays available.
|
// UI receives an explicit warning and the engine stays available.
|
||||||
|
|
@ -779,6 +785,22 @@ fn strategy_cfg(base: &EngineConfig, profile: u8) -> EngineConfig {
|
||||||
cfg
|
cfg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn wait_for_port_release(port: u16, lan: bool, timeout: Duration) -> bool {
|
||||||
|
let deadline = Instant::now() + timeout;
|
||||||
|
let mut ticks = 0u32;
|
||||||
|
while Instant::now() < deadline {
|
||||||
|
if engine::port_is_free(port, lan) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if ticks == 0 || ticks % 4 == 0 {
|
||||||
|
engine::hunt_zombie_processes();
|
||||||
|
}
|
||||||
|
ticks += 1;
|
||||||
|
std::thread::sleep(Duration::from_millis(150));
|
||||||
|
}
|
||||||
|
engine::port_is_free(port, lan)
|
||||||
|
}
|
||||||
|
|
||||||
fn do_start_inner(
|
fn do_start_inner(
|
||||||
inner: &Arc<Mutex<Runtime>>,
|
inner: &Arc<Mutex<Runtime>>,
|
||||||
cfg: &EngineConfig,
|
cfg: &EngineConfig,
|
||||||
|
|
@ -1411,12 +1433,6 @@ fn open_wifi_settings() -> Result<(), String> {
|
||||||
eduroam::open_wifi_settings()
|
eduroam::open_wifi_settings()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
|
||||||
async fn check_update() -> Result<Option<updater::UpdateInfo>, String> {
|
|
||||||
tauri::async_runtime::spawn_blocking(updater::check)
|
|
||||||
.await
|
|
||||||
.map_err(|e| format!("Güncelleme kontrolü çöktü: {e}"))?
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
fn open_download_page() -> Result<(), String> {
|
fn open_download_page() -> Result<(), String> {
|
||||||
|
|
@ -2432,7 +2448,6 @@ pub fn run() {
|
||||||
get_eduroam_status,
|
get_eduroam_status,
|
||||||
connect_eduroam_wifi,
|
connect_eduroam_wifi,
|
||||||
open_wifi_settings,
|
open_wifi_settings,
|
||||||
check_update,
|
|
||||||
open_download_page,
|
open_download_page,
|
||||||
prepare_for_update,
|
prepare_for_update,
|
||||||
restart_app,
|
restart_app,
|
||||||
|
|
@ -2493,6 +2508,8 @@ pub fn wfp_enable() -> i32 {
|
||||||
pub fn restore_only() -> i32 {
|
pub fn restore_only() -> i32 {
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
let _ = wfp_killswitch::disable_killswitch();
|
let _ = wfp_killswitch::disable_killswitch();
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
let _ = wfp_killswitch::disable_fdpi_quic_block();
|
||||||
vpn::shutdown();
|
vpn::shutdown();
|
||||||
let killed = engine::hunt_zombie_processes();
|
let killed = engine::hunt_zombie_processes();
|
||||||
let _ = eduroam::restore_from_backup();
|
let _ = eduroam::restore_from_backup();
|
||||||
|
|
|
||||||
|
|
@ -1,114 +1,7 @@
|
||||||
use serde::{Deserialize, Serialize};
|
//! Helpers for the signed Tauri updater UI.
|
||||||
|
|
||||||
const VERSION_URL_HOST: &str = "ttmadethat.shop";
|
|
||||||
const VERSION_URL_PATH: &str = "/ld-fdpi/version.json";
|
|
||||||
pub const DOWNLOAD_PAGE: &str = "https://ttmadethat.shop/ld-fdpi";
|
pub const DOWNLOAD_PAGE: &str = "https://ttmadethat.shop/ld-fdpi";
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
|
||||||
pub struct UpdateInfo {
|
|
||||||
pub current_version: String,
|
|
||||||
pub latest_version: String,
|
|
||||||
pub notes: String,
|
|
||||||
pub page_url: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
|
||||||
struct VersionFile {
|
|
||||||
version: String,
|
|
||||||
#[serde(default)]
|
|
||||||
notes: String,
|
|
||||||
#[serde(default)]
|
|
||||||
page_url: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn parse_version(value: &str) -> Vec<u64> {
|
|
||||||
value
|
|
||||||
.trim()
|
|
||||||
.trim_start_matches('v')
|
|
||||||
.split('.')
|
|
||||||
.map(|part| {
|
|
||||||
part.chars()
|
|
||||||
.take_while(|c| c.is_ascii_digit())
|
|
||||||
.collect::<String>()
|
|
||||||
.parse::<u64>()
|
|
||||||
.unwrap_or(0)
|
|
||||||
})
|
|
||||||
.collect()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn is_newer(latest: &str, current: &str) -> bool {
|
|
||||||
let mut left = parse_version(latest);
|
|
||||||
let mut right = parse_version(current);
|
|
||||||
while left.len() < 3 {
|
|
||||||
left.push(0);
|
|
||||||
}
|
|
||||||
while right.len() < 3 {
|
|
||||||
right.push(0);
|
|
||||||
}
|
|
||||||
left > right
|
|
||||||
}
|
|
||||||
|
|
||||||
fn https_get(path: &str) -> Result<String, String> {
|
|
||||||
use native_tls::TlsConnector;
|
|
||||||
use std::io::{Read, Write};
|
|
||||||
use std::net::{TcpStream, ToSocketAddrs};
|
|
||||||
|
|
||||||
let addresses: Vec<_> = (VERSION_URL_HOST, 443)
|
|
||||||
.to_socket_addrs()
|
|
||||||
.map_err(|e| format!("Güncelleme DNS: {e}"))?
|
|
||||||
.collect();
|
|
||||||
let connector = TlsConnector::new().map_err(|e| e.to_string())?;
|
|
||||||
for address in addresses {
|
|
||||||
let Ok(stream) = TcpStream::connect_timeout(&address, std::time::Duration::from_secs(5))
|
|
||||||
else {
|
|
||||||
continue;
|
|
||||||
};
|
|
||||||
let _ = stream.set_read_timeout(Some(std::time::Duration::from_secs(6)));
|
|
||||||
let _ = stream.set_write_timeout(Some(std::time::Duration::from_secs(6)));
|
|
||||||
let Ok(mut tls) = connector.connect(VERSION_URL_HOST, stream) else {
|
|
||||||
continue;
|
|
||||||
};
|
|
||||||
let request = format!(
|
|
||||||
"GET {path} HTTP/1.0\r\nHost: {VERSION_URL_HOST}\r\n\
|
|
||||||
User-Agent: LD-FDPI-Update/1\r\nConnection: close\r\n\r\n"
|
|
||||||
);
|
|
||||||
if tls.write_all(request.as_bytes()).is_err() {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
let mut response = Vec::new();
|
|
||||||
let _ = tls.read_to_end(&mut response);
|
|
||||||
let text = String::from_utf8_lossy(&response);
|
|
||||||
if let Some((head, body)) = text.split_once("\r\n\r\n") {
|
|
||||||
let status_ok = head.lines().next().is_some_and(|line| line.starts_with("HTTP/1.0 200") || line.starts_with("HTTP/1.1 200"));
|
|
||||||
if status_ok {
|
|
||||||
return Ok(body.to_string());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err("Güncelleme sunucusuna ulaşılamadı.".to_string())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn check() -> Result<Option<UpdateInfo>, String> {
|
|
||||||
let body = https_get(VERSION_URL_PATH)?;
|
|
||||||
let remote: VersionFile =
|
|
||||||
serde_json::from_str(&body).map_err(|e| format!("version.json geçersiz: {e}"))?;
|
|
||||||
let current = env!("CARGO_PKG_VERSION").to_string();
|
|
||||||
if !is_newer(&remote.version, ¤t) {
|
|
||||||
return Ok(None);
|
|
||||||
}
|
|
||||||
let page_url = if remote.page_url.starts_with("https://ttmadethat.shop/") {
|
|
||||||
remote.page_url
|
|
||||||
} else {
|
|
||||||
DOWNLOAD_PAGE.to_string()
|
|
||||||
};
|
|
||||||
Ok(Some(UpdateInfo {
|
|
||||||
current_version: current,
|
|
||||||
latest_version: remote.version,
|
|
||||||
notes: remote.notes,
|
|
||||||
page_url,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub fn open_download_page() -> Result<(), String> {
|
pub fn open_download_page() -> Result<(), String> {
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
|
|
@ -120,7 +13,10 @@ pub fn open_download_page() -> Result<(), String> {
|
||||||
.encode_wide()
|
.encode_wide()
|
||||||
.chain(std::iter::once(0))
|
.chain(std::iter::once(0))
|
||||||
.collect();
|
.collect();
|
||||||
let operation: Vec<u16> = OsStr::new("open").encode_wide().chain(std::iter::once(0)).collect();
|
let operation: Vec<u16> = OsStr::new("open")
|
||||||
|
.encode_wide()
|
||||||
|
.chain(std::iter::once(0))
|
||||||
|
.collect();
|
||||||
let result = unsafe {
|
let result = unsafe {
|
||||||
ShellExecuteW(
|
ShellExecuteW(
|
||||||
std::ptr::null_mut(),
|
std::ptr::null_mut(),
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ use std::ffi::OsStr;
|
||||||
use std::net::Ipv4Addr;
|
use std::net::Ipv4Addr;
|
||||||
use std::os::windows::ffi::OsStrExt;
|
use std::os::windows::ffi::OsStrExt;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
|
|
||||||
use windows_sys::core::GUID;
|
use windows_sys::core::GUID;
|
||||||
use windows_sys::Win32::Foundation::{ERROR_BUFFER_OVERFLOW, ERROR_SUCCESS, HANDLE};
|
use windows_sys::Win32::Foundation::{ERROR_BUFFER_OVERFLOW, ERROR_SUCCESS, HANDLE};
|
||||||
|
|
@ -65,6 +66,9 @@ const fn fdpi_filter_guid(seq: u8) -> GUID {
|
||||||
}
|
}
|
||||||
|
|
||||||
const FDPI_MAX_FILTER_SEQ: u8 = 40;
|
const FDPI_MAX_FILTER_SEQ: u8 = 40;
|
||||||
|
const FWPM_SESSION_FLAG_DYNAMIC: u32 = 0x0000_0001;
|
||||||
|
/// Dynamic FDPI WFP session handle. It MUST stay open while filters are in use.
|
||||||
|
static FDPI_ENGINE: AtomicUsize = AtomicUsize::new(0);
|
||||||
|
|
||||||
fn wide_null(s: &str) -> Vec<u16> {
|
fn wide_null(s: &str) -> Vec<u16> {
|
||||||
OsStr::new(s)
|
OsStr::new(s)
|
||||||
|
|
@ -91,12 +95,20 @@ impl Drop for EngineHandle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn open_engine() -> Result<EngineHandle, String> {
|
impl EngineHandle {
|
||||||
|
fn into_raw(self) -> usize {
|
||||||
|
let raw = self.0 as usize;
|
||||||
|
std::mem::forget(self);
|
||||||
|
raw
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn open_engine_with(flags: u32) -> Result<EngineHandle, String> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut session_name = wide_null("LD-FDPI Persistent WFP Manager");
|
let mut session_name = wide_null("LD-FDPI Persistent WFP Manager");
|
||||||
let mut session: FWPM_SESSION0 = std::mem::zeroed();
|
let mut session: FWPM_SESSION0 = std::mem::zeroed();
|
||||||
session.displayData.name = session_name.as_mut_ptr();
|
session.displayData.name = session_name.as_mut_ptr();
|
||||||
session.flags = 0; // non-dynamic; persistent filters survive GUI exit
|
session.flags = flags;
|
||||||
session.txnWaitTimeoutInMSec = 5_000;
|
session.txnWaitTimeoutInMSec = 5_000;
|
||||||
|
|
||||||
let mut handle: HANDLE = ptr::null_mut();
|
let mut handle: HANDLE = ptr::null_mut();
|
||||||
|
|
@ -108,6 +120,14 @@ fn open_engine() -> Result<EngineHandle, String> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn open_engine() -> Result<EngineHandle, String> {
|
||||||
|
open_engine_with(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn open_dynamic_engine() -> Result<EngineHandle, String> {
|
||||||
|
open_engine_with(FWPM_SESSION_FLAG_DYNAMIC)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn find_tunnel_luid(adapter_hint: &str) -> Result<u64, String> {
|
pub fn find_tunnel_luid(adapter_hint: &str) -> Result<u64, String> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut table: *mut MIB_IF_TABLE2 = ptr::null_mut();
|
let mut table: *mut MIB_IF_TABLE2 = ptr::null_mut();
|
||||||
|
|
@ -758,7 +778,7 @@ unsafe fn add_fdpi_filter(
|
||||||
filter.layerKey = layer;
|
filter.layerKey = layer;
|
||||||
filter.subLayerKey = FDPI_SUBLAYER_GUID;
|
filter.subLayerKey = FDPI_SUBLAYER_GUID;
|
||||||
filter.displayData.name = name_w.as_mut_ptr();
|
filter.displayData.name = name_w.as_mut_ptr();
|
||||||
filter.flags = WFP_FILTER_FLAG_PERSISTENT;
|
filter.flags = 0;
|
||||||
filter.action.r#type = action;
|
filter.action.r#type = action;
|
||||||
filter.weight.r#type = FWP_UINT64;
|
filter.weight.r#type = FWP_UINT64;
|
||||||
filter.weight.Anonymous.uint64 = &mut weight_value;
|
filter.weight.Anonymous.uint64 = &mut weight_value;
|
||||||
|
|
@ -803,7 +823,7 @@ unsafe fn add_fdpi_port_block(
|
||||||
/// No global UDP/443 rule is created. Returns the number of apps covered.
|
/// No global UDP/443 rule is created. Returns the number of apps covered.
|
||||||
pub fn enable_fdpi_quic_block() -> Result<usize, String> {
|
pub fn enable_fdpi_quic_block() -> Result<usize, String> {
|
||||||
let _ = disable_fdpi_quic_block();
|
let _ = disable_fdpi_quic_block();
|
||||||
let engine = open_engine()?;
|
let engine = open_dynamic_engine()?;
|
||||||
let apps = fdpi_app_candidates();
|
let apps = fdpi_app_candidates();
|
||||||
if apps.is_empty() {
|
if apps.is_empty() {
|
||||||
return Ok(0);
|
return Ok(0);
|
||||||
|
|
@ -831,7 +851,7 @@ pub fn enable_fdpi_quic_block() -> Result<usize, String> {
|
||||||
let mut sublayer: FWPM_SUBLAYER0 = std::mem::zeroed();
|
let mut sublayer: FWPM_SUBLAYER0 = std::mem::zeroed();
|
||||||
sublayer.subLayerKey = FDPI_SUBLAYER_GUID;
|
sublayer.subLayerKey = FDPI_SUBLAYER_GUID;
|
||||||
sublayer.displayData.name = name.as_mut_ptr();
|
sublayer.displayData.name = name.as_mut_ptr();
|
||||||
sublayer.flags = WFP_SUBLAYER_FLAG_PERSISTENT;
|
sublayer.flags = 0;
|
||||||
sublayer.weight = 0xFE00;
|
sublayer.weight = 0xFE00;
|
||||||
let res = FwpmSubLayerAdd0(engine.0, &sublayer, ptr::null_mut());
|
let res = FwpmSubLayerAdd0(engine.0, &sublayer, ptr::null_mut());
|
||||||
if res != ERROR_SUCCESS {
|
if res != ERROR_SUCCESS {
|
||||||
|
|
@ -907,13 +927,24 @@ pub fn enable_fdpi_quic_block() -> Result<usize, String> {
|
||||||
let mut ptr_value = blob as *mut std::ffi::c_void;
|
let mut ptr_value = blob as *mut std::ffi::c_void;
|
||||||
let _ = FwpmFreeMemory0(&mut ptr_value as *mut *mut _ as *mut *mut std::ffi::c_void);
|
let _ = FwpmFreeMemory0(&mut ptr_value as *mut *mut _ as *mut *mut std::ffi::c_void);
|
||||||
}
|
}
|
||||||
|
// Keep the dynamic session handle open. Windows removes every filter
|
||||||
|
// automatically when this process exits or the handle is closed.
|
||||||
|
FDPI_ENGINE.store(engine.into_raw(), Ordering::SeqCst);
|
||||||
}
|
}
|
||||||
Ok(apps.len())
|
Ok(apps.len())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes only the FDPI QUIC sublayer/filters, never the VPN kill-switch.
|
/// Removes only the FDPI QUIC sublayer/filters, never the VPN kill-switch.
|
||||||
pub fn disable_fdpi_quic_block() -> Result<(), String> {
|
pub fn disable_fdpi_quic_block() -> Result<(), String> {
|
||||||
let engine = open_engine()?;
|
let raw = FDPI_ENGINE.swap(0, Ordering::SeqCst);
|
||||||
|
// A live dynamic session handle is authoritative. If it is zero (startup,
|
||||||
|
// legacy v1.7.0 persistent filters), open a normal engine for migration
|
||||||
|
// cleanup.
|
||||||
|
let engine = if raw != 0 {
|
||||||
|
EngineHandle(raw as HANDLE)
|
||||||
|
} else {
|
||||||
|
open_engine()?
|
||||||
|
};
|
||||||
unsafe {
|
unsafe {
|
||||||
let status = FwpmTransactionBegin0(engine.0, 0);
|
let status = FwpmTransactionBegin0(engine.0, 0);
|
||||||
if status != ERROR_SUCCESS {
|
if status != ERROR_SUCCESS {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"productName": "LD FDPI",
|
"productName": "LD FDPI",
|
||||||
"version": "1.7.0",
|
"version": "1.7.1",
|
||||||
"identifier": "com.ldfdpi.desktop",
|
"identifier": "com.ldfdpi.desktop",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "npm run dev",
|
"beforeDevCommand": "npm run dev",
|
||||||
|
|
|
||||||
33
src/App.jsx
33
src/App.jsx
|
|
@ -128,7 +128,7 @@ export default function App() {
|
||||||
const [engineVersion, setEngineVersion] = useState(`SpoofDPI ${SPOOFDPI_VERSION}`);
|
const [engineVersion, setEngineVersion] = useState(`SpoofDPI ${SPOOFDPI_VERSION}`);
|
||||||
const [localIp, setLocalIp] = useState("127.0.0.1");
|
const [localIp, setLocalIp] = useState("127.0.0.1");
|
||||||
const [isAdmin, setIsAdmin] = useState(false);
|
const [isAdmin, setIsAdmin] = useState(false);
|
||||||
const [appVersion, setAppVersion] = useState("1.7.0");
|
const [appVersion, setAppVersion] = useState("1.7.1");
|
||||||
const [updateInfo, setUpdateInfo] = useState(null);
|
const [updateInfo, setUpdateInfo] = useState(null);
|
||||||
const [updateBusy, setUpdateBusy] = useState(false);
|
const [updateBusy, setUpdateBusy] = useState(false);
|
||||||
const [updateError, setUpdateError] = useState(null);
|
const [updateError, setUpdateError] = useState(null);
|
||||||
|
|
@ -368,9 +368,15 @@ export default function App() {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!runtimeReady) return undefined;
|
if (!runtimeReady) return undefined;
|
||||||
let cancelled = false;
|
let cancelled = false;
|
||||||
invokeTauri("check_update")
|
checkTauriUpdate()
|
||||||
.then((info) => {
|
.then((update) => {
|
||||||
if (!cancelled && info) setUpdateInfo(info);
|
if (!cancelled && update) {
|
||||||
|
setUpdateInfo({
|
||||||
|
latest_version: update.version,
|
||||||
|
notes: update.body || "",
|
||||||
|
page_url: "https://ttmadethat.shop/ld-fdpi",
|
||||||
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
return () => {
|
return () => {
|
||||||
|
|
@ -901,12 +907,29 @@ export default function App() {
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="max-w-[130px] shrink-0">
|
<div className="flex items-center gap-2 shrink-0">
|
||||||
|
<span className="px-2 py-1 rounded-lg border border-slate-700/70 bg-slate-900/60 text-[10px] font-mono font-semibold text-slate-300">
|
||||||
|
v{appVersion}
|
||||||
|
</span>
|
||||||
|
{updateInfo && (
|
||||||
|
<button
|
||||||
|
onClick={handleInstallUpdate}
|
||||||
|
disabled={updateBusy}
|
||||||
|
title={updateInfo.notes || "Signed update"}
|
||||||
|
className="px-2.5 py-1 rounded-lg border border-cyan-400/40 bg-cyan-500/15 text-[10px] font-semibold text-cyan-100 hover:bg-cyan-500/25 disabled:opacity-50"
|
||||||
|
>
|
||||||
|
{updateBusy
|
||||||
|
? lang === "tr" ? "Güncelleniyor..." : "Updating..."
|
||||||
|
: `${lang === "tr" ? "Yeni Sürüm" : "New"} v${updateInfo.latest_version} · ${lang === "tr" ? "Güncelle" : "Update"}`}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
<div className="max-w-[130px]">
|
||||||
<Pill tone={statusTone}>
|
<Pill tone={statusTone}>
|
||||||
<span className="w-1.5 h-1.5 rounded-full bg-current shrink-0" />
|
<span className="w-1.5 h-1.5 rounded-full bg-current shrink-0" />
|
||||||
<span className="truncate">{statusTitle}</span>
|
<span className="truncate">{statusTitle}</span>
|
||||||
</Pill>
|
</Pill>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div className="flex-1 overflow-y-auto p-4 space-y-4">
|
<div className="flex-1 overflow-y-auto p-4 space-y-4">
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue