Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9493e54a authored by LuK1337's avatar LuK1337 Committed by Michael Bestas
Browse files

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
parent 701d2876
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -280,6 +280,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)