mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 12:34:37 +03:00
fix
This commit is contained in:
@@ -732,7 +732,7 @@ namespace NekoGui {
|
||||
}
|
||||
|
||||
// tun-in
|
||||
if (IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn) {
|
||||
if (IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn && !status->forTest) {
|
||||
QJsonObject inboundObj;
|
||||
inboundObj["tag"] = "tun-in";
|
||||
inboundObj["type"] = "tun";
|
||||
@@ -937,7 +937,7 @@ namespace NekoGui {
|
||||
};
|
||||
|
||||
// tun user rule
|
||||
if (IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn) {
|
||||
if (IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn && !status->forTest) {
|
||||
auto match_out = dataStore->vpn_rule_white ? "proxy" : "bypass";
|
||||
|
||||
QString process_name_rule = dataStore->vpn_rule_process.trimmed();
|
||||
|
||||
@@ -749,13 +749,12 @@ void MainWindow::neko_set_spmode_vpn(bool enable, bool save) {
|
||||
if (enable != NekoGui::dataStore->spmode_vpn) {
|
||||
if (enable) {
|
||||
if (IS_NEKO_BOX_INTERNAL_TUN) {
|
||||
bool requestPermission = false;
|
||||
#ifdef Q_OS_WIN
|
||||
if (!Windows_IsInAdmin()) {
|
||||
requestPermission = true;
|
||||
bool requestPermission = !NekoGui::isAdmin();
|
||||
#ifdef Q_OS_LINUX
|
||||
if (requestPermission && QProcess::execute("pkexec", {"--help"}) != 0) {
|
||||
MessageBoxWarning(software_name, "Please install \"pkexec\" first.");
|
||||
neko_set_spmode_FAILED
|
||||
}
|
||||
#else
|
||||
requestPermission = !NekoGui::isAdmin();
|
||||
#endif
|
||||
if (requestPermission) {
|
||||
auto n = QMessageBox::warning(GetMessageBoxParent(), software_name, tr("Please run NekoBox as admin"), QMessageBox::Yes | QMessageBox::No);
|
||||
|
||||
Reference in New Issue
Block a user