File tree 27 files changed +253
-40
lines changed
common/src/main/java/com/twofasapp/common/domain
designsystem/src/main/java/com/twofasapp/designsystem/dialog
src/main/java/com/twofasapp/feature/home/ui/editservice
startup/src/main/java/com/twofasapp/feature/startup/ui/startup
27 files changed +253
-40
lines changed Original file line number Diff line number Diff line change 1
1
package com.twofasapp.common.domain
2
2
3
+ import android.net.Uri
4
+
3
5
data class Service (
4
6
val id : Long ,
5
7
val serviceTypeId : String? ,
@@ -125,4 +127,44 @@ data class Service(
125
127
backupSyncStatus = BackupSyncStatus .SYNCED ,
126
128
)
127
129
}
128
- }
130
+
131
+ fun toUri (): String {
132
+ return Uri .Builder ()
133
+ .apply {
134
+
135
+ scheme(" otpauth" )
136
+
137
+ authority(authType.name.lowercase())
138
+
139
+ if (info.isNullOrBlank().not ()) {
140
+ appendEncodedPath(" $name :$info " )
141
+ } else {
142
+ appendEncodedPath(name)
143
+ }
144
+
145
+ appendQueryParameter(" secret" , secret)
146
+
147
+ if (issuer.isNullOrBlank().not ()) {
148
+ appendQueryParameter(" issuer" , issuer)
149
+ }
150
+
151
+ if (digits != null && digits != DefaultDigits ) {
152
+ appendQueryParameter(" digits" , digits.toString())
153
+ }
154
+
155
+ if (period != null && period != DefaultPeriod ) {
156
+ appendQueryParameter(" period" , period.toString())
157
+ }
158
+
159
+ if (hotpCounter != null && authType == AuthType .HOTP ) {
160
+ appendQueryParameter(" counter" , hotpCounter.toString())
161
+ }
162
+
163
+ if (algorithm != null && algorithm != DefaultAlgorithm ) {
164
+ appendQueryParameter(" algorithm" , algorithm.name)
165
+ }
166
+
167
+ }
168
+ .toString()
169
+ }
170
+ }
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import androidx.compose.ui.Alignment
14
14
import androidx.compose.ui.Modifier
15
15
import androidx.compose.ui.tooling.preview.Preview
16
16
import androidx.compose.ui.unit.dp
17
+ import com.twofasapp.designsystem.TwTheme
17
18
18
19
@Composable
19
20
fun ListDialog (
@@ -38,6 +39,7 @@ fun ListDialog(
38
39
Text (
39
40
text = text,
40
41
style = MaterialTheme .typography.bodyLarge,
42
+ color = TwTheme .color.onSurfacePrimary,
41
43
modifier = Modifier
42
44
.fillMaxWidth()
43
45
.padding(horizontal = DialogPadding )
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ fun ListRadioDialog(
66
66
)
67
67
Text (
68
68
text = text,
69
+ color = TwTheme .color.onSurfacePrimary,
69
70
style = MaterialTheme .typography.bodyLarge,
70
71
modifier = Modifier .padding(start = 16 .dp)
71
72
)
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: de-DE, German (Germany)
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:30 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
854
854
<string name =" widget__no_selected_services" >Gedrückt halten und Service auswählen, um das Widget zu aktivieren...</string >
855
855
<string name =" widget__reveal_tokens_long_message" >Decke deine 2FAS-Token für 60 Sekunden auf</string >
856
856
<string name =" widget__reveal_tokens_short_message" >Aufdecken für 60 Sekunden</string >
857
- <string name =" settings__show_error_details" >Show error details</string >
857
+ <string name =" settings__show_error_details" >Fehlerdetails anzeigen</string >
858
+ <string name =" tokens__show_qr_code" >Zeige Dienst-QR</string >
859
+ <string name =" tokens__show_service_qr_setup_lock" >Dein Dienst ist geschützt. Bitte füge eine PIN oder Fingerabdrucksperre hinzu, um den QR-Code zu sehen.</string >
860
+ <string name =" tokens__copy_uri" >Copy URI</string >
858
861
</resources >
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: el-GR, Greek (Greece)
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:31 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
854
854
<string name =" widget__no_selected_services" >Κρατήστε πατημένο και επιλέξτε service για να ενεργοποιήσετε το widget...</string >
855
855
<string name =" widget__reveal_tokens_long_message" >Αποκαλύψτε τις μάρκες 2FAS για 60 δευτερόλεπτα</string >
856
856
<string name =" widget__reveal_tokens_short_message" >Αποκάλυψη για 60 δευτερόλεπτα</string >
857
- <string name =" settings__show_error_details" >Show error details</string >
857
+ <string name =" settings__show_error_details" >Εμφάνιση λεπτομερειών σφάλματος</string >
858
+ <string name =" tokens__show_qr_code" >Κωδικός QR Υπηρεσίας</string >
859
+ <string name =" tokens__show_service_qr_setup_lock" >Η υπηρεσία σας είναι προστατευμένη. Παρακαλώ προσθέστε ένα PIN ή κλείδωμα με δακτυλικό αποτύπωμα για να δείτε τον κωδικό QR.</string >
860
+ <string name =" tokens__copy_uri" >Copy URI</string >
858
861
</resources >
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: es-ES, Spanish (Spain)
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:30 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
855
855
<string name =" widget__reveal_tokens_long_message" >Revela tus fichas 2FAS durante 60 segundos</string >
856
856
<string name =" widget__reveal_tokens_short_message" >Revela durante 60 segundos</string >
857
857
<string name =" settings__show_error_details" >Show error details</string >
858
+ <string name =" tokens__show_qr_code" >Service QR Code</string >
859
+ <string name =" tokens__show_service_qr_setup_lock" >Your service is protected. Please add a PIN or Fingerprint lock to see QR code.</string >
860
+ <string name =" tokens__copy_uri" >Copy URI</string >
858
861
</resources >
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: fr-FR, French (France)
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:30 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
854
854
<string name =" widget__no_selected_services" >Maintenir et sélectionner le service pour activer le widget...</string >
855
855
<string name =" widget__reveal_tokens_long_message" >Révéler les jetons 2FAS pendant 60 secondes</string >
856
856
<string name =" widget__reveal_tokens_short_message" >Révéler pendant 60 secondes</string >
857
- <string name =" settings__show_error_details" >Show error details</string >
857
+ <string name =" settings__show_error_details" >Afficher les détails de l\'erreur</string >
858
+ <string name =" tokens__show_qr_code" >QR Code du service</string >
859
+ <string name =" tokens__show_service_qr_setup_lock" >Le service est protégé. Merci de configurer la protection par PIN ou empreinte pour afficher le QR code.</string >
860
+ <string name =" tokens__copy_uri" >Copy URI</string >
858
861
</resources >
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: it-IT, Italian (Italy)
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:31 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
855
855
<string name =" widget__reveal_tokens_long_message" >Mostra il tuo token 2FAS per 60 secondi</string >
856
856
<string name =" widget__reveal_tokens_short_message" >Mostra per 60 secondi</string >
857
857
<string name =" settings__show_error_details" >Show error details</string >
858
+ <string name =" tokens__show_qr_code" >Service QR Code</string >
859
+ <string name =" tokens__show_service_qr_setup_lock" >Your service is protected. Please add a PIN or Fingerprint lock to see QR code.</string >
860
+ <string name =" tokens__copy_uri" >Copy URI</string >
858
861
</resources >
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: ja-JP, Japanese (Japan)
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:31 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
848
848
<string name =" widget__no_selected_services" >ウィジェットを有効化するには、サービスを長押しして選択してください...</string >
849
849
<string name =" widget__reveal_tokens_long_message" >2FASのトークンを60秒間表示</string >
850
850
<string name =" widget__reveal_tokens_short_message" >60秒間表示</string >
851
- <string name =" settings__show_error_details" >Show error details</string >
851
+ <string name =" settings__show_error_details" >エラーの詳細を表示</string >
852
+ <string name =" tokens__show_qr_code" >QRコードの表示</string >
853
+ <string name =" tokens__show_service_qr_setup_lock" >サービスは保護されています。QRコードを表示するにはPINまたは指紋認証のロックを設定してください。</string >
854
+ <string name =" tokens__copy_uri" >Copy URI</string >
852
855
</resources >
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: nl-NL, Dutch (Netherlands)
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:31 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
855
855
<string name =" widget__reveal_tokens_long_message" >Uw 2FAS tokens voor 60 seconden onthullen</string >
856
856
<string name =" widget__reveal_tokens_short_message" >60 seconden onthullen</string >
857
857
<string name =" settings__show_error_details" >Show error details</string >
858
+ <string name =" tokens__show_qr_code" >Service QR Code</string >
859
+ <string name =" tokens__show_service_qr_setup_lock" >Your service is protected. Please add a PIN or Fingerprint lock to see QR code.</string >
860
+ <string name =" tokens__copy_uri" >Copy URI</string >
858
861
</resources >
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: pl-PL, Polish (Poland)
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:31 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
860
860
<string name =" widget__no_selected_services" >Przytrzymaj i wybierz serwis, aby aktywować widget...</string >
861
861
<string name =" widget__reveal_tokens_long_message" >Odsłoń swoje tokeny 2FAS na 60 sekund</string >
862
862
<string name =" widget__reveal_tokens_short_message" >Odsłoń na 60 sekund</string >
863
- <string name =" settings__show_error_details" >Show error details</string >
863
+ <string name =" settings__show_error_details" >Pokaż szczegóły błędu</string >
864
+ <string name =" tokens__show_qr_code" >Kod QR serwisu</string >
865
+ <string name =" tokens__show_service_qr_setup_lock" >Twój serwis jest chroniony. Dodaj kod PIN lub odcisk palca, aby zobaczyć kod QR.</string >
866
+ <string name =" tokens__copy_uri" >Copy URI</string >
864
867
</resources >
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: pt-BR, Brazilian Portuguese
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:31 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
854
854
<string name =" widget__no_selected_services" >Mantenha pressionado e selecione o serviço para ativar o widget...</string >
855
855
<string name =" widget__reveal_tokens_long_message" >Revele seus tokens 2FAS por 60 segundos</string >
856
856
<string name =" widget__reveal_tokens_short_message" >Revele por 60 segundos</string >
857
- <string name =" settings__show_error_details" >Show error details</string >
857
+ <string name =" settings__show_error_details" >Mostrar detalhes do erro</string >
858
+ <string name =" tokens__show_qr_code" >Mostrar serviço do QR code</string >
859
+ <string name =" tokens__show_service_qr_setup_lock" >Seu serviço está protegido. Adicione um PIN ou bloqueio de impressão digital para ver o código QR.</string >
860
+ <string name =" tokens__copy_uri" >Copy URI</string >
858
861
</resources >
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: pt-PT, Portuguese (Portugal)
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:31 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
855
855
<string name =" widget__reveal_tokens_long_message" >Revele as suas fichas 2FAS durante 60 segundos</string >
856
856
<string name =" widget__reveal_tokens_short_message" >Revelar durante 60 segundos</string >
857
857
<string name =" settings__show_error_details" >Show error details</string >
858
+ <string name =" tokens__show_qr_code" >Service QR Code</string >
859
+ <string name =" tokens__show_service_qr_setup_lock" >Your service is protected. Please add a PIN or Fingerprint lock to see QR code.</string >
860
+ <string name =" tokens__copy_uri" >Copy URI</string >
858
861
</resources >
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: tr-TR, Turkish (Turkey)
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:31 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
855
855
<string name =" widget__reveal_tokens_long_message" >2FAS jetonları 60 saniye boyunca gösterin</string >
856
856
<string name =" widget__reveal_tokens_short_message" >60 saniye boyunca göster</string >
857
857
<string name =" settings__show_error_details" >Show error details</string >
858
+ <string name =" tokens__show_qr_code" >Service QR Code</string >
859
+ <string name =" tokens__show_service_qr_setup_lock" >Your service is protected. Please add a PIN or Fingerprint lock to see QR code.</string >
860
+ <string name =" tokens__copy_uri" >Copy URI</string >
858
861
</resources >
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: uk-UA, Ukrainian (Ukraine)
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:31 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
861
861
<string name =" widget__reveal_tokens_long_message" >Розкрийте свої токени 2FAS на 60 секунд</string >
862
862
<string name =" widget__reveal_tokens_short_message" >Розкрийте на 60 секунд</string >
863
863
<string name =" settings__show_error_details" >Show error details</string >
864
+ <string name =" tokens__show_qr_code" >Service QR Code</string >
865
+ <string name =" tokens__show_service_qr_setup_lock" >Your service is protected. Please add a PIN or Fingerprint lock to see QR code.</string >
866
+ <string name =" tokens__copy_uri" >Copy URI</string >
864
867
</resources >
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: zh-Hans, Simplified Chinese
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:31 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
849
849
<string name =" widget__reveal_tokens_long_message" >显示您的 2FAS 令牌 60 秒</string >
850
850
<string name =" widget__reveal_tokens_short_message" >显示 60 秒</string >
851
851
<string name =" settings__show_error_details" >Show error details</string >
852
+ <string name =" tokens__show_qr_code" >Service QR Code</string >
853
+ <string name =" tokens__show_service_qr_setup_lock" >Your service is protected. Please add a PIN or Fingerprint lock to see QR code.</string >
854
+ <string name =" tokens__copy_uri" >Copy URI</string >
852
855
</resources >
Original file line number Diff line number Diff line change 4
4
Project: 2FAS App
5
5
Locale: en, English
6
6
Exported by: rafakob
7
- Exported at: Tue, 14 Jan 2025 04:37:30 -0800
7
+ Exported at: Thu, 16 Jan 2025 04:52:12 -0800
8
8
-->
9
9
<resources xmlns : xliff =" urn:oasis:names:tc:xliff:document:1.2" >
10
10
<!-- InfoPlist.strings
855
855
<string name =" widget__reveal_tokens_long_message" >Reveal your 2FAS tokens for 60 seconds</string >
856
856
<string name =" widget__reveal_tokens_short_message" >Reveal for 60 seconds</string >
857
857
<string name =" settings__show_error_details" >Show error details</string >
858
+ <string name =" tokens__show_qr_code" >Service QR Code</string >
859
+ <string name =" tokens__show_service_qr_setup_lock" >Your service is protected. Please add a PIN or Fingerprint lock to see QR code.</string >
860
+ <string name =" tokens__copy_uri" >Copy URI</string >
858
861
</resources >
Original file line number Diff line number Diff line change @@ -30,4 +30,5 @@ dependencies {
30
30
implementation(libs.bundles.commonmark)
31
31
implementation(libs.timber)
32
32
implementation(libs.kotlinSerialization)
33
+ implementation(libs.zxing)
33
34
}
You can’t perform that action at this time.
0 commit comments