mirror of
https://github.com/sudoxreboot/scrcpyd
synced 2026-04-14 11:36:40 +00:00
61 lines
1.9 KiB
Markdown
61 lines
1.9 KiB
Markdown
# scrcpyd
|
||
|
||
<p align="center">
|
||
<img src="icon.svg" alt="scrcpyd icon" width="256">
|
||
</p>
|
||
|
||

|
||
|
||
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.
|
||
- **ADB‑gated**: requires ADB connection (USB or wireless).
|
||
- **Restores settings**: original lock timeout is restored immediately on exit.
|
||
- **Optional screen‑awake**: 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/keep‑alive loop
|
||
- `module.prop`: Magisk metadata
|
||
- `icon.png`: module icon
|
||
|
||
## Uninstall
|
||
- Magisk → Modules → Remove
|
||
- Reboot
|
||
|
||
## Release
|
||
Latest release: https://github.com/sudoxreboot/scrcpyd/releases
|