diff --git a/debian/7z-encrypt-client/DEBIAN/control b/debian/7z-encrypt-client/DEBIAN/control index 4d0de0a..4ff2c39 100644 --- a/debian/7z-encrypt-client/DEBIAN/control +++ b/debian/7z-encrypt-client/DEBIAN/control @@ -2,7 +2,7 @@ Package: 7z-encrypt-client Version: 1.0.0 Architecture: all Maintainer: edgevoid -Installed-Size: 127 +Installed-Size: 128 Depends: python3 (>= 3.10), python3-venv, p7zip-full Section: utils Priority: optional diff --git a/debian/7z-encrypt-client/DEBIAN/md5sums b/debian/7z-encrypt-client/DEBIAN/md5sums index c801fea..c5acf31 100644 --- a/debian/7z-encrypt-client/DEBIAN/md5sums +++ b/debian/7z-encrypt-client/DEBIAN/md5sums @@ -9,6 +9,6 @@ dcb31e74e0a6ee8073337fc4fb2acf99 usr/share/7z-encrypt/config.py 3478ac8277b4b1a38694ad0cc8cdbcdb usr/share/7z-encrypt/splitter.py b90b8c950f99e1439bc273f50a2ee0a6 usr/share/7z-encrypt/state.py 795881c32c496161290920ae34bf74f1 usr/share/7z-encrypt/transfer.py -67d4b90265abf5a72af959f66679dd0f usr/share/7z-encrypt/tui.py +6aa2072a47dc2aa2a397836dda464040 usr/share/7z-encrypt/tui.py 198943ad7a94f6ba0995cf2d326f66d4 usr/share/doc/7z-encrypt-client/changelog.gz fadf3972cc61c7c76d0ccc20b29a804c usr/share/doc/7z-encrypt-client/copyright diff --git a/debian/7z-encrypt-client/usr/share/7z-encrypt/tui.py b/debian/7z-encrypt-client/usr/share/7z-encrypt/tui.py index 22cdecb..804e650 100644 --- a/debian/7z-encrypt-client/usr/share/7z-encrypt/tui.py +++ b/debian/7z-encrypt-client/usr/share/7z-encrypt/tui.py @@ -13,6 +13,7 @@ import os import shutil import subprocess import sys +import tempfile from pathlib import Path from urllib import request as urlrequest @@ -103,13 +104,12 @@ def upload() -> None: chunk_size = _clean(input("卷大小 MB [10]: ")) or "10" print("\n[1/3] 7z 压缩 (-mx=9) ...") - src7z = path + ".7z" - r = subprocess.run( - ["7z", "a", "-mx=9", "-bd", src7z, path], - capture_output=True, text=True, - ) + # 输出到临时目录 (Android 公共目录如 Download 写入受限, errno=1) + src7z = os.path.join(tempfile.gettempdir(), os.path.basename(path) + ".7z") + r = subprocess.run(["7z", "a", "-mx=9", "-bd", src7z, path]) if r.returncode != 0: - print(f"[错误] 7z 压缩失败: {r.stderr[-300:]}") + os.remove(src7z) + print("[错误] 7z 压缩失败") return print(f"[1/3] 压缩完成: {os.path.getsize(path) / 1048576:.1f} MB -> {os.path.getsize(src7z) / 1048576:.1f} MB")