https://bugs.kde.org/show_bug.cgi?id=523424

Brian Stine <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---

--- Comment #6 from Brian Stine <[email protected]> ---
I can reproduce the restricted-row behaviour from comment 1 on a Samsung phone.
It is stock Android 17 behaviour, and it affects received messages too, not
only messages KDE Connect sends. Please consider reopening.

Environment: Galaxy S24+ (SM-S926U), One UI build S926USQU6EZIF (Android 17),
installed 2026-10-14. KDE Connect Android 1.36.0. Google Messages is the
default SMS app, RCS on. Desktop kdeconnectd 23.08.5 (Ubuntu 24.04 base).

Symptom: Since the Android 17 update, end-to-end encrypted RCS conversations
are marked as restricted by Android. Only a few apps, such as Google Messages
and Microsoft's Link to Windows, can read them. KDE Connect and other apps
without the READ_RESTRICTED_MESSAGES app-op cannot, so these messages never
reach the desktop. I confirmed this across multiple message threads via adb and
dbus-monitor.

I found this while working on Connected, a COSMIC applet that uses kdeconnectd
over D-Bus (https://github.com/nwxnw/cosmic-ext-connected). Because the rows
never leave the phone, every desktop client is affected, not only mine.

Evidence: These symptoms are seen in results from the kdeconnectd daemon on the
desktop side and are shown in KDE Connect SMS and other apps that rely on the
daemon. In my test set, the missing messages were 12 hours to over two days
old, so this is not Android 17's 3-hour SMS OTP delay.

The rows are in Android's telephony provider, flagged restricted (adb shell
reads them):

  adb shell content query --uri content://mms --projection
_id:thread_id:date:msg_box:restricted --where "'restricted=1'"

In my testing, this returned 14 rows across 3 encrypted conversations, both
received (msg_box=1) and sent (msg_box=2), all written after the update. The
same query on content://sms returns nothing, so plain SMS is unaffected. Two
unencrypted RCS conversations active in the same period have no restricted
rows.

Logcat shows the telephony provider applying the restriction to every KDE
Connect query. To see it:

  adb shell pidof org.kde.kdeconnect_tp
  adb logcat | grep TP/SmsProvider

then start KDE Connect SMS on the desktop and open a conversation. Lines with
the KDE Connect pid as the calling pid include: 

  canReadRestrictedMessages=false
  getSelectionBySubIds() :
view_pdu_restricted_exclude_device_identifiers.sub_id IN (...)

Google Messages' queries show canReadRestrictedMessages=true.

All of this is consistent with Android 17's documentation, which says
"Restricted message access: Most apps now cannot access end-to-end encrypted
messages" (https://developer.android.com/about/versions/17/summary). The linked
detail section isn't published.

The check is in AOSP (android-17.0.0_r1): TelephonyProvider's
`ProviderUtil.canReadRestrictedMessages` lets only system and phone apps, or an
app whose READ_RESTRICTED_MESSAGES app-op is set to allow, read restricted
rows. The op defaults to ignored. It sits behind the flag
secure_access_to_restricted_rcs_messages, so any Android 17 device with that
flag on behaves this way. 

Workaround, confirmed:

Set KDE Connect's app-op to read restricted messages, but this can only be done
through an adb command and not by any user accessible setting. No Android
permission grants it, so the app cannot request it. 

  adb shell appops set org.kde.kdeconnect_tp READ_RESTRICTED_MESSAGES allow

After this KDE Connect's queries log canReadRestrictedMessages=true and the
missing messages sync. Note that kdeconnectd has to be restarted afterwards to
reset its message cache. Persistence across reboot and OS updates is untested.

To undo the app-op:

  adb shell appops set org.kde.kdeconnect_tp READ_RESTRICTED_MESSAGES default

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to