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

Commit d06e5a83 authored by Pechetty Sravani (xWF)'s avatar Pechetty Sravani (xWF) Committed by Gerrit Code Review
Browse files

Revert "Fix signing failure for split APKs"

This reverts commit 6871779d.

Reason for revert: Potential culprit for b/356752725- verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I4c29b27f0318901130036dbe8ab9edef37f08875
parent 6871779d
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -2434,23 +2434,12 @@ def GetMinSdkVersion(apk_name):
        "Failed to obtain minSdkVersion for {}: aapt2 return code {}:\n{}\n{}".format(
            apk_name, proc.returncode, stdoutdata, stderrdata))

  is_split_apk = False
  for line in stdoutdata.split("\n"):
    # See b/353837347 , split APKs do not have sdk version defined,
    # so we default to 21 as split APKs are only supported since SDK
    # 21.
    if (re.search(r"split=[\"'].*[\"']", line)):
      is_split_apk = True
    # Due to ag/24161708, looking for lines such as minSdkVersion:'23',minSdkVersion:'M'
    # or sdkVersion:'23', sdkVersion:'M'.
    m = re.match(r'(?:minSdkVersion|sdkVersion):\'([^\']*)\'', line)
    if m:
      return m.group(1)
  if is_split_apk:
    logger.info("%s is a split APK, it does not have minimum SDK version"
                " defined. Defaulting to 21 because split APK isn't supported"
                " before that.", apk_name)
    return 21
  raise ExternalError("No minSdkVersion returned by aapt2 for apk: {}".format(apk_name))