TextGrabber is an Android application that automatically captures and stores all visible text on your screen using Android's Accessibility Service API. It features intelligent deduplication, local SQLite storage, and a real-time statistics dashboard.
- 🔍 Automatic Text Capture: Monitors screen content changes and extracts text from all visible UI elements
- 🧠 Smart Deduplication: Dual-layer deduplication using LRU cache (400 entries) + database UNIQUE constraints
- 💾 Local Storage: SQLite database for persistent text storage
- 📊 Real-time Dashboard: Live counter and recent 30 items display
- 🌍 Internationalization: Supports English and Chinese (auto-detected)
- 🚫 Self-Exclusion: Automatically excludes capturing text from TextGrabber itself
- 🎯 ViewID Tracking: Captures Android View resource IDs for better context
- Android 7.0 (API 24) or higher
- Accessibility Service permission (requires manual activation in system settings)
- Download the latest APK from Releases
- Install the APK on your device
- Enable the Accessibility Service:
- Settings → Accessibility → TextGrabber → Toggle ON
- Open TextGrabber and toggle the switch to start capturing
- Enable Service: Turn on the toggle switch in the main interface
- Navigate to other apps: The service will automatically capture text as you scroll/interact
- View Statistics: Real-time counter shows total saved items
- Browse Recent Captures: Scrollable list displays the most recent 30 text entries
You can inspect the captured data using Android Studio's Database Inspector:
- Connect your device/emulator
- Open App Inspection → Database Inspector
- Select
com.screen.textgrabberprocess - View
text_grabber.db→captured_texttable
# Clone the repository
git clone https://github.com/yourusername/TextGrabber.git
cd TextGrabber
# Build debug APK
./gradlew assembleDebug
# Output: app/build/outputs/apk/debug/app-debug.apkMyAccessibilityService (Core)
├─ Event Listening (typeAllMask)
├─ Node Traversal (Recursive)
├─ DeduplicationLogic (LRU Cache: 400)
└─ DBManager (SQLite)
MainActivity (UI)
├─ Service Toggle
├─ Counter Display (Auto-refresh: 1s)
└─ Recent Texts List (Auto-refresh: 5s)
⚠️ Sensitive Permission: Accessibility Service can read ALL screen content- 🔒 Local Only: All data is stored locally on your device
- 🚫 No Network: This app does not transmit any data over the network
- 📝 Transparency: All source code is open and auditable
This project is licensed under the MIT License.
TextGrabber 是一个 Android 应用程序,使用 Android 无障碍服务 API 自动捕获并存储屏幕上的所有可见文本。具备智能去重、本地 SQLite 存储和实时统计面板等功能。
- 🔍 自动文本抓取:监控屏幕内容变化,提取所有可见 UI 元素的文本
- 🧠 智能去重:双层去重机制(LRU 缓存 400 条 + 数据库唯一约束)
- 💾 本地存储:使用 SQLite 数据库持久化存储文本
- 📊 实时统计面板:实时计数器和最近 30 条记录展示
- 🌍 国际化支持:支持中英文(自动检测系统语言)
- 🚫 自我排除:自动排除抓取 TextGrabber 自身的文本
- 🎯 ViewID 追踪:捕获 Android 视图资源 ID,提供更好的上下文信息
- Android 7.0 (API 24) 及以上
- 无障碍服务权限(需在系统设置中手动激活)
- 从 Releases 下载最新 APK
- 在设备上安装 APK
- 启用无障碍服务:
- 设置 → 无障碍 → TextGrabber → 开启
- 打开 TextGrabber,点击开关开始抓取
- 启用服务:在主界面打开开关
- 浏览其他应用:服务会自动在你滚动/交互时抓取文本
- 查看统计:实时计数器显示已保存的总条目数
- 浏览最近记录:可滚动列表显示最近 30 条文本条目
可以使用 Android Studio 的 Database Inspector 查看捕获的数据:
- 连接设备/模拟器
- 打开 App Inspection → Database Inspector
- 选择
com.screen.textgrabber进程 - 查看
text_grabber.db→captured_text表
# 克隆仓库
git clone https://github.com/yourusername/TextGrabber.git
cd TextGrabber
# 构建 debug APK
./gradlew assembleDebug
# 输出位置: app/build/outputs/apk/debug/app-debug.apkMyAccessibilityService (核心)
├─ 事件监听 (typeAllMask)
├─ 节点遍历 (递归)
├─ DeduplicationLogic (LRU 缓存: 400)
└─ DBManager (SQLite)
MainActivity (UI)
├─ 服务开关
├─ 计数器显示 (自动刷新: 1秒)
└─ 最近文本列表 (自动刷新: 5秒)
⚠️ 敏感权限:无障碍服务可以读取屏幕上的所有内容- 🔒 仅本地存储:所有数据仅存储在您的设备本地
- 🚫 无网络传输:本应用不会通过网络传输任何数据
- 📝 透明开源:所有源代码公开可审计
本项目使用 MIT 许可证。