* payment lock
* add 30 day timeout to showing the payment lock suggestion
* fix linting
* update comment
* Payment Lock: Fix project file & submodules (#4878)
* revert ringrtc changes
* revert pods changes
* fix project file
* PR Comment suggestions and fixes
* PR suggestions
* revert screen lock to previous implementation
* rename OWSPaymentLock to OWSPaymentsLock (missing plural s), remove
super-class dependency. Make OWSPaymentsLock more "swifty".
* revert changes to call-site for OWSScreenLock
* update call-sites for OWSPaymentsLock
* forgot to add PaymentOnboarding class and localization comment improvements
* change function call-site
* Remove OWSLocalAuthentication from project
* remove OWSLocalAuth from project file
* make edge-case default more secure if storage not ready
* fix project file
* lint fix
* fix linting errors
* Revert compact format style for OWSLocalizedString
* fix localization call-sites to use literals, update localization file after autogen
* Add new Payments Lock Prompt view to be shown after activating payments. Factor out the BiometryType "current biometry" into its own class with helpers to easily getting the devices current setup.
* fix linting issues, sort project file, and autogen localizations
* require payments lock to look at the recovery phrase
* fix linting issue
* fix missing localizations (caused by dynamic creation in previous commit)
* use Pods commit from signal/main
* re-run linter on latest commits
* new header comments for new branch files
* update submodule commits
* Use existing secondsInDay constant kDayInterval, use weak self guard statement instead of optional self in escaping closure.
* Revert submodule changes
* Remove duplicate copyright headers
* Revert copyright header changes
* Restore some missing translations
* Add localization for unknown LocalAuthentication error/state.
* remove Pods changes
* linting
* use submodule commits from main
* subclass the old Objc OWSViewController super-class, should fix CICD
* change capitalized Passcode to lower-case in non-title situation.
* remove early exit guard from biometryType computed function. Reason being that the type can be gathered from a policy that evaluates to false. In a case where the user has a FaceID phone but its disabled, the messaging would be incorrect. removing the early exit evaluates the biometryType which apple provides even if the policy returns false.
* inline snooze date
* inject write transaction to some convenience methods to reduce database overhead when multiple calls need to happen at the same time.
* make combined set and snooze function, update combined call-site
* rename long function
* use false instead of sender.on to avoid sneaky view issues
* add tryToUnlockPromise function to clean up call sites
* change superclass, fix Promise statement
* call super class function
* remove objc
* add unlock failed action sheet helper class and put at all relevant call-sites, still need to test though.
* add unlock failed action sheet helper class and put at all relevant call-sites, still need to test though. linting
* project file changes for new file
* re-render payments lock toggle after failure to change setting.
re-render payments lock toggle after failure to change setting.
* move around action sheet call-site to account for an action sheet already being presented. remove unecc. return
* fix merge conflicts, linting
* re-gen strings file
---------
Co-authored-by: Max Radermacher <max@signal.org>
* Put KeyBackupService in its own folder
* Put SDSKeyValueStore in its own directory
* Put SDSDatabaseStorage in its own directory
* Stop doing useless dispatches in SDSTransactable
* Add V2 DB classes
* Wrap SDSKeyValueStore in a protocol and factory
* Make TSConstantsProtocol public to take it as a param in other places
* Take explicit transactions and do single lookups in TSAccountManager registration state methods
* Take explicit transaction on OWS2FAManager
* Make KeyBackupService an instance that takes dependencies on init
* Protocolize KeyBackupService
* Put Dependencies+SSK in its own directory
* Add DependenciesBridge
* add ViewControllerContext
* used shared context in OnboardingController
* Don't check KeyBackupService in RemoteConfigManager; the one and only callsite already checks it separately
* All the random cleanup that needed to happen to get the app to build again.
* Add mock dbv2 classes
* Migrate existing KeyBackupServiceTests
* Namespace KBS shims
* DBV2 -> DB, after changing the min swiftlint type length to 2 chars
* add toy example
* Unwrap writes as reads
* pr comments
* pr comments 2: return of the nits
* final Pr comment
This is similar to 227f05e932.
This change should have no user impact.
This changes the "delete subscriber ID" request in the following ways:
- Adds tests
- Converts it to Swift
- Renames `deleteSubscriptionIDRequest` to `deleteSubscriberID`
- Serializes the data inside the method, rather than requiring callers
to do so
This change should have no user impact.
This changes the "set subscriber ID" request in the following ways:
- Adds tests
- Converts it to Swift
- Renames `setSubscriptionIDRequest` to `setSubscriberID`
- Serializes the data inside the method, rather than requiring callers
to do so
Tested this with automated tests and manually starting a subscription in
staging.
This change should have no user impact. It makes a few cleanups to
`OWSRequestFactory.requestPreauthChallengeRequest`:
- Adds tests
- Converts it to Swift
- Renames it to `requestPreauthChallenge`
- URL-encodes the parameters. This required some additional scaffolding;
see `URLPathComponents`.
This change should have no user impact. It makes a few changes to
`OWSRequestFactory.deviceProvisioningRequestWithMessageBody`:
- Adds tests
- Converts it to Swift
- Renames it to `provisionDevice`
- URL-encodes one of the parameters
(I was thankful for `OWSDeviceProvisionerTest` when I made this change,
as it increased my confidence that this was safe.)
This change should have no user impact.
This makes the following changes to `OWSRequestFactory.reportSpam`:
- Converts it to Swift
- Adds tests
- Handles a server GUID that couldn't be URL-encoded. For example, if it
contained spaces, we'd crash constructing the URL. No longer!
- Handles an empty server GUID
This was partly done in 6e6327b007. The
server now [hard-codes this capability to `true`][0] so it's completely
useless for us to set it.
[0]: fb4ed20ff5
Change license to AGPL
This commit:
- Updates the `LICENSE` file
- Start every file with something like:
// Copyright YEAR_FIRST_PUBLISHED Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
---
First, I removed existing license headers with this Ruby 3.1.2 script:
require 'set'
EXTENSIONS_TO_CHECK = Set['.h', '.hpp', '.cpp', '.m', '.mm', '.pch', '.swift']
same = 0
different = 0
all_files = `git ls-files`.lines.map { |line| line.strip }
all_files.each do |relative_path|
if relative_path == 'Pods'
next
end
unless EXTENSIONS_TO_CHECK.include? File.extname(relative_path)
next
end
path = File.expand_path(relative_path)
contents = File.read(path)
new_contents = contents.sub(/\/\/\n\/\/ Copyright .*\n\/\/\n\n/, '')
if contents == new_contents
same += 1
else
different += 1
end
File.write(path, new_contents)
end
puts "updated #{different} file(s), left #{same} untouched"
I'm sure this script could be improved, but it worked well enough.
Then, I created `Scripts/lint/lint-license-headers` and ran it to auto-
fix a lot of files. This changed the mode of some files, but I think
that's actually desirable. For example,
`SignalServiceKit/src/Util/AppContext.m` previously had a mode of
`0755/-rwxr-xr-x`, and it's now `0644/-rw-r--r--`.
Then I fixed some stragglers and updated the precommit script.
See [a similar change in the Desktop app][0].
[0]: 8bfaf598af
_This change should have no user impact._
This cleans up the way we generate registration IDs. It:
- Rewrites the generation code in Swift
- Removes the "sneaky transaction" method. I did this for clarity, and
because we won't use it for much longer
- Turns a log warning into a regular log—generating a registration ID is
not a problem
- Adds tests
I think this is a useful change on its own, but will be handy for an
upcoming change, too.
To improve message reliability, we're adding an urgency flag to outgoing
messages. For example, outgoing calls are urgent, but delivery receipts
are not. [Android][] and [Desktop][] have already done this work.
At a high level, I added an `isUrgent` property to `TSOutgoingMessage`s.
It defaults to `true`. Some subclasses, like
`OWSReceiptsForSenderMessage`, override it to return `false`.
Builds off of a few other commits (not necessary to understand this
commit, but might be useful for posterity):
- e858a0d916
- 8c6d2ebe8c
- 402b117221
- 2ba0cd764d
- 266a4663e9
- 8e5009bbf7
[Android]: dc04c8ed98
[Desktop]: 06190b1434
This change should have no user impact because it only changes
comments.
We had some comments that referenced the Signal server repo. They
referenced a commit that was a little out of date (from March 2022).
This updates the links.
This removes `FeatureFlags.giftBadgeReceiving` and
`FeatureFlags.giftBadgeSending`, replacing them with
`RemoteConfig.canReceiveGiftBadges` and
`RemoteConfig.canSendGiftBadges`.
This makes a few small changes to `OWSRequestFactory.boostCreatePaymentIntent()`:
- Adds tests
- Rewrites the function in Swift
I made sure I could do a boost (in staging) in the simulator.
_I recommend reviewing this with whitespace changes disabled._
Signal has renamed its primary branch to `main`. This updates references
to the old name, `master`, to either reference `main` or a specific
commit hash.
I also fixed a couple of small whitespace issues in a file I was
editing.
Pre-keys are refreshed at regular (throttled) intervals, but the
"refresh" operation will only actually upload new pre-keys if the
server says we're running low. In addition, after the "refresh",
there's a "rotation" operation for the signed pre-key if the current
one is more than two days old. This only runs if the refresh was
skipped, since uploading new one-time pre-keys is already an
opportunity to rotate the signed pre-key (and it's worth doing so,
since pre-keys running low can indicate high traffic).
None of this has changed. However, we can now do this for both ACI and
PNI pre-keys. This reworked +[TSPreKeyManager
checkPreKeysWithShouldThrottle:] quite a bit to declare the proper
operation dependencies, which isn't *strictly* necessary because the
queue they're executed on is already limited to a
maxConcurrentOperationCount of 1. We could remove that at this point
with proper use of "barrier" operations, but since all the operations
are hitting the server and account updates have to be serialized on
*that* end, there doesn't seem to be much of a benefit.