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
|
// tun-in
|
||||||
if (IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn) {
|
if (IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn && !status->forTest) {
|
||||||
QJsonObject inboundObj;
|
QJsonObject inboundObj;
|
||||||
inboundObj["tag"] = "tun-in";
|
inboundObj["tag"] = "tun-in";
|
||||||
inboundObj["type"] = "tun";
|
inboundObj["type"] = "tun";
|
||||||
@@ -937,7 +937,7 @@ namespace NekoGui {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// tun user rule
|
// 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";
|
auto match_out = dataStore->vpn_rule_white ? "proxy" : "bypass";
|
||||||
|
|
||||||
QString process_name_rule = dataStore->vpn_rule_process.trimmed();
|
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 != NekoGui::dataStore->spmode_vpn) {
|
||||||
if (enable) {
|
if (enable) {
|
||||||
if (IS_NEKO_BOX_INTERNAL_TUN) {
|
if (IS_NEKO_BOX_INTERNAL_TUN) {
|
||||||
bool requestPermission = false;
|
bool requestPermission = !NekoGui::isAdmin();
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_LINUX
|
||||||
if (!Windows_IsInAdmin()) {
|
if (requestPermission && QProcess::execute("pkexec", {"--help"}) != 0) {
|
||||||
requestPermission = true;
|
MessageBoxWarning(software_name, "Please install \"pkexec\" first.");
|
||||||
|
neko_set_spmode_FAILED
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
requestPermission = !NekoGui::isAdmin();
|
|
||||||
#endif
|
#endif
|
||||||
if (requestPermission) {
|
if (requestPermission) {
|
||||||
auto n = QMessageBox::warning(GetMessageBoxParent(), software_name, tr("Please run NekoBox as admin"), QMessageBox::Yes | QMessageBox::No);
|
auto n = QMessageBox::warning(GetMessageBoxParent(), software_name, tr("Please run NekoBox as admin"), QMessageBox::Yes | QMessageBox::No);
|
||||||
|
|||||||
Reference in New Issue
Block a user