Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nibocn/5b53ed8913660d386822 to your computer and use it in GitHub Desktop.
Save nibocn/5b53ed8913660d386822 to your computer and use it in GitHub Desktop.
android {

    ...
    
    signingConfigs {
        releaseConfig {
            storeFile file(System.getenv("KEYSTORE_PATH"))
            keyAlias System.getenv("KEY_ALIAS")
            storePassword System.getenv("KEYSTORE_PASSWORD")
            keyPassword System.getenv("KEY_PASSWORD")
        }
    }

    buildTypes {
        release {
            signingConfig signingConfigs.releaseConfig
        }
    }
}

通过环境变量获取相关证书参数,这样更安全

KEYSTORE_PATH: 证书文件路径;

KEY_ALIAS: 证书别名;

KEYSTORE_PASSWORD: 密码;

KEY_PASSWORD: 密码;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment