Java Android Membangun Kunci Rahasia

// Root-level file secrets.properties
SECRET_KEY="ABC123"
// In module level build.gradle
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretsProperties = new Properties()
secretsProperties.load(new FileInputStream(secretsPropertiesFile))
defaultConfig {
    buildConfigField("String", "SECRET_KEY", secretsProperties['SECRET_KEY'])
}
// Now accessible in the code
String consumerKey = BuildConfig.SECRET_KEY;
Mattalui