Android app that automatically reads notifications and copies OTPs (One-Time Passwords) to the clipboard.
- 🔔 Reads incoming notifications in real-time
- 🔍 Automatically detects OTP codes using a simple pattern matching algorithm (4-8 digits):
123456 - 📋 Copies detected OTPs to clipboard instantly
- 🔒 Privacy-focused: No data is stored or transmitted
- ⚡ Works in the background with minimal battery usage
- Install the app on your Android device (API 24+)
- Open the app
- Tap "Open Settings" to grant notification access permission
- Enable "OTP Copy" in the notification access settings
- Done! The app will now automatically copy OTPs from Gmail notifications
To ensure the app can read Google message notifications correctly, you need to disable a specific Android setting:
Path: Phone settings → Notifications → Advanced settings → Suggest actions and replies for notifications
Action: Toggle this setting OFF
Without disabling this setting, Google's smart reply feature may interfere with the app's ability to read notification content.
- JDK 8 or higher
- Android SDK with API level 34
-
Clone the repository:
git clone https://github.com/kalenwallin/android-otp-copy.git cd android-otp-copy -
Build from command line:
./gradlew assembleDebug
The APK will be available at
app/build/outputs/apk/debug/app-debug.apk
The debug.sh script provides convenient commands for development and debugging:
./debug.sh [command]| Command | Description |
|---|---|
build |
Build and install debug APK to connected device |
run |
Build, install, launch the app, and show logs |
logs |
Show live app logs (filtered to OTPCopy) |
logcat |
Show full system logcat |
crash |
Show recent crash logs |
wireless |
Set up wireless debugging |
devices |
List connected devices |
clear |
Clear app data |
uninstall |
Uninstall the app |
# Full development cycle - build, install, run, and watch logs
./debug.sh run
# Just watch app logs (while app is running)
./debug.sh logs
# Set up wireless debugging (connect via USB first)
./debug.sh wireless
# Check for crash logs
./debug.sh crash- Enable Developer Options on your Android device
- Enable USB Debugging in Developer Options
- Connect via USB cable (or use
./debug.sh wirelessfor wireless debugging)
The app requires the following permission:
- Notification Access: To read notifications and extract OTP codes
- MainActivity: Handles permission checking and settings navigation
- OtpNotificationListener: NotificationListenerService that monitors notifications
- OTP Detection: Uses regex patterns to identify OTP codes
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.