[TIMOB-24517] Android: Add APK signature scheme v2 support
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Low |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2020-01-10T15:19:06.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 9.0.0 |
| Components | Android |
| Labels | android, apk, sign |
| Reporter | Eric Merriman |
| Assignee | Joshua Quick |
| Created | 2017-03-20T20:26:14.000+0000 |
| Updated | 2020-01-10T15:19:06.000+0000 |
Description
*Summary:*
Titanium currently only supports signing with v1 signature scheme.
We should add v2 signing support, which can be verified on Android 7.0 and higher.
https://source.android.com/security/apksigning/v2
Note that an APK can be signed by both v1 and v2 at the same time. We still need v1 support for Android OS versions older than 7.0.
*Note 1:*
This can be signed manually via Android SDK build tool "apksigner".
https://developer.android.com/studio/command-line/apksigner
*Note 2:*
The "gradle" build system automatically signs all built APKs with both v1 and v2. When we add "gradle" build support, then we get v2 signing for free.
*Testing:*
You can verify which versioning schemes an APK has been signed with at the command line by doing the following...
Enter:
The tool will output something like the below. Make sure v2 is flagged
Open the Mac "Terminal".
CD to directory: ~/Library/Android/sdk/build-tools/<NewestVersion>
Enter: ./apksigner verify -v <PathToApk>
The tool will output something like the below. Make sure v2 is flagged true.
Verified using v1 scheme (JAR signing): true
Verified using v2 scheme (APK Signature Scheme v2): true
Verified using v3 scheme (APK Signature Scheme v3): false
TIMOB-23803 ?
Using build-tools
24+using https://developer.android.com/studio/command-line/apksigner.html will automatically use v2 signing when appropriate.Master: https://github.com/appcelerator/titanium_mobile/pull/11339
FR Passed. PR Merged.
Closing ticket, New feaure verified in SDK Version
9.0.0.v20200109153329. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/11339