mirror of
https://github.com/CherretGit/zaprett-app.git
synced 2025-12-22 11:39:37 +05:00
micro bug fix
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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 {
|
||||
Reference in New Issue
Block a user