From 5f42ae651450c8e96c2e374ce75a9ab9d625d236 Mon Sep 17 00:00:00 2001 From: PeratX <1215714524@qq.com> Date: Sat, 10 Nov 2018 13:16:24 +0800 Subject: [PATCH] ietfdoh: fixed Base64Url --- .../java/org/itxtech/daedalus/provider/HttpsIetfProvider.java | 3 ++- .../main/java/org/itxtech/daedalus/provider/TlsProvider.java | 1 + app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values-zh-rTW/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- default.host => default.hosts | 0 6 files changed, 6 insertions(+), 4 deletions(-) rename default.host => default.hosts (100%) diff --git a/app/src/main/java/org/itxtech/daedalus/provider/HttpsIetfProvider.java b/app/src/main/java/org/itxtech/daedalus/provider/HttpsIetfProvider.java index 81d2758..539d4a3 100644 --- a/app/src/main/java/org/itxtech/daedalus/provider/HttpsIetfProvider.java +++ b/app/src/main/java/org/itxtech/daedalus/provider/HttpsIetfProvider.java @@ -53,7 +53,8 @@ public class HttpsIetfProvider extends HttpsProvider { Request request = new Request.Builder() .url(HttpUrl.parse(HTTPS_SUFFIX + uri).newBuilder() .addQueryParameter("dns", Base64.encodeToString( - message.asBuilder().setId(0).build().toArray(), Base64.DEFAULT)) + message.asBuilder().setId(0).build().toArray(), + Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP)) .build()) .get() .build(); diff --git a/app/src/main/java/org/itxtech/daedalus/provider/TlsProvider.java b/app/src/main/java/org/itxtech/daedalus/provider/TlsProvider.java index e395ce7..6ca65c9 100644 --- a/app/src/main/java/org/itxtech/daedalus/provider/TlsProvider.java +++ b/app/src/main/java/org/itxtech/daedalus/provider/TlsProvider.java @@ -36,6 +36,7 @@ public class TlsProvider extends TcpProvider{ dnsSocket = context.getSocketFactory().createSocket(outPacket.getAddress(), DNSServerHelper.getPortOrDefault(outPacket.getAddress(), outPacket.getPort())); //Create TLS v1.2 socket + //TODO: SNI service.protect(dnsSocket); diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 2a7507e..02955e9 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -87,7 +87,7 @@ PdoMo DNS 辅服务器 PureDNS 华南 PureDNS 华北 - 红鱼 (DoT/DOH) + 红鱼 (DoH) 首选 DNS 服务器 备用 DNS 服务器 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 1a3de53..46b8d21 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -87,7 +87,7 @@ PdoMo DNS 輔伺服器 PureDNS 華南 PureDNS 華北 - 紅魚 (DoT/DOH) + 紅魚 (DoH) 主要 DNS 伺服器 次要 DNS 伺服器 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7368e97..f9c4afd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -92,7 +92,7 @@ PdoMo DNS Secondary PureDNS South China PureDNS North China - rubyfish (DoT/DOH) + rubyfish (DoH) Primary DNS server Secondary DNS server diff --git a/default.host b/default.hosts similarity index 100% rename from default.host rename to default.hosts