16 Commits
2_0 ... 2_1

Author SHA1 Message Date
CherretGit
cf15ed7559 Update workflow.yml 2025-07-04 18:38:21 +07:00
egor-white
77f6135f6a update ByeDpiVpnService.kt 2025-07-04 14:27:20 +03:00
egor-white
1997bb8403 Merge remote-tracking branch 'origin/main' 2025-07-04 14:17:03 +03:00
CherretGit
b266976a08 Update workflow.yml 2025-07-04 18:06:13 +07:00
egor-white
b5d9ec6f19 remove unused imports 2025-07-04 14:05:48 +03:00
egor-white
b0a4c3d2f5 move byedpi classes to package org.cherret.zaprett.byedpi 2025-07-04 14:04:48 +03:00
egor-white
8f2e7030d8 Update update.json 2025-07-04 12:23:25 +03:00
egor-white
aeb1c6123b Update changelog.md 2025-07-04 12:22:57 +03:00
egor-white
5a423f39c0 Update workflow.yml 2025-07-04 12:08:32 +03:00
egor-white
efeab387af change ver 2025-07-04 11:54:07 +03:00
egor-white
747a4b2052 bug fix 2025-07-04 11:53:16 +03:00
egor-white
6c6eeefcf1 add icon and module info card 2025-07-03 21:00:45 +03:00
CherretGit
0983262919 Update README.md 2025-06-30 12:31:03 +07:00
CherretGit
078c0085bb Update README.md 2025-06-30 12:30:13 +07:00
CherretGit
e87a0434de Update update.json 2025-06-30 01:16:34 +07:00
CherretGit
57d56cb5f2 Update changelog.md 2025-06-30 01:15:29 +07:00
25 changed files with 64 additions and 38 deletions

View File

@@ -28,6 +28,9 @@ jobs:
distribution: 'temurin'
cache: gradle
- name: Setup Git submodules
run: git submodule update --init --recursive
- name: Grant execute permission for gradlew
run: chmod +x gradlew

6
.gitmodules vendored Normal file
View File

@@ -0,0 +1,6 @@
[submodule "app/src/main/cpp/byedpi"]
path = app/src/main/cpp/byedpi
url = https://github.com/hufrea/byedpi
[submodule "app/src/main/jni/hev-socks5-tunnel"]
path = app/src/main/jni/hev-socks5-tunnel
url = https://github.com/heiher/hev-socks5-tunnel

View File

@@ -4,10 +4,10 @@
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2025-03-24T08:57:47.584581613Z">
<DropdownSelection timestamp="2025-06-22T07:39:53.690794081Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="LocalEmulator" identifier="path=/home/dimap/.var/app/com.google.AndroidStudio/config/.android/avd/Medium_Phone.avd" />
<DeviceId pluginId="Default" identifier="serial=10.0.0.189:40463;connection=ffec9c3f" />
</handle>
</Target>
</DropdownSelection>

2
.idea/misc.xml generated
View File

