From 595e7bc7f8422292c70dc2b75f06880c3d19f91e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=C2=A0Koby=C5=82ko?= Date: Mon, 4 Sep 2023 13:56:37 +0200 Subject: [PATCH] Add new guides --- feature/home/src/main/assets/discord.json | 67 +++++++++++++ feature/home/src/main/assets/epic_games.json | 99 +++++++++++++++++++ feature/home/src/main/assets/linkedin.json | 76 ++++++++++++++ .../home/src/main/assets/rockstar_games.json | 62 ++++++++++++ .../twofasapp/feature/home/ui/guides/Guide.kt | 12 +++ .../feature/home/ui/guides/GuidesScreen.kt | 60 ++++++----- 6 files changed, 351 insertions(+), 25 deletions(-) create mode 100644 feature/home/src/main/assets/discord.json create mode 100644 feature/home/src/main/assets/epic_games.json create mode 100644 feature/home/src/main/assets/linkedin.json create mode 100644 feature/home/src/main/assets/rockstar_games.json diff --git a/feature/home/src/main/assets/discord.json b/feature/home/src/main/assets/discord.json new file mode 100644 index 00000000..089d0e4d --- /dev/null +++ b/feature/home/src/main/assets/discord.json @@ -0,0 +1,67 @@ +{ + "serviceName": "Discord", + "serviceId": "5c9efdde-cb62-4304-9f04-d120084a53dd", + "flow": { + "header": "Follow our guide to pair your Discord account with 2FAS app.", + "menu": { + "title": "Please select the method you use to open Discord right now", + "items": [ + { + "name": "Through browser and desktop application", + "steps": [ + { + "image": "web_url", + "content": "Go to **www.discord.com** and log into your account." + }, + { + "image": "web_menu", + "content": "Click **'User Settings'** icon in the down left-hand menu." + }, + { + "image": "gears", + "content": "In **'My Account'** scroll down to option **TWO-FACTOR AUTHENTICATION** and tap **'Enable Two-Factor Auth'**." + }, + { + "image": "2fas_type", + "content": "You may be asked to enter your password for security reasons. Enter the password and click **'Continue'**." + }, + { + "image": "phone_qr", + "content": "Scan the QR code. Scanning the QR code will generate a token in the 2FAS app. Enter it and click **'Activate'**.\n\nRemember to get your backup codes from Discord!", + "cta": { + "name": "Scan QR code", + "action": "open_scanner" + } + } + ] + }, + { + "name": "Mobile app", + "steps": [ + { + "image": "account", + "content": "Open Discord, tap on your account icon in the down left corner to expand the side menu." + }, + { + "image": "gears", + "content": "Choose **'Account'**, then find and tap **'Enable Two-Factor Auth'**." + }, + { + "image": "2fas_type", + "content": "You may be asked to enter your password for security reasons. Enter your password and click **'Okay'**." + }, + { + "image": "phone_qr", + "content": "Copy or rewrite the **2FA Code** (it is your **Secret Key**) and use **'Add manually'** feature below to add LinkedIn to your 2FAS app. When ready, proceed to the next step and click **'Next'**. Enter the token generated by 2FAS applications.", + "cta": { + "name": "Add manually", + "action": "open_manually", + "data": "Discord" + } + } + ] + } + ] + } + } + } \ No newline at end of file diff --git a/feature/home/src/main/assets/epic_games.json b/feature/home/src/main/assets/epic_games.json new file mode 100644 index 00000000..e592c473 --- /dev/null +++ b/feature/home/src/main/assets/epic_games.json @@ -0,0 +1,99 @@ +{ + "serviceName": "Epic Games", + "serviceId": "21701630-a5d2-457c-a983-bfbf4efa801c", + "flow": { + "header": "Follow our guide to pair your Epic Games account with 2FAS app.", + "menu": { + "title": "Epic Games does not have a mobile application. Please select the method you use to open Epic Games right now", + "items": [ + { + "name": "Through brower", + "steps": [ + { + "image": "web_url", + "content": "Go to **www.epicgames.com** and log into your account." + }, + { + "image": "web_account_1", + "content": "Hover over your avatar icon to expand the list of options. Click **'ACCOUNT'**." + }, + { + "image": "web_menu", + "content": "Choose **'PASSWORD & SECURITY'** from left-hand menu." + }, + { + "image": "2fas_type", + "content": "Scroll down and find **Two-Factor Authentication** options. Then choose **Two-factor Authenticator App** and tab **'SET UP'**. Click **'CONTINUE'**." + }, + { + "image": "phone_qr", + "content": "Scan the QR code. Scanning the QR code will generate a token in the 2FAS app. Enter it and click **'Activate'**.\n\nRemember to get your backup codes from Epic Games!", + "cta": { + "name": "Scan QR code", + "action": "open_scanner" + } + } + ] + }, + { + "name": "Desktop app", + "steps": [ + { + "image": "account", + "content": "Open Epic Games, hover over your avatar icon to expand the list of options." + }, + { + "image": "web_account_1", + "content": "Choose **'Account'**. You will be taken to the **'ACCOUNT'** tab on the Epic Games website. Then find and tap **'Enable Two-Factor Auth'**." + }, + { + "image": "web_menu", + "content": "Choose **'PASSWORD & SECURITY'** from left-hand menu." + }, + { + "image": "gears", + "content": "Scroll down and find **Two-Factor Authentication** options. Then choose **Two-factor Authenticator App** and tab **'SET UP'**. Click **'CONTINUE'**." + }, + { + "image": "phone_qr", + "content": "Scan the QR code. Scanning the QR code will generate a token in the 2FAS app. Enter it and click **'Activate'**.\n\nRemember to get your backup codes from Epic Games!", + "cta": { + "name": "Scan QR code", + "action": "open_scanner" + } + } + ] + }, + { + "name": "Console (PlayStation, Xbox)", + "steps": [ + { + "image": "web_url", + "content": "In the console, turn on your web browser and go to **www.epicgames.com** and log in to your account." + }, + { + "image": "web_account_1", + "content": "Hover over your avatar icon to expand the list of options. Click **'ACCOUNT'**." + }, + { + "image": "web_menu", + "content": "Choose **'PASSWORD & SECURITY'** from left-hand menu." + }, + { + "image": "gears", + "content": "Scroll down and find **Two-Factor Authentication** options. Then choose **Two-factor Authenticator App** and tab **'SET UP'**. Click **'CONTINUE'**." + }, + { + "image": "phone_qr", + "content": "Scan the QR code. Scanning the QR code will generate a token in the 2FAS app. Enter it and click **'Activate'**.\n\nRemember to get your backup codes from Epic Games!", + "cta": { + "name": "Scan QR code", + "action": "open_scanner" + } + } + ] + } + ] + } + } +} diff --git a/feature/home/src/main/assets/linkedin.json b/feature/home/src/main/assets/linkedin.json new file mode 100644 index 00000000..333b7d54 --- /dev/null +++ b/feature/home/src/main/assets/linkedin.json @@ -0,0 +1,76 @@ +{ + "serviceName": "LinkedIn", + "serviceId": "924f8361-2435-41fe-8070-b2f6b105b042", + "flow": { + "header": "Follow our guide to pair your LinkedIn account with the 2FAS app.", + "menu": { + "title": "Please select the method you use to open LinkedIn right now", + "items": [ + { + "name": "Desktop computer or laptop", + "steps": [ + { + "image": "web_url", + "content": "Go to **www.linkedin.com** and log into your account." + }, + { + "image": "web_account_1", + "content": "Click your avatar in the top bar and select **'Settings & Privacy'**. From the left-hand menu, select **'Sign in & security'**." + }, + { + "image": "web_menu", + "content": "Then select the **'Two-step verification'** section on the right. Click **'Set up'**." + }, + { + "image": "web_phone", + "content": "You may be asked to verify your account by entering a 6-digit code sent to your email." + }, + { + "image": "2fas_type", + "content": "Select the **'Authenticator App'** and click **'Continue'**.\nYou may be asked to enter a password for security reasons. Enter your password and click **'Continue'**." + }, + { + "image": "retype", + "content": "Use **'Add manually'** feature below to add LinkedIn to your 2FAS app and rewrite secret key from LinkedIn. Tap **'Continue'** on LinkedIn, retype generated token, tap **'Verify'**.", + "cta": { + "name": "Add manually", + "action": "open_manually", + "data": "LinkedIn" + } + } + ] + }, + { + "name": "Mobile (app and website)", + "steps": [ + { + "image": "account", + "content": "Open **LinkedIn**, then tap the avatar on the top left corner. Next click **'Settings'**." + }, + { + "image": "gears", + "content": "Click **'Sign in & security'**. Then select the **'Two-step verification'**. Click **'Set up'**." + }, + { + "image": "web_phone", + "content": "You may be asked to verify your account by entering a 6-digit code sent to your email." + }, + { + "image": "2fas_type", + "content": "Choose the **'Authentication app'** and click **'Continue'**.\nYou may be asked to enter a password for security reasons. Enter your password and click **'Continue'**." + }, + { + "image": "retype", + "content": "Copy secret key and use **'Add manually'** feature below to add LinkedIn to your 2FAS app. Tap **'Continue'** on LinkedIn, retype generated token, tap **'Verify'**.", + "cta": { + "name": "Add manually", + "action": "open_manually", + "data": "LinkedIn" + } + } + ] + } + ] + } + } +} diff --git a/feature/home/src/main/assets/rockstar_games.json b/feature/home/src/main/assets/rockstar_games.json new file mode 100644 index 00000000..1b39d69a --- /dev/null +++ b/feature/home/src/main/assets/rockstar_games.json @@ -0,0 +1,62 @@ +{ + "serviceName": "RockStar Games", + "serviceId": "deead8dd-c9e3-463a-8c73-1e75c5ec13cf", + "flow": { + "header": "Follow our guide to pair your RockStar Games account with 2FAS app.", + "menu": { + "title": "RockStar Games does not have a mobile application. Please select the method you use to open RockStar Games right now", + "items": [ + { + "name": "Through browser", + "steps": [ + { + "image": "web_url", + "content": "Go to **www.socialclub.rockstargames.com** and log into your account." + }, + { + "image": "web_account_1", + "content": "Click account icon in the top right corner to expand the list of options. Then click **'SETTINGS'**." + }, + { + "image": "gears", + "content": "Choose **'2-STEP VERIFICATION'** and tap **'Setup'**." + }, + { + "image": "phone_qr", + "content": "Scan the QR code. Scanning the QR code will generate a token in the 2FAS app. Enter it and password. Then click **'Verify'**.", + "cta": { + "name": "Scan QR code", + "action": "open_scanner" + } + } + ] + }, + { + "name": "Desktop app", + "steps": [ + { + "image": "account", + "content": "Open RockStar Games and log into your account." + }, + { + "image": "web_account_1", + "content": "Click account icon in the top right corner to expand the list of options. Then click **'MANAGE ACCOUNT'**. You will be taken to the **'SETTINGS'** tab on the RockStar Social Club website." + }, + { + "image": "gears", + "content": "Choose **2-STEP VERIFICATION** and tap **'Setup'**." + }, + { + "image": "phone_qr", + "content": "Scan the QR code. Scanning the QR code will generate a token in the 2FAS app. Enter it and password. Then click **'Verify'**.", + "cta": { + "name": "Scan QR code", + "action": "open_scanner" + } + } + ] + } + ] + } + } + } diff --git a/feature/home/src/main/java/com/twofasapp/feature/home/ui/guides/Guide.kt b/feature/home/src/main/java/com/twofasapp/feature/home/ui/guides/Guide.kt index e897d242..b95eb155 100644 --- a/feature/home/src/main/java/com/twofasapp/feature/home/ui/guides/Guide.kt +++ b/feature/home/src/main/java/com/twofasapp/feature/home/ui/guides/Guide.kt @@ -10,6 +10,10 @@ enum class Guide { Facebook, Twitter, Amazon, + LinkedIn, + EpicGames, + RockstarGames, + Discord, Universal, ; } @@ -20,6 +24,10 @@ val Guide.json: String Guide.Twitter -> "twitter.json" Guide.Amazon -> "amazon.json" Guide.Universal -> "universal.json" + Guide.LinkedIn -> "linkedin.json" + Guide.EpicGames -> "epic_games.json" + Guide.RockstarGames -> "rockstar_games.json" + Guide.Discord -> "discord.json" } private val Guide.serviceId: String @@ -28,6 +36,10 @@ private val Guide.serviceId: String Guide.Twitter -> "a2987ab4-ac5c-48ce-863c-d3d3d1220fdb" Guide.Amazon -> "d50d085c-87a1-4c03-80aa-d2384971c6f3" Guide.Universal -> "89efcc2d-52f4-4ac3-988d-5d7f3b3cd0a7" + Guide.LinkedIn -> "924f8361-2435-41fe-8070-b2f6b105b042" + Guide.EpicGames -> "21701630-a5d2-457c-a983-bfbf4efa801c" + Guide.RockstarGames -> "deead8dd-c9e3-463a-8c73-1e75c5ec13cf" + Guide.Discord -> "5c9efdde-cb62-4304-9f04-d120084a53dd" } @Composable diff --git a/feature/home/src/main/java/com/twofasapp/feature/home/ui/guides/GuidesScreen.kt b/feature/home/src/main/java/com/twofasapp/feature/home/ui/guides/GuidesScreen.kt index 3129d0c1..c03d961c 100644 --- a/feature/home/src/main/java/com/twofasapp/feature/home/ui/guides/GuidesScreen.kt +++ b/feature/home/src/main/java/com/twofasapp/feature/home/ui/guides/GuidesScreen.kt @@ -15,7 +15,9 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width +import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.Icon import androidx.compose.material3.Scaffold @@ -69,38 +71,42 @@ private fun GuidesScreenContent( ) { padding -> Column( - Modifier - .fillMaxSize() - .padding(padding) + Modifier.fillMaxSize() ) { - Text( - text = TwLocale.strings.guidesSelectDescription, - style = TwTheme.typo.body1, - modifier = Modifier.padding(16.dp), - color = TwTheme.color.onSurfacePrimary, - ) + Column( + Modifier + .fillMaxWidth() + .weight(1f) + .padding(padding) + .verticalScroll(rememberScrollState()) + ) { + Text( + text = TwLocale.strings.guidesSelectDescription, + style = TwTheme.typo.body1, + modifier = Modifier.padding(16.dp), + color = TwTheme.color.onSurfacePrimary, + ) - guides.chunked(2).forEach { chunk -> - Row( - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 16.dp, vertical = 8.dp), - horizontalArrangement = Arrangement.spacedBy(16.dp) - ) { - if (chunk.firstOrNull() != null) { - GuideItem(guide = chunk.first(), modifier = Modifier.weight(1f), onClick = onGuideClick) - } + guides.chunked(2).forEach { chunk -> + Row( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 16.dp, vertical = 8.dp), + horizontalArrangement = Arrangement.spacedBy(16.dp) + ) { + if (chunk.firstOrNull() != null) { + GuideItem(guide = chunk.first(), modifier = Modifier.weight(1f), onClick = onGuideClick) + } - if (chunk.getOrNull(1) != null) { - GuideItem(guide = chunk[1], modifier = Modifier.weight(1f), onClick = onGuideClick) - } else { - Spacer(modifier = Modifier.weight(1f)) + if (chunk.getOrNull(1) != null) { + GuideItem(guide = chunk[1], modifier = Modifier.weight(1f), onClick = onGuideClick) + } else { + Spacer(modifier = Modifier.weight(1f)) + } } } } - Spacer(modifier = Modifier.weight(1f)) - Column( modifier = Modifier .fillMaxWidth() @@ -177,6 +183,10 @@ private fun GuideItem( Guide.Twitter -> "Twitter" Guide.Amazon -> "Amazon" Guide.Universal -> "Universal Guide" + Guide.LinkedIn -> "LinkedIn" + Guide.EpicGames -> "Epic Games" + Guide.RockstarGames -> "Rockstar Games" + Guide.Discord -> "Discord" }, style = TwTheme.typo.body3, color = TwTheme.color.onSurfacePrimary,