From 0461802a46f9cdadb73cbae9ad61e5cf0877d872 Mon Sep 17 00:00:00 2001 From: lou Date: Mon, 10 Aug 2026 19:50:54 +0800 Subject: [PATCH] =?UTF-8?q?TUI=20=E4=B8=8A=E4=BC=A0:=207z=20=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E6=94=B9=E4=B8=B4=E6=97=B6=E7=9B=AE=E5=BD=95=20(Andro?= =?UTF-8?q?id=20Download=20=E5=85=AC=E5=85=B1=E7=9B=AE=E5=BD=95=E5=86=99?= =?UTF-8?q?=E5=85=A5=E5=8F=97=E9=99=90=20errno=3D1)=20+=20=E9=80=8F?= =?UTF-8?q?=E4=BC=A0=E5=8E=8B=E7=BC=A9=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/7z-encrypt-client/DEBIAN/control | 2 +- debian/7z-encrypt-client/DEBIAN/md5sums | 2 +- debian/7z-encrypt-client/usr/share/7z-encrypt/tui.py | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) 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")