hgjazhgj / FGO-py

自动爬塔! 自动每周任务! 全自动免配置跨平台的Fate/Grand Order助手.启动脚本,上床睡觉,养肝护发,满加成圣诞了解一下?
http://fgo-py.hgjazhgj.top/
GNU Affero General Public License v3.0
1.53k stars 179 forks source link

调整为16:9发生错误 #92

Closed GamerNoTitle closed 1 year ago

GamerNoTitle commented 1 year ago

在提问之前...

描述你的问题

我的手机是红米NOTE11,使用数据线+adb进行连接,在调整为16:9时出现了此问题(手机具体信息见“还有别的嘛”节的截图)

PS:貌似是缺少权限,我自己用ADB去改了一下发现报java.lang.SecurityException: Must hold permission android.permission.WRITE_SECURE_SETTINGS,关闭MIUI优化同样存在这个问题


以下是控制台输出的Log

From https://github.com/hgjazhgj/FGO-py
 * branch            master     -> FETCH_HEAD
Already up to date.
[2022-12-28 10:58:57,951][INFO]<fgo> FGO-py v10.2.2
[2022-12-28 10:59:05,023][INFO]<airtest.core.android.rotation> update orientation None->1
Traceback (most recent call last):
  File "F:\Git\FGO-py\FGO-py\FGO-py\fgoGui.py", line 179, in invoke169
    fgoDevice.device.invoke169()
  File "F:\Git\FGO-py\FGO-py\FGO-py\fgoAndroid.py", line 70, in invoke169
    if x*16<y*9:self.adb.raw_shell('wm size %dx%d'%(x,x*16//9))
  File "F:\Git\FGO-py\Python39\lib\site-packages\airtest\core\android\adb.py", line 332, in raw_shell
    out = self.cmd(cmds, ensure_unicode=False)
  File "F:\Git\FGO-py\Python39\lib\site-packages\airtest\core\android\adb.py", line 197, in cmd
    raise AdbError(stdout, stderr)
airtest.core.error.AdbError: stdout[b''] stderr[b"\r\nException occurred while executing 'size':\r\njava.lang.SecurityException: Must hold permission android.permission.WRITE_SECURE_SETTINGS\r\n\tat com.android.server.wm.WindowManagerService.setForcedDisplaySize(WindowManagerService.java:5799)\r\n\tat com.android.server.wm.WindowManagerShellCommand.runDisplaySize(WindowManagerShellCommand.java:202)\r\n\tat com.android.server.wm.WindowManagerShellCommand.onCommand(WindowManagerShellCommand.java:76)\r\n\tat com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)\r\n\tat android.os.ShellCommand.exec(ShellCommand.java:38)\r\n\tat com.android.server.wm.WindowManagerService.onShellCommand(WindowManagerService.java:1367)\r\n\tat android.os.Binder.shellCommand(Binder.java:956)\r\n\tat android.os.Binder.onTransact(Binder.java:840)\r\n\tat android.view.IWindowManager$Stub.onTransact(IWindowManager.java:3096)\r\n\tat com.android.server.wm.WindowManagerService.onTransact(WindowManagerService.java:1640)\r\n\tat android.os.Binder.execTransactInternal(Binder.java:1190)\r\n\tat android.os.Binder.execTransact(Binder.java:1149)\r\n"]

如何复现

  1. 打开FGO-py的GUI
  2. 点击控制
  3. 选择全面屏适配,点击调整为16:9
  4. 出现问题

预期行为

控制台报错,然后FGO-py可能直接退出

相关 Logs

[2022-12-28 10:58:57,951][INFO]<fgo> FGO-py v10.2.2
[2022-12-28 10:58:59,759][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe devices
[2022-12-28 10:59:01,145][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 wait-for-device
[2022-12-28 10:59:01,211][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell getprop ro.build.version.sdk
[2022-12-28 10:59:03,918][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell ls -l /data/local/tmp/rotationwatcher.jar
[2022-12-28 10:59:04,006][DEBUG]<airtest.core.android.rotation> install_rotationwatcher skipped
[2022-12-28 10:59:04,006][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell app_process -Djava.class.path=/data/local/tmp/rotationwatcher.jar /data/local/tmp com.example.rotationwatcher.Main
[2022-12-28 10:59:04,463][DEBUG]<airtest.utils.nbsp> [rotation_server]b'90'
[2022-12-28 10:59:05,024][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell wm size
[2022-12-28 10:59:05,023][INFO]<airtest.core.android.rotation> update orientation None->1
[2022-12-28 10:59:05,024][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell wm size
[2022-12-28 10:59:05,143][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell getprop ro.sf.lcd_density
[2022-12-28 10:59:05,146][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell getprop ro.sf.lcd_density
[2022-12-28 10:59:05,235][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell dumpsys SurfaceFlinger
[2022-12-28 10:59:05,249][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell dumpsys SurfaceFlinger
[2022-12-28 10:59:05,405][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell dumpsys input
[2022-12-28 10:59:05,406][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell dumpsys input
[2022-12-28 10:59:05,496][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell getevent -p
[2022-12-28 10:59:05,498][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell getevent -p
[2022-12-28 10:59:05,594][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell dumpsys window windows
[2022-12-28 10:59:05,605][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell ls -l /data/local/tmp/maxpresent.jar
[2022-12-28 10:59:05,710][DEBUG]<airtest.core.android.touch_methods.maxtouch> install_maxtouch skipped
[2022-12-28 10:59:05,710][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 forward --no-rebind tcp:17016 localabstract:maxpresent_17016
[2022-12-28 10:59:05,773][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell app_process -Djava.class.path=/data/local/tmp/maxpresent.jar /data/local/tmp com.netease.maxpresent.MaxPresent socket maxpresent_17016
[2022-12-28 10:59:06,288][DEBUG]<airtest.utils.nbsp> [airtouch_server]b'Metrics Message : 2400.0=====1080.0'
[2022-12-28 10:59:06,289][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell wm size
[2022-12-28 10:59:06,307][DEBUG]<airtest.utils.nbsp> [airtouch_server]b'Start local socket (maxpresent_17016) server...'
[2022-12-28 10:59:06,384][DEBUG]<airtest.core.android.adb> F:\Git\FGO-py\Python39\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s dcba23b10509 shell wm size 1080x1920

截图

No response

还有别的吗?

手机系统信息 37bf59f12f86fd262e26e0ee8e2e039

来点色图

image

hgjazhgj commented 1 year ago

Android 12 是这样的... 我今年5月遇到过这个问题,当时查到的一堆资料说了什么已经忘了,反正我最后决定刷回Android11,并且禁用了手机的系统更新( 这是当时的聊天记录,只剩一张缩略图了凑合着看吧 image

GamerNoTitle commented 1 year ago

Android 12 是这样的... 我今年5月遇到过这个问题,当时查到的一堆资料说了什么已经忘了,反正我最后决定刷回Android11,并且禁用了手机的系统更新( 这是当时的聊天记录,只剩一张缩略图了凑合着看吧

好吧 那就没办法了 :<

GamerNoTitle commented 1 year ago

BTW如果我没理解错的话 如果要用WSA来跑FGO的话在连接到设备那里就应该填入wsa对吧 image image

但是酱紫好像连接不上?输入localhost:58526就能连接上 image

输入localhost:58526就点不到东西惹 :( image

hgjazhgj commented 1 year ago

image
隔壁的图,我直接进行一个摆的开

GamerNoTitle commented 1 year ago

好摆√ 我的WSA其实截图是正常的,可能定位上出了问题 主要是要用WSL所以HyperV得开着 算了 用我的surface跑个蓝叠吧 谢谢