parent
f52b87ef22
commit
371c66aad1
|
@ -147,7 +147,6 @@ var TopLevel = {
|
||||||
"getBlock" : function () {},
|
"getBlock" : function () {},
|
||||||
"getBlockNumber" : function () {},
|
"getBlockNumber" : function () {},
|
||||||
"getConnectionInfo" : function () {},
|
"getConnectionInfo" : function () {},
|
||||||
"getDeviceUUID" : function () {},
|
|
||||||
"getDomain" : function () {},
|
"getDomain" : function () {},
|
||||||
"getGasPrice" : function () {},
|
"getGasPrice" : function () {},
|
||||||
"getGenericPassword" : function () {},
|
"getGenericPassword" : function () {},
|
||||||
|
|
|
@ -46,7 +46,6 @@ import java.text.SimpleDateFormat;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipOutputStream;
|
import java.util.zip.ZipOutputStream;
|
||||||
|
|
||||||
|
@ -758,10 +757,6 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String createIdentifier() {
|
|
||||||
return UUID.randomUUID().toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void hashTransaction(final String txArgsJSON, final Callback callback) {
|
public void hashTransaction(final String txArgsJSON, final Callback callback) {
|
||||||
Log.d(TAG, "hashTransaction");
|
Log.d(TAG, "hashTransaction");
|
||||||
|
@ -1024,25 +1019,6 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||||
Statusgo.appStateChange(type);
|
Statusgo.appStateChange(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String uniqueID = null;
|
|
||||||
private static final String PREF_UNIQUE_ID = "PREF_UNIQUE_ID";
|
|
||||||
|
|
||||||
@ReactMethod
|
|
||||||
public void getDeviceUUID(final Callback callback) {
|
|
||||||
if (uniqueID == null) {
|
|
||||||
SharedPreferences sharedPrefs = this.getReactApplicationContext().getSharedPreferences(
|
|
||||||
PREF_UNIQUE_ID, Context.MODE_PRIVATE);
|
|
||||||
uniqueID = sharedPrefs.getString(PREF_UNIQUE_ID, null);
|
|
||||||
if (uniqueID == null) {
|
|
||||||
uniqueID = UUID.randomUUID().toString();
|
|
||||||
SharedPreferences.Editor editor = sharedPrefs.edit();
|
|
||||||
editor.putString(PREF_UNIQUE_ID, uniqueID);
|
|
||||||
editor.commit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
callback.invoke(uniqueID);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void setBlankPreviewFlag(final Boolean blankPreview) {
|
public void setBlankPreviewFlag(final Boolean blankPreview) {
|
||||||
final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this.reactContext);
|
final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this.reactContext);
|
||||||
|
|
|
@ -71,13 +71,6 @@ QVariantMap RCTStatus::constantsToExport() {
|
||||||
return QVariantMap();
|
return QVariantMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RCTStatus::getDeviceUUID(double callbackId) {
|
|
||||||
Q_D(RCTStatus);
|
|
||||||
qCDebug(RCTSTATUS) << "::getDeviceUUID call";
|
|
||||||
|
|
||||||
d->bridge->invokePromiseCallback(callbackId, QVariantList{"com.status.StatusIm"});
|
|
||||||
}
|
|
||||||
|
|
||||||
QString RCTStatus::prepareDirAndUpdateConfig(QString configString) {
|
QString RCTStatus::prepareDirAndUpdateConfig(QString configString) {
|
||||||
Q_D(RCTStatus);
|
Q_D(RCTStatus);
|
||||||
qCDebug(RCTSTATUS) << "::prepareDirAndUpdateConfig call - configString:" << configString;
|
qCDebug(RCTSTATUS) << "::prepareDirAndUpdateConfig call - configString:" << configString;
|
||||||
|
|
|
@ -66,7 +66,6 @@ public:
|
||||||
Q_INVOKABLE void callRPC(QString payload, double callbackId);
|
Q_INVOKABLE void callRPC(QString payload, double callbackId);
|
||||||
Q_INVOKABLE void callPrivateRPC(QString payload, double callbackId);
|
Q_INVOKABLE void callPrivateRPC(QString payload, double callbackId);
|
||||||
Q_INVOKABLE void closeApplication();
|
Q_INVOKABLE void closeApplication();
|
||||||
Q_INVOKABLE void getDeviceUUID(double callbackId);
|
|
||||||
|
|
||||||
Q_INVOKABLE static bool JSCEnabled();
|
Q_INVOKABLE static bool JSCEnabled();
|
||||||
Q_INVOKABLE static void statusGoEventCallback(const char* event);
|
Q_INVOKABLE static void statusGoEventCallback(const char* event);
|
||||||
|
|
|
@ -632,15 +632,6 @@ RCT_EXPORT_METHOD(appStateChange:(NSString *)type) {
|
||||||
StatusgoAppStateChange(type);
|
StatusgoAppStateChange(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT_EXPORT_METHOD(getDeviceUUID:(RCTResponseSenderBlock)callback) {
|
|
||||||
#if DEBUG
|
|
||||||
NSLog(@"getDeviceUUID() method called");
|
|
||||||
#endif
|
|
||||||
NSString* Identifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
|
|
||||||
|
|
||||||
callback(@[Identifier]);
|
|
||||||
}
|
|
||||||
|
|
||||||
RCT_EXPORT_METHOD(setBlankPreviewFlag:(BOOL *)newValue)
|
RCT_EXPORT_METHOD(setBlankPreviewFlag:(BOOL *)newValue)
|
||||||
{
|
{
|
||||||
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
|
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
|
|
@ -75,11 +75,6 @@
|
||||||
(fn [cofx _]
|
(fn [cofx _]
|
||||||
(init/start-app cofx)))
|
(init/start-app cofx)))
|
||||||
|
|
||||||
(handlers/register-handler-fx
|
|
||||||
:init.callback/get-device-UUID-success
|
|
||||||
(fn [cofx [_ device-uuid]]
|
|
||||||
(init/set-device-uuid cofx device-uuid)))
|
|
||||||
|
|
||||||
;; home screen
|
;; home screen
|
||||||
|
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
|
|
|
@ -23,21 +23,16 @@
|
||||||
(fx/defn initialize-app-db
|
(fx/defn initialize-app-db
|
||||||
"Initialize db to initial state"
|
"Initialize db to initial state"
|
||||||
[{{:keys [view-id hardwallet initial-props desktop/desktop
|
[{{:keys [view-id hardwallet initial-props desktop/desktop
|
||||||
device-UUID supported-biometric-auth push-notifications/stored network/type]} :db}]
|
supported-biometric-auth push-notifications/stored network/type]} :db}]
|
||||||
{:db (assoc app-db
|
{:db (assoc app-db
|
||||||
:initial-props initial-props
|
:initial-props initial-props
|
||||||
:desktop/desktop (merge desktop (:desktop/desktop app-db))
|
:desktop/desktop (merge desktop (:desktop/desktop app-db))
|
||||||
:network/type type
|
:network/type type
|
||||||
:hardwallet hardwallet
|
:hardwallet hardwallet
|
||||||
:device-UUID device-UUID
|
|
||||||
:supported-biometric-auth supported-biometric-auth
|
:supported-biometric-auth supported-biometric-auth
|
||||||
:view-id view-id
|
:view-id view-id
|
||||||
:push-notifications/stored stored)})
|
:push-notifications/stored stored)})
|
||||||
|
|
||||||
(fx/defn set-device-uuid
|
|
||||||
[{:keys [db]} device-uuid]
|
|
||||||
{:db (assoc db :device-UUID device-uuid)})
|
|
||||||
|
|
||||||
(fx/defn set-supported-biometric-auth
|
(fx/defn set-supported-biometric-auth
|
||||||
{:events [:init.callback/get-supported-biometric-auth-success]}
|
{:events [:init.callback/get-supported-biometric-auth-success]}
|
||||||
[{:keys [db]} supported-biometric-auth]
|
[{:keys [db]} supported-biometric-auth]
|
||||||
|
@ -80,8 +75,7 @@
|
||||||
|
|
||||||
(fx/defn start-app [cofx]
|
(fx/defn start-app [cofx]
|
||||||
(fx/merge cofx
|
(fx/merge cofx
|
||||||
{::get-device-UUID nil
|
{::get-supported-biometric-auth nil
|
||||||
::get-supported-biometric-auth nil
|
|
||||||
::init-keystore nil
|
::init-keystore nil
|
||||||
::restore-native-settings nil
|
::restore-native-settings nil
|
||||||
::open-multiaccounts #(re-frame/dispatch [::initialize-multiaccounts %])
|
::open-multiaccounts #(re-frame/dispatch [::initialize-multiaccounts %])
|
||||||
|
@ -108,11 +102,6 @@
|
||||||
(fn []
|
(fn []
|
||||||
(status/init-keystore)))
|
(status/init-keystore)))
|
||||||
|
|
||||||
(re-frame/reg-fx
|
|
||||||
::get-device-UUID
|
|
||||||
(fn []
|
|
||||||
(status/get-device-UUID #(re-frame/dispatch [:init.callback/get-device-UUID-success %]))))
|
|
||||||
|
|
||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
::get-supported-biometric-auth
|
::get-supported-biometric-auth
|
||||||
(fn []
|
(fn []
|
||||||
|
|
|
@ -206,12 +206,6 @@
|
||||||
(defn app-state-change [state]
|
(defn app-state-change [state]
|
||||||
(.appStateChange (status) state))
|
(.appStateChange (status) state))
|
||||||
|
|
||||||
(defn get-device-UUID [callback]
|
|
||||||
(.getDeviceUUID
|
|
||||||
(status)
|
|
||||||
(fn [UUID]
|
|
||||||
(callback (string/upper-case UUID)))))
|
|
||||||
|
|
||||||
(defn set-blank-preview-flag [flag]
|
(defn set-blank-preview-flag [flag]
|
||||||
(.setBlankPreviewFlag (status) flag))
|
(.setBlankPreviewFlag (status) flag))
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,6 @@
|
||||||
(reg-root-key-sub :tab-bar-visible? :tab-bar-visible?)
|
(reg-root-key-sub :tab-bar-visible? :tab-bar-visible?)
|
||||||
(reg-root-key-sub :dimensions/window :dimensions/window)
|
(reg-root-key-sub :dimensions/window :dimensions/window)
|
||||||
(reg-root-key-sub :initial-props :initial-props)
|
(reg-root-key-sub :initial-props :initial-props)
|
||||||
(reg-root-key-sub :get-device-UUID :device-UUID)
|
|
||||||
(reg-root-key-sub :fleets/custom-fleets :custom-fleets)
|
(reg-root-key-sub :fleets/custom-fleets :custom-fleets)
|
||||||
(reg-root-key-sub :chain-sync-state :node/chain-sync-state)
|
(reg-root-key-sub :chain-sync-state :node/chain-sync-state)
|
||||||
(reg-root-key-sub :desktop/desktop :desktop/desktop)
|
(reg-root-key-sub :desktop/desktop :desktop/desktop)
|
||||||
|
|
|
@ -155,10 +155,6 @@
|
||||||
|
|
||||||
(spec/def ::message-envelopes (spec/nilable map?))
|
(spec/def ::message-envelopes (spec/nilable map?))
|
||||||
|
|
||||||
;;;;UUID
|
|
||||||
|
|
||||||
(spec/def ::device-UUID (spec/nilable string?))
|
|
||||||
|
|
||||||
;;;; Supported Biometric authentication types
|
;;;; Supported Biometric authentication types
|
||||||
|
|
||||||
(spec/def ::supported-biometric-auth (spec/nilable #{:FaceID :TouchID :fingerprint}))
|
(spec/def ::supported-biometric-auth (spec/nilable #{:FaceID :TouchID :fingerprint}))
|
||||||
|
@ -320,7 +316,6 @@
|
||||||
:prices/prices
|
:prices/prices
|
||||||
:prices/prices-loading?
|
:prices/prices-loading?
|
||||||
:notifications/notifications
|
:notifications/notifications
|
||||||
::device-UUID
|
|
||||||
::supported-biometric-auth
|
::supported-biometric-auth
|
||||||
::collectible
|
::collectible
|
||||||
::collectibles
|
::collectibles
|
||||||
|
|
Loading…
Reference in New Issue