Skip to content

Commit b2b6dca

Browse files
ifaouibadiCedrikNikita
authored andcommitted
feat: mnemonic migrator cordova to ionic
1 parent 8c357dc commit b2b6dca

File tree

7 files changed

+148
-79
lines changed

7 files changed

+148
-79
lines changed

ios/App/App.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@
357357
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
358358
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
359359
CODE_SIGN_STYLE = Automatic;
360-
CURRENT_PROJECT_VERSION = 10;
360+
CURRENT_PROJECT_VERSION = 1;
361361
DEVELOPMENT_TEAM = 8H7FGC266S;
362362
INFOPLIST_FILE = App/Info.plist;
363363
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
@@ -382,7 +382,7 @@
382382
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
383383
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
384384
CODE_SIGN_STYLE = Automatic;
385-
CURRENT_PROJECT_VERSION = 10;
385+
CURRENT_PROJECT_VERSION = 1;
386386
DEVELOPMENT_TEAM = 8H7FGC266S;
387387
INFOPLIST_FILE = App/Info.plist;
388388
IPHONEOS_DEPLOYMENT_TARGET = 13.0;

ios/App/Podfile

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def capacitor_pods
1818
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
1919
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
2020
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
21+
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
2122
pod 'CapacitorNetwork', :path => '../../node_modules/@capacitor/network'
2223
pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share'
2324
pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen'

ios/App/Podfile.lock

+16-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ PODS:
1010
- CapacitorCommunityBarcodeScanner (4.0.1):
1111
- Capacitor
1212
- CapacitorCordova (5.0.4)
13+
- CapacitorFilesystem (5.1.4):
14+
- Capacitor
1315
- CapacitorHaptics (5.0.2):
1416
- Capacitor
1517
- CapacitorKeyboard (5.0.2):
1618
- Capacitor
19+
- CapacitorNetwork (5.0.6):
20+
- Capacitor
1721
- CapacitorShare (5.0.6):
1822
- Capacitor
1923
- CapacitorSplashScreen (5.0.6):
@@ -30,11 +34,14 @@ DEPENDENCIES:
3034
- "CapacitorClipboard (from `../../node_modules/@capacitor/clipboard`)"
3135
- "CapacitorCommunityBarcodeScanner (from `../../node_modules/@capacitor-community/barcode-scanner`)"
3236
- "CapacitorCordova (from `../../node_modules/@capacitor/ios`)"
37+
- "CapacitorFilesystem (from `../../node_modules/@capacitor/filesystem`)"
3338
- "CapacitorHaptics (from `../../node_modules/@capacitor/haptics`)"
3439
- "CapacitorKeyboard (from `../../node_modules/@capacitor/keyboard`)"
40+
- "CapacitorNetwork (from `../../node_modules/@capacitor/network`)"
3541
- "CapacitorShare (from `../../node_modules/@capacitor/share`)"
3642
- "CapacitorSplashScreen (from `../../node_modules/@capacitor/splash-screen`)"
3743
- "CapacitorStatusBar (from `../../node_modules/@capacitor/status-bar`)"
44+
- CordovaPlugins (from `../capacitor-cordova-ios-plugins`)
3845

3946
EXTERNAL SOURCES:
4047
Capacitor:
@@ -49,16 +56,22 @@ EXTERNAL SOURCES:
4956
:path: "../../node_modules/@capacitor-community/barcode-scanner"
5057
CapacitorCordova:
5158
:path: "../../node_modules/@capacitor/ios"
59+
CapacitorFilesystem:
60+
:path: "../../node_modules/@capacitor/filesystem"
5261
CapacitorHaptics:
5362
:path: "../../node_modules/@capacitor/haptics"
5463
CapacitorKeyboard:
5564
:path: "../../node_modules/@capacitor/keyboard"
65+
CapacitorNetwork:
66+
:path: "../../node_modules/@capacitor/network"
5667
CapacitorShare:
5768
:path: "../../node_modules/@capacitor/share"
5869
CapacitorSplashScreen:
5970
:path: "../../node_modules/@capacitor/splash-screen"
6071
CapacitorStatusBar:
6172
:path: "../../node_modules/@capacitor/status-bar"
73+
CordovaPlugins:
74+
:path: "../capacitor-cordova-ios-plugins"
6275

