I created an Android project that is stored on GitHub as a public repository. The project contains an API key that should not be viewable. To prevent this key from being published, I placed it in the config.properties file. In AndroidManifest.xml, the key value contains dummy data. To run the testing application, I am currently inserting a key into the manifest, before starting and replacing it with dummy data, before making any changes to GitHub.
My question is, how do I access a property api.keyin config.properties from AndroidManifest.xml? Idealy, when the gradle file creates a project, the api.key value is inserted into AndroidManifest.xml, but never displayed on GitHub because the .gitignore file does not allow .properties files.
source
share