From e0410b6f102d7104f195da5cd0088aafd9dc2f76 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 22 Jan 2022 22:57:34 -0800 Subject: [PATCH] TLS only on release builds --- app/shared/src/debug/AndroidManifest.xml | 8 ++++++++ app/shared/src/main/AndroidManifest.xml | 4 +--- app/src/main/java/com/topjohnwu/magisk/di/Networking.kt | 5 ++--- 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 app/shared/src/debug/AndroidManifest.xml diff --git a/app/shared/src/debug/AndroidManifest.xml b/app/shared/src/debug/AndroidManifest.xml new file mode 100644 index 000000000..bc4718ecc --- /dev/null +++ b/app/shared/src/debug/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/app/shared/src/main/AndroidManifest.xml b/app/shared/src/main/AndroidManifest.xml index 9afc17dfb..2d2f9323b 100644 --- a/app/shared/src/main/AndroidManifest.xml +++ b/app/shared/src/main/AndroidManifest.xml @@ -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" /> diff --git a/app/src/main/java/com/topjohnwu/magisk/di/Networking.kt b/app/src/main/java/com/topjohnwu/magisk/di/Networking.kt index 99f5ac66d..663392dd2 100644 --- a/app/src/main/java/com/topjohnwu/magisk/di/Networking.kt +++ b/app/src/main/java/com/topjohnwu/magisk/di/Networking.kt @@ -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()))