Skip to content

Commit

Permalink
Onboarding setup wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy Vlasov committed Jun 28, 2019
1 parent 6d1b376 commit 1768dc7
Show file tree
Hide file tree
Showing 65 changed files with 877 additions and 232 deletions.
2 changes: 1 addition & 1 deletion STATUS_GO_SHA256
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## DO NOT EDIT THIS FILE BY HAND. USE `scripts/update-status-go.sh <tag>` instead

1bhwwmypb64kf180kp634jwfppd3h6yda3qyh2icj3lz7y10pgvp
0759c9hpzgvr37d90h2sfnf1hwhvz7zhn4qcz71ayafnc9d3fmff
2 changes: 1 addition & 1 deletion STATUS_GO_VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## DO NOT EDIT THIS FILE BY HAND. USE `scripts/update-status-go.sh <tag>` instead

v0.27.0-beta.1
v0.29.0-beta.1
Binary file added android/app/src/main/res/drawable-hdpi/bell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable-mdpi/bell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable-xhdpi/bell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable-xxhdpi/bell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ var TopLevel = {
"DesktopNotification" : function () {},
"DeviceEventEmitter" : function () {},
"Dimensions" : function () {},
"disableInstallation" : function () {},
"dispatch" : function () {},
"displayNotification" : function () {},
"dividedBy" : function () {},
Expand All @@ -108,7 +107,6 @@ var TopLevel = {
"dy" : function () {},
"ease" : function () {},
"Easing" : function () {},
"enableInstallation" : function () {},
"enableVibration" : function () {},
"encode" : function () {},
"encodeURIComponent" : function () {},
Expand Down
23 changes: 23 additions & 0 deletions ios/StatusIm/Images.xcassets/bell.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "bell_1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "bell_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "bell_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions ios/StatusIm/Images.xcassets/fingerprint.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "fingerprint_1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "fingerprint_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "fingerprint_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,44 @@ public void run() {
StatusThreadPoolExecutor.getInstance().execute(r);
}

@ReactMethod
public void startOnboarding(final Integer n, final Integer mnemonicLength, final Callback callback) {
Log.d(TAG, "startOnboarding");
if (!checkAvailability()) {
callback.invoke(false);
return;
}
Runnable r = new Runnable() {
@Override
public void run() {
String res = Statusgo.startOnboarding(n, mnemonicLength);

callback.invoke(res);
}
};

StatusThreadPoolExecutor.getInstance().execute(r);
}

@ReactMethod
public void importOnboardingAccount(final String id, final String password, final Callback callback) {
Log.d(TAG, "importOnboardingAccount");
if (!checkAvailability()) {
callback.invoke(false);
return;
}
Runnable r = new Runnable() {
@Override
public void run() {
String res = Statusgo.importOnboardingAccount(id, password);

callback.invoke(res);
}
};

StatusThreadPoolExecutor.getInstance().execute(r);
}

private String createIdentifier() {
return UUID.randomUUID().toString();
}
Expand Down Expand Up @@ -1015,46 +1053,6 @@ public void run() {
StatusThreadPoolExecutor.getInstance().execute(r);
}

@ReactMethod
public void enableInstallation(final String installationId, final Callback callback) {
Log.d(TAG, "enableInstallation");
if (!checkAvailability()) {
callback.invoke(false);
return;
}

Runnable r = new Runnable() {
@Override
public void run() {
String result = Statusgo.enableInstallation(installationId);

callback.invoke(result);
}
};

StatusThreadPoolExecutor.getInstance().execute(r);
}

@ReactMethod
public void disableInstallation(final String installationId, final Callback callback) {
Log.d(TAG, "disableInstallation");
if (!checkAvailability()) {
callback.invoke(false);
return;
}

Runnable r = new Runnable() {
@Override
public void run() {
String result = Statusgo.disableInstallation(installationId);

callback.invoke(result);
}
};

StatusThreadPoolExecutor.getInstance().execute(r);
}

@ReactMethod
public void updateMailservers(final String enodes, final Callback callback) {
Log.d(TAG, "updateMailservers");
Expand Down
16 changes: 0 additions & 16 deletions modules/react-native-status/desktop/rctstatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,22 +330,6 @@ void RCTStatus::extractGroupMembershipSignatures(QString signatures, double call
}, signatures, callbackId);
}

void RCTStatus::enableInstallation(QString installationId, double callbackId) {
Q_D(RCTStatus);
QtConcurrent::run([&](QString installationId, double callbackId) {
const char* result = EnableInstallation(installationId.toUtf8().data());
d->bridge->invokePromiseCallback(callbackId, QVariantList{result});
}, installationId, callbackId);
}

void RCTStatus::disableInstallation(QString installationId, double callbackId) {
Q_D(RCTStatus);
QtConcurrent::run([&](QString installationId, double callbackId) {
const char* result = DisableInstallation(installationId.toUtf8().data());
d->bridge->invokePromiseCallback(callbackId, QVariantList{result});
}, installationId, callbackId);
}

void RCTStatus::setAdjustResize() {
}

Expand Down
2 changes: 0 additions & 2 deletions modules/react-native-status/desktop/rctstatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class RCTStatus : public QObject, public ModuleInterface {
Q_INVOKABLE void signMessage(QString rpcParams, double callbackId);
Q_INVOKABLE void signGroupMembership(QString content, double callbackId);
Q_INVOKABLE void extractGroupMembershipSignatures(QString signatures, double callbackId);
Q_INVOKABLE void enableInstallation(QString installationId, double callbackId);
Q_INVOKABLE void disableInstallation(QString installationId, double callbackId);
Q_INVOKABLE void updateMailservers(QString enodes, double callbackId);
Q_INVOKABLE void getNodesFromContract(QString url, QString address, double callbackId);
Q_INVOKABLE void chaosModeUpdate(bool on, double callbackId);
Expand Down
48 changes: 24 additions & 24 deletions modules/react-native-status/ios/RCTStatus/RCTStatus.m
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,29 @@ - (void)handleSignal:(NSString *)signal
callback(@[result]);
}

//////////////////////////////////////////////////////////////////// startOnboarding
RCT_EXPORT_METHOD(startOnboarding:(NSInteger)n
password:(NSInteger)mnemonicLength
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"StartOnboarding() method called");
#endif
NSString *result = StatusgoStartOnboarding(n, mnemonicLength);
callback(@[result]);
}

