I finished an android project that requires me to use an api_key. I've added the api key in my build.gradle file like this:
buildTypes.each {
it.buildConfigField "String", "MDB_API_KEY", "\"243248324293938243\""
}
(that's a random number btw)
Now that I finished the project I need to upload it to Github, for code review. Before doing so, I was asked to remove the api key, and I did
buildTypes.each {
it.buildConfigField "String", "MDB_API_KEY", *putYaOwnApiKeyBrothar*
}
and committed.
But if I push everything to Github, they could access any older commit, and retrieve my api_key.
I've seen similar questions, and the solution seems to be git filter-branch, but it seems that it removes a specific file across the commit history. I want to remove just the key (or that line, for that matter), since I want the *putYaOwnApiKeyBrothar* code available in all my commits. (In case they have to check an older one).
Is that even possible? Is there a simple way? If not, what should I do? Am I being dumb?