Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for protocol version 8 #1905

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

andyholmes
Copy link
Collaborator

Add support for the planned changes in protocol version 8.

See: https://invent.kde.org/network/kdeconnect-android/-/commit/454b2fd5d7b3162443fbec4a6f0b7cafa1b554ee

@andyholmes andyholmes force-pushed the andyholmes/protocol-v8 branch 3 times, most recently from 07f3803 to 7dca883 Compare January 10, 2025 17:59
@andyholmes andyholmes force-pushed the andyholmes/protocol-v8 branch from 7dca883 to 3af22bb Compare January 10, 2025 18:18
@ferdnyc
Copy link
Member

ferdnyc commented Jan 15, 2025

@andyholmes Yesterday Albert also updated the protocol docs to make it required that devices have UUID-format device IDs, the definition is now:

  • deviceId: String 🔒

    pattern: /^[a-zA-Z0-9_]{32,38}$/

    A unique ID for the device. Must be between 32 and 38 characters and made of only alphanumerical characters and underscores. A valid device ID can be generated from a random UUIDv4 string by removing the hyphens (-) or replacing them with underscores (_), such as 740bd4b9_b418_4ee4_97d6_caf1da8151be.

I feel like I still have some devices on my pairing list that use a shorter ID string. And even if not, GSConnect IDs are currently real UUIDs (with hyphens instead of underscores).

I wonder if we need code to migrate devices to new-format IDs?

@andyholmes
Copy link
Collaborator Author

@andyholmes Yesterday Albert also updated the protocol docs to make it required that devices have UUID-format device IDs, the definition is now:

  • deviceId: String 🔒
    pattern: /^[a-zA-Z0-9_]{32,38}$/
    A unique ID for the device. Must be between 32 and 38 characters and made of only alphanumerical characters and underscores. A valid device ID can be generated from a random UUIDv4 string by removing the hyphens (-) or replacing them with underscores (_), such as 740bd4b9_b418_4ee4_97d6_caf1da8151be.

I feel like I still have some devices on my pairing list that use a shorter ID string. And even if not, GSConnect IDs are currently real UUIDs (with hyphens instead of underscores).

I think the shorter codes are old Android hostnames, but yeah, the certificate & device ID generation needs to be updated.

I wonder if we need code to migrate devices to new-format IDs?

I don't think true migration will be possible, since the device ID is directly tied to the certificate. It's just unavoidable that folks will have to repair some devices

I suppose detecting a certificate with an old ID is possible and then showing a popup informing the user.

@ferdnyc
Copy link
Member

ferdnyc commented Jan 17, 2025

@andyholmes

I wonder if we need code to migrate devices to new-format IDs?

I don't think true migration will be possible, since the device ID is directly tied to the certificate. It's just unavoidable that folks will have to repair some devices

Oh, yeah, but mostly I meant that there are a lot of (GSConnect) installations out there with real-uuid-format-deviceIDs, that need to get their IDs regenerated as fake_uuid_format_deviceIDs. (And then, as you say, their certificates regenerated.) Normally, we wouldn't generate a new local device ID unless it was a first-time install.

And then they'll also have to re-pair all of their devices.

(Edit: Sucks that their app preferences will all get effectively wiped out, since they'll have to reconfigure everything on the Android (or other-remote) end for the new pairing.

On the local end, since it'll be the same remote device ID I believe the preferences should be carried over.)

@daniellandau
Copy link
Member

Are these problems specific to gsconnect? Has the KDE side been using fake_uuids_with_underscores already?

@ferdnyc
Copy link
Member

ferdnyc commented Jan 17, 2025

@daniellandau

Are these problems specific to gsconnect? Has the KDE side been using fake_uuids_with_underscores already?

Apparently yes, Albert's comment on making the change was:

All implementations have been using UUIDs as device IDs for a while, so we can start validating and enforcing this format.

However, while it's true GSConnect has been using UUIDs as device IDs, we've been using them with hyphens instead of underscores, while KDE Connect has apparently been doing the reverse.

@ferdnyc
Copy link
Member

ferdnyc commented Jan 17, 2025

I opened #1910 to track the device ID format issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants