Commit Graph

441 Commits

Author SHA1 Message Date
Siddarth Kumar 672358fbce
deps: bump react-native-linear-gradient library (#20329)
`react-native-linear-gradient` library has to be upgraded to `3.0.0-alpha.1` for new architecture support on `Android`.
2024-06-12 13:43:26 +05:30
Jamie Caprani 48f00f17a9
chore: fix some comments (#20410)
Signed-off-by: longxiangqiao <longxiangqiao@qq.com>
Co-authored-by: longxiangqiao <longxiangqiao@qq.com>
2024-06-11 12:48:24 +02:00
Jakub Sokołowski d7c66319aa
fix(ci)_: drop clean.sh script from cleanup stage
Because it keeps failing due to paths that appear alive but are not.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2024-06-04 14:32:51 +02:00
Icaro Motta 615ad2f02b
dx(debug)_: Add FlowStorm, a tracing debugger for Clojure(Script) (#20054)
Adds FlowStorm https://github.com/flow-storm/flow-storm-debugger v3.7.5, a well
known (tracing) debugger for Clojure(Script).

With FlowStorm, you can debug almost any cljs function in status-mobile. And
although it is not as capable as on the JVM, its main features work well enough.

How do I use it? Please, check the markdown diff in this PR: doc/debugging.md.

When would you use FlowStorm in status-mobile? You can use it all the time if
you want, but FlowStorm can be a powerful tool to understand complex pieces of
code. Consider those large subscriptions or event handlers. Or all those
components with lots of bindings and calculations. Understanding some of these
things is no easy task, even with a REPL. It is not a replacement for re-frisk,
those are very different tools and each have their place.

Resources:

- Repository: https://github.com/flow-storm/flow-storm-debugger
- Documentation: https://flow-storm.github.io/flow-storm-debugger
- Features: https://github.com/flow-storm/flow-storm-debugger#features
- YouTube demos: https://github.com/flow-storm/flow-storm-debugger#some-demo-videos-newers-at-the-top
2024-06-03 19:47:10 -03:00
Siddarth Kumar 5559599381
upgrade go to 1.21 (#20157) 2024-05-30 14:41:56 +05:30
Siddarth Kumar 7613de74ae
Fix integration tests for MacOS (#20248)
With go 1.20 its necessary to pass `lresolv` flag when building c-archives and `netgo` for networking on MacOS.
This was the primary reason why integration tests were failing.
ref 
-> https://github.com/golang/go/issues/58416
-> https://github.com/golang/go/issues/58159

This commit adds those flags to the derivation which builds status-go-library for integration tests and fixes the missing symbol crash.
2024-05-29 21:23:24 +05:30
Siddarth Kumar f65c10502b
pick between JSC & Hermes for Android (#20171)
We implement both `JSC` and `Hermes` in build phase of `Android` which increases our `APK` size by ~ `2 MB`.
This was fine before but currently we have to get below the `100 MB` limit.

This commit implements the preferred engine after inferring `hermesEnabled`  property from gradle.properties
This property is modified at build time for release here
178d62bd27/nix/mobile/android/build.nix (L17)
and set for debug here
178d62bd27/Makefile (L280)

Which should further reduce the `APK` size by `2 MB`.
2024-05-24 21:02:32 +05:30
flexsurfer 81977475c5
support ios "15.3" (#20127) 2024-05-23 10:59:43 +02:00
Siddarth Kumar 4cdbfb6cc6
enable proguard, modify rules & upgrade okhttp lib (#19975)
This commit enables proguard minification and adds exceptions in proguard rules for the following classes :
- org.bouncycastle
- im.status.ethereum.BuildConfig
- com.reactnativenavigation

This commit also upgrades okhttp gradle dependency to 4.11.0

This should shave off a few MBs in the android bundle.
2024-05-20 21:09:03 +05:30
Jamie Caprani 8f0840e913
chore(onboarding): remove parallax (#20026)
---------

Co-authored-by: Siddarth Kumar <siddarthkay@gmail.com>
2024-05-15 14:31:25 +02:00
Siddarth Kumar 91c347f6f5
chore: include Xcode 15.2 in allowed versions list (#20021)
## Summary

As reported by @ajayesivan and @seanstrom 
`Xcode 15.2` worked in their local environments and I then tried to use that version and found no issues with it.

This commit adds `Xcode 15.2` to versions list in Xcode Wrapper `nix` derivation.

## Testing notes
not needed.

## Platforms
- iOS

status: ready
2024-05-15 13:08:31 +05:30
Icaro Motta 16398dfd55
Upgrade re-frame to latest (#19931)
Upgrade re-frame to latest, from v1.3.0 (released on
2022-08-27) to latest v1.4.3 (released on 2024-01-25).

Important changes:

- [Added] re-frame.alpha namespace, for testing proposed features (see flows
  (https://github.com/day8/re-frame/discussions/795) and polymorphic
  subscriptions https://github.com/day8/re-frame/issues/680#issuecomment-1676487563).
- [Added] dispatch-sync now emits a :sync trace to indicate when it has
  finished.
- Re-frame upgraded its dependency on Reagent to latest v1.2.0.
- There are two breaking changes in v1.4.0, but they don't affect us because we
  don't use interceptors path and unwrap.
2024-05-13 21:18:16 -03:00
Siddarth Kumar cb9a620f40
fix: hack fix for contract tests on MacOS (#19965)
fixes #19802

Contract Tests are failing with missing symbols runtime error on `MacOS` after `golang` version was upgraded to 1.20
A simple hack fix such a case is to use `go 1.19` only to build the status-go library that is used specifically for these integration tests.
Its ugly but it works and unblocks devs from running tests locally.

- execute `make test-contract` on MacOS and it should not fail.

not needed since this impacts only the integration tests.

- macOS

status: ready
2024-05-10 17:58:49 +05:30
Icaro Motta 52a6f5c17d
Upgrade clj-kondo to 2024.03.13 (#19930)
This PR upgrades clj-kondo (our Clojure linter) from v2023-09-07 to
v2024-03-13, so ~6 months of development updates.

You can check out the changes starting at
https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20231020.
Nothing terribly useful to us this time, but as usual, clj-kondo can catch
more problems and more reliably than before.
2024-05-09 12:04:31 -03:00
Brian Sztamfater 07fb3610d1
chore: add wallet connect library (#19758)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-05-08 05:51:45 -03:00
Siddarth Kumar 43951b9dfd
modify xcodewrapper to do a runtime version check (#19822)
fixes #19770

Devs are often unaware of the supported Xcode version and often run into weird build issues with either higher or lower Xcode versions.
We currently only support Xcode 15.1
This change ensures we convey that change when devs execute `make run-ios`
This commit also attempts to ensure `xcodebuild` command is wrapped with `XcodeWrapper`.

- iOS
- macOS

status: ready
2024-05-08 12:51:04 +05:30
Siddarth Kumar 25e3a56dba
chore: pin cmake version (#19865)
On brand new ubuntu setup `make run-android` fails with :

```

Task :app:mergeExtDexDebug

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':react-native-reanimated:configureCMakeDebug[arm64-v8a]'.
[CXX1300] CMake '3.22.1' was not found in SDK, PATH, or by cmake.dir property.

BUILD FAILED in 2m 30s
673 actionable tasks: 673 executed

error: cannot unlink '/tmp/tmp-status-mobile-a094d218d/
nix-build-status-mobile-build-debug-android.drv-0/tmp.moQHI1tJWE/caches/8.4': Directory not empty
removed '/tmp/tmp-status-mobile-a094d218d/tmp.RpThXxcRZR'
make: *** [Makefile:278: run-android] Error 1
```

we do have `cmake` present in Android Shell and yet the build process is not able to find it.

This commit makes sure that we explicitly provide that reference.
2024-05-03 13:52:26 +05:30
Siddarth Kumar 86fefc2e32
[iOS] enable new architecture for react-native (#19748)
This commit enables `Fabric` and `Hermes` for `iOS` and in my initial tests the app seemed to behave well.
We can't do this for Android yet because the blur view implementation is not ported to `Fabric` properly.
needed for https://github.com/status-im/status-mobile/issues/18138
2024-04-30 14:08:41 +05:30
Siddarth Kumar 8fc6f4776b
fix store nodes not being found on iOS (#19798)
90b18d4f...b124e2b4

fixes #19736

Corresponding go PR https://github.com/status-im/status-go/pull/5093

This commit fixes DNS resolution inside status-go by forcing pure go resolver at build time.
Reference -> https://pkg.go.dev/net#hdr-Name_Resolution

Store nodes must be available on Android & iOS app.

- Android
- iOS

status: ready
2024-04-26 14:34:04 +02:00
Siddarth Kumar 9db49b8ca0
move rn-mail code to our native modules (#19760)
In this commit we nuke the unmaintained library `react-native-mail` and move over the logic to our native modules.
This also helps to fix `make nix-update-gradle` which would fail because of that library.

- Android
- iOS

status: ready
2024-04-24 11:55:40 +02:00
Siddarth Kumar ac48fbef44
bump go to 1.20 (#19564)
## Summary

This commit also points to status-go branch where we have upgraded go to 1.20
Related status-go PR -> https://github.com/status-im/status-go/pull/5027

### Testing notes
Please test everything, specially the store node stuff.

#### Platforms
- Android
- iOS

status: ready
2024-04-18 19:09:55 +02:00
Jakub Sokołowski b5962fd83a
nix: fix detecting install type in Docker
Otherwise build fails in a Docker container for Desktop:
```
+ make status-go
Building: status-go
Unknown Nix installtion type!
Unknown Nix installtion type!
make[1]: *** [Makefile:223: statusgo-shared-library] Error 1
make: *** [Makefile:432: vendor/status-go/build/bin/libstatus.so] Error 2
```

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2024-04-11 16:01:34 +03:00
Siddarth Kumar ce69df19ac
apply patches with patch files (#19451)
fixes #19449

In this commit we change the way patches are applied.
We no longer have to write patches in a patch phase like we used to, we can now place individual changes in a patch file inside the `patches` directory and they will be automatically applied.

Because of this change we can get rid of forks and instead have those changes in patch files.

To generate a patch file this make command can be used `make patch-file`
This will open an interactive shell which will allow you to specify which file you want to patch and then wait till you make those changes and generate a patch for it.

```
make patch-file
Configuring Nix shell for target 'default'...
Enter the path of the file to patch: ./node_modules/is-glob/index.js
File to patch: ./node_modules/is-glob/index.js
Temporary directory created: /tmp/tmp-status-mobile-40bc588fa/tmp.xrXarXoTPZ
Original file copied to temporary directory.
Please make the necessary changes to the file: ./node_modules/is-glob/index.js
Press any key when you are done with the changes...
Generating patch file...
Patch file created at /Users/siddarthkumar/code/status-im/PR/status-mobile/patches/index.js.patch
Info: Please execute 'make run-clojure' to test if the patch file works as expected.
```

- Android
- iOS
2024-04-08 21:06:41 +05:30
Siddarth Kumar da25280555
clean up unused libraries (#19456)
## Summary

This PR removes all of the unused `npm` libraries and their corresponding `gradle`/`cocoapods` dependencies.
The list of npm dependencies removed are :
- `@babel/preset-typescript`
- `create-react-class`
- `react-native-haptic-feedback`
- `react-native-image-viewing`
- `react-native-languages`
- `react-native-randombytes`
- `react-syntax-highlighter`
- `rn-emoji-keyboard`
- `tdigest`

This saves us some bytes in the bundle size.

## Platforms
- Android
- iOS
2024-04-02 16:32:54 +05:30
Siddarth Kumar 2dfb3ab838
upgrade nixpkgs to 23-11 (#19369)
fixes #18311

This PR upgrades `nixpkgs` to latest release version of 23-11
ref -> https://github.com/NixOS/nixpkgs/releases/tag/23.11

- `Gradle` from `8.0.1` -> `8.4`
- `Git` from `2.40.1` -> `2.42.0`
- `Curl` from `8.0.1` -> `8.4.0`
- `OpenSSL` from `3.0.8` -> `3.0.13`
- `NodeJS` from `18.16.0` -> `18.19.1`
-  `Python` from `3.10.11` -> `3.10.13`
- `Clojure` from `1.11.1.1273` -> `1.11.1.1413`
- and some more stuff

- `xcbeautify` , this was added in 23-11 ->https://github.com/NixOS/nixpkgs/pull/289446
- `idb-companion`, this was also added in 23-11 -> https://github.com/NixOS/nixpkgs/pull/296440
2024-04-01 16:26:44 +05:30
Siddarth Kumar 399da799a6
speed up android debug builds (#19335)
fixes #19081

## Summary
This PR aims to improve android build step for debug variants by ensuring we do not rebuild the android derivation for any change made to `clojurescript` code. 

We also do the following things : 
-  enable `JVM` parallel garbage collector.
-  get rid of `dexOptions` which was deprecated in `gradle 8`.
-  add additional `parallel` flag to `gradle` to speed up builds.

## Review notes
- `make run-clojure`
- `make run-android`
- ctrl + C on android terminal and edit any `cljs` file
- `make run-android`  ( should build almost instantly )
2024-03-23 15:12:05 +05:30
Siddarth Kumar a716f4e435
upgrade `react-native` to 0.73.5 (#18563)
fixes #18291

## Summary
Changes worth mentioning are :
- More hacks/patches
- Force app to use `Java 17` everywhere to compile `kotlin,java`
- `gems` were upgraded after a long time
- `aapt2` was bumped to `8.1.1`
- `metro` is now at `0.80.4`
- `xcbeautify` was bumped to `1.4.0`
- `@react-native-community/clipboard` lib was replaced with `@react-native-clipboard/clipboard`
- `react-native-dialogs` lib was upgraded to `1.1.2`
- `react-native-gesture-handler` lib was upgraded to `2.14.1`
- `react-native-navigation` was upgraded to `7.37.2`

## Platforms
- Android
- iOS
2024-03-22 19:51:44 +05:30
yqrashawn 29e69c54bd
build: less node_modules recopy from nix (#19120) 2024-03-07 13:30:36 +08:00
Lungu Cristian f8cd14296f
Add Promesa to simplify working with promises (#18767)
* added promesa (clj)

Signed-off-by: Cristian Lungu <lungucristian95@gmail.com>

* ref(resize): using promesa instead of passing cb

Signed-off-by: Cristian Lungu <lungucristian95@gmail.com>

---------

Signed-off-by: Cristian Lungu <lungucristian95@gmail.com>
2024-03-04 13:59:52 +02:00
Siddarth Kumar 5a7bfc61cc
fix: make run-ios-device script (#18845)
fixes #16310

We used to reply on `react-native cli` and would pass a `--device` flag to deploy the debug variant of `iOS` app on connected `iPhone`.
`react-native cli` under the hood uses `ios-deploy` library to achieve this functionality.
This showed many weird issues, specifically in locating connected devices and failures at build step with ambiguous error messages.

This commit fixes it by using our custom script `run-ios-devices.sh` which does not rely on `ios-deploy`.
We use `libimobiledevice` to identify `UDID` of a connected `iPhone`.
We use `xcrun devicectl device install app` and `xcrun devicectl device process launch` to install and launch the app.

This works well with `Xcode 15` and `iOS 17.x`.
We can now remove `ios-deploy` from `iOS` shell and `nix` overlay.
We also set up a logs folder and add a Readme.

## Review notes

- connect your iPhone to your Laptop via a cable
- `make run-clojure`
- `make run-ios-device`
(note: no need to pass device name now)

## Platforms
- iOS
2024-02-20 10:54:09 +05:30
Siddarth Kumar 2c96c38339
chore: disable hermes and cleanup gradle vars (#18832)
fixes #18831

We update the nix derivation to build android by passing `hermesEnabled` flag which checks the environment variable and if the environment variable is not set we default `hermesEnabled` to `true`.
This ensures that `hermes` is disabled for debug builds and enabled for release builds.

In this commit we also
- rename `nix/mobile/android/release.nix` → `nix/mobile/android/build.nix` since that nix file no longer generates release only builds.
- cleanup 2 other env vars and use the `gradle` project format
- replace `BUILD_NUMBER` with `verisonCode` for consistency
- replace `androidGradleOpts ` with `buildUrl ` 
- bump `status-jenkins-lib` to v1.8.7
2024-02-15 13:48:11 +05:30
Siddarth Kumar 42cab08553
chore: Improve DX for building the app locally (#18784)
After upgrading `react-native` to `0.72.5` we frequently started seeing the _red screen of death_ on both `Android` and `iOS` simulators right after the app was built and installed.
This used to happen because our workflow required us to do the following :
- `make run-clojure`
- `make run-metro`
- `make run-ios` OR `make run-android`

The problem with this approach was after `metro` was started the `iOS`, `Android` build step would change the files that `metro` couldn't handle and hence metro would go out of sync.
The quick fix back then was to restart `metro` terminal and to open the app again from the simulator.
This was however not a good DX.

This commit fixes that.
We no longer rely on `react-native` cli to generate and deploy debug builds on simulators. We take control of the process via our own script. The new workflow introduced in this commit will first build the app, then install the app on the simulators and then start metro terminal. When `metro` is successfully running the script will then open the app.

The new workflow now is :
- `make run-clojure`
- `make run-ios` OR `make run-android`
2024-02-14 19:58:45 +05:30
Jakub Sokołowski c5df51d944
nix: upgrade from 2.13.4 to 2.19.3
We are moving location of symlinks for build derivations for `gcroots`
from `/nix/var/nix/gcroots/per-user` to `.nix-gcroots` in the repo to
avoid errors like this caused by profile migration in `2.14` release:
```
error: creating directory '/nix/var/nix/gcroots/per-user/joe': Permission denied
```
For more details see: https://github.com/NixOS/nix/issues/8564

To upgrade without using `make nix-purge` use `make nix-upgrade`.

Related infra change:
https://github.com/status-im/infra-ci/commit/37c6ce47

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2024-02-13 13:32:50 +01:00
Siddarth Kumar cc63c8fff5
init: maestro dev automation (#18712)
The purpose of this commit is to allow running `maestro` automations to enhance productivity by **automating** mundane tasks.

Other flows like
- send contact request
- sync devices
- join a community
etc will be a part of follow ups.

In this commit we provide a `make` command to run a very common task like creating account & login :
`make auto-login`

We also allow another `make` command to run any other custom flow :
`make auto-custom FLOW="maestro/create-account-or-login.yaml"`

A `maestro` folder has been added with 3 `yaml` files which are very easy to understand
ref : https://maestro.mobile.dev/api-reference/commands
2024-02-06 23:29:35 +05:30
Siddarth Kumar 59c07050b2
chore: remove hermes enable condition (#18723)
We recently disabled `hermes` for debug builds here -> https://github.com/status-im/status-mobile/pull/18675
A side effect of that is when we run `make nix-update-gradle` the `hermes` pom gets removed from `deps.list`
This pom is necessary for release builds.
Currently that pom exists in `deps.list` but someone may accidentally remove it when running `make nix-update-gradle`

In this commit we remove the conditional implementation of `hermes` or `jsc` in `build.gradle`
This ensures that the `hermes` pom we need during release builds is not removed from `deps.list`.

I also ran `make nix-update-gradle` just to be sure.
I compared the apk in this commit to other PRs and the size increased by 2MB.
A small price to pay so that the team can run Malli locally without crashing their debug app frequently.

I've added a FIXME comment in the code for when we want to cut back on bundle size later.
2024-02-06 16:57:05 +05:30
Siddarth Kumar df76881c90
chore: disable hermes via gradle project env var (#18675)
fixes #18493

We enabled `hermes` for android in the `react-native` upgrade to `0.72.5`
Although things seemed fine but developers were seeing frequent crashes in their local environment.

After some investigation the crashes were traced to max native call stack depth in `hermes` engine.
Disabling `hermes` for local debug builds helps fix that issue.

This commit disables `hermes` by default with the help of a exporting an environment variable in the `make run-android` command.
It is annoying that this also modifies `android/gradle.properties` so we keep `hermesEnabled` as `false` there as well.
We also enable `hermes` when generating release builds so that we can take advantage of `hermes` engine in release builds.

We also add a log to print whether `hermes` is enabled or not. I think its helpful to have this so that we know whether `hermes` is enabled or not.
2024-02-01 20:56:18 +05:30
Siddarth Kumar f57a26b5f5
Remove hacks from darwin nix purge script (#18656)
## Summary
In this commit we : 
- instead of `cd` to `/Library/LaunchDaemons` and then attempting to `launchctl unload` the nixos plist files we just pass the full path to unload as seen in `nix` documentation here : https://nixos.org/manual/nix/stable/installation/uninstall.html#:~:text=Stop%20and%20remove%20the%20Nix%20daemon%20services%3A

- move killing a process by prompting for confirmation to a new shell script as per feedback from previous PR : https://github.com/status-im/status-mobile/pull/18192#discussion_r1439495310

- fix few small typos

## Platforms
- macOS
2024-01-30 09:00:26 +05:30
Lungu Cristian 901818492d
Replace unmaintained biometrics package (#18531)
* feat: added react-native-biometrics dependency

* chore: added malli schema to auth

* fix: malli schema

* feat: using react-native-biometrics

* fix: removed biometry not-enrolled error supression

* feat: added check for enabled biometric

* fix: biometrics error handling on ios

* chore: remove touch-id library

* chore: cleanup

* removed proj.list dep

* fix: gradle get_projects regex edge-case

Handles cases when the gradle project has a description, which shows up when running `gradle projects` as (`react-native-biometrics` - react-native-biometrics), breaking `make nix-update-gradle`. Here we're just adjusting the regex to ignore everything in the line after the closing (`).

* build: ran "make nix-update-gradle"

* chore: comment typo

* chore: replaced old lib in test mocks

* fix: addressed review comments

* fix: using event for standard-auth biometrics

* ref: using ex-cause for biometric error codes

* fix: removed promesa changes

* fix: auth slide biometric success not triggered
2024-01-29 13:33:46 +02:00
Siddarth Kumar 09bf6673cf
chore: upgrade `kotlinPluginVersion` to `1.9.0` (#18487)
### Summary

We need to bump `kotlin` Plugin version to `1.9.0` because the `nixpkgs` upgrade will set default `gradle` version to `8.4`.
`gradle` version `8.4` comes with a base `kotlin` version of `1.9.0` which becomes incompatible with our existing version of `1.7`

Otherwise we get errors like this :

```
e: /Users/siddarthkumar/code/experiments/status-mobile/node_modules/@react-native/
gradle-plugin/src/main/kotlin/com/facebook/react/utils/TaskUtils.kt: (25, 7): Class
'kotlin.collections.CollectionsKt__CollectionsKt' was compiled with an incompatible version of Kotlin.
The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /nix/store/3a228ppiiljfvsrxyq15h25chmiwsmbh-gradle-8.4/lib/gradle/lib/
kotlin-stdlib-1.9.10.jar!/kotlin/collections/CollectionsKt__CollectionsKt.class
.
.
.
```

needed for https://github.com/status-im/status-mobile/pull/18321

In this commit we set `kotlinPluginVersion` to `1.9.0` and update `gradle` dependencies.

#### Platforms
- Android
2024-01-16 21:18:15 +05:30
Siddarth Kumar 4eff9cc39c
fix: don't show trace message when default is set (#18464)
`getEnvWithDefault.nix` prints a trace message in console when a default value is not set. 

In this commit we add a check to see if default value matches the value of that env var.
Otherwise we get log messages like these when running `make run-ios`

```
trace: getEnvWithDefault IOS_STATUS_GO_TARGETS 
(default: ios/arm64;iossimulator/amd64): ios/arm64;iossimulator/amd64
trace: getEnvWithDefault IOS_STATUS_GO_TARGETS 
(default: ios/arm64;iossimulator/amd64): ios/arm64;iossimulator/amd64
```

We also fix a tiny mistake in `make run-ios` status-go target by updating the delimiter to be a semi-colon instead of a comma.
2024-01-11 14:57:28 +05:30
Jakub Sokołowski 257b0684ef
nix: fix regex in clean.sh script
Repo used to be called `status-react`.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2024-01-10 13:05:39 +01:00
Siddarth Kumar f992f4addd
fix: boost checksum issue due to jfrog (#18434)
I tried doing a clean pod install and was faced with this : 

```
Installing Yoga (1.14.0)
Installing boost (1.76.0)

[!] Error installing boost
Verification checksum was incorrect, expected 
f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41, got 
5e89103d9b70bba5c91a794126b169cb67654be2051f90cf7c22ba6893ede0ff
```

related issue in react-native repo : https://github.com/facebook/react-native/issues/42180 

In this commit we patch the pod specs provided by react native to rely on `sourceforge` instead `jfrog` to get boost.
2024-01-08 23:55:36 +05:30
Jakub Sokołowski 5915dd42bd
ci: upgrade CI hosts to Xcode 15.1
https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes
https://developer.apple.com/documentation/xcode-release-notes/xcode-15_0_1-release-notes
https://developer.apple.com/documentation/xcode-release-notes/xcode-15_1-release-notes

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2024-01-07 22:24:35 +01:00
Siddarth Kumar 7a4d79179d
chore: add Kotlin support (#18293)
This commit is a pre-requisite to upgrading `react-native` to `0.73.x`, now that react-native has completely moved their android code over from `Java` to `Kotlin` , it is also necessary for us to begin doing the same.

This commit converts just 2 files which are important at the moment.
- `android/app/src/main/java/im/status/ethereum/MainActivity.java`
- `android/app/src/main/java/im/status/ethereum/MainApplication.java`

I will can convert the remaining files in follow ups.
2023-12-28 20:20:25 +05:30
Icaro Motta 0b4a1545ae
Fix component tests, upgrade Jest & friends, and a few other goodies (#18276)
Fix all component tests after the latest RN upgrade.

Fixes https://github.com/status-im/status-mobile/issues/18157
Closes https://github.com/status-im/status-mobile/pull/18235

Dependency changes

- Upgraded Jest: from 26.6.3 to latest 29.7.0.
- Upgraded @testing-library/jest-native: from 5.3.0 to latest 5.4.3
- Upgraded @testing-library/react-native: from 11.5.4 to 12.4.2
- Removed explicit dependency on jest-circus, this is now the default test
  runner.
- Removed explicit dependency on jest-environment-node. This is handled by the
  package manager.
- Added jest-silent-reporter at version 0.5.0.

### Why component tests were failing?

Many tests were failing because we were using RN Testing Library (RNTL) in an
unreliable fashion. With the recent library upgrades, the unreliability was
excerbated. Other times, the tests were incorrectly arranging data.

### with-redefs does not work with async code

Generally speaking, with-redefs should not be used with async code, assume the
worst. The scope of the macro will cease to exist by the time the async code
runs. In many tests we were using with-redefs, then calling render, but for some
components that use use-effect, JS timers, animations, etc it's unreliable and
were the reason for failures.

It's easy to reproduce too:

```clojure
(defn foo []
  :foo)

(foo)
;; => :foo

(with-redefs [foo (constantly :bar)]
  (foo))
;; => :bar

(js/setTimeout
 (fn []
   (tap> [:calling-foo (foo)]))
 100)
;; Taps [:calling-foo :foo]
;; As you would expect, when running without with-redefs, it prints :foo.

;; So far so good, but whatch what happens with async code:

(with-redefs [foo (constantly :bar)]
  (js/setTimeout
   (fn []
     (tap> [:calling-foo (foo)]))
   100))
;; Taps [:calling-foo :foo]
;; ====> PROBLEM: Taps :foo, not :bar as one might expect
```

### Not waiting on wait-for

When test-helpers.component/wait-for is used, subsequent assertions/etc should
be done after the promise returned by wait-for is resolved. But remember to not
perform side-effects inside the wait-for callback (check out the docs
https://callstack.github.io/react-native-testing-library/docs/api#waitfor).
Most, if not all of our usages of wait-for were not waiting.

#### Improvement 1 - Silence Jest on demand

If you need to re-run component tests frequently, you may want to reduce the
output verbosity. By passing JEST_USE_SILENT_REPORTER=true to make
component-test or make component-test-watch you will see a lot less noise and be
able to focus on what really matters to you.

#### Improvement 2 - Selectively focus/disable tests

Because of our need to first compile CLJS to JS before running tests via Jest,
we couldn't easily skip or focus on specific tests. From this commit onwards, we
should never again have to change the list of requires in files core_spec.cljs.
Commenting out required namespaces gives a bad DX because it causes constant
rebasing issues.

#### Improvement 3 - Translations now work as in prod code (but only English)

Translations performed by *-by-translation-text can be done now without any
workaround under the hood. The query functions are now linted just like
i18n/label, which means static translation keywords must be qualified with :t/,
which is good for consistency.
2023-12-26 11:58:23 -03:00
Siddarth Kumar 10b97843ce
feat: add `xcbeautify` to iOS shell (#18273)
I can't remember the number of times I have had to ask developers to run `make run-ios | xcbeautify` when debugging iOS build failures and they do not have `xcbeautify` installed on their environment.

`xcbeautify` helps make `xcodebuild` output more readable and to identify problems quickly.

This commit adds `xcbeautify` to iOS shell and to  `make run-ios` so that we get readable output by default.
2023-12-22 19:45:59 +05:30
Anton Iakimov 2d22ed810c
ci: fix android-e2e nightly builds (#18261) 2023-12-21 14:36:16 +01:00
Siddarth Kumar 771fb111e6
make purge script more robust for Darwin (#18192)
The existing purge script for Darwin would fail and stop at many stages.

This commit makes the script more robust to certain failures that were observed and documented in https://github.com/status-im/status-mobile/issues/16404
2023-12-19 08:46:19 +05:30
Siddarth Kumar 8d0bb7ba9e
fix: modify permissions of all files to read (#18214)
`react-native-reanimated` generates write protected files during build time which are problematic because we copy over `node_modules` from `nix` store and when replacing them with new node modules we are manually asked to confirm this overwrite.

This used to happen before with `.cxx` files but now it also happens with `.so` files. 

This commit fixes those permissions.

partially fixes #18211
2023-12-18 14:38:34 +05:30
Siddarth Kumar 761a7df06f
upgrade react-native to 0.72.5 (#17241)
This commit does many things :
- Upgrade `react-native ` to `0.72.5`
- Upgrade `react-native-reanimated` to  `3.5.4`
- Upgrade `react-native-navigation` to `7.37.0`
- `ndkVersion` has been bumped to `25.2.9519653`
- `cmakeVersion` has been bumped to `3.22.1`
- `kotlinVersion` has been bumped to `1.7.22`
- `AGP` has been bumped to `7.4.2`
- `Gradle` has been upgraded to `8.0.1`
- Android `CompileSDK` and `TargetSDK` have been bumped to 33
- `@react-native-async-storage/async-storage` has been upgraded to `1.19.3`
- `@walletconnect/client` has been nuked
- some of the old `react-native-reanimated` code has been nuked
- `react-native-keychain` fork has been replaced with `8.1.2`

- On Android we are currently relying on `Hermes` Engine.
- On iOS we are currently relying on `JSC`
- We are not enabling new architecture for now (I have plans for that in the future) ref: https://github.com/status-im/status-mobile/issues/18138

IOS only PR : https://github.com/status-im/status-mobile/pull/16721
Android only PR : https://github.com/status-im/status-mobile/pull/17062

- `make run-metro` now has a target of `android` which was `clojure` earlier, this will increase the time it takes to start metro terminal but this is needed otherwise you will get a nasty error while developing for android locally.
2023-12-11 21:22:23 +05:30