Repository navigation
Comprehensive codebase improvements based on multi-agent code review - #115
Merged
Merged
Conversation
…ring overlay inspection
…ect against corrupted JSON
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.
Summary of Improvements
This PR delivers a comprehensive, systematic overhaul of the codebase across accessibility core, concurrency and thread safety, UI lifecycle & memory management, security & OS compatibility, and unit test coverage based on the multi-agent code review findings.
Each issue is resolved in an individual, atomic commit:
1. Build Configuration, Resources & Signing Security (
4cb8775)resources { excludes += ['pinyindb/*'] }fromapp/build.gradleso the dictionary database is bundled in release APKs, fixing silent failure in pinyin sorting.local.properties, removing plaintext secrets fromgradle.properties.proguard-rules.profor line number attributes, serializable data models, and pinyin4j.2. Privacy Disclosure & Accessibility Configuration (
00eb172)mSetting.isDisclosureAccepted()gate inresumeSkipAdAfterWakeup()andstartSkipAdProcess()so the background service remains idle after device reboot/wake until the user agrees to the in-app disclosure.accessibility_service_config.xmlfeedback type tofeedbackGenericand removed unusedflagRetrieveInteractiveWindows.3. Accessibility Node Recycling & Overlay IPC Optimization (
f13219f)findAllNode()anddumpChildNodes()intry-finallyblocks that guarantee everyAccessibilityNodeInfois recycled immediately after extraction.NodeOutlineDatato cache node bounds, area, and metadata in Java heap memory. Sorting outlines no longer invokes native Binder roundtrips on every comparison.if (BuildConfig.DEBUG).4. BroadcastReceivers & Package Scheme Registration (
95ac160)actions.addDataScheme("package")toPackageChangeReceiver's filter so Android OS forwards package addition and removal events properly.ContextCompat.RECEIVER_EXPORTED.5. Settings Concurrency & Defensive Copying (
7655dd4)Settings.getInstance().volatile.6. Robust Rule Matching & Model Hardening (
286b582)equals(),hashCode(),toString(), and null-safe copy constructors inPackagePositionDescriptionandPackageWidgetDescription.positionClickFutureand cancelled them upon process reset.SkipAdRules.parseKeywords()with Unicode whitespace regex ((?U)\\s+), added case-insensitive matching, and stripped zero-width characters (e.g.\u200B,\uFEFF).(0,0,0,0)do not match offscreen nodes at(0,0,0,0).7. Clipboard, Overlay & Dialog Lifecycle Safety (
e3eb293)clipData.getItemAt(0).coerceToText(context)with null and item count checks.TIRAMISU) to prevent system duplicate toast notifications.isAttachedToWindow()checks.ACTION_REFRESH_CUSTOMIZED_ACTIVITYafter saving rules.8. UI Memory Leak Prevention & MVVM Architecture (
141cd08)whitelistDialoginstance and safely dismissed it inSettingsFragment.onDestroyView().fragment_settings.xmland bottom padding reflection hack.retainAll().MutableLiveDatawithinHomeViewModeland exposed read-onlyLiveData, moving service status refreshing logic into the ViewModel.android:contentDescriptionto action buttons and status icons.9. Comprehensive Unit Test Coverage (
d1dc434)PackagePositionDescriptionTestverifying constructors, equality, hash code, and string representation.SettingsTestunder Robolectric testing singleton isolation, defensive copying, JSON corruption handling, and preferences persistence.SkipAdRulesTestwith Unicode ideographic space parsing, case insensitivity, zero-width evasion characters, and empty bounds filtering.Verification
./gradlew assembleDebug(Passed)../gradlew testDebugUnitTest(All passed)../gradlew test(Debug and Release test suites passed: 53 tasks executed/up-to-date, 0 failures).