diff --git a/STATUS_GO_VERSION b/STATUS_GO_VERSION index e5a84ccee9..cb665ce674 100644 --- a/STATUS_GO_VERSION +++ b/STATUS_GO_VERSION @@ -1 +1 @@ -0.19.0-beta.1 +0.19.0-beta.9 diff --git a/ci/Jenkinsfile.android b/ci/Jenkinsfile.android index 0b50980924..cdec5675c0 100644 --- a/ci/Jenkinsfile.android +++ b/ci/Jenkinsfile.android @@ -2,7 +2,7 @@ pipeline { agent { docker { label 'linux' - image 'statusteam/status-build-android:1.0.0' + image 'statusteam/status-build-android:1.0.1' args ( "-v /home/jenkins/tmp:/var/tmp:rw "+ "-v /home/jenkins/status-im.keystore:/tmp/status-im.keystore:ro" diff --git a/docker/android/Dockerfile b/docker/android/Dockerfile index 7e068c8f48..315ea0921f 100644 --- a/docker/android/Dockerfile +++ b/docker/android/Dockerfile @@ -12,7 +12,8 @@ COPY sdk-tools-linux-${ANDROID_SDK_VERSION}.zip /tmp/sdk-tools-linux.zip RUN unzip -q /tmp/sdk-tools-linux.zip -d /usr/lib/android-sdk \ && mkdir ~/.android && touch ~/.android/repositories.cfg \ && yes | /usr/lib/android-sdk/tools/bin/sdkmanager --licenses > /dev/null \ - && for PKG in ${SDK_PACKAGES}; do /usr/lib/android-sdk/tools/bin/sdkmanager --install "${PKG}"; done \ + && for PKG in ${SDK_PACKAGES}; do \ + yes | /usr/lib/android-sdk/tools/bin/sdkmanager --install "${PKG}" > /dev/null; done \ && chmod 777 -R /usr/lib/android-sdk # cleanup SDK RUN cd /usr/lib/android-sdk \ diff --git a/docker/android/Makefile b/docker/android/Makefile index 013f353b85..1e1718a84d 100644 --- a/docker/android/Makefile +++ b/docker/android/Makefile @@ -12,7 +12,7 @@ ANDROID_SDK_URL = https://dl.google.com/android/repository/sdk-tools-linux-$(AND ANDROID_SDK_ARCHIVE = sdk-tools-linux-$(ANDROID_SDK_VERSION).zip # WARNING: Remember to change the tag when updating the image -IMAGE_TAG = 1.0.0 +IMAGE_TAG = 1.0.1 IMAGE_NAME = statusteam/status-build-android:$(IMAGE_TAG) build: $(ANDROID_NDK_ARCHIVE) $(ANDROID_SDK_ARCHIVE) diff --git a/ios/Podfile b/ios/Podfile index 7ebad2db53..12333521bc 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -17,6 +17,7 @@ target 'StatusIm' do pod 'react-native-background-timer', :path => '../node_modules/react-native-background-timer' pod 'RNKeychain', :path => '../node_modules/react-native-keychain' pod 'react-native-camera', path: '../node_modules/react-native-camera' + pod 'SQLCipher', '~>3.0' target 'StatusImTests' do inherit! :search_paths diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 9f8ca4ec7c..cacfe1a74d 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -70,6 +70,11 @@ PODS: - yoga (= 0.56.0.React) - RNKeychain (3.0.0-rc.3): - React + - SQLCipher (3.4.2): + - SQLCipher/standard (= 3.4.2) + - SQLCipher/common (3.4.2) + - SQLCipher/standard (3.4.2): + - SQLCipher/common - yoga (0.56.0.React) DEPENDENCIES: @@ -79,6 +84,7 @@ DEPENDENCIES: - react-native-background-timer (from `../node_modules/react-native-background-timer`) - react-native-camera (from `../node_modules/react-native-camera`) - RNKeychain (from `../node_modules/react-native-keychain`) + - SQLCipher (~> 3.0) - yoga (from `../node_modules/react-native/ReactCommon/yoga`) SPEC REPOS: @@ -92,6 +98,7 @@ SPEC REPOS: - GoogleUtilities - nanopb - Protobuf + - SQLCipher EXTERNAL SOURCES: React: @@ -119,8 +126,9 @@ SPEC CHECKSUMS: react-native-background-timer: bb7a98c8e97fc7c290de2d423dd09ddb73dcbcbb react-native-camera: 68ad5143d2d0636236d46c7de8d2a6455ca52a36 RNKeychain: 627c6095cef215dd3d9804a9a9cf45ab96aa3997 + SQLCipher: f9fcf29b2e59ced7defc2a2bdd0ebe79b40d4990 yoga: b1ce48b6cf950b98deae82838f5173ea7cf89e85 -PODFILE CHECKSUM: 7636f960a0dbec2dd55b8b20e244befa3fdb4438 +PODFILE CHECKSUM: 7a7b07318fa8b5a77d7f71190a3536cf574273ed COCOAPODS: 1.5.3 diff --git a/modules/react-native-status/android/src/main/java/im/status/ethereum/module/StatusModule.java b/modules/react-native-status/android/src/main/java/im/status/ethereum/module/StatusModule.java index 3727c43353..2bdeb8995d 100644 --- a/modules/react-native-status/android/src/main/java/im/status/ethereum/module/StatusModule.java +++ b/modules/react-native-status/android/src/main/java/im/status/ethereum/module/StatusModule.java @@ -459,8 +459,8 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL } @ReactMethod - public void notifyUsers(final String dataPayloadJSON, final String tokensJSON, final Callback callback) { - Log.d(TAG, "notifyUsers"); + public void sendDataNotification(final String dataPayloadJSON, final String tokensJSON, final Callback callback) { + Log.d(TAG, "sendDataNotification"); if (!checkAvailability()) { callback.invoke(false); return; @@ -469,7 +469,7 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL Runnable r = new Runnable() { @Override public void run() { - String res = Statusgo.NotifyUsers(dataPayloadJSON, tokensJSON); + String res = Statusgo.SendDataNotification(dataPayloadJSON, tokensJSON); callback.invoke(res); } diff --git a/modules/react-native-status/desktop/rctstatus.cpp b/modules/react-native-status/desktop/rctstatus.cpp index f4ee8060f8..08b35733fe 100644 --- a/modules/react-native-status/desktop/rctstatus.cpp +++ b/modules/react-native-status/desktop/rctstatus.cpp @@ -90,6 +90,7 @@ void RCTStatus::startNode(QString configString) { } QVariantMap configJSON = jsonDoc.toVariant().toMap(); + QVariantMap shhextConfig = configJSON["ShhextConfig"].toMap(); qCDebug(RCTSTATUS) << "::startNode configString: " << configJSON; int networkId = configJSON["NetworkId"].toInt(); @@ -107,10 +108,12 @@ void RCTStatus::startNode(QString configString) { d_gethLogFilePath = dataDir.absoluteFilePath("geth.log"); configJSON["DataDir"] = absDataDirPath; - configJSON["BackupDisabledDataDir"] = absDataDirPath; configJSON["KeyStoreDir"] = rootDir.absoluteFilePath("keystore"); configJSON["LogFile"] = d_gethLogFilePath; + shhextConfig["BackupDisabledDataDir"] = absDataDirPath; + configJSON["ShhExtConfig"] = shhextConfig; + const QJsonDocument& updatedJsonDoc = QJsonDocument::fromVariant(configJSON); qCInfo(RCTSTATUS) << "::startNode updated configString: " << updatedJsonDoc.toVariant().toMap(); const char* result = StartNode(QString(updatedJsonDoc.toJson(QJsonDocument::Compact)).toUtf8().data()); @@ -136,12 +139,12 @@ void RCTStatus::createAccount(QString password, double callbackId) { } -void RCTStatus::notifyUsers(QString dataPayloadJSON, QString tokensJSON, double callbackId) { +void RCTStatus::sendDataNotification(QString dataPayloadJSON, QString tokensJSON, double callbackId) { Q_D(RCTStatus); - qCDebug(RCTSTATUS) << "::notifyUsers call - callbackId:" << callbackId; + qCDebug(RCTSTATUS) << "::sendDataNotification call - callbackId:" << callbackId; QtConcurrent::run([&](QString dataPayloadJSON, QString tokensJSON, double callbackId) { - const char* result = NotifyUsers(dataPayloadJSON.toUtf8().data(), tokensJSON.toUtf8().data()); - logStatusGoResult("::notifyUsers Notify", result); + const char* result = SendDataNotification(dataPayloadJSON.toUtf8().data(), tokensJSON.toUtf8().data()); + logStatusGoResult("::sendDataNotification SendDataNotification", result); d->bridge->invokePromiseCallback(callbackId, QVariantList{result}); }, dataPayloadJSON, tokensJSON, callbackId); } diff --git a/modules/react-native-status/desktop/rctstatus.h b/modules/react-native-status/desktop/rctstatus.h index 62ad2db899..bb99d45bec 100644 --- a/modules/react-native-status/desktop/rctstatus.h +++ b/modules/react-native-status/desktop/rctstatus.h @@ -38,7 +38,7 @@ public: Q_INVOKABLE void startNode(QString configString); Q_INVOKABLE void stopNode(); Q_INVOKABLE void createAccount(QString password, double callbackId); - Q_INVOKABLE void notifyUsers(QString dataPayloadJSON, QString tokensJSON, double callbackId); + Q_INVOKABLE void sendDataNotification(QString dataPayloadJSON, QString tokensJSON, double callbackId); Q_INVOKABLE void sendLogs(QString dbJSON); Q_INVOKABLE void addPeer(QString enode, double callbackId); Q_INVOKABLE void recoverAccount(QString passphrase, QString password, double callbackId); diff --git a/modules/react-native-status/ios/RCTStatus/RCTStatus.m b/modules/react-native-status/ios/RCTStatus/RCTStatus.m index f6df1e8eef..f6bd8ab603 100644 --- a/modules/react-native-status/ios/RCTStatus/RCTStatus.m +++ b/modules/react-native-status/ios/RCTStatus/RCTStatus.m @@ -183,15 +183,15 @@ RCT_EXPORT_METHOD(createAccount:(NSString *)password } //////////////////////////////////////////////////////////////////// -#pragma mark - NotifyUsers method -//////////////////////////////////////////////////////////////////// notifyUsers -RCT_EXPORT_METHOD(notifyUsers:(NSString *)dataPayloadJSON +#pragma mark - SendDataNotification method +//////////////////////////////////////////////////////////////////// sendDataNotification +RCT_EXPORT_METHOD(sendDataNotification:(NSString *)dataPayloadJSON tokensJSON:(NSString *)tokensJSON callback:(RCTResponseSenderBlock)callback) { - char * result = NotifyUsers((char *) [dataPayloadJSON UTF8String], (char *) [tokensJSON UTF8String]); + char * result = SendDataNotification((char *) [dataPayloadJSON UTF8String], (char *) [tokensJSON UTF8String]); callback(@[[NSString stringWithUTF8String: result]]); #if DEBUG - NSLog(@"NotifyUsers() method called"); + NSLog(@"SendDataNotification() method called"); #endif } diff --git a/src/status_im/chat/models/message.cljs b/src/status_im/chat/models/message.cljs index c50f7049a8..4779d4330b 100644 --- a/src/status_im/chat/models/message.cljs +++ b/src/status_im/chat/models/message.cljs @@ -479,5 +479,5 @@ ;; NOTE: react-native-firebase doesn't have a good implementation of sendMessage ;; (supporting e.g. priority or content_available properties), ;; therefore we must use an implementation in status-go. - (status/notify-users {:data-payload data-payload-json :tokens tokens-json} - #(log/debug "send-notification cb result: " %))))) + (status/send-data-notification {:data-payload data-payload-json :tokens tokens-json} + #(log/debug "send-data-notification cb result: " %))))) diff --git a/src/status_im/native_module/core.cljs b/src/status_im/native_module/core.cljs index 2545862656..ab457fe870 100644 --- a/src/status_im/native_module/core.cljs +++ b/src/status_im/native_module/core.cljs @@ -51,8 +51,8 @@ (defn module-initialized! [] (native-module/module-initialized!)) -(defn notify-users [m callback] - (native-module/notify-users m callback)) +(defn send-data-notification [m callback] + (native-module/send-data-notification m callback)) (defn send-logs [dbJson] (native-module/send-logs dbJson)) diff --git a/src/status_im/native_module/impl/module.cljs b/src/status_im/native_module/impl/module.cljs index e629ad62e0..2e3d35fd21 100644 --- a/src/status_im/native_module/impl/module.cljs +++ b/src/status_im/native_module/impl/module.cljs @@ -84,9 +84,9 @@ true) false)))))) -(defn notify-users [{:keys [data-payload tokens] :as m} on-result] +(defn send-data-notification [{:keys [data-payload tokens] :as m} on-result] (when status - (call-module #(.notifyUsers status data-payload tokens on-result)))) + (call-module #(.sendDataNotification status data-payload tokens on-result)))) (defn send-logs [dbJson] (when status diff --git a/src/status_im/node/core.cljs b/src/status_im/node/core.cljs index 7ecbeb545e..21e480a813 100644 --- a/src/status_im/node/core.cljs +++ b/src/status_im/node/core.cljs @@ -57,8 +57,7 @@ (let [initial-props @(re-frame/subscribe [:initial-props]) status-node-port (get initial-props :STATUS_NODE_PORT)] (cond-> (assoc config - :Name "StatusIM" - :BackupDisabledDataDir (utils.platform/no-backup-directory)) + :Name "StatusIM") config/dev-build? (assoc :ListenAddr ":30304" :DataDir (str (:DataDir config) "_dev")) @@ -111,15 +110,16 @@ :LightClient true :MinimumPoW 0.001 :EnableNTPSync true} - :RequireTopics (get-topics network) - :InstallationID installation-id - :MailServerConfirmations config/mailserver-confirmations-enabled? - :PFSEnabled (or config/pfs-encryption-enabled? - ;; We don't check dev-mode? here as - ;; otherwise we would have to restart the node - ;; when the user enables it - config/group-chats-enabled? - (config/pairing-enabled? true))) + :ShhextConfig {:BackupDisabledDataDir (utils.platform/no-backup-directory) + :InstallationID installation-id + :MailServerConfirmations config/mailserver-confirmations-enabled? + :PFSEnabled (or config/pfs-encryption-enabled? + ;; We don't check dev-mode? here as + ;; otherwise we would have to restart the node + ;; when the user enables it + config/group-chats-enabled? + (config/pairing-enabled? true))} + :RequireTopics (get-topics network)) (and config/bootnodes-settings-enabled? @@ -135,6 +135,8 @@ [db network] (-> (get-in (:networks/networks db) [network :config]) (get-base-node-config) + + (assoc :ShhextConfig {:BackupDisabledDataDir (utils.platform/no-backup-directory)}) (assoc :PFSEnabled false :NoDiscovery true) (add-log-level config/log-level-status-go))) diff --git a/test/cljs/status_im/test/node/core.cljs b/test/cljs/status_im/test/node/core.cljs index 27f2680631..210f636581 100644 --- a/test/cljs/status_im/test/node/core.cljs +++ b/test/cljs/status_im/test/node/core.cljs @@ -7,7 +7,8 @@ (-> config :node/start (js/JSON.parse) - (js->clj :keywordize-keys true))) + (js->clj :keywordize-keys true) + :ShhextConfig)) (deftest start-test (let [address "a"