换成单集群模式

This commit is contained in:
robin
2026-03-02 20:07:53 +08:00
parent 5d0b7c7e91
commit 2a76d1773d
432 changed files with 5681 additions and 5095 deletions

View File

@@ -3,11 +3,11 @@ plugins {
}
android {
namespace 'com.aliyun.ams.httpdns.demo'
namespace 'com.newsdk.ams.httpdns.demo'
compileSdkVersion 34
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.aliyun.ams.httpdns.demo2"
applicationId "com.newsdk.ams.httpdns.demo2"
minSdkVersion 19
targetSdkVersion 34
versionCode 1

View File

@@ -25,6 +25,6 @@
#-renamesourcefileattribute SourceFile
-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn com.alibaba.sdk.android.httpdns.test.**
-dontwarn com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector
-dontwarn com.newsdk.sdk.android.httpdns.test.**
-dontwarn com.newsdk.sdk.android.httpdns.net.HttpDnsNetworkDetector
-keep class com.aliyun.ams.ipdetector.Inet64Util{*;}

View File

@@ -1,357 +0,0 @@
package com.aliyun.ams.httpdns.demo;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import com.alibaba.sdk.android.httpdns.DegradationFilter;
import com.alibaba.sdk.android.httpdns.NetType;
import com.alibaba.sdk.android.httpdns.RequestIpType;
import com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector;
import com.alibaba.sdk.android.httpdns.ranking.IPRankingBean;
import com.aliyun.ams.httpdns.demo.base.BaseActivity;
import com.aliyun.ams.httpdns.demo.http.HttpUrlConnectionRequest;
import com.aliyun.ams.httpdns.demo.okhttp.OkHttpRequest;
import com.aliyun.ams.httpdns.demo.utils.ThreadUtil;
import java.util.ArrayList;
import java.util.Collections;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* @author zonglin.nzl
* @date 8/30/22
*/
public class HttpDnsActivity extends BaseActivity {
public static final String SCHEMA_HTTPS = "https://";
public static final String SCHEMA_HTTP = "http://";
public static final String TAOBAO_URL = "www.taobao.com";
public static final String Aliyun_URL = "www.Aliyun.com";
public static final String[] hosts = new String[]{
TAOBAO_URL, Aliyun_URL
};
public static String getUrl(String schema, String host) {
return schema + host;
}
/**
* 瑕佽姹傜殑schema
*/
private String schema = SCHEMA_HTTPS;
/**
* 瑕佽姹傜殑鍩熷悕
*/
private String host = Aliyun_URL;
/**
* 瑕佽В鏋愮殑ip绫诲瀷
*/
private RequestIpType requestIpType = RequestIpType.v4;
private HttpUrlConnectionRequest httpUrlConnectionRequest;
private OkHttpRequest okHttpRequest;
private NetworkRequest networkRequest = httpUrlConnectionRequest;
private ExecutorService worker = Executors.newSingleThreadExecutor();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
httpUrlConnectionRequest = new HttpUrlConnectionRequest(this);
okHttpRequest = new OkHttpRequest(this);
networkRequest = httpUrlConnectionRequest;
addFourButton("鍒囨崲瀹炰緥", v -> {
MyApp.getInstance().changeHolder();
sendLog("httpdns瀹炰緥宸插垏鎹?);
}, "鑾峰彇閰嶇疆", v -> {
sendLog(MyApp.getInstance().getCurrentHolder().getCurrentConfig());
sendLog("瑕佽В鏋愮殑鍩熷悕鏄? + host);
sendLog("瑕佽В鏋愮殑ip绫诲瀷鏄? + requestIpType.name());
sendLog("瑕佹ā鎷熻姹傜殑url鏄? + getUrl(schema, host));
sendLog("妯℃嫙璇锋眰鐨勭綉缁滄鏋舵槸" + (networkRequest == httpUrlConnectionRequest ? " HttpUrlConnection" : "OkHttp"));
}, "娓呴櫎閰嶇疆缂撳瓨", v -> {
MyApp.getInstance().getCurrentHolder().cleanSp();
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "閰嶇疆缂撳瓨娓呴櫎, 閲嶅惎鐢熸晥");
}, "娓呴櫎鏃ュ織", v -> cleanLog());
addTwoButton("寮€鍚痟ttps", v -> {
MyApp.getInstance().getCurrentHolder().setEnableHttps(true);
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "寮€鍚痟ttps");
}, "鍏抽棴https", v -> {
MyApp.getInstance().getCurrentHolder().setEnableHttps(false);
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "鍏抽棴https");
});
addTwoButton("鍏佽杩囨湡IP", v -> {
MyApp.getInstance().getCurrentHolder().setEnableExpiredIp(true);
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "鍏佽杩囨湡IP");
}, "涓嶅厑璁歌繃鏈烮P", v -> {
MyApp.getInstance().getCurrentHolder().setEnableExpiredIp(false);
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "涓嶅厑璁歌繃鏈烮P");
});
addTwoButton("鍏佽鎸佷箙鍖栫紦瀛?, v -> {
MyApp.getInstance().getCurrentHolder().setEnableCacheIp(true);
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "鍏佽鎸佷箙鍖栫紦瀛?);
}, "涓嶅厑璁告寔涔呭寲缂撳瓨", v -> {
MyApp.getInstance().getCurrentHolder().setEnableCacheIp(false);
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "涓嶅厑璁告寔涔呭寲缂撳瓨");
});
addThreeButton("璁剧疆涓浗澶ч檰", v -> {
MyApp.getInstance().getCurrentHolder().setRegion(null);
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "鍒囨崲鍒颁腑鍥藉ぇ闄?);
}, "璁剧疆涓浗棣欐腐", v -> {
MyApp.getInstance().getCurrentHolder().setRegion("hk");
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "鍒囨崲鍒颁腑鍥介?);
}, "璁剧疆鏂板姞鍧?, v -> {
MyApp.getInstance().getCurrentHolder().setRegion("sg");
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "鍒囨崲鍒版柊鍔犲潯");
});
addEditTextButton("瓒呮椂鏃堕暱 ms", "璁剧疆瓒呮椂ms", view -> {
EditText et = (EditText) view;
int timeout = Integer.parseInt(et.getEditableText().toString());
MyApp.getInstance().getCurrentHolder().setTimeout(timeout);
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "璁剧疆瓒呮椂 " + timeout);
});
addTwoButton("檷绾?, v -> {
// 娉ㄦ剰锛氶檷绾ц繃婊ゅ櫒鐜板湪闇€瑕侀€氳繃InitConfig璁剧疆锛岄噸鍚簲鐢ㄧ敓鏁?
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "闄嶇骇鍔熻兘闇€瑕侀€氳繃InitConfig閰嶇疆");
}, "鍏抽棴闄嶇骇", v -> {
// 娉ㄦ剰锛氶檷绾ц繃婊ゅ櫒鐜板湪闇€瑕侀€氳繃InitConfig璁剧疆锛岄噸鍚簲鐢ㄧ敓鏁?
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "闄嶇骇鍔熻兘闇€瑕侀€氳繃InitConfig閰嶇疆");
});
addTwoButton("寮€鍚綉缁滃彉鍖栧悗棰勮В鏋?, v -> {
// 娉ㄦ剰锛氭鍔熻兘鐜板湪闇€瑕侀€氳繃InitConfig璁剧疆锛岄噸鍚簲鐢ㄧ敓鏁?
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "缃戠粶鍙樺寲鍚庨瑙f瀽闇瑕侀氳繃InitConfig閰嶇疆");
}, "鍏抽棴缃戠粶鍙樺寲鍚庨瑙f瀽", v -> {
// 娉ㄦ剰锛氭鍔熻兘鐜板湪闇€瑕侀€氳繃InitConfig璁剧疆锛岄噸鍚簲鐢ㄧ敓鏁?
sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "缃戠粶鍙樺寲鍚庨瑙f瀽闇瑕侀氳繃InitConfig閰嶇疆");
});
addView(R.layout.item_autocomplete_edittext_button, view -> {
final AutoCompleteTextView actvOne = view.findViewById(R.id.actvOne);
final EditText etOne = view.findViewById(R.id.etOne);
Button btnOne = view.findViewById(R.id.btnOne);
actvOne.setHint("璇疯緭鍏ュ煙鍚?);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getApplicationContext(),
android.R.layout.simple_dropdown_item_1line, hosts);
actvOne.setAdapter(adapter);
etOne.setHint("璇疯緭鍏ヨ嚜瀹氫箟ttl");
btnOne.setText("鎸囧畾鍩熷悕ttl s");
btnOne.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String host = actvOne.getEditableText().toString();
int ttl = Integer.parseInt(etOne.getEditableText().toString());
MyApp.getInstance().getCurrentHolder().setHostTtl(host, ttl);
sendLog("鎸囧畾鍩熷悕" + host + "鐨則tl涓? + ttl + "?);
}
});
});
addView(R.layout.item_autocomplete_edittext_button, view -> {
final AutoCompleteTextView actvOne = view.findViewById(R.id.actvOne);
final EditText etOne = view.findViewById(R.id.etOne);
Button btnOne = view.findViewById(R.id.btnOne);
actvOne.setHint("鍩熷悕");
ArrayAdapter<String> adapter = new ArrayAdapter<>(getApplicationContext(),
android.R.layout.simple_dropdown_item_1line, hosts);
actvOne.setAdapter(adapter);
etOne.setHint("璇疯緭鍏ョ鍙?);
btnOne.setText("娣诲姞ipRanking閰嶇疆");
btnOne.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String host = actvOne.getEditableText().toString();
int port = Integer.parseInt(etOne.getEditableText().toString());
MyApp.getInstance().getCurrentHolder().addIpProbeItem(new IPRankingBean(host, port));
sendLog("娣诲姞鍩熷悕" + host + " ");
}
});
});
addAutoCompleteTextViewButton(hosts, "涓荤珯鍩熷悕", "娣诲姞涓荤珯鍩熷悕", view -> {
AutoCompleteTextView actvOne = (AutoCompleteTextView) view;
String host = actvOne.getEditableText().toString();
MyApp.getInstance().getCurrentHolder().addHostWithFixedIp(host);
sendLog("娣诲姞涓荤珯鍩熷悕" + host);
});
addAutoCompleteTextViewButton(hosts, "鍩熷悕", "鍒犻櫎鎸囧畾鍩熷悕鐨勭紦瀛?, view -> {
AutoCompleteTextView actvOne = (AutoCompleteTextView) view;
String host = actvOne.getEditableText().toString();
ArrayList<String> list = new ArrayList<>();
list.add(host);
MyApp.getInstance().getService().cleanHostCache(list);
sendLog("娓呴櫎鎸囧畾host鐨勭紦瀛? + host);
});
addOneButton("娓呴櫎鎵鏈夌紦瀛?, v -> {
MyApp.getInstance().getService().cleanHostCache(null);
sendLog("娓呴櫎鎵€鏈夌紦瀛?);
});
addFourButton("鑾峰彇褰撳墠缃戠粶鐘舵?, v -> {
NetType type = HttpDnsNetworkDetector.getInstance().getNetType(getApplicationContext());
sendLog("鑾峰彇缃戠粶鐘舵€?" + type.name());
}, "绂佺敤缃戠粶鐘舵€佺紦瀛?, v -> {
HttpDnsNetworkDetector.getInstance().disableCache(true);
sendLog("缃戠粶鐘舵?绂佺敤缂撳瓨 ");
}, "綉缁滅姸鎬佺紦瀛?, v -> {
HttpDnsNetworkDetector.getInstance().disableCache(false);
sendLog("缃戠粶鐘舵€?寮€鍚紦瀛?");
}, "娓呴櫎缃戠粶鐘舵€佺紦瀛?, v -> {
HttpDnsNetworkDetector.getInstance().cleanCache(false);
sendLog("缃戠粶鐘舵佹竻闄ょ紦瀛?");
});
addTwoButton("绂佹璇诲彇IP", v -> {
HttpDnsNetworkDetector.getInstance().setCheckInterface(false);
sendLog("鏌ヨ缃戠粶鐘舵佹椂 绂佹璇诲彇IP");
}, "鍏佽璇诲彇IP", v -> {
HttpDnsNetworkDetector.getInstance().setCheckInterface(true);
sendLog("鏌ヨ缃戠粶鐘舵佹椂 鍏佽璇诲彇IP");
});
addAutoCompleteTextViewButton(hosts, "鍩熷悕", "璁剧疆妫娴嬬綉缁滀娇鐢ㄧ殑鍩熷悕", view -> {
AutoCompleteTextView actvOne = (AutoCompleteTextView) view;
String host = actvOne.getEditableText().toString();
HttpDnsNetworkDetector.getInstance().setHostToCheckNetType(host);
sendLog("璁剧疆妫娴嬬綉缁滅姸鎬佷娇鐢ㄧ殑鍩熷悕涓? + host);
});
addTwoButton("妯℃嫙璇锋眰浣跨敤https璇锋眰", v -> {
schema = SCHEMA_HTTPS;
sendLog("娴嬭瘯url浣跨敤https");
}, "妯℃嫙璇锋眰浣跨敤http璇锋眰", v -> {
schema = SCHEMA_HTTP;
sendLog("娴嬭瘯url浣跨敤http");
});
addTwoButton("HttpUrlConnection", v -> {
networkRequest = httpUrlConnectionRequest;
sendLog("鎸囧畾缃戠粶瀹炵幇鏂瑰紡涓篐ttpUrlConnection");
}, "Okhttp", v -> {
networkRequest = okHttpRequest;
sendLog("鎸囧畾缃戠粶瀹炵幇鏂瑰紡涓簅khttp");
});
addFourButton("鎸囧畾v4", v -> {
requestIpType = RequestIpType.v4;
sendLog("瑕佽В鏋愮殑IP绫诲瀷鎸囧畾涓篿pv4");
}, "鎸囧畾v6", v -> {
requestIpType = RequestIpType.v6;
sendLog("瑕佽В鏋愮殑IP绫诲瀷鎸囧畾涓篿pv6");
}, "閮借В鏋?, v -> {
requestIpType = RequestIpType.both;
sendLog("瑕佽В鏋愮殑IP绫诲瀷鎸囧畾涓篿pv4鍜宨pv6");
}, "姩鍒ゆ柇", v -> {
requestIpType = RequestIpType.auto;
sendLog("瑕佽В鏋愮殑IP绫诲瀷鏍规嵁缃戠粶鎯呭喌鑷姩鍒ゆ柇");
});
addAutoCompleteTextViewButton(hosts, "鍩熷悕", "鎸囧畾瑕佽В鏋愮殑鍩熷悕", new OnButtonClick() {
@Override
public void onBtnClick(View view) {
AutoCompleteTextView actvOne = (AutoCompleteTextView) view;
host = actvOne.getEditableText().toString();
sendLog("瑕佽В鏋愮殑鍩熷悕" + host);
}
});
addTwoButton("寮傛瑙f瀽", v -> worker.execute(new Runnable() {
@Override
public void run() {
sendLog("濮嬪彂璧风綉缁滆?);
sendLog("缃戠粶瀹炵幇鏂瑰紡涓? + (networkRequest == httpUrlConnectionRequest ? "HttpUrlConnection" : "okhttp"));
String url = getUrl(schema, host);
sendLog("url is " + url);
sendLog("httpdns 浣跨敤 寮傛瀽api");
sendLog("鎸囧畾瑙瀽ip绫诲瀷涓? + requestIpType.name());
networkRequest.updateHttpDnsConfig(true, requestIpType);
try {
String response = networkRequest.httpGet(url);
if (response != null && response.length() > 30) {
response = response.trim();
if (response.length() > 30) {
response = response.substring(0, 30) + "...";
}
}
sendLog("璇锋眰缁撴潫 response is " + response + " 瀹屾暣璁板綍璇风湅logcat鏃ュ織");
} catch (Exception e) {
e.printStackTrace();
sendLog("璇锋眰缁撴潫 鍙戠敓寮傚父 " + e.getClass().getName() + e.getMessage() + " 瀹屾暣璁板綍璇风湅logcat鏃ュ織");
}
}
}), "鍚屾瑙f瀽", v -> worker.execute(() -> {
sendLog("寮€濮嬪彂璧风綉缁滆姹?);
sendLog("缃戠粶瀹炵幇鏂瑰紡涓? + (networkRequest == httpUrlConnectionRequest ? "HttpUrlConnection" : "okhttp"));
String url = getUrl(schema, host);
sendLog("url is " + url);
sendLog("httpdns 浣跨敤 鍚屾瑙瀽api");
sendLog("鎸囧畾瑙瀽ip绫诲瀷涓? + requestIpType.name());
networkRequest.updateHttpDnsConfig(false, requestIpType);
try {
String response = networkRequest.httpGet(url);
if (response != null && response.length() > 30) {
response = response.substring(0, 30) + "...";
}
sendLog("璇锋眰缁撴潫 response is " + response + " 瀹屾暣璁板綍璇风湅logcat鏃ュ織");
} catch (Exception e) {
e.printStackTrace();
sendLog("璇锋眰缁撴潫 鍙戠敓寮傚父 " + e.getClass().getName() + e.getMessage() + " 瀹屾暣璁板綍璇风湅logcat鏃ュ織");
}
}));
addThreeButton("鍙戣捣棰勮В鏋?, v -> worker.execute(() -> {
ArrayList<String> tmp = new ArrayList<>();
Collections.addAll(tmp, hosts);
MyApp.getInstance().getService().setPreResolveHosts(tmp, requestIpType);
sendLog("宸插彂璧烽瑙f瀽璇锋眰");
}), "璺宠浆SDNS娴嬭瘯鐣岄潰",
v -> startActivity(new Intent(HttpDnsActivity.this, SDNSActivity.class)), "璺宠浆Webview娴嬭瘯鐣岄潰", new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(HttpDnsActivity.this, WebViewActivity.class));
}
});
final String[] validHosts = new String[]{
"www.Aliyun.com",
"www.taobao.com"
};
addTwoButton("骞跺彂寮傛璇锋眰", v -> {
ThreadUtil.multiThreadTest(validHosts, 100, 20, 10 * 60 * 1000, true, requestIpType);
sendLog("寮傛api骞跺彂娴嬭瘯寮€濮嬶紝澶х害鑰楁椂10鍒嗛挓锛岃鏈€鍚庢煡鐪媗ogcat鏃ュ織锛岀璁ょ粨鏋滐紝寤鸿鍏抽棴httpdns鏃ュ織锛岄伩鍏嶆棩蹇楅噺杩囧ぇ");
}, "骞跺彂鍚屾璇锋眰", v -> {
ThreadUtil.multiThreadTest(validHosts, 100, 20, 10 * 60 * 1000, false, requestIpType);
sendLog("鍚屾api骞跺彂娴嬭瘯寮€濮嬶紝澶х害鑰楁椂10鍒嗛挓锛岃鏈€鍚庢煡鐪媗ogcat鏃ュ織锛岀璁ょ粨鏋滐紝寤鸿鍏抽棴httpdns鏃ュ織锛岄伩鍏嶆棩蹇楅噺杩囧ぇ");
});
}
}

