DNS: built-in Google Public DNS and Cloudflare DNS for DoH

This commit is contained in:
PeratX 2019-07-14 21:41:40 +08:00
parent 2124ab2d69
commit c97b65fad7
10 changed files with 21 additions and 47 deletions

View File

@ -1,6 +1,8 @@
language: android
jdk: oraclejdk8
dist: xenial
git:
depth: 1
android:
components:
- tools
@ -12,8 +14,6 @@ android:
- extra-android-m2repository
licenses:
- '.+'
before_install:
- yes | sdkmanager "platforms;android-28"
script:
- chmod 777 gradlew
- ./gradlew clean assembleDebug

View File

@ -48,8 +48,8 @@ __Users must comply with local laws and regulations.__<br>
* __CuteDNS__ - *Shutdown according to regulations*
* __[FUN DNS](http://fundns.cn)__ - *Shutdown according to regulations*
* __[Pure DNS](https://puredns.cn/)__
* __[PdoMo-DNS](https://pdomo.me/)__ - *Intelligent Free Public DNS*
* __[Pure DNS](https://puredns.cn/)__ - *Shutdown according to regulations*
* __[PdoMo-DNS](https://pdomo.me/)__ - *Shutdown according to regulations*
* __[rubyfish](https://www.rubyfish.cn)__ - *Free DoT/DoH DNS*
## Rule Providers
@ -60,9 +60,8 @@ __Users must comply with local laws and regulations.__<br>
## Requirements
* Minimum Android version: 4.0.3 (API 15) - __*Basic VPN functions*__
* Recommended Android version: >= 5.0 (API 21) - __*Full features*__
* Best Android version: >= 7.1 (API 25) - __*Launcher shortcuts*__
* Minimum Android version: >= 5.0 (API 21)
* Recommended Android version: >= 7.1 (API 25) - __*Launcher shortcuts*__
## Open Source Licenses

View File

@ -49,6 +49,9 @@ public class Daedalus extends Application {
add(new DNSServer("101.101.101.101", R.string.server_twnic_primary));
add(new DNSServer("101.102.103.104", R.string.server_twnic_secondary));
add(new DNSServer("dns.rubyfish.cn/dns-query", R.string.server_rubyfish));
add(new DNSServer("cloudflare-dns.com/dns-query", R.string.server_cloudflare));
add(new DNSServer("dns.google/dns-query", R.string.server_google_ietf));
add(new DNSServer("dns.google/resolve", R.string.server_google_json));
}};
public static final List<Rule> RULES = new ArrayList<Rule>() {{

View File

@ -127,7 +127,7 @@ public class FilterAppProxyActivity extends AppCompatActivity {
}
}
runOnUiThread(() -> notifyDataSetChanged());
runOnUiThread(this::notifyDataSetChanged);
}
@NonNull

View File

@ -1,13 +1,8 @@
package org.itxtech.daedalus.fragment;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.preference.*;
import android.view.View;
import com.google.android.material.snackbar.Snackbar;
import org.itxtech.daedalus.Daedalus;
import org.itxtech.daedalus.R;
import org.itxtech.daedalus.activity.FilterAppProxyActivity;
@ -78,26 +73,14 @@ public class GlobalConfigFragment extends PreferenceFragment {
return true;
});
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
SwitchPreference advanced = (SwitchPreference) findPreference("settings_advanced_switch");
advanced.setEnabled(false);
advanced.setChecked(false);
SwitchPreference boot = (SwitchPreference) findPreference("settings_boot");
boot.setEnabled(false);
boot.setChecked(false);
SwitchPreference app_filter = (SwitchPreference) findPreference("settings_app_filter_switch");
app_filter.setEnabled(false);
app_filter.setChecked(false);
}
SwitchPreference advanced = (SwitchPreference) findPreference("settings_advanced_switch");
advanced.setOnPreferenceChangeListener((preference, newValue) -> {
updateOptions((boolean) newValue, "settings_advanced");
return true;
});
SwitchPreference app_filter = (SwitchPreference) findPreference("settings_app_filter_switch");
app_filter.setOnPreferenceChangeListener((p, w) -> {
SwitchPreference appFilter = (SwitchPreference) findPreference("settings_app_filter_switch");
appFilter.setOnPreferenceChangeListener((p, w) -> {
updateOptions((boolean) w, "settings_app_filter");
return true;
});
@ -128,7 +111,7 @@ public class GlobalConfigFragment extends PreferenceFragment {
});
updateOptions(advanced.isChecked(), "settings_advanced");
updateOptions(app_filter.isChecked(), "settings_app_filter");
updateOptions(appFilter.isChecked(), "settings_app_filter");
}
private void updateOptions(boolean checked, String pref) {
@ -145,13 +128,4 @@ public class GlobalConfigFragment extends PreferenceFragment {
}
}
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
Snackbar.make(view, R.string.notice_legacy_api, Snackbar.LENGTH_LONG).show();
}
}
}

