From 7ba4439a5761495655a82d2eed2c17639486951b Mon Sep 17 00:00:00 2001 From: zzz701 Date: Mon, 1 Sep 2025 13:44:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=AF=91=E5=91=8A?= =?UTF-8?q?=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zzz701 --- build-tools/clean_ndk_ani.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-tools/clean_ndk_ani.py b/build-tools/clean_ndk_ani.py index 5457bfc29b5..43e62f9e7ff 100755 --- a/build-tools/clean_ndk_ani.py +++ b/build-tools/clean_ndk_ani.py @@ -18,6 +18,7 @@ import re import argparse import shutil import json +import stat from typing import List # ani header file list @@ -100,7 +101,9 @@ def clean_json_systemCapability_headers(capability_header_path): # Saving the modified JSON try: - with open(capability_header_path, 'w') as f: + fd = os.open(capability_header_path, os.O_WRONLY | os.O_TRUNC | os.O_CREAT, + stat.S_IRUSR | stat.S_IWUSR) + with os.fdopen(fd, 'w') as f: json.dump(systemCapabilitys, f, indent=2) print("JSON file updated successfully") except Exception as e: -- Gitee