View File

@@ -1,133 +0,0 @@
package com.aliyun.ams.httpdns.demo;
import android.os.Bundle;
import android.view.View;
import android.widget.AutoCompleteTextView;
import android.widget.EditText;
import com.alibaba.sdk.android.httpdns.HTTPDNSResult;
import com.alibaba.sdk.android.httpdns.RequestIpType;
import com.aliyun.ams.httpdns.demo.base.BaseActivity;
import java.util.HashMap;
import static com.aliyun.ams.httpdns.demo.HttpDnsActivity.Aliyun_URL;
public class SDNSActivity extends BaseActivity {
private final HashMap<String, String> globalParams = new HashMap<>();
/**
* 瑕佽姹傜殑鍩熷悕
*/
private String host = HttpDnsActivity.Aliyun_URL;
/**
* 瑕佽В鏋愮殑ip绫诲瀷
*/
private RequestIpType requestIpType = RequestIpType.v4;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addEditTextEditTextButton("key", "value", "娣诲姞鍏ㄥ眬閰嶇疆", new OnButtonClickMoreView() {
@Override
public void onBtnClick(View[] views) {
EditText etOne = (EditText) views[0];
EditText etTwo = (EditText) views[1];
String key = etOne.getEditableText().toString();
String value = etTwo.getEditableText().toString();
globalParams.put(key, value);
// 娉ㄦ剰锛歋DNS鍏ㄥ眬鍙傛暟鐜板湪闇€瑕侀€氳繃InitConfig璁剧疆锛岄噸鍚簲鐢ㄧ敓鏁?
sendLog("娣诲姞鍏ㄥ眬鍙傛暟 " + key + " : " + value);
}
});
addOneButton("娓呴櫎鍏ㄥ眬閰嶇疆", new View.OnClickListener() {
@Override
public void onClick(View v) {
globalParams.clear();
// 娉ㄦ剰锛歋DNS鍏ㄥ眬鍙傛暟鐜板湪闇€瑕侀€氳繃InitConfig璁剧疆锛岄噸鍚簲鐢ㄧ敓鏁?
sendLog("娓呴櫎鍏ㄥ眬鍙傛暟");
}
});
addFourButton("鎸囧畾v4", new View.OnClickListener() {
@Override
public void onClick(View v) {
requestIpType = RequestIpType.v4;
sendLog("瑕佽В鏋愮殑IP绫诲瀷鎸囧畾涓篿pv4");
}
}, "鎸囧畾v6", new View.OnClickListener() {
@Override
public void onClick(View v) {
requestIpType = RequestIpType.v6;
sendLog("瑕佽В鏋愮殑IP绫诲瀷鎸囧畾涓篿pv6");
}
}, "閮借В鏋?, new View.OnClickListener() {
@Override
public void onClick(View v) {
requestIpType = RequestIpType.both;
sendLog("瑕佽В鏋愮殑IP绫诲瀷鎸囧畾涓篿pv4鍜宨pv6");
}
}, "姩鍒ゆ柇", new View.OnClickListener() {
@Override
public void onClick(View v) {
requestIpType = RequestIpType.auto;
sendLog("瑕佽В鏋愮殑IP绫诲瀷鏍规嵁缃戠粶鎯呭喌鑷姩鍒ゆ柇");
}
});
addAutoCompleteTextViewButton(HttpDnsActivity.hosts, "鍩熷悕", "鎸囧畾瑕佽В鏋愮殑鍩熷悕", new OnButtonClick() {
@Override
public void onBtnClick(View view) {
AutoCompleteTextView actvOne = (AutoCompleteTextView) view;
host = actvOne.getEditableText().toString();
sendLog("瑕佽В鏋愮殑鍩熷悕" + host);
}
});
addEditTextEditTextButton("key", "value", "鍙戣捣璇锋眰", new OnButtonClickMoreView() {
@Override
public void onBtnClick(View[] views) {
EditText etOne = (EditText) views[0];
EditText etTwo = (EditText) views[1];
String key = etOne.getEditableText().toString();
String value = etTwo.getEditableText().toString();
HashMap<String, String> map = new HashMap<>();
map.put(key, value);
sendLog("鍙戣捣SDNS璇锋眰 requestIpType is " + requestIpType.name());
HTTPDNSResult result = MyApp.getInstance().getService().getIpsByHostAsync(host, requestIpType, map, "娴嬭瘯SDNS");
sendLog("缁撴灉 " + result);
}
});
addTwoButton("scale1鍙傛暟璇锋眰", new View.OnClickListener() {
@Override
public void onClick(View v) {
HashMap<String, String> map = new HashMap<>();
map.put("scale", "scale1");
sendLog("鍙戣捣SDNS璇锋眰 requestIpType is " + requestIpType.name() + " scale : scale1");
HTTPDNSResult result = MyApp.getInstance().getService().getIpsByHostAsync(host, requestIpType, map, "娴嬭瘯1");
sendLog("缁撴灉 " + result);
}
}, "scale2鍙傛暟璇锋眰", new View.OnClickListener() {
@Override
public void onClick(View v) {
HashMap<String, String> map = new HashMap<>();
map.put("scale", "scale2");
sendLog("鍙戣捣SDNS璇锋眰 requestIpType is " + requestIpType.name() + " scale : scale2");
HTTPDNSResult result = MyApp.getInstance().getService().getIpsByHostAsync(host, requestIpType, map, "娴嬭瘯2");
sendLog("缁撴灉 " + result);
}
});
}
}

