Bug fix
This commit is contained in:
1 parent
79297f8a42
commit
a726f00f35
1 file changed
+8
@@ -2,9 +2,11 @@ package com.v2ray.ang.util
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
|
import android.util.Log
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.tencent.mmkv.MMKV
|
import com.tencent.mmkv.MMKV
|
||||||
import com.v2ray.ang.AppConfig
|
import com.v2ray.ang.AppConfig
|
||||||
|
import com.v2ray.ang.AppConfig.ANG_PACKAGE
|
||||||
import com.v2ray.ang.AppConfig.PROTOCOL_FREEDOM
|
import com.v2ray.ang.AppConfig.PROTOCOL_FREEDOM
|
||||||
import com.v2ray.ang.AppConfig.TAG_DIRECT
|
import com.v2ray.ang.AppConfig.TAG_DIRECT
|
||||||
import com.v2ray.ang.AppConfig.TAG_FRAGMENT
|
import com.v2ray.ang.AppConfig.TAG_FRAGMENT
|
||||||
@@ -49,6 +51,12 @@ object V2rayConfigUtil {
|
|||||||
return Result(true, customConfig)
|
return Result(true, customConfig)
|
||||||
}
|
}
|
||||||
val outbound = config.getProxyOutbound() ?: return Result(false, "")
|
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)
|
val result = getV2rayNonCustomConfig(context, outbound, config.remarks)
|
||||||
//Log.d(ANG_PACKAGE, result.content)
|
//Log.d(ANG_PACKAGE, result.content)
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in new issue
Block a user