Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
8a61ae62
Commit
8a61ae62
authored
Sep 13, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable DoH upon failure
parent
60e1e07e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
NetworkingModule.kt
...src/main/java/com/topjohnwu/magisk/di/NetworkingModule.kt
+9
-2
No files found.
app/src/main/java/com/topjohnwu/magisk/di/NetworkingModule.kt
View file @
8a61ae62
...
@@ -22,6 +22,7 @@ import retrofit2.Retrofit
...
@@ -22,6 +22,7 @@ import retrofit2.Retrofit
import
retrofit2.converter.moshi.MoshiConverterFactory
import
retrofit2.converter.moshi.MoshiConverterFactory
import
retrofit2.converter.scalars.ScalarsConverterFactory
import
retrofit2.converter.scalars.ScalarsConverterFactory
import
java.net.InetAddress
import
java.net.InetAddress
import
java.net.UnknownHostException
val
networkingModule
=
module
{
val
networkingModule
=
module
{
single
{
createOkHttpClient
(
get
())
}
single
{
createOkHttpClient
(
get
())
}
...
@@ -62,10 +63,16 @@ fun createOkHttpClient(context: Context): OkHttpClient {
...
@@ -62,10 +63,16 @@ fun createOkHttpClient(context: Context): OkHttpClient {
.
resolvePrivateAddresses
(
true
)
/* To make PublicSuffixDatabase never used */
.
resolvePrivateAddresses
(
true
)
/* To make PublicSuffixDatabase never used */
.
build
()
.
build
()
var
skipDoH
=
false
builder
.
dns
{
hostname
->
builder
.
dns
{
hostname
->
// Only resolve via DoH for known DNS polluted hostnames
// Only resolve via DoH for known DNS polluted hostnames
if
(
hostname
==
"raw.githubusercontent.com"
)
{
if
(!
skipDoH
&&
hostname
==
"raw.githubusercontent.com"
)
{
try
{
doh
.
lookup
(
hostname
)
doh
.
lookup
(
hostname
)
}
catch
(
e
:
UnknownHostException
)
{
skipDoH
=
true
Dns
.
SYSTEM
.
lookup
(
hostname
)
}
}
else
{
}
else
{
Dns
.
SYSTEM
.
lookup
(
hostname
)
Dns
.
SYSTEM
.
lookup
(
hostname
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment