Skip to content

feat: misclicked/troll - #181

Closed
pillownara wants to merge 2 commits into
parallelcc:mainfrom
pillownara:android-17-support
Closed

feat: misclicked/troll#181
pillownara wants to merge 2 commits into
parallelcc:mainfrom
pillownara:android-17-support

Conversation

@pillownara

Copy link
Copy Markdown

No description provided.

… Android 17+ compatibility

Android 17 blocks reflection to static final fields. VIMSHooker and
CSMSHooker access config strings via reflection, which will throw
IllegalAccessException on Android 17+. Wrap with runCatching and
fallback to -1 if field access fails.

Fixes: Android 17 (API 37) compatibility issue
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Support Android 17 and guard restricted resource reflection

🐞 Bug fix ✨ Enhancement ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Targets and compiles against Android 17 (API 37).
• Prevents restricted resource reflection from crashing system-server hook initialization.
• Logs lookup failures and uses sentinel resource IDs as safe fallbacks.
Diagram

graph TD
  A["Android 17"] --> B["System server"] --> C["Hook setup"] --> D["R string lookup"]
  D -->|Success| E["Resource IDs"] --> G["Hook interceptors"]
  D -->|Failure| F["Fallback minus one"] --> G
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Resolve resources by name
  • ➕ Avoids static-final field reflection restrictions
  • ➕ Can preserve hook behavior instead of disabling resource matches
  • ➕ Centralizes compatibility around Android resource APIs
  • ➖ Internal resource names may not resolve consistently across OEM builds
  • ➖ Still requires guarded failure handling
2. Centralize guarded reflection
  • ➕ Removes duplicated lookup and logging logic
  • ➕ Provides one compatibility policy for internal resource fields
  • ➖ Does not bypass Android 17 reflection restrictions
  • ➖ Adds abstraction for only three current lookups

Recommendation: Keep guarded failure handling to protect system_server, but consider resolving IDs through Resources.getSystem().getIdentifier first and using reflection only as a compatibility fallback. The current -1 sentinel prevents crashes but can silently disable the affected resource-based overrides on Android 17; a shared resolver would reduce duplication and better preserve functionality.

Files changed (3) +22 / -5

Bug fix (2) +20 / -3
CSMSHooker.ktGuard contextual-search package resource reflection +8/-1

Guard contextual-search package resource reflection

• Wraps the internal contextual-search package resource lookup in runCatching. Failures are logged and mapped to -1 so CSMS hook initialization can continue when Android 17 blocks field access.

app/src/main/java/com/parallelc/micts/hooker/CSMSHooker.kt

VIMSHooker.ktGuard voice-interaction resource reflection +12/-2

Guard voice-interaction resource reflection

• Protects both contextual-search key and package resource lookups from reflective access failures. Each failure emits a warning and falls back to -1 before the voice-interaction hook is installed.

app/src/main/java/com/parallelc/micts/hooker/VIMSHooker.kt

Other (1) +2 / -2
build.gradle.ktsTarget Android 17 API level 37 +2/-2

Target Android 17 API level 37

• Raises compileSdk and targetSdk from 36 to 37 so builds use and declare Android 17 compatibility.

app/build.gradle.kts

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@pillownara pillownara closed this Aug 28, 2026
@pillownara pillownara changed the title Android 17 support Misclicked Aug 28, 2026
@pillownara pillownara changed the title Misclicked feat: misclicked/troll Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant