Skip to content

Commit 8341f67

Browse files
committed
release 2.0.0.7
1 parent cf7cbc9 commit 8341f67

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ android {
3030
//noinspection ExpiredTargetSdkVersion
3131
targetSdkVersion 29
3232
versionCode 111
33-
versionName "2.0.0.6"
33+
versionName "2.0.0.7"
3434
vectorDrawables.useSupportLibrary = true
3535
resourceConfigurations += ['zh', 'zh-rCN', 'zh-rHK', 'zh-rTW', 'es', 'ja', 'ko', 'fr', 'de', 'th']
3636
testOptions.unitTests.includeAndroidResources = true

app/src/main/java/com/hippo/ehviewer/ui/dialog/ArchiverDownloadDialog.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ private void importGallery(String tempFilePath, long downloadId) {
405405
/**
406406
* 去除输入字符串中的'\'、'/'、'|'字符
407407
* 创建文件名的静态私有方法
408+
* 限制文件名长度以避免"File name too long"错误
408409
* @param name 原始名称参数
409410
* @return 返回处理后的文件名字符串
410411
*/
@@ -417,6 +418,13 @@ static private String createFileName(String name){
417418
}
418419
String result = name.replaceAll("/","");
419420
result = result.replaceAll("\\|","");
421+
// 限制文件名长度,避免"File name too long"错误
422+
// 考虑到 ARCHIVER_PATH (18字符) + ".zip" (4字符) + 路径分隔符
423+
// 限制文件名在 200 个字符以内,为路径预留空间
424+
final int MAX_FILENAME_LENGTH = 200;
425+
if (result.length() > MAX_FILENAME_LENGTH) {
426+
result = result.substring(0, MAX_FILENAME_LENGTH);
427+
}
420428
return result;
421429
// 使用正则表达式替换非法字符
422430
// return name.replaceAll("[\\\\/|]", "");

0 commit comments

Comments
 (0)