How to get Google-Service.Json file in decompile apk?

怎甘沉沦 提交于 2019-12-05 02:36:58

JSON file is not included in your APK, what happens is your google/firebase Gradle plugin reads the JSON file and inserts it in string resource file. But by reverese engineering an apk using tools like apktool, anyone can access these resource files including your string resource file and raw string you put in your java code.

If you decompile the APK, you will get these secret details from string resource files.

  <string name="google_api_key">your key</string>
  <string name="firebase_database_url">firebase db url</string>

if you added firebase ACL, only authorized user can access the data, and also the key you are using can only be used with apk that signed with your keystore ( make sure sha1 hash you generated in firebase console for android app)

EDIT: For details on acl or protecting your firebase database operations see here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!