如何在反编译apk中得到Google-Service.Json文件?

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

我想知道在 android apk 上进行逆向工程时是否可以获取 google-service.json 文件。因为在 firebase Google-Service json 文件中包含项目的所有密钥。

JSON 文件未包含在您的 APK 中,发生的情况是您的 google/firebase Gradle 插件读取 JSON 文件并将其插入 string资源文件。 但是通过使用 apktool 等工具对 apk 进行逆向工程,任何人都可以访问这些资源文件,包括您的字符串资源文件和您放入 java 代码中的原始字符串。

如果反编译 APK,您将从字符串资源文件中获得这些 secret 详细信息。

  <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)

编辑:有关 acl 或保护您的 firebase 数据库操作的详细信息,请参阅 here