android - APK 包中的 .properties 文件的用途是什么?

标签 android firebase google-play-services apk packaging

在分析 APK 时,我发现存档的根目录中有很多 .properties 文件,指示 Google Play 服务、Firebase 和 Google HTTP 客户端的版本号,例如:

version=19.2.0
client=firebase-database
firebase-database_client=19.2.0

这些理论上可以从包中排除:

android {
    packagingOptions {
        exclude "firebase-*.properties"
        exclude "play-services-*.properties"
        exclude "google-http-client.version"
    }
}

然而,这 issue表明这将是“预期行为”。那么从包中排除这些看似无用的文件是否安全——或者 Google Play 是否需要它们,以便将这些版本号暴露给自动包内容扫描?这些版本号文件的用途是否记录在某处?


这是我正在谈论的内容的屏幕截图:

Analyze APK screenshot

最佳答案

文档中回答问题的部分当时可能不存在:


来源:Dependency information for Play Console :

When building your app using AGP 4.0.0 and higher, the plugin includes metadata that describes the library dependencies that are compiled into your app. When uploading your app, the Play Console inspects this metadata to provide alerts for known issues with SDKs and dependencies your app uses, and, in some cases, provide actionable feedback to resolve those issues.

The data is compressed, encrypted by a Google Play signing key, and stored in the signing block of your release app. We recommend keeping this dependencies file for a safe and positive user experience. However, if you’d rather not share this information, you can opt out by including the following dependenciesInfo block in your module’s build.gradle file.

android {
    dependenciesInfo {

        // Disables dependency metadata when building APKs.
        includeInApk = false

        // Disables dependency metadata when building Android App Bundles.
        includeInBundle = false
    }
}

关于android - APK 包中的 .properties 文件的用途是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58811165/

相关文章:

java - Spinner setSelection() 不起作用

firebase - 如何使用 flutter 从错误对话框中导航

eclipse - 如何将 Google Play Services 2 库安装修复到 Eclipse

java - 安卓工作室 : Project successfully compiled but can't access Google Play Services on device

java - EditText 下一个 Button 键盘

java - 在一类 MyGdx Game 中编写了整个游戏。我如何制作主菜单? libgdx

swift - 使用任务返回 UIImage 异步

javascript - 我如何在 firestore 字段的数组字段中循环并检索最后一个对其具有真实值(value)的结果?

android - Google API 与 Google Play 服务,为什么我们现在需要 Google API?

适用于 Kotlin 的 Android Parcelable 无法正常工作