更新日志
新增
- 新增模块冲突检测,识别 Telegami、TeleVip、Re:Telegram、Killergram、Telegram Speed Hook 和 Telegram Tweaks/SideStories,并按防撤回、编辑历史、下载参数、Secret Media、保存限制、去广告、Stories、隐私与 UI 注入等重叠能力给出分级风险与避让建议。
- 冲突检测在获得 root 授权后仅以只读方式查询 LSPosed 私有数据库,确认模块总开关和 Telegram 作用域;界面会显示各模块实际状态,查询失败时自动退回已安装包检测,且不会修改 LSPosed 数据库。
- 新增主动加载与防撤回/防修改能力,可在模块全局设置中开启总开关。
- Telegram 聊天右上角菜单新增按会话开启/关闭主动加载的入口,并直接显示当前状态。
- 聊天右上角菜单新增“清理模式”,开启后 5 分钟内放行当前会话的批量删除操作,并可再次点击提前关闭。
- 后台主动加载器会定期拉取已启用会话的最近消息,并在重启后自动恢复已启用的会话。
- 收到 Telegram/MiPush 相关推送入口时会立即触发主动加载,减少进入聊天后才开始加载的延迟。
- 新增媒体预取流程,主动调用 Telegram 文件加载路径并把可用的图片、视频等原始媒体复制到 GramSieve 缓存,降低打开编辑历史时转圈等待的概率。
- 新增撤回/编辑检测,覆盖 Telegram 更新流、删除消息、编辑消息和已加载消息缓存路径。
- 对方撤回产生的删除更新仍会在 Telegram 正式处理前清空待删除 ID,尽量阻止官方删除动作继续移除本地消息;用户主动删除则通过短时删除意图识别正常放行,并同步清理 GramSieve 中对应的消息、编辑历史和缓存媒体。
- 用户确认删除整个对话后,GramSieve 会停止该会话的主动加载,清除模块侧消息、编辑历史和媒体缓存,并按 Telegram 账号隔离持久化本地隐藏状态;重启后的本地清理仅作用于经验证与该对话直接关联的
cache4白名单表,避免已删对话被旧缓存重新带回列表。 - 新增消息缓存体系:LRU 内存缓存 + SQLite 持久化,保存原始文本、媒体说明、发送者、媒体类型、媒体 ID、编辑/撤回状态和缓存媒体路径。
- 新增媒体缓存,将原始图片、视频和其他可解析媒体复制到模块缓存中,供编辑历史和撤回后预览使用。
- 消息绑定时会缓存普通文本、媒体说明、图片、视频、文档等内容,并用内容 + 媒体类型 + 媒体 ID 指纹区分真实编辑和非内容更新。
- 点击消息弹窗中在“标记此消息”下方新增“编辑历史”入口;没有可展示编辑历史的消息不再显示该入口。
- 编辑历史支持显示原始文本/媒体说明与编辑后内容。
- 编辑前图片优先接入 Telegram 官方 PhotoViewer,保留顶部栏、右上角菜单和官方“保存到图库”入口。
- 有 Telegram 原始媒体对象的历史图片/视频会优先尝试官方 PhotoViewer;缓存视频提供本地全屏播放器兜底。
- 对仅有持久化缓存文件的原始图片构造隔离的临时 Telegram 图片消息,避免查看或保存后影响聊天中当前图片。
- 原始媒体尚未缓存但仍有 Telegram 媒体对象时,会触发媒体预取并提示稍后重试;纯媒体历史缺失时会给出明确提示而不是打开空白页。
- 被撤回消息会保留原内容提示,并尽量还原缓存媒体预览。
- 运行日志现在写入 Telegram 进程 app-specific 外部目录,早期尚未拿到宿主 Context 的日志会先排队并在初始化后刷新进文件。
- 模块进程收到 Provider 持久化日志时也会写入模块自身 app-specific 外部日志文件。
- README 新增主动加载、防撤回、防修改、编辑历史媒体查看和持久化日志说明,并同步修正消息标记入口文案。
- 配置入口现在寄生到 Telegram 设置列表中的 GramSieve 行,点击后在宿主设置页内打开模块配置。
- 聊天页右上角配置入口优先打开宿主内嵌配置面板,不再直接跳出到模块 Activity。
- 编辑历史改为多版本保存,新增 edit_history 持久化记录,连续编辑会保留多个版本。
- MessagesStorage.putMessages 写入前会只读 Telegram 本地 messages_v2/messages_topics 旧消息,与新消息比较,补齐离线或历史同步期间发生的编辑。
修复与优化
- 修复 Telegram 启动早期 ActivityThread.currentApplication 为空导致防撤回初始化失败的问题,改为在宿主或聊天 Context 可用时初始化。
- 修复当前 Telegram 版本 loadMessages 反射签名不匹配导致主动加载失效的问题,改为按重载参数动态构造调用参数。
- 修复 TL_updateEditChannelMessage / TL_updateEditMessage 字段识别问题,正确从 message 字段读取编辑后的消息。
- 修复频道/群组删除更新中的 dialogId 解析,支持 channel_id + messages 的撤回更新。
- 修复 Telegram 12.8.3 的
deleteMessages同时携带messageIds与randomIds时,把随机 ID 误当消息 ID 的问题;现在只解析第一个 Integer 消息 ID 列表。 - 修复私聊
messagesDeleted事件使用dialogId=0时,用户主动删除仍被防撤回拦截的问题;仅在全部消息 ID 唯一匹配同一条未过期删除意图时放行,歧义场景继续保守保护。 - 修复删除操作仍处于 Undo 暂存阶段就提前清理缓存并隐藏对话的问题;本地清理现在只在实际删除提交边界触发。
- 修复单独拉黑联系人被误判为删除对话并清空 GramSieve 历史的问题;
blockPeer不再触发对话清理。 - 修复已开启主动加载的会话没有持久化、重启后不会自动加载的问题。
- 修复本地隐藏状态仅按
dialogId保存,导致多个 Telegram 账号中相同 peer 相互影响的问题;持久化键、旧键迁移、列表过滤和启动清理现在均按账号隔离。 - 修复消息数据库读取 is_recalled / is_edited、媒体字段和缓存路径不完整的问题,并补齐游标关闭与线程安全处理。
- 通过数据库迁移和 putFresh 逻辑重置旧的 isEdited / isRecalled 脏状态,避免普通消息被历史标记污染。
- 修复反应、浏览量等非内容更新被误判为消息编辑的问题。
- 修复普通消息误出现黄色或红色背景的问题,并移除编辑/撤回消息区域的强背景色显示。
- 修复被复用的消息 Cell 残留撤回/编辑视觉状态,导致其他正常消息被污染的问题。
- 修复没有编辑内容的消息仍显示“编辑历史”入口的问题。
- 修复编辑前图片打开黑屏、被误判为视频、顶部栏缺失、右上角菜单不可用的问题。
- 修复官方保存原始图片后返回聊天,当前图片区域变透明/空白的问题。
- 修复部分编辑历史图片点击无反应时缺少可诊断日志的问题,现在会记录媒体类型、媒体 ID、缓存路径和 Telegram 媒体对象状态。
- 修复 Telegram 菜单项 setText / setTextAndIcon 反射兼容性和点击处理,提升“主动加载”“编辑历史”“标记此消息”等菜单注入稳定性。
- 提升防撤回、主动加载和媒体缓存相关日志可见性,并改为读取持久化文件而不是易溢出的 logcat 缓冲区。
- 放弃公共 /sdcard/GramSieve 日志路径,避免 scoped-storage 权限导致文件不存在;诊断路径改为 app-specific 外部目录。
- 修复 README 中消息标记入口描述,将长按更正为单击。
- 回退未发布的系统 TranslationManager 翻译实验,本版不包含该隐藏 API 功能。
- 移除了 Telegram 设置页右上角三点菜单里的“过滤规则”寄生入口,避免入口重复。
- 宿主内嵌配置页改为固定全黑背景,并修复从该页返回时直接退出 Telegram 设置页或回到桌面的问题。
- SQLite 持久化写入改为单线程序列化队列,降低 hook 流程阻塞 Telegram UI 的风险。
- 收紧 Telegram
cache4本地清理白名单,排除并非dialogId归属的download_queue.uid、saved_dialogs.did和requested_holes.uid,避免误删下载队列、Saved Messages 分组或秘密聊天重传状态。 - 反撤回链路增强了对方撤回的本地删除拦截、NotificationCenter 删除通知拦截和 Telegram 本地消息 deleted flag 标记,减少图片/媒体消息在滑动重绑后被 Telegram 自身状态覆盖的问题;同时明确区分用户主动删除,确保对应的本地数据库、通知和 UI 更新能够正常放行。
工程、测试与发布
- 新增 InstalledModuleScanner、LSPosedModuleStateReader、ModuleConflictDetector 及对应 JVM 测试,并补充 Android 包可见性声明与 app_process 保留规则。
- 新增 AntiRecallConfigStore、BackgroundMessageLoader、MessageCache、MessageDatabaseHelper、MediaCache、MediaPrefetcher、RecallDetector 等防撤回核心模块,并增加 SelfDeleteTracker、LocalDialogDeleteStore、TelegramDialogDatabasePruner 和 TelegramDialogPrunePlan,承载用户主动删除识别、账号隔离隐藏和白名单本地清理。
- 新增 AntiRecallConfigStoreTest、BackgroundMessageLoaderTest、MessageCacheTest、RecallDetectorTest、SelfDeleteTrackerTest、LocalDialogDeleteStoreTest、TelegramDialogPrunePlanTest 和 TelegramHookInstallerTest 等 JVM 测试,并补充删除拦截、真实编辑判断、多列表参数解析、私聊全局删除唯一匹配、账号键迁移、Undo 提交边界、
blockPeer隔离和cache4白名单回归覆盖。 - 新增 AntiRecallIntegrationTest 仪器测试,覆盖防撤回集成路径。
- 新增 Mockito 测试依赖,用于 SharedPreferences 等配置存储测试。
- 新增防撤回方案与设计文档,记录主动加载、撤回/编辑检测、缓存和 UI 集成方案。
- AGENTS.md 新增发布说明规范、持久化日志排查流程、Telegram Hook 生命周期和防撤回架构说明,并更新日志读取路径为 app-specific 外部目录。
- CI 新增 GitHub Release 发布时自动构建并上传 APK 的 release-apk job。
- 新增 SOURCE_URL 元数据文件。
- 版本号更新为 versionName 0.1.3、versionCode 4,版本线保持 0.1.x。
- 增加 Telegram APK 版本化归档脚本,便于复用反编译材料并避免 APK、apktool 输出进入仓库。
- 补充宿主配置面板、序列化存储、多版本编辑历史和反撤回缓存相关测试。
Changelog
Compared with v0.1.1, this v0.1.3 release includes:
Added
- Added module conflict detection for Telegami, TeleVip, Re:Telegram, Killergram, Telegram Speed Hook, and Telegram Tweaks/SideStories, with graded risks and avoidance guidance for overlapping anti-recall, edit-history, download, Secret Media, save-restriction, ad-blocking, Stories, privacy, and UI-injection capabilities.
- After root authorization, conflict detection uses read-only queries against the private LSPosed database to confirm each module's master switch and Telegram scope; the UI shows the confirmed state, falls back to installed-package detection when the query fails, and never modifies the LSPosed database.
- Added proactive loading with anti-recall and anti-edit support, controlled by a new global module setting.
- Added a per-chat proactive loading toggle to Telegram's top-right chat menu, with the current state shown directly in the menu text.
- Added Cleanup Mode to the top-right chat menu; while enabled, bulk deletion in the current chat is allowed for five minutes and can be turned off early with another tap.
- Added a background loader that periodically loads recent messages for enabled chats and restores enabled chats after restart.
- Telegram/MiPush-related push entry points now trigger an immediate proactive load, reducing the delay before messages are cached after push delivery.
- Added media prefetching that asks Telegram's file-loading path for original images/videos and copies available files into GramSieve's cache, reducing spinner time when opening edit history.
- Added recall/edit detection across Telegram update processing, delete calls, edit calls, and loaded-message caching paths.
- Delete updates caused by remote recalls still clear message IDs before Telegram handles them, helping prevent official local deletion from removing preserved messages; user-initiated deletes are now recognized through short-lived deletion intents, allowed to proceed, and purge the corresponding GramSieve messages, edit history, and cached media.
- After a full-dialog deletion is confirmed, GramSieve stops proactive loading for that chat, clears module-side messages, edit history, and media caches, and persists the local hide per Telegram account; restart cleanup is restricted to a verified
cache4allowlist of dialog-owned tables so stale local data does not bring the deleted dialog back into the list. - Added a message cache stack: LRU memory cache plus SQLite persistence for original text, captions, sender, media type, media ID, edit/recall flags, and cached media paths.
- Added media caching for original images, videos, and other resolvable media so edit history and recalled-message previews can use preserved files.
- Message binding now caches text, captions, photos, videos, documents, and media fingerprints based on content + media type + media ID.
- Added an Edit History item below Mark this message in the message popup; messages without renderable edit history no longer show that item.
- Edit history can show the original text/caption together with the edited content.
- Original pre-edit images now prefer Telegram's official PhotoViewer, preserving the top bar, overflow menu, and official Save to Gallery entry.
- Historical images/videos with an original Telegram media object try the official PhotoViewer first; cached videos keep a local full-screen player fallback.
- Cached-only original images use an isolated temporary Telegram photo message, preventing the current chat image from being affected after viewing or saving.
- If original media is not cached yet but a Telegram media object is still available, GramSieve triggers media prefetch and asks the user to retry shortly; missing media-only history now shows a clear message instead of opening a blank view.
- Recalled messages retain an original-content hint and try to restore cached media previews.
- Runtime logs now write to Telegram's app-specific external directory, and early logs emitted before host Context exists are queued and flushed once initialization completes.
- Logs persisted through the module ContentProvider are also written to the module app's own app-specific external log file.
- README now documents proactive loading, anti-recall, anti-edit, edit-history media viewing, and persistent log paths, and updates message-marking entry text.
- The configuration entry is now injected into Telegram's settings list as a GramSieve row and opens inside the host settings page.
- The chat menu configuration entry now prefers the host-embedded panel instead of launching the module Activity directly.
- Edit history now stores multiple versions through the new edit_history persistence path.
- MessagesStorage.putMessages now compares incoming messages with Telegram's existing messages_v2/messages_topics blobs to recover edits that happened during offline or history sync windows.
Fixed And Improved
- Fixed anti-recall initialization failing when ActivityThread.currentApplication is unavailable early in Telegram startup by initializing once host or chat Context is available.
- Fixed proactive loading failing on the current Telegram loadMessages signature by dynamically building arguments for compatible overloads.
- Fixed TL_updateEditChannelMessage / TL_updateEditMessage handling by reading the edited message from the message field.
- Fixed dialogId resolution for channel/group delete updates using channel_id + messages.
- Fixed Telegram 12.8.3
deleteMessagesparsing whenmessageIdsandrandomIdsare supplied together; only the first Integer message-ID list is now treated as deletions. - Fixed user-initiated private-chat deletions still being blocked when
messagesDeletedreportsdialogId=0; deletion is allowed only when every ID uniquely matches one unexpired intent, while ambiguous cases remain protected. - Fixed GramSieve clearing caches and hiding a dialog while Telegram's delete action was still staged in UndoView; local cleanup now starts only at the committed deletion boundary.
- Fixed standalone
blockPeercalls being treated as dialog deletion and purging GramSieve history. - Fixed enabled proactive-loading chats not being persisted or restored after restart.
- Fixed local hide state being keyed only by
dialogIdand leaking across Telegram accounts that share the same peer ID; persisted keys, legacy migration, row filtering, and startup cleanup are now account-scoped. - Fixed incomplete database reads for is_recalled / is_edited, media fields, and cached paths, and tightened cursor cleanup plus thread safety.
- Reset stale isEdited / isRecalled state through database migration and putFresh logic so normal messages are not polluted by old flags.
- Fixed reactions, view updates, and other non-content updates being treated as real message edits.
- Fixed normal messages showing false yellow or red backgrounds, and removed strong background coloring from edited/recalled message areas.
- Fixed reused message cells retaining stale recall/edit visual state and contaminating unrelated normal messages.
- Fixed the Edit History item appearing on messages that have no edit content.
- Fixed original images opening as a black screen, being misdetected as video, losing the top bar, or having an unusable overflow menu.
- Fixed the current chat image turning transparent/blank after saving an original image through the official viewer.
- Added diagnostic logs for edit-history media taps that cannot find a cached file, including media type, media ID, cached path, and Telegram media-object state.
- Improved Telegram menu item reflection and click handling for Proactive Loading, Edit History, and Mark this message.
- Improved anti-recall, proactive loading, and media-cache logging, with diagnostics based on persistent files instead of overflow-prone logcat buffers.
- Dropped the public /sdcard/GramSieve log path to avoid scoped-storage failures; diagnostics now use app-specific external storage paths.
- Fixed README wording for message marking from long-press to click.
- Reverted the unreleased system TranslationManager experiment; this release does not include that hidden API feature.
- Removed the duplicate “Filter rules” entry from Telegram settings' three-dot menu.
- The host-embedded configuration page now uses a fixed black background and fixes back navigation so returning from GramSieve stays inside Telegram settings.
- SQLite persistence now uses a single-thread serialized queue to reduce the risk of blocking Telegram UI hooks.
- Restricted Telegram
cache4cleanup to verified dialog-owned tables, excludingdownload_queue.uid,saved_dialogs.did, andrequested_holes.uidso unrelated downloads, Saved Messages grouping, and secret-chat retry state are preserved. - Anti-recall handling now strengthens local interception of remote recalls, NotificationCenter deletion interception, and Telegram local deleted-flag marking to reduce media messages disappearing after rebinding or scrolling; user-initiated deletion is now handled separately so the corresponding database, notification, and UI updates can proceed normally.
Engineering, Tests, And Release
- Added InstalledModuleScanner, LSPosedModuleStateReader, ModuleConflictDetector, their JVM tests, Android package-visibility declarations, and the app_process keep rule.
- Added the anti-recall core modules: AntiRecallConfigStore, BackgroundMessageLoader, MessageCache, MessageDatabaseHelper, MediaCache, MediaPrefetcher, and RecallDetector, plus SelfDeleteTracker, LocalDialogDeleteStore, TelegramDialogDatabasePruner, and TelegramDialogPrunePlan for user-deletion intent tracking, per-account local hiding, and allowlisted local cleanup.
- Added JVM tests for AntiRecallConfigStore, BackgroundMessageLoader, MessageCache, RecallDetector, SelfDeleteTracker, LocalDialogDeleteStore, TelegramDialogPrunePlan, and TelegramHookInstaller, with regression coverage for delete interception, real-edit detection, multi-list parameter parsing, unique matching for private-chat global deletion events, account-key migration, Undo commit boundaries,
blockPeerisolation, andcache4allowlisting. - Added AntiRecallIntegrationTest for the instrumented anti-recall integration path.
- Added Mockito for SharedPreferences and configuration-store tests.
- Added anti-recall planning and design documentation for proactive loading, recall/edit detection, caching, and UI integration.
- Updated AGENTS.md with release-note rules, persistent-log diagnostics, Telegram hook lifecycle notes, anti-recall architecture notes, and app-specific log paths.
- Added a GitHub Release release-apk workflow job to build and upload an APK when a release is published.
- Added SOURCE_URL metadata.
- Updated the app to versionName 0.1.3 and versionCode 4, keeping the 0.1.x release line.
- Added a versioned Telegram APK archive script so reverse-engineering evidence can be reused without committing APK or apktool output.
- Added and updated tests for the host config panel, serialized storage, multi-version edit history, and anti-recall cache behavior.