View File

@@ -1,128 +0,0 @@
package com.aliyun.ams.httpdns.demo.utils;
import android.util.Log;
import com.alibaba.sdk.android.httpdns.HTTPDNSResult;
import com.alibaba.sdk.android.httpdns.RequestIpType;
import com.alibaba.sdk.android.httpdns.SyncService;
import com.aliyun.ams.httpdns.demo.MyApp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class ThreadUtil {
public static void multiThreadTest(final String[] validHosts, final int hostCount,
final int threadCount, final int executeTime,
final boolean async, final RequestIpType type) {
int validCount = validHosts.length;
if (validCount > hostCount) {
validCount = hostCount;
}
final int tmpValidCount = validCount;
Log.d(MyApp.TAG,
threadCount + "绾跨▼骞跺彂锛屾墽琛? + executeTime + ", 鎬诲煙鍚? + hostCount + "涓紝鏈夋晥"
+ validCount + "涓?);
new Thread(new Runnable() {
@Override
public void run() {
final ArrayList<String> hosts = new ArrayList<>(hostCount);
for (int i = 0; i < hostCount - tmpValidCount; i++) {
hosts.add("test" + i + ".Aliyun.com");
}
hosts.addAll(Arrays.asList(validHosts).subList(0, tmpValidCount));
final CountDownLatch testLatch = new CountDownLatch(threadCount);
ExecutorService service = Executors.newFixedThreadPool(threadCount);
final CountDownLatch countDownLatch = new CountDownLatch(threadCount);
for (int i = 0; i < threadCount; i++) {
service.execute(new Runnable() {
@Override
public void run() {
countDownLatch.countDown();
try {
countDownLatch.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
Random random = new Random(Thread.currentThread().getId());
int allRequestCount = 0;
int slowRequestCount = 0;
int emptyResponseCount = 0;
long maxSlowRequestTime = 0;
long subSlowRequestTime = 0;
int taobaoCount = 0;
int taobaoSuccessCount = 0;
long firstTaobaoTime = 0;
long firstTaobaoSuccessTime = 0;
long begin = System.currentTimeMillis();
while (System.currentTimeMillis() - begin < executeTime) {
String host = hosts.get(random.nextInt(hostCount));
long startRequestTime = System.currentTimeMillis();
HTTPDNSResult ips = null;
if (async) {
ips = MyApp.getInstance().getService().getIpsByHostAsync(host,
type);
} else {
ips =
((SyncService)MyApp.getInstance().getService()).getByHost(
host, type);
}
long endRequestTime = System.currentTimeMillis();
if (host.equals("www.taobao.com")) {
if (taobaoCount == 0) {
firstTaobaoTime = System.currentTimeMillis();
}
taobaoCount++;
if (ips.getIps() != null && ips.getIps().length > 0) {
if (taobaoSuccessCount == 0) {
firstTaobaoSuccessTime = System.currentTimeMillis();
}
taobaoSuccessCount++;
}
}
if (endRequestTime - startRequestTime > 100) {
slowRequestCount++;
subSlowRequestTime += endRequestTime - startRequestTime;
if (maxSlowRequestTime < endRequestTime - startRequestTime) {
maxSlowRequestTime = endRequestTime - startRequestTime;
}
}
if (ips == null || ips.getIps() == null
|| ips.getIps().length == 0) {
emptyResponseCount++;
}
allRequestCount++;
}
String msg = Thread.currentThread().getId() + " allRequestCount: "
+ allRequestCount + ", slowRequestCount: " + slowRequestCount
+ ", emptyResponseCount: " + emptyResponseCount
+ ", maxSlowRequestTime : " + maxSlowRequestTime
+ ", avgSlowRequestTime: " + (slowRequestCount == 0 ? 0
: subSlowRequestTime / slowRequestCount)
+ ", taoRequestCount: " + taobaoCount + ", "
+ "taoSuccessRequestCount: "
+ taobaoSuccessCount + ", firstTaoRequestTime: " + (firstTaobaoTime
- begin) + ", firstSuccessTaoRequestTime: " + (
firstTaobaoSuccessTime - begin);
Log.w(MyApp.TAG, "asyncMulti " + msg);
testLatch.countDown();
}
});
}
try {
testLatch.await();
} catch (InterruptedException e) {
}
}
}).start();
}
}

View File

@@ -0,0 +1,159 @@
package com.newsdk.ams.httpdns.demo;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AutoCompleteTextView;
import com.newsdk.sdk.android.httpdns.RequestIpType;
import com.newsdk.ams.httpdns.demo.base.BaseActivity;
import com.newsdk.ams.httpdns.demo.http.HttpUrlConnectionRequest;
import com.newsdk.ams.httpdns.demo.okhttp.OkHttpRequest;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class HttpDnsActivity extends BaseActivity {
private static final String SCHEMA_HTTPS = "https://";
private static final String SCHEMA_HTTP = "http://";
private static final String[] HOSTS = new String[] {
"www.taobao.com",
"www.Aliyun.com"
};
private String schema = SCHEMA_HTTPS;
private String host = HOSTS[0];
private RequestIpType requestIpType = RequestIpType.v4;
private HttpUrlConnectionRequest httpUrlConnectionRequest;
private OkHttpRequest okHttpRequest;
private NetworkRequest networkRequest;
private final ExecutorService worker = Executors.newSingleThreadExecutor();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
httpUrlConnectionRequest = new HttpUrlConnectionRequest(this);
okHttpRequest = new OkHttpRequest(this);
networkRequest = httpUrlConnectionRequest;
addFourButton(
"Switch instance",
v -> {
MyApp.getInstance().changeHolder();
sendLog("Instance switched.");
},
"Show config",
v -> sendLog(MyApp.getInstance().getCurrentHolder().getCurrentConfig()),
"Clear holder cache",
v -> {
MyApp.getInstance().getCurrentHolder().cleanSp();
sendLog("Holder cache cleared.");
},
"Clear log",
v -> cleanLog()
);
addAutoCompleteTextViewButton(HOSTS, "Host", "Set host", view -> {
AutoCompleteTextView actv = (AutoCompleteTextView) view;
host = actv.getEditableText().toString();
sendLog("Host set to: " + host);
});
addTwoButton(
"Use HTTPS",
v -> {
schema = SCHEMA_HTTPS;
sendLog("Schema set to HTTPS.");
},
"Use HTTP",
v -> {
schema = SCHEMA_HTTP;
sendLog("Schema set to HTTP.");
}
);
addFourButton(
"IP type v4",
v -> {
requestIpType = RequestIpType.v4;
sendLog("Request IP type: v4");
},
"IP type v6",
v -> {
requestIpType = RequestIpType.v6;
sendLog("Request IP type: v6");
},
"IP type both",
v -> {
requestIpType = RequestIpType.both;
sendLog("Request IP type: both");
},
"IP type auto",
v -> {
requestIpType = RequestIpType.auto;
sendLog("Request IP type: auto");
}
);
addTwoButton(
"HttpUrlConnection",
v -> {
networkRequest = httpUrlConnectionRequest;
sendLog("Network stack: HttpUrlConnection");
},
"OkHttp",
v -> {
networkRequest = okHttpRequest;
sendLog("Network stack: OkHttp");
}
);
addTwoButton(
"Resolve sync",
v -> worker.execute(() -> executeResolve(false)),
"Resolve async",
v -> worker.execute(() -> executeResolve(true))
);
addTwoButton(
"Open SDNS page",
v -> startActivity(new Intent(HttpDnsActivity.this, SDNSActivity.class)),
"Open WebView page",
new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(HttpDnsActivity.this, WebViewActivity.class));
}
}
);
}
@Override
protected void onDestroy() {
super.onDestroy();
worker.shutdownNow();
}
private void executeResolve(boolean async) {
String url = schema + host;
sendLog("Request URL: " + url);
sendLog("Request IP type: " + requestIpType.name());
sendLog("Async mode: " + async);
sendLog("Stack: " + (networkRequest == httpUrlConnectionRequest ? "HttpUrlConnection" : "OkHttp"));
try {
networkRequest.updateHttpDnsConfig(async, requestIpType);
String response = networkRequest.httpGet(url);
if (response != null && response.length() > 120) {
response = response.substring(0, 120) + "...";
}
sendLog("Response: " + response);
} catch (Exception e) {
sendLog("Request failed: " + e.getClass().getSimpleName() + " " + e.getMessage());
}
}
}

