Repository navigation
feat(island): add OTP notification handler filtering - #1386
Merged
sameerasw merged 11 commits intoOct 18, 2026
Merged
Conversation
isaacsa51
marked this pull request as ready for review
October 15, 2026 05:37
Owner
|
Hi @isaacsa51 can you resolve the conflicts with new changes? |
sameerasw
marked this pull request as draft
October 15, 2026 12:25
isaacsa51
marked this pull request as ready for review
October 15, 2026 18:56
Contributor
Author
|
ready now @sameerasw |
…plugin_handler # Conflicts: # app/src/main/java/com/sameerasw/essentials/island/plugins/notifications/NotificationsPlugin.kt # app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt
sameerasw
requested changes
Oct 18, 2026
sameerasw
left a comment
Owner
There was a problem hiding this comment.
Should fix
- The OTP permission is granted silently.
PermissionGrantUtilnow callsgrantSensitiveNotifications()from the existing grant flow whenever the op is missing. That runsappops set … RECEIVE_SENSITIVE_NOTIFICATIONS allow, then disallows and re-allows the notification listener.- The OTP toggle defaults to on, so every Shizuku or root user gets this grant without asking. The description says users are prompted when they enable the feature.
- The listener rebind also briefly drops notification access. I'd keep the grant to the explicit "grant" row in the OTP settings.
- Domain-bound codes can match plain words.
DOMAIN_BOUNDreturns before any keyword check and accepts#[A-Za-z0-9]{4,10}. Text likealex@acme.com #engineeringwould produceengineeringas the code. Require at least one digit in the capture. - Amounts without a currency marker can look like codes.
CURRENCY_BEFOREonly catches symbols or a currency word before the number. A bank text such as "Do not share your OTP. Txn of 4500 INR on card…" would return4500. This is a gap I found by reading the regexes. Checking the text after the number for a currency word, and adding a test, would cover it. - Wrong settings style. The new rows have descriptions:
island_otp_enabled_desc,tap_to_copy_desc,bypass_filter_descandgrant_desc. Settings items here get titles only, so please drop them. - The checklist says the settings are in
FeatureRegistry.kt, but they aren't. That file isn't in the diff, so the OTP settings won't show up in search. - Comments. There are many explanatory comments, against the repo rule:
NotificationsPluginOtpClipboardOtpExtractor- the
formatOtpcomment inOtpExpanded - the
onLineTapcomment inIslandModels PermissionGrantUtilotpSourceTextinNotificationListener
Minor
NotificationsPlugin.popUp()has two whitespace-only lines.- The new import in
NotificationListenersits above the existing ones, out of order. - The OTP settings block builds its own
SettingsRepositoryand keeps local state instead of going through the ViewModel. That's the pattern you flagged on #1369. The rows nested inAnimatedVisibilitymay also lose the 24/4 corner grouping, so check it visually. - The grant button uses a raw
Thread { }.start(). - Extraction runs on every notification from every app, and words like "code", "pin" and "token" are common. Restricting it to message, email and sms categories would cut false positives.
- If a new alert arrives during the 1.5 s "copied" state,
popUp()can override the confirmation. - Bypass-filter defaults to on, so OTPs from apps the user excluded still appear. That seems intended, but it's worth stating in the description.
- There are no tests for the plugin flow (copy, finish, queue), only for the extractor.
sameerasw
marked this pull request as draft
October 18, 2026 03:27
isaacsa51
marked this pull request as ready for review
October 18, 2026 04:32
…h grant state on resume, re-allow listener if lost, test queue reindexing
…gate enabling on it
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.
Description
Given any code that matches the regex for a OTP code or Single Code sign in, show island with copy and dismiss info with the code on the island.
That way if the user have the android heads up turn off via app, the Island gracefully show it to the user with different option to show from.
If the user enables this feature, in case that the app still don't have the Shizuku permission, once enable the user will be prompted to grant permission since android censors this types of notification since Android 14 afaik, granting access with ADB, shizuku
or root obvswill enable island to show this info.Type of change
UI changes
Showing island and code with default options and line peek mode:
Screen_recording_20261014_222457.mp4
while OTP testing can be difficult, this was tested using a real device using adb commands to mimick different cases of codes, arranging from 3 to 8 char codes, google OTPS like G-12345 and also depending on the email, long text still sometimes will match the logic, this depends on the notification data and it's preview to see if it's contain this.
Checklist
Before submitting, please make sure:
develop(notmain)../gradlew assembleDebug../gradlew testDebugUnitTest.SettingsRepositoryfor keys and getter/setter methods.FeatureRegistry.ktfor search indexing.ui/core/(RoundedCardContainer,IconToggleItem, etc.).res/values/strings.xmland drawables use rounded variants (R.drawable.rounded_*).