Compare commits

...

5 Commits

Author SHA1 Message Date
2dust
a726f00f35 Bug fix 2024-06-29 16:47:06 +08:00
2dust
79297f8a42 up 1.8.27
App bundle support
2024-06-29 15:32:01 +08:00
2dust
e3f70ac253 Add LEANBACK_LAUNCHER 2024-06-29 15:29:20 +08:00
GFW-knocker
838b346fcc fix wireguard issue (#3260)
fix crash when invalid wireguard config imported
2024-06-28 09:41:55 +08:00
solokot
eba9545ccf Update Russian translation to 1.8.26 (#3238) 2024-06-24 09:09:35 +08:00
6 changed files with 54 additions and 33 deletions

View File

@@ -11,8 +11,8 @@ android {
applicationId = "com.v2ray.ang"
minSdk = 21
targetSdk = 34
versionCode = 565
versionName = "1.8.26"
versionCode = 570
versionName = "1.8.27"
multiDexEnabled = true
splits.abi {
reset()
@@ -53,14 +53,14 @@ android {
splits {
abi {
isEnable = true
isUniversalApk = false
isUniversalApk = true
}
}
applicationVariants.all {
val variant = this
val versionCodes =
mapOf("armeabi-v7a" to 1, "arm64-v8a" to 2, "x86" to 3, "x86_64" to 4)
mapOf("armeabi-v7a" to 4, "arm64-v8a" to 4, "x86" to 4, "x86_64" to 4, "all" to 4)
variant.outputs
.map { it as com.android.build.gradle.internal.api.ApkVariantOutputImpl }
@@ -86,6 +86,12 @@ android {
viewBinding = true
buildConfig = true
}
packagingOptions {
jniLibs {
useLegacyPackaging = true
}
}
}
dependencies {
@@ -100,15 +106,15 @@ dependencies {
implementation("androidx.cardview:cardview:1.0.0")
implementation("androidx.preference:preference-ktx:1.2.1")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("androidx.fragment:fragment-ktx:1.7.1")
implementation("androidx.fragment:fragment-ktx:1.8.1")
implementation("androidx.multidex:multidex:2.0.1")
implementation("androidx.viewpager2:viewpager2:1.1.0")
// Androidx ktx
implementation("androidx.activity:activity-ktx:1.9.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.1")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.2")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.2")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.2")
//kotlin
implementation("org.jetbrains.kotlin:kotlin-reflect:1.9.23")

View File

@@ -54,7 +54,7 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<!-- <category android:name="android.intent.category.LEANBACK_LAUNCHER"/>-->
<category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />

View File

@@ -97,7 +97,13 @@ class MainRecyclerAdapter(val activity: MainActivity) : RecyclerView.Adapter<Mai
holder.itemMainBinding.tvType.text = config.configType.name.lowercase()
}
}
val strState = "${outbound?.getServerAddress()?.dropLast(3)}*** : ${outbound?.getServerPort()}"
val strState = try{
"${outbound?.getServerAddress()?.dropLast(3)}*** : ${outbound?.getServerPort()}"
}catch(e: Exception){
""
}
holder.itemMainBinding.tvStatistics.text = strState
holder.itemMainBinding.layoutShare.setOnClickListener {

View File

@@ -2,9 +2,11 @@ package com.v2ray.ang.util
import android.content.Context
import android.text.TextUtils
import android.util.Log
import com.google.gson.Gson
import com.tencent.mmkv.MMKV
import com.v2ray.ang.AppConfig
import com.v2ray.ang.AppConfig.ANG_PACKAGE
import com.v2ray.ang.AppConfig.PROTOCOL_FREEDOM
import com.v2ray.ang.AppConfig.TAG_DIRECT
import com.v2ray.ang.AppConfig.TAG_FRAGMENT
@@ -49,6 +51,12 @@ object V2rayConfigUtil {
return Result(true, customConfig)
}
val outbound = config.getProxyOutbound() ?: return Result(false, "")
val address = outbound.getServerAddress() ?: return Result(false, "")
if (!Utils.isIpAddress(address) && !Utils.isValidUrl(address)) {
Log.d(ANG_PACKAGE, "$address is an invalid ip or domain")
return Result(false, "")
}
val result = getV2rayNonCustomConfig(context, outbound, config.remarks)
//Log.d(ANG_PACKAGE, result.content)
return result

View File

@@ -10,11 +10,11 @@ import java.net.URI
object WireguardFmt {
fun parseWireguard(str: String): ServerConfig? {
val config = ServerConfig.create(EConfigType.WIREGUARD)
val uri = URI(Utils.fixIllegalUrl(str))
config.remarks = Utils.urlDecode(uri.fragment ?: "")
if (uri.rawQuery != null) {
val config = ServerConfig.create(EConfigType.WIREGUARD)
config.remarks = Utils.urlDecode(uri.fragment ?: "")
val queryParam = uri.rawQuery.split("&")
.associate { it.split("=").let { (k, v) -> k to Utils.urlDecode(v) } }
@@ -31,9 +31,10 @@ object WireguardFmt {
(queryParam["reserved"] ?: "0,0,0").removeWhiteSpace().split(",")
.map { it.toInt() }
}
return config
}else {
return null
}
return config
}
fun toUri(config: ServerConfig): String {

View File

@@ -46,22 +46,22 @@
<string name="server_lab_more_function">Другие параметры</string>
<string name="server_lab_head_type">Тип заголовка</string>
<string name="server_lab_mode_type">Режим gRPC</string>
<string name="server_lab_request_host">host</string>
<string name="server_lab_request_host_http">http host</string>
<string name="server_lab_request_host_ws">ws host</string>
<string name="server_lab_request_host_httpupgrade">httpupgrade host</string>
<string name="server_lab_request_host_splithttp">splithttp host</string>
<string name="server_lab_request_host_h2">h2 host</string>
<string name="server_lab_request_host_quic">QUIC security</string>
<string name="server_lab_request_host_grpc">gRPC Authority</string>
<string name="server_lab_path">path</string>
<string name="server_lab_path_ws">ws path</string>
<string name="server_lab_path_httpupgrade">httpupgrade path</string>
<string name="server_lab_path_splithttp">splithttp path</string>
<string name="server_lab_path_h2">h2 path</string>
<string name="server_lab_path_quic">QUIC key</string>
<string name="server_lab_path_kcp">kcp seed</string>
<string name="server_lab_path_grpc">gRPC serviceName</string>
<string name="server_lab_request_host">Узел</string>
<string name="server_lab_request_host_http">Узел HTTP</string>
<string name="server_lab_request_host_ws">Узел WS</string>
<string name="server_lab_request_host_httpupgrade">Узел HTTPUpgrade</string>
<string name="server_lab_request_host_splithttp">Узел SplitHTTP</string>
<string name="server_lab_request_host_h2">Узел H2</string>
<string name="server_lab_request_host_quic">Шифрование QUIC</string>
<string name="server_lab_request_host_grpc">Полномочия gRPC</string>
<string name="server_lab_path">Путь</string>
<string name="server_lab_path_ws">Путь WS</string>
<string name="server_lab_path_httpupgrade">Путь HTTPUpgrade</string>
<string name="server_lab_path_splithttp">Путь SplitHTTP</string>
<string name="server_lab_path_h2">Путь H2</string>
<string name="server_lab_path_quic">Ключ QUIC</string>
<string name="server_lab_path_kcp">Сид KCP</string>
<string name="server_lab_path_grpc">Служба gRPC</string>
<string name="server_lab_stream_security">TLS</string>
<string name="server_lab_allow_insecure">Разрешать небезопасные</string>
<string name="server_lab_sni">SNI</string>
@@ -101,6 +101,7 @@
<string name="msg_remark_is_duplicate">Описание уже существует</string>
<string name="toast_action_not_allowed">Это действие запрещено</string>
<!-- PerAppProxyActivity -->
<string name="msg_dialog_progress">Загрузка…</string>
<string name="menu_item_search">Поиск</string>
@@ -140,7 +141,6 @@
<string name="title_pref_route_only_enabled">Домен только для маршрутизации</string>
<string name="summary_pref_route_only_enabled">Использовать определённое доменное имя только для маршрутизации и сохранять целевой адрес в виде IP.</string>
<string name="title_pref_local_dns_enabled">Использовать локальную DNS</string>
<string name="summary_pref_local_dns_enabled">Обслуживание выполняется DNS-модулем ядра (в настройках маршрутизации рекомендуется выбрать режим «Все, кроме LAN и Китая»)</string>
@@ -192,7 +192,7 @@
<string name="summary_pref_feedback">Предложить улучшение или сообщить об ошибке на GitHub</string>
<string name="summary_pref_tg_group">Присоединиться к группе в Telegram</string>
<string name="toast_tg_app_not_found">Приложение Telegram не найдено</string>
<string name="title_privacy_policy">Конфиденциальность</string>
<string name="title_privacy_policy">Политика конфиденциальности</string>
<string name="title_about">О приложении</string>
<string name="title_source_code">Исходный код</string>
<string name="title_tg_channel">Telegram-канал</string>