Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ffa7b34
Refactor code formatting and improve readability in ScreenLock module
fahim-ahmed05 Apr 24, 2025
335063d
Remove hide_content feature description from README
fahim-ahmed05 Apr 24, 2025
9234b53
Update README to clarify plugin functionality and improve formatting
fahim-ahmed05 Apr 24, 2025
3e5d5ae
Update README to enhance cautionary notes regarding plugin security
fahim-ahmed05 Apr 24, 2025
3fd9af2
Consolidate cautionary notes in README for clarity and emphasis on se…
fahim-ahmed05 Apr 24, 2025
e8a4532
Fix formatting of cautionary note in README for improved clarity
fahim-ahmed05 Apr 24, 2025
e312d15
Refactor onResume method for safe device wake-up handling and improve…
fahim-ahmed05 Apr 24, 2025
6393d62
Fix formatting of menu entry in README for consistency
fahim-ahmed05 Apr 24, 2025
2e477f9
Fill background with color instead of using fullscreen dialog
lnx00 May 6, 2025
ae0fdc5
Added option to change password
lnx00 May 6, 2025
00c6de2
Store password in settings file
lnx00 May 6, 2025
58ac7bf
Hash the password instead of storing it in plain text
lnx00 May 7, 2025
7e4da83
Added preview image to README
lnx00 May 7, 2025
86caf6a
Merge pull request #1 from lnx00/main
fahim-ahmed05 May 7, 2025
62b3766
Added a numeric only keyboard
lizzzhh Aug 9, 2025
d392308
Merge pull request #3 from lizzzhh/main
fahim-ahmed05 Aug 9, 2025
90c6239
changed preview image
fahim-ahmed05 Aug 15, 2025
45b30bc
change button layout to t9
fahim-ahmed05 Jan 1, 2026
45b3703
fix typo
fahim-ahmed05 Jan 1, 2026
c004008
cancel on lockscreen put device to sleep
fahim-ahmed05 Jan 1, 2026
862e7ca
add new info
fahim-ahmed05 Jan 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/assets/preview-password.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/preview-pin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
"workspace.library": [
"~/koreader-base/ffi",
"~/koreader/frontend"
],
"runtime.version": "LuaJIT",
"hint.enable": false
}
69 changes: 57 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,61 @@
# screenlock_koreader_plugin
This is a small plugin to enable locking the screen of the KOReader.
# KOReader Plugin: ScreenLock

## Setup
1. Put `screenlock.koplugin` into the `kodreader/plugins` directory.
2. Change the hardcoded password at the top of the main.lua from 1234 to something else.
This plugin adds a simple pin-based lock screen to KOReader.

The plugin will automatically activate on resume from suspend. There is also a screenlock menu entry added.
> [!CAUTION]
> This plugin provides **basic protection only**.
> It is **not a security solution** and will not stop a determined or technically skilled attacker.
> Do not rely on it to protect sensitive data.

### Hide Content Feature
Change `hide_content` bool to `true` to enlarge the input box and hide the screen until the password is entered correctly. This stops unauthorized users from seeing what books you're reading even if they turn on the device. Set bool to `false` to return to the small password box.
## Features

> [!CAUTION]
> This plugin is made for basic protection, not security — it may not protect your device from an experienced attacker.
>
> Always keep your device out of the hands of real threats.
- Lock KOReader with a password
- Automatically locks after device suspend / resume
- Optional blank (white) screen to hide document contents
- On-screen password keyboard
- Menu actions for locking and password management

## Installation

1. Copy the `screenlock.koplugin` folder into:
```
koreader/plugins/
```
2. Start (or restart) KOReader.
3. Open the KOReader menu and select **ScreenLock**.

## Usage

### Lock the screen

- Open the KOReader menu
- Go to **ScreenLock**
- Select **Lock now**

> or

- Press power/lock button

### Change the password

- Open **ScreenLock** in the menu
- Select **Change password**
- Enter your current password, then set a new one

> **Default password:** `1234`

## Behavior Notes

- The lock screen **automatically activates when the device resumes from sleep**
- Pressing **Cancel** on the password prompt puts the device back to sleep
- If enabled, screen contents are hidden while locked

## Preview

<img src=".github/assets/preview-pin.png" height="500"/>

## Limitations

- This plugin does **not encrypt files or memory**
- It only protects access within KOReader
- Removing the plugin or editing settings files can bypass the lock
3 changes: 1 addition & 2 deletions screenlock.koplugin/_meta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ local _ = require("gettext")
return {
name = "screenlock",
fullname = _("ScreenLock"),
description = _([[This plugin lets you lock your screen with a password,
description = _([[This plugin lets you lock your screen with a password,
either triggered from the menu or automatically upon device wake-up.]]),
}

Loading