简体   繁体   English

Google Play 是否为启动前测试激活 StrictMode?

[英]Is Google Play activating StrictMode for prelaunch tests?

I have submitted an app to Google Play and the Play Console prelaunch tests show a number of API policy violations (use of restricted / unsupported APIs):我已经向 Google Play 提交了一个应用程序,并且 Play 控制台预发布测试显示了许多 API 政策违规行为(使用受限/不受支持的 API):

谷歌播放控制台

When I check the stack traces for these events I see that the API policy violation was detected by StrictMode.当我检查这些事件的堆栈跟踪时,我看到 StrictMode 检测到 API 策略违规。 Here's one example:这是一个例子:

StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Lcom/android/org/conscrypt/ConscryptEngineSocket;->setHostname(Ljava/lang/String;)V
    at android.os.StrictMode.lambda$static$1(StrictMode.java:416)
    at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at java.lang.Class.getDeclaredMethodInternal(Native Method)
    at java.lang.Class.getPublicMethodRecursive(Class.java:2079)
    at java.lang.Class.getMethod(Class.java:2066)
    at java.lang.Class.getMethod(Class.java:1693)
    at e.g0.k.e.b(Unknown Source:1)
    at e.g0.k.e.a(Unknown Source:7)
    at e.g0.k.e.d(Unknown Source:4)
    at e.g0.k.e.e(Unknown Source:0)
    [...]

This puzzles me for a few reasons:这让我感到困惑有几个原因:

  1. I did not enable StrictMode in my app.我没有在我的应用程序中启用 StrictMode。 Is Google modifying the submitted APK in order to enable StrictMode for the prelaunch tests? Google 是否正在修改提交的 APK 以启用 StrictMode 进行预启动测试? I couldn't find any information on this anywhere.我在任何地方都找不到这方面的任何信息。

  2. I am ignoring the two warnings related to View and ViewGroup (according to the report, these are known issues related to AndroidX and I don't need to do anything about them).我忽略了与 View 和 ViewGroup 相关的两个警告(根据报告,这些是与 AndroidX 相关的已知问题,我不需要对它们做任何事情)。 The other four issues are related to Conscrypt restricted APIs which are restricted starting with Android 11 (API level 30).其他四个问题与 Conscrypt 受限 API 有关,这些 API 从 Android 11(API 级别 30)开始受到限制。 My app targets Android 10 (API level 29) where usage of these APIs should be OK.我的应用程序针对 Android 10(API 级别 29),这些 API 的使用应该没问题。 Why are these reported as warnings / errors?为什么这些报告为警告/错误? Furthermore, why are 2 of them reported as warnings ("unsupported") and 2 of them reported as errors ("fully restricted")?此外,为什么其中 2 个报告为警告(“不支持”)而其中 2 个报告为错误(“完全受限”)? (all 4 are OK in Android 10 and all 4 are restricted in Android 11) (在 Android 10 中所有 4 个都可以,在 Android 11 中所有 4 个都受到限制)

Re #1, Google does not have to modify your APK to enable StrictMode.关于 #1,Google 不必修改您的 APK 即可启用 StrictMode。 I believe it might be possible to enable it device wide.我相信有可能在设备范围内启用它。

Re #2, Looking at the restricted APIs for Android 10 in, I see that Lcom/android/org/conscrypt/ConscryptEngineSocket;->setHostname(Ljava/lang/String;) is on the blacklist, which means it should throw an error at runtime.关于#2,查看 Android 10 in 的受限 API ,我看到Lcom/android/org/conscrypt/ConscryptEngineSocket;->setHostname(Ljava/lang/String;)在黑名单上,这意味着它应该抛出错误在运行时。 Also, the setAlpnProtocols are on the greylist, not the blacklist, so that explains the difference between the warnings and the errors.此外, setAlpnProtocols在灰名单上,而不是黑名单上,因此可以解释警告和错误之间的区别。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Play 预发布报告崩溃 - Google Play Prelaunch Report Crash 激活由ionic制作的Android应用的strictmode - Activating strictmode for android app made with ionic Play 商店预发布报告中的 Android 应用程序崩溃,但可在真实设备中运行 - Android app crash in play store prelaunch report but working in real device 我可以定义Google Play UI测试的方案吗? - Can I define scenarios for Google Play UI tests? 以编程方式激活Google地图中的图层 - activating layers in google maps programmatically Google Maps v2 @ Android片段出现StrictMode错误 - StrictMode error with Google Maps v2 @ Android fragment 更新 Google Play 服务通知,使 Firebase 测试实验室设备上的测试失败 - Update Google Play services notification making tests fail on Firebase Test Lab devices 严格模式 + 分析 - StrictMode + Analytics Google Play开发者控制台-如何直接运行Firebase测试实验室的仪器测试? - google play dev console - how to run firebase test labs instrumentation tests directly? 在Google Play Developer控制台中,我在启动前测试中收到警告,提到: - In the Google Play Developer console, I'm getting warnings in the Pre-Launch tests mentioning:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM