TLS only on release builds

This commit is contained in:
topjohnwu 2022-01-22 22:57:34 -08:00
parent 8eac6c0b48
commit e0410b6f10
3 changed files with 11 additions and 6 deletions

View File

@ -0,0 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:usesCleartextTraffic="true"
tools:ignore="UnusedAttribute" />
</manifest>

View File

@ -22,8 +22,6 @@
android:label="Magisk"
android:requestLegacyExternalStorage="true"
android:supportsRtl="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:usesCleartextTraffic="true"
tools:ignore="UnusedAttribute" />
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
</manifest>

View File

@ -47,8 +47,7 @@ private class DnsResolver(client: OkHttpClient) : Dns {
if (Config.doh) {
try {
return doh.lookup(hostname)
} catch (e: UnknownHostException) {
}
} catch (e: UnknownHostException) {}
}
return Dns.SYSTEM.lookup(hostname)
}
@ -64,7 +63,7 @@ fun createOkHttpClient(context: Context): OkHttpClient {
level = HttpLoggingInterceptor.Level.BASIC
})
} else {
builder.connectionSpecs(listOf(ConnectionSpec.RESTRICTED_TLS))
builder.connectionSpecs(listOf(ConnectionSpec.MODERN_TLS))
}
builder.dns(DnsResolver(builder.build()))