Skip to content

v0.27.4

Latest

Choose a tag to compare

@Verlintas Verlintas released this 27 Sep 04:47
· 4 commits to main since this release

v0.27.4 — 重要修复:截屏权限不再「自己掉」(AI 不再全瞎)

问题

Android 14+ 上,每次授权只能创建一次屏幕投影(系统限制:MediaProjection token 单次消费)。旧实现每次截图都重建投影——导致第二次截图起必定失败并提示「授权已失效」,AI 在做完一次屏幕分析后即变「全瞎」。

修复

  • 重构为持续投影:授权一次后创建常驻的虚拟显示与帧缓冲,整个会话期间复用;每次截图直接读取最新帧,不再重建、不再重复消费授权
  • 前台服务保持进程常驻:切后台、锁屏期间授权持续有效
  • 屏幕旋转/分辨率变化自动适配(调整投影尺寸并更换帧缓冲)
  • 投影错误现在带具体原因记录,便于诊断

实测:一次授权后连续两次截图全部成功(此前第二次必挂)。

说明(系统限制)

应用进程被系统彻底杀掉后,Android 要求重新授权(平台设计,所有投屏类应用均如此);正常情况下前台服务会保持授权有效。

SHA-256:

  • full: b6e0f6299629851b7ed19a65faf8f6f6822ef7c0d0f374b00a91a78666c4fcbc
  • lite: bd23d045f9825e87cd4cec28625c62ce8de1cba114b8424c0b667495f7fddee4

v0.27.4 — Important fix: screen-capture permission no longer 'falls off'

Problem

On Android 14+ a MediaProjection token can create exactly ONE virtual
display and can only be consumed once (platform restriction). The old
implementation rebuilt the projection on every capture, so the second
screenshot always failed with 'authorization expired' - after one screen
analysis the AI went blind.

Fix

  • Rewritten as a persistent projection: after authorization the
    service creates the virtual display and frame buffer once and keeps
    them for the whole session; every capture reads the latest frame -
    no rebuilding, no token reuse
  • Foreground service keeps the process alive: the grant survives
    backgrounding and screen-off
  • Rotation/resolution changes are handled by resizing the projection
    and swapping the frame buffer
  • Projection errors are now logged with their exception for diagnosis

Verified on emulator: one authorization, two consecutive screenshots
both succeeded (previously the second always failed).

Note (platform behavior)

If the OS fully kills the app process, Android requires re-authorization
(true for all casting/screen-sharing apps); the foreground service
normally keeps the grant alive.

SHA-256:

  • full: b6e0f6299629851b7ed19a65faf8f6f6822ef7c0d0f374b00a91a78666c4fcbc
  • lite: bd23d045f9825e87cd4cec28625c62ce8de1cba114b8424c0b667495f7fddee4