View File

@@ -1,15 +1,15 @@
package com.aliyun.ams.httpdns.demo;
package com.newsdk.ams.httpdns.demo;
import android.content.Context;
import android.content.SharedPreferences;
import com.alibaba.sdk.android.httpdns.CacheTtlChanger;
import com.alibaba.sdk.android.httpdns.HttpDns;
import com.alibaba.sdk.android.httpdns.HttpDnsService;
import com.alibaba.sdk.android.httpdns.InitConfig;
import com.alibaba.sdk.android.httpdns.RequestIpType;
import com.alibaba.sdk.android.httpdns.ranking.IPRankingBean;
import com.aliyun.ams.httpdns.demo.utils.SpUtil;
import com.newsdk.sdk.android.httpdns.CacheTtlChanger;
import com.newsdk.sdk.android.httpdns.HttpDns;
import com.newsdk.sdk.android.httpdns.HttpDnsService;
import com.newsdk.sdk.android.httpdns.InitConfig;
import com.newsdk.sdk.android.httpdns.RequestIpType;
import com.newsdk.sdk.android.httpdns.ranking.IPRankingBean;
import com.newsdk.ams.httpdns.demo.utils.SpUtil;
import org.json.JSONArray;
import org.json.JSONException;

View File

@@ -1,13 +1,13 @@
package com.aliyun.ams.httpdns.demo;
package com.newsdk.ams.httpdns.demo;
import android.app.Application;
import android.content.SharedPreferences;
import android.util.Log;
import com.alibaba.sdk.android.httpdns.HttpDnsService;
import com.alibaba.sdk.android.httpdns.ILogger;
import com.alibaba.sdk.android.httpdns.log.HttpDnsLog;
import com.aliyun.ams.httpdns.demo.utils.SpUtil;
import com.newsdk.sdk.android.httpdns.HttpDnsService;
import com.newsdk.sdk.android.httpdns.ILogger;
import com.newsdk.sdk.android.httpdns.log.HttpDnsLog;
import com.newsdk.ams.httpdns.demo.utils.SpUtil;
public class MyApp extends Application {

View File

@@ -1,6 +1,6 @@
package com.aliyun.ams.httpdns.demo;
package com.newsdk.ams.httpdns.demo;
import com.alibaba.sdk.android.httpdns.RequestIpType;
import com.newsdk.sdk.android.httpdns.RequestIpType;
public interface NetworkRequest {

View File

@@ -0,0 +1,126 @@
package com.newsdk.ams.httpdns.demo;
import android.os.Bundle;
import android.view.View;
import android.widget.AutoCompleteTextView;
import android.widget.EditText;
import com.newsdk.sdk.android.httpdns.HTTPDNSResult;
import com.newsdk.sdk.android.httpdns.RequestIpType;
import com.newsdk.ams.httpdns.demo.base.BaseActivity;
import java.util.HashMap;
public class SDNSActivity extends BaseActivity {
private static final String[] HOSTS = new String[] {
"www.Aliyun.com",
"www.taobao.com"
};
private final HashMap<String, String> globalParams = new HashMap<>();
private String host = HOSTS[0];
private RequestIpType requestIpType = RequestIpType.v4;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addEditTextEditTextButton("key", "value", "Add global param", new OnButtonClickMoreView() {
@Override
public void onBtnClick(View[] views) {
EditText keyView = (EditText) views[0];
EditText valueView = (EditText) views[1];
String key = keyView.getEditableText().toString();
String value = valueView.getEditableText().toString();
globalParams.put(key, value);
sendLog("Global param added: " + key + "=" + value);
}
});
addOneButton("Clear global params", new View.OnClickListener() {
@Override
public void onClick(View v) {
globalParams.clear();
sendLog("Global params cleared.");
}
});
addFourButton(
"IP type v4",
new View.OnClickListener() {
@Override
public void onClick(View v) {
requestIpType = RequestIpType.v4;
sendLog("Request IP type: v4");
}
},
"IP type v6",
new View.OnClickListener() {
@Override
public void onClick(View v) {
requestIpType = RequestIpType.v6;
sendLog("Request IP type: v6");
}
},
"IP type both",
new View.OnClickListener() {
@Override
public void onClick(View v) {
requestIpType = RequestIpType.both;
sendLog("Request IP type: both");
}
},
"IP type auto",
new View.OnClickListener() {
@Override
public void onClick(View v) {
requestIpType = RequestIpType.auto;
sendLog("Request IP type: auto");
}
}
);
addAutoCompleteTextViewButton(HOSTS, "Host", "Set host", new OnButtonClick() {
@Override
public void onBtnClick(View view) {
AutoCompleteTextView hostView = (AutoCompleteTextView) view;
host = hostView.getEditableText().toString();
sendLog("Host set to: " + host);
}
});
addEditTextEditTextButton("key", "value", "Resolve with param", new OnButtonClickMoreView() {
@Override
public void onBtnClick(View[] views) {
EditText keyView = (EditText) views[0];
EditText valueView = (EditText) views[1];
HashMap<String, String> params = new HashMap<>(globalParams);
params.put(keyView.getEditableText().toString(), valueView.getEditableText().toString());
HTTPDNSResult result = MyApp.getInstance().getService().getIpsByHostAsync(
host, requestIpType, params, "sdns-demo");
sendLog("SDNS result: " + result);
}
});
addTwoButton("Resolve scale1", new View.OnClickListener() {
@Override
public void onClick(View v) {
HashMap<String, String> params = new HashMap<>(globalParams);
params.put("scale", "scale1");
HTTPDNSResult result = MyApp.getInstance().getService().getIpsByHostAsync(
host, requestIpType, params, "sdns-demo");
sendLog("scale1 result: " + result);
}
}, "Resolve scale2", new View.OnClickListener() {
@Override
public void onClick(View v) {
HashMap<String, String> params = new HashMap<>(globalParams);
params.put("scale", "scale2");
HTTPDNSResult result = MyApp.getInstance().getService().getIpsByHostAsync(
host, requestIpType, params, "sdns-demo");
sendLog("scale2 result: " + result);
}
});
}
}

View File

@@ -1,4 +1,4 @@
package com.aliyun.ams.httpdns.demo;
package com.newsdk.ams.httpdns.demo;
import android.annotation.SuppressLint;
import android.app.Activity;

View File

@@ -1,4 +1,4 @@
package com.aliyun.ams.httpdns.demo.base;
package com.newsdk.ams.httpdns.demo.base;
import android.app.Activity;
import android.os.Bundle;
@@ -17,8 +17,8 @@ import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import com.aliyun.ams.httpdns.demo.MyApp;
import com.aliyun.ams.httpdns.demo.R;
import com.newsdk.ams.httpdns.demo.MyApp;
import com.newsdk.ams.httpdns.demo.R;
public class BaseActivity extends Activity {

View File

@@ -1,4 +1,4 @@
package com.aliyun.ams.httpdns.demo.http;
package com.newsdk.ams.httpdns.demo.http;
import android.content.Context;
@@ -6,14 +6,14 @@ import android.net.SSLCertificateSocketFactory;
import android.os.Build;
import android.util.Log;
import com.alibaba.sdk.android.httpdns.HTTPDNSResult;
import com.alibaba.sdk.android.httpdns.NetType;
import com.alibaba.sdk.android.httpdns.RequestIpType;
import com.alibaba.sdk.android.httpdns.SyncService;
import com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector;
import com.aliyun.ams.httpdns.demo.MyApp;
import com.aliyun.ams.httpdns.demo.NetworkRequest;
import com.aliyun.ams.httpdns.demo.utils.Util;
import com.newsdk.sdk.android.httpdns.HTTPDNSResult;
import com.newsdk.sdk.android.httpdns.NetType;
import com.newsdk.sdk.android.httpdns.RequestIpType;
import com.newsdk.sdk.android.httpdns.SyncService;
import com.newsdk.sdk.android.httpdns.net.HttpDnsNetworkDetector;
import com.newsdk.ams.httpdns.demo.MyApp;
import com.newsdk.ams.httpdns.demo.NetworkRequest;
import com.newsdk.ams.httpdns.demo.utils.Util;
import java.io.BufferedReader;
import java.io.IOException;

View File

@@ -1,16 +1,16 @@
package com.aliyun.ams.httpdns.demo.okhttp;
package com.newsdk.ams.httpdns.demo.okhttp;
import android.content.Context;
import android.util.Log;
import com.alibaba.sdk.android.httpdns.HTTPDNSResult;
import com.alibaba.sdk.android.httpdns.NetType;
import com.alibaba.sdk.android.httpdns.RequestIpType;
import com.alibaba.sdk.android.httpdns.SyncService;
import com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector;
import com.aliyun.ams.httpdns.demo.MyApp;
import com.aliyun.ams.httpdns.demo.NetworkRequest;
import com.aliyun.ams.httpdns.demo.utils.Util;
import com.newsdk.sdk.android.httpdns.HTTPDNSResult;
import com.newsdk.sdk.android.httpdns.NetType;
import com.newsdk.sdk.android.httpdns.RequestIpType;
import com.newsdk.sdk.android.httpdns.SyncService;
import com.newsdk.sdk.android.httpdns.net.HttpDnsNetworkDetector;
import com.newsdk.ams.httpdns.demo.MyApp;
import com.newsdk.ams.httpdns.demo.NetworkRequest;
import com.newsdk.ams.httpdns.demo.utils.Util;
import java.net.HttpURLConnection;
import java.net.InetAddress;

View File

@@ -1,4 +1,4 @@
package com.aliyun.ams.httpdns.demo.utils;
package com.newsdk.ams.httpdns.demo.utils;
import android.content.Context;
import android.content.SharedPreferences;

View File

@@ -0,0 +1,94 @@
package com.newsdk.ams.httpdns.demo.utils;
import android.util.Log;
import com.newsdk.sdk.android.httpdns.HTTPDNSResult;
import com.newsdk.sdk.android.httpdns.RequestIpType;
import com.newsdk.sdk.android.httpdns.SyncService;
import com.newsdk.ams.httpdns.demo.MyApp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class ThreadUtil {
public static void multiThreadTest(
final String[] validHosts,
final int hostCount,
final int threadCount,
final int executeTime,
final boolean async,
final RequestIpType type
) {
new Thread(() -> runMultiThreadTest(validHosts, hostCount, threadCount, executeTime, async, type)).start();
}
private static void runMultiThreadTest(
String[] validHosts,
int hostCount,
int threadCount,
int executeTime,
boolean async,
RequestIpType type
) {
int validCount = Math.min(validHosts.length, hostCount);
Log.d(MyApp.TAG, "Start multiThreadTest, threads=" + threadCount
+ ", executeTimeMs=" + executeTime
+ ", hostCount=" + hostCount
+ ", validHostCount=" + validCount
+ ", async=" + async
+ ", ipType=" + type.name());
ArrayList<String> hosts = new ArrayList<>(hostCount);
for (int i = 0; i < hostCount - validCount; i++) {
hosts.add("test" + i + ".Aliyun.com");
}
hosts.addAll(Arrays.asList(validHosts).subList(0, validCount));
ExecutorService pool = Executors.newFixedThreadPool(threadCount);
CountDownLatch done = new CountDownLatch(threadCount);
for (int i = 0; i < threadCount; i++) {
pool.execute(() -> {
Random random = new Random(Thread.currentThread().getId());
long begin = System.currentTimeMillis();
int requestCount = 0;
int successCount = 0;
while (System.currentTimeMillis() - begin < executeTime) {
String host = hosts.get(random.nextInt(hosts.size()));
try {
HTTPDNSResult result;
if (async) {
result = MyApp.getInstance().getService().getIpsByHostAsync(host, type);
} else {
result = ((SyncService) MyApp.getInstance().getService()).getByHost(host, type);
}
if (result != null && result.getIps() != null && result.getIps().length > 0) {
successCount++;
}
} catch (Throwable t) {
Log.w(MyApp.TAG, "multiThreadTest request failed: " + t.getMessage());
}
requestCount++;
}
Log.w(MyApp.TAG, "multiThreadTest thread=" + Thread.currentThread().getId()
+ ", requestCount=" + requestCount
+ ", successCount=" + successCount);
done.countDown();
});
}
try {
done.await();
} catch (InterruptedException ignored) {
} finally {
pool.shutdownNow();
}
}
}

View File

@@ -1,6 +1,6 @@
package com.aliyun.ams.httpdns.demo.utils;
package com.newsdk.ams.httpdns.demo.utils;
import com.alibaba.sdk.android.httpdns.HTTPDNSResult;
import com.newsdk.sdk.android.httpdns.HTTPDNSResult;
import java.lang.reflect.Field;

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@@ -11,7 +11,7 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/aliyun_bg" />
android:background="@drawable/new_bg" />
<ScrollView
android:id="@+id/logScrollView"

View File

@@ -1,31 +1,30 @@
<resources>
<string name="app_name">銆愰樋閲屼簯HttpDns銆慏emo绋嬪簭</string>
<resources>
<string name="app_name">閵嗘劙妯嬮柌灞肩隘HttpDns閵嗘厪emo缁嬪绨</string>
<string name="action_settings">Settings</string>
<string name="normal_parse">鏅€氳В鏋?/string>
<string name="request_taobao">瑙f瀽娣樺疂鍩熷悕</string>
<string name="request_apple">瀽apple鍩熷悕</string>
<string name="request_douban">瑙f瀽璞嗙摚鍩熷悕</string>
<string name="https_parse">HTTPS寮€鍏?/string>
<string name="timeout">璁剧疆瓒呮椂</string>
<string name="set_expired">鍏佽杩囨湡鍩熷悕</string>
<string name="set_cache">寮€鍚寔涔呭寲缂撳瓨</string>
<string name="set_degration_filter">闄嶇骇绛栫暐</string>
<string name="set_pre_resolve">棰勮В鏋?/string>
<string name="normal_parse">閺咁噣鈧俺袙閺</string>
<string name="request_taobao">鐟欙絾鐎藉ǎ妯虹杺閸╃喎鎮</string>
<string name="request_apple">鐟欙絾鐎絘pple閸╃喎鎮</string>
<string name="request_douban">鐟欙絾鐎界挒鍡欐憵閸╃喎鎮</string>
<string name="https_parse">HTTPS瀵偓閸</string>
<string name="timeout">鐠佸墽鐤嗙搾鍛</string>
<string name="set_expired">閸忎浇顔忔潻鍥ㄦ埂閸╃喎鎮</string>
<string name="set_cache">瀵偓閸氼垱瀵旀稊鍛缂傛挸鐡</string>
<string name="set_degration_filter">闂勫秶楠囩粵鏍殣</string>
<string name="set_pre_resolve">妫板嫯袙閺</string>
<string name="set_region">region</string>
<string name="sync_request">鍚屾瑙f瀽</string>
<string name="multi_sync_request">鍚屾瑙f瀽骞跺彂</string>
<string name="multi_request">骞跺彂瑙f瀽</string>
<string name="sync_request">閸氬本顒炵憴锝嗙€</string>
<string name="multi_sync_request">閸氬本顒炵憴锝嗙€介獮璺哄絺</string>
<string name="multi_request">楠炶泛褰傜憴锝嗙€</string>
<string name="main_about_us">鍏充簬鎴戜滑</string>
<string name="main_helper">甯姪涓績</string>
<string name="main_clear_text">娓呴櫎褰撳墠娑堟伅</string>
<string name="main_about_us">閸忓厖绨幋鎴滄粦</string>
<string name="main_helper">鐢喖濮稉顓炵妇</string>
<string name="main_clear_text">濞撳懘娅庤ぐ鎾冲濞戝牊浼</string>
<!--鍏充簬鎴戜滑椤甸潰-->
<string name="layout_aboutus_arr">All Rights Reserved.</string>
<string name="layout_aboutus_company">闃块噷浜?杞欢)鏈夐檺鍏徃鐗堟潈鎵€鏈?/string>
<string name="layout_aboutus_copyright">Copyright 2009 - 2016 Aliyun.com</string>
<string name="layout_aboutus_company">闂冨潡鍣锋禍?鏉烆垯娆?閺堝妾洪崗顒€寰冮悧鍫熸綀閹碘偓閺</string>
<string name="layout_aboutus_copyright">Copyright 婕?2009 - 2016 Aliyun.com</string>
<string name="layout_aboutus_app_version">1.1.3</string>
<!--甯姪涓績椤甸潰-->
<string name="layout_helpus_content">Q : 浠€涔堟槸鐢ㄦ埛浣撻獙Demo锛焅nA : 鐢ㄦ埛浣撻獙Demo灏辨槸闃块噷浜戝钩鍙颁负鎮ㄨ嚜鍔ㄥ垱寤虹殑銆佺敤鏉ヤ綋楠孒ttpDns鏈嶅姟鍜屽弽棣堝缓璁敤鐨勪竴涓皬Demo锛岃鎮ㄤ綋楠屼究鎹枫€侀珮鏁堢殑HttpDns鏈嶅姟銆俓n\nQ : 濡備綍鑱旂郴鎴戜滑锛焅nA : App Demo鐩稿叧闂锛岃鎼滅储閽夐拤缇ゅ彿锛?1777313</string>
<string name="layout_helpus_content">Q : 娴犫偓娑斿牊妲搁悽銊﹀煕娴捇鐛橠emo閿涚剠nA : 閻劍鍩涙担鎾荤崣Demo鐏忚鲸妲搁梼鍧楀櫡娴滄垵閽╅崣棰佽礋閹劏鍤滈崝銊ュ灡瀵よ櫣娈戦妴浣烘暏閺夈儰缍嬫瀛抰tpDns閺堝秴濮熼崪灞藉冀妫牆缂撶拋顔炬暏閻ㄥ嫪绔存稉顏勭毈Demo閿涘矁顔€閹劋缍嬫灞肩┒閹规灚鈧線鐝弫鍫㈡畱HttpDns閺堝秴濮熼妴淇搉\nQ : 婵″倷缍嶉懕鏃傞兇閹存垳婊戦敍鐒卬A : App Demo閻╃鍙ч梻顕€顣介敍宀冾嚞閹兼粎鍌ㄩ柦澶愭嫟缂囥倕褰块敍?1777313</string>
</resources>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<Alibaba-anchors>
<New-anchors>
<certificates src="system" />
</Alibaba-anchors>
</New-anchors>
</base-config>
</network-security-config>