feat: add Russian preset and .srs rules to split tunneling
This commit is contained in:
1 parent
8b4d227e55
commit
9383401188
4 files changed
+132
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,73 @@
|
||||
ru.sberbankmobile
|
||||
com.idamob.tinkoff.android
|
||||
ru.vtb24.mobilebanking.android
|
||||
ru.alfabank.mobile.android
|
||||
ru.rosbank.android
|
||||
com.rbs.mobile.android.rbs
|
||||
ru.mtsbank.mobile
|
||||
ru.gazprombank.android
|
||||
ru.otkritie.mobile
|
||||
ru.psbank.android
|
||||
ru.sovcombank.sovcombank
|
||||
ru.rencredit.mobile
|
||||
ru.sber.sberpay
|
||||
ru.yoomoney.sdk.marchant
|
||||
ru.qiwi.wallet
|
||||
ru.rostel
|
||||
ru.gosuslugi.goskey
|
||||
ru.gosuslugi.auto
|
||||
ru.gosuslugi.culture
|
||||
ru.gosuslugi.pos
|
||||
ru.gosuslugi.volunteer
|
||||
ru.gosuslugi.migrant
|
||||
ru.gosuslugi.school
|
||||
ru.rtlabs.mobile.ebs.gosuslugi.android
|
||||
ru.fanid
|
||||
com.gnivts.selfemployed
|
||||
ru.sigma.gisgkh
|
||||
ru.rosreestr.mobile
|
||||
ru.sitesoft.fssp
|
||||
io.citizens.security
|
||||
ru.nalog.apply
|
||||
ru.fns.billchecker.mobile.android
|
||||
ru.trudvsem.mobile
|
||||
ru.finassist
|
||||
ru.pkd.gosuslugi
|
||||
ru.yandex.searchplugin
|
||||
com.yandex.browser
|
||||
ru.yandex.taximeter
|
||||
ru.yandex.food
|
||||
ru.yandex.music
|
||||
ru.yandex.disk
|
||||
ru.yandex.yandexmaps
|
||||
ru.yandex.navigator
|
||||
com.yandex.mail
|
||||
ru.yandex.metro
|
||||
ru.yandex.plus
|
||||
ru.yandex.taxi
|
||||
com.vkontakte.android
|
||||
ru.ok.android
|
||||
ru.mail.mailapp
|
||||
com.mail.mymail
|
||||
ru.oneme.app
|
||||
ru.ozon.app.android
|
||||
com.wildberries.ru
|
||||
ru.yandex.market
|
||||
ru.sbermegamarket.app
|
||||
com.avito.android
|
||||
ru.domclick.mobile
|
||||
com.cian.mobileapp
|
||||
ru.mts.android
|
||||
ru.tele2.cabinet
|
||||
com.megafon.selfcare
|
||||
ru.beeline.customers.android
|
||||
ru.rzd.rzd
|
||||
ru.aeroflot.passenger
|
||||
ru.mos.app
|
||||
ru.altarix.mos.pgu
|
||||
ru.mos.ed
|
||||
ru.mos.ourcity
|
||||
ru.mos.polls
|
||||
ru.mos.amina.app
|
||||
ru.dublgis.dgismobile
|
||||
com.vk.calls
|
||||
@@ -32,16 +32,24 @@ import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import android.content.Context
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.freeturn.app.R
|
||||
import com.freeturn.app.data.config.SplitTunnelMode
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.io.File
|
||||
import com.freeturn.app.data.config.splitTunnelSelection
|
||||
import com.freeturn.app.data.HapticUtil
|
||||
import com.freeturn.app.data.AppChoice
|
||||
import com.freeturn.app.data.installedInternetApps
|
||||
import com.freeturn.app.data.toPackageSet
|
||||
import com.freeturn.app.ui.components.EmptyState
|
||||
import com.freeturn.app.ui.theme.Spacing
|
||||
|
||||
@@ -81,6 +89,30 @@ fun SplitTunnelModal(
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun loadRussianPreset(context: Context): String? = withContext(Dispatchers.IO) {
|
||||
try {
|
||||
context.assets.open("geoip-ru.srs").use { input ->
|
||||
File(context.filesDir, "geoip-ru.srs").outputStream().use { output ->
|
||||
input.copyTo(output)
|
||||
}
|
||||
}
|
||||
context.assets.open("geosite-ru.srs").use { input ->
|
||||
File(context.filesDir, "geosite-ru.srs").outputStream().use { output ->
|
||||
input.copyTo(output)
|
||||
}
|
||||
}
|
||||
context.assets.open("russian_packages.txt").bufferedReader().use { reader ->
|
||||
val packages = reader.readLines()
|
||||
.map { it.trim() }
|
||||
.filter { it.isNotEmpty() }
|
||||
packages.sorted().joinToString("\n")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Лист split-tunneling с главного экрана. Один общий sheet: свитч вкл/выкл,
|
||||
* выбор режима (include/exclude), поиск и список приложений с иконками/чекбоксами.
|
||||
@@ -165,6 +197,33 @@ fun SplitTunnelSheetContent(
|
||||
}
|
||||
)
|
||||
|
||||
val scope = rememberCoroutineScope()
|
||||
OutlinedButton(
|
||||
onClick = {
|
||||
HapticUtil.perform(context, HapticUtil.Pattern.SELECTION)
|
||||
scope.launch {
|
||||
val preset = loadRussianPreset(context)
|
||||
if (preset != null) {
|
||||
val currentApps = apps.toPackageSet()
|
||||
val presetApps = preset.toPackageSet()
|
||||
val merged = (currentApps + presetApps).sorted().joinToString("\n")
|
||||
onAppsChange(merged)
|
||||
}
|
||||
}
|
||||
},
|
||||
enabled = controlsEnabled,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = HorizontalPadding)
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.cloud_download_24px),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.padding(end = Spacing.sm)
|
||||
)
|
||||
Text("Загрузить пресет РФ")
|
||||
}
|
||||
|
||||
OutlinedTextField(
|
||||
value = query,
|
||||
onValueChange = { query = it },
|
||||
|
||||
Reference in new issue
Block a user