Revert^2 "Fix signing failure for split APKs"
This reverts commit d06e5a83ba
.
Reason for revert: <It's not a culprit any more.>
Change-Id: I405c418e6da88774b174fcb3508eb54039fbdf8e
This commit is contained in:
committed by
Gerrit Code Review
parent
d06e5a83ba
commit
10e47e3723
@@ -2434,12 +2434,23 @@ 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))
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user