aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android
diff options
context:
space:
mode:
authorGravatar Adam Michael <ajmichael@google.com>2017-03-15 22:21:54 +0000
committerGravatar Yun Peng <pcloudy@google.com>2017-03-16 08:37:21 +0000
commit821f1c337c00a15235bf74d076f8861779afc2ee (patch)
tree7ffc275f773c0e5b8a86b2edf2813929b7e93596 /src/main/java/com/google/devtools/build/lib/rules/android
parente6ff1090f70d1ddbf69b205216c216c5e052afc8 (diff)
Remove support for --apk_signing_method=legacy_v1.
The default has been v1 since late October. -- PiperOrigin-RevId: 150250180 MOS_MIGRATED_REVID=150250180
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java18
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/ApkActionsBuilder.java32
2 files changed, 12 insertions, 38 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java
index bfdd604f41..f20c05dac6 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java
@@ -136,34 +136,24 @@ public class AndroidConfiguration extends BuildConfiguration.Fragment {
* Which APK signing method to use with the debug key for rules that build APKs.
*
* <ul>
- * <li>LEGACY_V1 uses the signer inside the deprecated apkbuilder tool.
* <li>V1 uses the apksigner attribute from the android_sdk and signs the APK as a JAR.
* <li>V2 uses the apksigner attribute from the android_sdk and signs the APK according to the APK
* Signing Schema V2 that is only supported on Android N and later.
* </ul>
*/
public enum ApkSigningMethod {
- LEGACY_V1(true, false, false),
- V1(false, true, false),
- V2(false, false, true),
- V1_V2(false, true, true);
+ V1(true, false),
+ V2(false, true),
+ V1_V2(true, true);
- private final boolean signLegacy;
private final boolean signV1;
private final boolean signV2;
- ApkSigningMethod(boolean signLegacy, boolean signV1, boolean signV2) {
- // If signLegacy is true, the other two values will be ignored.
- this.signLegacy = signLegacy;
+ ApkSigningMethod(boolean signV1, boolean signV2) {
this.signV1 = signV1;
this.signV2 = signV2;
}
- /** Whether to sign with the signer inside the deprecated apkbuilder tool. */
- public boolean signLegacy() {
- return signLegacy;
- }
-
/** Whether to JAR sign the APK with the apksigner tool. */
public boolean signV1() {
return signV1;
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/ApkActionsBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/android/ApkActionsBuilder.java
index 216713fced..c552a5f94c 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/ApkActionsBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/ApkActionsBuilder.java
@@ -148,31 +148,15 @@ public class ApkActionsBuilder {
}
if (signedApk != null) {
- if (signingMethod.signLegacy()) {
- // With the legacy signer, zipalignment is performed after signing. So if a zipaligned APK
- // is requested, we need an intermediate signed-but-not-zipaligned apk artifact.
- Artifact intermediateSignedApk = zipalignApk
- ? AndroidBinary.getDxArtifact(ruleContext, "signed_" + signedApk.getFilename())
- : signedApk;
- legacyBuildApk(
- ruleContext,
- intermediateSignedApk,
- semantics.getApkDebugSigningKey(ruleContext),
- "Generating signed " + apkName);
- if (zipalignApk) {
- zipalignApk(ruleContext, intermediateSignedApk, signedApk);
- }
- } else {
- Artifact apkToSign = intermediateUnsignedApk;
- // With apksigner, zipalignment is performed before signing. So if a zipaligned APK is
- // requested, we need an intermediate zipaligned-but-not-signed apk artifact.
- if (zipalignApk) {
- apkToSign =
- AndroidBinary.getDxArtifact(ruleContext, "zipaligned_" + signedApk.getFilename());
- zipalignApk(ruleContext, intermediateUnsignedApk, apkToSign);
- }
- signApk(ruleContext, semantics.getApkDebugSigningKey(ruleContext), apkToSign, signedApk);
+ Artifact apkToSign = intermediateUnsignedApk;
+ // Zipalignment is performed before signing. So if a zipaligned APK is requested, we need an
+ // intermediate zipaligned-but-not-signed apk artifact.
+ if (zipalignApk) {
+ apkToSign =
+ AndroidBinary.getDxArtifact(ruleContext, "zipaligned_" + signedApk.getFilename());
+ zipalignApk(ruleContext, intermediateUnsignedApk, apkToSign);
}
+ signApk(ruleContext, semantics.getApkDebugSigningKey(ruleContext), apkToSign, signedApk);
}
}