2022-10-09 Android app禁止截屏方法 和 在禁止截屏的情况下录制屏幕

一、APP有时候为了保护用户的隐私安全会禁止用户录屏和截屏,比如金融类的app等。可以在app的onCreate方法中添加这么一段代码

      1、代码

//禁止app录屏和截屏
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);

      2、效果图,禁止截屏

二、那在app禁止截屏的情况下如何录屏呢?

       1、使用scrcpy ,下载scrcpy

       2、下载链接 Releases · Genymobile/scrcpy · GitHub

       3、执行scrcpy 命令就可以投射屏幕了。

       4、执行scrcpy --record file2.mp4 录制屏幕

 

三、参考文章

Android 关于禁止应用截屏和录屏_你好世界丶的博客-CSDN博客APP有时候为了保护用户的隐私安全会禁止用户录屏和截屏,录入说视频交友类的app,金融类的app等可以在app的onCreate方法中添加这么一段代码:@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //禁止app录屏和截屏 getWindow().setFlags(WindowManager.https://blog.csdn.net/Blog_Sun/article/details/108731843#:~:text=%E9%93%B6%E8%A1%8C%E7%9B%B8%E5%85%B3%E7%9A%84%E3%80%82-,%E7%A6%81%E6%AD%A2%E5%BD%95%E5%B1%8F%E5%92%8C%E6%88%AA%E5%B1%8F%E5%B9%B6%E4%B8%8D%E9%9A%BE%EF%BC%8C%E5%8F%AA%E9%9C%80%E8%A6%81,%E7%9A%84%E6%97%B6%E5%80%99%EF%BC%8C%E7%9C%8B%E4%BC%BC%E8%83%BD%E5%A4%9FHow to Take a Screenshot in Android Bypassing Restriction (2020) | BeebomLearn about a simple way to take a screenshot in Android bypassing restriction. And the best part is that you don't even need root access.https://beebom.com/take-screenshot-android-bypassing-restriction/

猜你喜欢

转载自blog.csdn.net/qq_37858386/article/details/127233692