Repository navigation
feat: pairing screen - #10
Merged
Merged
Conversation
Server URLs must be https (a bare host gets https://, http:// is refused), device names follow the server's policy and default to Build.MODEL. DeviceSetup pairs, then stores the server URL and the encrypted token in noBackupFilesDir; a token without a usable server or key means the device has to be paired again.
The pairing request and the token write run to completion even if the screen goes away, because the server has already consumed the code. The form's toString leaves the pairing code out.
If saving the new token failed after the new URL was written, an old token could be paired with the new server and sent there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5
What
First-time setup: pair this device with a Daycompass server.
Build.MODEL, cut to 64 characters, with control characters removed and "Android device" as fallback; it is checked against the server's name policy before sending.https://;http://is refused, not upgraded. A path prefix such as/daycompassis kept.Retry-Afterdelay in minutesSecurity / privacy relevant
DeviceSetupstores the server URL as plain text innoBackupFilesDir/server_url.txt(not a secret, excluded from backups) and the token through the encrypted store from Encrypted device token storage (Keystore AES-GCM) #4. A token without a usable server URL means the device has to be paired again.PairingForm.toString()leaves the pairing code out. Nothing is logged.Build.MODEL, never from the personal device name in the settings./device/meclock check (that belongs to the sync milestone).Dependencies
androidx.lifecycle:lifecycle-viewmodel-compose2.9.4, the lifecycle version that was already resolved transitively. Verification metadata gains its entries, and all CI tasks pass one at a time with a coldGRADLE_USER_HOME.Tests
The new tests cover URL parsing, the name policy, the error mapping, an untrusted certificate told apart from an unreachable server, a failing Keystore, the old-token/new-server case, and that a rejected code stores nothing. The screens have not been run on a device or emulator yet.