This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object Entry : Route() { | |
| override val label: String = "entrymodule" | |
| override val arguments: List<String>? = null | |
| override val optionalArguments: List<String>? = null | |
| object Login : Route() { | |
| override val label: String = "login" | |
| override val arguments: List<String>? = null | |
| override val optionalArguments: List<String>? = null | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NavHost(navController = navController, startDestination = "entryModule") { | |
| navigation("login", "entryModule") { | |
| composable("login") { | |
| LoginScreen { | |
| navController.navigate("signup/sumeetrukeja@gmail.com/123456?birthdate=23-Sep-1994") | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| abstract class Route { | |
| abstract val label: String | |
| abstract val arguments: List<String>? | |
| abstract val optionalArguments: List<String>? | |
| val route: String by lazy { | |
| StringBuilder(label).apply { | |
| arguments?.let { | |
| it.forEach { | |
| append("/{$it}") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class DataStoreUtil { | |
| /** | |
| * serializes data type into string | |
| * performs encryption | |
| * stores encrypted data in DataStore | |
| */ | |
| private suspend inline fun <reified T> DataStore<Preferences>.secureEdit( | |
| value: T, | |
| crossinline editStore: (MutablePreferences, String) -> Unit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SecurityUtil | |
| @Inject | |
| constructor() { | |
| private val provider = "AndroidKeyStore" | |
| private val cipher by lazy { | |
| Cipher.getInstance("AES/GCM/NoPadding") | |
| } | |
| private val charset by lazy { | |
| charset("UTF-8") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| setIsStrongBoxBacked(true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| setUserAuthenticationRequired(true) | |
| setUserAuthenticationValidityDurationSeconds(5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val masterKey = MasterKeys.getOrCreate(MasterKeys.AES256_GCM_SPEC) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| implementation 'androidx.security:security-crypto:1.0.0-alpha02' |
NewerOlder