【问题标题】:Why is Google Assistant able to take the screenshots even if FLAG_SECURE is set?为什么即使设置了 FLAG_SECURE,Google Assistant 也能截图?
【发布时间】:2019-12-07 11:22:44
【问题描述】:

我的应用中有一些用户敏感信息,我想通过标准系统快捷方式或 Google 助理禁用其中的屏幕截图。我使用的 WindowManager 的 FLAG_SECURE 不会在某些设备上通过 Google Assistant 禁用屏幕截图。是系统错误吗?有什么解决方法吗?

documentation 之后,我为我的活动窗口设置了 FLAG_SECURE。它不适用于所有设备。

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
                WindowManager.LayoutParams.FLAG_SECURE);
        setContentView(R.layout.activity_main);
}

在 Google Pixel 2 设备 (Android 9.0) 上运行良好。屏幕截图被禁用。谷歌助手返回黑色图像作为屏幕截图。 在三星 A6 设备 (Android 9.0) 上,我无法通过系统快捷方式截屏,但 Google 助理仍然可以截屏。

【问题讨论】:

    标签: android google-assistant-sdk


    【解决方案1】:

    这是一个已知的安全问题。似乎它已经在 Pixel 设备上用最新的安全补丁修复了,但在三星设备上没有。

    【讨论】:

      猜你喜欢
      • 2010-12-25
      • 2022-08-11
      • 1970-01-01
      • 1970-01-01
      • 2023-03-21
      • 2021-12-02
      • 1970-01-01
      • 1970-01-01
      • 2015-09-02
      相关资源
      最近更新 更多