From 23be2749f7bb9f654feb23a20ab94b01ccf04da5 Mon Sep 17 00:00:00 2001 From: Mark Puha Date: Fri, 20 Jun 2025 19:09:22 +0200 Subject: [PATCH] feat: android/ios & fix qml --- .../vpn/protocol/wireguard/Wireguard.kt | 9 ++ .../vpn/protocol/wireguard/WireguardConfig.kt | 18 +++ client/platforms/ios/WGConfig.swift | 16 ++- client/translations/amneziavpn_ar_EG.ts | 105 +++----------- client/translations/amneziavpn_fa_IR.ts | 127 ++--------------- client/translations/amneziavpn_hi_IN.ts | 123 ++--------------- client/translations/amneziavpn_my_MM.ts | 105 +++----------- client/translations/amneziavpn_ru_RU.ts | 105 +++----------- client/translations/amneziavpn_uk_UA.ts | 123 ++--------------- client/translations/amneziavpn_ur_PK.ts | 123 ++--------------- client/translations/amneziavpn_zh_CN.ts | 129 ++---------------- client/ui/models/protocols/awgConfigModel.cpp | 42 +++--- client/ui/models/protocols/awgConfigModel.h | 12 +- .../ui/qml/Pages2/PageProtocolAwgSettings.qml | 86 ++++++------ 14 files changed, 227 insertions(+), 896 deletions(-) diff --git a/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/Wireguard.kt b/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/Wireguard.kt index 80cab96d..32f15908 100644 --- a/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/Wireguard.kt +++ b/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/Wireguard.kt @@ -124,6 +124,15 @@ open class Wireguard : Protocol() { configData.optStringOrNull("H2")?.let { setH2(it.toLong()) } configData.optStringOrNull("H3")?.let { setH3(it.toLong()) } configData.optStringOrNull("H4")?.let { setH4(it.toLong()) } + configData.optStringOrNull("I1")?.let { setI1(it.toString()) } + configData.optStringOrNull("I2")?.let { setI2(it.toString()) } + configData.optStringOrNull("I3")?.let { setI3(it.toString()) } + configData.optStringOrNull("I4")?.let { setI4(it.toString()) } + configData.optStringOrNull("I5")?.let { setI5(it.toString()) } + configData.optStringOrNull("J1")?.let { setJ1(it.toString()) } + configData.optStringOrNull("J2")?.let { setJ2(it.toString()) } + configData.optStringOrNull("J3")?.let { setJ3(it.toString()) } + configData.optStringOrNull("Itime")?.let { setItime(it.Int()) } } private fun start(config: WireguardConfig, vpnBuilder: Builder, protect: (Int) -> Boolean) { diff --git a/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/WireguardConfig.kt b/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/WireguardConfig.kt index 7ae3d43b..65dfb34e 100644 --- a/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/WireguardConfig.kt +++ b/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/WireguardConfig.kt @@ -121,6 +121,15 @@ open class WireguardConfig protected constructor( internal var h2: Long? = null internal var h3: Long? = null internal var h4: Long? = null + internal var i1: String? = null + internal var i2: String? = null + internal var i3: String? = null + internal var i4: String? = null + internal var i5: String? = null + internal var j1: String? = null + internal var j2: String? = null + internal var j3: String? = null + internal var itime: Int? = null fun setEndpoint(endpoint: InetEndpoint) = apply { this.endpoint = endpoint } @@ -143,6 +152,15 @@ open class WireguardConfig protected constructor( fun setH2(h2: Long) = apply { this.h2 = h2 } fun setH3(h3: Long) = apply { this.h3 = h3 } fun setH4(h4: Long) = apply { this.h4 = h4 } + fun setI1(i1: String) = apply { this.i1 = i1 } + fun setI2(i2: String) = apply { this.i2 = i2 } + fun setI3(i3: String) = apply { this.i3 = i3 } + fun setI4(i4: String) = apply { this.i4 = i4 } + fun setI5(i5: String) = apply { this.i5 = i5 } + fun setJ1(j1: String) = apply { this.j1 = j1 } + fun setJ2(j2: String) = apply { this.j2 = j2 } + fun setJ3(j3: String) = apply { this.j3 = j3 } + fun setItime(itime: Int) = apply { this.itime = itime } override fun build(): WireguardConfig = configBuild().run { WireguardConfig(this@Builder) } } diff --git a/client/platforms/ios/WGConfig.swift b/client/platforms/ios/WGConfig.swift index e3b67efe..0146950d 100644 --- a/client/platforms/ios/WGConfig.swift +++ b/client/platforms/ios/WGConfig.swift @@ -5,6 +5,9 @@ struct WGConfig: Decodable { let underloadPacketMagicHeader, transportPacketMagicHeader: String? let junkPacketCount, junkPacketMinSize, junkPacketMaxSize: String? let initPacketJunkSize, responsePacketJunkSize: String? + let specialJunk1, specialJunk2, specialJunk3, specialJunk4, specialJunk5: String? + let controlledJunk1, controlledJunk2, controlledJunk3: String? + let specialHandshakeTimeout: String? let dns1: String let dns2: String let mtu: String @@ -24,6 +27,9 @@ struct WGConfig: Decodable { case underloadPacketMagicHeader = "H3", transportPacketMagicHeader = "H4" case junkPacketCount = "Jc", junkPacketMinSize = "Jmin", junkPacketMaxSize = "Jmax" case initPacketJunkSize = "S1", responsePacketJunkSize = "S2" + case specialJunk1 = "I1", specialJunk2 = "I2", specialJunk3 = "I3", specialJunk4 = "I4", specialJunk5 = "I5" + case controlledJunk1 = "J1", controlledJunk2 = "J2", controlledJunk3 = "J3" + case specialHandshakeTimeout = "Itime" case dns1 case dns2 case mtu @@ -51,7 +57,15 @@ struct WGConfig: Decodable { H2 = \(responsePacketMagicHeader!) H3 = \(underloadPacketMagicHeader!) H4 = \(transportPacketMagicHeader!) - + I1 = \(specialJunk1!) + I2 = \(specialJunk2!) + I3 = \(specialJunk3!) + I4 = \(specialJunk4!) + I5 = \(specialJunk5!) + J1 = \(controlledJunk1!) + J2 = \(controlledJunk2!) + J3 = \(controlledJunk3!) + Itime = \(specialHandshakeTimeout!) """ } diff --git a/client/translations/amneziavpn_ar_EG.ts b/client/translations/amneziavpn_ar_EG.ts index ba246090..02a08c96 100644 --- a/client/translations/amneziavpn_ar_EG.ts +++ b/client/translations/amneziavpn_ar_EG.ts @@ -797,149 +797,84 @@ Thank you for staying with us! PageProtocolAwgSettings - AmneziaWG settings - اعدادات AmneziaWG + اعدادات AmneziaWG - Port - منفذ + منفذ - All users with whom you shared a connection with will no longer be able to connect to it. - جميع المستخدمين الذين شاركت معهم اتصال لن يكونو قادرين علي الاتصال مرة اخري. + جميع المستخدمين الذين شاركت معهم اتصال لن يكونو قادرين علي الاتصال مرة اخري. - Save - احفظ + احفظ - VPN address subnet - الشبكة الفرعية لعنوان VPN + الشبكة الفرعية لعنوان VPN - Jc - Junk packet count - Jc - عدد الحزم غير المرغوب فيها + Jc - عدد الحزم غير المرغوب فيها - Jmin - Junk packet minimum size - Jmin - الحجم الادني للحزم الغير مرغوب فيها + Jmin - الحجم الادني للحزم الغير مرغوب فيها - Jmax - Junk packet maximum size - Jmax - الحجم الاقصي للحزم الغير مرغوب فيها + Jmax - الحجم الاقصي للحزم الغير مرغوب فيها - S1 - Init packet junk size - S1 - حجم حزمة البيانات العشوائية الأولية + S1 - حجم حزمة البيانات العشوائية الأولية - S2 - Response packet junk size - S2 - حجم حزمة الاستجابة غير المرغوب فيها + S2 - حجم حزمة الاستجابة غير المرغوب فيها - H1 - Init packet magic header - H1 - حزمة رأس سحرية مبدئية + H1 - حزمة رأس سحرية مبدئية - H2 - Response packet magic header - H2 - رأس حزمة الاستجابة السحرية + H2 - رأس حزمة الاستجابة السحرية - H4 - Transport packet magic header - H4 - رأس حزمة النقل السحرية + H4 - رأس حزمة النقل السحرية - H3 - Underload packet magic header - H3 - رأس حزمة السحر غير المحمل + H3 - رأس حزمة السحر غير المحمل - - I1 - First special junk packet - - - - - I2 - Second special junk packet - - - - - I3 - Third special junk packet - - - - - I4 - Fourth special junk packet - - - - - I5 - Fifth special junk packet - - - - - J1 - First controlled junk packet - - - - - J2 - Second controlled junk packet - - - - - J3 - Third controlled junk packet - - - - - Itime - Special handshake timeout - - - - The values of the H1-H4 fields must be unique - يجب أن تكون قيم الحقول H1-H4 فريدة + يجب أن تكون قيم الحقول H1-H4 فريدة - The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) - يجب ألا تساوي قيمة الحقل S1 + حجم بدء الرسالة (148) S2 + حجم استجابة الرسالة (92) + يجب ألا تساوي قيمة الحقل S1 + حجم بدء الرسالة (148) S2 + حجم استجابة الرسالة (92) - Save settings? - احفظ الإعدادات؟ + احفظ الإعدادات؟ - Continue - واصل + واصل - Cancel - إلغاء + إلغاء - Unable change settings while there is an active connection - لا يمكن تغيير الإعدادات أثناء وجود اتصال نشط + لا يمكن تغيير الإعدادات أثناء وجود اتصال نشط diff --git a/client/translations/amneziavpn_fa_IR.ts b/client/translations/amneziavpn_fa_IR.ts index 720bbbfa..80bc3a58 100644 --- a/client/translations/amneziavpn_fa_IR.ts +++ b/client/translations/amneziavpn_fa_IR.ts @@ -801,14 +801,12 @@ Thank you for staying with us! PageProtocolAwgSettings - AmneziaWG settings - تنظیمات AmneziaWG + تنظیمات AmneziaWG - Port - پورت + پورت Remove AmneziaWG @@ -819,139 +817,32 @@ Thank you for staying with us! آیا میخواهید AmneziaWG از سرور حذف شود؟ - All users with whom you shared a connection with will no longer be able to connect to it. - همه کاربرانی که با آن‌ها ارتباطی به اشتراک گذاشته‌اید دیگر قادر به اتصال به آن نخواهند بود. + همه کاربرانی که با آن‌ها ارتباطی به اشتراک گذاشته‌اید دیگر قادر به اتصال به آن نخواهند بود. - Save - ذخیره + ذخیره - VPN address subnet - زیرشبکه آدرس VPN + زیرشبکه آدرس VPN - - Jc - Junk packet count - - - - - Jmin - Junk packet minimum size - - - - - Jmax - Junk packet maximum size - - - - - S1 - Init packet junk size - - - - - S2 - Response packet junk size - - - - - H1 - Init packet magic header - - - - - H2 - Response packet magic header - - - - - H4 - Transport packet magic header - - - - - H3 - Underload packet magic header - - - - - I1 - First special junk packet - - - - - I2 - Second special junk packet - - - - - I3 - Third special junk packet - - - - - I4 - Fourth special junk packet - - - - - I5 - Fifth special junk packet - - - - - J1 - First controlled junk packet - - - - - J2 - Second controlled junk packet - - - - - J3 - Third controlled junk packet - - - - - Itime - Special handshake timeout - - - - - The values of the H1-H4 fields must be unique - - - - - The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) - - - - Save settings? - تنظیمات را ذخیره کن? + تنظیمات را ذخیره کن? - Continue - ادامه + ادامه - Cancel - کنسل + کنسل - Unable change settings while there is an active connection - نمی‌توان تنظیمات را تغییر داد در حالی که اتصال فعال است. + نمی‌توان تنظیمات را تغییر داد در حالی که اتصال فعال است. diff --git a/client/translations/amneziavpn_hi_IN.ts b/client/translations/amneziavpn_hi_IN.ts index 045c8704..3e4b1b25 100644 --- a/client/translations/amneziavpn_hi_IN.ts +++ b/client/translations/amneziavpn_hi_IN.ts @@ -765,153 +765,52 @@ Thank you for staying with us! PageProtocolAwgSettings - AmneziaWG settings - Amneziaडब्ल्यूजी सेटिंग्स + Amneziaडब्ल्यूजी सेटिंग्स - VPN address subnet - VPN एड्रेस सबनेट + VPN एड्रेस सबनेट - Port - पोर्ट + पोर्ट MTU एमटीयू - - Jc - Junk packet count - - - - - Jmin - Junk packet minimum size - - - - - Jmax - Junk packet maximum size - - - - - S1 - Init packet junk size - - - - - S2 - Response packet junk size - - - - - H1 - Init packet magic header - - - - - H2 - Response packet magic header - - - - - H4 - Transport packet magic header - - - - - H3 - Underload packet magic header - - - - - I1 - First special junk packet - - - - - I2 - Second special junk packet - - - - - I3 - Third special junk packet - - - - - I4 - Fourth special junk packet - - - - - I5 - Fifth special junk packet - - - - - J1 - First controlled junk packet - - - - - J2 - Second controlled junk packet - - - - - J3 - Third controlled junk packet - - - - - Itime - Special handshake timeout - - - - Save - सहेजें + सहेजें - The values of the H1-H4 fields must be unique - H1-H4 फ़ील्ड का मान अद्वितीय होना चाहिए + H1-H4 फ़ील्ड का मान अद्वितीय होना चाहिए - The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) - फ़ील्ड S1 + संदेश आरंभ आकार (148) का मान S2 + संदेश प्रतिक्रिया आकार (92) के बराबर नहीं होना चाहिए + फ़ील्ड S1 + संदेश आरंभ आकार (148) का मान S2 + संदेश प्रतिक्रिया आकार (92) के बराबर नहीं होना चाहिए - Save settings? - सेटिंग्स सेव करें? + सेटिंग्स सेव करें? - All users with whom you shared a connection with will no longer be able to connect to it. - वे सभी उपयोगकर्ता जिनके साथ आपने कनेक्शन साझा किया था, वे अब इससे कनेक्ट नहीं हो पाएंगे. + वे सभी उपयोगकर्ता जिनके साथ आपने कनेक्शन साझा किया था, वे अब इससे कनेक्ट नहीं हो पाएंगे. - Unable change settings while there is an active connection - सक्रिय कनेक्शन होने पर सेटिंग बदलने में असमर्थ + सक्रिय कनेक्शन होने पर सेटिंग बदलने में असमर्थ - Continue - जारी रखना + जारी रखना - Cancel - रद्द करना + रद्द करना diff --git a/client/translations/amneziavpn_my_MM.ts b/client/translations/amneziavpn_my_MM.ts index 8c8d2e39..87e4c442 100644 --- a/client/translations/amneziavpn_my_MM.ts +++ b/client/translations/amneziavpn_my_MM.ts @@ -797,153 +797,88 @@ Thank you for staying with us! PageProtocolAwgSettings - AmneziaWG settings - AmneziaWG ဆက်တင်များ + AmneziaWG ဆက်တင်များ - Port - Port + Port MTU MTU - All users with whom you shared a connection with will no longer be able to connect to it. - သင်နှင့်အတူချိတ်ဆက်မှုတစ်ခုကို မျှဝေထားသည့် အသုံးပြုသူအားလုံး ချိတ်ဆက်နိုင်တော့မည်မဟုတ်ပါ. + သင်နှင့်အတူချိတ်ဆက်မှုတစ်ခုကို မျှဝေထားသည့် အသုံးပြုသူအားလုံး ချိတ်ဆက်နိုင်တော့မည်မဟုတ်ပါ. - Save - သိမ်းဆည်းမည် + သိမ်းဆည်းမည် - VPN address subnet - VPN လိပ်စာ ကွန်ရက်ခွဲ + VPN လိပ်စာ ကွန်ရက်ခွဲ - Jc - Junk packet count - Jc - Junk packet အရေအတွက် + Jc - Junk packet အရေအတွက် - Jmin - Junk packet minimum size - Jmin - Junk packet အသေးငယ်ဆုံးလက်ခံနိုင်မှုအရွယ်အစား + Jmin - Junk packet အသေးငယ်ဆုံးလက်ခံနိုင်မှုအရွယ်အစား - Jmax - Junk packet maximum size - Jmax - Junk packet အကြီးဆုံးလက်ခံနိုင်မှုအရွယ်အစား + Jmax - Junk packet အကြီးဆုံးလက်ခံနိုင်မှုအရွယ်အစား - S1 - Init packet junk size - S1 - Init packet junk အရွယ်အစား + S1 - Init packet junk အရွယ်အစား - S2 - Response packet junk size - S2 - Response packet junk အရွယ်အစား + S2 - Response packet junk အရွယ်အစား - H1 - Init packet magic header - H1 - Init packet magic header + H1 - Init packet magic header - H2 - Response packet magic header - H2 - Response packet magic header + H2 - Response packet magic header - H4 - Transport packet magic header - H4 - Transport packet magic header + H4 - Transport packet magic header - H3 - Underload packet magic header - H3 - Underload packet magic header + H3 - Underload packet magic header - - I1 - First special junk packet - - - - - I2 - Second special junk packet - - - - - I3 - Third special junk packet - - - - - I4 - Fourth special junk packet - - - - - I5 - Fifth special junk packet - - - - - J1 - First controlled junk packet - - - - - J2 - Second controlled junk packet - - - - - J3 - Third controlled junk packet - - - - - Itime - Special handshake timeout - - - - The values of the H1-H4 fields must be unique - H1-H4 အကွက်များ၏ တန်ဖိုးများသည် အခြားတန်ဖိုးများနှင့်မတူ တမူထူးခြားနေရပါမည် + H1-H4 အကွက်များ၏ တန်ဖိုးများသည် အခြားတန်ဖိုးများနှင့်မတူ တမူထူးခြားနေရပါမည် - The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) - အကွက် S1 + မက်ဆေ့ချ် စတင်ခြင်း အရွယ်အစား (148) ၏ တန်ဖိုးသည် S2 + မက်ဆေ့ချ် တုံ့ပြန်မှု အရွယ်အစား (92) နှင့် မညီမျှရပါ + အကွက် S1 + မက်ဆေ့ချ် စတင်ခြင်း အရွယ်အစား (148) ၏ တန်ဖိုးသည် S2 + မက်ဆေ့ချ် တုံ့ပြန်မှု အရွယ်အစား (92) နှင့် မညီမျှရပါ - Save settings? - ဆက်တင်များကို သိမ်းဆည်းမည်လား? + ဆက်တင်များကို သိမ်းဆည်းမည်လား? - Continue - ဆက်လက်လုပ်ဆောင်မည် + ဆက်လက်လုပ်ဆောင်မည် - Cancel - ပယ်ဖျက်မည် + ပယ်ဖျက်မည် - Unable change settings while there is an active connection - လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ဆက်တင်များကို ပြောင်းလဲ၍မရပါ + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ဆက်တင်များကို ပြောင်းလဲ၍မရပါ diff --git a/client/translations/amneziavpn_ru_RU.ts b/client/translations/amneziavpn_ru_RU.ts index da6eadba..82719dcf 100644 --- a/client/translations/amneziavpn_ru_RU.ts +++ b/client/translations/amneziavpn_ru_RU.ts @@ -733,149 +733,84 @@ Thank you for staying with us! PageProtocolAwgSettings - AmneziaWG settings - Настройки AmneziaWG + Настройки AmneziaWG - Port - Порт + Порт - All users with whom you shared a connection with will no longer be able to connect to it. - Все пользователи, с которыми вы поделились конфигурацией вашего VPN, больше не смогут к нему подключаться. + Все пользователи, с которыми вы поделились конфигурацией вашего VPN, больше не смогут к нему подключаться. - Save - Сохранить + Сохранить - VPN address subnet - Подсеть VPN-адресов + Подсеть VPN-адресов - Jc - Junk packet count - Jc - Junk packet count + Jc - Junk packet count - Jmin - Junk packet minimum size - Jmin - Junk packet minimum size + Jmin - Junk packet minimum size - Jmax - Junk packet maximum size - Jmax - Junk packet maximum size + Jmax - Junk packet maximum size - S1 - Init packet junk size - S1 - Init packet junk size + S1 - Init packet junk size - S2 - Response packet junk size - S2 - Response packet junk size + S2 - Response packet junk size - H1 - Init packet magic header - H1 - Init packet magic header + H1 - Init packet magic header - H2 - Response packet magic header - H2 - Response packet magic header + H2 - Response packet magic header - H4 - Transport packet magic header - H4 - Transport packet magic header + H4 - Transport packet magic header - H3 - Underload packet magic header - H3 - Underload packet magic header + H3 - Underload packet magic header - - I1 - First special junk packet - - - - - I2 - Second special junk packet - - - - - I3 - Third special junk packet - - - - - I4 - Fourth special junk packet - - - - - I5 - Fifth special junk packet - - - - - J1 - First controlled junk packet - - - - - J2 - Second controlled junk packet - - - - - J3 - Third controlled junk packet - - - - - Itime - Special handshake timeout - - - - The values of the H1-H4 fields must be unique - Значения в полях H1-H4 должны быть уникальными + Значения в полях H1-H4 должны быть уникальными - The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) - Значение в поле S1 + размер инициации сообщения (148) не должно равняться значению в поле S2 + размер ответа на сообщение (92) + Значение в поле S1 + размер инициации сообщения (148) не должно равняться значению в поле S2 + размер ответа на сообщение (92) - Save settings? - Сохранить настройки? + Сохранить настройки? - Continue - Продолжить + Продолжить - Cancel - Отменить + Отменить - Unable change settings while there is an active connection - Невозможно изменить настройки во время активного соединения + Невозможно изменить настройки во время активного соединения diff --git a/client/translations/amneziavpn_uk_UA.ts b/client/translations/amneziavpn_uk_UA.ts index eacac054..a39f3095 100644 --- a/client/translations/amneziavpn_uk_UA.ts +++ b/client/translations/amneziavpn_uk_UA.ts @@ -827,139 +827,40 @@ Thank you for staying with us! PageProtocolAwgSettings - AmneziaWG settings - налаштування AmneziaWG + налаштування AmneziaWG - VPN address subnet - VPN address subnet + VPN address subnet - Port - Порт + Порт - - Jc - Junk packet count - - - - - Jmin - Junk packet minimum size - - - - - Jmax - Junk packet maximum size - - - - - S1 - Init packet junk size - - - - - S2 - Response packet junk size - - - - - H1 - Init packet magic header - - - - - H2 - Response packet magic header - - - - - H4 - Transport packet magic header - - - - - H3 - Underload packet magic header - - - - - I1 - First special junk packet - - - - - I2 - Second special junk packet - - - - - I3 - Third special junk packet - - - - - I4 - Fourth special junk packet - - - - - I5 - Fifth special junk packet - - - - - J1 - First controlled junk packet - - - - - J2 - Second controlled junk packet - - - - - J3 - Third controlled junk packet - - - - - Itime - Special handshake timeout - - - - Save - Зберегти + Зберегти - The values of the H1-H4 fields must be unique - Значення полів H1-H4 мають бути унікальними + Значення полів H1-H4 мають бути унікальними - The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) - Значення поля S1 + розмір повідомлення ініціалізації (148) не має бути рівним значенню S2 + розмір повідомлення відповіді (92) + Значення поля S1 + розмір повідомлення ініціалізації (148) не має бути рівним значенню S2 + розмір повідомлення відповіді (92) - Save settings? - Зберегти налаштування? + Зберегти налаштування? - All users with whom you shared a connection with will no longer be able to connect to it. - Усі користувачі, з якими ви поділилися підключенням, більше не зможуть підключитися до нього. + Усі користувачі, з якими ви поділилися підключенням, більше не зможуть підключитися до нього. - Unable change settings while there is an active connection - Неможливо змінити налаштування, поки є активне підключення + Неможливо змінити налаштування, поки є активне підключення Remove AmneziaWG @@ -978,14 +879,12 @@ Thank you for staying with us! Користувачі, з якими ви поділились цим протоколм, більше не зможуть до нього підключитись. - Continue - Продовжити + Продовжити - Cancel - Відмінити + Відмінити Save and Restart Amnezia diff --git a/client/translations/amneziavpn_ur_PK.ts b/client/translations/amneziavpn_ur_PK.ts index f76be8ab..203d64d1 100644 --- a/client/translations/amneziavpn_ur_PK.ts +++ b/client/translations/amneziavpn_ur_PK.ts @@ -765,153 +765,52 @@ Thank you for staying with us! PageProtocolAwgSettings - AmneziaWG settings - امنیزیا وی جی کی ترتیبات + امنیزیا وی جی کی ترتیبات - Port - پورٹ + پورٹ MTU ام ٹی یو - All users with whom you shared a connection with will no longer be able to connect to it. - آپ جن لوگوں کے ساتھ آپ نے اس کنکشن کا اشتراک کیا تھا، وہ اس سے مزید جڑ نہیں سکیں گے۔ + آپ جن لوگوں کے ساتھ آپ نے اس کنکشن کا اشتراک کیا تھا، وہ اس سے مزید جڑ نہیں سکیں گے۔ - Save - محفوظ کریں + محفوظ کریں - VPN address subnet - وی پی این ایڈریس سب نیٹ + وی پی این ایڈریس سب نیٹ - - Jc - Junk packet count - - - - - Jmin - Junk packet minimum size - - - - - Jmax - Junk packet maximum size - - - - - S1 - Init packet junk size - - - - - S2 - Response packet junk size - - - - - H1 - Init packet magic header - - - - - H2 - Response packet magic header - - - - - H4 - Transport packet magic header - - - - - H3 - Underload packet magic header - - - - - I1 - First special junk packet - - - - - I2 - Second special junk packet - - - - - I3 - Third special junk packet - - - - - I4 - Fourth special junk packet - - - - - I5 - Fifth special junk packet - - - - - J1 - First controlled junk packet - - - - - J2 - Second controlled junk packet - - - - - J3 - Third controlled junk packet - - - - - Itime - Special handshake timeout - - - - The values of the H1-H4 fields must be unique - H1 تا H4 فیلڈز کی قیمتیں مخصوص ہونی چاہیے + H1 تا H4 فیلڈز کی قیمتیں مخصوص ہونی چاہیے - The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) - S1 + پیغام شروع کار (148) کے فیلڈ کی قیمت S2 + پیغام جواب (92) کے سائز کے برابر نہیں ہونی چاہئے + S1 + پیغام شروع کار (148) کے فیلڈ کی قیمت S2 + پیغام جواب (92) کے سائز کے برابر نہیں ہونی چاہئے - Save settings? - ترتیبات محفوظ کریں? + ترتیبات محفوظ کریں? - Continue - جاری رکھیں + جاری رکھیں - Cancel - منسوخ کریں + منسوخ کریں - Unable change settings while there is an active connection - جب ایک فعال کنکشن موجود ہو تو ترتیبات کو تبدیل نہیں کیا جا سکتا + جب ایک فعال کنکشن موجود ہو تو ترتیبات کو تبدیل نہیں کیا جا سکتا diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 7a360b1b..cef3e617 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -779,14 +779,12 @@ Thank you for staying with us! PageProtocolAwgSettings - AmneziaWG settings - AmneziaWG 配置 + AmneziaWG 配置 - Port - 端口 + 端口 Remove AmneziaWG @@ -797,139 +795,28 @@ Thank you for staying with us! 从服务上移除AmneziaWG? - All users with whom you shared a connection with will no longer be able to connect to it. - 与您共享连接的所有用户将无法再连接到该连接。 + 与您共享连接的所有用户将无法再连接到该连接。 - Save - 保存 + 保存 - VPN address subnet - VPN 地址子网 + VPN 地址子网 - - Jc - Junk packet count - - - - - Jmin - Junk packet minimum size - - - - - Jmax - Junk packet maximum size - - - - - S1 - Init packet junk size - - - - - S2 - Response packet junk size - - - - - H1 - Init packet magic header - - - - - H2 - Response packet magic header - - - - - H4 - Transport packet magic header - - - - - H3 - Underload packet magic header - - - - - I1 - First special junk packet - - - - - I2 - Second special junk packet - - - - - I3 - Third special junk packet - - - - - I4 - Fourth special junk packet - - - - - I5 - Fifth special junk packet - - - - - J1 - First controlled junk packet - - - - - J2 - Second controlled junk packet - - - - - J3 - Third controlled junk packet - - - - - Itime - Special handshake timeout - - - - - The values of the H1-H4 fields must be unique - - - - - The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) - - - - Save settings? - 保存设置? + 保存设置? - Continue - 继续 + 继续 - Cancel - 取消 - - - - Unable change settings while there is an active connection - + 取消 diff --git a/client/ui/models/protocols/awgConfigModel.cpp b/client/ui/models/protocols/awgConfigModel.cpp index b43767a8..b2fc595c 100644 --- a/client/ui/models/protocols/awgConfigModel.cpp +++ b/client/ui/models/protocols/awgConfigModel.cpp @@ -196,7 +196,8 @@ void AwgConfigModel::updateModel(const QJsonObject &config) m_serverProtocolConfig[config_key::controlledJunk3] = serverProtocolConfig.value(config_key::controlledJunk3).toString(protocols::awg::defaultControlledJunk3); m_serverProtocolConfig[config_key::specialHandshakeTimeout] = - serverProtocolConfig.value(config_key::specialHandshakeTimeout).toString(protocols::awg::defaultSpecialHandshakeTimeout); + serverProtocolConfig.value(config_key::specialHandshakeTimeout) + .toString(protocols::awg::defaultSpecialHandshakeTimeout); auto lastConfig = m_serverProtocolConfig.value(config_key::last_config).toString(); QJsonObject clientProtocolConfig = QJsonDocument::fromJson(lastConfig.toUtf8()).object(); @@ -275,15 +276,15 @@ QHash AwgConfigModel::roleNames() const roles[ServerUnderloadPacketMagicHeaderRole] = "serverUnderloadPacketMagicHeader"; roles[ServerTransportPacketMagicHeaderRole] = "serverTransportPacketMagicHeader"; - roles[ServerSpecialJunk1Role] = "specialJunk1"; - roles[ServerSpecialJunk2Role] = "specialJunk2"; - roles[ServerSpecialJunk3Role] = "specialJunk3"; - roles[ServerSpecialJunk4Role] = "specialJunk4"; - roles[ServerSpecialJunk5Role] = "specialJunk5"; - roles[ServerControlledJunk1Role] = "controlledJunk1"; - roles[ServerControlledJunk2Role] = "controlledJunk2"; - roles[ServerControlledJunk3Role] = "controlledJunk3"; - roles[ServerSpecialHandshakeTimeoutRole] = "specialHandshakeTimeout"; + roles[ServerSpecialJunk1Role] = "serverSpecialJunk1"; + roles[ServerSpecialJunk2Role] = "serverSpecialJunk2"; + roles[ServerSpecialJunk3Role] = "serverSpecialJunk3"; + roles[ServerSpecialJunk4Role] = "serverSpecialJunk4"; + roles[ServerSpecialJunk5Role] = "serverSpecialJunk5"; + roles[ServerControlledJunk1Role] = "serverControlledJunk1"; + roles[ServerControlledJunk2Role] = "serverControlledJunk2"; + roles[ServerControlledJunk3Role] = "serverControlledJunk3"; + roles[ServerSpecialHandshakeTimeoutRole] = "serverSpecialHandshakeTimeout"; return roles; } @@ -321,21 +322,21 @@ AwgConfig::AwgConfig(const QJsonObject &serverProtocolConfig) .toString(protocols::awg::defaultUnderloadPacketMagicHeader); serverTransportPacketMagicHeader = serverProtocolConfig.value(config_key::transportPacketMagicHeader) .toString(protocols::awg::defaultTransportPacketMagicHeader); - serverSpecialJunk[config_key::specialJunk1] = + serverSpecialJunk1 = serverProtocolConfig.value(config_key::specialJunk1).toString(protocols::awg::defaultSpecialJunk1); - serverSpecialJunk[config_key::specialJunk2] = + serverSpecialJunk2 = serverProtocolConfig.value(config_key::specialJunk2).toString(protocols::awg::defaultSpecialJunk2); - serverSpecialJunk[config_key::specialJunk3] = + serverSpecialJunk3 = serverProtocolConfig.value(config_key::specialJunk3).toString(protocols::awg::defaultSpecialJunk3); - serverSpecialJunk[config_key::specialJunk4] = + serverSpecialJunk4 = serverProtocolConfig.value(config_key::specialJunk4).toString(protocols::awg::defaultSpecialJunk4); - serverSpecialJunk[config_key::specialJunk5] = + serverSpecialJunk5 = serverProtocolConfig.value(config_key::specialJunk5).toString(protocols::awg::defaultSpecialJunk5); - serverControlledJunk[config_key::controlledJunk1] = + serverControlledJunk1 = serverProtocolConfig.value(config_key::controlledJunk1).toString(protocols::awg::defaultControlledJunk1); - serverControlledJunk[config_key::controlledJunk2] = + serverControlledJunk2 = serverProtocolConfig.value(config_key::controlledJunk2).toString(protocols::awg::defaultControlledJunk2); - serverControlledJunk[config_key::controlledJunk3] = + serverControlledJunk3 = serverProtocolConfig.value(config_key::controlledJunk3).toString(protocols::awg::defaultControlledJunk3); serverSpecialHandshakeTimeout = serverProtocolConfig.value(config_key::specialHandshakeTimeout) .toString(protocols::awg::defaultSpecialHandshakeTimeout); @@ -352,7 +353,10 @@ bool AwgConfig::hasEqualServerSettings(const AwgConfig &other) const || serverResponsePacketMagicHeader != other.serverResponsePacketMagicHeader || serverUnderloadPacketMagicHeader != other.serverUnderloadPacketMagicHeader || serverTransportPacketMagicHeader != other.serverTransportPacketMagicHeader - || serverSpecialJunk != other.serverSpecialJunk || serverControlledJunk != other.serverControlledJunk + || serverSpecialJunk1 != other.serverSpecialJunk1 || serverSpecialJunk2 != other.serverSpecialJunk2 + || serverSpecialJunk3 != other.serverSpecialJunk3 || serverSpecialJunk4 != other.serverSpecialJunk4 + || serverSpecialJunk5 != other.serverSpecialJunk5 || serverControlledJunk1 != other.serverControlledJunk1 + || serverControlledJunk2 != other.serverControlledJunk2 || serverControlledJunk3 != other.serverControlledJunk3 || serverSpecialHandshakeTimeout != other.serverSpecialHandshakeTimeout) { return false; } diff --git a/client/ui/models/protocols/awgConfigModel.h b/client/ui/models/protocols/awgConfigModel.h index 50daf765..5c5953b6 100644 --- a/client/ui/models/protocols/awgConfigModel.h +++ b/client/ui/models/protocols/awgConfigModel.h @@ -33,13 +33,18 @@ struct AwgConfig QString serverUnderloadPacketMagicHeader; QString serverTransportPacketMagicHeader; - QMap serverSpecialJunk; - QMap serverControlledJunk; + QString serverSpecialJunk1; + QString serverSpecialJunk2; + QString serverSpecialJunk3; + QString serverSpecialJunk4; + QString serverSpecialJunk5; + QString serverControlledJunk1; + QString serverControlledJunk2; + QString serverControlledJunk3; QString serverSpecialHandshakeTimeout; bool hasEqualServerSettings(const AwgConfig &other) const; bool hasEqualClientSettings(const AwgConfig &other) const; - }; class AwgConfigModel : public QAbstractListModel @@ -65,6 +70,7 @@ public: ServerResponsePacketMagicHeaderRole, ServerUnderloadPacketMagicHeaderRole, ServerTransportPacketMagicHeaderRole, + ServerSpecialJunk1Role, ServerSpecialJunk2Role, ServerSpecialJunk3Role, diff --git a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml index fa818ab6..7e2c5feb 100644 --- a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml @@ -317,121 +317,121 @@ PageType { } TextFieldWithHeaderType { - id: i1JunkPacketTextField + id: specialJunk1TextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("I1 - First special junk packet") - textField.text: serverSpecialJunk["I1"] + textField.text: serverSpecialJunk1 textField.onEditingFinished: { - if (textField.text !== serverI1JunkPacket) { - serverI1JunkPacket = textField.text + if (textField.text !== serverSpecialJunk1) { + serverSpecialJunk1 = textField.text } } } TextFieldWithHeaderType { - id: i2JunkPacketTextField + id: specialJunk2TextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("I2 - Second special junk packet") - textField.text: serverSpecialJunk["I2"] + textField.text: serverSpecialJunk2 textField.onEditingFinished: { - if (textField.text !== serverI2JunkPacket) { - serverI2JunkPacket = textField.text + if (textField.text !== serverSpecialJunk2) { + serverSpecialJunk2 = textField.text } } } TextFieldWithHeaderType { - id: i3JunkPacketTextField + id: specialJunk3TextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("I3 - Third special junk packet") - textField.text: serverSpecialJunk["I3"] + textField.text: serverSpecialJunk3 textField.onEditingFinished: { - if (textField.text !== serverI3JunkPacket) { - serverI3JunkPacket = textField.text + if (textField.text !== serverSpecialJunk3) { + serverSpecialJunk3 = textField.text } } } TextFieldWithHeaderType { - id: i4JunkPacketTextField + id: specialJunk4TextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("I4 - Fourth special junk packet") - textField.text: serverSpecialJunk["I4"] + textField.text: serverSpecialJunk4 textField.onEditingFinished: { - if (textField.text !== serverI4JunkPacket) { - serverI4JunkPacket = textField.text + if (textField.text !== serverSpecialJunk4) { + serverSpecialJunk4 = textField.text } } } TextFieldWithHeaderType { - id: i5JunkPacketTextField + id: specialJunk5TextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("I5 - Fifth special junk packet") - textField.text: serverSpecialJunk["I5"] + textField.text: serverSpecialJunk5 textField.onEditingFinished: { - if (textField.text !== serverI5JunkPacket) { - serverI5JunkPacket = textField.text + if (textField.text !== serverSpecialJunk5 ) { + serverSpecialJunk5 = textField.text } } } TextFieldWithHeaderType { - id: j1JunkPacketTextField + id: controlledJunk1TextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("J1 - First controlled junk packet") - textField.text: serverControlledJunk["J1"] + textField.text: serverControlledJunk1 textField.onEditingFinished: { - if (textField.text !== serverJ1JunkPacket) { - serverJ1JunkPacket = textField.text + if (textField.text !== serverControlledJunk1) { + serverControlledJunk1 = textField.text } } } TextFieldWithHeaderType { - id: j2JunkPacketTextField + id: controlledJunk2TextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("J2 - Second controlled junk packet") - textField.text: serverControlledJunk[J2] + textField.text: serverControlledJunk2 textField.onEditingFinished: { - if (textField.text !== serverJ2JunkPacket) { - serverJ2JunkPacket = textField.text + if (textField.text !== serverControlledJunk2) { + serverControlledJunk2 = textField.text } } } TextFieldWithHeaderType { - id: j3JunkPacketTextField + id: controlledJunk3TextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("J3 - Third controlled junk packet") - textField.text: serverControlledJunk[J3] + textField.text: serverControlledJunk3 textField.onEditingFinished: { - if (textField.text !== serverJ3JunkPacket) { - serverJ3JunkPacket = textField.text + if (textField.text !== serverControlledJunk3) { + serverControlledJunk3 = textField.text } } } @@ -442,12 +442,12 @@ PageType { Layout.topMargin: 16 headerText: qsTr("Itime - Special handshake timeout") - textField.text: serverSpeciaHandshakeIntervalTime + textField.text: serverSpecialHandshakeTimeout textField.validator: IntValidator { bottom: 0 } textField.onEditingFinished: { - if (textField.text !== serverSepcialHandshakeTimeout) { - serverSepcialHandshakeTimeout = textField.text + if (textField.text !== serverSpecialHandshakeTimeout) { + serverSpecialHandshakeTimeout = textField.text } } } @@ -468,14 +468,14 @@ PageType { junkPacketMaxSizeTextField.errorText === "" && junkPacketMinSizeTextField.errorText === "" && junkPacketCountTextField.errorText === "" && - i1JunkPacketTextField.errorText === "" && - i2JunkPacketTextField.errorText === "" && - i3JunkPacketTextField.errorText === "" && - i4JunkPacketTextField.errorText === "" && - i5JunkPacketTextField.errorText === "" && - j1JunkPacketTextField.errorText === "" && - j2JunkPacketTextField.errorText === "" && - j3JunkPacketTextField.errorText === "" && + specialJunk1TextField.errorText === "" && + specialJunk2TextField.errorText === "" && + specialJunk3TextField.errorText === "" && + specialJunk4TextField.errorText === "" && + specialJunk5TextField.errorText === "" && + controlledJunk1TextField.errorText === "" && + controlledJunk2TextField.errorText === "" && + controlledJunk3TextField.errorText === "" && iTimeTextField.errorText === "" && portTextField.errorText === "" && vpnAddressSubnetTextField.errorText === ""