# android-git-sha-plugin **Repository Path**: mirrors_promeG/android-git-sha-plugin ## Basic Information - **Project Name**: android-git-sha-plugin - **Description**: Automaticlly add current GIT SHA value to your apk. It can rise an error if the current git branch is dirty. - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-18 - **Last Updated**: 2026-07-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # android-git-sha-plugin [ ![Download](https://api.bintray.com/packages/promeg/maven/android-git-sha-plugin/images/download.svg) ](https://bintray.com/promeg/maven/android-git-sha-plugin/_latestVersion) Automaticlly add current GIT SHA value to your apk. It can rise an error if the current git branch is dirty. ## Why you should use a GIT SHA in your crash reporting. Acturally this project is inspried by [Why You Should Use a GIT SHA in Your Crash Reporting](http://www.donnfelker.com/why-you-should-use-a-git-sha-in-your-crash-reporting/) . Please read it before using this plugin. ## How to use android-git-sha-plugin ### 1. Add to your project #### In your project's root build.gradle file. ```groovy buildscript { repositories { jcenter() } dependencies { classpath 'com.github.promeg:android-git-sha-plugin:1.0.1' } } ``` #### In your application module's build.gradle file. ```groovy apply plugin: 'com.android.application' apply plugin: 'android-git-sha' dependencies { compile 'com.github.promeg:android-git-sha-lib:1.0.1' } ``` ### 2. Config plugin ```groovy gitSha { buildTypeMatcher = 'release' // RegExp to specify the build type flavorMatcher = 'inner|fortest' // RegExp to specify the flavor abortIfGitDirty = true // whether abort build if the current git branch is dirty } ``` ### 3. Read GIT SHA value in java code ```java GitShaUtils.getGitSha(appContext); // return current GIT SHA value. ``` Then you can add GIT SHA value in your crash reporting. ```java Crashlytics.setString("git_sha", GitShaUtils.getGitSha(appContext)); ```