fix(Remove screenshot restriction): Improve reliability (#471)

This commit is contained in:
Linus 2023-11-10 01:06:01 +00:00 committed by GitHub
parent c73f8f752d
commit 4b8a9b9b13

View File

@ -5,6 +5,10 @@ import android.view.WindowManager;
public class RemoveScreenshotRestrictionPatch { public class RemoveScreenshotRestrictionPatch {
public static void addFlags(Window window, int flags) {
window.addFlags(flags & ~WindowManager.LayoutParams.FLAG_SECURE);
}
public static void setFlags(Window window, int flags, int mask) { public static void setFlags(Window window, int flags, int mask) {
window.setFlags(flags & ~WindowManager.LayoutParams.FLAG_SECURE, mask & ~WindowManager.LayoutParams.FLAG_SECURE); window.setFlags(flags & ~WindowManager.LayoutParams.FLAG_SECURE, mask & ~WindowManager.LayoutParams.FLAG_SECURE);
} }