From 4faa3177f27e605317a170aa9f3707b51ce39bea Mon Sep 17 00:00:00 2001 From: hmalik144 Date: Thu, 9 Jun 2022 23:53:33 +0100 Subject: [PATCH] removed api keys from gradle.properties files Took 52 minutes (cherry picked from commit e54dc864905eb5f8ef9374b9550d7def33fbfd1a) Took 2 minutes --- app/build.gradle | 7 +++++-- gradle.properties | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1284a4c..f99ea7b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,8 +20,11 @@ android { testInstrumentationRunner "com.appttude.h_mal.atlas_weather.application.TestRunner" vectorDrawables.useSupportLibrary = true - buildConfigField "String", "ParamOne", "${paramOneEndPoint}" - buildConfigField "String", "ParamTwo", "${paramTwoEndPoint}" + Properties properties = new Properties() + properties.load(project.rootProject.file('local.properties').newDataInputStream()) + + buildConfigField "String", "ParamOne", "\"${properties.getProperty('WEATHER_API')}\"" + buildConfigField "String", "ParamTwo", "\"${properties.getProperty('SEARCH_API')}\"" } android { sourceSets{ diff --git a/gradle.properties b/gradle.properties index ddd0787..9e6fce1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,5 +17,3 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -paramOneEndPoint="ed03070baf705c1185fa40f245bf8cca" -paramTwoEndPoint="WkQ8IlFaKCpn6LfwqpjV2QygC878kSbJ"