Skip to content

Commit

Permalink
Merge branch 'develop' into jc/remove-legacy-wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Son89 authored Feb 22, 2024
2 parents cb0847d + fee8ef5 commit f6f36ab
Show file tree
Hide file tree
Showing 142 changed files with 1,567 additions and 992 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,5 @@ test/appium/tests/users.py
## git hooks
lefthook.yml

## metro server logs
metro-server-logs.log
## build time logs
/logs/*.log
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ endif
export TMPDIR = /tmp/tmp-status-mobile-$(BUILD_TAG)
# This has to be specified for both the Node.JS server process and the Qt process.
export REACT_SERVER_PORT ?= 5001
# Default metro port used by scripts/run-android.sh.
export RCT_METRO_PORT ?= 8081
# Fix for ERR_OSSL_EVP_UNSUPPORTED error.
export NODE_OPTIONS += --openssl-legacy-provider
# The path can be anything, but home is usually safest.
Expand Down Expand Up @@ -294,11 +296,8 @@ show-ios-devices: ##@other shows connected ios device and its name
# TODO: fix IOS_STATUS_GO_TARGETS to be either amd64 or arm64 when RN is upgraded
run-ios-device: export TARGET := ios
run-ios-device: export IOS_STATUS_GO_TARGETS := ios/arm64;iossimulator/amd64
run-ios-device: ##@run iOS app and start it on a connected device by its name
ifndef DEVICE_NAME
$(error Usage: make run-ios-device DEVICE_NAME=your-device-name)
endif
react-native run-ios --device "$(DEVICE_NAME)"
run-ios-device: ##@run iOS app and start it on the first connected iPhone
@scripts/run-ios-device.sh

#--------------
# Tests
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ project dependencies, coding guidelines and testing procedures.
Check out our [coding guidelines](doc/new-guidelines.md).

- **Community Management**
Metcalfe's law states that the value of a network is proportional to the square of the number of connected users of the system - without community Status is meaningless. We're looking to create a positive, fun environment to explore new ideas, experiment and grow the Status community. Building a community takes a lot of work but the people you'll meet and the long-lasting relationships you form will be well worth it, check out our [Mission and Community Principles](https://status.im/about)
Metcalfe's law states that the value of a network is proportional to the square of the number of connected users of the system - without community Status is meaningless. We're looking to create a positive, fun environment to explore new ideas, experiment and grow the Status community. Building a community takes a lot of work but the people you'll meet and the long-lasting relationships you form will be well worth it, check out our [Mission and Community Principles](https://status.app/manifesto)

- **Specification / Documentation**
John Dewey once said, "Education is not preparation for life; education is life *itself* ". Developers and Designers need guidance and it all starts from documentation and specifications. Our software is only as good as its documentation, check out our [docs](doc/) and see how you can improve what we have.
Expand All @@ -53,10 +53,10 @@ Status is a visual interface to make permanent changes on the Blockchain, it han

- **Evangelism**
Help us spread the word! Tell a friend *right now*, in fact, tell **everyone** - yell from a mountain if you have to, every person counts! If you've got a great story to tell or have some interesting way you've spread the word about Status let us know about it in our [chat](https://join.status.im/chat/public/status)

## Give me Binaries!

You can get our Beta builds for both Android and iOS on our [website](https://status.im), through our [nightly builds](https://status.im/nightly/), or by [building it yourself](https://status.im/technical/build_status/).
You can get our Beta builds for both Android and iOS on our [website](https://status.app), through our [nightly builds](https://status.im/nightly/), or by [building it yourself](doc/starting-guide.md).

## Core Contributors

Expand Down
6 changes: 1 addition & 5 deletions ci/Jenkinsfile.combined
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ pipeline {
stage('Prep') {
steps { script {
println("Current JOB: ${env.JOB_NAME}")
/* just for a shorter access */
btype = utils.getBuildType()
} }
}
stage('Build') {
Expand Down Expand Up @@ -84,10 +82,8 @@ pipeline {
when { expression { params.PUBLISH } }
steps { script {
switch (btype) {
case 'nightly':
/* Create JSON file with newest build URLs */
case 'nightly': /* Create JSON file with newest build URLs */
s3.updateBucketJSON(urls, 'latest.json');
build(job: 'website/status.im', wait: false);
break;
case 'release':
github.publishReleaseFiles(repo: 'status-mobile');
Expand Down
2 changes: 2 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

[Contributing to status-go](status-go-changes.md)

[Malli schemas (recorded demo)](https://www.youtube.com/watch?v=SlRio70aYVI) ([slides](files/forging-code-with-schemas-sep-2023-slides.pdf))

## Testing

[How to run local tests](testing.md)
Expand Down
Binary file not shown.
59 changes: 37 additions & 22 deletions doc/starting-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,41 @@ This document provides information on how to start developing Status App.

# Getting Started

To start developing start a shell for the platform you are interested in.
To start developing clone the status-mobile repo in the directory of your choice.
```
make shell TARGET=android
git clone https://github.com/status-im/status-mobile.git
```
This step will take a while the first time as it will download all dependencies.

# Development
Then open a terminal and cd into this directory.

There are three steps necessary to start development, in this case for Android:
```
cd status-mobile
```

Then build the clojure terminal

```
make run-clojure
```

note: ⚠️ This might take a while if this is your first time.

This command installs `nix` and pulls in all the dependencies.
Do answer with "Y" to all the prompts and press "Enter" when `nix` setup asks you to Acknowledge.
This command builds the `jsbundle` and then compiles `Clojure` into `JavaScript`, watches for changes on `cljs` files, and hot-reloads code in the app.

1. `make run-clojure` - Compiles Clojure into JavaScript, watches for changes on cljs files, and hot-reloads code in the app.
2. `make run-android` or `make run-ios` - Builds the Android/iOS app, starts it on the device and starts metro bundler.
wait till you see the following message :

The first two will continue watching for changes and keep re-building the app. They need to be ready first.
The last one will exit once the app is up and ready.
```
[:mobile] Build completed. (1801 files, 52 compiled, 0 warnings, 9.52s)
```

Once the clojure terminal is running you need to run the appropriate command next for your platform in a separate terminal :

`make run-android` or `make run-ios`

These commands will build the app, start a metro bundler and deploy the app on your simulator OR connected device (android only). For building and deploying to connected iPhones use `make run-ios-device` instead of `make run-ios`
Also check [developing on a physical iOS Device](#Additional-requirements-for-developing-on-physical-ios-device).

## Simulators and Devices
### Android
Expand All @@ -45,13 +65,9 @@ Running `make run-ios` will target `iPhone 13` by default.

If you need to run on any other simulator, you can specify the simulator type by adding the `SIMULATOR` flag:
```sh
make run-ios SIMULATOR="iPhone 13"
make run-ios SIMULATOR="iPhone 15"
```

#### Running on a physical device

Some manual steps are necessary for [developing on a physical iOS Device](#physical-ios-device).

# Build release

To build the app, you can simply run on of the following:
Expand Down Expand Up @@ -101,16 +117,15 @@ Steps:
3. [Setup Git to sign commits](https://help.github.com/en/github/authenticating-to-github/signing-commits)
4. [Setup GitHub to validate commits](https://help.github.com/en/github/authenticating-to-github/adding-a-new-gpg-key-to-your-github-account)

## Physical iOS Device
## Additional requirements for developing on Physical iOS Device

To use a physical iPhone your device UDID must be added to provisioning profiles and your Apple account invited as Developer to Status team.

1. [Get your UDID of your iPhone.](https://www.extentia.com/post/finding-the-udid-of-an-ios-device)
2. Request from someone with access like @cammellos or @jakubgs to
- Add the UDID to development devices on Apple Developer Portal.
- Invite your Apple account to be Developer in Status team.
3. Run a build in XCode using the project from `status-mobile/ios` directory.
- You might see error: `Select a development team in the Signing & Capabilities editor`
- Select `Status Research & Development GmbH` as the development team and rebuild again.

Once build finishes Status should start on your iPhone with its logs in terminal running `make run-metro`.
- Add the UDID to development devices on Apple Developer Portal.
- Invite your Apple account to be Developer in Status team.
3. Open XCode using the project from `status-mobile/ios` directory.
- You might see error: `Select a development team in the Signing & Capabilities editor`
- Select `Status Research & Development GmbH` as the development team.
4. In a new terminal execute `make clean` and then `make xcode-clean`
38 changes: 32 additions & 6 deletions doc/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

## Unit & integration tests

To run tests:
To run all tests:

```
make test
```



Also test watcher can be launched. It will re-run the entire test suite when any file is modified

```
Expand Down Expand Up @@ -51,18 +49,46 @@ Here I'm showing a terminal-only experience using Tmux (left pane Emacs, right p

[2022-12-19 13-17.webm](https://user-images.githubusercontent.com/46027/208471199-1909c446-c82d-42a0-9350-0c15ca562713.webm)

## Component tests
## Component tests only

To run tests:

```
make component-test
make component-test
```

Also test watcher can be launched. It will re-run the entire test suite when any file is modified

```
make component-test-watch
make component-test-watch
```

Check [component tests doc](./component-tests-overview.md) for more.

## Unit tests only

To run unit tests:

```
make test-unit
```

Also test watcher can be launched. It will re-run the entire test suite when any file is modified

```
make test-unit WATCH=true
```

## Integration tests only

To run integration tests:

```
make test-integration
```

Also test watcher can be launched. It will re-run the entire test suite when any file is modified

```
make test-integration WATCH=true
```
21 changes: 1 addition & 20 deletions doc/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this
Update yarn.lock file. In order to do this, perform the following steps on a clean `status-mobile` repo:
```
cd status-mobile
make shell
yarn install
```
and don't forget to commit updated `yarn.lock` together with `package.json`.
Expand Down Expand Up @@ -127,23 +128,3 @@ Status-mobile uses `shadow-cljs` for hot reloading changes and uses its own [rel

### Solution
Open react native's [In-App Developer Menu](https://reactnative.dev/docs/debugging#accessing-the-in-app-developer-menu) and press "Disable Fast Refresh" or "Disable Hot Reloading"

## App Crashes after few reloads

### Cause
For x86 CPU architecture Android Devices, Hermes is creating the issue and the app crashes after a few reloads.
([Original Issue](https://github.com/status-im/status-mobile/issues/14031))

<details>
<summary>How to Find CPU architecture</summary>

CPU architecture of android device can be found using
- `adb shell uname -m` or
- `adb shell getprop ro.product.cpu.abilist`

</details>

### Solution
Disable Hermes while building the app

`make run-android DISABLE_HERMES=true`
18 changes: 18 additions & 0 deletions logs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Description

This directory is the destination of logs created during build time of debug builds.

# Logs

* `xcrun_device_install.log` - Output from `status-mobile/scripts/run-ios-device.sh`.
- Created by redirecting output of `xcrun simctl install "$UDID" "$APP_PATH"`.
* `xcrun_device_process_launch.log` - Output from `status-mobile/scripts/run-ios-device.sh`.
- Created by specifying `--json-output` flag for `xcrun devicectl device process launch --no-activate --verbose --device "${DEVICE_UUID}" "${INSTALLATION_URL}"`.
* `xcrun_device_process_resume.log` - Output from `status-mobile/scripts/run-ios-device.sh`.
- Created by redirecting output of `xcrun devicectl device process resume --device "${DEVICE_UUID}" --pid "${STATUS_PID}"`.
* `adb_install.log` - Output from `scripts/run-android.sh`.
- Created by redirecting output of `adb install -r ./result/app-debug.apk`.
* `adb_shell_monkey.log` - Output from `status-mobile/scripts/run-android.sh`.
- Created by redirecting output of `adb shell monkey -p im.status.ethereum.debug 1 >`.
* `ios_simulators_list.log` - Output from `status-mobile/scripts/run-ios.sh`.
- Created by redirecting output of `xcrun simctl list devices -j`.
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,14 @@ public void deleteMultiaccount(final String keyUID, final Callback callback) thr
final String keyStoreDir = this.utils.getKeyStorePath(keyUID);
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.deleteMultiaccount(keyUID, keyStoreDir), callback);
}

@ReactMethod
public void getRandomMnemonic(final Callback callback) throws JSONException {
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.getRandomMnemonic(), callback);
}

@ReactMethod
public void createAccountFromMnemonicAndDeriveAccountsForPaths(final String mnemonic, final Callback callback) throws JSONException {
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.createAccountFromMnemonicAndDeriveAccountsForPaths(mnemonic), callback);
}
}
16 changes: 16 additions & 0 deletions modules/react-native-status/ios/RCTStatus/AccountManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,20 @@ -(NSString *) prepareDirAndUpdateConfig:(NSString *)config
NSLog(@"%@", result);
}

RCT_EXPORT_METHOD(getRandomMnemonic:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"GetRandomMnemonic() method called");
#endif
NSString *result = StatusgoGetRandomMnemonic();
callback(@[result]);
}

RCT_EXPORT_METHOD(createAccountFromMnemonicAndDeriveAccountsForPaths:(NSString *)mnemonic callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"createAccountFromMnemonicAndDeriveAccountsForPaths() method called");
#endif
NSString *result = StatusgoCreateAccountFromMnemonicAndDeriveAccountsForPaths(mnemonic);
callback(@[result]);
}

@end
2 changes: 1 addition & 1 deletion nix/mobile/ios/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ in {
buildInputs = with pkgs; [
xcodeWrapper watchman procps
flock # used in nix/scripts/node_modules.sh
ios-deploy # used in 'make run-ios-device'
xcbeautify # used in 'make run-ios'
libimobiledevice # used in `make run-ios-device`
];

# WARNING: Executes shellHook in reverse order.
Expand Down
12 changes: 0 additions & 12 deletions nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,6 @@ in {
react-native = callPackage ./deps/react-native { };
};

# Fix for missing libarclite_macosx.a in Xcode 14.3.
# https://github.com/ios-control/ios-deploy/issues/580
ios-deploy = super.darwin.ios-deploy.overrideAttrs (old: rec {
version = "1.12.2";
src = super.fetchFromGitHub {
owner = "ios-control";
repo = "ios-deploy";
rev = version;
sha256 = "sha256-TVGC+f+1ow3b93CK3PhIL70le5SZxxb2ug5OkIg8XCA";
};
});

# Clojure's linter receives frequent upgrades, and we want to take advantage
# of the latest available rules.
clj-kondo = super.clj-kondo.override rec {
Expand Down
Loading

0 comments on commit f6f36ab

Please sign in to comment.