Skip to content

Commit

Permalink
release: v2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuingsmile committed Apr 13, 2024
1 parent 3ca9e03 commit 15ac688
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 49 deletions.
49 changes: 25 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</a>
</div>

&emsp;&emsp;一款基于flutter的手机端云存储平台/图床管理和文件上传/下载工具,最新版本**V2.2.4**,与PicGo配置互通,可直接扫码导入,主要功能包括云存储/图床/云服务器平台,以及网盘管理(通过[Alist](https://alist.nn.ci/zh/)),文件上传和下载管理,以及各种格式的链接分享。
&emsp;&emsp;一款基于flutter的手机端云存储平台/图床管理和文件上传/下载工具,最新版本**V2.3.0**,与PicGo配置互通,可直接扫码导入,主要功能包括云存储/图床/云服务器平台,以及网盘管理(通过[Alist](https://alist.nn.ci/zh/)),文件上传和下载管理,以及各种格式的链接分享。

&emsp;&emsp;支持多种图片/PDF/文本文件/音视频的在线预览和播放,具体支持的格式请查看[支持的格式列表](https://github.com/Kuingsmile/PicHoro/blob/main/supported_format.md "支持的格式列表")

Expand Down Expand Up @@ -51,32 +51,32 @@

## 文件预览支持

| 平台 | 图片 | PDF | 文本文件 | 视频 |
| ------ | :--: | :-: | :------: | :--: |
| Alist |||| |
| 阿里云 |||| |
| S3 |||| |
| 腾讯云 |||| |
| 又拍云 |||| |
| 七牛云 |||| |
| WebDav |||| |
| FTP |||| |
| Github |||| |
| Imgur |||| |
| 兰空 |||| |
| SM.MS |||| |
| 平台 | 图片 | PDF | 文本文件 | 视频 |
| ------ | :---: | :---: | :------: | :---: |
| Alist | || | |
| 阿里云 | || | |
| S3 | || | |
| 腾讯云 | || | |
| 又拍云 | || | |
| 七牛云 | || | |
| WebDav | || | |
| FTP | || | |
| Github | || | |
| Imgur | || | |
| 兰空 | || | |
| SM.MS | || | |

## 下载

### 安卓

Github下载地址 [Github release](https://github.com/Kuingsmile/PicHoro/releases)

我的个人网站提供的最新版本下载地址 [https://pichoro.msq.pub/PicHoro_V2.2.4.apk](https://pichoro.msq.pub/PicHoro_V2.2.4.apk)
我的个人网站提供的最新版本下载地址 [https://pichoro.msq.pub/PicHoro_V2.3.0.apk](https://pichoro.msq.pub/PicHoro_V2.3.0.apk)

### IOS

由于个人没有Mac和开发者账号,暂时无法提供IOS版本,如果有人愿意帮忙开发IOS版本,可以联系我,我会提供相关的技术支持。
由于个人没有Mac,无法提供IOS版本,如果有人愿意帮忙开发IOS版本,可以联系我,我会提供相关的技术支持。

## 应用截图

Expand Down Expand Up @@ -109,19 +109,20 @@ Github下载地址 [Github release](https://github.com/Kuingsmile/PicHoro/releas

  详细更新日志请查看[更新日志](https://github.com/Kuingsmile/PicHoro/blob/main/Version_update_log.md "更新日志")

## 2024-04-13 **V2.3.0**

- 新增:优化了smms图床的配置检查速度
- 新增:阿里云新增了对`oss-cn-wuhan`地域的支持
- 新增:现在允许s3图床桶名含有大写字母
- 修复:修复了github图床自定义域名以多个`/`结尾时,返回路径错误的问题
- 修复:修复了图片链接格式设置为BBcode时上传报错的问题

## 2024-02-21 **V2.2.4**

- 新增:七牛云新增 `亚太-河内`区域支持
- 新增:优化了github用户名的判断逻辑
- 修复:修复了七牛云检查配置时,即使配置正确也会提示错误的问题

## 2023-11-25 **V2.2.3**

- 新增: 现在支持为alist设置网址拼接路径
- 新增: 现在支持从文件管理器分享图片快速启动PicHoro
- 修复: 修复了兰空图床配置项相册id没有正常生效的问题
- 修复了视频无法预览播放的问题

## 开发交流

开发进度可以查看 [Projects](https://github.com/Kuingsmile/PicHoro/projects),会同步更新开发进度。
Expand Down
8 changes: 8 additions & 0 deletions Version_update_log.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# 更新日志

## 2024-04-13 **V2.3.0**

- 新增:优化了smms图床的配置检查速度
- 新增:阿里云新增了对`oss-cn-wuhan`地域的支持
- 新增:现在允许s3图床桶名含有大写字母
- 修复:修复了github图床自定义域名以多个`/`结尾时,返回路径错误的问题
- 修复:修复了图片链接格式设置为BBcode时上传报错的问题

## 2024-02-21 **V2.2.4**

- 新增:七牛云新增`亚太-河内`区域支持
Expand Down
8 changes: 8 additions & 0 deletions assets/files/UpdateLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# 更新日志

## 2024-04-13 **V2.3.0**

- 新增:优化了smms图床的配置检查速度
- 新增:阿里云新增了对`oss-cn-wuhan`地域的支持
- 新增:现在允许s3图床桶名含有大写字母
- 修复:修复了github图床自定义域名以多个`/`结尾时,返回路径错误的问题
- 修复:修复了图片链接格式设置为BBcode时上传报错的问题

## 2024-02-01 **V2.2.4**

- 新增:七牛云新增`亚太-河内`区域支持
Expand Down
37 changes: 20 additions & 17 deletions lib/api/smms_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,45 @@ import 'package:horopic/utils/global.dart';
import 'package:path/path.dart' as my_path;

class SmmsImageUploadUtils {
static const _baseUrl = "https://smms.app/api/v2";
static const _uploadEndpoint = "/upload";
static const _deleteEndpoint = "/delete";

static Dio _getDio(Map configMap) {
BaseOptions options = setBaseOptions();
options.headers = {
"Authorization": configMap["token"],
"Content-Type": "multipart/form-data",
};
return Dio(options);
}

//上传接口
static uploadApi({
static Future<List<String>> uploadApi({
required String path,
required String name,
required Map configMap,
Function(int, int)? onSendProgress,
CancelToken? cancelToken,
}) async {
try {
String formatedURL = '';
FormData formdata = FormData.fromMap({
"smfile": await MultipartFile.fromFile(path, filename: my_path.basename(name)),
"format": "json",
});

BaseOptions options = setBaseOptions();
options.headers = {
"Authorization": configMap["token"],
"Content-Type": "multipart/form-data",
};
Dio dio = Dio(options);
String uploadUrl = "https://smms.app/api/v2/upload";
Dio dio = _getDio(configMap);
var response = await dio.post(
uploadUrl,
"$_baseUrl$_uploadEndpoint",
data: formdata,
onSendProgress: onSendProgress,
cancelToken: cancelToken,
);
if (response.statusCode == 200 && response.data!['success'] == true) {
String returnUrl = response.data!['data']['url'];
String pictureKey = response.data!['data']['hash'];
if (Global.isCopyLink == true) {
formatedURL = linkGenerateDict[Global.defaultLKformat]!(returnUrl, name);
} else {
formatedURL = returnUrl;
}
String formatedURL =
Global.isCopyLink == true ? linkGenerateDict[Global.defaultLKformat]!(returnUrl, name) : returnUrl;
return ["success", formatedURL, returnUrl, pictureKey];
} else {
return ["failed"];
Expand All @@ -57,7 +60,7 @@ class SmmsImageUploadUtils {
}
}

static deleteApi({required Map deleteMap, required Map configMap}) async {
static Future<List<String>> deleteApi({required Map deleteMap, required Map configMap}) async {
Map<String, dynamic> formdata = {
"hash": deleteMap["pictureKey"],
"format": "json",
Expand All @@ -68,7 +71,7 @@ class SmmsImageUploadUtils {
"Authorization": configMap["token"],
};
Dio dio = Dio(options);
String deleteUrl = "https://smms.app/api/v2/delete/${deleteMap["pictureKey"]}";
String deleteUrl = '$_baseUrl$_deleteEndpoint/${deleteMap["pictureKey"]}';

try {
var response = await dio.get(deleteUrl, queryParameters: formdata);
Expand Down
11 changes: 7 additions & 4 deletions lib/api/tencent_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,27 @@ import 'package:horopic/utils/common_functions.dart';
import 'package:horopic/utils/global.dart';

class TencentImageUploadUtils {
static String _hmacSha1(String key, String data) {
return Hmac(sha1, utf8.encode(key)).convert(utf8.encode(data)).toString();
}

//表单上传的signature
static String getUploadAuthorization(
String secretKey,
String keyTime,
String uploadPolicyStr,
) {
String signKey = Hmac(sha1, utf8.encode(secretKey)).convert(utf8.encode(keyTime)).toString();
String signKey = _hmacSha1(secretKey, keyTime);
String stringtosign = sha1.convert(utf8.encode(uploadPolicyStr)).toString();
String signature = Hmac(sha1, utf8.encode(signKey)).convert(utf8.encode(stringtosign)).toString();
return signature;
return _hmacSha1(signKey, stringtosign);
}

//authorization
static String getDeleteAuthorization(String method, String urlpath, Map header, String secretId, String secretKey) {
int startTimestamp = DateTime.now().millisecondsSinceEpoch ~/ 1000;
int endTimestamp = startTimestamp + 86400;
String keyTime = '$startTimestamp;$endTimestamp';
String signKey = Hmac(sha1, utf8.encode(secretKey)).convert(utf8.encode(keyTime)).toString();
String signKey = _hmacSha1(secretKey, keyTime);
String lowerMethod = method.toLowerCase();
String headerList = '';
String httpHeaders = '';
Expand Down
3 changes: 2 additions & 1 deletion lib/picture_host_manage/manage_api/aliyun_manage_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class AliyunManageAPI {
'oss-cn-shanghai': '华东2(上海)',
'oss-cn-nanjing': '华东5(南京本地地域)',
'oss-cn-fuzhou': '华东6(福州本地地域)',
'oss-cn-wuhan': '华中1(武汉本地地域)',
'oss-cn-qingdao': '华北1(青岛)',
'oss-cn-beijing': '华北2(北京)',
'oss-cn-zhangjiakou': '华北3(张家口)',
Expand All @@ -28,7 +29,7 @@ class AliyunManageAPI {
'oss-cn-heyuan': '华南2(河源)',
'oss-cn-guangzhou': '华南3(广州)',
'oss-cn-chengdu': '西南1(成都)',
'oss-cn-hongkong': '中国(香港)',
'oss-cn-hongkong': '中国香港',
'oss-us-west-1': '美国(硅谷)',
'oss-us-east-1': '美国(弗吉尼亚)',
'oss-ap-northeast-1': '日本(东京)',
Expand Down
2 changes: 1 addition & 1 deletion lib/picture_host_manage/manage_api/qiniu_manage_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class QiniuManageAPI {
'z0': 'https://upload.qiniup.com', //华东
'cn-east-2': 'https://upload-cn-east-2.qiniup.com', //华东 浙江2
'z1': 'https://upload-z1.qiniup.com', //华北
'z2': 'https://upload-z2.qiniup.com', //华南
'z2': 'https://upload-z2.qiniup.com', //广东
'na0': 'https://upload-na0.qiniup.com', //北美
'as0': 'https://upload-as0.qiniup.com', //东南亚
'ap-northeast-1': 'https://upload-ap-northeast-1.qiniup.com', //亚太首尔
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 2.2.2+1
version: 2.3.0+1

environment:
sdk: ^3.0.0
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "2.2.4"
"version": "2.3.0"
}

0 comments on commit 15ac688

Please sign in to comment.