-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix several DoH issues and allow to specify the server
- Loading branch information
Showing
7 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,9 +96,20 @@ private void start() { | |
PowerTunnel.DOH_ADDRESS = null; | ||
if (prefs.getBoolean("override_dns", false) || DNS_SERVERS.isEmpty()) { | ||
String provider = prefs.getString("dns_provider", "CLOUDFLARE"); | ||
DNS_SERVERS.clear(); | ||
DNS_OVERRIDE = true; | ||
if(provider.equals("SPECIFIED")) { | ||
String specifiedDnsProvider = prefs.getString("specified_dns_provider", ""); | ||
if(!specifiedDnsProvider.trim().isEmpty()) { | ||
if(specifiedDnsProvider.startsWith("https://")) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
krlvm
Author
Owner
|
||
PowerTunnel.DOH_ADDRESS = specifiedDnsProvider; | ||
} else { | ||
This comment has been minimized.
Sorry, something went wrong.
DRSDavidSoft
|
||
DNS_SERVERS.clear(); | ||
DNS_SERVERS.add(specifiedDnsProvider); | ||
} | ||
} | ||
} | ||
if (!provider.contains("_DOH")) { | ||
DNS_SERVERS.clear(); | ||
switch (provider) { | ||
default: | ||
case "CLOUDFLARE": { | ||
|
@@ -139,7 +150,7 @@ private void start() { | |
} | ||
} | ||
} | ||
Log.i(TAG, "Waiting for VPN server start..."); | ||
Log.i(TAG, "Waiting for VPN server to start..."); | ||
if (!PowerTunnel.isRunning()) { | ||
try { | ||
PowerTunnel.bootstrap(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This should be like this:
This is because the same DoH endpoints can be used over plain HTTP.