AndroidAppLockscreen: drop a PIN lockscreen into any Android app in minutes
说明与用途
AndroidAppLockscreen 是一个轻量级库,可帮助开发者快速将 PIN 码锁屏集成到 Android 应用中。它通过自动处理密码管理和活动生命周期复杂性,消除了代码重复和对重型后端依赖的需求。
问题
Developers often copy-paste PIN lockscreen implementations across multiple projects or rely on heavy backend solutions like Firebase or biometrics when only a simple, local PIN entry is needed.
结果
A minimal, MIT-licensed library that integrates a PIN lockscreen into Android apps in minutes, handling complex activity lifecycle scenarios automatically.
工作流
- Add the JitPack repository to the project.
- Add the dependency 'com.github.p32929:AndroidAppLockscreen:1.2' to build.gradle.
- Extend activities with LockscreenHandler.
- Call EasyLock.checkPassword(this) in MainActivity's onCreate.
- Use EasyLock methods (setPassword, changePassword, disablePassword) for password management.
证据
i built it after copy-pasting the same lockscreen implementation across three different projects.
LockscreenHandler handles all of that — it knows the difference between 'user left the app' and 'activity was recreated internally'.
- 记录日期: 2026-09-10T10:48:31.006Z