6376
SPEC CHECKSUMS:
6477
Capacitor: d3d4463573438b9fa65326d1f3549da6f4c21634
@@ -67,13 +80,15 @@ SPEC CHECKSUMS:
6780
CapacitorClipboard: 77edf49827ea21da2a9c05c690a4a6a4d07199c4
6881
CapacitorCommunityBarcodeScanner: 7feb206489c8555a8ca0c74c57ddf49ead774eb8
6982
CapacitorCordova: b1fe6bf1f36974a8e4a9044b342d22d49c0996d6
83+
CapacitorFilesystem: af704badfbc69f6f8623d9ed313e5490e3723dcb
7084
CapacitorHaptics: 864585542a435bd41eaabf7f30d9ff5ec03024d3
7185
CapacitorKeyboard: e628d4e66d621c69e449945ebabded17c5b9c2e8
86+
CapacitorNetwork: d80b3e79bef6ec37640ee2806c19771f07ff2d0c
7287
CapacitorShare: cd41743331cb71d217c029de54b681cbd91e0fcc
7388
CapacitorSplashScreen: 5fa2ab5e46cf5cc530cf16a51c80c7a986579ccd
7489
CapacitorStatusBar: 48f2899f6846cc7d8431b251ebfc58e1c10e3d58
7590
CordovaPlugins: dae7dac59b3cce58f5a7ce3894709d8f0f824656
7691

7792
PODFILE CHECKSUM: 3def7d0c4fed5e243238a546e365273910a500af
7893

79-
COCOAPODS: 1.12.1
94+
COCOAPODS: 1.14.3

package-lock.json

+28-74
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"@capacitor/haptics": "5.0.2",
4747
"@capacitor/ios": "5.0.4",
4848
"@capacitor/keyboard": "5.0.2",
49+
"@capacitor/filesystem": "^5.1.4",
4950
"@capacitor/network": "^5.0.6",
5051
"@capacitor/share": "^5.0.5",
5152
"@capacitor/splash-screen": "^5.0.6",

src/popup/pages/Index.vue

+20-2
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,15 @@
9090
</template>
9191

9292
<script lang="ts">
93-
import { defineComponent, ref } from 'vue';
93+
import { defineComponent, ref, onMounted } from 'vue';
9494
import { generateMnemonic } from '@aeternity/bip39';
9595
import { useRouter } from 'vue-router';
9696
import { useStore } from 'vuex';
9797
import { IonPage, IonContent } from '@ionic/vue';
9898
import {
9999
IN_FRAME,
100100
IS_MOBILE_DEVICE,
101+
IS_MOBILE_APP,
101102
IS_WEB,
102103
IS_IOS,
103104
MODAL_ACCOUNT_IMPORT,
@@ -106,6 +107,7 @@ import {
106107
useModals,
107108
useUi,
108109
} from '@/composables';
110+
import { getRestoreMnemonicFromCordova, cleanMnemonicFiles } from '@/utils/storeMigrator';
109111
110112
import CheckBox from '../components/CheckBox.vue';
111113
import BtnSubheader from '../components/buttons/BtnSubheader.vue';
@@ -127,7 +129,7 @@ export default defineComponent({
127129
const store = useStore();
128130
const router = useRouter();
129131
const { openModal } = useModals();
130-
const { loginTargetLocation } = useUi();
132+
const { loginTargetLocation, setLoaderVisible } = useUi();
131133
132134
const termsAgreed = ref(false);
133135
@@ -140,6 +142,22 @@ export default defineComponent({
140142
return openModal(MODAL_ACCOUNT_IMPORT);
141143
}
142144
145+
/**
146+
* TMP: for IOS Migration
147+
*/
148+
onMounted(async () => {
149+
if (IS_IOS && IS_MOBILE_APP) {
150+
setLoaderVisible(true);
151+
const mnemonic = await getRestoreMnemonicFromCordova();
152+
setLoaderVisible(false);
153+
if (mnemonic) {
154+
store.commit('setMnemonic', mnemonic);
155+
cleanMnemonicFiles();
156+
router.push(loginTargetLocation.value);
157+
}
158+
}
159+
});
160+
143161
return {
144162
PlusCircleIcon,
145163
CheckCircleIcon,

0 commit comments

Comments
 (0)