remove crypto libraries and nodeify hack

Signed-off-by: Eric Dvorsak <eric@dvorsak.fr>
This commit is contained in:
Eric Dvorsak 2018-04-06 05:54:52 +02:00
parent 74281a742f
commit 26b0224236
No known key found for this signature in database
GPG Key ID: 932AC1CE5F05DE0C
28 changed files with 679 additions and 2152 deletions

View File

@ -15,7 +15,6 @@
"realm",
"react-native-i18n",
"realm/react-native",
"react-native-randombytes",
"dismissKeyboard",
"react-native-splash-screen",
"react-native-status",
@ -30,7 +29,6 @@
"react-native-fcm",
"homoglyph-finder",
"web3",
"eccjs",
"chance",
"instabug-reactnative",
"nfc-react-native",

View File

@ -199,7 +199,6 @@ dependencies {
implementation project(':react-native-splash-screen')
implementation project(':react-native-image-resizer')
implementation project(':react-native-dialogs')
implementation project(':react-native-randombytes')
implementation project(':realm')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:26.1.0"

View File

@ -2,7 +2,6 @@ package im.status.ethereum;
import android.support.multidex.MultiDexApplication;
import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage;
import com.bitgo.randombytes.RandomBytesPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.facebook.react.ReactApplication;
import com.instabug.reactlibrary.RNInstabugReactnativePackage;
@ -64,7 +63,6 @@ public class MainApplication extends MultiDexApplication implements ReactApplica
statusPackage,
new RealmReactPackage(),
new RNI18nPackage(),
new RandomBytesPackage(),
new RCTCameraPackage(),
new RNFSPackage(),
new ReactNativeDialogsPackage(),

View File

@ -20,8 +20,6 @@ include ':react-native-image-resizer'
project(':react-native-image-resizer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-resizer/android')
include ':react-native-dialogs'
project(':react-native-dialogs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-dialogs/android')
include ':react-native-randombytes'
project(':react-native-randombytes').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-randombytes/android')
include ':react-native-i18n'
project(':react-native-i18n').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-i18n/android')
include ':realm'

View File

@ -35,7 +35,6 @@
3E15DFEC1F6F4D7CAE088F49 /* libTcpSockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C2A4E93F6B154AEFA3485B45 /* libTcpSockets.a */; };
4C16DE0C1F89508700AA10DB /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C16DE0B1F89508700AA10DB /* JavaScriptCore.framework */; };
4CA4DA1B206D105D006A98B0 /* libRNInstabug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E3F1C121DDAE781005E4779 /* libRNInstabug.a */; };
4FFAE7B0414A463991039A2E /* libRNRandomBytes.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C55F15EB4D4DAF9202A662 /* libRNRandomBytes.a */; };
5974D2035B8B47E0946B63B6 /* libRNFIRMessaging.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F752F17B1E04216B1337A72 /* libRNFIRMessaging.a */; };
63AE4174241B852A045FAE1F /* InstabugCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA36FD18BC2ECACF0A8B83DE /* InstabugCore.framework */; };
81C6E6AE0AA739BE9D87C1D0 /* libPods-StatusImTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FC1CBCFE6C906043D6CCEEE1 /* libPods-StatusImTests.a */; };
@ -160,13 +159,6 @@
remoteGlobalIDString = 3400A8081CEB54A6008A0BC7;
remoteInfo = imageCropPicker;
};
20B7D0FD1D3F74CC00B70F14 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 45FB5F523DE04BDE9877869C /* RNRandomBytes.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 73EEC9391BFE4B1D00D468EB;
remoteInfo = RNRandomBytes;
};
20B7D10D1D3F74CD00B70F14 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 46E2F6052EB44C698C680894 /* RNI18n.xcodeproj */;
@ -563,7 +555,6 @@
38E1A2C8D0734EE99E2B16CE /* TcpSockets.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = TcpSockets.xcodeproj; path = "../node_modules/react-native-tcp/ios/TcpSockets.xcodeproj"; sourceTree = "<group>"; };
3A7EB0491DD9CABC00A4FCC8 /* SplashScreen.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SplashScreen.xcodeproj; path = "../node_modules/react-native-splash-screen/ios/SplashScreen.xcodeproj"; sourceTree = "<group>"; };
439B6B4B407A4E2AACAFE5BE /* RCTStatus.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RCTStatus.xcodeproj; path = "../modules/react-native-status/ios/RCTStatus/RCTStatus.xcodeproj"; sourceTree = "<group>"; };
45FB5F523DE04BDE9877869C /* RNRandomBytes.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNRandomBytes.xcodeproj; path = "../node_modules/react-native-randombytes/RNRandomBytes.xcodeproj"; sourceTree = "<group>"; };
46E2F6052EB44C698C680894 /* RNI18n.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNI18n.xcodeproj; path = "../node_modules/react-native-i18n/ios/RNI18n.xcodeproj"; sourceTree = "<group>"; };
4C16DE0B1F89508700AA10DB /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
4E586E1B0E544F64AA9F5BD1 /* libz.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
@ -573,7 +564,6 @@
5E5A7625B76441D984EA8C0D /* RCTImageResizer.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RCTImageResizer.xcodeproj; path = "../node_modules/react-native-image-resizer/ios/RCTImageResizer.xcodeproj"; sourceTree = "<group>"; };
674B3D9595A047AB8D518F4E /* libRNFS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNFS.a; sourceTree = "<group>"; };
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
78C55F15EB4D4DAF9202A662 /* libRNRandomBytes.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNRandomBytes.a; sourceTree = "<group>"; };
7F752F17B1E04216B1337A72 /* libRNFIRMessaging.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNFIRMessaging.a; sourceTree = "<group>"; };
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
8B9A886A2CB448B1ABA0EB62 /* libc++.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
@ -662,7 +652,6 @@
9E7C64731E03FDDE004C7042 /* libRCTCamera.a in Frameworks */,
FD4F213C3873473CB703B1D2 /* libRNFS.a in Frameworks */,
213311F38CA74CE280FD09AD /* libRNI18n.a in Frameworks */,
4FFAE7B0414A463991039A2E /* libRNRandomBytes.a in Frameworks */,
22118DE1207A419FBFE7B62D /* libRealmReact.a in Frameworks */,
25DC9C9DC25846BD8D084888 /* libc++.tbd in Frameworks */,
BA68A2377A20496EA737000D /* libz.tbd in Frameworks */,
@ -846,14 +835,6 @@
name = Products;
sourceTree = "<group>";
};
20B7D0F01D3F74CC00B70F14 /* Products */ = {
isa = PBXGroup;
children = (
20B7D0FE1D3F74CC00B70F14 /* libRNRandomBytes.a */,
);
name = Products;
sourceTree = "<group>";
};
20B7D1041D3F74CD00B70F14 /* Products */ = {
isa = PBXGroup;
children = (
@ -933,7 +914,6 @@
9F1854E6D9654226B1FC8308 /* RCTCamera.xcodeproj */,
305F194186D848FDB07AF34C /* RNFS.xcodeproj */,
46E2F6052EB44C698C680894 /* RNI18n.xcodeproj */,
45FB5F523DE04BDE9877869C /* RNRandomBytes.xcodeproj */,
F090E261B9854867A728CE4F /* RealmReact.xcodeproj */,
38E1A2C8D0734EE99E2B16CE /* TcpSockets.xcodeproj */,
439B6B4B407A4E2AACAFE5BE /* RCTStatus.xcodeproj */,
@ -1107,7 +1087,6 @@
52F6ED6465184513A082652B /* libRNI18n.a */,
DF1CD4C3D1254774ACCAE4E8 /* libBVLinearGradient.a */,
5535217F57E44D77AA9CF083 /* libRCTOrientation.a */,
78C55F15EB4D4DAF9202A662 /* libRNRandomBytes.a */,
11632AA0A5F84F029DD91797 /* libRNVectorIcons.a */,
CD48A32459B64E96843BB238 /* libRealmReact.a */,
C2A4E93F6B154AEFA3485B45 /* libTcpSockets.a */,
@ -1320,10 +1299,6 @@
ProductGroup = 9E3F1BE31DDAE781005E4779 /* Products */;
ProjectRef = F3548417D8DA4362B6796A54 /* RNInstabug.xcodeproj */;
},
{
ProductGroup = 20B7D0F01D3F74CC00B70F14 /* Products */;
ProjectRef = 45FB5F523DE04BDE9877869C /* RNRandomBytes.xcodeproj */;
},
{
ProductGroup = 92925B361F571DE600203EEB /* Products */;
ProjectRef = 1E74DC52A1E449A2BA858B14 /* RNSVG.xcodeproj */;
@ -1423,13 +1398,6 @@
remoteRef = 20A5C9521D927137002C4965 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
20B7D0FE1D3F74CC00B70F14 /* libRNRandomBytes.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRNRandomBytes.a;
remoteRef = 20B7D0FD1D3F74CC00B70F14 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
20B7D10E1D3F74CD00B70F14 /* libRNI18n.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -2081,7 +2049,6 @@
"$(SRCROOT)/../node_modules/react-native-i18n/RNI18n",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
"$(SRCROOT)/../node_modules/react-native-orientation/iOS/RCTOrientation/**",
"$(SRCROOT)/../node_modules/react-native-randombytes",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/realm/src/**",
"$(SRCROOT)/../node_modules/react-native-tcp/ios/**",
@ -2140,7 +2107,6 @@
"$(SRCROOT)/../node_modules/react-native-i18n/RNI18n",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
"$(SRCROOT)/../node_modules/react-native-orientation/iOS/RCTOrientation/**",
"$(SRCROOT)/../node_modules/react-native-randombytes",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/realm/src/**",
"$(SRCROOT)/../node_modules/react-native-tcp/ios/**",
@ -2222,7 +2188,6 @@
"$(SRCROOT)/../node_modules/react-native-i18n/RNI18n",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
"$(SRCROOT)/../node_modules/react-native-orientation/iOS/RCTOrientation/**",
"$(SRCROOT)/../node_modules/react-native-randombytes",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/realm/src/**",
"$(SRCROOT)/../node_modules/react-native-tcp/ios/**",
@ -2283,7 +2248,6 @@
"$(SRCROOT)/../node_modules/react-native-i18n/RNI18n",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
"$(SRCROOT)/../node_modules/react-native-orientation/iOS/RCTOrientation/**",
"$(SRCROOT)/../node_modules/react-native-randombytes",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/realm/src/**",
"$(SRCROOT)/../node_modules/react-native-tcp/ios/**",

2469
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,11 +3,7 @@
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"postinstall": "./postinstall.sh"
},
"devDependencies": {
"rn-nodeify": "8.2.0"
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"assert": "1.4.1",
@ -19,25 +15,17 @@
"babel-preset-react-native": "4.0.0",
"babel-register": "6.18.0",
"bignumber.js": "github:status-im/bignumber.js#master",
"browserify-zlib": "0.1.4",
"buffer": "3.6.0",
"chance": "1.0.12",
"console-browserify": "1.1.0",
"constants-browserify": "0.0.1",
"create-react-class": "15.6.2",
"dns.js": "1.0.1",
"domain-browser": "1.1.7",
"eccjs": "0.3.1",
"emojilib": "2.2.9",
"events": "1.1.1",
"homoglyph-finder": "1.1.1",
"https-browserify": "0.0.1",
"identicon.js": "github:status-im/identicon.js",
"instabug-reactnative": "2.8.1",
"level-filesystem": "1.2.0",
"nfc-react-native": "github:status-im/nfc-react-native",
"os-browserify": "0.1.2",
"path-browserify": "0.0.0",
"process": "0.11.10",
"prop-types": "15.6.0",
"punycode": "1.4.1",
@ -63,84 +51,16 @@
"react-native-level-fs": "3.0.0",
"react-native-os": "1.1.0",
"react-native-qrcode": "0.2.6",
"react-native-randombytes": "3.0.0",
"react-native-splash-screen": "3.0.6",
"react-native-svg": "6.3.1",
"react-native-tcp": "3.3.0",
"react-native-testfairy": "2.8.0",
"react-native-udp": "2.2.1",
"react-native-webview-bridge": "github:status-im/react-native-webview-bridge#feature/camera-permissions",
"readable-stream": "1.1.14",
"realm": "2.0.7",
"rn-snoopy": "github:status-im/rn-snoopy",
"stream-browserify": "1.0.0",
"string_decoder": "0.10.31",
"timers-browserify": "1.4.2",
"tty-browserify": "0.0.0",
"url": "0.10.3",
"vm-browserify": "0.0.4",
"web3": "github:status-im/web3.js#status-develop"
},
"browser": {
"crypto": "react-native-crypto",
"assert": "assert",
"zlib": "browserify-zlib",
"console": "console-browserify",
"constants": "constants-browserify",
"dns": "dns.js",
"domain": "domain-browser",
"http": "react-native-http",
"https": "https-browserify",
"os": "react-native-os",
"path": "path-browserify",
"querystring": "querystring-es3",
"fs": "react-native-level-fs",
"dgram": "react-native-udp",
"timers": "timers-browserify",
"tty": "tty-browserify",
"vm": "vm-browserify",
"net": "react-native-tcp",
"fcm": "react-native-fcm",
"tls": false,
"child_process": false,
"buffer": "buffer",
"process": "process",
"_stream_transform": "readable-stream/transform",
"_stream_readable": "readable-stream/readable",
"_stream_writable": "readable-stream/writable",
"_stream_duplex": "readable-stream/duplex",
"_stream_passthrough": "readable-stream/passthrough",
"stream": "stream-browserify"
},
"react-native": {
"crypto": "react-native-crypto",
"assert": "assert",
"zlib": "browserify-zlib",
"console": "console-browserify",
"constants": "constants-browserify",
"dns": "dns.js",
"domain": "domain-browser",
"http": "react-native-http",
"https": "https-browserify",
"os": "react-native-os",
"path": "path-browserify",
"querystring": "querystring-es3",
"fs": "react-native-level-fs",
"dgram": "react-native-udp",
"timers": "timers-browserify",
"tty": "tty-browserify",
"vm": "vm-browserify",
"net": "react-native-tcp",
"fcm": "react-native-fcm",
"tls": false,
"child_process": false,
"buffer": "buffer",
"process": "process",
"_stream_transform": "readable-stream/transform",
"_stream_readable": "readable-stream/readable",
"_stream_writable": "readable-stream/writable",
"_stream_duplex": "readable-stream/duplex",
"_stream_passthrough": "readable-stream/passthrough",
"stream": "stream-browserify"
}
}

View File

@ -1,5 +0,0 @@
#!/bin/sh
# rn-nodeify
# temporary hack due to https://github.com/facebook/react-native/issues/4968
./node_modules/.bin/rn-nodeify --install "assert,zlib,buffer,inherits,console,constants,crypto,dns,domain,events,http,https,os,path,process,punycode,querystring,fs,stream,string_decoder,timers,tty,url,util,net,vm" --hack;

View File

@ -14,7 +14,6 @@
(def instabug (js/require "instabug-reactnative"))
(def nfc (js/require "nfc-react-native"))
(def qr-code (js/require "react-native-qrcode"))
(def random-bytes (js/require "react-native-randombytes"))
(def react-native (js/require "react-native"))
(def realm (js/require "realm"))
(def webview-bridge (js/require "react-native-webview-bridge"))

View File

@ -39,13 +39,9 @@
(defn get-active-group-chats
[]
(map (fn [{:keys [chat-id public-key private-key public?]}]
(let [group {:group-id chat-id
:public? public?}]
(if (and public-key private-key)
(assoc group :keypair {:private private-key
:public public-key})
group)))
(map (fn [{:keys [chat-id public?]}]
{:group-id chat-id
:public? public?})
(realm/js-object->clj (groups true))))
(defn- get-by-id-obj

View File

@ -0,0 +1,35 @@
(ns status-im.data-store.realm.schemas.account.v23.chat
(:require [status-im.ui.components.styles :refer [default-chat-color]]))
(def schema {:name :chat
:primaryKey :chat-id
:properties {:chat-id :string
:name :string
:color {:type :string
:default default-chat-color}
:group-chat {:type :bool
:indexed true}
:group-admin {:type :string
:optional true}
:is-active :bool
:timestamp :int
:contacts {:type :list
:objectType :chat-contact}
:unremovable? {:type :bool
:default false}
:removed-at {:type :int
:optional true}
:removed-from-at {:type :int
:optional true}
:added-to-at {:type :int
:optional true}
:updated-at {:type :int
:optional true}
:message-overhead {:type :int
:default 0}
:contact-info {:type :string
:optional true}
:debug? {:type :bool
:default false}
:public? {:type :bool
:default false}}})

View File

@ -0,0 +1,28 @@
(ns status-im.data-store.realm.schemas.account.v23.contact
(:require [taoensso.timbre :as log]))
(def schema {:name :contact
:primaryKey :whisper-identity
:properties {:address {:type :string :optional true}
:whisper-identity :string
:name {:type :string :optional true}
:photo-path {:type :string :optional true}
:last-updated {:type :int :default 0}
:last-online {:type :int :default 0}
:pending? {:type :bool :default false}
:hide-contact? {:type :bool :default false}
:status {:type :string :optional true}
:fcm-token {:type :string :optional true}
:description {:type :string :optional true}
:public-key {:type :string
:optional true}
:dapp? {:type :bool
:default false}
:dapp-url {:type :string
:optional true}
:bot-url {:type :string
:optional true}
:dapp-hash {:type :int
:optional true}
:debug? {:type :bool
:default false}}})

View File

@ -1,10 +1,10 @@
(ns status-im.data-store.realm.schemas.account.v23.core
(:require [status-im.data-store.realm.schemas.account.v22.chat :as chat]
(:require [status-im.data-store.realm.schemas.account.v23.chat :as chat]
[status-im.data-store.realm.schemas.account.v22.transport :as transport]
[status-im.data-store.realm.schemas.account.v1.chat-contact :as chat-contact]
[status-im.data-store.realm.schemas.account.v19.contact :as contact]
[status-im.data-store.realm.schemas.account.v23.contact :as contact]
[status-im.data-store.realm.schemas.account.v20.discover :as discover]
[status-im.data-store.realm.schemas.account.v23.message :as message]
[status-im.data-store.realm.schemas.account.v23.message :as message]
[status-im.data-store.realm.schemas.account.v19.request :as request]
[status-im.data-store.realm.schemas.account.v19.user-status :as user-status]
[status-im.data-store.realm.schemas.account.v5.contact-group :as contact-group]
@ -21,7 +21,7 @@
transport/schema
contact/schema
discover/schema
message/schema
message/schema
request/schema
user-status/schema
contact-group/schema

View File

@ -6,7 +6,8 @@
[status-im.data-store.realm.schemas.base.v5.core :as v5]
[status-im.data-store.realm.schemas.base.v6.core :as v6]
[status-im.data-store.realm.schemas.base.v7.core :as v7]
[status-im.data-store.realm.schemas.base.v8.core :as v8]))
[status-im.data-store.realm.schemas.base.v8.core :as v8]
[status-im.data-store.realm.schemas.base.v9.core :as v9]))
;; put schemas ordered by version
(def schemas [{:schema v1/schema
@ -32,4 +33,7 @@
:migration v7/migration}
{:schema v8/schema
:schemaVersion 8
:migration v8/migration}])
:migration v8/migration}
{:schema v9/schema
:schemaVersion 9
:migration v9/migration}])

View File

@ -0,0 +1,25 @@
(ns status-im.data-store.realm.schemas.base.v9.account)
(def schema {:name :account
:primaryKey :address
:properties {:address :string
:public-key :string
:name {:type :string :optional true}
:email {:type :string :optional true}
:status {:type :string :optional true}
:debug? {:type :bool :default false}
:photo-path :string
:signing-phrase {:type :string}
:mnemonic {:type :string}
:last-updated {:type :int :default 0}
:last-sign-in {:type :int :default 0}
:signed-up? {:type :bool
:default false}
:network :string
:networks {:type :list
:objectType :network}
:wnode :string
:settings {:type :string}
:sharing-usage-data? {:type :bool :default false}
:dev-mode? {:type :bool :default false}
:seed-backed-up? {:type :bool :default false}}})

View File

@ -0,0 +1,10 @@
(ns status-im.data-store.realm.schemas.base.v9.core
(:require [status-im.data-store.realm.schemas.base.v4.network :as network]
[status-im.data-store.realm.schemas.base.v9.account :as account]
[taoensso.timbre :as log]))
(def schema [network/schema
account/schema])
(defn migration [old-realm new-realm]
(log/debug "migrating 9 base database: " old-realm new-realm))

View File

@ -1,7 +1,6 @@
(ns status-im.js-dependencies)
(def Chance (js/require "chance"))
(def eccjs (js/require "eccjs"))
(def emojis (js/require "emojilib"))
(def homoglyph-finder (js/require "homoglyph-finder"))
(def identicon-js (js/require "identicon.js"))

View File

@ -18,8 +18,6 @@
(spec/def :account/signed-up? (spec/nilable boolean?))
(spec/def :account/last-updated (spec/nilable int?))
(spec/def :account/last-sign-in (spec/nilable int?))
(spec/def :account/updates-private-key :global/not-empty-string)
(spec/def :account/updates-public-key :global/not-empty-string)
(spec/def :account/photo-path (spec/nilable string?))
(spec/def :account/debug? (spec/nilable boolean?))
(spec/def :account/status (spec/nilable string?))
@ -37,7 +35,6 @@
:req-un [:account/name :account/address :account/public-key
:account/photo-path :account/signing-phrase]
:opt-un [:account/debug? :account/status :account/last-updated
:account/updates-private-key :account/updates-public-key
:account/email :account/signed-up? :account/network
:account/networks :account/settings :account/wnode
:account/last-sign-in :account/sharing-usage-data? :account/dev-mode?

View File

@ -74,8 +74,6 @@
:name (generate-gfy pubkey)
:status status
:signed-up? true
:updates-public-key "public"
:updates-private-key "private"
:photo-path (identicon pubkey)
:signing-phrase signing-phrase
:mnemonic mnemonic

View File

@ -27,19 +27,15 @@
(handlers/register-handler-fx
:account-recovered
(fn [{:keys [db keypair]} [_ result password]]
(fn [{:keys [db]} [_ result password]]
(let [data (types/json->clj result)
public-key (:pubkey data)
address (-> data :address utils.hex/normalize-hex)
phrase (signing-phrase/generate)
{:keys [public private]} keypair
account {:public-key public-key
:address address
:name (gfycat/generate-gfy public-key)
:photo-path (identicon/identicon public-key)
;;TODO remove those
:updates-public-key "public"
:updates-private-key "private"
:mnemonic ""
:signed-up? true
:signing-phrase phrase

View File

@ -12,7 +12,6 @@
(spec/def :contact/whisper-identity :global/not-empty-string)
(spec/def :contact/name :global/not-empty-string)
(spec/def :contact/address (spec/nilable :global/address))
(spec/def :contact/private-key (spec/nilable string?))
(spec/def :contact/public-key (spec/nilable string?))
(spec/def :contact/photo-path (spec/nilable string?))
(spec/def :contact/status (spec/nilable string?))
@ -42,7 +41,6 @@
:req-un [:contact/name]
:opt-un [:contact/whisper-identity
:contact/address
:contact/private-key
:contact/public-key
:contact/photo-path
:contact/status

View File

@ -38,7 +38,6 @@
[status-im.utils.ethereum.core :as ethereum]
[status-im.utils.random :as random]
[status-im.utils.config :as config]
[status-im.utils.crypt :as crypt]
[status-im.utils.notifications :as notifications]
[status-im.utils.handlers :as handlers]
[status-im.utils.http :as http]
@ -139,18 +138,6 @@
(fn []
(data-store/init)))
(re-frame/reg-fx
::initialize-crypt-fx
(fn []
(crypt/gen-random-bytes
1024
(fn [{:keys [error buffer]}]
(if error
(log/error "Failed to generate random bytes to initialize sjcl crypto")
(->> (.toString buffer "hex")
(.toBits (.. dependencies/eccjs -sjcl -codec -hex))
(.addEntropy (.. dependencies/eccjs -sjcl -random))))))))
(defn move-to-internal-storage [config]
(status/move-to-internal-storage
#(status/start-node config)))
@ -230,7 +217,6 @@
[:load-accounts]
[:initialize-views]
[:listen-to-network-status]
[:initialize-crypt]
[:initialize-geth]]}))
(handlers/register-handler-fx
@ -323,11 +309,6 @@
:photo-path photo-path
:name name))))}))
(handlers/register-handler-fx
:initialize-crypt
(fn [_ _]
{::initialize-crypt-fx nil}))
(handlers/register-handler-fx
:initialize-geth
(fn [{db :db} _]

View File

@ -1,26 +0,0 @@
(ns status-im.utils.crypt
(:require [goog.crypt :refer [byteArrayToHex]]
[clojure.string :as s]
[status-im.react-native.js-dependencies :as rn-dependencies])
(:import goog.crypt.Sha256))
(def sha-256 (Sha256.))
(defn bytes-to-str [arr]
(s/join (map char arr)))
(defn str-to-bytes [s]
(map (comp int) s))
(defn encrypt [s]
(.reset sha-256)
(.update sha-256 s)
(byteArrayToHex (.digest sha-256)))
(defn gen-random-bytes [length cb]
(.randomBytes rn-dependencies/random-bytes
length
(fn [& [err buf]]
(if err
(cb {:error err})
(cb {:buffer buf})))))

View File

@ -17,7 +17,6 @@
(def orientation #js {})
(def popup-menu #js {})
(def qr-code #js {})
(def random-bytes #js {})
(def react-native
#js {:NativeModules #js {}
:Animated #js {:View #js {}

View File

@ -17,8 +17,6 @@
:email nil
:signed-up? true
:name "Sleepy Serene Leopardseal"
:updates-private-key "3849320857de8efe1e1ec57e08e92ed2bce196cb8763756ae4e6e7e011c1d857de0a115b3dc7eff066afe75a8794ea9905b"
:updates-public-key "384975d68aec6426faacf8b4ba2c55d5a84b70a8a26eb616e06e9c9e63f95dfdf1c1c165773e1cdca2d198a0bc5386d8a6f2079414e073b4730c8f4745292a6cdfb3fa28143ad5937128643c6addf356b66962376dc8b12274d9abfb2e1c6447ac3"
:photo-path "photo"
:debug? false
:signing-phrase "baby atom base"
@ -32,8 +30,6 @@
{:address account-id
:signed-up? true
:name "Disloyal Trusting Rainbowfish"
:updates-private-key "3849071831f581f5e2a4f095a53e0a697144b32ea6de9e92cc08936f2efa40d2f1702bdb131356df0930a3a0d301221f2b5"
:updates-public-key "38453ecc298b8b35de00c85d3217f00aa7040a7d3053dbbf6831d03c750df40b27977906692b3b5d6fec8134706b2bf65900c61130047488520cb60080a59b118cb281f3aaf65ba704c7efde8f9357d2b22fe8110b38a4dd714c1c9e108a8b067fe"
:photo-path "new-account-photo"
:status "the future starts today, not tomorrow"
:network constants/default-network
@ -84,14 +80,4 @@
(rf/dispatch [:add-account new-account])
(is (= {(:address account-from-realm) account-from-realm
(:address new-account) new-account'} @accounts))
(testing ":account-update-keys event"
(rf/dispatch [:account-update-keys])
(is (= {(:address account-from-realm) account-from-realm
(:address new-account) (assoc new-account'
:updates-private-key "new private"
:updates-public-key "new public")}
(update @accounts (:address new-account) dissoc :last-updated)))))))))
(:address new-account) new-account'} @accounts)))))))

View File

@ -123,7 +123,6 @@
(testing "watch-contact"
(let [contact {:public-key "public-key"
:private-key "private-key"
:whisper-identity "whisper-identity"}
actual-fx (-> {:db {:web3 "web3"}}
(contacts-events/watch-contact contact)
@ -139,18 +138,13 @@
(is (= "whisper-identity" (:whisper-identity actual-fx))))
(testing "it adds the public key"
(is (= "public-key" (:public-key actual-fx))))
(testing "it adds the private key"
(is (= "private-key" (:private-key actual-fx))))))
(is (= "public-key" (:public-key actual-fx))))))
(testing "send-contact-request"
(let [contact {:whisper-identity "contact-whisper-identity"}
account {:name "name"
:photo-path "photo-path"
:status "status"
:updates-public-key "updates-public-key"
:updates-private-key "updates-private-key"}
:status "status"}
accounts {"current-account-id" account}
db {:accounts/accounts accounts
:accounts/current-account-id "current-account-id"
@ -182,9 +176,7 @@
(testing "it adds the current-account information"
(is (= account (select-keys actual-fx [:name
:photo-path
:status
:updates-public-key
:updates-private-key]))))))
:status]))))))
(run-test-sync
@ -291,13 +283,10 @@
:fcm-token "0xwhatever"})
(def received-contact1 (merge new-contact
(dissoc received-contact :profile-image)
{:public-key new-contact-public-key
:private-key ""}))
{:public-key new-contact-public-key}))
(rf/dispatch [:contact-request-received {:from new-contact-public-key
:payload {:contact received-contact
:keypair {:public new-contact-public-key
:private ""}}}])
:payload {:contact received-contact}}])
(testing "it adds the new contact to the list of contacts"
(is (= received-contact1

View File

@ -12,8 +12,6 @@
{:address "c296367a939e0957500a25ca89b70bd64b03004e"
:signed-up? true
:name "Disloyal Trusting Rainbowfish"
:updates-private-key "3849071831f581f5e2a4f095a53e0a697144b32ea6de9e92cc08936f2efa40d2f1702bdb131356df0930a3a0d301221f2b5"
:updates-public-key "38453ecc298b8b35de00c85d3217f00aa7040a7d3053dbbf6831d03c750df40b27977906692b3b5d6fec8134706b2bf65900c61130047488520cb60080a59b118cb281f3aaf65ba704c7efde8f9357d2b22fe8110b38a4dd714c1c9e108a8b067fe"
:photo-path "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAADAFBMVEXw8PDYjLoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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x ::account-events/save-account #()))

View File

@ -50,11 +50,9 @@
;; (.log js/console (str :post-error " " identity "\n" args))))
;; (defn id-specific-config
;; [id {:keys [private public]} contacts done]
;; [id contacts done]
;; {:identity id
;; :callback (make-callback id done)
;; :profile-keypair {:public public
;; :private private}
;; :contacts contacts
;; :post-error-callback (post-error-callback id)})
@ -69,7 +67,6 @@
;; (async done
;; (let [timeout 30
;; web3 (make-web3)
;; id1-keypair (protocol/new-keypair!)
;; common-config {:web3 web3
;; :groups []
;; :ack-not-received-s-interval 125
@ -80,7 +77,7 @@
;; :delivery-loop-ms-interval 500
;; :hashtags []
;; :pending-messages []}
;; id1-config (id-specific-config node/identity-1 id1-keypair [] done)]
;; id1-config (id-specific-config node/identity-1 [] done)]
;; (ensure-test-terminates! timeout done)
;; (protocol/init-whisper! (merge common-config id1-config))
;; (protocol/send-message!