Uredi

Deli z drugimi prek


AndroidSigning@2 - Android Signing v2 task

Use this task in a pipeline to sign and align Android APK files.

This task is deprecated; use AndroidSigning@3.

Use this task in a pipeline to sign and align Android APK files.

Syntax

# Android Signing v2
# Sign and align Android APK files.
- task: AndroidSigning@2
  inputs:
    apkFiles: '**/*.apk' # string. Alias: files. Required. APK files. Default: **/*.apk.
  # Signing Options
    #jarsign: true # boolean. Sign the APK. Default: true.
    jarsignerKeystoreFile: # string. Alias: keystoreFile. Required when jarsign = true. Keystore file. 
    #jarsignerKeystorePassword: # string. Alias: keystorePass. Optional. Use when jarsign = true. Keystore password. 
    #jarsignerKeystoreAlias: # string. Alias: keystoreAlias. Optional. Use when jarsign = true. Alias. 
    #jarsignerKeyPassword: # string. Alias: keyPass. Optional. Use when jarsign = true. Key password. 
    #jarsignerArguments: '-verbose -sigalg MD5withRSA -digestalg SHA1' # string. Optional. Use when jarsign = true. Jarsigner arguments. Default: -verbose -sigalg MD5withRSA -digestalg SHA1.
  # Zipalign Options
    #zipalign: true # boolean. Zipalign. Default: true.
    #zipalignFile: # string. Alias: zipalignLocation. Optional. Use when zipalign = true. Zipalign location.

Inputs

apkFiles - APK files
Input alias: files. string. Required. Default value: **/*.apk.

The relative path from the repo root to the APK(s) you want to sign. You can use wildcards to specify multiple files. For example:

  • outputs\apk*.apk to sign all .APK files in the outputs\apk\ subfolder.
  • **/bin/*.apk to sign all .APK files in all bin subfolders.

jarsign - Sign the APK
boolean. Default value: true.

Signs the APK with a provided keystore file. Unsigned APKs can only run in an emulator. APKs must be signed to run on a device.


jarsignerKeystoreFile - Keystore file
Input alias: keystoreFile. string. Required when jarsign = true.

The file path to the Android Keystore file that is used to sign the APK. This file must be uploaded to the secure files library, where it is securely stored with encryption. The Android Keystore file is removed from the agent machine when the pipeline completes.

The file can either be checked into source control or placed on the build machine directly by an administrator. It is recommended to encrypt the keystore file in source control and use the Decrypt File task to decrypt the file during the build.


jarsignerKeystorePassword - Keystore password
Input alias: keystorePass. string. Optional. Use when jarsign = true.

The password for the provided Android Keystore file.

Important

Use a new variable with its lock enabled on the Variables tab to encrypt this value. See secret variables.


jarsignerKeystoreAlias - Alias
Input alias: keystoreAlias. string. Optional. Use when jarsign = true.

The alias that identifies the public/private key pair to be used in the Android Keystore file.


jarsignerKeyPassword - Key password
Input alias: keyPass. string. Optional. Use when jarsign = true.

The key password for the alias and Android Keystore file.

Important

Use a new variable with its lock enabled on the Variables tab to encrypt this value. See secret variables.


jarsignerArguments - Jarsigner arguments
string. Optional. Use when jarsign = true. Default value: -verbose -sigalg MD5withRSA -digestalg SHA1.

Provides options to pass to the jarsigner command line.


zipalign - Zipalign
boolean. Default value: true.

Select this boolean if you want to zipalign your package. This reduces the amount of RAM consumed by an app.


zipalignFile - Zipalign location
Input alias: zipalignLocation. string. Optional. Use when zipalign = true.

Specifies the location of the zipalign executable used during signing. This defaults to the zipalign found in the Android SDK version folder that your application builds against.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Requirements

Requirement Description
Pipeline types YAML, Classic build
Runs on Agent, DeploymentGroup
Demands Self-hosted agents must have capabilities that match the following demands to run jobs that use this task: JDK
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions This task runs using the following command restrictions: restricted
Settable variables This task has permission to set the following variables: Setting variables is disabled
Agent version 2.182.1 or greater
Task category Build
Requirement Description
Pipeline types YAML, Classic build
Runs on Agent, DeploymentGroup
Demands Self-hosted agents must have capabilities that match the following demands to run jobs that use this task: JDK
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 2.116.0 or greater
Task category Build
Requirement Description
Pipeline types YAML, Classic build
Runs on Agent, DeploymentGroup
Demands Self-hosted agents must have capabilities that match the following demands to run jobs that use this task: JDK, AndroidSDK
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 2.116.0 or greater
Task category Build