java android build secret keys

Solutions on MaxInterview for java android build secret keys by the best coders in the world

showing results for - "java android build secret keys"
David
07 Mar 2016
1// Root-level file secrets.properties
2SECRET_KEY="ABC123"
3// In module level build.gradle
4def secretsPropertiesFile = rootProject.file("secrets.properties")
5def secretsProperties = new Properties()
6secretsProperties.load(new FileInputStream(secretsPropertiesFile))
7defaultConfig {
8    buildConfigField("String", "SECRET_KEY", secretsProperties['SECRET_KEY'])
9}
10// Now accessible in the code
11String consumerKey = BuildConfig.SECRET_KEY;