Sign APKs using SHA-256 instead of SHA-1 when possible.

This changes the build system to provide the signapk tool with the
minSdkVersion of the APK being signed. signapk in turn will then use
SHA-256 instead of SHA-1 if minSdkVersion is 18 (JB MR2) or higher
(see c2c49ed0c13846f7f96249c7419971dfcddc9215).

To avoid increasing incremental OTA update package sizes for already
released platforms, release build scripts disable the above logic when
signing target files ZIPs for pre-N platforms.

Bug: 25643280

(cherry picked from commit 2cfd1d108c82bdedccb03917e09aa5e677e8fde2)

Change-Id: I38450d07ddc05c705de40313f843beada8db7d98
4 files changed