Initial commit
No files matched your search
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
|
||||
<application
|
||||
android:extractNativeLibs="true"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="VK TURN Proxy"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.VkTurnProxy"
|
||||
tools:targetApi="31">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name=".ProxyService"
|
||||
android:exported="false"
|
||||
android:foregroundServiceType="specialUse" />
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.vkturn.proxy
|
||||
|
||||
import android.Manifest
|
||||
import android.app.Activity
|
||||
import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var tvLogs: TextView
|
||||
private lateinit var logScrollView: ScrollView
|
||||
private lateinit var btnToggle: Button
|
||||
|
||||
// Обработка выбора файла для обновления ядра
|
||||
private val filePicker = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||
if (result.resultCode == Activity.RESULT_OK) {
|
||||
result.data?.data?.let { uri ->
|
||||
try {
|
||||
val inputStream = contentResolver.openInputStream(uri)
|
||||
val customBin = File(filesDir, "custom_vkturn")
|
||||
val outputStream = FileOutputStream(customBin)
|
||||
inputStream?.copyTo(outputStream)
|
||||
inputStream?.close()
|
||||
outputStream.close()
|
||||
customBin.setExecutable(true)
|
||||
ProxyService.addLog("СИСТЕМА: Кастомный бинарник установлен в /files/custom_vkturn")
|
||||
Toast.makeText(this, "Ядро обновлено!", Toast.LENGTH_SHORT).show()
|
||||
} catch (e: Exception) {
|
||||
ProxyService.addLog("ОШИБКА ОБНОВЛЕНИЯ: ${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val requestPermissionLauncher = registerForActivityResult(ActivityResultContracts.RequestPermission()) { isGranted ->
|
||||
if (!isGranted) Toast.makeText(this, "Разрешите уведомления для фоновой работы!", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
|
||||
// Инициализация элементов
|
||||
tvLogs = findViewById(R.id.tvLogs)
|
||||
logScrollView = findViewById(R.id.logScrollView)
|
||||
btnToggle = findViewById(R.id.btnToggle)
|
||||
tvLogs.setTextIsSelectable(true) // Позволяет выделять текст логов
|
||||
|
||||
val switchRawMode = findViewById<Switch>(R.id.switchRawMode)
|
||||
val editRawCommand = findViewById<EditText>(R.id.editRawCommand)
|
||||
val layoutGuiSettings = findViewById<LinearLayout>(R.id.layoutGuiSettings)
|
||||
val editPeer = findViewById<EditText>(R.id.editPeer)
|
||||
val editLink = findViewById<EditText>(R.id.editLink)
|
||||
val editN = findViewById<EditText>(R.id.editN)
|
||||
val checkUdp = findViewById<CheckBox>(R.id.checkUdp)
|
||||
val checkNoDtls = findViewById<CheckBox>(R.id.checkNoDtls)
|
||||
val editListen = findViewById<EditText>(R.id.editListen)
|
||||
|
||||
// Загрузка настроек
|
||||
val prefs = getSharedPreferences("ProxyPrefs", Context.MODE_PRIVATE)
|
||||
switchRawMode.isChecked = prefs.getBoolean("isRaw", false)
|
||||
editRawCommand.setText(prefs.getString("rawCmd", ""))
|
||||
editPeer.setText(prefs.getString("peer", ""))
|
||||
editLink.setText(prefs.getString("link", ""))
|
||||
editN.setText(prefs.getString("n", "8"))
|
||||
checkUdp.isChecked = prefs.getBoolean("udp", true)
|
||||
checkNoDtls.isChecked = prefs.getBoolean("noDtls", false)
|
||||
editListen.setText(prefs.getString("listen", "127.0.0.1:9000"))
|
||||
|
||||
// Переключение режимов интерфейса
|
||||
val updateUiState = {
|
||||
if (switchRawMode.isChecked) {
|
||||
editRawCommand.visibility = View.VISIBLE
|
||||
layoutGuiSettings.visibility = View.GONE
|
||||
} else {
|
||||
editRawCommand.visibility = View.GONE
|
||||
layoutGuiSettings.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
updateUiState()
|
||||
switchRawMode.setOnCheckedChangeListener { _, _ -> updateUiState() }
|
||||
|
||||
// Кнопки управления
|
||||
findViewById<Button>(R.id.btnUpdateBinary).setOnClickListener {
|
||||
val intent = Intent(Intent.ACTION_GET_CONTENT).apply { type = "*/*" }
|
||||
filePicker.launch(intent)
|
||||
}
|
||||
|
||||
findViewById<Button>(R.id.btnBattery).setOnClickListener {
|
||||
val intent = Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS).apply {
|
||||
data = Uri.parse("package:$packageName")
|
||||
}
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
findViewById<Button>(R.id.btnCopyLogs).setOnClickListener {
|
||||
val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
val clip = ClipData.newPlainText("vk_turn_logs", tvLogs.text)
|
||||
clipboard.setPrimaryClip(clip)
|
||||
Toast.makeText(this, "Логи скопированы!", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
findViewById<Button>(R.id.btnClearLogs).setOnClickListener {
|
||||
ProxyService.logBuffer.clear()
|
||||
tvLogs.text = "Консоль очищена."
|
||||
}
|
||||
|
||||
btnToggle.setOnClickListener {
|
||||
if (!ProxyService.isRunning) {
|
||||
// Сохранение перед стартом
|
||||
prefs.edit().apply {
|
||||
putBoolean("isRaw", switchRawMode.isChecked)
|
||||
putString("rawCmd", editRawCommand.text.toString())
|
||||
putString("peer", editPeer.text.toString())
|
||||
putString("link", editLink.text.toString())
|
||||
putString("n", editN.text.toString())
|
||||
putBoolean("udp", checkUdp.isChecked)
|
||||
putBoolean("noDtls", checkNoDtls.isChecked)
|
||||
putString("listen", editListen.text.toString())
|
||||
}.apply()
|
||||
|
||||
checkPermissionsAndStart()
|
||||
} else {
|
||||
stopService(Intent(this, ProxyService::class.java))
|
||||
btnToggle.text = "ЗАПУСТИТЬ ПРОКСИ"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkPermissionsAndStart() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
|
||||
requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS)
|
||||
return
|
||||
}
|
||||
}
|
||||
ProxyService.logBuffer.clear()
|
||||
startForegroundService(Intent(this, ProxyService::class.java))
|
||||
btnToggle.text = "ОСТАНОВИТЬ ПРОКСИ"
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
btnToggle.text = if (ProxyService.isRunning) "ОСТАНОВИТЬ ПРОКСИ" else "ЗАПУСТИТЬ ПРОКСИ"
|
||||
tvLogs.text = ProxyService.logBuffer.joinToString("\n")
|
||||
scrollLogsToEnd()
|
||||
|
||||
ProxyService.onLogReceived = { msg ->
|
||||
runOnUiThread {
|
||||
if (tvLogs.text.length > 25000) tvLogs.text = tvLogs.text.substring(10000)
|
||||
tvLogs.append("\n$msg")
|
||||
scrollLogsToEnd()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun scrollLogsToEnd() {
|
||||
logScrollView.post { logScrollView.fullScroll(View.FOCUS_DOWN) }
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
ProxyService.onLogReceived = null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.vkturn.proxy
|
||||
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.app.Service
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.IBinder
|
||||
import android.os.PowerManager
|
||||
import androidx.core.app.NotificationCompat
|
||||
import java.io.BufferedReader
|
||||
import java.io.File
|
||||
import java.io.InputStreamReader
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
class ProxyService : Service() {
|
||||
|
||||
companion object {
|
||||
var isRunning = false
|
||||
val logBuffer = mutableListOf<String>()
|
||||
var onLogReceived: ((String) -> Unit)? = null
|
||||
|
||||
fun addLog(msg: String) {
|
||||
if (logBuffer.size > 200) logBuffer.removeAt(0)
|
||||
logBuffer.add(msg)
|
||||
onLogReceived?.invoke(msg)
|
||||
}
|
||||
}
|
||||
|
||||
private var wakeLock: PowerManager.WakeLock? = null
|
||||
private var process: Process? = null
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder? = null
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
val channel = NotificationChannel("ProxyChannel", "Proxy", NotificationManager.IMPORTANCE_LOW)
|
||||
getSystemService(NotificationManager::class.java).createNotificationChannel(channel)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
if (isRunning) return START_STICKY
|
||||
|
||||
val notification = NotificationCompat.Builder(this, "ProxyChannel")
|
||||
.setContentTitle("VK TURN Proxy")
|
||||
.setContentText("Работает в фоне")
|
||||
.setSmallIcon(android.R.drawable.ic_menu_preferences)
|
||||
.build()
|
||||
startForeground(1, notification)
|
||||
isRunning = true
|
||||
|
||||
val powerManager = getSystemService(Context.POWER_SERVICE) as PowerManager
|
||||
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "VkTurn::BgLock")
|
||||
wakeLock?.acquire()
|
||||
|
||||
addLog("=== ЗАПУСК ПРОКСИ ===")
|
||||
startBinary()
|
||||
|
||||
return START_STICKY
|
||||
}
|
||||
|
||||
private fun startBinary() {
|
||||
val prefs = getSharedPreferences("ProxyPrefs", Context.MODE_PRIVATE)
|
||||
val isRaw = prefs.getBoolean("isRaw", false)
|
||||
|
||||
// Ищем обновленный пользователем файл, если его нет - берем вшитый в APK
|
||||
val customBin = File(filesDir, "custom_vkturn")
|
||||
val executable = if (customBin.exists()) {
|
||||
addLog("Используется кастомное ядро из памяти телефона")
|
||||
customBin.absolutePath
|
||||
} else {
|
||||
addLog("Используется стандартное ядро из APK")
|
||||
"${applicationInfo.nativeLibraryDir}/libvkturn.so"
|
||||
}
|
||||
|
||||
val cmdArgs = mutableListOf<String>()
|
||||
|
||||
if (isRaw) {
|
||||
val rawCmd = prefs.getString("rawCmd", "") ?: ""
|
||||
// Разбиваем строку по пробелам
|
||||
val parts = rawCmd.trim().split("\\s+".toRegex())
|
||||
cmdArgs.add(executable) // Подменяем вызов "./client" на реальный путь
|
||||
if (parts.size > 1) {
|
||||
cmdArgs.addAll(parts.subList(1, parts.size))
|
||||
}
|
||||
} else {
|
||||
val peer = prefs.getString("peer", "") ?: ""
|
||||
val link = prefs.getString("link", "") ?: ""
|
||||
val n = prefs.getString("n", "") ?: ""
|
||||
val listen = prefs.getString("listen", "127.0.0.1:9000") ?: ""
|
||||
|
||||
cmdArgs.add(executable)
|
||||
cmdArgs.add("-peer")
|
||||
cmdArgs.add(peer)
|
||||
cmdArgs.add(if (link.contains("yandex")) "-yandex-link" else "-vk-link")
|
||||
cmdArgs.add(link)
|
||||
cmdArgs.add("-listen")
|
||||
cmdArgs.add(listen)
|
||||
|
||||
if (n.isNotEmpty()) {
|
||||
cmdArgs.add("-n")
|
||||
cmdArgs.add(n)
|
||||
}
|
||||
if (prefs.getBoolean("udp", false)) cmdArgs.add("-udp")
|
||||
if (prefs.getBoolean("noDtls", false)) cmdArgs.add("-no-dtls")
|
||||
}
|
||||
|
||||
thread {
|
||||
try {
|
||||
addLog("Команда: ${cmdArgs.joinToString(" ")}")
|
||||
|
||||
process = ProcessBuilder(cmdArgs)
|
||||
.redirectErrorStream(true)
|
||||
.start()
|
||||
|
||||
val reader = BufferedReader(InputStreamReader(process?.inputStream))
|
||||
var line: String?
|
||||
while (reader.readLine().also { line = it } != null) {
|
||||
addLog(line ?: "")
|
||||
}
|
||||
|
||||
// Если процесс завершился, выводим код
|
||||
val exitCode = process?.waitFor()
|
||||
addLog("=== ПРОЦЕСС ОСТАНОВЛЕН (Код: $exitCode) ===")
|
||||
} catch (e: Exception) {
|
||||
addLog("КРИТИЧЕСКАЯ ОШИБКА: ${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
isRunning = false
|
||||
addLog("=== ОСТАНОВКА ИЗ ИНТЕРФЕЙСА ===")
|
||||
process?.destroy()
|
||||
if (wakeLock?.isHeld == true) wakeLock?.release()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="#121212"> <ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnUpdateBinary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="#37474F"
|
||||
android:text="ЗАГРУЗИТЬ НОВОЕ ЯДРО (ФАЙЛ)"
|
||||
android:textColor="#FFFFFF" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnBattery"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:backgroundTint="#BF360C"
|
||||
android:text="ОТКЛЮЧИТЬ ОПТИМИЗАЦИЮ БАТАРЕИ"
|
||||
android:textColor="#FFFFFF" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switchRawMode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Режим своей (Raw) команды"
|
||||
android:textColor="#E0E0E0"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editRawCommand"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="#1E1E1E"
|
||||
android:fontFamily="monospace"
|
||||
android:hint="./client -n 8 -udp -peer IP:56000 ..."
|
||||
android:padding="12dp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textColorHint="#757575"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutGuiSettings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Peer (IP:Port сервера)" android:textColor="#B0BEC5" android:textStyle="bold" android:layout_marginTop="12dp"/>
|
||||
<EditText android:id="@+id/editPeer" android:layout_width="match_parent" android:layout_height="wrap_content" android:backgroundTint="#455A64" android:textColor="#FFFFFF" android:hint="11.22.33.44:00000" android:textColorHint="#616161"/>
|
||||
|
||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Ссылка (VK Calls)" android:textColor="#B0BEC5" android:textStyle="bold" android:layout_marginTop="12dp"/>
|
||||
<EditText android:id="@+id/editLink" android:layout_width="match_parent" android:layout_height="wrap_content" android:backgroundTint="#455A64" android:textColor="#FFFFFF" android:hint="https://vk.com/call/join/..." android:textColorHint="#616161"/>
|
||||
|
||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Потоки (-n)" android:textColor="#B0BEC5" android:textStyle="bold" android:layout_marginTop="12dp"/>
|
||||
<EditText android:id="@+id/editN" android:layout_width="match_parent" android:layout_height="wrap_content" android:backgroundTint="#455A64" android:textColor="#FFFFFF" android:inputType="number" android:text="8" />
|
||||
|
||||
<CheckBox android:id="@+id/checkUdp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Использовать UDP (-udp)" android:textColor="#E0E0E0" android:checked="true" />
|
||||
<CheckBox android:id="@+id/checkNoDtls" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Без обфускации (-no-dtls)" android:textColor="#E0E0E0" />
|
||||
|
||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Локальный порт" android:textColor="#B0BEC5" android:textStyle="bold" android:layout_marginTop="12dp"/>
|
||||
<EditText android:id="@+id/editListen" android:layout_width="match_parent" android:layout_height="wrap_content" android:backgroundTint="#455A64" android:textColor="#FFFFFF" android:text="127.0.0.1:9000" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnToggle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="ЗАПУСТИТЬ ПРОКСИ"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:backgroundTint="#2E7D32" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#263238"
|
||||
android:orientation="horizontal"
|
||||
android:padding="4dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textColor="#CFD8DC"
|
||||
android:padding="8dp"
|
||||
android:text="ТЕРМИНАЛ ЛОГОВ:"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Button android:id="@+id/btnCopyLogs" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="COPY" android:textSize="10sp" android:backgroundTint="#455A64"/>
|
||||
<Button android:id="@+id/btnClearLogs" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="4dp" android:text="CLEAR" android:textSize="10sp" android:backgroundTint="#455A64"/>
|
||||
</LinearLayout>
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/logScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="220dp"
|
||||
android:background="#000000">
|
||||
<TextView
|
||||
android:id="@+id/tvLogs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#4CAF50"
|
||||
android:textSize="12sp"
|
||||
android:padding="10dp"
|
||||
android:fontFamily="monospace"
|
||||
android:text="Ожидание запуска..." />
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 982 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
@@ -0,0 +1,7 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.VkTurnProxy" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your dark theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
</resources>
|
||||
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">VkTurnProxy</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,9 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.VkTurnProxy" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your light theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
||||
</style>
|
||||
|
||||
<style name="Theme.VkTurnProxy" parent="Base.Theme.VkTurnProxy" />
|
||||
</resources>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample backup rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/guide/topics/data/autobackup
|
||||
for details.
|
||||
Note: This file is ignored for devices older than API 31
|
||||
See https://developer.android.com/about/versions/12/backup-restore
|
||||
-->
|
||||
<full-backup-content>
|
||||
<!--
|
||||
<include domain="sharedpref" path="."/>
|
||||
<exclude domain="sharedpref" path="device.xml"/>
|
||||
-->
|
||||
</full-backup-content>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample data extraction rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
|
||||
for details.
|
||||
-->
|
||||
<data-extraction-rules>
|
||||
<cloud-backup>
|
||||
<!-- TODO: Use <include> and <exclude> to control what is backed up.
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
-->
|
||||
</cloud-backup>
|
||||
<!--
|
||||
<device-transfer>
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
</device-transfer>
|
||||
-->
|
||||
</data-extraction-rules>
|
||||