FLAG_SECURE not working on Google Pixel devices

Đang mở
#2,132 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
android, kotlin
Lĩnh vực
mobile, security

Hướng nghiên cứu

Không xác định được tệp repository hoặc bài kiểm thử nào. Trước tiên, hãy tái hiện việc phát JW Player ở chế độ toàn màn hình trên các thiết bị Pixel đã kiểm thử bằng các lệnh gọi FLAG_SECURE được hiển thị, sau đó xác định xem chế độ toàn màn hình có sử dụng một cửa sổ hoặc activity riêng hay không và xác minh rằng tính năng chụp màn hình bị chặn trước khi đề xuất thay đổi repository.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
Is there an existing issue for this?
  • I have searched the existing issues
Is there a StackOverflow question about this issue?
  • I have searched StackOverflow
What happened?

I am developing an Android application using the View/XML approach and need to prevent screenshots and screen recordings. To achieve this, I have enabled FLAG_SECURE using:

window?.addFlags(WindowManager.LayoutParams.FLAG_SECURE)

window?.setFlags(
WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE
)
This works as expected on most devices, where screenshots and screen recordings are blocked successfully.

However, I have observed different behavior on Google Pixel devices (tested on Pixel 4 and Pixel 9). When a video is played in fullscreen mode using JW Player, users are still able to capture the screen, suggesting that FLAG_SECURE is not being enforced for the fullscreen video view.

Am I missing any additional configuration or implementation step for fullscreen video playback with JW Player? Does JW Player create a separate window/activity that requires FLAG_SECURE to be applied separately?

Additional details:

UI framework: View/XML (not Compose)

Video player: JW Player

Devices tested: Google Pixel 4 and Pixel 9

Android versions: 16 & 13

No errors or crashes are observed; the issue is only that screen capture is not blocked during fullscreen playback.

What could be causing FLAG_SECURE to be ineffective in this specific fullscreen video scenario on Pixel devices?

Relevant logcat output

Code of Conduct
  • I agree to follow this project's Code of Conduct
Ngôn ngữ chính
Kotlin
Star
22.1k
Fork
4.7k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của android/nowinandroid

Tất cả issue của android/nowinandroid

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.