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,11 +206,15 @@ class ByeDpiVpnService : VpnService() {
withContext(Dispatchers.IO) {
hostlist.printWriter().use { out ->
lists.forEach {
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,6 +84,7 @@ fun setStartOnBoot(startOnBoot: Boolean) {
fun getStartOnBoot(): Boolean {
val configFile = getConfigFile()
if (configFile.exists()) {
val props = Properties()
return try {
if (configFile.exists()) {
@@ -98,6 +99,8 @@ fun getStartOnBoot(): Boolean {
false
}
}
return false
}
fun getZaprettPath(): String {
val props = Properties()