Skip to content

Commit a1ff8a7

Browse files
author
yangsen
committed
Merge branch 'master' of YangSen-qn:qiniu/android-sdk into develop
# Conflicts: # library/src/androidTest/java/com/qiniu/android/TestConfig.java
2 parents 02470de + bc39ba1 commit a1ff8a7

File tree

103 files changed

+1485
-555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1485
-555
lines changed

.idea/encodings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/scopes/scope_settings.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#Changelog
2+
3+
## 8.5.0(2022-08-25)
4+
* 支持自定义 request client
5+
* 升级 HappyDns 依赖至 v2.0.0
6+
27
## 8.4.4 (2022-06-02)
38
* 处理 Dns 预解析内存问题
49

@@ -14,7 +19,6 @@
1419
* 优化
1520
* SystemDns 解析:异步开线程池,降低高并发场景下对内存资源占用。
1621

17-
1822
## 8.4.0(2021-12-07)
1923
* 优化:
2024
* DNS 预解析支持 DoH (DNS over HTTPS)

QiNiu_Android.iml

Lines changed: 0 additions & 19 deletions
This file was deleted.

README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ https://github.com/qiniudemo/qiniu-lab-android
1515

1616
| Qiniu SDK 版本 | 最低 Android版本 | 依赖库版本 |
1717
|------------ |-----------------|------------------------|
18+
| 8.5.0 | Android 4.0+ | okhttp 4+ |
1819
| 8.4.* | Android 4.0+ | okhttp 4+ |
1920
| 8.3.2 | Android 4.0+ | okhttp 4+ |
2021
| 8.3.1 | Android 4.0+ | okhttp 4+ |
@@ -33,7 +34,7 @@ https://github.com/qiniudemo/qiniu-lab-android
3334
| 7.0.7 | Android 2.2+ | android-async-http 1.4.8 |
3435

3536
### 注意
36-
* 推荐使用最新版:8.4.4
37+
* 推荐使用最新版:8.5.0
3738
* 7.6.2 ~ 8.3.2 AndroidNetwork.getMobileDbm()可以获取手机信号强度,需要如下权限(API>=18时生效)
3839
```
3940
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
@@ -52,10 +53,10 @@ https://github.com/qiniudemo/qiniu-lab-android
5253
* Android Studio中添加dependencies 或者 在项目中添加maven依赖
5354
```
5455
// 1. 直接导入
55-
implementation 'com.qiniu:qiniu-android-sdk:8.4.+'
56+
implementation 'com.qiniu:qiniu-android-sdk:8.5.+'
5657
5758
// 2. 如果要修改okhttp依赖的版本,可采用以下方式(强烈建议使用七牛库依赖的okhttp版本)
58-
implementation ('com.qiniu:qiniu-android-sdk:8.4.+'){
59+
implementation ('com.qiniu:qiniu-android-sdk:8.5.+'){
5960
exclude (group: 'com.squareup.okhttp3', module: 'okhttp')
6061
}
6162
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
@@ -82,6 +83,32 @@ new UpCompletionHandler() {
8283
...
8384
```
8485

86+
### 支持使用 HTTP/3 协议发起请求
87+
88+
导入 [HTTP/3 client 插件](https://github.com/qiniu/qiniu-android-curl-plugin),http3 client 插件依赖于 Android SDK v8.5.0及以上版本
89+
90+
安装导入
91+
```java
92+
// 移除 qiniu-android-sdk 依赖 : implementation 'com.qiniu:qiniu-android-sdk:x.x.+'
93+
implementation 'com.qiniu:qiniu-android-curl-plugin:1.0.0'
94+
```
95+
96+
使用 CurlClient
97+
```java
98+
import com.qiniu.client.curl.CurlClient;
99+
import com.qiniu.android.storage.Configuration;
100+
import com.qiniu.android.storage.UploadManager;
101+
102+
// @param caPath: SSL 证书本地路径;如果想自定义 CA 可设置此选项,此处为 CA 文件的本地路径。
103+
// 如果未定义(caPath 配置 null)则使用 SDK 内部提供的 CA 证书,证书来源:https://curl.se/ca/cacert.pem
104+
CurlClient client = new CurlClient(caPath);
105+
Configuration config = new Configuration.Builder()
106+
.requestClient(client)
107+
.build();
108+
UploadManager manager = new UploadManager(config);
109+
```
110+
111+
85112
## 测试
86113

87114
``` bash

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ buildscript {
99
google()
1010
}
1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:3.5.2'
12+
classpath 'com.android.tools.build:gradle:3.6.4'
1313
// NOTE: Do not place your application dependencies here; they belong
1414
// in the individual module build.gradle files
1515
}

codecov.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
1-
coverage:
2-
precision: 2
3-
round: down
4-
status:
5-
patch:
6-
default:
7-
target: 80%
8-
project:
9-
default:
10-
target: 80%
1+
codecov:
2+
ci:
3+
- prow.qiniu.io # prow 里面运行需添加,其他 CI 不要
4+
require_ci_to_pass: no # 改为 no,否则 codecov 会等待其他 GitHub 上所有 CI 通过才会留言。
5+
6+
github_checks: #关闭github checks
7+
annotations: false
118

129
comment:
13-
layout: "header, diff, uncovered, files"
14-
behavior: default
10+
layout: "reach, diff, flags, files"
11+
behavior: new # 默认是更新旧留言,改为 new,删除旧的,增加新的。
12+
require_changes: false # if true: only post the comment if coverage changes
13+
require_base: no # [yes :: must have a base report to post]
14+
require_head: yes # [yes :: must have a head report to post]
15+
branches: # branch names that can post comment
16+
- "master"
17+
18+
coverage:
19+
status: # 评判 pr 通过的标准
20+
patch: off
21+
project: # project 统计所有代码x
22+
default:
23+
# basic
24+
target: 70% # 总体通过标准
25+
threshold: 3% # 允许单次下降的幅度
26+
base: auto
27+
if_not_found: success
28+
if_ci_failed: error

0 commit comments

Comments
 (0)