@@ -1,6 +1,6 @@
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@@ -2,9 +2,9 @@
## О приложении
Приложение разработано для работы с модулем [zaprett](https://github.com/egor-white/zaprett)
### [Официальный Telegram-канал приложения](https://t.me/zaprett_module)
## ВНИМАНИЕ приложение работает только с root правами
## ВНИМАНИЕ приложению желательно наличие root прав на устройстве, но есть режим работы без них на основе byedpi
На данный момент приложение умеет:
* Запускать, останавливать и перезапускать модуль
* Запускать, останавливать и перезапускать сервис
* Работа с листами (добавление, включение и выключение, загрузка из репозитория)
* Работа с стратегиями (добавление, выбор, загрузка из репозитория)
* Авто обновление приложения

View File

@@ -15,8 +15,8 @@ android {
applicationId = "com.cherret.zaprett"
minSdk = 30
targetSdk = 35
versionCode = 12
versionName = "2.0"
versionCode = 13
versionName = "2.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
ndk {

View File

@@ -20,8 +20,8 @@
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keep class com.cherret.zaprett.TProxyService {
-keep class com.cherret.zaprett.byedpi.TProxyService {
native long[] TProxyGetStats();
native void TProxyStartService(java.lang.String, int);
native void TProxyStopService();
}
}

View File

@@ -55,7 +55,7 @@
</intent-filter>
</service>
<service
android:name=".ByeDpiVpnService"
android:name=".byedpi.ByeDpiVpnService"
android:exported="true"
android:permission="android.permission.BIND_VPN_SERVICE"
android:foregroundServiceType="specialUse">

View File

@@ -18,7 +18,7 @@ JNIEXPORT jint JNI_OnLoad(
}
JNIEXPORT jint JNICALL
Java_com_cherret_zaprett_NativeBridge_jniCreateSocket(
Java_com_cherret_zaprett_byedpi_NativeBridge_jniCreateSocket(
JNIEnv *env,
__attribute__((unused)) jobject thiz,
jobjectArray args) {
@@ -61,7 +61,7 @@ Java_com_cherret_zaprett_NativeBridge_jniCreateSocket(
}
JNIEXPORT jint JNICALL
Java_com_cherret_zaprett_NativeBridge_jniStartProxy(
Java_com_cherret_zaprett_byedpi_NativeBridge_jniStartProxy(
__attribute__((unused)) JNIEnv *env,
__attribute__((unused)) jobject thiz) {
@@ -76,7 +76,7 @@ Java_com_cherret_zaprett_NativeBridge_jniStartProxy(
}
JNIEXPORT jint JNICALL
Java_com_cherret_zaprett_NativeBridge_jniStopProxy(
Java_com_cherret_zaprett_byedpi_NativeBridge_jniStopProxy(
__attribute__((unused)) JNIEnv *env,
__attribute__((unused)) jobject thiz) {

View File

@@ -200,7 +200,7 @@ fun getActiveStrategy(sharedPreferences: SharedPreferences): List<String> {
}
fun enableList(path: String, sharedPreferences: SharedPreferences) {
if (sharedPreferences.getBoolean("use-module", false)) {
if (sharedPreferences.getBoolean("use_module", false)) {
val props = Properties()
val configFile = getConfigFile()
try {
@@ -264,7 +264,7 @@ fun enableStrategy(path: String, sharedPreferences: SharedPreferences) {
}
fun disableList(path: String, sharedPreferences: SharedPreferences) {
if (sharedPreferences.getBoolean("use-module", false)) {
if (sharedPreferences.getBoolean("use_module", false)) {
val props = Properties()
val configFile = getConfigFile()
try {
@@ -328,4 +328,4 @@ fun disableStrategy(path: String, sharedPreferences: SharedPreferences) {
else {
sharedPreferences.edit { remove("active_strategy") }
}
}
}

View File

@@ -1,11 +1,10 @@
package com.cherret.zaprett
package com.cherret.zaprett.byedpi
import android.annotation.SuppressLint
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.net.VpnService
@@ -13,6 +12,9 @@ import android.os.ParcelFileDescriptor
import android.util.Log
import android.widget.Toast
import androidx.core.app.NotificationCompat
import com.cherret.zaprett.MainActivity
import com.cherret.zaprett.R
import com.cherret.zaprett.getActiveStrategy
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
@@ -30,7 +32,7 @@ class ByeDpiVpnService : VpnService() {
@SuppressLint("ForegroundServiceType")
override fun onCreate() {
super.onCreate()
sharedPreferences = getSharedPreferences("settings", Context.MODE_PRIVATE)
sharedPreferences = getSharedPreferences("settings", MODE_PRIVATE)
createNotificationChannel()
}
@@ -155,6 +157,7 @@ class ByeDpiVpnService : VpnService() {
private fun stopProxy() {
try {
vpnInterface?.close()
vpnInterface = null
NativeBridge().stopProxy()
TProxyService.TProxyStopService()
status = ServiceStatus.Disconnected

View File

@@ -1,4 +1,4 @@
package com.cherret.zaprett
package com.cherret.zaprett.byedpi
class NativeBridge {
companion object {

View File

@@ -1,4 +1,4 @@
package com.cherret.zaprett
package com.cherret.zaprett.byedpi
enum class ServiceStatus {
Disconnected,

View File

@@ -1,4 +1,4 @@
package com.cherret.zaprett
package com.cherret.zaprett.byedpi
object TProxyService {
init {

View File

@@ -18,6 +18,8 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Build
import androidx.compose.material.icons.filled.Dangerous
@@ -114,7 +116,9 @@ fun HomeScreen(viewModel: HomeViewModel = viewModel(), vpnLauncher: ActivityResu
},
snackbarHost = { SnackbarHost(snackbarHostState) },
content = { paddingValues ->
Column(modifier = Modifier.padding(paddingValues)) {
Column(modifier = Modifier
.padding(paddingValues)
.verticalScroll(rememberScrollState())) {
ServiceStatusCard(viewModel, cardText, snackbarHostState, scope)
UpdateCard(updateAvailable) { viewModel.showUpdateDialog() }
if (showUpdateDialog) {

View File

@@ -22,9 +22,9 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.cherret.zaprett.BuildConfig
import com.cherret.zaprett.ByeDpiVpnService
import com.cherret.zaprett.byedpi.ByeDpiVpnService
import com.cherret.zaprett.R
import com.cherret.zaprett.ServiceStatus
import com.cherret.zaprett.byedpi.ServiceStatus
import com.cherret.zaprett.checkModuleInstallation
import com.cherret.zaprett.checkRoot
import com.cherret.zaprett.getStartOnBoot

View File

@@ -8,9 +8,9 @@ import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.core.content.ContextCompat
import androidx.lifecycle.AndroidViewModel
import com.cherret.zaprett.ByeDpiVpnService
import com.cherret.zaprett.byedpi.ByeDpiVpnService
import com.cherret.zaprett.R
import com.cherret.zaprett.ServiceStatus
import com.cherret.zaprett.byedpi.ServiceStatus
import com.cherret.zaprett.download
import com.cherret.zaprett.getBinVersion
import com.cherret.zaprett.getChangelog
@@ -41,7 +41,7 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
var nfqwsVer = mutableStateOf(context.getString(R.string.unknown_text))
private set
var byedpiVer = mutableStateOf(context.getString(R.string.unknown_text))
var byedpiVer = mutableStateOf("0.17.1")
private set
var serviceMode = mutableIntStateOf(R.string.service_mode_ciadpi)
@@ -201,4 +201,12 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
installApk(context, uri)
}
}
fun parseArgs(ip: String, port: String, lines: List<String>): Array<String> {
val regex = Regex("""--?\S+(?:=(?:[^"'\s]+|"[^"]*"|'[^']*'))?|[^\s]+""")
val parsedArgs = lines
.flatMap { line -> regex.findAll(line).map { it.value } }
return arrayOf("ciadpi", "--ip", ip, "--port", port) + parsedArgs
}
}

View File

@@ -4,8 +4,8 @@ import android.app.Application
import android.content.Context
import android.content.SharedPreferences
import androidx.compose.material3.SnackbarHostState
import com.cherret.zaprett.ByeDpiVpnService
import com.cherret.zaprett.ServiceStatus
import com.cherret.zaprett.byedpi.ByeDpiVpnService
import com.cherret.zaprett.byedpi.ServiceStatus
import com.cherret.zaprett.disableStrategy
import com.cherret.zaprett.enableStrategy
import com.cherret.zaprett.getActiveByeDPIStrategies

View File

@@ -16,6 +16,6 @@
APP_OPTIM := release
APP_PLATFORM := android-21
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
APP_CFLAGS := -O3 -DPKGNAME=com/cherret/zaprett
APP_CFLAGS := -O3 -DPKGNAME=com/cherret/zaprett/byedpi
APP_CPPFLAGS := -O3 -std=c++11
NDK_TOOLCHAIN_VERSION := clang

View File

@@ -72,7 +72,7 @@
<string name="qs_stopping">Остановка…</string>
<string name="module_version">Версия модуля</string>
<string name="nfqws_version">Версия nfqws</string>
<string name="ciadpi_version">Версия ciadpi 0.17.1</string>
<string name="ciadpi_version">Версия ciadpi</string>
<string name="unknown_text">неизвестно</string>
<string name="service_mode">Режим работы</string>
<string name="qs_not_available">Не доступно</string>

View File

@@ -73,7 +73,7 @@
<string name="qs_stopping">Stopping…</string>
<string name="module_version">Module version</string>
<string name="nfqws_version">nfqws version</string>
<string name="ciadpi_version">ciadpi version 0.17.1</string>
<string name="ciadpi_version">ciadpi version</string>
<string name="unknown_text">unknown</string>
<string name="service_mode">Service mode</string>
<string name="service_mode_nfqws" translatable="false">nfqws</string>

View File

@@ -1 +1,3 @@
Добавлена вкладка "Стратегии"
Исправление багов в фрагменте хостов
Исправление сплющивания карточки информации о модуле
Перенос версии byedpi в соответствующее место

View File

@@ -25,7 +25,6 @@ androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-toolin
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-lifecycle-service = { group = "androidx.lifecycle", name = "lifecycle-service", version.ref = "lifecycleService" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }

View File

@@ -1,6 +1,6 @@
{
"version": "1.10",
"versionCode": 11,
"downloadUrl": "https://github.com/CherretGit/zaprett-app/releases/download/1_10_0/app-release.apk",
"version": "2.1",
"versionCode": 13,
"downloadUrl": "https://github.com/CherretGit/zaprett-app/releases/download/2_1/app-release.apk",
"changelogUrl": "https://raw.githubusercontent.com/CherretGit/zaprett-app/refs/heads/main/changelog.md"
}