Making a FLAG_SECURE window invisible from a screenshot on Android
Asked Answered
W

0

8

I have a floating window that has a flag FLAG_SECURE. It is successfully hidden from screencaptures and a MediaProjection that I have set up. It is shown as black rectangular object when I record through a MediaProjection. Everything from my floating window is blacked out.

    WindowManager windowManager = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
    WindowManager.LayoutParams params = new WindowManager.LayoutParams();

    params.type = WindowManager.LayoutParams.TYPE_PHONE;
    params.format = PixelFormat.TRANSPARENT;
    params.flags = WindowManager.LayoutParams.FLAG_SECURE;

    windowManager.addView(floatingView, params);

My question is, is it possible to hide this floating window? I mean to not show it as a black object but instead capture content under the floating window so that it is completely hidden from MediaProjection?

Wrinkle answered 23/8, 2016 at 8:54 Comment(3)
you already had success with this? i'm also searching this solution. +1 to your question.Twerp
@Twerp no haven't found a solution yetWrinkle
i too searching this solution +1 to your questionAsk

© 2022 - 2024 — McMap. All rights reserved.