wesleydeng
V2EX  ›  Android

请问 scrcpy --turn-screen-off 是如何设置手机黑屏时,投屏不黑屏可以正常显示的。

  •  
  •   wesleydeng · Oct 15, 2023 · 13856 views
    This topic created in 1117 days ago, the information mentioned may be changed or developed.

    在使用 mediaprojection 镜像模式下,进行投屏功能开发时,如果要想手机黑屏,远程投屏是正常,该设置那些

    11 replies  •  2023-10-28 23:44:23 +08:00
    seers
    seers
    Oct 15, 2023
    1
    --stay-awake --turn-screen-off
    wesleydeng
    wesleydeng
    OP
    Oct 15, 2023
    3
    @seers 谢谢大佬。请问下这个设置的原理。
    wesleydeng
    wesleydeng
    OP
    Oct 15, 2023
    4
    @ysc3839 谢谢大佬,这个 SurfaceControl 拷贝下来,使用反射调用 SurfaceControl.getPhysicalDisplayIds() 提示无法反射,提示没权限
    ysc3839
    ysc3839
    Oct 15, 2023 via Android
    5
    @wesleydeng 应该要 adb 权限的
    wesleydeng
    wesleydeng
    OP
    Oct 15, 2023
    6
    @ysc3839 谢谢大佬,那如何在在不要 adb 权限也做到类似效果啊?同类产品乐播好像也可以。
    ysc3839
    ysc3839
    Oct 15, 2023 via Android
    7
    @wesleydeng 那你可以逆向乐播看看是如何实现的
    wesleydeng
    wesleydeng
    OP
    Oct 16, 2023
    8
    @ysc3839 太难了,没搞定
    SupperMary
    SupperMary
    Oct 20, 2023
    9
    @wesleydeng hide 的接口普通应用是无法反射的,参考 https://developer.android.google.cn/about/versions/10/non-sdk-q?hl=zh-cn#enable-non-sdk-access

    设对应的 settings 之后看是否能反射了。
    wesleydeng
    wesleydeng
    OP
    Oct 28, 2023
    10
    @ysc3839 太难了,没搞定
    @SupperMary 这个也是需要 adb 命令操作,有没有不需要 adb 的命令呢。图片滤镜能去除黑色遮罩吗
    SupperMary
    SupperMary
    Oct 28, 2023
    11
    @wesleydeng 没有 adb 的话,好像有漏洞可以绕过 hiden api 不允许反射的限制,你可以搜搜。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1358 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 19:39 · PVG 03:39 · LAX 11:39 · JFK 14:39
    ♥ Do have faith in what you're doing.