带阿里标识的版本
This commit is contained in:
77
EdgeHttpDNS/sdk/.tmp_android_bundle/README.md
Normal file
77
EdgeHttpDNS/sdk/.tmp_android_bundle/README.md
Normal file
@@ -0,0 +1,77 @@
|
||||
# HTTPDNS Android SDK (SNI Hidden v1.0.0)
|
||||
|
||||
## 1. Init
|
||||
|
||||
```java
|
||||
import com.Trust.sdk.android.httpdns.HttpDns;
|
||||
import com.Trust.sdk.android.httpdns.HttpDnsService;
|
||||
import com.Trust.sdk.android.httpdns.InitConfig;
|
||||
|
||||
String appId = "app1f1ndpo9";
|
||||
|
||||
new InitConfig.Builder()
|
||||
.setContext(context)
|
||||
.setPrimaryServiceHost("httpdns-a.example.com")
|
||||
.setBackupServiceHost("httpdns-b.example.com")
|
||||
.setServicePort(443)
|
||||
.setSecretKey("your-sign-secret") // optional if sign is enabled
|
||||
.setEnableHttps(true)
|
||||
.buildFor(appId);
|
||||
|
||||
HttpDnsService httpDnsService = HttpDns.getService(appId);
|
||||
```
|
||||
|
||||
## 2. Resolve
|
||||
|
||||
```java
|
||||
HTTPDNSResult result = httpDnsService.getHttpDnsResultForHostSyncNonBlocking(
|
||||
"api.business.com",
|
||||
RequestIpType.auto,
|
||||
null,
|
||||
null
|
||||
);
|
||||
```
|
||||
|
||||
## 3. Official HTTP Adapter (IP + Empty-SNI + Host)
|
||||
|
||||
```java
|
||||
import com.Trust.sdk.android.httpdns.network.HttpDnsAdapterOptions;
|
||||
import com.Trust.sdk.android.httpdns.network.HttpDnsAdapterRequest;
|
||||
import com.Trust.sdk.android.httpdns.network.HttpDnsAdapterResponse;
|
||||
import com.Trust.sdk.android.httpdns.network.HttpDnsHttpAdapter;
|
||||
|
||||
HttpDnsHttpAdapter adapter = HttpDns.buildHttpClientAdapter(
|
||||
httpDnsService,
|
||||
new HttpDnsAdapterOptions.Builder()
|
||||
.setConnectTimeoutMillis(3000)
|
||||
.setReadTimeoutMillis(5000)
|
||||
.setRequestIpType(RequestIpType.auto)
|
||||
.setAllowInsecureCertificatesForDebugOnly(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
HttpDnsAdapterResponse response = adapter.execute(
|
||||
new HttpDnsAdapterRequest("GET", "https://api.business.com/v1/ping")
|
||||
);
|
||||
```
|
||||
|
||||
Behavior is fixed:
|
||||
- Resolve by `/resolve`.
|
||||
- Connect to resolved IP over HTTPS.
|
||||
- Keep `Host` header as business domain.
|
||||
- No fallback to domain direct request.
|
||||
|
||||
## 4. Public Errors
|
||||
|
||||
- `NO_IP_AVAILABLE`
|
||||
- `TLS_EMPTY_SNI_FAILED`
|
||||
- `HOST_ROUTE_REJECTED`
|
||||
- `RESOLVE_SIGN_INVALID`
|
||||
|
||||
## 5. Removed Public Params
|
||||
|
||||
Do not use legacy public parameters:
|
||||
- `accountId`
|
||||
- `serviceDomain`
|
||||
- `endpoint`
|
||||
- `aesSecretKey`
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
68
EdgeHttpDNS/sdk/.tmp_android_bundle/proguard-rules.pro
vendored
Normal file
68
EdgeHttpDNS/sdk/.tmp_android_bundle/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in /Users/ryan/Downloads/adt-bundle-mac-x86_64-20131030/sdk/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
-optimizationpasses 3
|
||||
-dontoptimize
|
||||
-dontusemixedcaseclassnames
|
||||
-dontskipnonpubliclibraryclasses
|
||||
-verbose
|
||||
-overloadaggressively
|
||||
#-allowaccessmodification
|
||||
-useuniqueclassmembernames
|
||||
|
||||
-dontwarn com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector
|
||||
|
||||
-keeppackagenames com.alibaba.sdk.android.httpdns
|
||||
-flattenpackagehierarchy com.alibaba.sdk.android.httpdns
|
||||
-keep class com.alibaba.sdk.android.httpdns.HttpDns{*;}
|
||||
-keep interface com.alibaba.sdk.android.httpdns.HttpDnsService{*;}
|
||||
-keep class com.alibaba.sdk.android.httpdns.impl.ErrorImpl{*;}
|
||||
-keep interface com.alibaba.sdk.android.httpdns.SyncService{*;}
|
||||
-keep class com.alibaba.sdk.android.httpdns.InitConfig{*;}
|
||||
-keep class com.alibaba.sdk.android.httpdns.InitConfig$Builder{*;}
|
||||
-keep class com.alibaba.sdk.android.httpdns.RequestIpType{*;}
|
||||
-keep interface com.alibaba.sdk.android.httpdns.DegradationFilter{*;}
|
||||
-keep interface com.alibaba.sdk.android.httpdns.NotUseHttpDnsFilter{*;}
|
||||
-keep interface com.alibaba.sdk.android.httpdns.HttpDnsCallback{*;}
|
||||
-keep class com.alibaba.sdk.android.httpdns.ranking.IPRankingBean{*;}
|
||||
-keep interface com.alibaba.sdk.android.httpdns.ILogger{*;}
|
||||
-keep interface com.alibaba.sdk.android.httpdns.CacheTtlChanger{*;}
|
||||
-keep class com.alibaba.sdk.android.httpdns.NetType{*;}
|
||||
-keepclasseswithmembers class com.alibaba.sdk.android.httpdns.log.HttpDnsLog {
|
||||
public static *** setLogger(***);
|
||||
public static *** removeLogger(***);
|
||||
public static *** enable(***);
|
||||
}
|
||||
-keep class com.alibaba.sdk.android.httpdns.HTTPDNSResult{*;}
|
||||
-keepclasseswithmembers class com.alibaba.sdk.android.httpdns.HttpDnsSettings {
|
||||
public static *** setDailyReport(***);
|
||||
public static *** setNetworkChecker(***);
|
||||
}
|
||||
|
||||
-keep class com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector {
|
||||
public <methods>;
|
||||
public <fields>;
|
||||
}
|
||||
|
||||
-keep interface com.alibaba.sdk.android.httpdns.HttpDnsSettings$NetworkChecker{*;}
|
||||
-keep interface com.alibaba.sdk.android.httpdns.HttpDnsSettings$NetworkDetector{*;}
|
||||
-keep class com.alibaba.sdk.android.httpdns.utils.CommonUtil{
|
||||
public <methods>;
|
||||
public <fields>;
|
||||
}
|
||||
-keep enum com.alibaba.sdk.android.httpdns.Region {*;}
|
||||
-keep class com.alibaba.sdk.android.httpdns.exception.InitException{*;}
|
||||
Reference in New Issue
Block a user