├── .gitignore ├── CHANGELOG.md ├── HttpDnsLibs ├── HTTPDNS_Android_v4.10.1a_release.aar └── HTTPDNS_Android_v4.10.1a_release_intl.aar ├── HttpDnsSample ├── .gitignore ├── HTTPDNS_Android_v4.10.1a_release │ ├── HTTPDNS_Android_v4.10.1a_release.aar │ └── build.gradle ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── yx │ │ │ └── dnsTest │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── yx │ │ │ │ └── dnsTest │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.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 │ │ │ ├── values-night │ │ │ └── themes.xml │ │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── themes.xml │ │ │ └── xml │ │ │ └── network_security_config.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── yx │ │ └── dnsTest │ │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── keystore └── settings.gradle └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | *.aab 5 | 6 | # Files for the ART/Dalvik VM 7 | *.dex 8 | 9 | # Java class files 10 | *.class 11 | 12 | # Generated files 13 | bin/ 14 | gen/ 15 | out/ 16 | # Uncomment the following line in case you need and you don't have the release build type files in your app 17 | # release/ 18 | 19 | # Gradle files 20 | .gradle/ 21 | build/ 22 | 23 | # Local configuration file (sdk path, etc) 24 | local.properties 25 | 26 | # Proguard folder generated by Eclipse 27 | proguard/ 28 | 29 | # Log Files 30 | *.log 31 | 32 | # Android Studio Navigation editor temp files 33 | .navigation/ 34 | 35 | # Android Studio captures folder 36 | captures/ 37 | 38 | # IntelliJ 39 | *.iml 40 | .idea/workspace.xml 41 | .idea/tasks.xml 42 | .idea/gradle.xml 43 | .idea/assetWizardSettings.xml 44 | .idea/dictionaries 45 | .idea/libraries 46 | # Android Studio 3 in .gitignore file. 47 | .idea/caches 48 | .idea/modules.xml 49 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you 50 | .idea/navEditor.xml 51 | 52 | # Keystore files 53 | # Uncomment the following lines if you do not want to check your keystore files in. 54 | #*.jks 55 | #*.keystore 56 | 57 | # External native build folder generated in Android Studio 2.2 and later 58 | .externalNativeBuild 59 | .cxx/ 60 | 61 | # Google Services (e.g. APIs or Firebase) 62 | # google-services.json 63 | 64 | # Freeline 65 | freeline.py 66 | freeline/ 67 | freeline_project_description.json 68 | 69 | # fastlane 70 | fastlane/report.xml 71 | fastlane/Preview.html 72 | fastlane/screenshots 73 | fastlane/test_output 74 | fastlane/readme.md 75 | 76 | # Version control 77 | vcs.xml 78 | 79 | # lint 80 | lint/intermediates/ 81 | lint/generated/ 82 | lint/outputs/ 83 | lint/tmp/ 84 | # lint/reports/ 85 | 86 | # Mac 87 | .DS_Store 88 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## v4.8.1 2 | 1. 功能优化。 3 | 4 | ## v4.8.0 5 | 1. 缓存策略优化。 6 | 2. 代码优化。 7 | 8 | ## v4.7.0 9 | 1. 新增清除指定域名缓存能力。 10 | 2. 解析监控日志上报调整。 11 | 3. 功能优化。 12 | 13 | ## v4.6.0 14 | 1. http 解析请求支持长链接。 15 | 2. 批量解析重构优化。 16 | 3. 功能优化。 17 | 18 | ## v4.5.0 19 | 1. dnsip(HTTPDNS服务IP) SDK内部调度,无需用户配置。 20 | 2. 支持ECS IP配置。 21 | 3. 包体积优化。 22 | 4. 灯塔(beacon)下线。 23 | 24 | ## v4.4.0 25 | 1. SDK 支持数据上报统计分析,配合控制台解析监控使用。原灯塔上报服务(beacon)将下线,建议尽快切换。 26 | 2. 新增独立国际版 SDK。 27 | 3. 功能优化。 28 | 29 | ## 4.3.0 30 | 1. 新增允许使用过期缓存配置,调整对应解析逻辑。 31 | 2. 新增本地存储能力。 32 | 3. 功能优化。 33 | 34 | ## 4.2.0 35 | 1. 新增 IP 优选服务 36 | 2. 功能优化 37 | 38 | ## 4.1.0 39 | 1. 新增缓存自动刷新功能 40 | 2. 解析时延优化 41 | 42 | ## 4.0.1 43 | 1. 优化批量接口返回数据 44 | 45 | ## 4.0.0 46 | 1. 增加参数配置选项、自定义解析栈(IPV4,IPV6) 47 | 2. 开放预解析能力、关闭localdns兜底解析能力 48 | 49 | ## 3.9.0 50 | 1. 代码优化 51 | 52 | ## 3.8.0 53 | 1. atta解析日志上报 54 | 2. 容灾逻辑优化 55 | 56 | ## 3.7.0 57 | 1. 提供IPv4、IPv6 异步解析接口 58 | 2. 去除SSID信息采集 59 | 60 | ## 3.6.0 61 | 1. 支持批量查询以及多种加密方式(AES、HTTPS、DES) 62 | 63 | ## 3.5.0 64 | 65 | ### Bug Fixes 66 | 67 | 1. 修复返回单个IP时不均衡的问题 68 | 2. 优化双栈网络请求和缓存处理 69 | 3. 将默认的DNS超时时间调整为2000毫秒 70 | 71 | ## 3.3.0 72 | 73 | ### Bug Fixes 74 | 75 | 1. 优化弱网下的网络请求 76 | 77 | ## 3.2.5 78 | 79 | ### Bug Fixes 80 | 81 | 1. HTTP的接收完成判断调整 82 | 2. 对于字符指针使用malloc代替new 83 | 84 | 85 | ## 3.2.4 86 | 87 | ### Bug Fixes 88 | 89 | 1. 修复readable之后读取仍可能为0的问题,此时需要重试 90 | 2. 网络切变判断调整 91 | 92 | -------------------------------------------------------------------------------- /HttpDnsLibs/HTTPDNS_Android_v4.10.1a_release.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentCloud/httpdns-sdk-android/cecccc776632ca0057e06f535c0b6afe8176b745/HttpDnsLibs/HTTPDNS_Android_v4.10.1a_release.aar -------------------------------------------------------------------------------- /HttpDnsLibs/HTTPDNS_Android_v4.10.1a_release_intl.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentCloud/httpdns-sdk-android/cecccc776632ca0057e06f535c0b6afe8176b745/HttpDnsLibs/HTTPDNS_Android_v4.10.1a_release_intl.aar -------------------------------------------------------------------------------- /HttpDnsSample/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | /.idea/ 11 | .DS_Store 12 | /build 13 | /captures 14 | .externalNativeBuild 15 | /app/release 16 | -------------------------------------------------------------------------------- /HttpDnsSample/HTTPDNS_Android_v4.10.1a_release/HTTPDNS_Android_v4.10.1a_release.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentCloud/httpdns-sdk-android/cecccc776632ca0057e06f535c0b6afe8176b745/HttpDnsSample/HTTPDNS_Android_v4.10.1a_release/HTTPDNS_Android_v4.10.1a_release.aar -------------------------------------------------------------------------------- /HttpDnsSample/HTTPDNS_Android_v4.10.1a_release/build.gradle: -------------------------------------------------------------------------------- 1 | configurations.maybeCreate("default") 2 | artifacts.add("default", file('HTTPDNS_Android_v4.10.1a_release.aar')) -------------------------------------------------------------------------------- /HttpDnsSample/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /HttpDnsSample/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | id 'kotlin-android' 4 | } 5 | 6 | android { 7 | compileSdkVersion 30 8 | 9 | defaultConfig { 10 | applicationId "com.yx.dnsTest" 11 | minSdkVersion 23 12 | targetSdkVersion 30 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | 18 | // ndk { 19 | // abiFilters "armeabi-v7a", "arm64-v8a" 20 | // } 21 | } 22 | 23 | buildTypes { 24 | release { 25 | minifyEnabled false 26 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 27 | } 28 | } 29 | 30 | flavorDimensions "version" 31 | 32 | productFlavors { 33 | normal {} 34 | 35 | intl {} 36 | } 37 | 38 | // packagingOptions{ 39 | // pickFirst '**/*.so' 40 | // } 41 | 42 | compileOptions { 43 | sourceCompatibility JavaVersion.VERSION_1_8 44 | targetCompatibility JavaVersion.VERSION_1_8 45 | } 46 | kotlinOptions { 47 | jvmTarget = '1.8' 48 | } 49 | ndkVersion '21.3.6528147' 50 | } 51 | 52 | dependencies { 53 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 54 | implementation 'androidx.core:core-ktx:1.3.2' 55 | implementation 'androidx.appcompat:appcompat:1.2.0' 56 | implementation 'com.google.android.material:material:1.3.0' 57 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 58 | implementation project(path: ':HTTPDNS_Android_v4.10.1a_release') 59 | testImplementation 'junit:junit:4.+' 60 | androidTestImplementation 'androidx.test.ext:junit:1.1.2' 61 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' 62 | } -------------------------------------------------------------------------------- /HttpDnsSample/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /HttpDnsSample/app/src/androidTest/java/com/yx/dnsTest/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.yx.dnsTest 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.yx.dnsTest", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /HttpDnsSample/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /HttpDnsSample/app/src/main/java/com/yx/dnsTest/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.yx.dnsTest 2 | 3 | import android.os.Bundle 4 | import android.util.Log 5 | import android.view.View 6 | import android.widget.Button 7 | import android.widget.EditText 8 | import android.widget.TextView 9 | import androidx.appcompat.app.AppCompatActivity 10 | import com.tencent.msdk.dns.DnsConfig 11 | import com.tencent.msdk.dns.MSDKDnsResolver 12 | 13 | class MainActivity : AppCompatActivity() { 14 | override fun onCreate(savedInstanceState: Bundle?) { 15 | super.onCreate(savedInstanceState) 16 | setContentView(R.layout.activity_main) 17 | 18 | val TAG = "MainActivity" 19 | 20 | val textInput: EditText = findViewById(R.id.textInput) 21 | val btn = findViewById