View File

@ -7,7 +7,6 @@
<string name="notice_activated">已启用 iTXTech Daedalus。</string>
<string name="notice_start_test">正在测试指定的 DNS 服务器……</string>
<string name="notice_queries">DNS 查询次数:</string>
<string name="notice_legacy_api">当前 Android API 无法支持所有功能。</string>
<string name="notice_need_restart">重新启用 Daedalus 以应用设置。</string>
<string name="notice_start_download">正在下载规则,请稍等 ……</string>
<string name="notice_downloaded">已下载规则。</string>
@ -86,11 +85,12 @@
<string name="settings_app_filter_list">选择应用</string>
<string name="settings_app_filter_mode">黑名单模式</string>
<string name="settings_app_filter_list_summary">选择要过滤的应用</string>
<string name="settings_app_filter_summary">仅支持Android Lollipop及以上版本</string>
<string name="server_twnic_primary">Quad 101 主服务器</string>
<string name="server_twnic_secondary">Quad 101 辅服务器</string>
<string name="server_rubyfish">红鱼 (DoH)</string>
<string name="server_google_json">谷歌公共 DNS (DoH JSON)</string>
<string name="server_google_ietf">谷歌公共 DNS (DoH RFC8484)</string>
<string name="primary_server">首选 DNS 服务器</string>
<string name="secondary_server">备用 DNS 服务器</string>

View File

@ -7,7 +7,6 @@
<string name="notice_activated">已啟動 iTXTech Daedalus。</string>
<string name="notice_start_test">正在測試指定的 DNS 伺服器……</string>
<string name="notice_queries">DNS 查詢次數:</string>
<string name="notice_legacy_api">目前 Android API 無法支援所有功能。</string>
<string name="notice_need_restart">重新啟動 Daedalus 以套用設定。</string>
<string name="notice_start_download">正在下載規則,請稍等……</string>
<string name="notice_downloaded">已下載規則。</string>
@ -64,7 +63,7 @@
<string name="settings_manual_summary">造訪 GitHub wiki 頁面。</string>
<string name="settings_log_size">紀錄檔大小限制</string>
<string name="settings_debug_output">调试输出 TODO</string>
<string name="settings_dont_build_doh_cache">存 DoH DNS 的 IP地址</string>
<string name="settings_dont_build_doh_cache">存 DoH DNS 的 IP地址</string>
<string name="settings_dark_theme">使用暗主题</string>
<string name="settings_rule_name">規則名稱</string>
@ -86,7 +85,6 @@
<string name="settings_app_filter_list">選擇應用</string>
<string name="settings_app_filter_mode">黑名單模式</string>
<string name="settings_app_filter_list_summary">選擇要過濾的應用</string>
<string name="settings_app_filter_summary">僅支持Android Lollipop及以上版本</string>
<string name="server_twnic_primary">Quad 101 主伺服器</string>
<string name="server_twnic_secondary">Quad 101 輔伺服器</string>

View File

@ -6,7 +6,6 @@
<string name="notice_activated">iTXTech Daedalus is activated.</string>
<string name="notice_start_test">Testing specified DNS server…</string>
<string name="notice_queries">DNS query times:</string>
<string name="notice_legacy_api">The current Android API can not support all the features.</string>
<string name="notice_need_restart">Re-activate Daedalus to make the settings take effect.</string>
<string name="notice_start_download">Downloading rule, please wait …</string>
<string name="notice_downloaded">Rule has been downloaded.</string>
@ -91,11 +90,13 @@
<string name="settings_app_filter_mode">Blacklist mode</string>
<string name="settings_app_filter_list">Select application</string>
<string name="settings_app_filter_list_summary">Select apps to pass through</string>
<string name="settings_app_filter_summary">Only supports Android Lollipop and above</string>
<string name="server_twnic_primary">Quad 101 Primary</string>
<string name="server_twnic_secondary">Quad 101 Secondary</string>
<string name="server_rubyfish">rubyfish (DoH)</string>
<string name="server_cloudflare">Cloudflare DNS (DoH)</string>
<string name="server_google_json">Google Public DNS (DoH JSON)</string>
<string name="server_google_ietf">Google Public DNS (DoH RFC8484)</string>
<string name="primary_server">Primary DNS server</string>
<string name="secondary_server">Secondary DNS server</string>

View File

@ -54,7 +54,6 @@
<SwitchPreference
android:key="settings_app_filter_switch"
android:title="@string/settings_app_filter"
android:summary="@string/settings_app_filter_summary"
android:defaultValue="false"/>
<SwitchPreference
android:key="settings_app_filter_mode_switch"

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-4.6-bin.zip
distributionUrl=https://services.gradle.org/distributions/gradle-5.5.1-bin.zip