Skip to content

Android node: sms.send fails with getGroupIdLevel1 SecurityException on messages >160 chars (Samsung / missing READ_PHONE_STATE) #1

Description

@edisonxgao

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Summary

On the sideloaded (thirdParty) Android node build, sms.send fails for any single message longer than 160 GSM-7 chars. Messages ≤160 chars send fine. The failure surfaces as SMS_PERMISSION_REQUIRED: getGroupIdLevel1.

Steps to reproduce

Environment

  • Device: Samsung Galaxy Z Fold8
  • OS: Android <17> / One UI <9>
  • Carrier: Optus (AU) — issue appeared after switching from Telstra; same app, same device
  • App build: Openclaw APK, version <2006.7.4>
  • Package: <fill from pm list packages | grep -i claw>

Steps to reproduce

  1. Grant the app SMS + Call Log permissions (fresh install, permissions granted normally).
  2. Send a single SMS ≤160 GSM-7 chars via sms.send → succeeds.
  3. Send a single SMS >160 GSM-7 chars (forces multipart) to the same number → fails.

Expected behavior

Expected

Long messages are split and sent as a multipart SMS.

Actual behavior

Actual

Send fails with SMS_PERMISSION_REQUIRED: getGroupIdLevel1.

OpenClaw version

2026.7.4

Operating system

MACOS Tahan

Install method

NPM

Model

Claude

Provider / routing chain

Opecnlaw to Tailscale TO Node

Additional provider/model setup details

Root cause

The multipart path (SmsManager.divideMessage()fragmentText()calculateLength()SmsMessage.hasEmsSupport()) calls TelephonyManager.getGroupIdLevel1(), which is guarded by READ_PHONE_STATE. On Samsung firmware that ships a NoEmsSupport carrier-config list, this path reads GID1 whenever a message needs concatenation; ≤160-char messages never hit it. The app declares SMS and Call Log permissions but does not declare READ_PHONE_STATE, so there is no way to grant it — the "Phone" permission group doesn't even list the app in Settings. This makes it carrier/OEM-conditional (Telstra didn't trigger the EMS-check path; Optus does).

Impact

Any Samsung user on an affected carrier cannot send long/multipart SMS via the node. Fails silently from the agent's perspective (surfaces only as a permission error), so automated SMS workflows drop long messages.

Suggested remediation

  1. Declare android.permission.READ_PHONE_STATE in the thirdParty flavor manifest and request it at runtime alongside SEND_SMS; or
  2. Avoid the framework EMS-check dependency (e.g. catch the SecurityException in the split path and fall back to sending single-part chunks), so the feature degrades gracefully without the extra permission.

Logs

Screenshots, recordings, and evidence

No response

Impact and severity

Impact

Any Samsung user on an affected carrier cannot send long/multipart SMS via the node. Fails silently from the agent's perspective (surfaces only as a permission error), so automated SMS workflows drop long messages.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions