diff --git a/img/bluewalletsplash.json b/img/bluewalletsplash.json new file mode 100644 index 00000000..a4b85e2f --- /dev/null +++ b/img/bluewalletsplash.json @@ -0,0 +1 @@ +{"ip":0,"fr":60,"v":"5.1.20","assets":[],"layers":[{"ty":4,"nm":"blue","ip":0,"st":0,"ind":5,"hix":1,"ks":{"o":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":88,"s":[0],"e":[100],"i":{"x":[0.515],"y":[0.955]},"o":{"x":[0.455],"y":[0.03]}},{"t":132}]},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[21.5,8.5,0]},"p":{"s":true,"x":{"a":0,"k":294},"y":{"a":0,"k":231}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":0,"k":0},"s":{"a":0,"k":[100,100]}},"shapes":[{"ty":"gr","nm":"blue shape group","it":[{"ty":"sh","ks":{"a":0,"k":{"c":true,"v":[[71.1621094,96.1743164],[67.6757812,94.2260742],[67.4912109,94.2260742],[67.4912109,96],[64.5996094,96],[64.5996094,80.3730469],[67.5834961,80.3730469],[67.5834961,86.4946289],[67.7680664,86.4946289],[71.1621094,84.5053711],[75.7456055,90.3398438]],"i":[[2.8403319999999894,0],[0.6049804999999964,1.230468799999997],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[-1.548339900000002,0],[0,-3.6503907000000027]],"o":[[-1.5996094000000056,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0.5742188000000112,-1.240722699999992],[2.8608397999999937,0],[0,3.6298828000000043]]}}},{"ty":"sh","ks":{"a":0,"k":{"c":true,"v":[[70.1264648,87.0073242],[67.5527344,90.3500977],[70.1264648,93.6826172],[72.6796875,90.3398438]],"i":[[1.5791016000000013,0],[0.010253899999995042,-2.0610352000000063],[-1.579101499999993,0],[0,2.0712890000000073]],"o":[[-1.568847599999998,0],[0.010253899999995042,2.0507811999999888],[1.5893555000000106,0],[0,-2.061035199999992]]}}},{"ty":"sh","ks":{"a":0,"k":{"c":true,"v":[[77.7401952,96],[77.7401952,80.3730469],[80.7240819,80.3730469],[80.7240819,96]],"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]]}}},{"ty":"sh","ks":{"a":0,"k":{"c":true,"v":[[93.5160349,84.6899414],[93.5160349,96],[90.6244333,96],[90.6244333,94.1850586],[90.439863,94.1850586],[87.1381052,96.2460938],[83.1800974,92.0625],[83.1800974,84.6899414],[86.1639841,84.6899414],[86.1639841,91.293457],[88.245527,93.6518555],[90.5321481,91.2114258],[90.5321481,84.6899414]],"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[1.712402300000008,0],[0,2.625],[0,0],[0,0],[0,0],[-1.3740233999999987,0],[0,1.5073241999999993],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[-0.5332031000000086,1.3125],[-2.4404296999999957,0],[0,0],[0,0],[0,0],[0,1.558593799999997],[1.4868165000000033,0],[0,0],[0,0]]}}},{"ty":"sh","ks":{"a":0,"k":{"c":true,"v":[[100.863164,86.7304688],[98.4022261,89.1606445],[103.221562,89.1606445]],"i":[[1.3945310000000006,0],[0.10253910000000133,-1.466308600000005],[0,0]],"o":[[-1.3842776999999984,0],[0,0],[-0.06152300000000821,-1.4970703000000043]]}}},{"ty":"sh","ks":{"a":0,"k":{"c":true,"v":[[103.283085,92.7802734],[106.061894,92.7802734],[100.893925,96.2460938],[95.4183394,90.4013672],[100.85291,84.4438477],[106.154179,90.1552734],[106.154179,91.0678711],[98.3919722,91.0678711],[98.3919722,91.2216797],[100.975957,93.9492188]],"i":[[-0.3178709999999967,0.7485352000000063],[0,0],[2.7685550000000063,0],[0,3.6708983999999987],[-3.3632814999999994,0],[0,-3.5888671999999957],[0,0],[0,0],[0,0],[-1.5585941999999875,0]],"o":[[0,0],[-0.4511719999999997,2.1328125],[-3.4453121999999894,0],[0,-3.681152400000002],[3.332519000000005,0],[0,0],[0,0],[0,0],[0.04101560000000859,1.6816406000000086],[1.1791990000000112,0]]}}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1,"ml":1},{"ty":"fl","o":{"a":0,"k":100},"r":1,"c":{"a":0,"k":[1,1,1,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-64,-80]},"r":{"a":0,"k":0}}]}],"op":132},{"ty":4,"nm":"wallet","ip":0,"st":0,"ind":4,"hix":2,"ks":{"o":{"a":0,"k":0},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[29.5,8.5,0]},"p":{"s":true,"x":{"a":0,"k":291},"y":{"a":0,"k":235.5}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":0,"k":0},"s":{"a":0,"k":[100,100,100]}},"shapes":[],"op":132},{"ty":4,"nm":"small","ip":0,"st":0,"ind":3,"hix":3,"ks":{"o":{"a":1,"k":[{"t":0,"s":[0],"e":[100],"i":{"x":[0.675],"y":[0.19]},"o":{"x":[0.55],"y":[0.055]}},{"t":40}]},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[60,32,0]},"p":{"s":true,"x":{"a":0,"k":275},"y":{"a":1,"k":[{"t":0,"s":[267.5],"e":[228],"i":{"x":[0.265],"y":[1.5]},"o":{"x":[0.68],"y":[-0.55]}},{"t":40}]}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":0,"k":0},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","nm":"small shape group","it":[{"ty":"sh","ks":{"a":0,"k":{"c":true,"v":[[30.3055543,56.484375],[89.6944457,56.484375],[106.331298,60.053101],[116.431274,70.1530769],[120,86.7899293],[120,89.6944457],[116.431274,106.331298],[106.331298,116.431274],[89.6944457,120],[30.3055543,120],[13.6687019,116.431274],[3.56872596,106.331298],[-4.39256841e-16,89.6944457],[4.39256841e-16,86.7899293],[3.56872596,70.1530769],[13.6687019,60.053101]],"i":[[-7.174513700000002,0],[0,0],[-4.354167000000004,-2.3286339],[-2.328634000000008,-4.354166599999999],[0,-7.1745136999999914],[0,0],[2.328633999999994,-4.354167000000004],[4.35416699999999,-2.328634000000008],[7.1745136999999914,0],[0,0],[4.354166699999999,2.328633999999994],[2.3286338200000003,4.35416699999999],[8.78624526e-16,7.1745136999999914],[0,0],[-2.3286338100000004,4.354166699999993],[-4.354166640000001,2.3286337999999986]],"o":[[0,0],[7.1745136999999914,0],[4.35416699999999,2.3286337999999986],[2.328633999999994,4.354166699999993],[0,0],[0,7.1745136999999914],[-2.328634000000008,4.35416699999999],[-4.354167000000004,2.328633999999994],[0,0],[-7.174513700000002,0],[-4.354166640000001,-2.328634000000008],[-2.3286338100000004,-4.354167000000004],[0,0],[-8.78624526e-16,-7.1745136999999914],[2.3286338200000003,-4.354166599999999],[4.354166699999999,-2.3286339]]}}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1,"ml":1},{"ty":"gf","o":{"a":0,"k":100},"r":2,"g":{"p":2,"k":{"a":0,"k":[0,0.5450980392156862,0.8431372549019608,0.9764705882352941,1,0.40784313725490196,0.7333333333333333,0.8823529411764706]}},"t":1,"s":{"a":0,"k":[60,3.2704118520000005]},"e":{"a":0,"k":[60,120]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[0,-56]},"r":{"a":0,"k":0}}]}],"op":132},{"ty":4,"nm":"medium","ip":0,"st":0,"ind":2,"hix":4,"ks":{"o":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":27,"s":[0],"e":[100],"i":{"x":[0.675],"y":[0.19]},"o":{"x":[0.55],"y":[0.055]}},{"t":64}]},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[60,47,0]},"p":{"s":true,"x":{"a":0,"k":275},"y":{"a":1,"k":[{"t":0,"s":[274],"e":[274],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":27,"s":[274],"e":[213],"i":{"x":[0.265],"y":[1.5]},"o":{"x":[0.68],"y":[-0.55]}},{"t":64}]}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":0,"k":0},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","nm":"medium shape group","it":[{"ty":"sh","ks":{"a":0,"k":{"c":true,"v":[[34.2519038,26.484375],[85.7480962,26.484375],[106.331298,30.053101],[116.431274,40.1530769],[120,60.7362788],[120,85.7480962],[116.431274,106.331298],[106.331298,116.431274],[85.7480962,120],[34.2519038,120],[13.6687019,116.431274],[3.56872596,106.331298],[-9.22545274e-16,85.7480962],[9.22545274e-16,60.7362788],[3.56872596,40.1530769],[13.6687019,30.053101]],"i":[[-11.9101331,0],[0,0],[-4.354167000000004,-2.3286339000000034],[-2.328634000000008,-4.354166599999999],[0,-11.910133100000003],[0,0],[2.328633999999994,-4.354167000000004],[4.35416699999999,-2.328634000000008],[11.910133099999996,0],[0,0],[4.354166699999999,2.328633999999994],[2.3286338200000003,4.35416699999999],[1.458570646e-15,11.910133099999996],[0,0],[-2.3286338100000004,4.3541667],[-4.354166640000001,2.328633799999995]],"o":[[0,0],[11.910133099999996,0],[4.35416699999999,2.328633799999995],[2.328633999999994,4.3541667],[0,0],[0,11.910133099999996],[-2.328634000000008,4.35416699999999],[-4.354167000000004,2.328633999999994],[0,0],[-11.9101331,0],[-4.354166640000001,-2.328634000000008],[-2.3286338100000004,-4.354167000000004],[0,0],[-1.458570646e-15,-11.910133100000003],[2.3286338200000003,-4.354166599999999],[4.354166699999999,-2.3286339000000034]]}}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1,"ml":1},{"ty":"gf","o":{"a":0,"k":100},"r":2,"g":{"p":2,"k":{"a":0,"k":[0,0.24705882352941178,0.47058823529411764,0.8627450980392157,1,0.1843137254901961,0.37254901960784315,0.7019607843137254]}},"t":1,"s":{"a":0,"k":[60,0]},"e":{"a":0,"k":[60,117.46116324]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[0,-26]},"r":{"a":0,"k":0}}]}],"op":132},{"ty":4,"nm":"big","ip":0,"st":0,"ind":1,"hix":5,"ks":{"o":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":49,"s":[0],"e":[100],"i":{"x":[0.675],"y":[0.19]},"o":{"x":[0.55],"y":[0.055]}},{"t":88}]},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[60,60,0]},"p":{"s":true,"x":{"a":0,"k":275},"y":{"a":1,"k":[{"t":0,"s":[287],"e":[287],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":49,"s":[287],"e":[200],"i":{"x":[0.265],"y":[1.5]},"o":{"x":[0.68],"y":[-0.55]}},{"t":88}]}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":0,"k":0},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","nm":"big shape group","it":[{"ty":"sh","ks":{"a":0,"k":{"c":true,"v":[[34.2519038,-1.38381791e-15],[85.7480962,1.38381791e-15],[106.331298,3.56872596],[116.431274,13.6687019],[120,34.2519038],[120,85.7480962],[116.431274,106.331298],[106.331298,116.431274],[85.7480962,120],[34.2519038,120],[13.6687019,116.431274],[3.56872596,106.331298],[-9.22545274e-16,85.7480962],[9.22545274e-16,34.2519038],[3.56872596,13.6687019],[13.6687019,3.56872596]],"i":[[-11.9101331,2.187855967e-15],[0,0],[-4.354167000000004,-2.3286338100000004],[-2.328634000000008,-4.354166640000001],[0,-11.9101331],[0,0],[2.328633999999994,-4.354167000000004],[4.35416699999999,-2.328634000000008],[11.910133099999996,0],[0,0],[4.354166699999999,2.328633999999994],[2.3286338200000003,4.35416699999999],[1.458570646e-15,11.910133099999996],[0,0],[-2.3286338100000004,4.354166699999999],[-4.354166640000001,2.3286338200000003]],"o":[[0,0],[11.910133099999996,-2.187855967e-15],[4.35416699999999,2.3286338200000003],[2.328633999999994,4.354166699999999],[0,0],[0,11.910133099999996],[-2.328634000000008,4.35416699999999],[-4.354167000000004,2.328633999999994],[0,0],[-11.9101331,0],[-4.354166640000001,-2.328634000000008],[-2.3286338100000004,-4.354167000000004],[0,0],[-1.458570646e-15,-11.9101331],[2.3286338200000003,-4.354166640000001],[4.354166699999999,-2.3286338100000004]]}}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1,"ml":1},{"ty":"gf","o":{"a":0,"k":100},"r":2,"g":{"p":2,"k":{"a":0,"k":[0,0.09019607843137255,0.27450980392156865,0.592156862745098,1,0.047058823529411764,0.1450980392156863,0.3137254901960784]}},"t":1,"s":{"a":0,"k":[60,3.405888732]},"e":{"a":0,"k":[60,120]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0}}]}],"op":132}],"op":132,"w":550,"h":400} \ No newline at end of file diff --git a/index.js b/index.js index 2eeb7b7b..9077b7dd 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,8 @@ import { Sentry } from 'react-native-sentry'; import { AppRegistry } from 'react-native'; import WalletMigrate from './screen/wallets/walletMigrate'; import { name as appName } from './app.json'; +import LottieView from 'lottie-react-native'; + /** @type {AppStorage} */ const BlueApp = require('./BlueApp'); let A = require('./analytics'); @@ -22,7 +24,12 @@ if (!Error.captureStackTrace) { class BlueAppComponent extends React.Component { constructor(props) { super(props); - this.state = { isMigratingData: true }; + this.state = { isMigratingData: true, onAnimationFinished: false }; + } + + componentDidMount() { + const walletMigrate = new WalletMigrate(this.setIsMigratingData); + walletMigrate.start(); } setIsMigratingData = async () => { @@ -31,8 +38,40 @@ class BlueAppComponent extends React.Component { this.setState({ isMigratingData: false }); }; + onAnimationFinish = () => { + if (this.state.isMigratingData) { + this.loadingSplash.play(0); + } else { + this.setState({ onAnimationFinished: true }); + } + }; + render() { - return this.state.isMigratingData ? : ; + if (this.state.isMigratingData) { + return ( + (this.loadingSplash = ref)} + onAnimationFinish={this.onAnimationFinish} + source={require('./img/bluewalletsplash.json')} + autoPlay + loop={false} + /> + ); + } else { + if (this.state.onAnimationFinished) { + return ; + } else { + return ( + (this.loadingSplash = ref)} + onAnimationFinish={this.onAnimationFinish} + source={require('./img/bluewalletsplash.json')} + autoPlay + loop={false} + /> + ); + } + } } } diff --git a/ios/BlueWallet-Bridging-Header.h b/ios/BlueWallet-Bridging-Header.h new file mode 100644 index 00000000..1b2cb5d6 --- /dev/null +++ b/ios/BlueWallet-Bridging-Header.h @@ -0,0 +1,4 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + diff --git a/ios/BlueWallet.xcodeproj/project.pbxproj b/ios/BlueWallet.xcodeproj/project.pbxproj index c12f6d29..0c143fa1 100644 --- a/ios/BlueWallet.xcodeproj/project.pbxproj +++ b/ios/BlueWallet.xcodeproj/project.pbxproj @@ -23,6 +23,7 @@ 2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D16E6891FA4F8E400B85C8A /* libReact.a */; }; 2DCD954D1E0B4F2C00145EB5 /* BlueWalletTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* BlueWalletTests.m */; }; 3208E93922F63279007F5A27 /* AppCenter-Config.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3208E93822F63279007F5A27 /* AppCenter-Config.plist */; }; + 32B5A32A2334450100F8D608 /* Bridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B5A3292334450100F8D608 /* Bridge.swift */; }; 32F0A29A2311DBB20095C559 /* ComplicationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F0A2992311DBB20095C559 /* ComplicationController.swift */; }; 34582CAA4AD140F7B80C961A /* libTcpSockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DF4E6C040764E4BA1ACC1EB /* libTcpSockets.a */; }; 34CC55B441594DBB95AD1B50 /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E8E8CE89B3D142C6A8A56C34 /* Octicons.ttf */; }; @@ -149,6 +150,8 @@ 2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; }; 2FCC2CD6FF4448229D0CE0F3 /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialCommunityIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf"; sourceTree = ""; }; 3208E93822F63279007F5A27 /* AppCenter-Config.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "AppCenter-Config.plist"; sourceTree = ""; }; + 32B5A3282334450100F8D608 /* BlueWallet-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BlueWallet-Bridging-Header.h"; sourceTree = ""; }; + 32B5A3292334450100F8D608 /* Bridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Bridge.swift; sourceTree = ""; }; 32F0A24F2310B0700095C559 /* BlueWalletWatch Extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "BlueWalletWatch Extension.entitlements"; sourceTree = ""; }; 32F0A2502310B0910095C559 /* BlueWallet.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = BlueWallet.entitlements; path = BlueWallet/BlueWallet.entitlements; sourceTree = ""; }; 32F0A2992311DBB20095C559 /* ComplicationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComplicationController.swift; sourceTree = ""; }; @@ -321,6 +324,8 @@ 13B07FB61A68108700A75B9A /* Info.plist */, 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 13B07FB71A68108700A75B9A /* main.m */, + 32B5A3292334450100F8D608 /* Bridge.swift */, + 32B5A3282334450100F8D608 /* BlueWallet-Bridging-Header.h */, ); name = BlueWallet; sourceTree = ""; @@ -624,6 +629,7 @@ }; 13B07F861A680F5B00A75B9A = { DevelopmentTeam = A7W54YZ4WU; + LastSwiftMigration = 1030; ProvisioningStyle = Manual; SystemCapabilities = { com.apple.Keychain = { @@ -932,6 +938,7 @@ files = ( 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 13B07FC11A68108700A75B9A /* main.m in Sources */, + 32B5A32A2334450100F8D608 /* Bridge.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1024,6 +1031,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = A1B6AA2DE9A6E425682F4F3C /* Pods-BlueWalletTests.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; DEVELOPMENT_TEAM = A7W54YZ4WU; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -1074,6 +1082,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 6AB6574CC4ECAAA359683D0F /* Pods-BlueWalletTests.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; DEVELOPMENT_TEAM = A7W54YZ4WU; @@ -1122,6 +1131,7 @@ baseConfigurationReference = 9B3A324B70BC8C6D9314FD4F /* Pods-BlueWallet.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; @@ -1143,6 +1153,9 @@ PRODUCT_BUNDLE_IDENTIFIER = io.bluewallet.bluewallet; PRODUCT_NAME = BlueWallet; PROVISIONING_PROFILE_SPECIFIER = "io.bluewallet.bluewallet AppStore"; + SWIFT_OBJC_BRIDGING_HEADER = "BlueWallet-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; }; @@ -1153,6 +1166,7 @@ baseConfigurationReference = B459EE96941AE09BCB547DC0 /* Pods-BlueWallet.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; @@ -1173,6 +1187,8 @@ PRODUCT_BUNDLE_IDENTIFIER = io.bluewallet.bluewallet; PRODUCT_NAME = BlueWallet; PROVISIONING_PROFILE_SPECIFIER = "io.bluewallet.bluewallet AppStore"; + SWIFT_OBJC_BRIDGING_HEADER = "BlueWallet-Bridging-Header.h"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; }; diff --git a/ios/Bridge.swift b/ios/Bridge.swift new file mode 100644 index 00000000..87c7573d --- /dev/null +++ b/ios/Bridge.swift @@ -0,0 +1,9 @@ +// +// Bridge.swift +// BlueWallet +// +// Created by Marcos Rodriguez on 9/19/19. +// Copyright © 2019 Facebook. All rights reserved. +// + +import Foundation diff --git a/ios/Podfile.lock b/ios/Podfile.lock index f69a54d1..2858c27b 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -33,6 +33,10 @@ PODS: - DoubleConversion - glog - glog (0.3.5) + - lottie-ios (3.0.7) + - lottie-react-native (3.1.1): + - lottie-ios (~> 3.0.3) + - React - RCTSystemSetting (1.7.2): - React - React (0.60.5): @@ -151,7 +155,7 @@ PODS: - SentryReactNative (0.43.2): - React - Sentry (~> 4.1.3) - - swift_qrcodejs (1.1.1) + - swift_qrcodejs (1.1.2) - ToolTipMenu (5.2.1): - React - yoga (0.60.5.React) @@ -165,6 +169,7 @@ DEPENDENCIES: - EFQRCode (= 5.0.0) - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) + - lottie-react-native (from `../node_modules/lottie-react-native`) - RCTSystemSetting (from `../node_modules/react-native-system-setting`) - React (from `../node_modules/react-native/`) - React-Core (from `../node_modules/react-native/React`) @@ -211,6 +216,7 @@ SPEC REPOS: - AppCenterReactNativeShared - boost-for-react-native - EFQRCode + - lottie-ios - Sentry - swift_qrcodejs @@ -229,6 +235,8 @@ EXTERNAL SOURCES: :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec" glog: :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" + lottie-react-native: + :path: "../node_modules/lottie-react-native" RCTSystemSetting: :path: "../node_modules/react-native-system-setting" React: @@ -320,6 +328,8 @@ SPEC CHECKSUMS: EFQRCode: 07437cfbce3a1e497397a4f3d766c980d8972608 Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51 glog: 1f3da668190260b06b429bb211bfbee5cd790c28 + lottie-ios: c38c3178ae8c4a8f200661aa5f80b9f1ca7f56b3 + lottie-react-native: d8caf2aa9ab8bb76312e44997c1c91804a23d44d RCTSystemSetting: 9279ff44c49bb4fb0a5d335a0851852c8f3eda99 React: 53c53c4d99097af47cf60594b8706b4e3321e722 React-Core: ba421f6b4f4cbe2fb17c0b6fc675f87622e78a64 @@ -358,7 +368,7 @@ SPEC CHECKSUMS: RNWatch: c2d3bff3adf9ce06e10eb8c2d75c9043f5df0e35 Sentry: 4e8a17b61ddd116f89536cc81d567fdee1ebca96 SentryReactNative: 07237139c00366ea2e75ae3e5c566e7a71c27a90 - swift_qrcodejs: 0bacbfe321a99954c7b8e04c75562007ea4e4f7c + swift_qrcodejs: 4d024fc98b0778b804ec6a5c810880fd092aec9d ToolTipMenu: c158702a26154d892bc9e6eaa7d7382f0f1ee16e yoga: 312528f5bbbba37b4dcea5ef00e8b4033fdd9411 diff --git a/package-lock.json b/package-lock.json index 6f1ee4b0..60fc4c7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3750,6 +3750,11 @@ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" }, + "dedent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.6.0.tgz", + "integrity": "sha1-Dm2o8M5Sg471zsXI+TlrDBtko8s=" + }, "deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", @@ -7610,6 +7615,22 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "lottie-ios": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lottie-ios/-/lottie-ios-3.1.3.tgz", + "integrity": "sha512-FKSx9l5Ekwm1Wt/ncoCwvsq8NAb1nylzMFlxrHixLYNBtO2eCQet+vwQag+74Nc/E9Lp3DKkBUCyBfz+zjtmAw==" + }, + "lottie-react-native": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lottie-react-native/-/lottie-react-native-3.1.1.tgz", + "integrity": "sha512-zIHMQZoyAItPUw+42s38TwKA9+CWBaWxsTJhS8Ef7xbRWD9Gkr7UA6RrYfBJ0RZ4SKQ/V1YNnjp6200no+Rn8w==", + "requires": { + "invariant": "^2.2.2", + "lottie-ios": "^3.0.3", + "prop-types": "^15.5.10", + "react-native-safe-modules": "^1.0.0" + } + }, "lru-cache": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", @@ -10837,6 +10858,14 @@ "hoist-non-react-statics": "^2.3.1" } }, + "react-native-safe-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/react-native-safe-modules/-/react-native-safe-modules-1.0.0.tgz", + "integrity": "sha512-ShT8duWBT30W4OFcltZl+UvpPDikZFURvLDQqAsrvbyy6HzWPGJDCpdqM+6GqzPPs4DPEW31YfMNmdJcZ6zI2w==", + "requires": { + "dedent": "^0.6.0" + } + }, "react-native-screens": { "version": "1.0.0-alpha.23", "resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-1.0.0-alpha.23.tgz", diff --git a/package.json b/package.json index 560ee418..9d2cddfd 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "events": "1.1.1", "frisbee": "2.0.9", "intl": "1.2.5", + "lottie-react-native": "3.1.1", "mocha": "5.2.0", "node-libs-react-native": "1.0.3", "path-browserify": "1.0.0", diff --git a/screen/wallets/walletMigrate.js b/screen/wallets/walletMigrate.js index 7f5e018f..30d710fd 100644 --- a/screen/wallets/walletMigrate.js +++ b/screen/wallets/walletMigrate.js @@ -1,41 +1,20 @@ -import React, { Component } from 'react'; -import { View, ActivityIndicator } from 'react-native'; import AsyncStorage from '@react-native-community/async-storage'; -import PropTypes from 'prop-types'; import RNFS from 'react-native-fs'; import RNSecureKeyStore, { ACCESSIBLE } from 'react-native-secure-key-store'; -const expoDataDirectory = RNFS.DocumentDirectoryPath + '/ExponentExperienceData/%40overtorment%2Fbluewallet/RCTAsyncLocalStorage'; +export default class WalletMigrate { + static expoDataDirectory = RNFS.DocumentDirectoryPath + '/ExponentExperienceData/%40overtorment%2Fbluewallet/RCTAsyncLocalStorage'; -export default class WalletMigrate extends Component { - componentDidMount() { - this.migrateDataFromExpo(); + constructor(onComplete) { + this.onComplete = onComplete; } - migrationComplete() { - console.log('Migration was successful. Exiting migration...'); - this.props.onComplete(); - } - - async migrateDataToSecureKeystore() { - try { - const data = await AsyncStorage.getItem('data'); - if (data) { - const isEncrypted = (await AsyncStorage.getItem('data_encrypted')) || ''; - await RNSecureKeyStore.set('data', data, { accessible: ACCESSIBLE.WHEN_UNLOCKED }); - await RNSecureKeyStore.set('data_encrypted', isEncrypted, { - accessible: ACCESSIBLE.WHEN_UNLOCKED, - }); - await AsyncStorage.removeItem('data'); - await AsyncStorage.removeItem('data_encrypted'); - } - } catch (_e) { - console.log('Nothing to migrate from AsyncStorage.'); - } - this.migrationComplete(); + // 0: Let's start! + async start() { + return this.migrateDataFromExpo(); } - // Migrate Document directory from Expo + // 1: Migrate Document directory from Expo async migrateDataFromExpo() { const expoDirectoryExists = await RNFS.exists(RNFS.DocumentDirectoryPath + '/ExponentExperienceData'); @@ -52,7 +31,7 @@ export default class WalletMigrate extends Component { console.log('/RCTAsyncLocalStorage_V1 does not exist. Continuing...'); } try { - await RNFS.copyFile(expoDataDirectory, RNFS.DocumentDirectoryPath + '/RCTAsyncLocalStorage_V1'); + await RNFS.copyFile(WalletMigrate.expoDataDirectory, RNFS.DocumentDirectoryPath + '/RCTAsyncLocalStorage_V1'); } catch (error) { console.log('An error was encountered when trying to copy Expo data to /RCTAsyncLocalStorage_V1. Exiting migration...'); console.log(error); @@ -63,7 +42,7 @@ export default class WalletMigrate extends Component { console.log('An error was encountered when trying to delete .DS_Store. Continuing migration...'); console.log(error); } - const files = await RNFS.readDir(expoDataDirectory); + const files = await RNFS.readDir(WalletMigrate.expoDataDirectory); for (const file of files) { try { if (file.isFile()) { @@ -100,15 +79,28 @@ export default class WalletMigrate extends Component { await this.migrateDataToSecureKeystore(); } - render() { - return ( - - - - ); + // 2: Migrate Data from AsyncStorage to RNSecureKeyStore + async migrateDataToSecureKeystore() { + try { + const data = await AsyncStorage.getItem('data'); + if (data) { + const isEncrypted = (await AsyncStorage.getItem('data_encrypted')) || ''; + await RNSecureKeyStore.set('data', data, { accessible: ACCESSIBLE.WHEN_UNLOCKED }); + await RNSecureKeyStore.set('data_encrypted', isEncrypted, { + accessible: ACCESSIBLE.WHEN_UNLOCKED, + }); + await AsyncStorage.removeItem('data'); + await AsyncStorage.removeItem('data_encrypted'); + } + } catch (_e) { + console.log('Nothing to migrate from AsyncStorage.'); + } + this.migrationComplete(); } -} -WalletMigrate.propTypes = { - onComplete: PropTypes.func, -}; + // 3: We're done! + migrationComplete() { + console.log('Migration was successful. Exiting migration...'); + this.onComplete(); + } +} \ No newline at end of file