diff --git a/frontends/web/src/api/bitbox01.ts b/frontends/web/src/api/bitbox01.ts index 77d359dd52..df4f747fc3 100644 --- a/frontends/web/src/api/bitbox01.ts +++ b/frontends/web/src/api/bitbox01.ts @@ -21,7 +21,6 @@ export type DeviceInfo = { id: string; lock: boolean; name: string; - new_hidden_wallet: boolean; seeded: boolean; serial: string; sdcard: boolean; diff --git a/frontends/web/src/hooks/sdcard.test.ts b/frontends/web/src/hooks/sdcard.test.ts index 5df567037a..1c3332758c 100644 --- a/frontends/web/src/hooks/sdcard.test.ts +++ b/frontends/web/src/hooks/sdcard.test.ts @@ -55,7 +55,6 @@ describe('useSDCard', () => { id: '0001', lock: false, name: 'some name', - new_hidden_wallet: false, seeded: false, serial: 'anystring', sdcard: true, diff --git a/frontends/web/src/locales/en/app.json b/frontends/web/src/locales/en/app.json index 2d73a73a6d..b92efe268f 100644 --- a/frontends/web/src/locales/en/app.json +++ b/frontends/web/src/locales/en/app.json @@ -177,8 +177,7 @@ "error": { "e10000": "Current device password incorrect.", "e10001": "Failed to replace device password", - "e102": "The password must consist of at least 4 characters.", - "e112": "Hidden device password cannot be the same as the main device password." + "e102": "The password must consist of at least 4 characters." } }, "bitbox02Interact": { @@ -385,7 +384,6 @@ "dismiss": "Dismiss", "done": "Done", "download": "Download", - "hiddenwallet": "Create hidden wallet", "next": "Next", "ok": "OK", "previous": "Previous", @@ -1000,14 +998,6 @@ "ejectSD": { "text": "You can remove the microSD card from the BitBox at any time as long as you are not in the process of creating or restoring a backup.", "title": "How can I eject the microSD card?" - }, - "hiddenWallet": { - "text": "It is a second wallet on the same device protected by a different device password and recovery password, which you can use for plausible deniability. The same backup seed is used for both your normal and hidden wallet, so no additional backup is required.", - "title": "What is a hidden wallet?" - }, - "legacyHiddenWallet": { - "text": "First click the button below (available if the BitBox is unlocked with the main device password and 2FA is disabled), then replug your Bitbox and unlock it with your hidden device password.", - "title": "How do I access the legacy hidden wallet?" } }, "bitsurance": { @@ -1252,16 +1242,6 @@ "headerssync": { "blocksSynced": "{{blocks}} blocks synced" }, - "hiddenWallet": { - "info1HTML": "For plausible deniability purposes, a hidden wallet can be created based on a different device password + recovery password combination.", - "info2HTML": "Define the device password and recovery password you want to associate with your hidden wallet below. The device password and recovery password must be different from the ones you defined for your primary wallet.", - "passwordLabel": "Hidden recovery password", - "passwordPlaceholder": "Please confirm hidden recovery password", - "pinLabel": "Hidden device password", - "pinRepeatLabel": "Repeat hidden device password", - "pinRepeatPlaceholder": "Please confirm hidden device password", - "success": "Hidden wallet created successfully. Replug your BitBox to unlock it." - }, "initialize": { "create": "Set device password", "creating": "Setting device password…", @@ -1285,12 +1265,6 @@ "language": { "title": "Select language" }, - "legacyhiddenwallet": { - "disable": "Disable legacy hidden wallet", - "enable": "Enable legacy hidden wallet", - "successDisable": "Successfully disabled the legacy hidden wallet.", - "successEnable": "Successfully enabled the legacy hidden wallet. Replug your BitBox and enter the hidden device password to access the legacy hidden wallet." - }, "loading": "loading…", "manageAccounts": { "accountHidden": "This account has been hidden from your watch-only accounts. To see it again, please plug in your BitBox.", diff --git a/frontends/web/src/routes/device/bitbox01/settings/components/hiddenwallet.jsx b/frontends/web/src/routes/device/bitbox01/settings/components/hiddenwallet.jsx deleted file mode 100644 index 62df05d05b..0000000000 --- a/frontends/web/src/routes/device/bitbox01/settings/components/hiddenwallet.jsx +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Copyright 2018 Shift Devices AG - * Copyright 2021 Shift Crypto AG - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Component } from 'react'; -import { withTranslation } from 'react-i18next'; -import { Button } from '../../../../../components/forms'; -import { alertUser } from '../../../../../components/alert/Alert'; -import { DialogLegacy, DialogButtons } from '../../../../../components/dialog/dialog-legacy'; -import { WaitDialog } from '../../../../../components/wait-dialog/wait-dialog'; -import { PasswordRepeatInput } from '../../../../../components/password'; -import { apiPost } from '../../../../../utils/request'; -import { SimpleMarkup } from '../../../../../utils/markup'; -import { SettingsButton } from '../../../../../components/settingsButton/settingsButton'; - -class HiddenWallet extends Component { - state = { - password: null, - pin: null, - isConfirming: false, - activeDialog: false, - }; - - abort = () => { - this.setState({ - password: null, - isConfirming: false, - activeDialog: false, - }); - }; - - handleFormChange = event => { - this.setState({ [event.target.id]: event.target.value }); - }; - - validate = () => { - return this.state.password && this.state.pin; - }; - - createHiddenWallet = event => { - event.preventDefault(); - if (!this.validate()) { - return; - } - this.setState({ - activeDialog: false, - isConfirming: true, - }); - apiPost('devices/' + this.props.deviceID + '/set-hidden-password', { - pin: this.state.pin, - backupPassword: this.state.password, - }).catch(() => {}).then(({ success, didCreate, errorMessage, code }) => { - this.abort(); - if (success) { - if (didCreate) { - alertUser(this.props.t('hiddenWallet.success')); - } - } else { - alertUser(this.props.t(`bitbox.error.e${code}`, { - defaultValue: errorMessage - })); - } - }); - }; - - setValidPassword = password => { - this.setState({ password }); - }; - - setValidPIN = pin => { - this.setState({ pin }); - }; - - render() { - const { - t, - disabled, - } = this.props; - const { - isConfirming, - activeDialog, - } = this.state; - return ( -
- this.setState({ activeDialog: true })}> - {t('button.hiddenwallet')} - - { - activeDialog && ( - - - -
- - - - - - - -
- ) - } - { - isConfirming && ( - - ) - } -
- ); - } -} - -export default withTranslation()(HiddenWallet); diff --git a/frontends/web/src/routes/device/bitbox01/settings/components/legacyhiddenwallet.jsx b/frontends/web/src/routes/device/bitbox01/settings/components/legacyhiddenwallet.jsx deleted file mode 100644 index 5ef9686c91..0000000000 --- a/frontends/web/src/routes/device/bitbox01/settings/components/legacyhiddenwallet.jsx +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright 2018 Shift Devices AG - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Component } from 'react'; -import { withTranslation } from 'react-i18next'; -import { Button } from '../../../../../components/forms'; -import { alertUser } from '../../../../../components/alert/Alert'; -import { apiPost } from '../../../../../utils/request'; - -class LegacyHiddenWallet extends Component { - toggle = () => { - const newValue = !this.props.newHiddenWallet; - apiPost('devices/' + this.props.deviceID + '/feature-set', { - new_hidden_wallet: newValue, - }).then(() => { - if (newValue) { - alertUser(this.props.t('legacyhiddenwallet.successDisable')); - } else { - alertUser(this.props.t('legacyhiddenwallet.successEnable')); - } - if (this.props.onChange) { - this.props.onChange(newValue); - } - }); - }; - - render() { - const { - t, - disabled, - newHiddenWallet, - } = this.props; - return ( - - ); - } -} - -export default withTranslation()(LegacyHiddenWallet); diff --git a/frontends/web/src/routes/device/bitbox01/settings/settings.tsx b/frontends/web/src/routes/device/bitbox01/settings/settings.tsx index 3d66d73899..fe87757175 100644 --- a/frontends/web/src/routes/device/bitbox01/settings/settings.tsx +++ b/frontends/web/src/routes/device/bitbox01/settings/settings.tsx @@ -25,9 +25,7 @@ import { Entry } from '../../../../components/guide/entry'; import { Header } from '../../../../components/layout'; import { Spinner } from '../../../../components/spinner/Spinner'; import Blink from './components/blink'; -import LegacyHiddenWallet from './components/legacyhiddenwallet'; import RandomNumber from './components/randomnumber'; -import HiddenWallet from './components/hiddenwallet'; import ChangePIN from './components/changepin'; import Reset from './components/reset'; import UpgradeFirmware from '../components/upgradefirmware'; @@ -43,30 +41,24 @@ export const Settings = ({ deviceID }: Props) => { const [firmwareVersion, setFirmwareVersion] = useState(null); const [newVersion, setNewVersion] = useState(null); - const [lock, setLock] = useState(true); const [name, setName] = useState(null); const [spinner, setSpinner] = useState(true); const [sdcard, setSdcard] = useState(false); const [serial, setSerial] = useState(''); - const [newHiddenWallet, setNewHiddenWallet] = useState(true); useEffect(() => { const init = async () => { const deviceInfo = await getDeviceInfo(deviceID); if (deviceInfo) { const { - lock, name, - new_hidden_wallet, sdcard, serial, version, } = deviceInfo; setFirmwareVersion(version.replace('v', '')); - setLock(lock); setName(name); - setNewHiddenWallet(new_hidden_wallet); setSdcard(sdcard); setSerial(serial); setSpinner(false); @@ -97,16 +89,6 @@ export const Settings = ({ deviceID }: Props) => { {t('deviceSettings.secrets.manageBackups')} - {newHiddenWallet ? ( - - ) : ( - - )} @@ -140,18 +122,6 @@ export const Settings = ({ deviceID }: Props) => { - - {!lock && newHiddenWallet && ( - -

- -

-
- )}
);