micro bug fix

This commit is contained in:
CherretGit
2025-09-30 18:40:12 +07:00
parent c67846a7e4
commit 1e985807d9
3 changed files with 21 additions and 15 deletions

View File

@@ -14,6 +14,7 @@ import androidx.core.app.NotificationCompat
import com.cherret.zaprett.MainActivity
import com.cherret.zaprett.R
import com.cherret.zaprett.data.ServiceStatus
import com.cherret.zaprett.utils.disableList
import com.cherret.zaprett.utils.getActiveExcludeLists
import com.cherret.zaprett.utils.getActiveLists
import com.cherret.zaprett.utils.getActiveStrategy
@@ -205,10 +206,14 @@ class ByeDpiVpnService : VpnService() {
withContext(Dispatchers.IO) {
hostlist.printWriter().use { out ->
lists.forEach {
it.bufferedReader().useLines {
it.forEach {
out.println(it)
if (it.exists()) {
it.bufferedReader().useLines {
it.forEach {
out.println(it)
}
}
} else {
disableList(it.name, sharedPreferences)
}
}
}

View File

@@ -196,9 +196,7 @@ private fun UpdateCard(updateAvailable: MutableState<Boolean>, onClick: () -> Un
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceVariant),
modifier = Modifier
.fillMaxWidth()
.padding(start = 10.dp, top = 10.dp, end = 10.dp)
.width(140.dp)
.height(70.dp),
.padding(start = 10.dp, top = 10.dp, end = 10.dp),
onClick = onClick
) {
Text(

View File

@@ -84,19 +84,22 @@ fun setStartOnBoot(startOnBoot: Boolean) {
fun getStartOnBoot(): Boolean {
val configFile = getConfigFile()
val props = Properties()
return try {
if (configFile.exists()) {
FileInputStream(configFile).use { input ->
props.load(input)
if (configFile.exists()) {
val props = Properties()
return try {
if (configFile.exists()) {
FileInputStream(configFile).use { input ->
props.load(input)
}
props.getProperty("start_on_boot", "false").toBoolean()
} else {
false
}
props.getProperty("start_on_boot", "false").toBoolean()
} else {
} catch (_: IOException) {
false
}
} catch (_: IOException) {
false
}
return false
}
fun getZaprettPath(): String {