diff options
author | LuK1337 <priv.luk@gmail.com> | 2024-03-24 20:52:45 +0100 |
---|---|---|
committer | LuK1337 <priv.luk@gmail.com> | 2024-03-24 21:18:17 +0100 |
commit | fc51de455325ebca8bf4e28203a1143ba07076e2 (patch) | |
tree | 7f91f78c943a98fa54148094add8bd49e1c34668 | |
parent | 3903154c64bf30a9bb2eede2f96d8d55b050da76 (diff) | |
download | build-fc51de455325ebca8bf4e28203a1143ba07076e2.tar.gz |
releasetools: Resolve symlinks in IsEntryOtaPackage()
Test: Sign target files package where
SYSTEM/product/media/bootanimation-dark.zip is a symlink to
bootanimation.zip.
Change-Id: I4648c3c39c094cb090cbe337c566c3e9ad894691
-rwxr-xr-x | tools/releasetools/sign_target_files_apks.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py index 5d92eded43..b8f848fb2b 100755 --- a/tools/releasetools/sign_target_files_apks.py +++ b/tools/releasetools/sign_target_files_apks.py @@ -271,6 +271,10 @@ def IsOtaPackage(fp): def IsEntryOtaPackage(input_zip, filename): with input_zip.open(filename, "r") as fp: + external_attr = input_zip.getinfo(filename).external_attr + if stat.S_ISLNK(external_attr >> 16): + return IsEntryOtaPackage(input_zip, + os.path.join(os.path.dirname(filename), fp.read().decode())) return IsOtaPackage(fp) |