File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
common/src/main/java/com/yogeshpaliyal/common Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ data class PasswordConfig(
11
11
val includeUppercaseLetters : Boolean ,
12
12
val includeLowercaseLetters : Boolean ,
13
13
val includeSymbols : Boolean ,
14
- val listOfSymbols : List <Char >,
14
+ val listOfSymbols : List <Char > = PasswordGenerator .totalSymbol ,
15
15
val includeNumbers : Boolean ,
16
16
val includeBlankSpaces : Boolean ,
17
17
val password : String
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package com.yogeshpaliyal.common.utils
2
2
3
3
import androidx.datastore.core.Serializer
4
4
import com.yogeshpaliyal.common.data.UserSettings
5
- import kotlinx.serialization.SerializationException
6
5
import kotlinx.serialization.json.Json
7
6
import java.io.InputStream
8
7
import java.io.OutputStream
@@ -16,16 +15,13 @@ class UserSettingsSerializer(
16
15
17
16
override suspend fun readFrom (input : InputStream ): UserSettings {
18
17
val decryptedBytes = cryptoManager.decrypt(input)
19
- return try {
20
- val decodedString = decryptedBytes.decodeToString()
21
- Json .decodeFromString(
22
- deserializer = UserSettings .serializer(),
23
- string = decodedString
24
- )
25
- } catch (e: SerializationException ) {
26
- e.printStackTrace()
27
- defaultValue
28
- }
18
+
19
+ val decodedString = decryptedBytes.decodeToString()
20
+ return Json .decodeFromString(
21
+ deserializer = UserSettings .serializer(),
22
+ string = decodedString
23
+ )
24
+
29
25
}
30
26
31
27
override suspend fun writeTo (t : UserSettings , output : OutputStream ) {
You can’t perform that action at this time.
0 commit comments