Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
Nethius
1909d3c94e
chore: bump version (#1701) 2025-07-08 15:11:45 +08:00
Nethius
10a107716c
fix: fixed awg 1.5 fields processing for ios (#1700) 2025-07-08 15:06:52 +08:00
Nethius
5445e6637b
chore: minor fixes (#1616)
* chore: removed unnecessary qdebug

* fix: return soft and hide strict killswitch
2025-07-08 14:25:03 +08:00
3 changed files with 61 additions and 32 deletions

View file

@ -46,29 +46,59 @@ struct WGConfig: Decodable {
} }
var settings: String { var settings: String {
junkPacketCount == nil ? "" : guard junkPacketCount != nil else { return "" }
"""
Jc = \(junkPacketCount!) var settingsLines: [String] = []
Jmin = \(junkPacketMinSize!)
Jmax = \(junkPacketMaxSize!) // Required parameters when junkPacketCount is present
S1 = \(initPacketJunkSize!) settingsLines.append("Jc = \(junkPacketCount!)")
S2 = \(responsePacketJunkSize!) settingsLines.append("Jmin = \(junkPacketMinSize!)")
S3 = \(cookieReplyPacketJunkSize!) settingsLines.append("Jmax = \(junkPacketMaxSize!)")
S4 = \(transportPacketJunkSize!) settingsLines.append("S1 = \(initPacketJunkSize!)")
H1 = \(initPacketMagicHeader!) settingsLines.append("S2 = \(responsePacketJunkSize!)")
H2 = \(responsePacketMagicHeader!)
H3 = \(underloadPacketMagicHeader!) settingsLines.append("H1 = \(initPacketMagicHeader!)")
H4 = \(transportPacketMagicHeader!) settingsLines.append("H2 = \(responsePacketMagicHeader!)")
I1 = \(specialJunk1!) settingsLines.append("H3 = \(underloadPacketMagicHeader!)")
I2 = \(specialJunk2!) settingsLines.append("H4 = \(transportPacketMagicHeader!)")
I3 = \(specialJunk3!)
I4 = \(specialJunk4!) // Optional parameters - only add if not nil and not empty
I5 = \(specialJunk5!) if let s3 = cookieReplyPacketJunkSize, !s3.isEmpty {
J1 = \(controlledJunk1!) settingsLines.append("S3 = \(s3)")
J2 = \(controlledJunk2!) }
J3 = \(controlledJunk3!) if let s4 = transportPacketJunkSize, !s4.isEmpty {
Itime = \(specialHandshakeTimeout!) settingsLines.append("S4 = \(s4)")
""" }
if let i1 = specialJunk1, !i1.isEmpty {
settingsLines.append("I1 = \(i1)")
}
if let i2 = specialJunk2, !i2.isEmpty {
settingsLines.append("I2 = \(i2)")
}
if let i3 = specialJunk3, !i3.isEmpty {
settingsLines.append("I3 = \(i3)")
}
if let i4 = specialJunk4, !i4.isEmpty {
settingsLines.append("I4 = \(i4)")
}
if let i5 = specialJunk5, !i5.isEmpty {
settingsLines.append("I5 = \(i5)")
}
if let j1 = controlledJunk1, !j1.isEmpty {
settingsLines.append("J1 = \(j1)")
}
if let j2 = controlledJunk2, !j2.isEmpty {
settingsLines.append("J2 = \(j2)")
}
if let j3 = controlledJunk3, !j3.isEmpty {
settingsLines.append("J3 = \(j3)")
}
if let itime = specialHandshakeTimeout, !itime.isEmpty {
settingsLines.append("Itime = \(itime)")
}
return settingsLines.joined(separator: "\n")
} }
var str: String { var str: String {

View file

@ -221,8 +221,6 @@ namespace
serverConfig[configKey::apiConfig] = apiConfig; serverConfig[configKey::apiConfig] = apiConfig;
qDebug() << serverConfig;
return ErrorCode::NoError; return ErrorCode::NoError;
} }
} }

View file

@ -62,8 +62,7 @@ PageType {
Layout.leftMargin: 16 Layout.leftMargin: 16
Layout.rightMargin: 16 Layout.rightMargin: 16
visible: false enabled: SettingsController.isKillSwitchEnabled && !ConnectionController.isConnected
// enabled: SettingsController.isKillSwitchEnabled && !ConnectionController.isConnected
checked: !SettingsController.strictKillSwitchEnabled checked: !SettingsController.strictKillSwitchEnabled
text: qsTr("Soft KillSwitch") text: qsTr("Soft KillSwitch")
@ -74,9 +73,7 @@ PageType {
} }
} }
DividerType { DividerType {}
visible: false
}
VerticalRadioButton { VerticalRadioButton {
id: strictKillSwitch id: strictKillSwitch
@ -84,7 +81,9 @@ PageType {
Layout.leftMargin: 16 Layout.leftMargin: 16
Layout.rightMargin: 16 Layout.rightMargin: 16
enabled: SettingsController.isKillSwitchEnabled && !ConnectionController.isConnected visible: false
enabled: false
// enabled: SettingsController.isKillSwitchEnabled && !ConnectionController.isConnected
checked: SettingsController.strictKillSwitchEnabled checked: SettingsController.strictKillSwitchEnabled
text: qsTr("Strict KillSwitch") text: qsTr("Strict KillSwitch")
@ -106,7 +105,9 @@ PageType {
} }
} }
DividerType {} DividerType {
visible: false
}
LabelWithButtonType { LabelWithButtonType {
Layout.topMargin: 32 Layout.topMargin: 32