Commit Graph

23 Commits

Author SHA1 Message Date
dkadrikj 519765b9bd Rename ServerConnectionListener.kt to ApiConnectionListener.kt,
ServerConnectionHandler.kt to ApiConnectionHandler.kt and
ServerConnectionException.kt to ApiConnectionException.kt
2021-11-22 15:01:26 +00:00
Benjamin Monjoie bd78d8069d Delay OkHttp's initialization
OkHttp's cache initialization is blocking the UI.
As per this trick: https://www.zacsweers.dev/dagger-party-tricks-deferred-okhttp-init/,
it should be better to initialize OkHttp in Retrofit's `callFactory` method.

This currently doesn't solve the issue with coroutines but has no downside either.
Indeed, the `callFactory` SAM is called on the `Dispatcher` which initiate the call.
It's often the `viewModelScope` which is using `Dispatchers.Main`.
Hopefully, an update to Retrofit will solve this issue.
2021-10-07 15:39:19 +00:00
Jorge Martín 102f40d3d6 Add Atlas Proxy for testing, ExtraHeaderProvider to add arbitrary headers to all requests 2021-10-06 09:31:42 +02:00
Neil Marietta ae9280d50b KeyStoreCrypto fallback if Android KeyStore is not properly working. 2021-09-21 16:25:03 +02:00
Neil Marietta a5bcf95dae Network: Added TooManyRequest error handling per Session. 2021-08-13 15:19:12 +02:00
Neil Marietta 4784644591 Added ServerTimeListener/ServerTimeInterceptor, updating PGPCrypto time. 2021-06-21 14:11:04 +02:00
Neil Marietta 1b7e6eb9e9 Fixed ClientId initialisation issue.
Added ClientIdProvider (rely on ProtonCookieStore).
2021-06-03 17:18:11 +02:00
Neil Marietta 646183da63 Refactored HumanVerification.
Never delete HumanVerification tokens except on Invalid Verification Code (error 12087).

HumanVerification Network Handlers:
- HumanVerificationNeededHandler: call onHumanVerificationNeeded on error 9001 (last of error handler list).
- HumanVerificationInvalidHandler: call onHumanVerificationInvalid (which delete token) on error 12087.
2021-06-03 17:18:11 +02:00
dkadrikj 98ca99f9a6 Various improvements for Signup and Presentation.
Various improvements for User, Human Verification and Presentation modules.
Various improvements for User, Human Verification and Presentation modules.
Remove PayloadRequest.kt.
Update tests suite.
Remove not used files NewUser.kt and NewExternalEmailUser.kt
Take out create address from UserManager.kt
User emailSplit extension instead.
Introduce CreateUserType.kt
Move HumanVerificationResult handler into the ViewModel.
Fix wait to DB write HV ViewModel.
Improve SetupPrimaryKeys.kt.
Fix HV tests.
2021-05-12 21:07:28 +02:00
dkadrikj d41e19e28c Change network module to support refactored Human Verification module. 2021-05-12 17:57:14 +00:00
dkadrikj 7b5ebaa9e2 Add persistent cookie support. 2020-12-01 11:00:39 +01:00
Neil Marietta ec97d4dfbc Updated Target Android SDK Level to 30. 2020-11-11 18:02:34 +01:00
Neil Marietta bf33818a5a Integrated AccountManager with modules. 2020-11-02 10:38:21 +01:00
Neil Marietta 0fa57dff20 Removed ExperimentalCoroutinesApi annotation (see build.gradle.kts, kotlinCompilerArgs). 2020-11-02 10:33:09 +01:00
Davide Farella 4e0d9d3dd5 Update Kotlin, Serialization and Coroutines
* Kotlin [1.3.72] -> [1.4.10]
* Serialization [0.20.0] -> [1.0.0]
* Coroutines [1.3.4] -> [1.4.0-M1]

CP-994
2020-10-21 18:23:54 +02:00
Neil Marietta 53f8b0107f Integrated SessionListener/SessionProvider/SessionId into network modules.
Added ApiProvider (create ApiManager instance given a sessionId).
Adapted HumanVerification modules to use ApiProvider.
2020-10-20 11:22:27 +02:00
Mateusz Markowicz f8818f84cd Add testing for certificate pinning 2020-07-16 11:06:39 +02:00
Mateusz Markowicz c06b9e32f0 Support for int -> bool serialization for Proton API 2020-07-07 17:26:34 +02:00
Mateusz Markowicz b0b16eef9a Log and include original exception in ApiResult.Error 2020-07-07 17:26:34 +02:00
Mateusz Markowicz ca85c626fb Introducing API block avoidance based on DoH 2020-07-03 11:24:18 +00:00
Mateusz Markowicz 619f7e65bc Prepare module factory interface to support DoH
CP-405
2020-07-02 14:09:36 +00:00
Mateusz Markowicz d14e896863 Refactor handling of proton error data in json response
- use deserializer from kotlin-utils
- merge Proton and Http ApiResult errors
2020-07-02 14:09:36 +00:00
Algirdas Pundzius 265a5a0205 Initial commit
Co-authored-by: Davide Giuseppe Farella <4face91@protonmail.com>
Co-authored-by: Dino Kadrikj <kadrikj@protonmail.ch>
Co-authored-by: Mateusz Markowicz <poniekad@protonmail.com>
2020-07-01 13:58:49 +03:00