//////////////////////////////////////////////////////////////////// importOnboardingAccount
RCT_EXPORT_METHOD(importOnboardingAccount:(NSString *)id
password:(NSString *)password
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"ImportOnboardingAccount() method called");
#endif
NSString *result = StatusgoImportOnboardingAccount(id, password);
callback(@[result]);
}


//////////////////////////////////////////////////////////////////// login
RCT_EXPORT_METHOD(login:(NSString *)address
password:(NSString *)password
Expand Down Expand Up @@ -425,30 +448,6 @@ - (void)handleSignal:(NSString *)signal
callback(@[result]);
}

////////////////////////////////////////////////////////////////////
#pragma mark - EnableInstallation
//////////////////////////////////////////////////////////////////// enableInstallation
RCT_EXPORT_METHOD(enableInstallation:(NSString *)content
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"EnableInstallation() method called");
#endif
NSString *result = StatusgoEnableInstallation(content);
callback(@[result]);
}

////////////////////////////////////////////////////////////////////
#pragma mark - DisableInstallation
//////////////////////////////////////////////////////////////////// disableInstallation
RCT_EXPORT_METHOD(disableInstallation:(NSString *)content
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"DisableInstallation() method called");
#endif
NSString *result = StatusgoDisableInstallation(content);
callback(@[result]);
}

////////////////////////////////////////////////////////////////////
#pragma mark - only android methods
////////////////////////////////////////////////////////////////////
Expand All @@ -473,6 +472,7 @@ - (void)handleSignal:(NSString *)signal
RCT_EXPORT_METHOD(clearCookies) {
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];

for (cookie in [storage cookies]) {
[storage deleteCookie:cookie];
}
Expand Down
Binary file added resources/images/ui/intro1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/ui/intro2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/ui/intro3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/ui/sample-key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1768dc7

Please sign in to comment.