Skip to content

Commit

Permalink
更新host文件:删除了部分失效域名
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaojieonly committed Aug 15, 2024
1 parent 6ceffa3 commit c3a9c9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/hippo/ehviewer/EhApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import com.hippo.content.RecordingApplication;
import com.hippo.ehviewer.client.EhClient;
import com.hippo.ehviewer.client.EhCookieStore;
import com.hippo.ehviewer.client.EhDns;
import com.hippo.ehviewer.client.EhHosts;
import com.hippo.ehviewer.client.EhEngine;
import com.hippo.ehviewer.client.data.EhNewsDetail;
import com.hippo.ehviewer.client.data.GalleryDetail;
Expand Down Expand Up @@ -374,7 +374,7 @@ public static OkHttpClient getOkHttpClient(@NonNull Context context) {
.cache(getOkHttpCache(application))
// .hostnameVerifier((hostname, session) -> true)
// .dispatcher(dispatcher)
.dns(new EhDns(application))
.dns(new EhHosts(application))
.addNetworkInterceptor(sprocket -> {
try {
return sprocket.proceed(sprocket.request());
Expand Down Expand Up @@ -441,7 +441,7 @@ public static OkHttpClient getImageOkHttpClient(@NonNull Context context) {
.cookieJar(getEhCookieStore(application))
.cache(getOkHttpCache(application))
// .hostnameVerifier((hostname, session) -> true)
.dns(new EhDns(application))
.dns(new EhHosts(application))
.addNetworkInterceptor(sprocket -> {
try {
return sprocket.proceed(sprocket.request());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import okhttp3.dnsoverhttps.DnsOverHttps;


public class EhDns implements Dns {
public class EhHosts implements Dns {

private static final Map<String, List<InetAddress>> builtInHosts;

Expand All @@ -55,30 +55,12 @@ public class EhDns implements Dns {
"104.20.18.168",
"104.20.19.168",
"172.67.2.238",
"178.162.139.11",
"178.162.139.12",
"178.162.139.13",
"178.162.139.14",
"178.162.139.15",
"178.162.139.16",
"178.162.139.33",
"178.162.139.34",
"178.162.139.36",
"178.162.145.131",
"178.162.145.132",
"178.162.145.152",
"37.48.89.1",
"37.48.89.13",
"37.48.89.14",
"37.48.89.15",
"37.48.89.2",
"37.48.89.20",
"37.48.89.25",
"37.48.89.26",
"37.48.89.3",
"81.171.10.49",
"81.171.10.51",
"81.171.10.53"
"178.162.145.152"
);
put(map, "repo.e-hentai.org", "94.100.28.57", "94.100.29.73");
put(map, "forums.e-hentai.org", "94.100.18.243");
Expand Down Expand Up @@ -127,7 +109,7 @@ public class EhDns implements Dns {
private final Hosts hosts;
private static DnsOverHttps dnsOverHttps;

public EhDns(Context context) {
public EhHosts(Context context) {
hosts = EhApplication.getHosts(context);
DnsOverHttps.Builder builder = new DnsOverHttps.Builder()
.client(new OkHttpClient.Builder().cache(EhApplication.getOkHttpCache(context)).build())
Expand Down

0 comments on commit c3a9c9d

Please sign in to comment.