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
This commit is contained in:
LuK1337
2024-03-24 20:52:45 +01:00
parent 3903154c64
commit fc51de4553

View File

@@ -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)