diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d8d26de7..f17cf7a32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1632,11 +1632,11 @@ if (WIN32) set(SUBSYSTEM_VERSION_SUFFIX ",5.02") endif() elseif(OS_AARCH64) - # Windows ARM64 requires Windows 10 - set(SUBSYSTEM_VERSION_SUFFIX ",10.0") - else() - # 6.02 = Windows 8.1 + # default value for arm64 set(SUBSYSTEM_VERSION_SUFFIX ",6.02") + else() + # default value for x86 and x64 + set(SUBSYSTEM_VERSION_SUFFIX ",6.00") endif() endif() if (MSVC) diff --git a/src/gtk/yass_window.cpp b/src/gtk/yass_window.cpp index cfba4741c..3239b8d19 100644 --- a/src/gtk/yass_window.cpp +++ b/src/gtk/yass_window.cpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -/* Copyright (c) 2019-2022 Chilledheart */ +/* Copyright (c) 2019-2024 Chilledheart */ #include "gtk/yass_window.hpp" @@ -175,13 +175,13 @@ YASSWindow::YASSWindow() password_ = GTK_ENTRY(gtk_entry_new()); static const char* const method_names[] = { #define XX(num, name, string) string, - CIPHER_METHOD_MAP(XX) + CIPHER_METHOD_VALID_MAP(XX) #undef XX }; method_ = GTK_COMBO_BOX_TEXT(gtk_combo_box_text_new()); - for (uint32_t i = 1; i < sizeof(method_names) / sizeof(method_names[0]); + for (uint32_t i = 0; i < sizeof(method_names) / sizeof(method_names[0]); ++i) { gtk_combo_box_text_append_text(method_, method_names[i]); } @@ -410,16 +410,16 @@ void YASSWindow::LoadChanges() { static const int method_ids[] = { #define XX(num, name, string) num, - CIPHER_METHOD_MAP(XX) + CIPHER_METHOD_VALID_MAP(XX) #undef XX }; uint32_t i; - for (i = 1; i < sizeof(method_ids) / sizeof(method_ids[0]); ++i) { + for (i = 0; i < sizeof(method_ids) / sizeof(method_ids[0]); ++i) { if (cipher_method == method_ids[i]) break; } - gtk_combo_box_set_active(GTK_COMBO_BOX(method_), i - 1); + gtk_combo_box_set_active(GTK_COMBO_BOX(method_), i); gtk_entry_set_text(local_host_, local_host_str.c_str()); gtk_entry_set_text(local_port_, local_port_str.c_str()); diff --git a/src/gtk4/yass_window.cpp b/src/gtk4/yass_window.cpp index 78472cb94..0045c5918 100644 --- a/src/gtk4/yass_window.cpp +++ b/src/gtk4/yass_window.cpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -/* Copyright (c) 2019-2023 Chilledheart */ +/* Copyright (c) 2019-2024 Chilledheart */ #include "gtk4/yass_window.hpp" @@ -150,13 +150,13 @@ YASSWindow::YASSWindow(GApplication *app) static const char* const method_names[] = { #define XX(num, name, string) string, - CIPHER_METHOD_MAP(XX) + CIPHER_METHOD_VALID_MAP(XX) #undef XX }; GtkComboBoxText *method = GTK_COMBO_BOX_TEXT(impl_->method); - for (uint32_t i = 1; i < sizeof(method_names) / sizeof(method_names[0]); + for (uint32_t i = 0; i < sizeof(method_names) / sizeof(method_names[0]); ++i) { gtk_combo_box_text_append_text(method, method_names[i]); } @@ -343,16 +343,16 @@ void YASSWindow::LoadChanges() { static const int method_ids[] = { #define XX(num, name, string) num, - CIPHER_METHOD_MAP(XX) + CIPHER_METHOD_VALID_MAP(XX) #undef XX }; uint32_t i; - for (i = 1; i < sizeof(method_ids) / sizeof(method_ids[0]); ++i) { + for (i = 0; i < sizeof(method_ids) / sizeof(method_ids[0]); ++i) { if (cipher_method == method_ids[i]) break; } - gtk_combo_box_set_active(GTK_COMBO_BOX(impl_->method), i - 1); + gtk_combo_box_set_active(GTK_COMBO_BOX(impl_->method), i); gtk_editable_set_text(GTK_EDITABLE(impl_->local_host), local_host_str.c_str()); gtk_editable_set_text(GTK_EDITABLE(impl_->local_port), local_port_str.c_str()); diff --git a/src/ios/YassAppDelegate.mm b/src/ios/YassAppDelegate.mm index 35aeebff8..9b567270e 100644 --- a/src/ios/YassAppDelegate.mm +++ b/src/ios/YassAppDelegate.mm @@ -164,13 +164,11 @@ - (void)OnStartSaveAndLoadInstance:(NETunnelProviderManager*) vpn_manager { #endif auto ips_v4 = worker_.GetRemoteIpsV4(); NSMutableArray *remote_ips_v4 = [[NSMutableArray alloc] init]; - [remote_ips_v4 addObject: @"127.0.0.1"]; for (const auto & ip_v4 : ips_v4) { [remote_ips_v4 addObject:@(ip_v4.c_str())]; } auto ips_v6 = worker_.GetRemoteIpsV6(); NSMutableArray *remote_ips_v6 = [[NSMutableArray alloc] init]; - [remote_ips_v6 addObject: @"::1"]; for (const auto & ip_v6 : ips_v6) { [remote_ips_v6 addObject:@(ip_v6.c_str())]; } diff --git a/src/ios/YassViewController.mm b/src/ios/YassViewController.mm index a2c71858c..44a61e473 100644 --- a/src/ios/YassViewController.mm +++ b/src/ios/YassViewController.mm @@ -53,7 +53,7 @@ - (void)viewDidLoad { cipher_methods_ = @[ #define XX(num, name, string) @string, - CIPHER_METHOD_MAP(XX) + CIPHER_METHOD_VALID_MAP(XX) #undef XX ]; current_cipher_method_ = nil; diff --git a/src/mac/YassViewController.mm b/src/mac/YassViewController.mm index 65f7b7105..b29bad7d0 100644 --- a/src/mac/YassViewController.mm +++ b/src/mac/YassViewController.mm @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -/* Copyright (c) 2022 Chilledheart */ +/* Copyright (c) 2022-2024 Chilledheart */ #import "mac/YassViewController.h" @@ -55,15 +55,15 @@ - (void)viewDidLoad { [self.cipherMethod removeAllItems]; NSString* methodStrings[] = { #define XX(num, name, string) @string, - CIPHER_METHOD_MAP(XX) + CIPHER_METHOD_VALID_MAP(XX) #undef XX }; - for (uint32_t i = 1; i < sizeof(methodStrings) / sizeof(methodStrings[0]); + for (uint32_t i = 0; i < sizeof(methodStrings) / sizeof(methodStrings[0]); ++i) { [self.cipherMethod addItemWithObjectValue:methodStrings[i]]; } self.cipherMethod.numberOfVisibleItems = - sizeof(methodStrings) / sizeof(methodStrings[0]) - 1; + sizeof(methodStrings) / sizeof(methodStrings[0]); [self.autoStart setState:(CheckLoginItemStatus(nullptr) ? NSControlStateValueOn diff --git a/src/win32/yass_frame.cpp b/src/win32/yass_frame.cpp index 0cc4f8591..7da5e17f3 100644 --- a/src/win32/yass_frame.cpp +++ b/src/win32/yass_frame.cpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -/* Copyright (c) 2022 Chilledheart */ +/* Copyright (c) 2022-2024 Chilledheart */ #include "win32/yass_frame.hpp" @@ -402,12 +402,12 @@ int CYassFrame::Create(const wchar_t* className, // Right Panel const wchar_t* method_strings[] = { #define XX(num, name, string) L##string, - CIPHER_METHOD_MAP(XX) + CIPHER_METHOD_VALID_MAP(XX) #undef XX }; DWORD method_nums[] = { #define XX(num, name, string) static_cast(num), - CIPHER_METHOD_MAP(XX) + CIPHER_METHOD_VALID_MAP(XX) #undef XX }; @@ -449,10 +449,10 @@ int CYassFrame::Create(const wchar_t* className, method_combo_box_ = CreateComboBox(CBS_DROPDOWNLIST, m_hWnd, IDC_COMBOBOX_METHOD, hInstance); - int method_count = sizeof(method_strings) / sizeof(method_strings[0]) - 1; + int method_count = sizeof(method_strings) / sizeof(method_strings[0]); for (int i = 0; i < method_count; ++i) { - ComboBox_AddString(method_combo_box_, method_strings[i + 1]); - ComboBox_SetItemData(method_combo_box_, i, method_nums[i + 1]); + ComboBox_AddString(method_combo_box_, method_strings[i]); + ComboBox_SetItemData(method_combo_box_, i, method_nums[i]); } ComboBox_SetMinVisible(method_combo_box_, method_count);