Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 923e3f32d1 | |||
| 5490db90c0 | |||
| cb68d42291 | |||
| ec3a8e80d6 | |||
| eb0960125b | |||
| 12b70e2088 | |||
| 0c473dea19 | |||
| e71dd7342a | |||
| a765215dda | |||
| edea3027f7 | |||
| 305219c3bc | |||
| 9c4188fba7 | |||
| 0f3124bece | |||
| 2614f72a36 | |||
| 480c7fc8a1 | |||
| 302e7f148e | |||
| 98d6da983b | |||
| f6f60f77d3 | |||
| 7be0fb3ecd | |||
| d53a9f9ecd | |||
| 9eb03eece2 | |||
| 6632ba3b6e | |||
| bd582f1d90 | |||
| f5f1e12565 | |||
| 207d6f4f8c | |||
| 52e0a19826 | |||
| fc0e60a097 | |||
| 65d6b4aaa8 | |||
| 7b11755e7f | |||
| 2d0de4860c | |||
| 7406ef16ff | |||
| a084b21d50 |
@@ -153,7 +153,7 @@ jobs:
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
if: github.event.inputs.release_tag != ''
|
||||
with:
|
||||
file: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/*playstore*/release/*.apk
|
||||
file: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/*/release/*.apk
|
||||
tag: ${{ github.event.inputs.release_tag }}
|
||||
file_glob: true
|
||||
prerelease: true
|
||||
|
||||
+1
-1
Submodule AndroidLibXrayLite updated: a5c68069c9...f89b8c4585
@@ -12,8 +12,8 @@ android {
|
||||
applicationId = "com.v2ray.ang"
|
||||
minSdk = 21
|
||||
targetSdk = 35
|
||||
versionCode = 668
|
||||
versionName = "1.10.18"
|
||||
versionCode = 677
|
||||
versionName = "1.10.26"
|
||||
multiDexEnabled = true
|
||||
|
||||
val abiFilterList = (properties["ABI_FILTERS"] as? String)?.split(';')
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name" translatable="false">v2rayNG (F-Droid)</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<shortcut
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_qu_switch_24dp"
|
||||
android:shortcutDisabledMessage="@string/app_widget_name"
|
||||
android:shortcutId="shortcuts_switch"
|
||||
android:shortcutLongLabel="@string/app_widget_name"
|
||||
android:shortcutShortLabel="@string/app_widget_name">
|
||||
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:targetClass="com.v2ray.ang.ui.ScSwitchActivity"
|
||||
android:targetPackage="com.v2ray.ang.fdroid" />
|
||||
<categories android:name="android.shortcut.conversation" />
|
||||
</shortcut>
|
||||
<shortcut
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_qu_scan_24dp"
|
||||
android:shortcutDisabledMessage="@string/menu_item_import_config_qrcode"
|
||||
android:shortcutId="shortcuts_scan"
|
||||
android:shortcutLongLabel="@string/menu_item_import_config_qrcode"
|
||||
android:shortcutShortLabel="@string/menu_item_import_config_qrcode">
|
||||
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:targetClass="com.v2ray.ang.ui.ScScannerActivity"
|
||||
android:targetPackage="com.v2ray.ang.fdroid" />
|
||||
<categories android:name="android.shortcut.conversation" />
|
||||
</shortcut>
|
||||
</shortcuts>
|
||||
@@ -195,8 +195,8 @@
|
||||
android:resource="@xml/app_widget_provider" />
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||
<action android:name="com.v2ray.ang.action.widget.click" />
|
||||
<action android:name="com.v2ray.ang.action.activity" />
|
||||
<action android:name="${applicationId}.action.widget.click" />
|
||||
<action android:name="${applicationId}.action.activity" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver
|
||||
|
||||
@@ -75,9 +75,9 @@ object AppConfig {
|
||||
const val PROTOCOL_FREEDOM = "freedom"
|
||||
|
||||
/** Broadcast actions. */
|
||||
const val BROADCAST_ACTION_SERVICE = "com.v2ray.ang.action.service"
|
||||
const val BROADCAST_ACTION_ACTIVITY = "com.v2ray.ang.action.activity"
|
||||
const val BROADCAST_ACTION_WIDGET_CLICK = "com.v2ray.ang.action.widget.click"
|
||||
const val BROADCAST_ACTION_SERVICE = "$ANG_PACKAGE.action.service"
|
||||
const val BROADCAST_ACTION_ACTIVITY = "$ANG_PACKAGE.action.activity"
|
||||
const val BROADCAST_ACTION_WIDGET_CLICK = "$ANG_PACKAGE.action.widget.click"
|
||||
|
||||
/** Tasker extras. */
|
||||
const val TASKER_EXTRA_BUNDLE = "com.twofortyfouram.locale.intent.extra.BUNDLE"
|
||||
@@ -91,6 +91,8 @@ object AppConfig {
|
||||
const val TAG_DIRECT = "direct"
|
||||
const val TAG_BLOCKED = "block"
|
||||
const val TAG_FRAGMENT = "fragment"
|
||||
const val TAG_DNS = "dns-module"
|
||||
const val TAG_DOMESTIC_DNS = "domestic-dns"
|
||||
|
||||
/** Network-related constants. */
|
||||
const val UPLINK = "uplink"
|
||||
|
||||
@@ -245,7 +245,14 @@ data class V2rayConfig(
|
||||
var tproxy: String? = null,
|
||||
var mark: Int? = null,
|
||||
var dialerProxy: String? = null,
|
||||
var domainStrategy: String? = null
|
||||
var domainStrategy: String? = null,
|
||||
var happyEyeballs: happyEyeballsBean? = null,
|
||||
)
|
||||
data class happyEyeballsBean(
|
||||
var prioritizeIPv6: Boolean? = null,
|
||||
var maxConcurrentTry: Int? = 4,
|
||||
var tryDelayMs: Int? = 250, // ms
|
||||
var interleave: Int? = null,
|
||||
)
|
||||
|
||||
data class TlsSettingsBean(
|
||||
@@ -490,6 +497,7 @@ data class V2rayConfig(
|
||||
var expectIPs: List<String>? = null,
|
||||
val clientIp: String? = null,
|
||||
val skipFallback: Boolean? = null,
|
||||
val tag: String? = null,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ object ShadowsocksFmt : FmtBase() {
|
||||
fun toUri(config: ProfileItem): String {
|
||||
val pw = "${config.method}:${config.password}"
|
||||
|
||||
return toUri(config, Utils.encode(pw), null)
|
||||
return toUri(config, Utils.encode(pw, true), null)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,7 +51,7 @@ object SocksFmt : FmtBase() {
|
||||
else
|
||||
":"
|
||||
|
||||
return toUri(config, Utils.encode(pw), null)
|
||||
return toUri(config, Utils.encode(pw, true), null)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -100,8 +100,19 @@ object UpdateCheckerManager {
|
||||
}
|
||||
|
||||
private fun getDownloadUrl(release: GitHubRelease, abi: String): String {
|
||||
return release.assets.find { it.name.contains(abi) }?.browserDownloadUrl
|
||||
?: release.assets.firstOrNull()?.browserDownloadUrl
|
||||
val fDroid = "fdroid"
|
||||
|
||||
val assetsByAbi = release.assets.filter {
|
||||
(it.name.contains(abi, true))
|
||||
}
|
||||
|
||||
val asset = if (BuildConfig.APPLICATION_ID.contains(fDroid, ignoreCase = true)) {
|
||||
assetsByAbi.firstOrNull { it.name.contains(fDroid) }
|
||||
} else {
|
||||
assetsByAbi.firstOrNull { !it.name.contains(fDroid) }
|
||||
}
|
||||
|
||||
return asset?.browserDownloadUrl
|
||||
?: throw IllegalStateException("No compatible APK found")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -509,9 +509,10 @@ object V2rayConfigManager {
|
||||
//hev-socks5-tunnel dns routing
|
||||
v2rayConfig.routing.rules.add(
|
||||
0, RulesBean(
|
||||
type = "field",
|
||||
inboundTag = arrayListOf("socks"),
|
||||
outboundTag = "dns-out",
|
||||
port = "53",
|
||||
outboundTag = "dns-out"
|
||||
type = "field"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -574,18 +575,8 @@ object V2rayConfigManager {
|
||||
address = domesticDns.first(),
|
||||
domains = directDomain,
|
||||
expectIPs = if (isCnRoutingMode) geoipCn else null,
|
||||
skipFallback = true
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
if (Utils.isPureIpAddress(domesticDns.first())) {
|
||||
v2rayConfig.routing.rules.add(
|
||||
0, RulesBean(
|
||||
outboundTag = AppConfig.TAG_DIRECT,
|
||||
port = "53",
|
||||
ip = arrayListOf(domesticDns.first()),
|
||||
domain = null
|
||||
skipFallback = true,
|
||||
tag = AppConfig.TAG_DOMESTIC_DNS
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -626,20 +617,25 @@ object V2rayConfigManager {
|
||||
// DNS dns
|
||||
v2rayConfig.dns = V2rayConfig.DnsBean(
|
||||
servers = servers,
|
||||
hosts = hosts
|
||||
hosts = hosts,
|
||||
tag = AppConfig.TAG_DNS
|
||||
)
|
||||
|
||||
// DNS routing
|
||||
if (Utils.isPureIpAddress(remoteDns.first())) {
|
||||
v2rayConfig.routing.rules.add(
|
||||
0, RulesBean(
|
||||
outboundTag = AppConfig.TAG_PROXY,
|
||||
port = "53",
|
||||
ip = arrayListOf(remoteDns.first()),
|
||||
domain = null
|
||||
)
|
||||
v2rayConfig.routing.rules.add(
|
||||
RulesBean(
|
||||
outboundTag = AppConfig.TAG_DIRECT,
|
||||
inboundTag = arrayListOf(AppConfig.TAG_DOMESTIC_DNS),
|
||||
domain = null
|
||||
)
|
||||
}
|
||||
)
|
||||
v2rayConfig.routing.rules.add(
|
||||
RulesBean(
|
||||
outboundTag = AppConfig.TAG_PROXY,
|
||||
inboundTag = arrayListOf(AppConfig.TAG_DNS),
|
||||
domain = null
|
||||
)
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
Log.e(AppConfig.TAG, "Failed to configure DNS", e)
|
||||
return false
|
||||
@@ -1014,14 +1010,22 @@ object V2rayConfigManager {
|
||||
if (domain.isNullOrEmpty()) continue
|
||||
|
||||
if (newHosts.containsKey(domain)) {
|
||||
item.ensureSockopt().domainStrategy = if (preferIpv6) "UseIPv6v4" else "UseIPv4v6"
|
||||
item.ensureSockopt().domainStrategy = "UseIP"
|
||||
item.ensureSockopt().happyEyeballs = StreamSettingsBean.happyEyeballsBean(
|
||||
prioritizeIPv6 = preferIpv6,
|
||||
interleave = 2
|
||||
)
|
||||
continue
|
||||
}
|
||||
|
||||
val resolvedIps = HttpUtil.resolveHostToIP(domain, preferIpv6)
|
||||
if (resolvedIps.isNullOrEmpty()) continue
|
||||
|
||||
item.ensureSockopt().domainStrategy = if (preferIpv6) "UseIPv6v4" else "UseIPv4v6"
|
||||
item.ensureSockopt().domainStrategy = "UseIP"
|
||||
item.ensureSockopt().happyEyeballs = StreamSettingsBean.happyEyeballsBean(
|
||||
prioritizeIPv6 = preferIpv6,
|
||||
interleave = 2
|
||||
)
|
||||
newHosts[domain] = if (resolvedIps.size == 1) {
|
||||
resolvedIps[0]
|
||||
} else {
|
||||
|
||||
@@ -127,6 +127,9 @@ class AboutActivity : BaseActivity() {
|
||||
"v${BuildConfig.VERSION_NAME} (${SpeedtestManager.getLibVersion()})".also {
|
||||
binding.tvVersion.text = it
|
||||
}
|
||||
BuildConfig.APPLICATION_ID.also {
|
||||
binding.tvAppId.text = it
|
||||
}
|
||||
}
|
||||
|
||||
private fun backupConfiguration(outputZipFilePos: String): Pair<Boolean, String> {
|
||||
|
||||
@@ -386,6 +386,9 @@ class MainActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedList
|
||||
}
|
||||
|
||||
R.id.intelligent_selection_all -> {
|
||||
if (MmkvManager.decodeSettingsString(AppConfig.PREF_OUTBOUND_DOMAIN_RESOLVE_METHOD, "1") != "0") {
|
||||
toast(getString(R.string.pre_resolving_domain))
|
||||
}
|
||||
mainViewModel.createIntelligentSelectionAll()
|
||||
true
|
||||
}
|
||||
|
||||
@@ -56,8 +56,14 @@ class PerAppProxyActivity : BaseActivity() {
|
||||
appsList.sortedWith { p1, p2 ->
|
||||
when {
|
||||
p1.isSelected > p2.isSelected -> -1
|
||||
p1.isSelected == p2.isSelected -> 0
|
||||
else -> 1
|
||||
p1.isSelected < p2.isSelected -> 1
|
||||
p1.isSystemApp > p2.isSystemApp -> 1
|
||||
p1.isSystemApp < p2.isSystemApp -> -1
|
||||
p1.appName.lowercase() > p2.appName.lowercase() -> 1
|
||||
p1.appName.lowercase() < p2.appName.lowercase() -> -1
|
||||
p1.packageName > p2.packageName -> 1
|
||||
p1.packageName < p2.packageName -> -1
|
||||
else -> 0
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -12,7 +12,9 @@ import java.net.IDN
|
||||
import java.net.Inet6Address
|
||||
import java.net.InetAddress
|
||||
import java.net.InetSocketAddress
|
||||
import java.net.MalformedURLException
|
||||
import java.net.Proxy
|
||||
import java.net.URI
|
||||
import java.net.URL
|
||||
|
||||
object HttpUtil {
|
||||
@@ -140,7 +142,7 @@ object HttpUtil {
|
||||
val responseCode = conn.responseCode
|
||||
when (responseCode) {
|
||||
in 300..399 -> {
|
||||
val location = conn.getHeaderField("Location")
|
||||
val location = resolveLocation(conn)
|
||||
conn.disconnect()
|
||||
if (location.isNullOrEmpty()) {
|
||||
throw IOException("Redirect location not found")
|
||||
@@ -219,5 +221,29 @@ object HttpUtil {
|
||||
}
|
||||
return conn
|
||||
}
|
||||
|
||||
// Returns absolute URL string location header sets
|
||||
fun resolveLocation(conn: HttpURLConnection): String? {
|
||||
val raw = conn.getHeaderField("Location")?.trim()?.takeIf { it.isNotEmpty() } ?: return null
|
||||
|
||||
// Try check url is relative or absolute
|
||||
return try {
|
||||
val locUri = URI(raw)
|
||||
val baseUri = conn.url.toURI()
|
||||
val resolved = if (locUri.isAbsolute) locUri else baseUri.resolve(locUri)
|
||||
resolved.toURL().toString()
|
||||
} catch (_: Exception) {
|
||||
// Fallback: url resolver, also should handles //host/...
|
||||
try {
|
||||
URL(raw).toString() // absolute with protocol
|
||||
} catch (_: MalformedURLException) {
|
||||
try {
|
||||
URL(conn.url, raw).toString()
|
||||
} catch (_: MalformedURLException) {
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -134,11 +134,16 @@ object Utils {
|
||||
* Encode a string to base64.
|
||||
*
|
||||
* @param text The string to encode.
|
||||
* @param removePadding
|
||||
* @return The base64 encoded string, or an empty string if encoding fails.
|
||||
*/
|
||||
fun encode(text: String): String {
|
||||
fun encode(text: String, removePadding : Boolean = false): String {
|
||||
return try {
|
||||
Base64.encodeToString(text.toByteArray(Charsets.UTF_8), Base64.NO_WRAP)
|
||||
var encoded = Base64.encodeToString(text.toByteArray(Charsets.UTF_8), Base64.NO_WRAP)
|
||||
if (removePadding) {
|
||||
encoded = encoded.trimEnd('=')
|
||||
}
|
||||
encoded
|
||||
} catch (e: Exception) {
|
||||
Log.e(AppConfig.TAG, "Failed to encode text to base64", e)
|
||||
""
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/padding_spacing_dp16">
|
||||
|
||||
<TextView
|
||||
@@ -245,6 +245,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/title_about"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_app_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/title_about"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -377,5 +377,6 @@
|
||||
<item>Least Ping</item>
|
||||
<item>Least Load</item>
|
||||
</string-array>
|
||||
<string name="pre_resolving_domain">Pre-resolving domain…</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -382,5 +382,6 @@
|
||||
<item>Least Ping</item>
|
||||
<item>Least Load</item>
|
||||
</string-array>
|
||||
<string name="pre_resolving_domain">Pre-resolving domain…</string>
|
||||
|
||||
</resources>
|
||||
@@ -392,5 +392,6 @@
|
||||
<item>کم ترین پینگ</item>
|
||||
<item>کم ترین بار(لود)</item>
|
||||
</string-array>
|
||||
<string name="pre_resolving_domain">Pre-resolving domain…</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -391,5 +391,6 @@
|
||||
<item>کمترین پینگ</item>
|
||||
<item>کمترین بار(لود)</item>
|
||||
</string-array>
|
||||
<string name="pre_resolving_domain">Pre-resolving domain…</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -391,5 +391,6 @@
|
||||
<item>Наименьшая задержка</item>
|
||||
<item>Наименьшая нагрузка</item>
|
||||
</string-array>
|
||||
<string name="pre_resolving_domain">Предварительное определение домена…</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -379,5 +379,6 @@
|
||||
<item>Least Ping</item>
|
||||
<item>Least Load</item>
|
||||
</string-array>
|
||||
<string name="pre_resolving_domain">Pre-resolving domain…</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -383,5 +383,6 @@
|
||||
<item>最低延迟</item>
|
||||
<item>最稳定</item>
|
||||
</string-array>
|
||||
<string name="pre_resolving_domain">预解析域名中…</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -383,5 +383,6 @@
|
||||
<item>Least Ping</item>
|
||||
<item>Least Load</item>
|
||||
</string-array>
|
||||
<string name="pre_resolving_domain">Pre-resolving domain…</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -395,5 +395,6 @@
|
||||
<item>Least Ping</item>
|
||||
<item>Least Load</item>
|
||||
</string-array>
|
||||
<string name="pre_resolving_domain">Pre-resolving domain…</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
[versions]
|
||||
agp = "8.12.0"
|
||||
agp = "8.12.3"
|
||||
desugarJdkLibs = "2.1.5"
|
||||
gradleLicensePlugin = "0.9.8"
|
||||
kotlin = "2.2.0"
|
||||
kotlin = "2.2.20"
|
||||
coreKtx = "1.16.0"
|
||||
junit = "4.13.2"
|
||||
junitVersion = "1.2.1"
|
||||
espressoCore = "3.6.1"
|
||||
junitVersion = "1.3.0"
|
||||
espressoCore = "3.7.0"
|
||||
appcompat = "1.7.1"
|
||||
material = "1.12.0"
|
||||
material = "1.13.0"
|
||||
activity = "1.10.1"
|
||||
constraintlayout = "2.2.1"
|
||||
mmkvStatic = "1.3.14"
|
||||
@@ -20,8 +20,8 @@ swiperefreshlayout = "1.1.0"
|
||||
toasty = "1.5.2"
|
||||
editorkit = "2.9.0"
|
||||
core = "3.5.3"
|
||||
workRuntimeKtx = "2.10.2"
|
||||
lifecycleViewmodelKtx = "2.9.2"
|
||||
workRuntimeKtx = "2.10.5"
|
||||
lifecycleViewmodelKtx = "2.9.4"
|
||||
multidex = "2.0.1"
|
||||
mockitoMockitoInline = "5.2.0"
|
||||
flexbox = "3.0.0"
|
||||
|
||||
Reference in New Issue
Block a user