radarlabs / radar-sdk-android

Android SDK for Radar, the leading geofencing and location tracking platform
https://radar.com
Apache License 2.0
75 stars 22 forks source link

Kennyhu/mob 18 encrypt sensitive data in device storage from radar sdk #334

Open KennyHuRadar opened 9 months ago

KennyHuRadar commented 9 months ago

Decisions and considerations. We are adding a new android x dependency for encrypted shared preferences. We have decided to use the interface of the long term stable version, like Okta and Stripe. This implementation choice was picked over the alternative of using shared preference with in-house crypto library (high risk and engineering effort) and migrating off shared preferences (high effort).

Risk of dependency conflicts are mitigated via using a version of the dependency used by other SDKs and also allowing devices running earlier versions of android to use the regular shared preferences.

Currently implementing with bump in minimum deploy target to SDK 23. Based on data on customers, we determined that the impacts are small.

Added a fake key store to pass unit test per suggestion of (this is a workaround and there does not seem to be an offical support for AndroidKeyStore within the test suite)

KennyHuRadar commented 9 months ago

waypoint build: https://expo.dev/accounts/radarlabs/projects/waypoint/builds/86a7e0b0-103a-4171-9067-1a9e6ae7d9b3