├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── haohaozaici │ │ │ │ └── httpdns │ │ │ │ ├── model │ │ │ │ └── sp │ │ │ │ │ ├── BaseSP.java │ │ │ │ │ └── HttpDnsSP.java │ │ │ │ ├── network │ │ │ │ ├── api │ │ │ │ │ └── APIService.java │ │ │ │ ├── httpdns │ │ │ │ │ ├── OkHttpDns.java │ │ │ │ │ ├── HttpDnsRes.java │ │ │ │ │ └── HttpDnsCache.java │ │ │ │ └── Network.java │ │ │ │ ├── HttpDnsWebView.java │ │ │ │ ├── App.java │ │ │ │ ├── HttpDnsWebClient.java │ │ │ │ ├── MainActivity.java │ │ │ │ └── feature │ │ │ │ └── bilibilipic │ │ │ │ └── SplashPicRes.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── haohaozaici │ │ │ └── httpdns │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── io │ │ └── github │ │ └── haohaozaici │ │ └── httpdns │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── img └── 递归dns.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── .gitignore ├── gradlew.bat ├── gradlew └── README.md /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /release 3 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /img/递归dns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haohaozaici/HttpDNS/HEAD/img/递归dns.png -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | HttpDNS 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haohaozaici/HttpDNS/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haohaozaici/HttpDNS/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haohaozaici/HttpDNS/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haohaozaici/HttpDNS/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haohaozaici/HttpDNS/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haohaozaici/HttpDNS/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haohaozaici/HttpDNS/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haohaozaici/HttpDNS/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haohaozaici/HttpDNS/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haohaozaici/HttpDNS/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haohaozaici/HttpDNS/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/haohaozaici/httpdns/model/sp/BaseSP.java: -------------------------------------------------------------------------------- 1 | package io.github.haohaozaici.httpdns.model.sp; 2 | 3 | /** 4 | * Created by haoyuan on 2018/1/23. 5 | */ 6 | 7 | public class BaseSP { 8 | 9 | public static final String COMMON = "common"; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jan 23 09:29:19 CST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/haohaozaici/httpdns/model/sp/HttpDnsSP.java: -------------------------------------------------------------------------------- 1 | package io.github.haohaozaici.httpdns.model.sp; 2 | 3 | /** 4 | * Created by haoyuan on 2018/1/23. 5 | */ 6 | 7 | public class HttpDnsSP { 8 | 9 | public static final String HTTP_DNS = "httpDns"; 10 | 11 | // public static final String HTTP_DNS_TTL = "HTTP_DNS_TTL"; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/io/github/haohaozaici/httpdns/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package io.github.haohaozaici.httpdns; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/io/github/haohaozaici/httpdns/network/api/APIService.java: -------------------------------------------------------------------------------- 1 | package io.github.haohaozaici.httpdns.network.api; 2 | 3 | import io.github.haohaozaici.httpdns.feature.bilibilipic.SplashPicRes; 4 | import io.reactivex.Flowable; 5 | import retrofit2.http.GET; 6 | 7 | /** 8 | * Created by haoyuan on 2018/1/23. 9 | */ 10 | 11 | public interface APIService { 12 | 13 | 14 | String BiliBili_API_HOST = "https://app.bilibili.com/"; 15 | 16 | 17 | @GET("/x/splash?plat=0&width=1080&height=1920") 18 | Flowable getSplashPic(); 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/haohaozaici/httpdns/HttpDnsWebView.java: -------------------------------------------------------------------------------- 1 | package io.github.haohaozaici.httpdns; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.webkit.WebView; 7 | 8 | /** 9 | * Created by haoyuan on 2018/1/25. 10 | */ 11 | 12 | public class HttpDnsWebView extends AppCompatActivity { 13 | 14 | WebView mWebView; 15 | 16 | 17 | @Override 18 | protected void onCreate(@Nullable Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | 21 | // mWebView.setWebViewClient(); 22 | 23 | 24 | 25 | 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/haohaozaici/httpdns/App.java: -------------------------------------------------------------------------------- 1 | package io.github.haohaozaici.httpdns; 2 | 3 | import android.app.Application; 4 | 5 | import com.blankj.utilcode.util.Utils; 6 | import com.elvishew.xlog.XLog; 7 | 8 | import io.github.haohaozaici.httpdns.network.httpdns.HttpDnsCache; 9 | 10 | /** 11 | * Created by haoyuan on 2018/1/23. 12 | */ 13 | 14 | public class App extends Application { 15 | 16 | 17 | @Override 18 | public void onCreate() { 19 | super.onCreate(); 20 | Utils.init(this); 21 | XLog.init(); 22 | 23 | //preload dns cache 24 | HttpDnsCache dnsCache = HttpDnsCache.getInstance(); 25 | dnsCache.init(191607, "app.bilibili.com", "api.bilibili.com"); 26 | dnsCache.loadDnsCache(); 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/haohaozaici/httpdns/HttpDnsWebClient.java: -------------------------------------------------------------------------------- 1 | package io.github.haohaozaici.httpdns; 2 | 3 | import android.webkit.WebResourceRequest; 4 | import android.webkit.WebResourceResponse; 5 | import android.webkit.WebView; 6 | import android.webkit.WebViewClient; 7 | 8 | /** 9 | * Created by haoyuan on 2018/1/25. 10 | */ 11 | 12 | public class HttpDnsWebClient extends WebViewClient { 13 | 14 | @Override 15 | public WebResourceResponse shouldInterceptRequest(WebView view, String url) { 16 | 17 | 18 | 19 | return super.shouldInterceptRequest(view, url); 20 | } 21 | 22 | 23 | @Override 24 | public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) { 25 | 26 | 27 | 28 | return super.shouldInterceptRequest(view, request); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 |