Skip to content

Commit

Permalink
split keys
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTrunk committed Feb 14, 2025
1 parent 24e8697 commit 4cbc7c3
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 23 deletions.
77 changes: 65 additions & 12 deletions src/components/AddressDetails/AddressDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,19 +376,72 @@ const AddressDetails = (props: { actionStatus: (status: boolean) => void }) => {
>
{t('home:wallet_priv_key_desc')}
</Text>
<Text
style={[
Fonts.textTinyTiny,
Fonts.textLight,
Gutters.tinyTMargin,
Fonts.textJustify,
Fonts.textError,
]}
>
{t('home:sensitive_data_warning', {
sensitive_data: t('home:wallet_private_key'),
})}
</Text>
<View>
<Text
selectable={true}
style={[
Fonts.textTiny,
Fonts.textCenter,
Gutters.smallMargin,
]}
>
{privateKeyVisible
? decryptedPrivateKey
: '*** *** *** *** *** ***'}
</Text>
{decryptedPrivateKey == t('home:chain_not_synced_scan') && (
<Text
selectable={true}
style={[
Fonts.textTiny,
Fonts.textCenter,
Gutters.tinyMargin,
Gutters.smallBMargin,
Gutters.smallTMargin,
]}
>
{privateKeyVisible
? decryptedPrivateKey
: '*** *** *** *** *** ***'}
</Text>
)}
{decryptedPrivateKey !== t('home:chain_not_synced_scan') && (
<>
<Text
selectable={true}
style={[
Fonts.textTiny,
Fonts.textCenter,
Gutters.tinyMargin,
Gutters.smallTMargin,
]}
>
{privateKeyVisible
? decryptedPrivateKey.slice(
0,
Math.floor(decryptedPrivateKey.length / 2),
)
: '*** *** *** *** *** ***'}
</Text>
<Text
selectable={true}
style={[
Fonts.textTiny,
Fonts.textCenter,
Gutters.tinyMargin,
Gutters.smallBMargin,
]}
>
{privateKeyVisible
? decryptedPrivateKey.slice(
Math.floor(decryptedPrivateKey.length / 2),
decryptedPrivateKey.length,
)
: '*** *** *** *** *** ***'}
</Text>
</>
)}
</View>
</View>
</View>
Expand Down
58 changes: 48 additions & 10 deletions src/components/SSPKeyDetails/SSKeyDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,19 +266,57 @@ const SSPKeyDetails = (props: { actionStatus: (status: boolean) => void }) => {
>
{t('home:chain_xpriv_desc', { chain: blockchainConfig.name })}
</Text>
<Text
style={[
Fonts.textTinyTiny,
Fonts.textLight,
Gutters.tinyTMargin,
Fonts.textJustify,
Fonts.textError,
]}
>
{t('home:sensitive_data_warning', {
sensitive_data: t('home:chain_xpriv', {
chain: blockchainConfig.name,
}),
})}
</Text>
<View>
{activityLoading && <ActivityIndicator size={'large'} />}
{!activityLoading && (
<Text
selectable={true}
style={[
Fonts.textTiny,
Fonts.textCenter,
Gutters.smallMargin,
]}
>
{xprivVisible ? deryptedXpriv : '*** *** *** *** *** ***'}
</Text>
<>
<Text
selectable={true}
style={[
Fonts.textTiny,
Fonts.textCenter,
Gutters.tinyMargin,
]}
>
{xprivVisible
? deryptedXpriv.slice(
0,
Math.floor(deryptedXpriv.length / 2),
)
: '*** *** *** *** *** ***'}
</Text>
<Text
selectable={true}
style={[
Fonts.textTiny,
Fonts.textCenter,
Gutters.tinyMargin,
Gutters.smallBMargin,
]}
>
{xprivVisible
? deryptedXpriv.slice(
Math.floor(deryptedXpriv.length / 2),
deryptedXpriv.length,
)
: '*** *** *** *** *** ***'}
</Text>
</>
)}
</View>
</View>
Expand Down
3 changes: 2 additions & 1 deletion src/translations/resources/en/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,6 @@
"change_language": "Change Language",
"language": "Language",
"use_system_language": "Use System Language",
"err_auth_biometrics_pw_needed": "Biometrics restricted, use password authentication instead."
"err_auth_biometrics_pw_needed": "Biometrics restricted, use password authentication instead.",
"sensitive_data_warning": "WARNING: For security reasons, the {{sensitive_data}} is displayed in 2 parts. Please join them together to get the full {{sensitive_data}}. It is highly discouraged to copy the {{sensitive_data}} into your clipboard, any application or website has access to clipboard and can see your {{sensitive_data}}."
}

0 comments on commit 4cbc7c3

Please sign in to comment.