41 Commits

Author SHA1 Message Date
cheesedroid
dac08f7588 Update build.gradle.kts 2026-01-11 19:42:26 +03:00
CherretGit
4112145a64 strip symbols 2026-01-11 22:28:17 +07:00
CherretGit
3e098de4dc remove unused imports 2026-01-11 22:10:02 +07:00
CherretGit
7454f5f90b fix padding 2026-01-11 22:01:02 +07:00
CherretGit
56b44ea0ba Revert "fix padding"
This reverts commit 686a9b0444.
2026-01-10 22:06:23 +07:00
CherretGit
686a9b0444 fix padding 2026-01-10 21:38:35 +07:00
CherretGit
1eb913b436 improve jni 2026-01-10 20:13:50 +07:00
CherretGit
962aff21f0 Merge pull request #35 from mewmrow/upd-readme
Update README.md
2026-01-04 21:31:46 +07:00
meow ᗜˬᗜ
d9469b5ab3 Update README.md 2026-01-04 17:26:51 +03:00
CherretGit
4f4a587242 Merge branch 'm3e' into main 2026-01-04 21:02:11 +07:00
cheesedroid
7cfd3f96f1 Update update.json 2025-12-25 19:48:29 +03:00
cheesedroid
7fce58d729 Update changelog.md 2025-12-25 19:48:02 +03:00
CherretGit
8730c26295 update agp 2025-12-25 23:12:05 +07:00
CherretGit
e0b4eea076 bump version 2025-12-25 23:11:42 +07:00
CherretGit
1e9f043112 fix exclude repo and strategy test 2025-12-25 22:58:45 +07:00
CherretGit
b92e2d94da Merge remote-tracking branch 'origin/main' 2025-12-25 20:12:37 +07:00
CherretGit
71a46f878b android 9 support 2025-12-25 20:12:28 +07:00
cheesedroid
80ae4368a8 Merge pull request #29 from mewmrow/upd-images
updated screenshots for new version 2.13
2025-12-15 16:45:50 +03:00
meow ᗜˬᗜ
b24153c861 final add 8, 9.png 2025-12-15 14:18:15 +03:00
meow ᗜˬᗜ
69be86e084 test 2025-12-15 14:17:32 +03:00
meow ᗜˬᗜ
b4a1b7bf30 added 8, 9.png 2025-12-15 14:16:25 +03:00
meow ᗜˬᗜ
698624e0cd added 8, 9.png 2025-12-15 14:15:50 +03:00
meow ᗜˬᗜ
b854898270 updated 3 images 2025-12-15 14:14:25 +03:00
meow ᗜˬᗜ
387b52d1a4 Delete images/7.png 2025-12-15 14:14:06 +03:00
meow ᗜˬᗜ
6fd1476adb updated 6 images 2025-12-15 14:13:52 +03:00
meow ᗜˬᗜ
e88d142041 Delete images/1.png 2025-12-15 14:13:06 +03:00
meow ᗜˬᗜ
7ac9fea0a3 updated 1.png 2025-12-15 14:12:51 +03:00
meow ᗜˬᗜ
b5a8192eea Delete images/6.png 2025-12-15 14:12:26 +03:00
meow ᗜˬᗜ
014e6b9d58 Delete images/5.png 2025-12-15 14:12:19 +03:00
meow ᗜˬᗜ
e15c212330 Delete images/4.png 2025-12-15 14:12:13 +03:00
meow ᗜˬᗜ
9d7e790caa Delete images/3.png 2025-12-15 14:12:06 +03:00
meow ᗜˬᗜ
893808f327 Delete images/2.png 2025-12-15 14:11:58 +03:00
meow ᗜˬᗜ
f2f8edc48f Delete images/1.png 2025-12-15 14:11:51 +03:00
cheesedroid
774948ae87 Update update.json 2025-12-08 19:45:16 +03:00
cheesedroid
297ce0cdea Update changelog.md 2025-12-08 19:44:53 +03:00
CherretGit
80abf2380a Merge pull request #25 from CherretGit/main
bump version and optimize libbyedpi
2025-12-08 23:16:54 +07:00
white
fd69451adc Merge remote-tracking branch 'origin/m3e' into m3e
# Conflicts:
#	app/src/main/java/com/cherret/zaprett/ui/screen/StrategySelectionScreen.kt
2025-12-08 12:58:26 +03:00
white
611e8ae39c remove unnecessary modifier, return OptIn 2025-12-08 12:57:35 +03:00
CherretGit
21e80d0463 Merge pull request #24 from CherretGit/main
remove unnecessary modifier
2025-12-08 16:57:12 +07:00
white
98f2af3853 update branch from main 2025-12-08 12:50:33 +03:00
CherretGit
d00677270a update dependencies + m3e 2025-12-07 20:58:01 +07:00
35 changed files with 140 additions and 99 deletions

