The previous implementation used 6 separate text fields for the SMS
verification code, which broke macOS's built-in SMS autofill functionality.
When the system detects an SMS code and offers to autofill it, it expects
a single text field to receive the entire code.
Changes:
- Replaced 6 individual PinCodeCharacterTextField instances with a single
NSTextField
- Added .oneTimeCode content type to enable SMS autofill on macOS 11+
- Simplified the code structure while maintaining the same functionality
- Added input validation to ensure only digits are accepted
Now when users receive an SMS verification code, macOS can properly
autofill the entire code with a single click, rather than filling only
the first digit and deleting the message.
Closes#788
- We now check if in the handling of two factor option, the option to be used is a SecurityKey. If so, check if a FIDO2 device is attached and if it needs a PIN.
- When a PIN is not required, we can just move straight onto assertation, the code for which will present the touch key UI.
- Otherwise we fallback to the original flow.
- This object was being kept around after being created and as we need it in some other functions it made sense to make it lazy and keep it around that way.
- Arguably the FIDO2 instance could be removed after each time it’s been used, but as the FIDO2 class doesn’t have any state stored in it, it seems benign keeping it about for now.
- Use from https://github.com/abiligiri/swift-srp, version 1.1.0
This is based on latest from upstream with changes required
- Remove local copy of swift-srp
- Switch to use https://github.com/adam-fowler/swift-srp with some modifications
that are local
- Pad g value to equal size of N while calculating clientProof
- Use SHA256(plain-text-password) while computing key using PBKDF2
- Added a unit test with some sample values
- Introduced a new preference keys allowedMajorVersions, hideSupportXcodes
- allowedMajorVersions defaults to Int.max (ie allow all versions till date)
- allowedMajorVersions is used to limit the number of major versions to as many as
value set for this key. Eg: A value of 1 would allow the latest GA version and one major version before
A value of 0 would allow only the latest GA version
A value of 2 would allow the latest GA and previous two major versions
- allowedMajorVersions does not have preference UI
$ defaults write com.xcodesorg.xcodesapp allowedMajorVersions 2 #to limit to current GA and previous major
$ defaults delete com.xcodesorg.xcodesapp allowedMajorVersions #to remove limits
- Display buildNumber in bottom status bar