{"id":20187433,"url":"https://github.com/bitrise-steplib/steps-sign-apk","last_synced_at":"2025-04-10T06:43:23.808Z","repository":{"id":40669331,"uuid":"47703077","full_name":"bitrise-steplib/steps-sign-apk","owner":"bitrise-steplib","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-02T07:55:44.000Z","size":3231,"stargazers_count":12,"open_issues_count":0,"forks_count":22,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-24T07:50:17.625Z","etag":null,"topics":["bitrise","bitrise-step","ci","hacktoberfest","production-code"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitrise-steplib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-09T16:16:36.000Z","updated_at":"2024-10-02T07:55:13.000Z","dependencies_parsed_at":"2024-07-15T17:38:28.605Z","dependency_job_id":"00d295cc-6c7c-4122-a799-01d8a24927cf","html_url":"https://github.com/bitrise-steplib/steps-sign-apk","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitrise-steplib%2Fsteps-sign-apk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitrise-steplib%2Fsteps-sign-apk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitrise-steplib%2Fsteps-sign-apk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitrise-steplib%2Fsteps-sign-apk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitrise-steplib","download_url":"https://codeload.github.com/bitrise-steplib/steps-sign-apk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248173438,"owners_count":21059595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitrise","bitrise-step","ci","hacktoberfest","production-code"],"created_at":"2024-11-14T03:23:45.629Z","updated_at":"2025-04-10T06:43:23.777Z","avatar_url":"https://github.com/bitrise-steplib.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android Sign\n\n[![Step changelog](https://shields.io/github/v/release/bitrise-steplib/steps-sign-apk?include_prereleases\u0026label=changelog\u0026color=blueviolet)](https://github.com/bitrise-steplib/steps-sign-apk/releases)\n\nSigns your APK or Android App Bundle before uploading it to Google Play Store.\n\n\u003cdetails\u003e\n\u003csummary\u003eDescription\u003c/summary\u003e\n\nOnce you have uploaded your keystore file and provided your keystore credentials on the **Code Signing** tab of the **App Settings** page, the **Android Sign** Step signs your APK digitally.\nBitrise assigns Environment Variables to the uploaded file and credentials, and uses those in the respective fields of the **Android Sign** Step.\nOnce the Step runs, it produces a signed APK or App Bundle which will be used as the input value of the **App file path** field in the **Google Play Deploy** Step.\n\n### Configuring the Step\n\n1. Add the **Android Sign** Step after a build Step in your deploy workflow.\n2. Upload the keystore file to the **Upload file** field on the **Code Signing** tab.\n3. Provide your keystore password, keystore alias and private key password to the relevant fields on the **Code Signing** tab.\n4. Run your build.\n\n### Troubleshooting\nMake sure you have the **Android Sign** Step right after a build Steps but before **Deploy to Google Play** Step in your deploy workflow.\nIf you wish to get your Android project signed automatically, use the **Android Sign** Step and do not set any gradle task for the signing, otherwise, the Step will fail.\n\n### Useful links\n- [Android code signing using Android Sign Step](https://devcenter.bitrise.io/code-signing/android-code-signing/android-code-signing-using-bitrise-sign-apk-step/)\n- [Android deployment](https://devcenter.bitrise.io/deploy/android-deploy/android-deployment-index/)\n\n### Related Steps\n- [Android Build](https://www.bitrise.io/integrations/steps/android-build)\n- [Gradle Runner](https://www.bitrise.io/integrations/steps/gradle-runner)\n- [Deploy to Bitrise.io](https://www.bitrise.io/integrations/steps/deploy-to-bitrise-io)\n\u003c/details\u003e\n\n## 🧩 Get started\n\nAdd this step directly to your workflow in the [Bitrise Workflow Editor](https://devcenter.bitrise.io/steps-and-workflows/steps-and-workflows-index/).\n\nYou can also run this step directly with [Bitrise CLI](https://github.com/bitrise-io/bitrise).\n\n### Examples\n\n1. Build an Android App Bundle:\n\n```yaml\nworkflows:\n  release:\n    envs:\n    - PROJECT_LOCATION: .\n    - MODULE: app\n    - VARIANT: release\n    # If the Android keystore is configured in the workflow editor, BITRISEIO_ANDROID_KEYSTORE* envs will be set automatically\n    - BITRISEIO_ANDROID_KEYSTORE_URL: $BITRISEIO_ANDROID_KEYSTORE_URL\n    - BITRISEIO_ANDROID_KEYSTORE_PASSWORD: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD\n    - BITRISEIO_ANDROID_KEYSTORE_ALIAS: $BITRISEIO_ANDROID_KEYSTORE_ALIAS\n    - BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD\n    \n    steps:\n    - activate-ssh-key:\n        run_if: '{{getenv \"SSH_RSA_PRIVATE_KEY\" | ne \"\"}}'\n    - git-clone: {}\n    - install-missing-android-tools:\n        inputs:\n        - gradlew_path: $PROJECT_LOCATION/gradlew\n    - android-build:\n        inputs:\n        - project_location: $PROJECT_LOCATION\n        - module: $MODULE\n        - variant: $VARIANT\n        - build_type: aab\n```\n2. Sign the App Bundle:\n\n```yaml\n    - sign-apk:\n        inputs:\n        - use_apk_signer: false\n```\n\n3. Deploy the signed App Bundle to Bitrise:\n\n```yaml\n    - deploy-to-bitrise-io: {}\n```\n\n## ⚙️ Configuration\n\n\u003cdetails\u003e\n\u003csummary\u003eInputs\u003c/summary\u003e\n\n| Key | Description | Flags | Default |\n| --- | --- | --- | --- |\n| `android_app` | Path(s) to the build artifact file to sign (`.aab` or `.apk`).  You can provide multiple build artifact file paths separated by `\\|` character.  Format examples:  - `/path/to/my/app.apk` - `/path/to/my/app1.apk\\|/path/to/my/app2.apk\\|/path/to/my/app3.apk`  - `/path/to/my/app.aab` - `/path/to/my/app1.aab\\|/path/to/my/app2.apk\\|/path/to/my/app3.aab` | required | `$BITRISE_APK_PATH\\n$BITRISE_AAB_PATH` |\n| `keystore_url` | For remote keystores you can provide any download location (e.g. `https://URL/TO/keystore.jks`). For local keystores provide file path url. (e.g. `file://PATH/TO/keystore.jks`). | required, sensitive | `$BITRISEIO_ANDROID_KEYSTORE_URL` |\n| `keystore_password` | Matching password to `keystore_url`. Do not confuse this with `key_password`! | required, sensitive | `$BITRISEIO_ANDROID_KEYSTORE_PASSWORD` |\n| `keystore_alias` | Alias of key inside `keystore_url`. | required, sensitive | `$BITRISEIO_ANDROID_KEYSTORE_ALIAS` |\n| `private_key_password` | If key password equals to keystore password (not recommended), you can leave it empty. Otherwise specify the private key password.  | sensitive | `$BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD` |\n| `page_align` | If enabled, it tells zipalign to use memory page alignment for stored shared object files.  - `automatic`: Enable page alignment for .so files, unless atribute `extractNativeLibs=\"true\"` is set in the AndroidManifest.xml - `true`: Enable memory page alignment for .so files - `false`: Disable memory page alignment for .so files  | required | `automatic` |\n| `signer_tool` | Indicates which tool should be used for signing the app.  - `automatic`: Uses the `apksigner` tool to sign an APK and `jarsigner` tool to sign an AAB file. - `apksigner`: Uses the `apksigner` tool to sign the app. - `jarsigner`: Uses the `jarsigner` tool to sign the app.  | required | `automatic` |\n| `signer_scheme` | If set, enforces which Signature Scheme should be used by the project.  - `automatic`: The tool uses the values of `--min-sdk-version` and `--max-sdk-version` to decide when to apply this Signature Scheme. - `v2`: Sets `--v2-signing-enabled` true, and determines whether apksigner signs the given APK package using the APK Signature Scheme v2. - `v3`: Sets `--v3-signing-enabled` true, and determines whether apksigner signs the given APK package using the APK Signature Scheme v3. - `v4`: Sets `--v4-signing-enabled` true, and determines whether apksigner signs the given APK package using the APK Signature Scheme v4. This scheme produces a signature in an separate file (apk-name.apk.idsig). If true and the APK is not signed, then a v2 or v3 signature is generated based on the values of `--min-sdk-version` and `--max-sdk-version`.  | required | `automatic` |\n| `debuggable_permitted` | Whether to permit signing `android:debuggable=\"true\"` APKs. Android disables some of its security protections for such apps.  | required | `true` |\n| `output_name` | If empty, then the output name is `app-release-bitrise-signed`. Otherwise, it's the specified name. Do not add the file extension here.  |  |  |\n| `verbose_log` | Enable verbose logging? | required | `false` |\n| `apk_path` | __This input is deprecated and will be removed on 20 August 2019, use `App file path` input instead!__  Path(s) to the build artifact file to sign (`.aab` or `.apk`).  You can provide multiple build artifact file paths separated by `\\|` character.  Deprecated, use `android_app` instead.  Format examples:  - `/path/to/my/app.apk` - `/path/to/my/app1.apk\\|/path/to/my/app2.apk\\|/path/to/my/app3.apk`  - `/path/to/my/app.aab` - `/path/to/my/app1.aab\\|/path/to/my/app2.apk\\|/path/to/my/app3.aab` |  |  |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eOutputs\u003c/summary\u003e\n\n| Environment Variable | Description |\n| --- | --- |\n| `BITRISE_SIGNED_APK_PATH` | This output will include the path of the signed APK. If the build generates more than one APK this output will contain the last one's path. |\n| `BITRISE_SIGNED_APK_PATH_LIST` | This output will include the paths of the generated APKs If multiple APKs are provided for signing the output paths are separated with `\\|` character, for example, `app-armeabi-v7a-debug.apk\\|app-mips-debug.apk\\|app-x86-debug.apk` |\n| `BITRISE_SIGNED_AAB_PATH` | This output will include the path of the signed AAB. If the build generates more than one AAB this output will contain the last one's path. |\n| `BITRISE_SIGNED_AAB_PATH_LIST` | This output will include the paths of the generated AABs. If multiple AABs are provided for signing the output paths are separated with `\\|` character, for example, `app-armeabi-v7a-debug.aab\\|app-mips-debug.aab\\|app-x86-debug.aab` |\n| `BITRISE_APK_PATH` | This output will include the path(s) of the signed APK(s). If multiple APKs are provided for signing the output paths are separated with `\\|` character, for example, `app-armeabi-v7a-debug.apk\\|app-mips-debug.apk\\|app-x86-debug.apk` |\n| `BITRISE_AAB_PATH` | This output will include the path(s) of the signed AAB(s). If multiple AABs are provided for signing the output paths are separated with `\\|` character, for example, `app-armeabi-v7a-debug.aab\\|app-mips-debug.aab\\|app-x86-debug.aab` |\n\u003c/details\u003e\n\n## 🙋 Contributing\n\nWe welcome [pull requests](https://github.com/bitrise-steplib/steps-sign-apk/pulls) and [issues](https://github.com/bitrise-steplib/steps-sign-apk/issues) against this repository.\n\nFor pull requests, work on your changes in a forked repository and use the Bitrise CLI to [run step tests locally](https://devcenter.bitrise.io/bitrise-cli/run-your-first-build/).\n\nLearn more about developing steps:\n\n- [Create your own step](https://devcenter.bitrise.io/contributors/create-your-own-step/)\n- [Testing your Step](https://devcenter.bitrise.io/contributors/testing-and-versioning-your-steps/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitrise-steplib%2Fsteps-sign-apk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitrise-steplib%2Fsteps-sign-apk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitrise-steplib%2Fsteps-sign-apk/lists"}