Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d5351ec9e | ||
|
|
d9fb121d67 | ||
|
|
62d0951a24 | ||
|
|
d6605cc866 | ||
|
|
1fc493d879 | ||
|
|
bdc27dd180 | ||
|
|
e257c4cb56 |
@@ -83,7 +83,7 @@ dependencies {
|
|||||||
implementation "androidx.preference:preference:1.0.0"
|
implementation "androidx.preference:preference:1.0.0"
|
||||||
implementation "androidx.recyclerview:recyclerview:1.2.1"
|
implementation "androidx.recyclerview:recyclerview:1.2.1"
|
||||||
implementation 'androidx.multidex:multidex:2.0.1'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
implementation 'androidx.viewpager2:viewpager2:1.0.0'
|
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
|
||||||
|
|
||||||
// Androidx ktx
|
// Androidx ktx
|
||||||
implementation 'androidx.activity:activity-ktx:1.2.4'
|
implementation 'androidx.activity:activity-ktx:1.2.4'
|
||||||
|
|||||||
@@ -459,10 +459,15 @@ object Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Throws(IOException::class)
|
@Throws(IOException::class)
|
||||||
fun getUrlContentWithCustomUserAgent(url: String?): String {
|
fun getUrlContentWithCustomUserAgent(urlStr: String?): String {
|
||||||
val conn = URL(url).openConnection()
|
val url = URL(urlStr)
|
||||||
|
val conn = url.openConnection()
|
||||||
conn.setRequestProperty("Connection", "close")
|
conn.setRequestProperty("Connection", "close")
|
||||||
conn.setRequestProperty("User-agent", "v2rayNG/${BuildConfig.VERSION_NAME}")
|
conn.setRequestProperty("User-agent", "v2rayNG/${BuildConfig.VERSION_NAME}")
|
||||||
|
url.userInfo?.let {
|
||||||
|
conn.setRequestProperty("Authorization",
|
||||||
|
"Basic ${encode(urlDecode(it))}")
|
||||||
|
}
|
||||||
conn.useCaches = false
|
conn.useCaches = false
|
||||||
return conn.inputStream.use {
|
return conn.inputStream.use {
|
||||||
it.bufferedReader().readText()
|
it.bufferedReader().readText()
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ object V2rayConfigUtil {
|
|||||||
v2rayConfig.inbounds[0].port = 10808
|
v2rayConfig.inbounds[0].port = 10808
|
||||||
val fakedns = settingsStorage?.decodeBool(AppConfig.PREF_FAKE_DNS_ENABLED)
|
val fakedns = settingsStorage?.decodeBool(AppConfig.PREF_FAKE_DNS_ENABLED)
|
||||||
?: false
|
?: false
|
||||||
val sniffAllTlsAndHttp = settingsStorage?.decodeBool(AppConfig.PREF_SNIFFING_ENABLED)
|
val sniffAllTlsAndHttp = settingsStorage?.decodeBool(AppConfig.PREF_SNIFFING_ENABLED, true)
|
||||||
?: true
|
?: true
|
||||||
v2rayConfig.inbounds[0].sniffing?.enabled = fakedns || sniffAllTlsAndHttp
|
v2rayConfig.inbounds[0].sniffing?.enabled = fakedns || sniffAllTlsAndHttp
|
||||||
if (!sniffAllTlsAndHttp) {
|
if (!sniffAllTlsAndHttp) {
|
||||||
|
|||||||
Reference in New Issue
Block a user