FabriBertani / Plugin.Maui.ScreenSecurity

Safeguard your .NET MAUI app effortlessly by preventing content exposure, screenshots, and recordings with ease.
MIT License
160 stars 12 forks source link

Android Emulator - Take screenshot (ctrl+s) is still capturing the screen. #29

Closed darrenjlewington closed 7 months ago

darrenjlewington commented 7 months ago

I've added the following code to an OnAppearing method:

    protected override void OnAppearing()
    {
        base.OnAppearing();

if ANDROID

        ScreenSecurity.Default.ActivateScreenSecurityProtection();

elif IOS

        var screenProtectionOptions = new ScreenProtectionOptions
        {
            HexColor = "#6C4675",
            PreventScreenshot = true,
            PreventScreenRecording = true
        };

        ScreenSecurity.Default.ActivateScreenSecurityProtection(screenProtectionOptions);

endif

    }

But when I run the code through an Android emulator, a screen shot (ctrl+s) is still being captured!

I'm using: Windows 11 Home. Microsoft Visual Studio Professional 2022 (64-bit) - Current Version 17.8.5. Android 14.0 - API 34. Android Emulator - Pixel 5.

Thank you in advance for your help.

Kind regards,

Darren

darrenjlewington commented 7 months ago

I should have also mentioned that I'm using: Plugin.Maui.ScreenSecurity - version 1.1.6. .Net - version 8.

Thank you & kind regards,

Darren

darrenjlewington commented 7 months ago

After further testing today, it would appear that when you go into multi-window mode in the emulator the take screenshot option there (at the bottom of the emulator) is indeed disabled.

However, the take screenshot (ctrl+s) option to the right of the emulator still captures the screen.

I must admit that I'm new to mobile app delelopment, so please accept my apologies if I'm mis-understanding.

Kind regards,

Darren

FabriBertani commented 7 months ago

Hi @darrenjlewington how are you?

Yes, most of this stuff is better to test on a physical device, emulators and simulators sometimes are mixed with the host OS and things like screenshots are taken by the host OS instead of the emulator/simulator.

I'll close this for now. Re-open it if you have any further issues.

darrenjlewington commented 7 months ago

Hi Fabricio,

I'm very well thank you. Hope you are to.

Thank you so much for getting back to me, especially over the weekend.

I understand, and thank you for the explanation. Deploying to an actual device will be my next challenge. 🙂

Enjoy the rest of the weekend and kind regards,

Darren

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: Fabricio Bertani @.> Sent: Saturday, April 6, 2024 9:53:44 PM To: FabriBertani/Plugin.Maui.ScreenSecurity @.> Cc: Darren Lewington @.>; Mention @.> Subject: Re: [FabriBertani/Plugin.Maui.ScreenSecurity] Android Emulator - Take screenshot (ctrl+s) is still capturing the screen. (Issue #29)

Hi @darrenjlewingtonhttps://github.com/darrenjlewington how are you?

Yes, most of this stuff is better to test on a physical device, emulators and simulators sometimes are mixed with the host OS and things like screenshots are taken by the host OS instead of the emulator/simulator.

I'll close this for now. Re-open it if you have any further issues.

— Reply to this email directly, view it on GitHubhttps://github.com/FabriBertani/Plugin.Maui.ScreenSecurity/issues/29#issuecomment-2041179157, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARKBFL7S7P3NVW44PON2JTTY4BHERAVCNFSM6AAAAABFZXRYWWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBRGE3TSMJVG4. You are receiving this because you were mentioned.Message ID: @.***>