forked from tianma8023/XposedSmsCode
-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Background
From latest user logs:
modules_2026-02-21T14_31_01.155935.logverbose_2026-02-21T14_31_01.153618.log
User-reported symptom: SMS parse/copy works, but delete SMS action often fails.
Log evidence
Representative failed sample (2026-02-22 06:20:25~06:20:27):
SmsHandlerHookreceivesSMS_DELIVER- sender/body parsed and code extracted successfully
- then
OperateSmsAction:Deleting SMS... - finally
Delete SMS failed
No hard exception is thrown for delete path, so this is likely a provider-write or matching failure (rows=0) rather than crash.
Analysis
Potential root causes found in current code:
OperateSmsActionusesmPluginContext.contentResolverfor Telephony SMS delete/update.- In hook context this may be treated as module-app identity for SMS provider write, making write operations brittle (especially Android 16 / OEM variants).
- Matching condition is too strict:
- requires exact
address == sender - requires unread status in same matching branch
- any address normalization difference (prefix/country code formatting) can fail matching and lead to
rows=0.
- requires exact
- Timing sensitivity:
- SMS provider row may not be ready immediately when operation runs.
Proposed/implemented fix
- Switch SMS provider operations to
mPhoneContext.contentResolver. - Add retry window for SMS operation (4 attempts, 800ms delay) to absorb provider insert timing.
- Relax matching robustness:
- address normalization match by digits suffix,
- mark-as-read treats already-read as success.
Scope
File:
OperateSmsAction.kt
Verification
- Kotlin compile:
./gradlew :app:compileDebugKotlinpassed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels