Skip to content

Commit eee75ad

Browse files
committed
Release Android 1.5.1
1 parent aa18e31 commit eee75ad

8 files changed

Lines changed: 616 additions & 164 deletions

File tree

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ plugins {
55

66
val whiteDnsVersionCode = providers.gradleProperty("WHITE_DNS_VERSION_CODE")
77
.map { it.toInt() }
8-
.orElse(11)
8+
.orElse(12)
99
val whiteDnsVersionName = providers.gradleProperty("WHITE_DNS_VERSION_NAME")
10-
.orElse("1.5.0")
10+
.orElse("1.5.1")
1111

1212
android {
1313
namespace = "shop.whitedns.client"

app/src/main/java/shop/whitedns/client/model/WhiteDnsAutoTune.kt

Lines changed: 107 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -24,105 +24,147 @@ enum class WhiteDnsAutoTunePresetStability {
2424
object WhiteDnsAutoTunePresets {
2525
val all: List<WhiteDnsAutoTunePreset> = listOf(
2626
WhiteDnsAutoTunePreset(
27-
id = "auto-1",
28-
label = "WhiteDNS Config 1",
29-
minUploadMtu = "100",
30-
maxUploadMtu = "1000",
31-
minDownloadMtu = "200",
32-
maxDownloadMtu = "4000",
33-
resolverTimeoutSeconds = "0.5",
27+
id = "iran-average",
28+
label = "Iran Default",
29+
minUploadMtu = "40",
30+
maxUploadMtu = "140",
31+
minDownloadMtu = "300",
32+
maxDownloadMtu = "3000",
33+
resolverTimeoutSeconds = "2.5",
3434
dnsResponseFragmentStoreCapacity = "256",
35-
uploadDuplication = "15",
36-
downloadDuplication = "30",
35+
uploadDuplication = "3",
36+
downloadDuplication = "7",
3737
uploadCompression = 2,
38-
downloadCompression = 3,
39-
stability = WhiteDnsAutoTunePresetStability.Aggressive,
38+
downloadCompression = 2,
4039
),
4140
WhiteDnsAutoTunePreset(
42-
id = "auto-2",
43-
label = "WhiteDNS Config 2",
44-
minUploadMtu = "100",
45-
maxUploadMtu = "500",
46-
minDownloadMtu = "100",
47-
maxDownloadMtu = "1325",
48-
resolverTimeoutSeconds = "0.5",
49-
dnsResponseFragmentStoreCapacity = "250",
50-
uploadDuplication = "5",
51-
downloadDuplication = "15",
41+
id = "iran-low-mtu-scan",
42+
label = "Iran Low MTU Scan",
43+
minUploadMtu = "20",
44+
maxUploadMtu = "120",
45+
minDownloadMtu = "160",
46+
maxDownloadMtu = "768",
47+
resolverTimeoutSeconds = "2.5",
48+
dnsResponseFragmentStoreCapacity = "256",
49+
uploadDuplication = "3",
50+
downloadDuplication = "7",
5251
uploadCompression = 2,
5352
downloadCompression = 2,
5453
),
5554
WhiteDnsAutoTunePreset(
56-
id = "auto-3",
57-
label = "WhiteDNS Config 3",
58-
minUploadMtu = "50",
59-
maxUploadMtu = "1500",
60-
minDownloadMtu = "50",
61-
maxDownloadMtu = "500",
62-
resolverTimeoutSeconds = "0.2",
63-
dnsResponseFragmentStoreCapacity = "200",
64-
uploadDuplication = "1",
65-
downloadDuplication = "1",
66-
uploadCompression = 0,
67-
downloadCompression = 0,
68-
stability = WhiteDnsAutoTunePresetStability.Aggressive,
69-
),
70-
WhiteDnsAutoTunePreset(
71-
id = "auto-4",
72-
label = "WhiteDNS Config 4",
55+
id = "iran-fast-low-mtu",
56+
label = "Iran Fast Low MTU",
7357
minUploadMtu = "20",
7458
maxUploadMtu = "325",
7559
minDownloadMtu = "100",
7660
maxDownloadMtu = "1270",
77-
resolverTimeoutSeconds = "0.5",
61+
resolverTimeoutSeconds = "2.5",
7862
dnsResponseFragmentStoreCapacity = "100",
79-
uploadDuplication = "1",
80-
downloadDuplication = "5",
63+
uploadDuplication = "5",
64+
downloadDuplication = "10",
8165
uploadCompression = 2,
8266
downloadCompression = 2,
8367
),
8468
WhiteDnsAutoTunePreset(
85-
id = "auto-5",
86-
label = "WhiteDNS Config 5",
87-
minUploadMtu = "50",
88-
maxUploadMtu = "500",
89-
minDownloadMtu = "100",
90-
maxDownloadMtu = "9000",
91-
resolverTimeoutSeconds = "0.3",
69+
id = "iran-compact-fixed",
70+
label = "Iran Compact Fixed",
71+
minUploadMtu = "62",
72+
maxUploadMtu = "62",
73+
minDownloadMtu = "414",
74+
maxDownloadMtu = "414",
75+
resolverTimeoutSeconds = "2.5",
76+
dnsResponseFragmentStoreCapacity = "384",
77+
uploadDuplication = "6",
78+
downloadDuplication = "8",
79+
uploadCompression = 2,
80+
downloadCompression = 2,
81+
),
82+
WhiteDnsAutoTunePreset(
83+
id = "iran-fixed-64-balanced",
84+
label = "Iran Fixed 64 Balanced",
85+
minUploadMtu = "64",
86+
maxUploadMtu = "64",
87+
minDownloadMtu = "756",
88+
maxDownloadMtu = "756",
89+
resolverTimeoutSeconds = "2.5",
9290
dnsResponseFragmentStoreCapacity = "256",
93-
uploadDuplication = "1",
94-
downloadDuplication = "1",
95-
uploadCompression = 0,
96-
downloadCompression = 0,
97-
stability = WhiteDnsAutoTunePresetStability.Aggressive,
91+
uploadDuplication = "8",
92+
downloadDuplication = "8",
93+
uploadCompression = 2,
94+
downloadCompression = 2,
9895
),
9996
WhiteDnsAutoTunePreset(
100-
id = "auto-6",
101-
label = "WhiteDNS Config 6",
102-
minUploadMtu = "40",
103-
maxUploadMtu = "200",
104-
minDownloadMtu = "100",
105-
maxDownloadMtu = "1500",
106-
resolverTimeoutSeconds = "0.5",
97+
id = "iran-mid-reliable",
98+
label = "Iran Mid Reliable",
99+
minUploadMtu = "120",
100+
maxUploadMtu = "160",
101+
minDownloadMtu = "652",
102+
maxDownloadMtu = "1110",
103+
resolverTimeoutSeconds = "2.5",
107104
dnsResponseFragmentStoreCapacity = "256",
108105
uploadDuplication = "5",
109-
downloadDuplication = "5",
106+
downloadDuplication = "11",
110107
uploadCompression = 2,
111108
downloadCompression = 2,
112109
),
113110
WhiteDnsAutoTunePreset(
114-
id = "auto-7",
115-
label = "WhiteDNS Config 7",
111+
id = "iran-download-heavy",
112+
label = "Iran Download Heavy",
113+
minUploadMtu = "104",
114+
maxUploadMtu = "139",
115+
minDownloadMtu = "394",
116+
maxDownloadMtu = "1000",
117+
resolverTimeoutSeconds = "2.5",
118+
dnsResponseFragmentStoreCapacity = "256",
119+
uploadDuplication = "8",
120+
downloadDuplication = "30",
121+
uploadCompression = 2,
122+
downloadCompression = 2,
123+
),
124+
WhiteDnsAutoTunePreset(
125+
id = "iran-fixed-64-aggressive",
126+
label = "Iran Fixed 64 Wide",
116127
minUploadMtu = "64",
117128
maxUploadMtu = "64",
118129
minDownloadMtu = "756",
119-
maxDownloadMtu = "756",
120-
resolverTimeoutSeconds = "0.7",
130+
maxDownloadMtu = "1317",
131+
resolverTimeoutSeconds = "2.5",
132+
dnsResponseFragmentStoreCapacity = "230",
133+
uploadDuplication = "14",
134+
downloadDuplication = "30",
135+
uploadCompression = 2,
136+
downloadCompression = 2,
137+
stability = WhiteDnsAutoTunePresetStability.Aggressive,
138+
),
139+
WhiteDnsAutoTunePreset(
140+
id = "iran-large-download-aggressive",
141+
label = "Iran No Compression Max",
142+
minUploadMtu = "100",
143+
maxUploadMtu = "600",
144+
minDownloadMtu = "800",
145+
maxDownloadMtu = "6500",
146+
resolverTimeoutSeconds = "2.5",
147+
dnsResponseFragmentStoreCapacity = "640",
148+
uploadDuplication = "23",
149+
downloadDuplication = "30",
150+
uploadCompression = 0,
151+
downloadCompression = 0,
152+
stability = WhiteDnsAutoTunePresetStability.Aggressive,
153+
),
154+
WhiteDnsAutoTunePreset(
155+
id = "iran-wide-range-aggressive",
156+
label = "Iran Wide Range Max",
157+
minUploadMtu = "100",
158+
maxUploadMtu = "1000",
159+
minDownloadMtu = "200",
160+
maxDownloadMtu = "2667",
161+
resolverTimeoutSeconds = "2.5",
121162
dnsResponseFragmentStoreCapacity = "256",
122163
uploadDuplication = "15",
123164
downloadDuplication = "30",
124165
uploadCompression = 2,
125166
downloadCompression = 2,
167+
stability = WhiteDnsAutoTunePresetStability.Aggressive,
126168
),
127169
)
128170
}

app/src/main/java/shop/whitedns/client/model/WhiteDnsModels.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,10 @@ data class WhiteDnsSettings(
258258
val maxUploadMtu: String = "140",
259259
val maxDownloadMtu: String = "3000",
260260
val mtuTestRetriesResolvers: String = "3",
261-
val mtuTestTimeoutResolvers: String = "2.0",
261+
val mtuTestTimeoutResolvers: String = "2.5",
262262
val mtuTestParallelismResolvers: String = "100",
263263
val mtuTestRetriesLogs: String = "5",
264-
val mtuTestTimeoutLogs: String = "2.0",
264+
val mtuTestTimeoutLogs: String = "2.5",
265265
val mtuTestParallelismLogs: String = "32",
266266
val rxTxWorkers: String = "4",
267267
val tunnelProcessWorkers: String = "4",
@@ -1620,10 +1620,10 @@ fun WhiteDnsSettings.resolve(): ResolvedWhiteDnsSettings {
16201620
maxUploadMtu = resolvedMaxUploadMtu,
16211621
maxDownloadMtu = resolvedMaxDownloadMtu,
16221622
mtuTestRetriesResolvers = boundedInt(mtuTestRetriesResolvers, defaultValue = 3, minValue = 1, maxValue = 100),
1623-
mtuTestTimeoutResolvers = positiveDouble(mtuTestTimeoutResolvers, defaultValue = 2.0),
1623+
mtuTestTimeoutResolvers = positiveDouble(mtuTestTimeoutResolvers, defaultValue = 2.5),
16241624
mtuTestParallelismResolvers = boundedInt(mtuTestParallelismResolvers, defaultValue = 100, minValue = 1, maxValue = 1024),
16251625
mtuTestRetriesLogs = boundedInt(mtuTestRetriesLogs, defaultValue = 5, minValue = 1, maxValue = 100),
1626-
mtuTestTimeoutLogs = positiveDouble(mtuTestTimeoutLogs, defaultValue = 2.0),
1626+
mtuTestTimeoutLogs = positiveDouble(mtuTestTimeoutLogs, defaultValue = 2.5),
16271627
mtuTestParallelismLogs = boundedInt(mtuTestParallelismLogs, defaultValue = 32, minValue = 1, maxValue = 1024),
16281628
rxTxWorkers = resolvedRxTxWorkers,
16291629
tunnelProcessWorkers = resolvedTunnelProcessWorkers,

app/src/main/java/shop/whitedns/client/ui/WhiteDnsScreen.kt

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,9 @@ private enum class WhiteDnsTab(
306306

307307
private const val ScanWorkerMin = 1
308308
private const val ScanWorkerMax = 32
309-
private const val MtuParallelismMin = 1
310-
private const val MtuParallelismMax = 1024
309+
private const val MtuParallelismMin = 50
310+
private const val MtuParallelismMax = 1000
311+
private const val MtuParallelismStep = 50
311312
private const val MtuParallelismDefault = 100
312313

313314
private enum class CompactActionTone {
@@ -1154,7 +1155,7 @@ private fun ParallelTestSelectionPanel(
11541155
)
11551156
ParallelTestConfigRow(
11561157
label = WhiteDnsL10n.whiteDnsConfigsLabel,
1157-
detail = "+${stableWhiteDnsConfigIds.size}",
1158+
detail = WhiteDnsL10n.whiteDnsConfigsDescription,
11581159
checked = allStableWhiteDnsSelected,
11591160
enabled = controlsEnabled && canAddStableWhiteDnsConfigs,
11601161
onToggle = {
@@ -1171,7 +1172,7 @@ private fun ParallelTestSelectionPanel(
11711172
)
11721173
ParallelTestConfigRow(
11731174
label = WhiteDnsL10n.whiteDnsAggressiveConfigsLabel,
1174-
detail = "+${aggressiveWhiteDnsConfigIds.size}",
1175+
detail = WhiteDnsL10n.whiteDnsAggressiveConfigsDescription,
11751176
checked = allAggressiveWhiteDnsSelected,
11761177
enabled = controlsEnabled && canAddAggressiveWhiteDnsConfigs,
11771178
onToggle = {
@@ -1275,11 +1276,12 @@ private fun ParallelTestConfigRow(
12751276
)
12761277
Text(
12771278
text = detail,
1278-
maxLines = 1,
1279+
maxLines = 2,
12791280
overflow = TextOverflow.Ellipsis,
12801281
style = MaterialTheme.typography.bodySmall.copy(
12811282
fontSize = 10.sp,
12821283
color = WhiteDnsPalette.Muted.copy(alpha = contentAlpha),
1284+
lineHeight = 14.sp,
12831285
),
12841286
)
12851287
}
@@ -2069,7 +2071,7 @@ private fun MtuParallelismSlider(
20692071
onParallelismChange: (Int) -> Unit,
20702072
) {
20712073
val context = LocalContext.current
2072-
var sliderValue by remember(parallelism) { mutableStateOf(parallelism.toFloat()) }
2074+
var sliderValue by remember(parallelism) { mutableStateOf(parallelism.toMtuParallelismSliderValue().toFloat()) }
20732075
val displayedParallelism = sliderValue.toMtuParallelismSliderValue()
20742076
Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
20752077
Row(
@@ -2088,9 +2090,9 @@ private fun MtuParallelismSlider(
20882090
)
20892091
}
20902092
Slider(
2091-
value = sliderValue.coerceIn(MtuParallelismMin.toFloat(), MtuParallelismMax.toFloat()),
2093+
value = sliderValue,
20922094
onValueChange = { value ->
2093-
sliderValue = value.coerceIn(MtuParallelismMin.toFloat(), MtuParallelismMax.toFloat())
2095+
sliderValue = value.toMtuParallelismSliderValue().toFloat()
20942096
},
20952097
onValueChangeFinished = {
20962098
val committedParallelism = sliderValue.toMtuParallelismSliderValue()
@@ -2100,7 +2102,7 @@ private fun MtuParallelismSlider(
21002102
},
21012103
enabled = enabled,
21022104
valueRange = MtuParallelismMin.toFloat()..MtuParallelismMax.toFloat(),
2103-
steps = 0,
2105+
steps = ((MtuParallelismMax - MtuParallelismMin) / MtuParallelismStep) - 1,
21042106
modifier = Modifier.semantics {
21052107
contentDescription = context.getString(R.string.cd_mtu_parallelism_slider, displayedParallelism)
21062108
},
@@ -2125,11 +2127,16 @@ private fun MtuParallelismSlider(
21252127
}
21262128

21272129
private fun String.toMtuParallelismSliderValue(): Int {
2128-
return toIntOrNull()?.coerceIn(MtuParallelismMin, MtuParallelismMax) ?: MtuParallelismDefault
2130+
return toIntOrNull()?.toMtuParallelismSliderValue() ?: MtuParallelismDefault
21292131
}
21302132

21312133
private fun Float.toMtuParallelismSliderValue(): Int {
2132-
return roundToInt().coerceIn(MtuParallelismMin, MtuParallelismMax)
2134+
return roundToInt().toMtuParallelismSliderValue()
2135+
}
2136+
2137+
private fun Int.toMtuParallelismSliderValue(): Int {
2138+
val rounded = (this.toFloat() / MtuParallelismStep).roundToInt() * MtuParallelismStep
2139+
return rounded.coerceIn(MtuParallelismMin, MtuParallelismMax)
21332140
}
21342141

21352142
@Composable

app/src/main/java/shop/whitedns/client/ui/WhiteDnsStrings.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,9 @@ interface WhiteDnsStrings {
495495
val noResolversPlaceholder: String
496496
val whiteDnsResolversLabel: String
497497
val whiteDnsConfigsLabel: String
498+
val whiteDnsConfigsDescription: String
498499
val whiteDnsAggressiveConfigsLabel: String
500+
val whiteDnsAggressiveConfigsDescription: String
499501
val whiteDnsLogsLabel: String
500502
val whiteDnsDiagnosticsLabel: String
501503
val parallelTestCollapseDescription: String
@@ -1166,7 +1168,9 @@ object EnglishStrings : WhiteDnsStrings {
11661168
override val noResolversPlaceholder = "No resolvers"
11671169
override val whiteDnsResolversLabel = "WhiteDNS resolvers"
11681170
override val whiteDnsConfigsLabel = "WhiteDNS configs"
1169-
override val whiteDnsAggressiveConfigsLabel = "Aggressive configs"
1171+
override val whiteDnsConfigsDescription = "Conservative: lower data usage, recommended for most users"
1172+
override val whiteDnsAggressiveConfigsLabel = "High usage configs"
1173+
override val whiteDnsAggressiveConfigsDescription = "High usage: use when internet usage is not a concern"
11701174
override val whiteDnsLogsLabel = "WhiteDNS logs"
11711175
override val whiteDnsDiagnosticsLabel = "WhiteDNS diagnostics"
11721176
override val parallelTestCollapseDescription = "Collapse Parallel Test configs"
@@ -1824,7 +1828,9 @@ object PersianStrings : WhiteDnsStrings {
18241828
override val noResolversPlaceholder = "بدون ریزالور"
18251829
override val whiteDnsResolversLabel = "ریزالورهای WhiteDNS"
18261830
override val whiteDnsConfigsLabel = "تنظیمات WhiteDNS"
1827-
override val whiteDnsAggressiveConfigsLabel = "تنظیمات پرریسک"
1831+
override val whiteDnsConfigsDescription = "محافظه‌کارانه: مصرف اینترنت کمتر، مناسب بیشتر کاربران"
1832+
override val whiteDnsAggressiveConfigsLabel = "تنظیمات پرمصرف"
1833+
override val whiteDnsAggressiveConfigsDescription = "پرمصرف: وقتی مصرف اینترنت برایتان مهم نیست استفاده کنید"
18281834
override val whiteDnsLogsLabel = "لاگ‌های WhiteDNS"
18291835
override val whiteDnsDiagnosticsLabel = "تشخیص WhiteDNS"
18301836
override val parallelTestCollapseDescription = "بستن تنظیمات تست موازی"

app/src/main/java/shop/whitedns/client/ui/WhiteDnsTheme.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,9 @@ object WhiteDnsL10n {
627627
val noResolversPlaceholder: String @Composable get() = LocalWhiteDnsStrings.current.noResolversPlaceholder
628628
val whiteDnsResolversLabel: String @Composable get() = LocalWhiteDnsStrings.current.whiteDnsResolversLabel
629629
val whiteDnsConfigsLabel: String @Composable get() = LocalWhiteDnsStrings.current.whiteDnsConfigsLabel
630+
val whiteDnsConfigsDescription: String @Composable get() = LocalWhiteDnsStrings.current.whiteDnsConfigsDescription
630631
val whiteDnsAggressiveConfigsLabel: String @Composable get() = LocalWhiteDnsStrings.current.whiteDnsAggressiveConfigsLabel
632+
val whiteDnsAggressiveConfigsDescription: String @Composable get() = LocalWhiteDnsStrings.current.whiteDnsAggressiveConfigsDescription
631633
val whiteDnsLogsLabel: String @Composable get() = LocalWhiteDnsStrings.current.whiteDnsLogsLabel
632634
val whiteDnsDiagnosticsLabel: String @Composable get() = LocalWhiteDnsStrings.current.whiteDnsDiagnosticsLabel
633635
val parallelTestCollapseDescription: String @Composable get() = LocalWhiteDnsStrings.current.parallelTestCollapseDescription

0 commit comments

Comments
 (0)