升级构建链与依赖、精简权限、适配边到边,满足当前 Play 上架要求 - #111
Merged
Merged
Conversation
Play flagged the published build (234) for an outdated androidx.activity and the target API deadline (API 36 from 31 Aug 2026) is in force. This brings the project to the current baseline: Build - AGP 8.9.3, Gradle 8.11.1, compileSdk/targetSdk 36 - AndroidX to current stable: appcompat 1.7.0, activity 1.9.3, fragment 1.8.5, material 1.12.0, constraintlayout 2.2.0, navigation 2.8.5, preference 1.2.1, lifecycle-viewmodel/livedata 2.8.7 (replacing the discontinued lifecycle-extensions), gson 2.11.0, test libs - Jetifier off: every dependency is AndroidX or plain Java Manifest / policy - drop READ/WRITE_EXTERNAL_STORAGE, SYSTEM_ALERT_WINDOW, REQUEST_IGNORE_BATTERY_OPTIMIZATIONS and QUERY_ALL_PACKAGES: none is used. Overlays are accessibility-service windows, the battery page is opened via ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS, and package visibility for launcher apps, home apps and input methods now comes from <queries> instead of the restricted QUERY_ALL_PACKAGES - accessibility service declares isAccessibilityTool="false" - prominent disclosure dialog before sending the user to the accessibility settings (what is read, that nothing leaves the device) - remove the ignored android:persistent UI - edge-to-edge (enforced from targetSdk 35): the window ActionBar drew over the content and the content under the status bar. The activity now uses a NoActionBar theme with its own Toolbar, fitsSystemWindows on the root, and light system bars matching the white toolbar and bottom navigation - ViewModelProviders -> ViewModelProvider, PackageInfo.versionCode -> PackageInfoCompat.getLongVersionCode, unused imports removed Verified on a real device (Android 16): layout, disclosure dialog, service binding and ad skipping; 64 unit tests pass.
checkout v7, setup-java v6, upload-artifact v7, action-gh-release v3; setup-java v4 and the Node 20 runtime are deprecated. Pin ubuntu-24.04 because ubuntu-latest moves to Ubuntu 26 on 19 Oct 2026.
Google Play requires in-app disclosure and consent before the accessibility service may process screen content. The dialog was only shown when the service was not running yet, so enabling the service from the system settings, or having enabled it before this release, skipped it, and nothing recorded that the user agreed. - Settings persists the consent; the dialog is shown whenever it is missing (button tap, or automatically when the home screen opens while the service already runs) and records it on "agree" - the service ignores every accessibility event until the consent is recorded, and tells the user once per process to confirm it in the app - the disclosure text now distinguishes automatic recognition (in-memory only) from the user-initiated features that do keep data: widget and position rules saved as local app data, and the window dump copied to the clipboard on request Adds tests for the gate and the persisted flag; 66 unit tests in total.
Owner
Author
|
已按审查意见修复,见提交
回归测试:未确认时 STATE/CONTENT 事件被忽略、不读屏、不点击、提示一次,确认后下一事件即恢复处理;同意标记持久化到 SharedPreferences。单元测试共 66 个,全部通过。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Play Console 对当前上架版本(234,2022 年)给出"androidx.activity SDK 版本已过时"警告;同时 Google Play 目标 API 要求自 2026-08-31 起为 API 36。本 PR 把 master 整体拉到当前 Play 基线。
改动
构建链与依赖
lifecycle-extensions换为lifecycle-viewmodel/lifecycle-livedata2.8.7;gson 2.11.0;测试库同步升级。Manifest 与政策合规
READ/WRITE_EXTERNAL_STORAGE、SYSTEM_ALERT_WINDOW、REQUEST_IGNORE_BATTERY_OPTIMIZATIONS、QUERY_ALL_PACKAGES:悬浮窗是无障碍服务的TYPE_ACCESSIBILITY_OVERLAY,电池页用ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS打开,均不需要权限;启动器应用 / 桌面 / 输入法的包可见性改由<queries>提供。QUERY_ALL_PACKAGES在 Play 需要单独申报且本应用难以通过,去掉后 release 包不再声明任何用户可见权限。isAccessibilityTool="false"。android:persistent。UI(边到边)
setSupportActionBar),根布局fitsSystemWindows,浅色系统栏与白色标题栏 / 底部导航统一。ViewModelProviders→ViewModelProvider,versionCode→PackageInfoCompat.getLongVersionCode,清理无用 import。验证
上架前还需在 Play Console 完成的(代码之外)
isAccessibilityTool=false是其前提)。🤖 Generated with Claude Code