Skip to content

Sharing a contact via Android share menu results in 'invalid file' on GrapheneOS #14617

@essentialols

Description

@essentialols

Bug description

When sharing a single contact from the AOSP/GrapheneOS Contacts app to Signal via Android's share menu (ACTION_SEND with text/x-vcard MIME type), Signal reports the file as invalid and does not send the contact.

Steps to reproduce:

  1. Open Contacts app on GrapheneOS (stock AOSP-based contacts app)
  2. Open any contact
  3. Tap Share > choose Signal
  4. Signal shows "invalid file" or silently fails to attach the contact

Expected: The contact is shared as a vCard attachment in the Signal conversation.

Actual: Signal rejects the file as invalid.

Key observation: Sharing the same contact to SMS/MMS apps works perfectly. The vCard data itself is valid. The issue appears to be in how Signal resolves the shared content URI.

Likely root cause: The Contacts app shares a content://com.android.contacts/contacts/as_vcard/ URI. Signal's ShareRepository.resolve() calls contentResolver.openInputStream() and contentResolver.query() on this URI. If Signal does not have READ_CONTACTS permission (common on GrapheneOS, where users often deny this or use Contact Scopes), the URI read fails with a SecurityException that Signal catches silently, resulting in ResolvedShareData.Failure.

Additionally, the ContactsProvider returns NULL for the SIZE column on vCard URIs (OpenableColumns.SIZE maps to "NULL" in sContactsVCardProjectionMap). If Signal's size validation treats zero/null size as invalid, this would also cause rejection.

Note: A complementary fix has been submitted on the GrapheneOS Contacts side to explicitly add FLAG_GRANT_READ_URI_PERMISSION to the share intent (GrapheneOS/platform_packages_apps_Contacts#25). However, Signal should also handle this case gracefully, as other apps using the same AOSP share pattern will have the same issue.

Related issues

Device

Pixel (GrapheneOS)

Android version

15

Signal version

Latest from accrescent/GitHub releases

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions