scrcpyd/README.md
2025-12-20 10:58:38 -06:00

58 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# scrcpyd
![scrcpyd icon](icon.png)
A Magisk module that keeps your device unlocked **only while scrcpy is running and ADB is connected**. It does **not** remove your PIN/pattern and restores your original lock timeout as soon as scrcpy exits.
Built for long XR sessions where repeated unlocks are disruptive, without weakening security when scrcpy is not in use.
## Features
- **Scoped to scrcpy**: active only when the scrcpy server process exists.
- **ADBgated**: requires ADB connection (USB or wireless).
- **Restores settings**: original lock timeout is restored immediately on exit.
- **Optional screenawake**: only when scrcpy is started with `--stay-awake`.
## Install
1) Download the latest ZIP from Releases.
2) Magisk → Modules → Install from storage → select the ZIP.
3) Reboot.
## Usage
- Normal (keep unlocked, screen may still dim):
```bash
scrcpy
```
- Keep the screen awake too:
```bash
scrcpy --stay-awake
```
## How It Works
While scrcpy is running **and** ADB is connected, the module:
- Sets `lock_screen_lock_after_timeout` to a very large value.
- If `--stay-awake` is detected in the scrcpy process args, it also sets `screen_off_timeout` to a very large value and issues a wake event.
When scrcpy stops or ADB disconnects, it restores your original values.
## Safety & Security
- Your PIN/pattern remains intact.
- No changes persist after scrcpy exits.
- The module is inert when ADB is off or scrcpy is not running.
## Compatibility
- Tested on Android 16 (LineageOS) + Magisk.
- Should work on most modern Android builds with Magisk and root.
## Files
- `service.sh`: background watcher/keepalive loop
- `module.prop`: Magisk metadata
- `icon.svg`: module icon
## Uninstall
- Magisk → Modules → Remove
- Reboot
## Release
Latest release: https://github.com/sudoxreboot/scrcpyd/releases