View File

@@ -4,10 +4,10 @@
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2025-10-03T07:21:08.712998131Z">
<DropdownSelection timestamp="2026-01-10T16:13:45.882808992Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="LocalEmulator" identifier="path=/home/dimap/.android/avd/Medium_Phone.avd" />
<DeviceId pluginId="LocalEmulator" identifier="path=/home/dimap/.android/avd/Medium_Phone_2.avd" />
</handle>
</Target>
</DropdownSelection>

View File

@@ -17,6 +17,7 @@
На данный момент приложение умеет:
* Запускать, останавливать и перезапускать сервис
* Работа с листами (добавление, включение и выключение, загрузка из репозитория)
* Работа с айписетами (добавление, включение и выключение, загрузка из репозитория)
* Работа с стратегиями (добавление, выбор, загрузка из репозитория)
* Авто обновление приложения
@@ -39,4 +40,6 @@
<img src="images/5.png" width="180">
<img src="images/6.png" width="180"><br>
<img src="images/7.png" width="180">
<img src="images/8.png" width="180">
<img src="images/9.png" width="180">
</p>

View File

@@ -14,10 +14,10 @@ android {
defaultConfig {
applicationId = "com.cherret.zaprett"
minSdk = 29
minSdk = 28
targetSdk = 35
versionCode = 25
versionName = "2.13"
versionCode = 27
versionName = "2.15"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

View File

@@ -1,3 +1,4 @@
@file:OptIn(ExperimentalMaterial3ExpressiveApi::class)
package com.cherret.zaprett
import android.Manifest
@@ -7,7 +8,6 @@ import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.os.Environment
import android.provider.Settings
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
@@ -16,6 +16,7 @@ import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.viewModels
import androidx.annotation.StringRes
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Home
@@ -24,6 +25,7 @@ import androidx.compose.material.icons.filled.MultipleStop
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material.icons.filled.SettingsInputComposite
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.Icon
import androidx.compose.material3.NavigationBar
import androidx.compose.material3.NavigationBarItem
@@ -207,7 +209,7 @@ class MainActivity : ComponentActivity() {
NavHost(
navController,
startDestination = Screen.home.route,
Modifier.padding(innerPadding)
Modifier.padding(innerPadding).consumeWindowInsets(innerPadding)
) {
composable(Screen.home.route) { HomeScreen(viewModel = viewModel,vpnPermissionLauncher) }
composable(Screen.hosts.route) { HostsScreen(navController) }

View File

@@ -8,6 +8,7 @@ import android.app.PendingIntent
import android.content.Intent
import android.content.SharedPreferences
import android.net.VpnService
import android.os.Build
import android.os.ParcelFileDescriptor
import android.util.Log
import androidx.core.app.NotificationCompat
@@ -20,7 +21,6 @@ import com.cherret.zaprett.utils.getActiveExcludeIpsets
import com.cherret.zaprett.utils.getActiveExcludeLists
import com.cherret.zaprett.utils.getActiveIpsets
import com.cherret.zaprett.utils.getActiveLists
import com.cherret.zaprett.utils.getActiveStrategy
import com.cherret.zaprett.utils.getAppsListMode
import com.cherret.zaprett.utils.getHostListMode
import kotlinx.coroutines.CoroutineScope
@@ -130,7 +130,9 @@ class ByeDpiVpnService : VpnService() {
.addAddress("10.10.10.10", 32)
.addDnsServer(dns)
.addRoute("0.0.0.0", 0)
.setMetered(false)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
builder.setMetered(false)
}
if (ipv6) {
builder.addAddress("fd00::1", 128)
.addRoute("::", 0)

View File

@@ -1,6 +1,5 @@
package com.cherret.zaprett.ui.component
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth

View File

@@ -1,3 +1,4 @@
@file:OptIn(ExperimentalMaterial3ExpressiveApi::class)
package com.cherret.zaprett.ui.screen
import android.app.Activity
@@ -11,11 +12,9 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
@@ -23,10 +22,8 @@ import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource

View File

@@ -1,3 +1,4 @@
@file:OptIn(ExperimentalMaterial3ExpressiveApi::class)
package com.cherret.zaprett.ui.screen
import android.content.ClipData
@@ -39,6 +40,7 @@ import androidx.compose.material3.AlertDialog
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.FilledTonalButton
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
@@ -69,15 +71,12 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavController
import com.cherret.zaprett.BuildConfig
import com.cherret.zaprett.R
import com.cherret.zaprett.data.ServiceStatusUI
import com.cherret.zaprett.ui.viewmodel.HomeViewModel
import dev.jeziellago.compose.markdowntext.MarkdownText
import kotlinx.coroutines.CoroutineScope
import kotlinx.serialization.SerializationException
import java.io.IOException
@OptIn(ExperimentalMaterial3Api::class)
@Composable

View File

@@ -1,3 +1,4 @@
@file:OptIn(ExperimentalMaterial3ExpressiveApi::class)
package com.cherret.zaprett.ui.screen
import android.content.ClipData
@@ -27,6 +28,7 @@ import androidx.compose.material3.AlertDialog
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.Scaffold
@@ -41,7 +43,6 @@ import androidx.compose.material3.TopAppBar
import androidx.compose.material3.pulltorefresh.PullToRefreshBox
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf

View File

@@ -1,3 +1,4 @@
@file:OptIn(ExperimentalMaterial3ExpressiveApi::class)
package com.cherret.zaprett.ui.screen
import android.content.ClipData
@@ -27,6 +28,7 @@ import androidx.compose.material3.AlertDialog
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.Scaffold
@@ -61,7 +63,6 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavController
import com.cherret.zaprett.R
import com.cherret.zaprett.ui.component.ListSwitchItem
import com.cherret.zaprett.ui.viewmodel.HostsViewModel
import com.cherret.zaprett.ui.viewmodel.IpsetViewModel
import com.cherret.zaprett.utils.getHostListMode

View File

@@ -1,3 +1,4 @@
@file:OptIn(ExperimentalMaterial3ExpressiveApi::class)
package com.cherret.zaprett.ui.screen
import android.content.ClipData
@@ -15,6 +16,7 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold

View File

@@ -1,3 +1,4 @@
@file:OptIn(ExperimentalMaterial3ExpressiveApi::class)
package com.cherret.zaprett.ui.screen
import android.content.Context
@@ -32,6 +33,7 @@ import androidx.compose.material3.Checkbox
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.ModalBottomSheet
@@ -41,7 +43,6 @@ import androidx.compose.material3.Scaffold
import androidx.compose.material3.Switch
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.TextField
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
@@ -73,23 +74,16 @@ import androidx.navigation.NavController
import coil3.compose.AsyncImage
import com.cherret.zaprett.BuildConfig
import com.cherret.zaprett.R
import com.cherret.zaprett.byedpi.ByeDpiVpnService
import com.cherret.zaprett.data.AppListType
import com.cherret.zaprett.data.Setting
import com.cherret.zaprett.ui.component.InfoDialog
import com.cherret.zaprett.ui.component.SettingsActionItem
import com.cherret.zaprett.ui.component.SettingsItem
import com.cherret.zaprett.ui.component.SettingsSection
import com.cherret.zaprett.data.AppListType
import com.cherret.zaprett.data.ServiceStatus
import com.cherret.zaprett.ui.component.InfoDialog
import com.cherret.zaprett.data.Setting
import com.cherret.zaprett.ui.component.TextDialog
import com.cherret.zaprett.ui.viewmodel.SettingsViewModel
import com.cherret.zaprett.utils.checkModuleInstallation
import com.cherret.zaprett.utils.checkRoot
import com.cherret.zaprett.utils.getAppsListMode
import com.cherret.zaprett.utils.getStartOnBoot
import com.cherret.zaprett.utils.setAppsListMode
import com.cherret.zaprett.utils.setStartOnBoot
import com.cherret.zaprett.utils.stopService
@OptIn(ExperimentalMaterial3Api::class)
@Composable

View File

@@ -1,3 +1,4 @@
@file:OptIn(ExperimentalMaterial3ExpressiveApi::class)
package com.cherret.zaprett.ui.screen
import android.content.ClipData
@@ -24,6 +25,7 @@ import androidx.compose.material3.AlertDialog
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.Scaffold

View File

@@ -1,3 +1,4 @@
@file:OptIn(ExperimentalMaterial3ExpressiveApi::class)
package com.cherret.zaprett.ui.screen
import android.content.ClipData
@@ -16,33 +17,17 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Info
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FilledTonalButton
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
@@ -50,6 +35,22 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Info
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.FilledTonalButton
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.TextButton
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.platform.LocalContext
import androidx.lifecycle.viewModelScope
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavController
@@ -235,4 +236,4 @@ private fun NoHostsCard(noHostsCard: MutableState<Boolean>) {
}
)
}
}
}

View File

@@ -2,7 +2,10 @@ package com.cherret.zaprett.ui.theme
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.MaterialExpressiveTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MotionScheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
@@ -32,6 +35,7 @@ private val LightColorScheme = lightColorScheme(
*/
)
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
@Composable
fun ZaprettTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
@@ -49,9 +53,10 @@ fun ZaprettTheme(
else -> LightColorScheme
}
MaterialTheme(
MaterialExpressiveTheme(
colorScheme = colorScheme,
typography = Typography,
motionScheme = MotionScheme.expressive(),
content = content
)
}

View File

@@ -2,10 +2,12 @@ package com.cherret.zaprett.ui.viewmodel
import android.app.Application
import com.cherret.zaprett.utils.RepoItemInfo
import com.cherret.zaprett.utils.getAllExcludeLists
import com.cherret.zaprett.utils.getAllLists
import com.cherret.zaprett.utils.getHostList
import com.cherret.zaprett.utils.getHostListMode
class HostRepoViewModel(application: Application): BaseRepoViewModel(application) {
override fun getInstalledLists(): Array<String> = getAllLists()
override fun getInstalledLists(): Array<String> = if (getHostListMode(sharedPreferences) == "whitelist") getAllLists() else getAllExcludeLists()
override fun getRepoList(callback: (Result<List<RepoItemInfo>>) -> Unit) = getHostList(sharedPreferences, callback)
}

View File

@@ -2,13 +2,13 @@ package com.cherret.zaprett.ui.viewmodel
import android.app.Application
import com.cherret.zaprett.utils.RepoItemInfo
import com.cherret.zaprett.utils.getAllExcludeIpsets
import com.cherret.zaprett.utils.getAllIpsets
import com.cherret.zaprett.utils.getAllLists
import com.cherret.zaprett.utils.getHostList
import com.cherret.zaprett.utils.getHostListMode
import com.cherret.zaprett.utils.getIpsetList
class IpsetRepoViewModel(application: Application): BaseRepoViewModel(application) {
override fun getInstalledLists(): Array<String> = getAllIpsets()
override fun getInstalledLists(): Array<String> = if(getHostListMode(sharedPreferences) == "whitelist") getAllIpsets() else getAllExcludeIpsets()
override fun getRepoList(callback: (Result<List<RepoItemInfo>>) -> Unit) =
getIpsetList(sharedPreferences, callback)
}

View File

@@ -4,11 +4,8 @@ import android.app.Application
import android.content.Context
import androidx.compose.material3.SnackbarHostState
import com.cherret.zaprett.utils.disableIpset
import com.cherret.zaprett.utils.disableList
import com.cherret.zaprett.utils.enableIpset
import com.cherret.zaprett.utils.enableList
import com.cherret.zaprett.utils.getActiveExcludeIpsets
import com.cherret.zaprett.utils.getActiveExcludeLists
import com.cherret.zaprett.utils.getActiveIpsets
import com.cherret.zaprett.utils.getAllExcludeIpsets
import com.cherret.zaprett.utils.getAllIpsets

View File

@@ -8,7 +8,6 @@ import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.mutableStateOf
import androidx.core.content.ContextCompat
import androidx.lifecycle.AndroidViewModel
import com.cherret.zaprett.R
import com.cherret.zaprett.byedpi.ByeDpiVpnService
import com.cherret.zaprett.data.ServiceStatus
import com.cherret.zaprett.data.StrategyCheckResult
@@ -16,7 +15,6 @@ import com.cherret.zaprett.data.StrategyTestingStatus
import com.cherret.zaprett.utils.disableStrategy
import com.cherret.zaprett.utils.enableStrategy
import com.cherret.zaprett.utils.getActiveLists
import com.cherret.zaprett.utils.getActiveStrategy
import com.cherret.zaprett.utils.getAllStrategies
import com.cherret.zaprett.utils.getStatus
import com.cherret.zaprett.utils.startService
@@ -27,7 +25,6 @@ import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.withContext
import kotlinx.coroutines.withTimeoutOrNull
@@ -122,7 +119,7 @@ class StrategySelectionViewModel(application: Application) : AndroidViewModel(ap
}
suspend fun performTest() {
val targets = readActiveListsLines()
var stopTest : Boolean = false;
var stopTest = false
for (index in strategyStates.indices) {
val current = strategyStates[index]
if (stopTest) break
@@ -133,9 +130,11 @@ class StrategySelectionViewModel(application: Application) : AndroidViewModel(ap
_errorFlow.value = error
if (error.isNotEmpty()) stopTest = true
} }
startService { error ->
_errorFlow.value = error
if (error.isNotEmpty()) stopTest = true
getStatus {
if (!it) startService { error ->
_errorFlow.value = error
if (error.isNotEmpty()) stopTest = true
}
}
try {
val progress = countReachable(index, targets)

View File

@@ -1,16 +1,11 @@
package com.cherret.zaprett.utils
import android.annotation.SuppressLint
import android.app.DownloadManager
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.SharedPreferences
import android.net.Uri
import android.os.Build
import android.os.Environment
import androidx.core.content.ContextCompat
import androidx.core.content.FileProvider
import androidx.core.net.toUri
import com.cherret.zaprett.BuildConfig

View File

@@ -1,3 +1,2 @@
1. Изменения под новую версию модуля
2. Исправление работы ipset с byedpi
3. Исправление вылетов
1. Добавление поддержки Android 9
2. Исправление ошибок

View File

@@ -1,21 +1,21 @@
[versions]
agp = "8.13.1"
kotlin = "2.2.10"
agp = "8.13.2"
kotlin = "2.2.21"
coreKtx = "1.17.0"
junit = "4.13.2"
junitVersion = "1.3.0"
espressoCore = "3.7.0"
lifecycleRuntimeKtx = "2.9.2"
activityCompose = "1.10.1"
composeBom = "2025.08.00"
compose-material3 = "1.3.2"
compose-material3-adaptive = "1.4.0-beta02"
navigation = "2.9.3"
lifecycleRuntimeKtx = "2.10.0"
activityCompose = "1.12.1"
composeBom = "2025.12.00"
compose-material3 = "1.5.0-alpha10"
compose-material3-adaptive = "1.5.0-alpha10"
navigation = "2.9.6"
compose-icons = "1.7.8"
libsu = "6.0.0"
okhttp = "5.1.0"
okhttp = "5.3.2"
serialization = "1.9.0"
firebase-bom = "34.1.0"
firebase-bom = "34.6.0"
fragment-compose = "1.8.9"
coil3 = "3.3.0"
compose-markdown = "0.5.7"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 119 KiB

BIN
images/8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
images/9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

43
rust/Cargo.lock generated
View File

@@ -28,6 +28,18 @@ dependencies = [
"log",
]
[[package]]
name = "autocfg"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
[[package]]
name = "bitflags"
version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
[[package]]
name = "byedpi"
version = "0.1.0"
@@ -35,9 +47,8 @@ dependencies = [
"android_logger",
"cmake",
"jni",
"libc",
"log",
"once_cell",
"nix",
]
[[package]]
@@ -68,6 +79,12 @@ version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
[[package]]
name = "cfg_aliases"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "cmake"
version = "0.1.54"
@@ -144,10 +161,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
[[package]]
name = "once_cell"
version = "1.21.3"
name = "memoffset"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
dependencies = [
"autocfg",
]
[[package]]
name = "nix"
version = "0.30.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6"
dependencies = [
"bitflags",
"cfg-if",
"cfg_aliases",
"libc",
"memoffset",
]
[[package]]
name = "proc-macro2"

View File

@@ -5,10 +5,9 @@ edition = "2024"
[dependencies]
jni = "0.21.1"
libc = "0.2.0"
android_logger = "0.15.1"
log = "0.4"
once_cell = "1.21.3"
nix = { version = "0.30.1", features = ["socket"] }
[lib]
crate-type = ["cdylib"]
@@ -19,5 +18,5 @@ cmake = "0.1.49"
[profile.release]
opt-level = "z"
lto = true
strip = true
strip = "symbols"
codegen-units = 1

View File

@@ -1,11 +1,11 @@
use android_logger::Config;
use core::ffi::{c_char, c_int};
use jni::JNIEnv;
use jni::objects::{JClass, JObjectArray, JString};
use jni::sys::jint;
use libc::{SHUT_RDWR, shutdown};
use log::{LevelFilter, info};
use log::{LevelFilter, error, info};
use nix::sys::socket::{Shutdown, shutdown};
use std::ffi::CString;
use std::os::raw::c_char;
use std::sync::atomic::{AtomicBool, Ordering};
static PROXY_RUNNING: AtomicBool = AtomicBool::new(false);
@@ -15,7 +15,7 @@ unsafe extern "C" {
static mut server_fd: i32;
static mut optind: i32;
static mut optreset: i32;
fn main(argc: libc::c_int, argv: *const *const c_char) -> libc::c_int;
fn main(argc: c_int, argv: *const *const c_char) -> c_int;
fn clear_params();
}
@@ -65,10 +65,19 @@ pub unsafe extern "system" fn Java_com_cherret_zaprett_byedpi_NativeBridge_jniSt
) -> jint {
init_logger();
if !PROXY_RUNNING.load(Ordering::SeqCst) {
info!("failed to stop proxy");
info!("proxy already stopped");
return -1;
}
info!("stopping proxy");
let ret = unsafe { shutdown(server_fd, SHUT_RDWR) };
ret as jint
let ret = unsafe { shutdown(server_fd, Shutdown::Both) };
match ret {
Ok(_) => {
info!("proxy stopped successfully");
0
}
Err(e) => {
error!("failed to stop proxy {}", e);
-1
}
}
}

View File

@@ -1,6 +1,6 @@
{
"version": "2.12",
"versionCode": 24,
"downloadUrl": "https://github.com/CherretGit/zaprett-app/releases/download/2.12.0/app-release.apk",
"version": "2.14",
"versionCode": 26,
"downloadUrl": "https://github.com/CherretGit/zaprett-app/releases/download/2.14.0/app-release.apk",
"changelogUrl": "https://raw.githubusercontent.com/CherretGit/zaprett-app/refs/heads/main/changelog.md"
}