Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Adjust device time test setting (DEV) #2316

Merged
merged 3 commits into from
Feb 10, 2021

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Feb 10, 2021

Instead of faking the "disable-device-time-check" which won't work for SafetyNet,
we now fake the time offset to be within the acceptable delta.

Testing

  • Check that this can't become active in production, and that the tests cover this.
  • Check that you can now time travel and do and can perform a "casual" verification via the data donation test menu

Instead of faking the "disable-device-time-check" which won't work for SafetyNet,
we now fake the time offset to be within the acceptable delta.
@d4rken d4rken added the maintainers Tag pull requests created by maintainers label Feb 10, 2021
@d4rken d4rken added this to the 1.13.0 milestone Feb 10, 2021
@d4rken d4rken requested a review from a team February 10, 2021 10:36
@ralfgehrer ralfgehrer self-assigned this Feb 10, 2021
@ralfgehrer ralfgehrer added the prio PRs to review first. label Feb 10, 2021
@ralfgehrer
Copy link
Contributor

When activating fake time and traveling one day into the future, I receive the following exception on the "Casual" SafetyNet Report
SafetyNetException: TIME_SINCE_ONBOARDING_UNVERIFIED: Time since first reliable timestamp <24h

@LukasLechnerDev LukasLechnerDev self-assigned this Feb 10, 2021
@sonarcloud
Copy link

sonarcloud bot commented Feb 10, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

80.0% 80.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@ralfgehrer ralfgehrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarified with @d4rken.

  • Launch app
  • check test menu --> Remote config - isDeviceTimeCorrec should be true
  • enable fake time
  • travel > 24h
  • check SafetyNet Report "Casually" --> Requirements passed

Copy link
Contributor

@LukasLechnerDev LukasLechnerDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Device has correct time
  • Reset App
  • Do Onboarding
  • TestMenu: Create SafetyNet Report
    => casual verification fails with "Time since first reliable timestamp < 24h"

=====

  • Enable "Fake correct device time"
  • time travel 24h into the future
  • TestMenu: Create SafetyNet Report
    => casual verification: "Requirements passed"

=====

  • time travel only 23h in the future
  • TestMenu: Create SafetyNet Report
    => casual verification fails with "Time since first reliable timestamp < 24h"

=> Works as expected.

  • Tests also look good and verify that the time can't be faked in production builds.
  • One Suggestion would be to describe the new switch a bit better in the Developer Menu. e.g. by adding "This allows time travelling while still getting positive device time checks" or something like that

@d4rken d4rken added the author merge PR to be merged by author label Feb 10, 2021
@d4rken d4rken merged commit 1069453 into release/1.13.x Feb 10, 2021
@d4rken d4rken deleted the fix/DEV-adjust-testoptions-safetynet branch February 10, 2021 16:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
author merge PR to be merged by author maintainers Tag pull requests created by maintainers prio PRs to review first.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants