fix: bugs
Some checks failed
CI / build (push) Has been cancelled

This commit is contained in:
xtclovver 2026-05-25 20:14:54 +03:00
parent f6e9df2a35
commit 7142ea1c6c
9 changed files with 36 additions and 20 deletions

View file

@ -29,8 +29,8 @@ android {
applicationId = "com.notcvnt.rknhardering"
minSdk = 26
targetSdk = 36
versionCode = 20800
versionName = "2.8.0"
versionCode = 20801
versionName = "2.8.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
androidResources.localeFilters += listOf("en", "ru", "fa", "zh-rCN")

View file

@ -82,14 +82,18 @@ class CheckViewModel(app: Application) : AndroidViewModel(app) {
}
}
if (isCurrentScan(scanId, executionContext)) {
val app: Application = getApplication()
val customEnabled = AppUiSettings.prefs(app)
.getBoolean(SettingsPrefs.PREF_CUSTOM_CHECKS_ENABLED, false)
val profile = if (customEnabled) CustomCheckRunner.getActiveProfile(app) else null
val enrichedResult = result.copy(
customProfileId = profile?.id,
customProfileName = profile?.name,
)
val enrichedResult = try {
val app: Application = getApplication()
val customEnabled = AppUiSettings.prefs(app)
.getBoolean(SettingsPrefs.PREF_CUSTOM_CHECKS_ENABLED, false)
val profile = if (customEnabled) CustomCheckRunner.getActiveProfile(app) else null
result.copy(
customProfileId = profile?.id,
customProfileName = profile?.name,
)
} catch (_: Exception) {
result
}
appendScanEvent(scanId, ScanEvent.Completed(enrichedResult, privacyMode))
}
} catch (e: kotlinx.coroutines.CancellationException) {

View file

@ -1306,15 +1306,11 @@ class MainActivity : AppCompatActivity() {
}
private fun resolveTextColorPrimary(): Int {
val tv = android.util.TypedValue()
theme.resolveAttribute(android.R.attr.textColorPrimary, tv, true)
return getColor(tv.resourceId)
return MaterialColors.getColor(this, android.R.attr.textColorPrimary, 0xFFFFFFFF.toInt())
}
private fun resolveTextColorSecondary(): Int {
val tv = android.util.TypedValue()
theme.resolveAttribute(android.R.attr.textColorSecondary, tv, true)
return getColor(tv.resourceId)
return MaterialColors.getColor(this, android.R.attr.textColorSecondary, 0x99FFFFFF.toInt())
}
private fun updateTileFromDomainReachability(result: DomainReachabilityResult) {

View file

@ -446,7 +446,7 @@ object VpnCheckRunner {
}
val operatorWhitelistDeferred = if (settings.networkRequestsEnabled) {
safeAsync<OperatorWhitelistProbeResult?>(fallback = { null }) {
safeAsync<OperatorWhitelistProbeResult?>(context = Dispatchers.IO, fallback = { null }) {
dependencies.operatorWhitelistProbe()
}
} else null

View file

@ -2,7 +2,7 @@ package com.notcvnt.rknhardering.probe
import kotlinx.coroutines.async
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.withTimeout
import kotlinx.coroutines.withTimeoutOrNull
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.dnsoverhttps.DnsOverHttps
@ -24,7 +24,7 @@ object OperatorWhitelistProbe {
val startMs = System.currentTimeMillis()
val errors = mutableMapOf<String, String>()
val (googleOk, appleOk, firefoxOk, ruOk) = withTimeout(PROBE_TIMEOUT_MS) {
val results = withTimeoutOrNull(PROBE_TIMEOUT_MS) {
coroutineScope {
val googleDeferred = async { checkGoogle(errors) }
val appleDeferred = async { checkApple(errors) }
@ -37,7 +37,11 @@ object OperatorWhitelistProbe {
ruDeferred.await(),
)
}
}
} ?: arrayOf(false, false, false, false)
val googleOk = results[0]
val appleOk = results[1]
val firefoxOk = results[2]
val ruOk = results[3]
val allCaptiveFailed = !googleOk && !appleOk && !firefoxOk
val whitelistDetected = allCaptiveFailed && ruOk

View file

@ -0,0 +1,3 @@
Fixed check interruption (crash) during long network timeouts in the operator whitelist probe.
Improved stability of applying custom profiles when building scan results.
Fixed a potential crash when resolving system colors in the UI.

View file

@ -0,0 +1,3 @@
1. رفع مشکل توقف (کرش) بررسی به دلیل تایم‌اوت‌های طولانی شبکه در کاوشگر وایت‌لیست اپراتور.
2. بهبود پایداری اعمال پروفایل‌های سفارشی هنگام ایجاد نتایج اسکن.
3. رفع کرش احتمالی هنگام تشخیص رنگ‌های سیستم در رابط کاربری.

View file

@ -0,0 +1,3 @@
Исправлено прерывание (краш) проверки при долгих сетевых таймаутах в зонде «белых списков» оператора.
Повышена стабильность применения кастомных профилей при формировании результатов сканирования.
Исправлен потенциальный краш при определении системных цветов в интерфейсе.

View file

@ -0,0 +1,3 @@
1. 修复了在运营商白名单探测中因长时间网络超时导致的检查中断(崩溃)问题。
2. 提高了在生成扫描结果时应用自定义配置文件的稳定性。
3. 修复了在界面中解析系统颜色时可能发生的崩溃问题。