From 2920984b0ce1aadf03ece702b10583d0bdb3ea43 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Thu, 9 Jun 2016 12:49:02 +0300 Subject: [PATCH] react-native-status dependency and other Former-commit-id: 76e2887b17fdc7321998280fe28895fdc314f6ea --- .re-natal | 5 ++- android/app/build.gradle | 1 + .../main/java/com/statusim/JailModule.java | 27 -------------- .../main/java/com/statusim/JailPackage.java | 37 ------------------- .../main/java/com/statusim/MainActivity.java | 1 + android/settings.gradle | 3 ++ package.json | 3 +- src/status_im/chat/sign_up.cljs | 2 +- src/status_im/commands/handlers.cljs | 5 ++- 9 files changed, 14 insertions(+), 70 deletions(-) delete mode 100644 android/app/src/main/java/com/statusim/JailModule.java delete mode 100644 android/app/src/main/java/com/statusim/JailPackage.java diff --git a/.re-natal b/.re-natal index 1455b14c43..f1c7bbd66b 100644 --- a/.re-natal +++ b/.re-natal @@ -1,7 +1,7 @@ { "name": "StatusIm", "interface": "reagent", - "androidHost": "localhost", + "androidHost": "10.0.3.2", "modules": [ "react-native-contacts", "react-native-invertible-scroll-view", @@ -16,7 +16,8 @@ "react-native-randombytes", "dismissKeyboard", "react-native-linear-gradient", - "react-native-android-sms-listener" + "react-native-android-sms-listener", + "react-native-status" ], "imageDirs": [ "images" diff --git a/android/app/build.gradle b/android/app/build.gradle index 379551061c..95beff7a12 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -130,6 +130,7 @@ dependencies { compile project(':react-native-i18n') compile project(':react-native-linear-gradient') compile project(':ReactNativeAndroidSmsListener') + compile project(':react-native-status') // compile(name:'geth', ext:'aar') compile(group: 'status-im', name: 'android-geth', version: '1.4.0-201604110816-a97a114', ext: 'aar') diff --git a/android/app/src/main/java/com/statusim/JailModule.java b/android/app/src/main/java/com/statusim/JailModule.java deleted file mode 100644 index eed3852cbb..0000000000 --- a/android/app/src/main/java/com/statusim/JailModule.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.statusim; - -import com.facebook.react.bridge.Callback; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.ReactContextBaseJavaModule; -import com.facebook.react.bridge.ReactMethod; - -public class JailModule extends ReactContextBaseJavaModule { - - public JailModule(ReactApplicationContext reactContext) { - super(reactContext); - } - - @Override - public String getName() { - return "Jail"; - } - - @ReactMethod - public void parse(String js, Callback succ, Callback fail) { - succ.invoke("{\"commands\":{\"request-money\":" + - "{\"description\":\"olala!\",\"name\":\"request-money\"," + - "\"params\":{\"foo\":{\"type\":\"string\"}}}}," + - "\"responses\":{}}"); - } -} - diff --git a/android/app/src/main/java/com/statusim/JailPackage.java b/android/app/src/main/java/com/statusim/JailPackage.java deleted file mode 100644 index c1c71d94f1..0000000000 --- a/android/app/src/main/java/com/statusim/JailPackage.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.statusim; - -import com.facebook.react.ReactPackage; -import com.facebook.react.bridge.JavaScriptModule; -import com.facebook.react.bridge.NativeModule; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.uimanager.ViewManager; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * Created by rasom on 07.06.16. - */ -public class JailPackage implements ReactPackage { - - @Override - public List> createJSModules() { - return Collections.emptyList(); - } - - @Override - public List createViewManagers(ReactApplicationContext reactContext) { - return Collections.emptyList(); - } - - @Override - public List createNativeModules( - ReactApplicationContext reactContext) { - List modules = new ArrayList<>(); - - modules.add(new JailModule(reactContext)); - - return modules; - } -} diff --git a/android/app/src/main/java/com/statusim/MainActivity.java b/android/app/src/main/java/com/statusim/MainActivity.java index bbfa9caf05..dc1a4cd324 100644 --- a/android/app/src/main/java/com/statusim/MainActivity.java +++ b/android/app/src/main/java/com/statusim/MainActivity.java @@ -17,6 +17,7 @@ import java.util.Arrays; import java.util.List; import java.util.Properties; import java.io.File; +import com.statusim.Jail.JailPackage; import com.i18n.reactnativei18n.ReactNativeI18n; import io.realm.react.RealmReactPackage; diff --git a/android/settings.gradle b/android/settings.gradle index 141db02933..a42e8ee4c2 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -18,3 +18,6 @@ include ':react-native-linear-gradient' project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android') include ':ReactNativeAndroidSmsListener' project(':ReactNativeAndroidSmsListener').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-sms-listener/android') + +include ':react-native-status' +project(':react-native-status').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-status/android') diff --git a/package.json b/package.json index f325b8e9f3..e6ea438243 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "react-native-loading-spinner-overlay": "0.0.8", "react-native-randombytes": "^2.0.0", "react-native-vector-icons": "^1.3.4", - "realm": "^0.11.1" + "realm": "^0.11.1", + "react-native-status": "git+ssh://git@github.com/status-im/react-native-status" } } diff --git a/src/status_im/chat/sign_up.cljs b/src/status_im/chat/sign_up.cljs index 0c59915e31..b182354e15 100644 --- a/src/status_im/chat/sign_up.cljs +++ b/src/status_im/chat/sign_up.cljs @@ -186,7 +186,7 @@ :name "console" ; todo remove/change dapp config fot console :dapp-url "http://localhost:8185" - :dapp-hash 123 + :dapp-hash 834331894 :color default-chat-color :group-chat false :is-active true diff --git a/src/status_im/commands/handlers.cljs b/src/status_im/commands/handlers.cljs index 7f8657d7b2..fc9e2a8ad3 100644 --- a/src/status_im/commands/handlers.cljs +++ b/src/status_im/commands/handlers.cljs @@ -87,8 +87,8 @@ (defn get-hash-by-file [file] - ;; todo implement - 123) + ;; todo tbd hashing algorithm + (hash file)) (defn get-jail [] (.-Jail (.-NativeModules r/react))) @@ -110,6 +110,7 @@ [db [identity file]] (let [valid? (= (get-hash-by-dentity db identity) (get-hash-by-file file))] + (println "hsh " (hash file)) (assoc db ::valid-hash valid?))) (defn save-commands!