Skip to content

Fix AccuRadio ad detection not working#153

Merged
aghontpi merged 2 commits into
developmentfrom
fix/accuradio
Feb 24, 2025
Merged

Fix AccuRadio ad detection not working#153
aghontpi merged 2 commits into
developmentfrom
fix/accuradio

Conversation

@aghontpi

@aghontpi aghontpi commented Feb 24, 2025

Copy link
Copy Markdown
Owner

AccuRadio ads were no longer being detected because the notification text wasn’t accessible via notification.extras. This PR refactors the detection logic to a more generic approach that:

  1. Inflates the RemoteViews (if available) into a temporary view hierarchy and recursively extracts text from any TextView instances.
  2. Falls back to reflection to read from mActions if the first method fails.

Additionally, it updates the logs to provide more detail on each step and handles exceptions gracefully to avoid crashes.

Changes

  • Added extractTextFromRemoteViews() to inflate and parse RemoteViews.
  • Added extractTextViaReflection() as a fallback method.

Additional Notes

  • These changes should handle any custom notification layouts used by AccuRadio (or similar apps) in future updates.

@aghontpi

Copy link
Copy Markdown
Owner Author

fix accuradio detection

@aghontpi aghontpi changed the base branch from master to development February 24, 2025 21:49
@aghontpi aghontpi merged commit a2b3e3b into development Feb 24, 2025
@aghontpi aghontpi deleted the fix/accuradio branch February 24, 2025 21:50
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