阿里sdk
41
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/.gitignore
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
.dart_tool/
|
||||
.packages
|
||||
build/
|
||||
ios/Pods/
|
||||
ios/Frameworks/
|
||||
.DS_Store
|
||||
|
||||
|
||||
# Android 常见忽略项(避免提交本地构建/IDE/密钥等产物)
|
||||
# 参考:Android 项目通用 .gitignore
|
||||
# 构建与产物
|
||||
*.apk
|
||||
*.aab
|
||||
*.ap_
|
||||
*.dex
|
||||
*.class
|
||||
captures/
|
||||
.externalNativeBuild/
|
||||
.cxx/
|
||||
|
||||
# Gradle
|
||||
.gradle/
|
||||
local.properties
|
||||
|
||||
# Android Studio / IntelliJ
|
||||
*.iml
|
||||
.idea/
|
||||
|
||||
# Eclipse(少数场景仍可能出现)
|
||||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
bin/
|
||||
gen/
|
||||
out/
|
||||
|
||||
# 密钥与敏感文件
|
||||
*.jks
|
||||
*.keystore
|
||||
*.hprof
|
||||
google-services.json
|
||||
21
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/CHANGELOG.md
Normal file
@@ -0,0 +1,21 @@
|
||||
## 1.0.2
|
||||
* 升级 iOS HTTPDNS SDK 至 3.4.0 版本
|
||||
|
||||
## 1.0.1
|
||||
* 新增 IP 优选功能
|
||||
* 现有接口功能优化
|
||||
* 升级 Android HTTPDNS SDK 至 2.6.7 版本
|
||||
* 升级 iOS HTTPDNS SDK 至 3.3.0 版本
|
||||
|
||||
## 1.0.0
|
||||
* 重构插件,更新接入方式和各个接口
|
||||
* 集成Android HTTPDNS SDK 2.6.5版本
|
||||
|
||||
## 0.0.2
|
||||
* 集成iOS HTTPDNS SDK 3.2.1版本
|
||||
* 集成Android HTTPDNS SDK 2.6.3版本
|
||||
* 修改预解析接口中requestIpType参数必传
|
||||
|
||||
## 0.0.1
|
||||
* 集成Android HTTPDNS SDK 2.6.2版本
|
||||
* 集成iOS HTTPDNS SDK 3.2.0版本
|
||||
21
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 Alibaba Cloud
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
532
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/README.md
Normal file
@@ -0,0 +1,532 @@
|
||||
# Aliyun HTTPDNS Flutter Plugin
|
||||
|
||||
阿里云EMAS HTTPDNS Flutter插件,提供基于原生SDK的域名解析能力。
|
||||
|
||||
一、快速入门
|
||||
-----------------------
|
||||
|
||||
### 1.1 开通服务
|
||||
|
||||
请参考[快速入门文档](https://help.aliyun.com/document_detail/2867674.html)开通HTTPDNS。
|
||||
|
||||
### 1.2 获取配置
|
||||
|
||||
请参考开发配置文档在EMAS控制台开发配置中获取AccountId/SecretKey/AESSecretKey等信息,用于初始化SDK。
|
||||
|
||||
## 二、安装
|
||||
|
||||
在`pubspec.yaml`中加入dependencies:
|
||||
```yaml
|
||||
dependencies:
|
||||
aliyun_httpdns: ^1.0.1
|
||||
```
|
||||
添加依赖之后需要执行一次 `flutter pub get`。
|
||||
|
||||
### 原生SDK版本说明
|
||||
|
||||
插件已集成了对应平台的HTTPDNS原生SDK,当前版本:
|
||||
|
||||
- **Android**: `com.aliyun.ams:alicloud-android-httpdns:2.6.7`
|
||||
- **iOS**: `AlicloudHTTPDNS:3.3.0`
|
||||
|
||||
|
||||
|
||||
三、配置和使用
|
||||
------------------------
|
||||
|
||||
### 3.1 初始化配置
|
||||
|
||||
应用启动后,需要先初始化插件,才能调用HTTPDNS能力。
|
||||
初始化主要是配置AccountId/SecretKey等信息及功能开关。
|
||||
示例代码如下:
|
||||
|
||||
```dart
|
||||
// 初始化 HTTPDNS
|
||||
await AliyunHttpdns.init(
|
||||
accountId: '您的AccountId',
|
||||
secretKey: '您的SecretKey',
|
||||
);
|
||||
|
||||
// 设置功能选项
|
||||
await AliyunHttpdns.setHttpsRequestEnabled(true);
|
||||
await AliyunHttpdns.setLogEnabled(true);
|
||||
await AliyunHttpdns.setPersistentCacheIPEnabled(true);
|
||||
await AliyunHttpdns.setReuseExpiredIPEnabled(true);
|
||||
|
||||
// 构建服务
|
||||
await AliyunHttpdns.build();
|
||||
|
||||
// 设置预解析域名
|
||||
await AliyunHttpdns.setPreResolveHosts(['www.aliyun.com'], ipType: 'both');
|
||||
print("init success");
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### 3.1.1 日志配置
|
||||
|
||||
应用开发过程中,如果要输出HTTPDNS的日志,可以调用日志输出控制方法,开启日志,示例代码如下:
|
||||
|
||||
```dart
|
||||
await AliyunHttpdns.setLogEnabled(true);
|
||||
print("enableLog success");
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### 3.1.2 sessionId记录
|
||||
|
||||
应用在运行过程中,可以调用获取SessionId方法获取sessionId,记录到应用的数据采集系统中。
|
||||
sessionId用于表示标识一次应用运行,线上排查时,可以用于查询应用一次运行过程中的解析日志,示例代码如下:
|
||||
|
||||
```dart
|
||||
final sessionId = await AliyunHttpdns.getSessionId();
|
||||
print("SessionId = $sessionId");
|
||||
```
|
||||
|
||||
|
||||
|
||||
### 3.2 域名解析
|
||||
|
||||
#### 3.2.1 预解析
|
||||
|
||||
当需要提前解析域名时,可以调用预解析域名方法,示例代码如下:
|
||||
|
||||
```dart
|
||||
await AliyunHttpdns.setPreResolveHosts(["www.aliyun.com", "www.example.com"], ipType: 'both');
|
||||
print("preResolveHosts success");
|
||||
```
|
||||
|
||||
|
||||
|
||||
调用之后,插件会发起域名解析,并把结果缓存到内存,用于后续请求时直接使用。
|
||||
|
||||
### 3.2.2 域名解析
|
||||
|
||||
当需要解析域名时,可以通过调用域名解析方法解析域名获取IP,示例代码如下:
|
||||
|
||||
```dart
|
||||
Future<void> _resolve() async {
|
||||
final res = await AliyunHttpdns.resolveHostSyncNonBlocking('www.aliyun.com', ipType: 'both');
|
||||
final ipv4List = res['ipv4'] ?? [];
|
||||
final ipv6List = res['ipv6'] ?? [];
|
||||
print('IPv4: $ipv4List');
|
||||
print('IPv6: $ipv6List');
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
四、Flutter最佳实践
|
||||
------------------------------
|
||||
|
||||
### 4.1 原理说明
|
||||
|
||||
本示例展示了一种更直接的集成方式,通过自定义HTTP客户端适配器来实现HTTPDNS集成:
|
||||
|
||||
1. 创建自定义的HTTP客户端适配器,拦截网络请求
|
||||
2. 在适配器中调用HTTPDNS插件解析域名为IP地址
|
||||
3. 使用解析得到的IP地址创建直接的Socket连接
|
||||
4. 对于HTTPS连接,确保正确设置SNI(Server Name Indication)为原始域名
|
||||
|
||||
这种方式避免了创建本地代理服务的复杂性,直接在HTTP客户端层面集成HTTPDNS功能。
|
||||
|
||||
### 4.2 示例说明
|
||||
|
||||
完整应用示例请参考插件包中example应用。
|
||||
|
||||
#### 4.2.1 自定义HTTP客户端适配器实现
|
||||
|
||||
自定义适配器的实现请参考插件包中example/lib/net/httpdns_http_client_adapter.dart文件。本方案由EMAS团队设计实现,参考请注明出处。
|
||||
适配器内部会拦截HTTP请求,调用HTTPDNS进行域名解析,并使用解析后的IP创建socket连接。
|
||||
|
||||
本示例支持三种网络库:Dio、HttpClient、http包。代码如下:
|
||||
|
||||
```dart
|
||||
import 'dart:io';
|
||||
import 'package:dio/io.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/io_client.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:aliyun_httpdns/aliyun_httpdns.dart';
|
||||
|
||||
// Dio 适配器
|
||||
IOHttpClientAdapter buildHttpdnsHttpClientAdapter() {
|
||||
final HttpClient client = HttpClient();
|
||||
_configureHttpClient(client);
|
||||
_configureConnectionFactory(client);
|
||||
|
||||
final IOHttpClientAdapter adapter = IOHttpClientAdapter(createHttpClient: () => client)
|
||||
..validateCertificate = (cert, host, port) => true;
|
||||
return adapter;
|
||||
}
|
||||
|
||||
// 原生 HttpClient
|
||||
HttpClient buildHttpdnsNativeHttpClient() {
|
||||
final HttpClient client = HttpClient();
|
||||
_configureHttpClient(client);
|
||||
_configureConnectionFactory(client);
|
||||
return client;
|
||||
}
|
||||
|
||||
// http 包适配器
|
||||
http.Client buildHttpdnsHttpPackageClient() {
|
||||
final HttpClient httpClient = buildHttpdnsNativeHttpClient();
|
||||
return IOClient(httpClient);
|
||||
}
|
||||
|
||||
// HttpClient 基础配置
|
||||
void _configureHttpClient(HttpClient client) {
|
||||
client.findProxy = (Uri _) => 'DIRECT';
|
||||
client.idleTimeout = const Duration(seconds: 90);
|
||||
client.maxConnectionsPerHost = 8;
|
||||
}
|
||||
|
||||
// 配置基于 HTTPDNS 的连接工厂
|
||||
// 本方案由EMAS团队设计实现,参考请注明出处。
|
||||
void _configureConnectionFactory(HttpClient client) {
|
||||
client.connectionFactory = (Uri uri, String? proxyHost, int? proxyPort) async {
|
||||
final String domain = uri.host;
|
||||
final bool https = uri.scheme.toLowerCase() == 'https';
|
||||
final int port = uri.port == 0 ? (https ? 443 : 80) : uri.port;
|
||||
|
||||
final List<InternetAddress> targets = await _resolveTargets(domain);
|
||||
final Object target = targets.isNotEmpty ? targets.first : domain;
|
||||
|
||||
if (!https) {
|
||||
return Socket.startConnect(target, port);
|
||||
}
|
||||
|
||||
// HTTPS:先 TCP,再 TLS(SNI=域名),并保持可取消
|
||||
bool cancelled = false;
|
||||
final Future<ConnectionTask<Socket>> rawStart = Socket.startConnect(target, port);
|
||||
final Future<Socket> upgraded = rawStart.then((task) async {
|
||||
final Socket raw = await task.socket;
|
||||
if (cancelled) {
|
||||
raw.destroy();
|
||||
throw const SocketException('Connection cancelled');
|
||||
}
|
||||
final SecureSocket secure = await SecureSocket.secure(
|
||||
raw,
|
||||
host: domain, // 重要:使用原始域名作为SNI
|
||||
);
|
||||
if (cancelled) {
|
||||
secure.destroy();
|
||||
throw const SocketException('Connection cancelled');
|
||||
}
|
||||
return secure;
|
||||
});
|
||||
return ConnectionTask.fromSocket(
|
||||
upgraded,
|
||||
() {
|
||||
cancelled = true;
|
||||
try {
|
||||
rawStart.then((t) => t.cancel());
|
||||
} catch (_) {}
|
||||
},
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
// 通过 HTTPDNS 解析目标 IP 列表
|
||||
Future<List<InternetAddress>> _resolveTargets(String domain) async {
|
||||
try {
|
||||
final res = await AliyunHttpdns.resolveHostSyncNonBlocking(domain, ipType: 'both');
|
||||
final List<String> ipv4 = res['ipv4'] ?? [];
|
||||
final List<String> ipv6 = res['ipv6'] ?? [];
|
||||
final List<InternetAddress> targets = [
|
||||
...ipv4.map(InternetAddress.tryParse).whereType<InternetAddress>(),
|
||||
...ipv6.map(InternetAddress.tryParse).whereType<InternetAddress>(),
|
||||
];
|
||||
if (targets.isEmpty) {
|
||||
debugPrint('[dio] HTTPDNS no result for $domain, fallback to system DNS');
|
||||
} else {
|
||||
debugPrint('[dio] HTTPDNS resolved $domain -> ${targets.first.address}');
|
||||
}
|
||||
return targets;
|
||||
} catch (e) {
|
||||
debugPrint('[dio] HTTPDNS resolve failed: $e, fallback to system DNS');
|
||||
return const <InternetAddress>[];
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### 4.2.2 适配器集成和使用
|
||||
|
||||
适配器的集成请参考插件包中example/lib/main.dart文件。
|
||||
首先需要初始化HTTPDNS,然后配置网络库使用自定义适配器,示例代码如下:
|
||||
|
||||
```dart
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
late final Dio _dio;
|
||||
late final HttpClient _httpClient;
|
||||
late final http.Client _httpPackageClient;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
// 初始化 HTTPDNS
|
||||
_initHttpDnsOnce();
|
||||
|
||||
// 配置网络库使用 HTTPDNS 适配器
|
||||
_dio = Dio();
|
||||
_dio.httpClientAdapter = buildHttpdnsHttpClientAdapter();
|
||||
_dio.options.headers['Connection'] = 'keep-alive';
|
||||
|
||||
_httpClient = buildHttpdnsNativeHttpClient();
|
||||
_httpPackageClient = buildHttpdnsHttpPackageClient();
|
||||
}
|
||||
|
||||
Future<void> _initHttpDnsOnce() async {
|
||||
try {
|
||||
await AliyunHttpdns.init(
|
||||
accountId: 000000,
|
||||
secretKey: '您的SecretKey',
|
||||
);
|
||||
await AliyunHttpdns.setHttpsRequestEnabled(true);
|
||||
await AliyunHttpdns.setLogEnabled(true);
|
||||
await AliyunHttpdns.setPersistentCacheIPEnabled(true);
|
||||
await AliyunHttpdns.setReuseExpiredIPEnabled(true);
|
||||
await AliyunHttpdns.build();
|
||||
|
||||
// 设置预解析域名
|
||||
await AliyunHttpdns.setPreResolveHosts(['www.aliyun.com'], ipType: 'both');
|
||||
} catch (e) {
|
||||
debugPrint('[httpdns] init failed: $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
使用配置好的网络库发起请求时,会自动使用HTTPDNS进行域名解析:
|
||||
|
||||
```dart
|
||||
// 使用 Dio
|
||||
final response = await _dio.get('https://www.aliyun.com');
|
||||
|
||||
// 使用 HttpClient
|
||||
final request = await _httpClient.getUrl(Uri.parse('https://www.aliyun.com'));
|
||||
final response = await request.close();
|
||||
|
||||
// 使用 http 包
|
||||
final response = await _httpPackageClient.get(Uri.parse('https://www.aliyun.com'));
|
||||
```
|
||||
|
||||
#### 4.2.3 资源清理
|
||||
|
||||
在组件销毁时,记得清理相关资源:
|
||||
|
||||
```dart
|
||||
@override
|
||||
void dispose() {
|
||||
_urlController.dispose();
|
||||
_httpClient.close();
|
||||
_httpPackageClient.close();
|
||||
super.dispose();
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
五、API
|
||||
----------------------
|
||||
|
||||
### 5.1 日志输出控制
|
||||
|
||||
控制是否打印Log。
|
||||
|
||||
```dart
|
||||
await AliyunHttpdns.setLogEnabled(true);
|
||||
print("enableLog success");
|
||||
```
|
||||
|
||||
|
||||
|
||||
### 5.2 初始化
|
||||
|
||||
初始化配置, 在应用启动时调用。
|
||||
|
||||
```dart
|
||||
// 基础初始化
|
||||
await AliyunHttpdns.init(
|
||||
accountId: 000000,
|
||||
secretKey: 'your_secret_key',
|
||||
aesSecretKey: 'your_aes_secret_key', // 可选
|
||||
);
|
||||
|
||||
// 配置功能选项
|
||||
await AliyunHttpdns.setHttpsRequestEnabled(true);
|
||||
await AliyunHttpdns.setLogEnabled(true);
|
||||
await AliyunHttpdns.setPersistentCacheIPEnabled(true);
|
||||
await AliyunHttpdns.setReuseExpiredIPEnabled(true);
|
||||
|
||||
// 构建服务实例
|
||||
await AliyunHttpdns.build();
|
||||
|
||||
print("init success");
|
||||
```
|
||||
|
||||
|
||||
|
||||
初始化参数:
|
||||
|
||||
| 参数名 | 类型 | 是否必须 | 功能 | 支持平台 |
|
||||
|-------------|--------|------|------------|-------------|
|
||||
| accountId | int | 必选参数 | Account ID | Android/iOS |
|
||||
| secretKey | String | 可选参数 | 加签密钥 | Android/iOS |
|
||||
| aesSecretKey| String | 可选参数 | 加密密钥 | Android/iOS |
|
||||
|
||||
功能配置方法:
|
||||
|
||||
- `setHttpsRequestEnabled(bool)` - 设置是否使用HTTPS解析链路
|
||||
- `setLogEnabled(bool)` - 设置是否开启日志
|
||||
- `setPersistentCacheIPEnabled(bool)` - 设置是否开启持久化缓存
|
||||
- `setReuseExpiredIPEnabled(bool)` - 设置是否允许复用过期IP
|
||||
- `setPreResolveAfterNetworkChanged(bool)` - 设置网络切换时是否自动刷新解析
|
||||
|
||||
|
||||
|
||||
### 5.3 域名解析
|
||||
|
||||
解析指定域名。
|
||||
|
||||
```dart
|
||||
Future<void> _resolve() async {
|
||||
final res = await AliyunHttpdns.resolveHostSyncNonBlocking(
|
||||
'www.aliyun.com',
|
||||
ipType: 'both', // 'auto', 'ipv4', 'ipv6', 'both'
|
||||
);
|
||||
|
||||
final ipv4List = res['ipv4'] ?? [];
|
||||
final ipv6List = res['ipv6'] ?? [];
|
||||
print('IPv4: $ipv4List');
|
||||
print('IPv6: $ipv6List');
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
参数:
|
||||
|
||||
| 参数名 | 类型 | 是否必须 | 功能 |
|
||||
|------------|---------------------|------|----------------------------------------|
|
||||
| hostname | String | 必选参数 | 要解析的域名 |
|
||||
| ipType | String | 可选参数 | 请求IP类型: 'auto', 'ipv4', 'ipv6', 'both' |
|
||||
|
||||
|
||||
|
||||
返回数据结构:
|
||||
|
||||
| 字段名 | 类型 | 功能 |
|
||||
|------|--------------|----------------------------------|
|
||||
| ipv4 | List<String> | IPv4地址列表,如: ["1.1.1.1", "2.2.2.2"] |
|
||||
| ipv6 | List<String> | IPv6地址列表,如: ["::1", "::2"] |
|
||||
|
||||
|
||||
|
||||
### 5.4 预解析域名
|
||||
|
||||
预解析域名, 解析后缓存在SDK中,下次解析时直接从缓存中获取,提高解析速度。
|
||||
|
||||
```dart
|
||||
await AliyunHttpdns.setPreResolveHosts(
|
||||
["www.aliyun.com", "www.example.com"],
|
||||
ipType: 'both'
|
||||
);
|
||||
print("preResolveHosts success");
|
||||
```
|
||||
|
||||
|
||||
|
||||
参数:
|
||||
|
||||
| 参数名 | 类型 | 是否必须 | 功能 |
|
||||
|--------|--------------|------|----------------------------------------|
|
||||
| hosts | List<String> | 必选参数 | 预解析域名列表 |
|
||||
| ipType | String | 可选参数 | 请求IP类型: 'auto', 'ipv4', 'ipv6', 'both' |
|
||||
|
||||
|
||||
|
||||
### 5.5 获取SessionId
|
||||
|
||||
获取SessionId, 用于排查追踪问题。
|
||||
|
||||
```dart
|
||||
final sessionId = await AliyunHttpdns.getSessionId();
|
||||
print("SessionId = $sessionId");
|
||||
```
|
||||
|
||||
|
||||
|
||||
无需参数,直接返回当前会话ID。
|
||||
|
||||
### 5.6 清除缓存
|
||||
|
||||
清除所有DNS解析缓存。
|
||||
|
||||
```dart
|
||||
await AliyunHttpdns.cleanAllHostCache();
|
||||
print("缓存清除成功");
|
||||
```
|
||||
|
||||
### 5.7 持久化缓存配置
|
||||
|
||||
设置是否开启持久化缓存功能。开启后,SDK 会将解析结果保存到本地,App 重启后可以从本地加载缓存,提升首屏加载速度。
|
||||
|
||||
```dart
|
||||
// 基础用法:开启持久化缓存
|
||||
await AliyunHttpdns.setPersistentCacheIPEnabled(true);
|
||||
|
||||
// 高级用法:开启持久化缓存并设置过期时间阈值
|
||||
await AliyunHttpdns.setPersistentCacheIPEnabled(
|
||||
true,
|
||||
discardExpiredAfterSeconds: 86400 // 1天,单位:秒
|
||||
);
|
||||
print("持久化缓存已开启");
|
||||
```
|
||||
|
||||
参数:
|
||||
|
||||
| 参数名 | 类型 | 是否必须 | 功能 |
|
||||
|----------------------------|------|------|------------------------------------------|
|
||||
| enabled | bool | 必选参数 | 是否开启持久化缓存 |
|
||||
| discardExpiredAfterSeconds | int | 可选参数 | 过期时间阈值(秒),App 启动时会丢弃过期超过此时长的缓存记录,建议设置为 1 天(86400 秒) |
|
||||
|
||||
注意事项:
|
||||
- 持久化缓存仅影响第一次域名解析结果,后续解析仍会请求 HTTPDNS 服务器
|
||||
- 如果业务服务器 IP 变化频繁,建议谨慎开启此功能
|
||||
- 建议在 `build()` 之前调用此接口
|
||||
|
||||
### 5.8 网络变化时自动刷新预解析
|
||||
|
||||
设置在网络环境变化时是否自动刷新预解析域名的缓存。
|
||||
|
||||
```dart
|
||||
await AliyunHttpdns.setPreResolveAfterNetworkChanged(true);
|
||||
print("网络变化自动刷新已启用");
|
||||
```
|
||||
|
||||
### 5.9 IP 优选
|
||||
|
||||
设置需要进行 IP 优选的域名列表。开启后,SDK 会对解析返回的 IP 列表进行 TCP 测速并排序,优先返回连接速度最快的 IP。
|
||||
|
||||
```dart
|
||||
await AliyunHttpdns.setIPRankingList({
|
||||
'www.aliyun.com': 443,
|
||||
});
|
||||
print("IP 优选配置成功");
|
||||
```
|
||||
|
||||
参数:
|
||||
|
||||
| 参数名 | 类型 | 是否必须 | 功能 |
|
||||
|-------------|-----------------|------|------------------------------|
|
||||
| hostPortMap | Map<String, int> | 必选参数 | 域名和端口的映射,例如:{'www.aliyun.com': 443} |
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
33
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/android/build.gradle
Normal file
@@ -0,0 +1,33 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.aliyun.ams.httpdns'
|
||||
compileSdkVersion 34
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '17'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.annotation:annotation:1.8.0'
|
||||
implementation 'com.aliyun.ams:alicloud-android-httpdns:2.6.7'
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# Keep rules for vendor SDK (fill as needed)
|
||||
# -keep class com.vendor.httpdns.** { *; }
|
||||
# -dontwarn com.vendor.httpdns.**
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/releases/' }
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "httpdns_plugin"
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application/>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,324 @@
|
||||
package com.aliyun.ams.httpdns
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import androidx.annotation.NonNull
|
||||
|
||||
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.log.HttpDnsLog
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin
|
||||
import io.flutter.plugin.common.MethodCall
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
|
||||
import io.flutter.plugin.common.MethodChannel.Result
|
||||
|
||||
|
||||
class AliyunHttpDnsPlugin : FlutterPlugin, MethodCallHandler {
|
||||
private lateinit var channel: MethodChannel
|
||||
private var appContext: Context? = null
|
||||
|
||||
// Cached service keyed by accountId to avoid re-creating
|
||||
private var service: HttpDnsService? = null
|
||||
private var accountId: String? = null
|
||||
private var secretKey: String? = null
|
||||
private var aesSecretKey: String? = null
|
||||
|
||||
// Desired states collected before build()
|
||||
private var desiredPersistentCacheEnabled: Boolean? = null
|
||||
private var desiredDiscardExpiredAfterSeconds: Int? = null
|
||||
private var desiredReuseExpiredIPEnabled: Boolean? = null
|
||||
private var desiredLogEnabled: Boolean? = null
|
||||
private var desiredHttpsEnabled: Boolean? = null
|
||||
private var desiredPreResolveAfterNetworkChanged: Boolean? = null
|
||||
private var desiredIPRankingMap: Map<String, Int>? = null
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
|
||||
appContext = flutterPluginBinding.applicationContext
|
||||
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "aliyun_httpdns")
|
||||
channel.setMethodCallHandler(this)
|
||||
}
|
||||
|
||||
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
|
||||
// Log every incoming call with method name and raw arguments
|
||||
try {
|
||||
Log.i("AliyunHttpDns", "invoke method=${call.method}, args=${call.arguments}")
|
||||
} catch (_: Throwable) {
|
||||
Log.i("AliyunHttpDns", "invoke method=${call.method}, args=<unprintable>")
|
||||
}
|
||||
when (call.method) {
|
||||
// Dart: init(accountId, secretKey?, aesSecretKey?) — only save states here
|
||||
"initialize" -> {
|
||||
val args = call.arguments as? Map<*, *> ?: emptyMap<String, Any>()
|
||||
val ctx = appContext
|
||||
if (ctx == null) {
|
||||
result.error("no_context", "Android context not attached", null)
|
||||
return
|
||||
}
|
||||
val accountAny = args["accountId"]
|
||||
val account = when (accountAny) {
|
||||
is Int -> accountAny.toString()
|
||||
is Long -> accountAny.toString()
|
||||
is String -> accountAny
|
||||
else -> null
|
||||
}
|
||||
val secret = (args["secretKey"] as? String)?.takeIf { it.isNotBlank() }
|
||||
val aes = (args["aesSecretKey"] as? String)?.takeIf { it.isNotBlank() }
|
||||
|
||||
if (account.isNullOrBlank()) {
|
||||
Log.i("AliyunHttpDns", "initialize missing accountId")
|
||||
result.success(false)
|
||||
return
|
||||
}
|
||||
// Save desired states only; actual build happens on 'build'
|
||||
accountId = account
|
||||
secretKey = secret
|
||||
aesSecretKey = aes
|
||||
Log.i("AliyunHttpDns", "initialize saved state, account=$account")
|
||||
result.success(true)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Dart: setLogEnabled(enabled) — save desired
|
||||
"setLogEnabled" -> {
|
||||
val enabled = call.argument<Boolean>("enabled") == true
|
||||
desiredLogEnabled = enabled
|
||||
Log.i("AliyunHttpDns", "setLogEnabled desired=$enabled")
|
||||
result.success(null)
|
||||
}
|
||||
|
||||
// Dart: setHttpsRequestEnabled(enabled)
|
||||
"setHttpsRequestEnabled" -> {
|
||||
val enabled = call.argument<Boolean>("enabled") == true
|
||||
desiredHttpsEnabled = enabled
|
||||
Log.i("AliyunHttpDns", "https request desired=$enabled")
|
||||
result.success(null)
|
||||
}
|
||||
|
||||
// Dart: setPersistentCacheIPEnabled(enabled, discardExpiredAfterSeconds?) — save desired
|
||||
"setPersistentCacheIPEnabled" -> {
|
||||
val enabled = call.argument<Boolean>("enabled") == true
|
||||
val discard = call.argument<Int>("discardExpiredAfterSeconds")
|
||||
desiredPersistentCacheEnabled = enabled
|
||||
desiredDiscardExpiredAfterSeconds = discard
|
||||
Log.i("AliyunHttpDns", "persistent cache desired=$enabled discard=$discard")
|
||||
result.success(null)
|
||||
}
|
||||
|
||||
// Dart: setReuseExpiredIPEnabled(enabled) — save desired
|
||||
"setReuseExpiredIPEnabled" -> {
|
||||
val enabled = call.argument<Boolean>("enabled") == true
|
||||
desiredReuseExpiredIPEnabled = enabled
|
||||
Log.i("AliyunHttpDns", "reuse expired ip desired=$enabled")
|
||||
result.success(null)
|
||||
}
|
||||
|
||||
// Dart: setPreResolveAfterNetworkChanged(enabled) — save desired (applied at build via InitConfig)
|
||||
"setPreResolveAfterNetworkChanged" -> {
|
||||
val enabled = call.argument<Boolean>("enabled") == true
|
||||
desiredPreResolveAfterNetworkChanged = enabled
|
||||
Log.i("AliyunHttpDns", "preResolveAfterNetworkChanged desired=$enabled")
|
||||
result.success(null)
|
||||
}
|
||||
|
||||
// Dart: setIPRankingList(hostPortMap) — save desired
|
||||
"setIPRankingList" -> {
|
||||
val hostPortMap = call.argument<Map<String, Int>>("hostPortMap")
|
||||
desiredIPRankingMap = hostPortMap
|
||||
Log.i("AliyunHttpDns", "IP ranking list desired, hosts=${hostPortMap?.keys?.joinToString()}")
|
||||
result.success(null)
|
||||
}
|
||||
|
||||
// Dart: setPreResolveHosts(hosts, ipType)
|
||||
"setPreResolveHosts" -> {
|
||||
val hosts = call.argument<List<String>>("hosts") ?: emptyList()
|
||||
val ipTypeStr = call.argument<String>("ipType") ?: "auto"
|
||||
val type = when (ipTypeStr.lowercase()) {
|
||||
"ipv4", "v4" -> RequestIpType.v4
|
||||
"ipv6", "v6" -> RequestIpType.v6
|
||||
"both", "64" -> RequestIpType.both
|
||||
else -> RequestIpType.auto
|
||||
}
|
||||
try {
|
||||
service?.setPreResolveHosts(hosts, type)
|
||||
Log.i("AliyunHttpDns", "preResolve set for ${hosts.size} hosts, type=$type")
|
||||
} catch (t: Throwable) {
|
||||
Log.i("AliyunHttpDns", "setPreResolveHosts failed: ${t.message}")
|
||||
}
|
||||
result.success(null)
|
||||
}
|
||||
|
||||
// Dart: getSessionId
|
||||
"getSessionId" -> {
|
||||
val sid = try { service?.getSessionId() } catch (_: Throwable) { null }
|
||||
result.success(sid)
|
||||
}
|
||||
|
||||
// Dart: cleanAllHostCache
|
||||
"cleanAllHostCache" -> {
|
||||
try {
|
||||
// Best-effort: empty list to clear all
|
||||
service?.cleanHostCache(ArrayList())
|
||||
} catch (t: Throwable) {
|
||||
Log.i("AliyunHttpDns", "cleanAllHostCache failed: ${t.message}")
|
||||
}
|
||||
result.success(null)
|
||||
}
|
||||
|
||||
// Dart: build() — construct InitConfig and acquire service using desired states
|
||||
"build" -> {
|
||||
val ctx = appContext
|
||||
val account = accountId
|
||||
if (ctx == null || account.isNullOrBlank()) {
|
||||
result.success(false)
|
||||
return
|
||||
}
|
||||
try {
|
||||
desiredLogEnabled?.let { enabled ->
|
||||
try {
|
||||
HttpDnsLog.enable(enabled)
|
||||
Log.i("AliyunHttpDns", "HttpDnsLog.enable($enabled)")
|
||||
} catch (t: Throwable) {
|
||||
Log.w("AliyunHttpDns", "HttpDnsLog.enable failed: ${t.message}")
|
||||
}
|
||||
}
|
||||
|
||||
val builder = InitConfig.Builder()
|
||||
|
||||
// Optional builder params
|
||||
try { builder.javaClass.getMethod("setContext", Context::class.java).invoke(builder, ctx) } catch (_: Throwable) {}
|
||||
try {
|
||||
if (!secretKey.isNullOrBlank()) {
|
||||
builder.javaClass.getMethod("setSecretKey", String::class.java).invoke(builder, secretKey)
|
||||
}
|
||||
} catch (_: Throwable) {}
|
||||
try {
|
||||
if (!aesSecretKey.isNullOrBlank()) {
|
||||
builder.javaClass.getMethod("setAesSecretKey", String::class.java).invoke(builder, aesSecretKey)
|
||||
}
|
||||
} catch (_: Throwable) {}
|
||||
// Prefer HTTPS if requested
|
||||
try {
|
||||
desiredHttpsEnabled?.let { en ->
|
||||
builder.javaClass.getMethod("setEnableHttps", Boolean::class.javaPrimitiveType).invoke(builder, en)
|
||||
}
|
||||
} catch (_: Throwable) {}
|
||||
try {
|
||||
desiredPersistentCacheEnabled?.let { enabled ->
|
||||
val discardSeconds = desiredDiscardExpiredAfterSeconds
|
||||
if (discardSeconds != null && discardSeconds >= 0) {
|
||||
val expiredThresholdMillis = discardSeconds.toLong() * 1000L
|
||||
builder.javaClass.getMethod("setEnableCacheIp", Boolean::class.javaPrimitiveType, Long::class.javaPrimitiveType)
|
||||
.invoke(builder, enabled, expiredThresholdMillis)
|
||||
} else {
|
||||
builder.javaClass.getMethod("setEnableCacheIp", Boolean::class.javaPrimitiveType)
|
||||
.invoke(builder, enabled)
|
||||
}
|
||||
}
|
||||
} catch (_: Throwable) { }
|
||||
try {
|
||||
desiredReuseExpiredIPEnabled?.let { enabled ->
|
||||
builder.javaClass.getMethod("setEnableExpiredIp", Boolean::class.javaPrimitiveType)
|
||||
.invoke(builder, enabled)
|
||||
}
|
||||
} catch (_: Throwable) { }
|
||||
// Apply preResolve-after-network-changed
|
||||
try {
|
||||
desiredPreResolveAfterNetworkChanged?.let { en ->
|
||||
builder.javaClass.getMethod("setPreResolveAfterNetworkChanged", Boolean::class.javaPrimitiveType).invoke(builder, en)
|
||||
}
|
||||
} catch (_: Throwable) {}
|
||||
|
||||
// Apply IP ranking list
|
||||
try {
|
||||
desiredIPRankingMap?.let { map ->
|
||||
if (map.isNotEmpty()) {
|
||||
// Create List<IPRankingBean>
|
||||
val ipRankingBeanClass = Class.forName("com.alibaba.sdk.android.httpdns.ranking.IPRankingBean")
|
||||
val constructor = ipRankingBeanClass.getConstructor(String::class.java, Int::class.javaPrimitiveType)
|
||||
val list = ArrayList<Any>()
|
||||
map.forEach { (host, port) ->
|
||||
val bean = constructor.newInstance(host, port)
|
||||
list.add(bean)
|
||||
}
|
||||
val m = builder.javaClass.getMethod("setIPRankingList", List::class.java)
|
||||
m.invoke(builder, list)
|
||||
Log.i("AliyunHttpDns", "setIPRankingList applied with ${list.size} hosts")
|
||||
}
|
||||
}
|
||||
} catch (t: Throwable) {
|
||||
Log.w("AliyunHttpDns", "setIPRankingList failed: ${t.message}")
|
||||
}
|
||||
|
||||
builder.buildFor(account)
|
||||
|
||||
service = if (!secretKey.isNullOrBlank()) {
|
||||
HttpDns.getService(ctx, account, secretKey)
|
||||
} else {
|
||||
HttpDns.getService(ctx, account)
|
||||
}
|
||||
|
||||
Log.i("AliyunHttpDns", "build completed for account=$account")
|
||||
result.success(true)
|
||||
} catch (t: Throwable) {
|
||||
Log.i("AliyunHttpDns", "build failed: ${t.message}")
|
||||
result.success(false)
|
||||
}
|
||||
}
|
||||
|
||||
// Dart: resolveHostSyncNonBlocking(hostname, ipType, sdnsParams?, cacheKey?)
|
||||
"resolveHostSyncNonBlocking" -> {
|
||||
val hostname = call.argument<String>("hostname")
|
||||
if (hostname.isNullOrBlank()) {
|
||||
result.success(mapOf("ipv4" to emptyList<String>(), "ipv6" to emptyList<String>()))
|
||||
return
|
||||
}
|
||||
val ipTypeStr = call.argument<String>("ipType") ?: "auto"
|
||||
val type = when (ipTypeStr.lowercase()) {
|
||||
"ipv4", "v4" -> RequestIpType.v4
|
||||
"ipv6", "v6" -> RequestIpType.v6
|
||||
"both", "64" -> RequestIpType.both
|
||||
else -> RequestIpType.auto
|
||||
}
|
||||
try {
|
||||
val svc = service ?: run {
|
||||
val ctx = appContext
|
||||
val acc = accountId
|
||||
if (ctx != null && !acc.isNullOrBlank()) HttpDns.getService(ctx, acc) else null
|
||||
}
|
||||
val r = svc?.getHttpDnsResultForHostSyncNonBlocking(hostname, type)
|
||||
val v4 = r?.ips?.toList() ?: emptyList()
|
||||
val v6 = r?.ipv6s?.toList() ?: emptyList()
|
||||
// 记录解析结果,便于排查:包含 host、请求类型以及返回的 IPv4/IPv6 列表
|
||||
Log.d(
|
||||
"HttpdnsPlugin",
|
||||
"resolve result host=" + hostname + ", type=" + type +
|
||||
", ipv4=" + v4.joinToString(prefix = "[", postfix = "]") +
|
||||
", ipv6=" + v6.joinToString(prefix = "[", postfix = "]")
|
||||
)
|
||||
result.success(mapOf("ipv4" to v4, "ipv6" to v6))
|
||||
} catch (t: Throwable) {
|
||||
Log.i("AliyunHttpDns", "resolveHostSyncNonBlocking failed: ${t.message}")
|
||||
result.success(mapOf("ipv4" to emptyList<String>(), "ipv6" to emptyList<String>()))
|
||||
}
|
||||
}
|
||||
|
||||
// Legacy methods removed: preResolve / clearCache handled at app layer if needed
|
||||
|
||||
else -> result.notImplemented()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
channel.setMethodCallHandler(null)
|
||||
service = null
|
||||
appContext = null
|
||||
}
|
||||
}
|
||||
51
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/example/README.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# aliyun_httpdns_example
|
||||
|
||||
Demonstrates how to use the aliyun_httpdns plugin with various network libraries.
|
||||
|
||||
## Features
|
||||
|
||||
This example demonstrates:
|
||||
- HTTPDNS initialization and configuration
|
||||
- Domain name resolution (IPv4 and IPv6)
|
||||
- Integration with multiple network libraries:
|
||||
- Dio
|
||||
- HttpClient
|
||||
- http package
|
||||
- Custom HTTP client adapter for HTTPDNS
|
||||
- Real HTTP requests using HTTPDNS resolution
|
||||
|
||||
## Getting Started
|
||||
|
||||
1. Replace the `accountId` and `secretKey` in `lib/main.dart` with your own credentials:
|
||||
```dart
|
||||
await AliyunHttpdns.init(
|
||||
accountId: YOUR_ACCOUNT_ID, // Replace with your account ID
|
||||
secretKey: 'YOUR_SECRET_KEY', // Replace with your secret key
|
||||
);
|
||||
```
|
||||
|
||||
2. Install dependencies:
|
||||
```bash
|
||||
flutter pub get
|
||||
```
|
||||
|
||||
3. Run the app:
|
||||
```bash
|
||||
flutter run
|
||||
```
|
||||
|
||||
4. Try the features:
|
||||
- Enter a URL and select a network library (Dio/HttpClient/http)
|
||||
- Tap "Send Request" to make an HTTP request using HTTPDNS
|
||||
- Tap "HTTPDNS Resolve" to test domain resolution directly
|
||||
|
||||
## Implementation Details
|
||||
|
||||
The example uses a modern approach with `HttpClient.connectionFactory` to integrate HTTPDNS:
|
||||
- See `lib/net/httpdns_http_client_adapter.dart` for the implementation
|
||||
- This approach avoids the complexity of local proxy servers
|
||||
- Works seamlessly with Dio, HttpClient, and http package
|
||||
|
||||
## Note
|
||||
|
||||
The credentials in this example are placeholders. Please obtain your own credentials from the [Aliyun HTTPDNS Console](https://help.aliyun.com/document_detail/2867674.html).
|
||||
@@ -0,0 +1,5 @@
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
linter:
|
||||
rules:
|
||||
avoid_print: false
|
||||
39
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/example/android/.gitignore
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
gradle-wrapper.jar
|
||||
/.gradle
|
||||
/captures/
|
||||
/gradlew
|
||||
/gradlew.bat
|
||||
/local.properties
|
||||
GeneratedPluginRegistrant.java
|
||||
.cxx/
|
||||
|
||||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/to/reference-keystore
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
||||
|
||||
# Android 常见忽略项(与 packages/httpdns_plugin/.gitignore 同步)
|
||||
# 构建与产物
|
||||
*.apk
|
||||
*.aab
|
||||
*.ap_
|
||||
*.dex
|
||||
*.class
|
||||
.externalNativeBuild/
|
||||
|
||||
# Android Studio / IntelliJ
|
||||
*.iml
|
||||
.idea/
|
||||
|
||||
# Eclipse(可能遗留的工程类型)
|
||||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
bin/
|
||||
gen/
|
||||
out/
|
||||
|
||||
# 调试与敏感文件
|
||||
*.hprof
|
||||
google-services.json
|
||||
@@ -0,0 +1,45 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.httpdns_flutter_demo"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
// Align with plugin requirement; Flutter will still set its own default if not present
|
||||
ndkVersion = "27.0.12077973"
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_17.toString()
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "com.example.httpdns_flutter_demo"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
@@ -0,0 +1,45 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application
|
||||
android:label="httpdns_flutter_demo"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:taskAffinity=""
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
the Android process has started. This theme is visible to the user
|
||||
while the Flutter UI initializes. After that, this theme continues
|
||||
to determine the Window background behind the Flutter UI. -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"
|
||||
/>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
</application>
|
||||
<!-- Required to query activities that can process text, see:
|
||||
https://developer.android.com/training/package-visibility and
|
||||
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
||||
|
||||
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.PROCESS_TEXT"/>
|
||||
<data android:mimeType="text/plain"/>
|
||||
</intent>
|
||||
</queries>
|
||||
</manifest>
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.example.httpdns_flutter_demo
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
class MainActivity : FlutterActivity() {
|
||||
// No custom platform channels needed
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="?android:colorBackground" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<!-- <item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item> -->
|
||||
</layer-list>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@android:color/white" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<!-- <item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item> -->
|
||||
</layer-list>
|
||||
|
After Width: | Height: | Size: 544 B |
|
After Width: | Height: | Size: 442 B |
|
After Width: | Height: | Size: 721 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
@@ -0,0 +1,16 @@
|
||||
// repositories are managed via settings.gradle.kts dependencyResolutionManagement
|
||||
|
||||
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
|
||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||
|
||||
subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
@@ -0,0 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
|
||||
@@ -0,0 +1,44 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath = run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
// Allow project plugins (like Flutter) to add their own repositories
|
||||
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven {
|
||||
url = uri("https://maven.aliyun.com/nexus/content/repositories/releases/")
|
||||
}
|
||||
// Flutter engine artifacts
|
||||
maven {
|
||||
url = uri("https://storage.googleapis.com/download.flutter.io")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "8.7.3" apply false
|
||||
id("com.android.library") version "8.7.3" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
include(":httpdns_plugin")
|
||||
project(":httpdns_plugin").projectDir = File(rootDir, "../packages/httpdns_plugin/android")
|
||||
34
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/example/ios/.gitignore
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
**/dgph
|
||||
*.mode1v3
|
||||
*.mode2v3
|
||||
*.moved-aside
|
||||
*.pbxuser
|
||||
*.perspectivev3
|
||||
**/*sync/
|
||||
.sconsign.dblite
|
||||
.tags*
|
||||
**/.vagrant/
|
||||
**/DerivedData/
|
||||
Icon?
|
||||
**/Pods/
|
||||
**/.symlinks/
|
||||
profile
|
||||
xcuserdata
|
||||
**/.generated/
|
||||
Flutter/App.framework
|
||||
Flutter/Flutter.framework
|
||||
Flutter/Flutter.podspec
|
||||
Flutter/Generated.xcconfig
|
||||
Flutter/ephemeral/
|
||||
Flutter/app.flx
|
||||
Flutter/app.zip
|
||||
Flutter/flutter_assets/
|
||||
Flutter/flutter_export_environment.sh
|
||||
ServiceDefinitions.json
|
||||
Runner/GeneratedPluginRegistrant.*
|
||||
|
||||
# Exceptions to above rules.
|
||||
!default.mode1v3
|
||||
!default.mode2v3
|
||||
!default.pbxuser
|
||||
!default.perspectivev3
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>App</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>io.flutter.flutter.app</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>App</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>12.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,2 @@
|
||||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||
#include "Generated.xcconfig"
|
||||
@@ -0,0 +1,2 @@
|
||||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||
#include "Generated.xcconfig"
|
||||
46
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/example/ios/Podfile
Normal file
@@ -0,0 +1,46 @@
|
||||
# Add Aliyun specs as per official docs
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
source 'https://github.com/aliyun/aliyun-specs.git'
|
||||
# Uncomment this line to define a global platform for your project
|
||||
# platform :ios, '12.0'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
|
||||
project 'Runner', {
|
||||
'Debug' => :debug,
|
||||
'Profile' => :release,
|
||||
'Release' => :release,
|
||||
}
|
||||
|
||||
def flutter_root
|
||||
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
|
||||
unless File.exist?(generated_xcode_build_settings_path)
|
||||
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
|
||||
end
|
||||
|
||||
File.foreach(generated_xcode_build_settings_path) do |line|
|
||||
matches = line.match(/FLUTTER_ROOT\=(.*)/)
|
||||
return matches[1].strip if matches
|
||||
end
|
||||
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
|
||||
end
|
||||
|
||||
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
|
||||
|
||||
flutter_ios_podfile_setup
|
||||
|
||||
target 'Runner' do
|
||||
use_frameworks!
|
||||
|
||||
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
|
||||
target 'RunnerTests' do
|
||||
inherit! :search_paths
|
||||
end
|
||||
end
|
||||
|
||||
post_install do |installer|
|
||||
installer.pods_project.targets.each do |target|
|
||||
flutter_additional_ios_build_settings(target)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,724 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
2F8C6B535D6BDE9646E5ABE5 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10D15B669AF1C99B57E43B43 /* Pods_RunnerTests.framework */; };
|
||||
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
9CB7CB3429314F19B9D43685 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F583D518126049D598B49FBF /* Pods_Runner.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
|
||||
remoteInfo = Runner;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
10D15B669AF1C99B57E43B43 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||
1BF067253F80E6DEA03389BE /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||
6472E8D8C7A005CEB4DE0D98 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
715A1CF31478D05406BD5672 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
724BA33E96AD9EA1919214E4 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||
85BE647325FA94F8E2A91E9E /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
D284A99258D04D8499E1C019 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
F583D518126049D598B49FBF /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
57D55860DD5AD711D2F8C8D5 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2F8C6B535D6BDE9646E5ABE5 /* Pods_RunnerTests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
9CB7CB3429314F19B9D43685 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
331C8082294A63A400263BE5 /* RunnerTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
331C807B294A618700263BE5 /* RunnerTests.swift */,
|
||||
);
|
||||
path = RunnerTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
584D4251140799232753D0E9 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
85BE647325FA94F8E2A91E9E /* Pods-Runner.debug.xcconfig */,
|
||||
1BF067253F80E6DEA03389BE /* Pods-Runner.release.xcconfig */,
|
||||
715A1CF31478D05406BD5672 /* Pods-Runner.profile.xcconfig */,
|
||||
D284A99258D04D8499E1C019 /* Pods-RunnerTests.debug.xcconfig */,
|
||||
724BA33E96AD9EA1919214E4 /* Pods-RunnerTests.release.xcconfig */,
|
||||
6472E8D8C7A005CEB4DE0D98 /* Pods-RunnerTests.profile.xcconfig */,
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6CF37BC747C4841363DA14E4 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F583D518126049D598B49FBF /* Pods_Runner.framework */,
|
||||
10D15B669AF1C99B57E43B43 /* Pods_RunnerTests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
||||
);
|
||||
name = Flutter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146E51CF9000F007C117D = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9740EEB11CF90186004384FC /* Flutter */,
|
||||
97C146F01CF9000F007C117D /* Runner */,
|
||||
97C146EF1CF9000F007C117D /* Products */,
|
||||
331C8082294A63A400263BE5 /* RunnerTests */,
|
||||
584D4251140799232753D0E9 /* Pods */,
|
||||
6CF37BC747C4841363DA14E4 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146EF1CF9000F007C117D /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
97C146EE1CF9000F007C117D /* Runner.app */,
|
||||
331C8081294A63A400263BE5 /* RunnerTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146F01CF9000F007C117D /* Runner */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
||||
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
|
||||
97C147021CF9000F007C117D /* Info.plist */,
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
|
||||
);
|
||||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
331C8080294A63A400263BE5 /* RunnerTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||
buildPhases = (
|
||||
1CFC6FCC6DFE1CEE95F50D7B /* [CP] Check Pods Manifest.lock */,
|
||||
331C807D294A63A400263BE5 /* Sources */,
|
||||
331C807F294A63A400263BE5 /* Resources */,
|
||||
57D55860DD5AD711D2F8C8D5 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
331C8086294A63A400263BE5 /* PBXTargetDependency */,
|
||||
);
|
||||
name = RunnerTests;
|
||||
productName = RunnerTests;
|
||||
productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
97C146ED1CF9000F007C117D /* Runner */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
AB32AC629D1244FC05BABC9D /* [CP] Check Pods Manifest.lock */,
|
||||
9740EEB61CF901F6004384FC /* Run Script */,
|
||||
97C146EA1CF9000F007C117D /* Sources */,
|
||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||
97C146EC1CF9000F007C117D /* Resources */,
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Runner;
|
||||
productName = Runner;
|
||||
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
97C146E61CF9000F007C117D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 1510;
|
||||
ORGANIZATIONNAME = "";
|
||||
TargetAttributes = {
|
||||
331C8080294A63A400263BE5 = {
|
||||
CreatedOnToolsVersion = 14.0;
|
||||
TestTargetID = 97C146ED1CF9000F007C117D;
|
||||
};
|
||||
97C146ED1CF9000F007C117D = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
LastSwiftMigration = 1100;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 97C146E51CF9000F007C117D;
|
||||
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
97C146ED1CF9000F007C117D /* Runner */,
|
||||
331C8080294A63A400263BE5 /* RunnerTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
331C807F294A63A400263BE5 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
97C146EC1CF9000F007C117D /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
1CFC6FCC6DFE1CEE95F50D7B /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
|
||||
);
|
||||
name = "Thin Binary";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||
};
|
||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Run Script";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||
};
|
||||
AB32AC629D1244FC05BABC9D /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
331C807D294A63A400263BE5 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
97C146EA1CF9000F007C117D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 97C146ED1CF9000F007C117D /* Runner */;
|
||||
targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
97C146FB1CF9000F007C117D /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
97C147001CF9000F007C117D /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
249021D3217E4FDB00AE95B9 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
249021D4217E4FDB00AE95B9 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = VSW2PKYTD7;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.aliyun.emasdemo.httpdns;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = EMAS_HTTPDNS_IOS_DEMO_DEV;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
331C8088294A63A400263BE5 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = D284A99258D04D8499E1C019 /* Pods-RunnerTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.httpdnsFlutterDemo.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
331C8089294A63A400263BE5 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 724BA33E96AD9EA1919214E4 /* Pods-RunnerTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.httpdnsFlutterDemo.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
331C808A294A63A400263BE5 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 6472E8D8C7A005CEB4DE0D98 /* Pods-RunnerTests.profile.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.httpdnsFlutterDemo.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
97C147031CF9000F007C117D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
97C147041CF9000F007C117D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
97C147061CF9000F007C117D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = VSW2PKYTD7;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.aliyun.emasdemo.httpdns;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = EMAS_HTTPDNS_IOS_DEMO_DEV;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
97C147071CF9000F007C117D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = VSW2PKYTD7;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.aliyun.emasdemo.httpdns;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = EMAS_HTTPDNS_IOS_DEMO_DEV;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
331C8088294A63A400263BE5 /* Debug */,
|
||||
331C8089294A63A400263BE5 /* Release */,
|
||||
331C808A294A63A400263BE5 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
97C147031CF9000F007C117D /* Debug */,
|
||||
97C147041CF9000F007C117D /* Release */,
|
||||
249021D3217E4FDB00AE95B9 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
97C147061CF9000F007C117D /* Debug */,
|
||||
97C147071CF9000F007C117D /* Release */,
|
||||
249021D4217E4FDB00AE95B9 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1510"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO"
|
||||
parallelizable = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "331C8080294A63A400263BE5"
|
||||
BuildableName = "RunnerTests.xctest"
|
||||
BlueprintName = "RunnerTests"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
enableGPUValidationMode = "1"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Profile"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
10
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/example/ios/Runner.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,15 @@
|
||||
import Flutter
|
||||
import UIKit
|
||||
|
||||
@main
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
GeneratedPluginRegistrant.register(with: self)
|
||||
|
||||
// No custom platform channels needed
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "Icon-App-1024x1024@1x.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 295 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 450 B |
|
After Width: | Height: | Size: 282 B |
|
After Width: | Height: | Size: 462 B |
|
After Width: | Height: | Size: 704 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 586 B |
|
After Width: | Height: | Size: 862 B |
|
After Width: | Height: | Size: 862 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 762 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 68 B |
|
After Width: | Height: | Size: 68 B |
|
After Width: | Height: | Size: 68 B |
@@ -0,0 +1,5 @@
|
||||
# Launch Screen Assets
|
||||
|
||||
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
|
||||
|
||||
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
|
||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="LaunchImage" width="168" height="185"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Flutter View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Httpdns Flutter Demo</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>httpdns_flutter_demo</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1 @@
|
||||
#import "GeneratedPluginRegistrant.h"
|
||||
@@ -0,0 +1,12 @@
|
||||
import Flutter
|
||||
import UIKit
|
||||
import XCTest
|
||||
|
||||
class RunnerTests: XCTestCase {
|
||||
|
||||
func testExample() {
|
||||
// If you add code to the Runner application, consider adding tests here.
|
||||
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
|
||||
}
|
||||
|
||||
}
|
||||
389
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/example/lib/main.dart
Normal file
@@ -0,0 +1,389 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'net/httpdns_http_client_adapter.dart';
|
||||
import 'package:aliyun_httpdns/aliyun_httpdns.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
|
||||
// This widget is the root of your application.
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'HTTP Request Demo',
|
||||
theme: ThemeData(
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
||||
useMaterial3: true,
|
||||
),
|
||||
home: const MyHomePage(title: 'HTTP Request Demo'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget {
|
||||
const MyHomePage({super.key, required this.title});
|
||||
|
||||
final String title;
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
enum NetworkLibrary {
|
||||
dio('Dio'),
|
||||
httpClient('HttpClient'),
|
||||
httpPackage('http');
|
||||
|
||||
const NetworkLibrary(this.displayName);
|
||||
final String displayName;
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
final TextEditingController _urlController = TextEditingController();
|
||||
String _responseText = 'Response will appear here...';
|
||||
bool _isLoading = false;
|
||||
|
||||
late final Dio _dio;
|
||||
late final HttpClient _httpClient;
|
||||
late final http.Client _httpPackageClient;
|
||||
|
||||
NetworkLibrary _selectedLibrary = NetworkLibrary.dio;
|
||||
|
||||
bool _httpdnsReady = false;
|
||||
bool _httpdnsIniting = false;
|
||||
|
||||
Future<void> _initHttpDnsOnce() async {
|
||||
if (_httpdnsReady || _httpdnsIniting) return;
|
||||
_httpdnsIniting = true;
|
||||
try {
|
||||
await AliyunHttpdns.init(
|
||||
accountId: 000000, // 请替换为您的 Account ID
|
||||
secretKey: 'your_secret_key_here', // 请替换为您的 Secret Key
|
||||
);
|
||||
await AliyunHttpdns.setHttpsRequestEnabled(true);
|
||||
await AliyunHttpdns.setLogEnabled(true);
|
||||
await AliyunHttpdns.setPersistentCacheIPEnabled(true);
|
||||
await AliyunHttpdns.setReuseExpiredIPEnabled(true);
|
||||
await AliyunHttpdns.build();
|
||||
|
||||
// 先build再执行解析相关动作
|
||||
final preResolveHosts = 'www.aliyun.com';
|
||||
await AliyunHttpdns.setPreResolveHosts([preResolveHosts], ipType: 'both');
|
||||
debugPrint('[httpdns] pre-resolve scheduled for host=$preResolveHosts');
|
||||
_httpdnsReady = true;
|
||||
} catch (e) {
|
||||
debugPrint('[httpdns] init failed: $e');
|
||||
} finally {
|
||||
_httpdnsIniting = false;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// 设置默认的API URL用于演示
|
||||
_urlController.text = 'https://www.aliyun.com';
|
||||
|
||||
// 仅首次进入页面时初始化 HTTPDNS
|
||||
_initHttpDnsOnce();
|
||||
|
||||
// 先初始化HTTPDNS再初始化Dio
|
||||
_dio = Dio();
|
||||
_dio.httpClientAdapter = buildHttpdnsHttpClientAdapter();
|
||||
_dio.options.headers['Connection'] = 'keep-alive';
|
||||
|
||||
_httpClient = buildHttpdnsNativeHttpClient();
|
||||
_httpPackageClient = buildHttpdnsHttpPackageClient();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_urlController.dispose();
|
||||
_httpClient.close();
|
||||
_httpPackageClient.close();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _sendHttpRequest() async {
|
||||
if (_urlController.text.isEmpty) {
|
||||
setState(() {
|
||||
_responseText = 'Error: Please enter a URL';
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
_responseText = 'Sending request...';
|
||||
});
|
||||
|
||||
final uri = Uri.parse(_urlController.text);
|
||||
|
||||
try {
|
||||
final String libraryName = _selectedLibrary.displayName;
|
||||
debugPrint('[$libraryName] Sending request to ${uri.host}:${uri.port}');
|
||||
|
||||
int statusCode;
|
||||
Map<String, String> headers;
|
||||
String body;
|
||||
|
||||
switch (_selectedLibrary) {
|
||||
case NetworkLibrary.dio:
|
||||
final response = await _dio.getUri(
|
||||
uri,
|
||||
options: Options(
|
||||
responseType: ResponseType.plain,
|
||||
followRedirects: true,
|
||||
validateStatus: (_) => true,
|
||||
),
|
||||
);
|
||||
statusCode = response.statusCode ?? 0;
|
||||
headers = {
|
||||
for (final e in response.headers.map.entries)
|
||||
e.key: e.value.join(','),
|
||||
};
|
||||
body = response.data is String
|
||||
? response.data as String
|
||||
: jsonEncode(response.data);
|
||||
break;
|
||||
|
||||
case NetworkLibrary.httpClient:
|
||||
final request = await _httpClient.getUrl(uri);
|
||||
final response = await request.close();
|
||||
statusCode = response.statusCode;
|
||||
headers = {};
|
||||
response.headers.forEach((name, values) {
|
||||
headers[name] = values.join(',');
|
||||
});
|
||||
body = await response.transform(utf8.decoder).join();
|
||||
break;
|
||||
|
||||
case NetworkLibrary.httpPackage:
|
||||
final response = await _httpPackageClient.get(uri);
|
||||
statusCode = response.statusCode;
|
||||
headers = response.headers;
|
||||
body = response.body;
|
||||
break;
|
||||
}
|
||||
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
|
||||
final StringBuffer responseInfo = StringBuffer();
|
||||
|
||||
responseInfo.writeln('=== REQUEST ($libraryName) ===');
|
||||
responseInfo.writeln('uri: ${uri.toString()}');
|
||||
responseInfo.writeln();
|
||||
|
||||
responseInfo.writeln('=== STATUS ===');
|
||||
responseInfo.writeln('statusCode: $statusCode');
|
||||
responseInfo.writeln();
|
||||
|
||||
responseInfo.writeln('=== HEADERS ===');
|
||||
headers.forEach((key, value) {
|
||||
responseInfo.writeln('$key: $value');
|
||||
});
|
||||
responseInfo.writeln();
|
||||
|
||||
responseInfo.writeln('=== BODY ===');
|
||||
if (statusCode >= 200 && statusCode < 300) {
|
||||
try {
|
||||
final jsonData = json.decode(body);
|
||||
const encoder = JsonEncoder.withIndent(' ');
|
||||
responseInfo.write(encoder.convert(jsonData));
|
||||
} catch (_) {
|
||||
responseInfo.write(body);
|
||||
}
|
||||
} else {
|
||||
responseInfo.write(body);
|
||||
}
|
||||
|
||||
_responseText = responseInfo.toString();
|
||||
});
|
||||
} catch (e) {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
_responseText = 'Network Error: $e';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 使用 HTTPDNS 解析当前 URL 的 host 并显示结果
|
||||
Future<void> _testHttpDnsResolve() async {
|
||||
final text = _urlController.text.trim();
|
||||
if (text.isEmpty) {
|
||||
setState(() {
|
||||
_responseText = 'Error: Please enter a URL';
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
final Uri uri;
|
||||
try {
|
||||
uri = Uri.parse(text);
|
||||
} catch (_) {
|
||||
setState(() {
|
||||
_responseText = 'Error: Invalid URL';
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
_responseText = 'Resolving with HTTPDNS...';
|
||||
});
|
||||
|
||||
try {
|
||||
// 确保只初始化一次
|
||||
await _initHttpDnsOnce();
|
||||
final res = await AliyunHttpdns.resolveHostSyncNonBlocking(
|
||||
uri.host,
|
||||
ipType: 'both',
|
||||
);
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
final buf = StringBuffer();
|
||||
buf.writeln('=== HTTPDNS RESOLVE ===');
|
||||
buf.writeln('host: ${uri.host}');
|
||||
final ipv4 = (res['ipv4'] as List?)?.cast<String>() ?? const <String>[];
|
||||
final ipv6 = (res['ipv6'] as List?)?.cast<String>() ?? const <String>[];
|
||||
if (ipv4.isNotEmpty) buf.writeln('IPv4 list: ${ipv4.join(', ')}');
|
||||
if (ipv6.isNotEmpty) buf.writeln('IPv6 list: ${ipv6.join(', ')}');
|
||||
_responseText = buf.toString();
|
||||
});
|
||||
} catch (e) {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
_responseText = 'HTTPDNS Error: $e';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
|
||||
title: Text(widget.title),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// URL输入框
|
||||
TextField(
|
||||
controller: _urlController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Enter URL',
|
||||
hintText: 'https://www.aliyun.com',
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.link),
|
||||
),
|
||||
keyboardType: TextInputType.url,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: _isLoading ? null : _sendHttpRequest,
|
||||
icon: _isLoading
|
||||
? const SizedBox(
|
||||
width: 20,
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(Icons.send),
|
||||
label: Text(_isLoading ? 'Sending...' : 'Send Request'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: DropdownButton<NetworkLibrary>(
|
||||
value: _selectedLibrary,
|
||||
isExpanded: true,
|
||||
underline: const SizedBox(),
|
||||
icon: const Icon(Icons.arrow_drop_down),
|
||||
items: NetworkLibrary.values.map((library) {
|
||||
return DropdownMenuItem<NetworkLibrary>(
|
||||
value: library,
|
||||
child: Text(library.displayName),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: _isLoading
|
||||
? null
|
||||
: (NetworkLibrary? newValue) {
|
||||
if (newValue != null) {
|
||||
setState(() {
|
||||
_selectedLibrary = newValue;
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// HTTPDNS 解析按钮
|
||||
ElevatedButton.icon(
|
||||
onPressed: _isLoading ? null : _testHttpDnsResolve,
|
||||
icon: const Icon(Icons.dns),
|
||||
label: const Text('HTTPDNS Resolve'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 保留空白分隔
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 响应文本显示区域
|
||||
Expanded(
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
color: Colors.grey.shade50,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Text(
|
||||
_responseText,
|
||||
style: const TextStyle(
|
||||
fontFamily: 'monospace',
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dio/io.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/io_client.dart';
|
||||
import 'package:aliyun_httpdns/aliyun_httpdns.dart';
|
||||
|
||||
/* *
|
||||
* 构建带 HTTPDNS 能力的 IOHttpClientAdapter
|
||||
*
|
||||
* 本方案由EMAS团队设计实现,参考请注明出处。
|
||||
*/
|
||||
|
||||
IOHttpClientAdapter buildHttpdnsHttpClientAdapter() {
|
||||
final HttpClient client = HttpClient();
|
||||
_configureHttpClient(client);
|
||||
|
||||
_configureConnectionFactory(client);
|
||||
|
||||
final IOHttpClientAdapter adapter = IOHttpClientAdapter(
|
||||
createHttpClient: () => client,
|
||||
)..validateCertificate = (cert, host, port) => true;
|
||||
return adapter;
|
||||
}
|
||||
|
||||
HttpClient buildHttpdnsNativeHttpClient() {
|
||||
final HttpClient client = HttpClient();
|
||||
_configureHttpClient(client);
|
||||
_configureConnectionFactory(client);
|
||||
return client;
|
||||
}
|
||||
|
||||
http.Client buildHttpdnsHttpPackageClient() {
|
||||
final HttpClient httpClient = buildHttpdnsNativeHttpClient();
|
||||
return IOClient(httpClient);
|
||||
}
|
||||
|
||||
// HttpClient 基础配置
|
||||
void _configureHttpClient(HttpClient client) {
|
||||
client.findProxy = (Uri _) => 'DIRECT';
|
||||
client.idleTimeout = const Duration(seconds: 90);
|
||||
client.maxConnectionsPerHost = 8;
|
||||
}
|
||||
|
||||
// 配置基于 HTTPDNS 的连接工厂
|
||||
void _configureConnectionFactory(HttpClient client) {
|
||||
client
|
||||
.connectionFactory = (Uri uri, String? proxyHost, int? proxyPort) async {
|
||||
final String domain = uri.host;
|
||||
final bool https = uri.scheme.toLowerCase() == 'https';
|
||||
final int port = uri.port == 0 ? (https ? 443 : 80) : uri.port;
|
||||
|
||||
final List<InternetAddress> targets = await _resolveTargets(domain);
|
||||
final Object target = targets.isNotEmpty ? targets.first : domain;
|
||||
|
||||
if (!https) {
|
||||
return Socket.startConnect(target, port);
|
||||
}
|
||||
|
||||
// HTTPS:先 TCP,再 TLS(SNI=域名),并保持可取消
|
||||
bool cancelled = false;
|
||||
final Future<ConnectionTask<Socket>> rawStart = Socket.startConnect(
|
||||
target,
|
||||
port,
|
||||
);
|
||||
final Future<Socket> upgraded = rawStart.then((task) async {
|
||||
final Socket raw = await task.socket;
|
||||
if (cancelled) {
|
||||
raw.destroy();
|
||||
throw const SocketException('Connection cancelled');
|
||||
}
|
||||
final SecureSocket secure = await SecureSocket.secure(raw, host: domain);
|
||||
if (cancelled) {
|
||||
secure.destroy();
|
||||
throw const SocketException('Connection cancelled');
|
||||
}
|
||||
return secure;
|
||||
});
|
||||
return ConnectionTask.fromSocket(upgraded, () {
|
||||
cancelled = true;
|
||||
try {
|
||||
rawStart.then((t) => t.cancel());
|
||||
} catch (_) {}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// 通过 HTTPDNS 解析目标 IP 列表;IPv4 优先;失败则返回空列表(上层回退系统 DNS)
|
||||
Future<List<InternetAddress>> _resolveTargets(String domain) async {
|
||||
try {
|
||||
final res = await AliyunHttpdns.resolveHostSyncNonBlocking(
|
||||
domain,
|
||||
ipType: 'both',
|
||||
);
|
||||
final List<String> ipv4 =
|
||||
(res['ipv4'] as List?)?.cast<String>() ?? const <String>[];
|
||||
final List<String> ipv6 =
|
||||
(res['ipv6'] as List?)?.cast<String>() ?? const <String>[];
|
||||
final List<InternetAddress> targets = [
|
||||
...ipv4.map(InternetAddress.tryParse).whereType<InternetAddress>(),
|
||||
...ipv6.map(InternetAddress.tryParse).whereType<InternetAddress>(),
|
||||
];
|
||||
if (targets.isEmpty) {
|
||||
debugPrint('[HTTPDNS] no result for $domain, fallback to system DNS');
|
||||
} else {
|
||||
debugPrint('[HTTPDNS] resolved $domain -> ${targets.first.address}');
|
||||
}
|
||||
return targets;
|
||||
} catch (e) {
|
||||
debugPrint('[HTTPDNS] resolve failed: $e, fallback to system DNS');
|
||||
return const <InternetAddress>[];
|
||||
}
|
||||
}
|
||||
292
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/example/pubspec.lock
Normal file
@@ -0,0 +1,292 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
aliyun_httpdns:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "1.0.0"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.13.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.0"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.19.1"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cupertino_icons
|
||||
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.8"
|
||||
dio:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: dio
|
||||
sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.9.0"
|
||||
dio_web_adapter:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dio_web_adapter
|
||||
sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.3"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: flutter_lints
|
||||
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.0.0"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
http:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: http
|
||||
sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.5.0"
|
||||
http2:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: http2
|
||||
sha256: "382d3aefc5bd6dc68c6b892d7664f29b5beb3251611ae946a98d35158a82bbfa"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.1"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_parser
|
||||
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.2"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.0.9"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.9"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_testing
|
||||
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.1.1"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.17"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.11.1"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.16.0"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: mime
|
||||
sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.9.1"
|
||||
plugin_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: plugin_platform_interface
|
||||
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.8"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.1"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.12.1"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.1"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.2"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.4"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.0"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "15.0.0"
|
||||
web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web
|
||||
sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
sdks:
|
||||
dart: ">=3.7.0-0 <4.0.0"
|
||||
flutter: ">=3.18.0-18.0.pre.54"
|
||||
28
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/example/pubspec.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
name: aliyun_httpdns_example
|
||||
description: "Demonstrates how to use the aliyun_httpdns plugin."
|
||||
publish_to: 'none'
|
||||
|
||||
environment:
|
||||
sdk: ">=2.18.5 <4.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
aliyun_httpdns:
|
||||
# When depending on this package from a real application you should use:
|
||||
# aliyun_httpdns: ^x.y.z
|
||||
# The example app is bundled with the plugin so we use a path dependency on
|
||||
# the parent directory to use the current plugin's version.
|
||||
path: ../
|
||||
cupertino_icons: ^1.0.8
|
||||
dio: ^5.9.0
|
||||
http: ^1.2.0
|
||||
http2: ^2.3.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_lints: ^5.0.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
@@ -0,0 +1,203 @@
|
||||
import Flutter
|
||||
import UIKit
|
||||
import AlicloudHTTPDNS
|
||||
|
||||
public class AliyunHttpDnsPlugin: NSObject, FlutterPlugin {
|
||||
private var channel: FlutterMethodChannel!
|
||||
|
||||
// Desired states saved until build()
|
||||
private var desiredAccountId: Int?
|
||||
private var desiredSecretKey: String?
|
||||
private var desiredAesSecretKey: String?
|
||||
|
||||
private var desiredPersistentCacheEnabled: Bool?
|
||||
private var desiredDiscardExpiredAfterSeconds: Int?
|
||||
private var desiredReuseExpiredIPEnabled: Bool?
|
||||
private var desiredLogEnabled: Bool?
|
||||
private var desiredHttpsEnabled: Bool?
|
||||
private var desiredPreResolveAfterNetworkChanged: Bool?
|
||||
private var desiredIPRankingMap: [String: NSNumber]?
|
||||
|
||||
|
||||
|
||||
public static func register(with registrar: FlutterPluginRegistrar) {
|
||||
let channel = FlutterMethodChannel(name: "aliyun_httpdns", binaryMessenger: registrar.messenger())
|
||||
let instance = AliyunHttpDnsPlugin()
|
||||
instance.channel = channel
|
||||
registrar.addMethodCallDelegate(instance, channel: channel)
|
||||
}
|
||||
|
||||
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
switch call.method {
|
||||
// Dart: init(accountId, secretKey?, aesSecretKey?) — only save desired state
|
||||
case "initialize":
|
||||
let options = call.arguments as? [String: Any] ?? [:]
|
||||
let accountIdAny = options["accountId"]
|
||||
let secretKey = options["secretKey"] as? String
|
||||
let aesSecretKey = options["aesSecretKey"] as? String
|
||||
|
||||
guard let accountId = (accountIdAny as? Int) ?? Int((accountIdAny as? String) ?? "") else {
|
||||
NSLog("AliyunHttpDns: initialize missing accountId")
|
||||
result(false)
|
||||
return
|
||||
}
|
||||
desiredAccountId = accountId
|
||||
desiredSecretKey = secretKey
|
||||
desiredAesSecretKey = aesSecretKey
|
||||
NSLog("AliyunHttpDns: initialize saved accountId=\(accountId)")
|
||||
result(true)
|
||||
|
||||
|
||||
|
||||
// Dart: setLogEnabled(enabled) — save desired
|
||||
case "setLogEnabled":
|
||||
let args = call.arguments as? [String: Any]
|
||||
let enabled = (args?["enabled"] as? Bool) ?? false
|
||||
desiredLogEnabled = enabled
|
||||
NSLog("AliyunHttpDns: log desired=\(enabled)")
|
||||
result(nil)
|
||||
|
||||
case "setHttpsRequestEnabled":
|
||||
let args = call.arguments as? [String: Any]
|
||||
let enabled = (args?["enabled"] as? Bool) ?? false
|
||||
desiredHttpsEnabled = enabled
|
||||
NSLog("AliyunHttpDns: https request desired=\(enabled)")
|
||||
result(nil)
|
||||
|
||||
// Dart: setPersistentCacheIPEnabled(enabled, discardExpiredAfterSeconds?) — save desired
|
||||
case "setPersistentCacheIPEnabled":
|
||||
let args = call.arguments as? [String: Any]
|
||||
let enabled = (args?["enabled"] as? Bool) ?? false
|
||||
let discard = args?["discardExpiredAfterSeconds"] as? Int
|
||||
desiredPersistentCacheEnabled = enabled
|
||||
desiredDiscardExpiredAfterSeconds = discard
|
||||
NSLog("AliyunHttpDns: persistent cache desired=\(enabled) discard=\(discard ?? -1)")
|
||||
result(nil)
|
||||
|
||||
// Dart: setReuseExpiredIPEnabled(enabled) — save desired
|
||||
case "setReuseExpiredIPEnabled":
|
||||
let args = call.arguments as? [String: Any]
|
||||
let enabled = (args?["enabled"] as? Bool) ?? false
|
||||
desiredReuseExpiredIPEnabled = enabled
|
||||
NSLog("AliyunHttpDns: reuse expired ip desired=\(enabled)")
|
||||
result(nil)
|
||||
|
||||
case "setPreResolveAfterNetworkChanged":
|
||||
let args = call.arguments as? [String: Any]
|
||||
let enabled = (args?["enabled"] as? Bool) ?? false
|
||||
desiredPreResolveAfterNetworkChanged = enabled
|
||||
NSLog("AliyunHttpDns: preResolveAfterNetworkChanged desired=\(enabled)")
|
||||
result(nil)
|
||||
|
||||
case "setIPRankingList":
|
||||
let args = call.arguments as? [String: Any]
|
||||
let hostPortMap = args?["hostPortMap"] as? [String: NSNumber]
|
||||
desiredIPRankingMap = hostPortMap
|
||||
NSLog("AliyunHttpDns: IP ranking list desired, hosts=\(hostPortMap?.keys.joined(separator: ", ") ?? "")")
|
||||
result(nil)
|
||||
|
||||
case "setPreResolveHosts":
|
||||
let args = call.arguments as? [String: Any]
|
||||
let hosts = (args?["hosts"] as? [String]) ?? []
|
||||
let ipTypeStr = (args?["ipType"] as? String) ?? "auto"
|
||||
switch ipTypeStr.lowercased() {
|
||||
case "ipv4", "v4":
|
||||
HttpDnsService.sharedInstance().setPreResolveHosts(hosts, queryIPType: AlicloudHttpDNS_IPType.init(0))
|
||||
case "ipv6", "v6":
|
||||
HttpDnsService.sharedInstance().setPreResolveHosts(hosts, queryIPType: AlicloudHttpDNS_IPType.init(1))
|
||||
case "both", "64":
|
||||
HttpDnsService.sharedInstance().setPreResolveHosts(hosts, queryIPType: AlicloudHttpDNS_IPType.init(2))
|
||||
default:
|
||||
HttpDnsService.sharedInstance().setPreResolveHosts(hosts)
|
||||
}
|
||||
result(nil)
|
||||
|
||||
case "getSessionId":
|
||||
let sid = HttpDnsService.sharedInstance().getSessionId()
|
||||
result(sid)
|
||||
|
||||
case "cleanAllHostCache":
|
||||
HttpDnsService.sharedInstance().cleanAllHostCache()
|
||||
result(nil)
|
||||
|
||||
// Dart: build() — construct service and apply desired states
|
||||
case "build":
|
||||
guard let accountId = desiredAccountId else {
|
||||
result(false)
|
||||
return
|
||||
}
|
||||
// Initialize singleton
|
||||
if let secret = desiredSecretKey, !secret.isEmpty {
|
||||
if let aes = desiredAesSecretKey, !aes.isEmpty {
|
||||
_ = HttpDnsService(accountID: accountId, secretKey: secret, aesSecretKey: aes)
|
||||
} else {
|
||||
_ = HttpDnsService(accountID: accountId, secretKey: secret)
|
||||
}
|
||||
} else {
|
||||
_ = HttpDnsService(accountID: accountId) // deprecated but acceptable fallback
|
||||
}
|
||||
let svc = HttpDnsService.sharedInstance()
|
||||
// Apply desired runtime flags
|
||||
if let enable = desiredPersistentCacheEnabled {
|
||||
if let discard = desiredDiscardExpiredAfterSeconds, discard >= 0 {
|
||||
svc.setPersistentCacheIPEnabled(enable, discardRecordsHasExpiredFor: TimeInterval(discard))
|
||||
} else {
|
||||
svc.setPersistentCacheIPEnabled(enable)
|
||||
}
|
||||
}
|
||||
if let enable = desiredReuseExpiredIPEnabled {
|
||||
svc.setReuseExpiredIPEnabled(enable)
|
||||
}
|
||||
if let enable = desiredLogEnabled {
|
||||
svc.setLogEnabled(enable)
|
||||
}
|
||||
if let enable = desiredHttpsEnabled {
|
||||
svc.setHTTPSRequestEnabled(enable)
|
||||
}
|
||||
|
||||
if let en = desiredPreResolveAfterNetworkChanged {
|
||||
svc.setPreResolveAfterNetworkChanged(en)
|
||||
}
|
||||
if let ipRankingMap = desiredIPRankingMap, !ipRankingMap.isEmpty {
|
||||
svc.setIPRankingDatasource(ipRankingMap)
|
||||
}
|
||||
NSLog("AliyunHttpDns: build completed accountId=\(accountId)")
|
||||
result(true)
|
||||
|
||||
// Dart: resolveHostSyncNonBlocking(hostname, ipType, sdnsParams?, cacheKey?)
|
||||
case "resolveHostSyncNonBlocking":
|
||||
guard let args = call.arguments as? [String: Any], let host = args["hostname"] as? String else {
|
||||
result(["ipv4": [], "ipv6": []])
|
||||
return
|
||||
}
|
||||
let ipTypeStr = (args["ipType"] as? String) ?? "auto"
|
||||
let sdnsParams = args["sdnsParams"] as? [String: String]
|
||||
let cacheKey = args["cacheKey"] as? String
|
||||
let type: HttpdnsQueryIPType
|
||||
switch ipTypeStr.lowercased() {
|
||||
case "ipv4", "v4": type = .ipv4
|
||||
case "ipv6", "v6": type = .ipv6
|
||||
case "both", "64": type = .both
|
||||
default: type = .auto
|
||||
}
|
||||
let svc = HttpDnsService.sharedInstance()
|
||||
var v4: [String] = []
|
||||
var v6: [String] = []
|
||||
if let params = sdnsParams, let key = cacheKey, let r = svc.resolveHostSyncNonBlocking(host, by: type, withSdnsParams: params, sdnsCacheKey: key) {
|
||||
if r.hasIpv4Address() { v4 = r.ips }
|
||||
if r.hasIpv6Address() { v6 = r.ipv6s }
|
||||
} else if let r = svc.resolveHostSyncNonBlocking(host, by: type) {
|
||||
if r.hasIpv4Address() { v4 = r.ips }
|
||||
if r.hasIpv6Address() { v6 = r.ipv6s }
|
||||
}
|
||||
result(["ipv4": v4, "ipv6": v6])
|
||||
|
||||
// Legacy methods removed: preResolve / clearCache
|
||||
|
||||
default:
|
||||
result(FlutterMethodNotImplemented)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
|
||||
# Run `pod lib lint aliyun_httpdns.podspec` to validate before publishing.
|
||||
#
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'aliyun_httpdns'
|
||||
s.version = '1.0.2'
|
||||
s.summary = 'aliyun httpdns flutter plugin'
|
||||
s.description = <<-DESC
|
||||
aliyun httpdns flutter plugin.
|
||||
DESC
|
||||
s.homepage = 'https://help.aliyun.com/document_detail/435220.html'
|
||||
s.license = { :file => '../LICENSE' }
|
||||
s.author = { 'Aliyun' => 'httpdns@alibaba-inc.com' }
|
||||
s.source = { :path => '.' }
|
||||
s.source_files = 'Classes/**/*'
|
||||
s.public_header_files = 'Classes/**/*.h'
|
||||
s.static_framework = true
|
||||
s.dependency 'Flutter'
|
||||
s.dependency 'AlicloudHTTPDNS', '3.4.0'
|
||||
s.platform = :ios, '10.0'
|
||||
|
||||
# Flutter.framework does not contain a i386 slice.
|
||||
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
|
||||
|
||||
# If your plugin requires a privacy manifest, for example if it uses any
|
||||
# required reason APIs, update the PrivacyInfo.xcprivacy file to describe your
|
||||
# plugin's privacy impact, and then uncomment this line. For more information,
|
||||
# see https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
|
||||
# s.resource_bundles = {'aliyun_httpdns_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
|
||||
end
|
||||
|
||||
|
||||
141
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/lib/aliyun_httpdns.dart
Normal file
@@ -0,0 +1,141 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class AliyunHttpdns {
|
||||
static const MethodChannel _channel = MethodChannel('aliyun_httpdns');
|
||||
|
||||
/// 1) 初始化:使用 accountId/secretKey/aesSecretKey
|
||||
static Future<bool> init({
|
||||
required int accountId,
|
||||
String? secretKey,
|
||||
String? aesSecretKey,
|
||||
}) async {
|
||||
final ok =
|
||||
await _channel.invokeMethod<bool>('initialize', <String, dynamic>{
|
||||
'accountId': accountId,
|
||||
if (secretKey != null) 'secretKey': secretKey,
|
||||
if (aesSecretKey != null) 'aesSecretKey': aesSecretKey,
|
||||
});
|
||||
return ok ?? false;
|
||||
}
|
||||
|
||||
/// 构建底层 service,只有在调用了 initialize / 一系列 setXxx 后,
|
||||
/// 调用本方法才会真正创建底层实例并应用配置
|
||||
static Future<bool> build() async {
|
||||
final ok = await _channel.invokeMethod<bool>('build');
|
||||
return ok ?? false;
|
||||
}
|
||||
|
||||
/// 2) 设置日志开关
|
||||
static Future<void> setLogEnabled(bool enabled) async {
|
||||
await _channel.invokeMethod<void>('setLogEnabled', <String, dynamic>{
|
||||
'enabled': enabled,
|
||||
});
|
||||
}
|
||||
|
||||
/// 3) 设置持久化缓存
|
||||
static Future<void> setPersistentCacheIPEnabled(bool enabled,
|
||||
{int? discardExpiredAfterSeconds}) async {
|
||||
await _channel
|
||||
.invokeMethod<void>('setPersistentCacheIPEnabled', <String, dynamic>{
|
||||
'enabled': enabled,
|
||||
if (discardExpiredAfterSeconds != null)
|
||||
'discardExpiredAfterSeconds': discardExpiredAfterSeconds,
|
||||
});
|
||||
}
|
||||
|
||||
/// 4) 是否允许复用过期 IP
|
||||
static Future<void> setReuseExpiredIPEnabled(bool enabled) async {
|
||||
await _channel
|
||||
.invokeMethod<void>('setReuseExpiredIPEnabled', <String, dynamic>{
|
||||
'enabled': enabled,
|
||||
});
|
||||
}
|
||||
|
||||
/// 设置是否使用 HTTPS 解析链路,避免明文流量被系统拦截
|
||||
static Future<void> setHttpsRequestEnabled(bool enabled) async {
|
||||
await _channel
|
||||
.invokeMethod<void>('setHttpsRequestEnabled', <String, dynamic>{
|
||||
'enabled': enabled,
|
||||
});
|
||||
}
|
||||
|
||||
/// 5) 伪异步解析:返回 IPv4/IPv6 数组
|
||||
/// 返回格式:{"ipv4": `List<String>`, "ipv6": `List<String>`}
|
||||
static Future<Map<String, List<String>>> resolveHostSyncNonBlocking(
|
||||
String hostname, {
|
||||
String ipType = 'auto', // auto/ipv4/ipv6/both
|
||||
Map<String, String>? sdnsParams,
|
||||
String? cacheKey,
|
||||
}) async {
|
||||
final Map<dynamic, dynamic>? res = await _channel
|
||||
.invokeMethod('resolveHostSyncNonBlocking', <String, dynamic>{
|
||||
'hostname': hostname,
|
||||
'ipType': ipType,
|
||||
if (sdnsParams != null) 'sdnsParams': sdnsParams,
|
||||
if (cacheKey != null) 'cacheKey': cacheKey,
|
||||
});
|
||||
final Map<String, List<String>> out = {
|
||||
'ipv4': <String>[],
|
||||
'ipv6': <String>[],
|
||||
};
|
||||
if (res == null) return out;
|
||||
final v4 = res['ipv4'];
|
||||
final v6 = res['ipv6'];
|
||||
if (v4 is List) {
|
||||
out['ipv4'] = v4.map((e) => e.toString()).toList();
|
||||
}
|
||||
if (v6 is List) {
|
||||
out['ipv6'] = v6.map((e) => e.toString()).toList();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
// 解析域名,返回 A/AAAA 记录等(保留旧接口以兼容,未在本任务使用)
|
||||
static Future<Map<String, dynamic>?> resolve(String hostname,
|
||||
{Map<String, dynamic>? options}) async {
|
||||
final res = await _channel.invokeMethod<Map<dynamic, dynamic>>('resolve', {
|
||||
'hostname': hostname,
|
||||
if (options != null) 'options': options,
|
||||
});
|
||||
return res?.map((key, value) => MapEntry(key.toString(), value));
|
||||
}
|
||||
|
||||
// 1) setPreResolveHosts: 传入 host 列表,native 侧调用 SDK 预解析
|
||||
static Future<void> setPreResolveHosts(List<String> hosts,
|
||||
{String ipType = 'auto'}) async {
|
||||
await _channel.invokeMethod<void>('setPreResolveHosts', <String, dynamic>{
|
||||
'hosts': hosts,
|
||||
'ipType': ipType,
|
||||
});
|
||||
}
|
||||
|
||||
// 2) setLogEnabled: 已有,同步保留(在此文件顶部已有 setLogEnabled 实现)
|
||||
|
||||
// 3) setPreResolveAfterNetworkChanged: 是否在网络切换时自动刷新解析
|
||||
static Future<void> setPreResolveAfterNetworkChanged(bool enabled) async {
|
||||
await _channel.invokeMethod<void>(
|
||||
'setPreResolveAfterNetworkChanged', <String, dynamic>{
|
||||
'enabled': enabled,
|
||||
});
|
||||
}
|
||||
|
||||
// 4) getSessionId: 获取会话 id
|
||||
static Future<String?> getSessionId() async {
|
||||
final sid = await _channel.invokeMethod<String>('getSessionId');
|
||||
return sid;
|
||||
}
|
||||
|
||||
// 5) cleanAllHostCache: 清除所有缓存
|
||||
static Future<void> cleanAllHostCache() async {
|
||||
await _channel.invokeMethod<void>('cleanAllHostCache');
|
||||
}
|
||||
|
||||
/// 设置 IP 优选列表
|
||||
/// [hostPortMap] 域名和端口的映射,例如:{'www.aliyun.com': 443}
|
||||
static Future<void> setIPRankingList(Map<String, int> hostPortMap) async {
|
||||
await _channel.invokeMethod<void>('setIPRankingList', <String, dynamic>{
|
||||
'hostPortMap': hostPortMap,
|
||||
});
|
||||
}
|
||||
}
|
||||
213
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/pubspec.lock
Normal file
@@ -0,0 +1,213 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.13.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.0"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.19.1"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.3"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: flutter_lints
|
||||
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.0.0"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.0.9"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.9"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_testing
|
||||
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.1.1"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.17"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.11.1"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.16.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.9.1"
|
||||
plugin_platform_interface:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: plugin_platform_interface
|
||||
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.8"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.1"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.12.1"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.1"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.2"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.4"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "15.0.0"
|
||||
sdks:
|
||||
dart: ">=3.7.0-0 <4.0.0"
|
||||
flutter: ">=3.18.0-18.0.pre.54"
|
||||
72
EdgeHttpDNS/sdk/flutter/aliyun_httpdns/pubspec.yaml
Normal file
@@ -0,0 +1,72 @@
|
||||
name: aliyun_httpdns
|
||||
description: "Aliyun HTTPDNS Flutter plugin."
|
||||
version: 1.0.2
|
||||
homepage: https://help.aliyun.com/document_detail/2584339.html
|
||||
|
||||
environment:
|
||||
sdk: ">=2.18.5 <4.0.0"
|
||||
flutter: '>=3.3.0'
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
plugin_platform_interface: ^2.0.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_lints: ^5.0.0
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
||||
# The following section is specific to Flutter packages.
|
||||
flutter:
|
||||
# This section identifies this Flutter project as a plugin project.
|
||||
# The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.)
|
||||
# which should be registered in the plugin registry. This is required for
|
||||
# using method channels.
|
||||
# The Android 'package' specifies package in which the registered class is.
|
||||
# This is required for using method channels on Android.
|
||||
# The 'ffiPlugin' specifies that native code should be built and bundled.
|
||||
# This is required for using `dart:ffi`.
|
||||
# All these are used by the tooling to maintain consistency when
|
||||
# adding or updating assets for this project.
|
||||
plugin:
|
||||
platforms:
|
||||
android:
|
||||
package: com.aliyun.ams.httpdns
|
||||
pluginClass: AliyunHttpDnsPlugin
|
||||
ios:
|
||||
pluginClass: AliyunHttpDnsPlugin
|
||||
|
||||
# To add assets to your plugin package, add an assets section, like this:
|
||||
# assets:
|
||||
# - images/a_dot_burr.jpeg
|
||||
# - images/a_dot_ham.jpeg
|
||||
#
|
||||
# For details regarding assets in packages, see
|
||||
# https://flutter.dev/to/asset-from-package
|
||||
#
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
# https://flutter.dev/to/resolution-aware-images
|
||||
|
||||
# To add custom fonts to your plugin package, add a fonts section here,
|
||||
# in this "flutter" section. Each entry in this list should have a
|
||||
# "family" key with the font family name, and a "fonts" key with a
|
||||
# list giving the asset and other descriptors for the font. For
|
||||
# example:
|
||||
# fonts:
|
||||
# - family: Schyler
|
||||
# fonts:
|
||||
# - asset: fonts/Schyler-Regular.ttf
|
||||
# - asset: fonts/Schyler-Italic.ttf
|
||||
# style: italic
|
||||
# - family: Trajan Pro
|
||||
# fonts:
|
||||
# - asset: fonts/TrajanPro.ttf
|
||||
# - asset: fonts/TrajanPro_Bold.ttf
|
||||
# weight: 700
|
||||
#
|
||||
# For details regarding fonts in packages, see
|
||||
# https://flutter.dev/to/font-from-package
|
||||