Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
304232d029 | ||
|
|
f80c3bfe07 | ||
|
|
bb0a62fc8b | ||
|
|
5bfdca6cd9 | ||
|
|
447e712a9d |
@@ -11,8 +11,8 @@ android {
|
|||||||
applicationId = "com.v2ray.ang"
|
applicationId = "com.v2ray.ang"
|
||||||
minSdk = 21
|
minSdk = 21
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 574
|
versionCode = 578
|
||||||
versionName = "1.8.30"
|
versionName = "1.8.34"
|
||||||
multiDexEnabled = true
|
multiDexEnabled = true
|
||||||
splits.abi {
|
splits.abi {
|
||||||
reset()
|
reset()
|
||||||
|
|||||||
@@ -236,7 +236,13 @@ object Utils {
|
|||||||
*/
|
*/
|
||||||
fun isValidUrl(value: String?): Boolean {
|
fun isValidUrl(value: String?): Boolean {
|
||||||
try {
|
try {
|
||||||
if (value != null && Patterns.WEB_URL.matcher(value).matches() || URLUtil.isValidUrl(value)) {
|
if (value.isNullOrEmpty()) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (Patterns.WEB_URL.matcher(value).matches()
|
||||||
|
|| Patterns.DOMAIN_NAME.matcher(value).matches()
|
||||||
|
|| URLUtil.isValidUrl(value)
|
||||||
|
) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
|||||||
@@ -52,9 +52,11 @@ object V2rayConfigUtil {
|
|||||||
}
|
}
|
||||||
val outbound = config.getProxyOutbound() ?: return Result(false, "")
|
val outbound = config.getProxyOutbound() ?: return Result(false, "")
|
||||||
val address = outbound.getServerAddress() ?: return Result(false, "")
|
val address = outbound.getServerAddress() ?: return Result(false, "")
|
||||||
if (!Utils.isIpAddress(address) && !Utils.isValidUrl(address)) {
|
if (!Utils.isIpAddress(address)) {
|
||||||
Log.d(ANG_PACKAGE, "$address is an invalid ip or domain")
|
if (!Utils.isValidUrl(address)) {
|
||||||
return Result(false, "")
|
Log.d(ANG_PACKAGE, "$address is an invalid ip or domain")
|
||||||
|
return Result(false, "")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val result = getV2rayNonCustomConfig(context, outbound, config.remarks)
|
val result = getV2rayNonCustomConfig(context, outbound, config.remarks)
|
||||||
|
|||||||
Reference in New Issue
Block a user