Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions app/src/main/java/org/lsposed/manager/util/CloudflareDNS.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,18 @@ public CloudflareDNS() {
@NonNull
@Override
public List<InetAddress> lookup(@NonNull String hostname) throws UnknownHostException {
if (DoH && noProxy) {
return cloudflare.lookup(hostname);
} else {
return SYSTEM.lookup(hostname);
try {
if (DoH && noProxy) {
return cloudflare.lookup(hostname);
} else {
return SYSTEM.lookup(hostname);
}
} catch (SecurityException e) {
var message = e.getMessage();
var unknownHost = new UnknownHostException(
message == null ? hostname : hostname + ": " + message);
unknownHost.initCause(e);
throw unknownHost;
}
}
}