Compare commits

..
132 Commits
Author SHA1 Message Date
Icaro Motta eae887e6b4 Update status-go version to head of release/7.1.x 2024-12-17 09:01:52 -03:00
frank eff9003b68 fix_: hex string should be case insensitive 2024-12-17 09:01:52 -03:00
frank 6a2c13928e fix(sha3)_: support hex string 2024-12-17 09:01:52 -03:00
Parvesh Monu 3191c70048 fix Privacy policy button in learn more sheet open terms-of-use sheet (#21823) 2024-12-17 12:36:19 +01:00
Alexander Pantiukhov 8e3c42796f Revert back 6104ec05e3 2024-12-16 18:15:45 +01:00
flexsurfer 141fbba9a4 [#21828] Close the flows for adding accounts in keycard accounts (#21829) 2024-12-16 18:14:35 +01:00
Sean Hagstrom aaca9c9388 chore: update legal-docs submodule and resources with updated terms-of-use (#21821) 2024-12-16 17:28:59 +01:00
Ulises ManuelandShivek Khurana 1b9c3b577c Hide viewing community token requirements under a feature flag (#21814)
Co-authored-by: Shivek Khurana <khuranashivek@outlook.com>
2024-12-16 13:55:29 +01:00
Sean Hagstrom c1daea3e99 fix: use image clock when updating profile images to cause re-render (#21795) 2024-12-16 11:18:10 +01:00
Icaro Motta 9673eb40df Remove trace level from UI 2024-12-13 15:07:07 -03:00
frank b7cd92ce67 fix_: no log file generated after set log level 2024-12-13 15:07:07 -03:00
Sean Hagstrom 8878bf096c feature: add keycard metric events (#21794)
This change adds some metrics events for tracking when keycard users have reached an unavailable feature, when keycard users have successfully logged in, and when keycard users have succeeded or failed to migrate to keycard.
2024-12-12 18:48:35 +01:00
flexsurfer 6774271d9a [#21803] Cannot perform transactions/create derived account via keycard using NON default keypairs which existed before keycard migration (#21808) 2024-12-12 16:50:09 +01:00
Ulises Manuel 744ba2917e feat(profile): Make terms of use and privacy policy easily accessible (#21759)
* Fix `:true` keyword being used in navigation screens.

* Add about screen, terms of use and privacy policy links

* Remove old about app screen
2024-12-12 08:58:25 +01:00
Ulises Manuel a5b001f237 feat(oboarding): Update ilustrations (#21781)
* Share usage data screen image done

* Update login by syncing and login using recovery phrase images

*  Small refactor: remove `merge` and add a `let` binding

* Fix modal entering expected animation
2024-12-12 08:58:16 +01:00
Alexander Pantiukhov 6104ec05e3 NEEDS TO BE REVERTED LATER: logs: temporarily enabling loggin in release 2024-12-11 14:36:09 +01:00
flexsurfer b933d386b2 [#21577] Keycard [Wallet] - Derives next account for profile key pair (#21753) 2024-12-11 10:18:05 +01:00
Mohsen e2ec2e6171 [#21763] feat: add feature unavailable for dapps interaction (#21771) 2024-12-11 10:17:59 +01:00
Mohamed Javid a3bb6305b9 fix(wallet)_: logic for calculating zero balance (#21777)
This commit fixes logic to calculate whether the user has zero balance in all non-watched accounts.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-12-11 10:17:52 +01:00
Ulises ManuelandYevheniia Berdnyk 06be16d081 feat(onboarding): Remove color and username steps (#21715)
* Remove password disclaimer, update copy and simplify implementation

* Remove non-existing wallet event

* Skip profile configuration for the "create profile" onboarding flow

* Include flow for new profiles when another profile already exists

* Add explanation about temp username

* Point 20 to a constant

* Simplify create profile password screen

* Fix password creation screen jump on mount

* e2e: updated tests

* Completely remove the "create profile" onboarding screen

* e2e: updated tests with recovering user

---------

Co-authored-by: Yevheniia Berdnyk <ie.berdnyk@gmail.com>
2024-12-10 11:38:03 +01:00
Mohamed Javid 6a9e79f450 fix_: slider reset in standard authentication (#21779)
This commit resets the slider-button after the completion of slider in standard authentication.


Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-12-10 11:37:39 +01:00
Mohamed Javid 84f5a4378c fix(wallet)_: tx data cleanup after send or bridge tx (#21770)
This commit fixes the token/networks going to zero/disabled in the "Bridge to" screen when the user navigates back from the input screen.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-12-10 11:36:53 +01:00
alwx 2329b79f3d Updated status-go version 2024-12-09 14:03:32 +01:00
Brian Sztamfater 5b1f25d545 fix_: sometimes balances are not updated until relogin (#21748)
https://github.com/status-im/status-go/compare/a61f28bf...5371520f

Signed-off-by: Brian Sztamfater <brian@status.im>
2024-12-06 18:02:02 +01:00
alwx d35c2d2616 Update status-go-version.json to point to mobile/release/2.32.x 2024-12-06 17:56:52 +01:00
alwx 4226aa4d5e Bump release to 2.32.0 2024-12-06 16:44:04 +01:00
frank 9aa31ddf02 fix: no peers available supporting LightPush protocol (#21730)
When network is restored from disabled state.
2024-12-06 11:09:22 -03:00
Mohamed Javid 9a61b30c50 feat(wallet)_: keycard support for swap and approval (#21764)
This commit adds support for Keycard in the swap flow

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-12-06 17:55:36 +05:30
Volodymyr Kozieiev f1652ee2c4 Change value that triggers routes requesting in send screen (#21751) 2024-12-06 11:43:02 +00:00
Mohsen e1d2b9b1c1 [#21709] fix: big number issue in swap max value (#21752) 2024-12-06 12:48:24 +03:00
frank e60c20bc10 feat(websocket): add ping/pong keep-alive mechanism for iOS websocket (#21733)
Add WebSocket keep-alive mechanism using ping/pong frames to maintain connection stability:
- Add ping timer that sends ping every 30 seconds
- Automatically reconnect if ping fails
- Properly cleanup timer on disconnect
- Add logging for StatusGo server requests

This helps prevent connection timeouts and ensures timely detection of connection issues.
2024-12-06 15:37:17 +08:00
Icaro Motta 1391c48e39 chore(analytics): Improve tracking of login and onboarding completion events (#21760)
Improves tracking of login and successful onboarding completion according to
requests from non-technical analytics users and to synchronize with desktop. We
now publish two new events user-logged-in and onboarding-completed.

Fixes https://github.com/status-im/status-mobile/issues/21679

Areas that may be impacted: no impact is expected whatsoever, but login and
onboarding code were lightly touched.

- Event user-logged-in is always published, whenever the profile login is
  successful. If the user created a profile, we publish both
  onboarding-completed and user-logged-in.
- Event onboarding-completed is published if the user created a profile,
  recovered using seed phrase or paired devices successfully.
2024-12-05 18:40:10 -03:00
Mohamed Javid 2343d9be1e fix(wallet)_: default token image fallback (#21762)
This commit replaces the fallback for an unknown token image (where we display the first letter of the token name) with the default token image

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-12-05 20:56:38 +05:30
Parvesh Monu 7b85bfbd53 Remove elipses from preparing status label (#21757) 2024-12-05 16:01:23 +05:30
Volodymyr Kozieiev 27bfbea6bd Fix sending collectible by building transaction before signing (#21744)
* Fix sending collectible by building transaction before signing
2024-12-05 10:19:26 +00:00
Lungu Cristian caaff74efe Fix div error after amount is set as fiat (#21732)
* fix: cleanup send state on input unmount

* fix: switching default val to fiat filled input with 0.00
2024-12-05 09:53:57 +02:00
Brian Sztamfater 6ce58db7b9 fix_: incorrect USDT estimation and decimals on swap on arbitrum network (#21741)
https://github.com/status-im/status-go/compare/896eb635...a61f28bf

Signed-off-by: Brian Sztamfater <brian@status.im>
2024-12-04 14:34:01 -03:00
Sean Hagstrom fe788c3c26 feature: display registered profile keycards inside keycard settings (#21739)
This change adds support for displaying the keycards inside the keycards settings screen. Note, that the keycards that are displayed are the keycards that are associated to the user's profile keypair.
2024-12-04 09:06:19 -08:00
Yevheniia Berdnyk 1faa2e8f88 e2e: added key pair test 2024-12-04 16:55:39 +02:00
Parvesh Monu 2b7430e008 Update onboarding carousel and share usage screen (#21742) 2024-12-04 20:19:23 +05:30
Sean Hagstrom 62c8e73409 fix: avoid re-renders inside contact-list for new-chat sheet (#21640)
This change fixes some of the re-rendering issues that occur inside the contact list when creating a new chat. Most important is that we avoid extra re-renders by configuring the flat-list with stable props. And we also avoid re-rendering avatar images each time the avatar component re-renders.
2024-12-04 06:30:10 -08:00
Mohamed Javid e0e9ab9adb fix(wallet)_: token decimals in activities (#21745)
This commit fixes certain asset values that are 0 in wallet activities.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-12-04 19:23:48 +05:30
Siddarth Kumar b618f73063 ios: explicitly specify path to fetch CryptoSwift (#21750)
This commit explicitly specifies location and version of `CryptoSwift` pod in attempt to fix errors like this in CI.
```
None of your spec sources contain a spec satisfying the dependencies: `CryptoSwift (= 1.8.0), CryptoSwift`.
```
2024-12-04 19:05:43 +05:30
Mohamed Javid 8a88aac34d fix(wallet)_: wallet card flexible width (#21746)
This commit 
 - adds container-style prop to the wallet card component 
 - makes the Buy and Receive CTAs (cards) width flexible as we display two cards, and it needs to fill the screen width.

NOTE: The component's fixed width is 161, but in certain phones, it's small and does not fill the screen's whole width.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-12-03 23:50:17 +05:30
Mohsen 32ccca0912 [#21323] fix: wrong networks when asset not available in default account (#21689) 2024-12-03 17:24:30 +03:00
flexsurfer 2be78041e2 [#21669] [iOS] "Oops, this is not a Keycard" screen appears if user didn't scan his card properly (#21737) 2024-12-03 14:32:37 +01:00
Lungu Cristian d941029661 Fix swaps received value UI bug (#21724)
* fix: use text instead of input for received value

* fix: using input-disabled? instead of pay?
2024-12-03 11:49:15 +02:00
Lungu Cristian f7c930964c Show Swaps fee accurately as <0.01 when very small (#21726)
* fix: use full fiat value when converting from crypto

* test: fixed tests
2024-12-03 11:21:45 +02:00
Lungu Cristian 0c25b77e54 fix: show accurate approval fee for swaps (#21718) 2024-12-03 10:28:23 +02:00
Icaro Motta d0deb94bf3 fix(chats): Fix chats leaking to other profile (#21713)
Fixes a regression introduced in PR
https://github.com/status-im/status-mobile/pull/21634.

What's important is that the fix for chats leaking to other profiles was a
client-side bug, thus not coming from status-go, thus no private data was
leaking to other profiles. This PR keeps the existing workaround to memoize
chats in the home screen.

Fixes https://github.com/status-im/status-mobile/issues/21696
2024-12-02 23:27:37 -03:00
Icaro Motta 3a444f40f3 fix(group-chat): Missing group chat name when clearing history (#21684)
Fix missing group name when user chooses drawer option to clear chat history
from within the group chat screen.

Fixes https://github.com/status-im/status-mobile/issues/21639
2024-12-02 22:01:53 -03:00
Icaro Motta 7537c6b033 chore: Use en-US as default locale for F-Droid (#21714)
In Google Play and App Store, it is desirable to use en-GB (English UK) as the
default locale for legal reasons. We heard from F-Droid folks that en-GB is not
as well supported as en-US
https://github.com/status-im/status-mobile/issues/21665.

In this PR we go back to en-US as the default locale in fastlane and update the
text for English (UK) standards. Google Play and App Store shouldn’t be affected
and will use en-GB as the default locale.

Fixes https://github.com/status-im/status-mobile/issues/21665
2024-12-02 21:49:46 -03:00
Yevheniia Berdnyk e67f6c1cd3 e2e: mark skipped tests in TR 2024-12-02 20:13:35 +02:00
Tetiana Churikova 1d7eb49c57 e2e: remove xfail for staging fleet (#21681) 2024-12-02 18:33:48 +01:00
Mohamed Javid f6dfc64567 feat(wallet)!: Activity - a more reliable update (#21596)
This commit:

- Removes the usage of deprecated "wallet_filterActivityAsync RPC" and updates it to "wallet_startActivityFilterSessionV2" with other supporting activity filter session RPCs
- Removes deprecated "wallet_checkRecentHistoryForChainIDs" RPC as we no longer support past transaction history
- Added support for Bridge, Swap and Approval activities
- Added context for the sender and receiver if the address is known (own accounts or saved addresses)
- Added support for viewing, copying and sharing links to TX details on block explorer

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-12-02 21:35:05 +05:30
flexsurfer f08ac94596 [#21686] User can not sign transactions after Login/Sign up flows using Keycard (#21699) 2024-12-02 14:57:03 +01:00
Mohamed Javid 52a8f8fc22 feat(wallet)_: Show buy and receive cta on zero balance (#21690)
This commit:

- adds wallet-card component
- adds Buy and Receive CTAs above the assets list in the wallet home if the balance is zero

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-11-30 00:03:29 +05:30
Brian Sztamfater 6859fb8f8e fix(swap): optimize endpoints calls (#21549)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-11-29 13:21:44 -03:00
frank f45f96975e refactor_: rename LOG_REQUEST_GO to API_LOGGING_ENABLED (#21677)
https://github.com/status-im/status-go/compare/032eb5b6...c014fbfc

- Rename LOG_REQUEST_GO env variable to API_LOGGING_ENABLED across all env files
- Rename requests.log to api.log for consistency
- Remove standalone initLogging functionality from native modules as it's now
  handled within InitializeApplication
- Add logging configuration (logEnabled, logLevel, apiLoggingEnabled) to
  InitializeApplication params
- Add logDir parameter for Android to ensure proper log file location

This change consolidates logging initialization into the InitializeApplication
flow and makes the naming more consistent with its actual functionality.
2024-11-29 22:01:27 +08:00
Lungu Cristian 53d5ac4ea2 Using Keycard with the new Endpoints for Send/Bridge (#21705)
* fix: routes component annoying warning

* feat: replaced keycard sign with sign-hashes

* feat: using the keycard to sign transactions

* fix: removed unused and weird imports

* chore: removed debug logs

* chore: linting

* fix: removed clearing data on send error
2024-11-29 09:18:12 +02:00
Mohsen 874f07bd77 [#21644] fix: display zero for empty balances asset (#21697) 2024-11-29 08:42:37 +03:00
Mohamed Javid 4efb3c111a fix(wallet)_: error on tapping from/to section in tx confirmation screen (#21695)
This commit fixes the error thrown when tapping the From or To sections in the transaction confirmation screen.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-11-28 22:59:19 +05:30
Alexander de2b5fb935 Update sending transaction end point (#21480) (#21541)
* Update sending transaction end point

* Transaction approval

* Fixes

* Fixes

* Fixes

* Fix for issue 3

* Fixes for 2, 4, 7

* Update

* Fixes

* Fixes
2024-11-28 14:08:35 +01:00
Icaro Motta 5f8d5fd57e perf: Optimize messenger initialization (#21642)
Integrates the optimizations coming from the status-go PR
https://github.com/status-im/status-go/pull/6106. Now messenger filters are
set-up concurrently and we can call the endpoint wakuext_chatsPreview twice:
once for non-community chats and once for community chats. This way, the user
should be able to see some data render before the slow part ends
(community-related data).

Fixes https://github.com/status-im/status-mobile/issues/21456

Areas that may be impacted

- Login
- Loading of data after login (contacts, chats, etc)
2024-11-28 08:46:32 -03:00
Ulises Manuel 763b291629 fix(messenger): List of users overlap composer input (#21641)
* Fix mentions overlapped

* Fix rendering blink
2024-11-27 16:05:56 -06:00
Sean Hagstrom 9f50686042 fix: ensure keycard pin error message is visible (#21691)
Primarily, this change fixes an issue related to the Keycard PIN error message not being visible displayed on some devices. Additionally, this change also clears the PIN entry state after failing to enter the correct Keycard PIN. And this change also allows for the PIN entry component to have two separate error modes: one for the entire component and another for just the info text.
2024-11-27 08:47:56 -08:00
Yevheniia Berdnyk 1652601a82 e2e: fix for fallback tests 2024-11-27 15:47:12 +02:00
Yevheniia Berdnyk 7a44db36fe e2e: updated onboarding flow in tests 2024-11-27 03:30:00 +05:30
Parvesh Monu 338b241c8e Implement onboarding share usage data screen 2024-11-27 03:30:00 +05:30
Volodymyr Kozieiev 91761a92c7 Replace GetWalletToken endpoint with FetchOrGetCachedWalletBalances (#21625) 2024-11-26 13:27:58 +00:00
Sean Hagstrom 4b2a1db12f fix: add spacing between wrong-password error and forgot-password link (#21594) 2024-11-25 10:29:00 -08:00
Mohsen 05d4b4b068 [#21615] fix: hide mercuryo provider (#21626) 2024-11-25 20:58:58 +03:00
flexsurfer 9c9b55fe3e [#21573] Keycard - Sign up with a new Keycard (#21623) 2024-11-25 15:22:21 +01:00
Yevheniia Berdnyk 6ec307a8bb e2e: updated buttons ids 2024-11-25 15:07:37 +05:30
Parvesh Monu 86553eff14 Update create profile and sign in screen 2024-11-25 15:06:18 +05:30
Yevheniia Berdnyk 60911a1dd1 e2e: false failures fixes 2024-11-22 17:54:38 +02:00
Mohsen 21c2a525cf [#21557] feat: show from account page in swap flow (#21611)
* [#21557] feat: show from account page in swap flow

* [#21557] feat: add disabled state to account-item

* [#21557] fix: apply suggestion

* [#21557] fix: add format address util and rename screen

* [#21557] fix: check and count account with token balance

* [#21557] fix: check for root screen
2024-11-22 16:12:00 +03:00
frank 26ae330476 chore_: add env STATUS_BACKEND_SERVER_MEDIA_SERVER_ENABLE_TLS (#21648)
* chore_: add env STATUS_BACKEND_SERVER_MEDIA_SERVER_ENABLE_TLS

https://github.com/status-im/status-go/compare/b3dbe91b...cae9d35d

* update status-go version and doc

https://github.com/status-im/status-go/compare/b3dbe91b...906c50bf
2024-11-22 11:00:02 +08:00
Volodymyr Kozieiev 5442a8567c Custom Option Menu for TX Parameters on SEND Flow (#21657)
* wip

* wip

* custom menu implemented

* sheets closing and navigation

* Hidden under feature flag

* emoji added to settings item
2024-11-21 16:28:45 +00:00
Parvesh Monu fa0777e25e fix Unable to tap on chats/channels after opening profile link (#21643) 2024-11-21 18:16:01 +05:30
Samuel Hawksby-Robinson c6c3e089ca Added the legal docs as a submodule (#21654)
Signed-off-by: Samuel Hawksby-Robinson <samuel@samyoul.com>
2024-11-21 12:19:58 +00:00
Lungu Cristian 6a30ce3de3 Use latest watchman (#21546)
* chore: upgraded watchman, otherwise it's not used with current metro

The latest metro version requires watchman capabilities that are not
available in the version we locked, so it was not used. Instead we
used the "node watcher", which is slower and buggier (at least for me
metro was timing out quite often)

* fix: watchman ignore .clj-kondo, .shadow-cljs
2024-11-21 11:55:32 +02:00
Ulises ManuelandYevheniia Berdnyk ac0a115f1d feat(onboarding): Switch profiles keeping biometrics valid (#21628)
* Rework login and logout flow to keep biometrics valid

- Move logout logic to a new namespace, the implementation no longer uses `rf/defn`

* Code style fixes

* Fix warning: "null is not an image" in login

* Fix biometric icons used all over the app

---------

Co-authored-by: Yevheniia Berdnyk <ie.berdnyk@gmail.com>
2024-11-20 13:51:06 -06:00
Yevheniia Berdnyk 58476a43da e2e: removed notifications button in tests 2024-11-20 20:25:51 +05:30
Parvesh Monu 92e6a1862b Onboarding skip enable notifications screen 2024-11-20 20:25:51 +05:30
flexsurfer 45cd66f908 [#21559] Keycard - Fresh instal sign in (#21612)
https://github.com/status-im/status-go/compare/00a8a72a...79e662e4
[#21592] No Oops, this isn't a Keycard screen when scanning not a Keycard
2024-11-20 12:57:46 +01:00
Mohamed Javid a1e3bb3bd6 fix(wallet)_: Paraswap contract address (#21635)
This commit fixes ParaSwap contract address displayed on the setting approval cap for a token.

Since we get the approval contract address in the swap proposal, we take that as higher precedence over the hardcoded value in the constants file

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-11-19 17:52:57 +05:30
Parvesh Monu e6f290c06a Remove jump to (#21634) 2024-11-19 17:21:24 +05:30
Alexander 65c872c6ec Wallet status badge for offline RPC handling (#21484) 2024-11-19 12:38:06 +01:00
frank 7acaff6167 feat_: support use status backend server (#21450)
* chore_: use status.go v2 endpoint

https://github.com/status-im/status-go/compare/39511298...e255fb8b

* feat: use status backend server (#21550)

* chore: add env variable STATUS_BACKEND_SERVER_IMAGE_SERVER_URI_PREFIX

* update doc

* fix_: image_server lint issue

* chore_: update status-go version
2024-11-19 18:50:01 +08:00
Lungu Cristian 08c97b078a fix: don't parse v signature component, as status-go expects 01/02 (#21589) 2024-11-19 12:27:22 +02:00
Lungu Cristian e59b782b86 Wallet design review fixes (#21542)
* feat: hide token price-change info if no token balance

* fix: show dapps header button only on account screen

* ref: renamed to above-zero? and using it where needed

* fix: removed bridge icon from submit button
2024-11-19 12:08:52 +02:00
Volodymyr Kozieiev 87483b1ef4 Swap: use correct fee on spending cap screen (#21532) 2024-11-18 16:15:14 +00:00
Lungu Cristian eb3ae3c928 Fix send no bonder fee included (#21116) 2024-11-14 18:47:42 +02:00
Yevheniia Berdnyk 3f12c04684 e2e: fix for fallback tests 2024-11-13 19:39:22 +02:00
Sean Hagstrom cf0fba7891 feature!: add maximum character limit to password length (#21593)
This change now limits the password for a profile to be a maximum of a 100 characters.
2024-11-13 09:30:47 -08:00
flexsurfer 9f0fb41713 [#21587] Unsupported light theme on Keycard profile key pair migration (#21588)
[#21586] Keycard migration crashes the app on Android
 [#21601] Keycard is not empty screen appears at the wrong place of migration flow
2024-11-13 11:15:14 +01:00
Mohsen 2a7da758aa [#20828] feat: display toast for all wallet connect actions (#21534) 2024-11-13 12:09:21 +03:00
Parvesh Monu 0f00f8439f Remove onboarding generating keys screen (#21608) 2024-11-13 00:46:59 +05:30
Ulises Manuel 76d6825dd5 fix(communities): incorrect drawer for non community members (#21597)
* Fix wrong community modal shown for non-members

* Fix button overlapped in community chat for non-members

* Fix shown options order in modal
2024-11-12 09:36:17 -06:00
Yevheniia Berdnyk 028f959bc3 e2e: updated onboarding flow 2024-11-12 15:06:23 +05:30
Parvesh Monu bc6de0722f Implement Onboarding - New intro screen 2024-11-12 15:06:09 +05:30
Icaro Motta 3e67a0f163 chore(perf): Do not transform large messenger initialization response to cljs (#21604)
This commit should help with potential freezes right after login, especially in
low-end devices and for users with more data.

The default behavior for the effect :json-rpc/call is to transform the
response to CLJS data using (js->clj data :keywordize-keys true), even if the
result is never used. The problem is that the response from
wakuext_startMessenger can be a very large struct! This PR simply adds the
missing line :js-response true.

https://github.com/status-im/status-mobile/blob/ca22b67d0e82a3cb123be2174b3ef2157e676e08/src/status_im/common/json_rpc/events.cljs#L85-L87

type MessengerResponse struct {
	Contacts                      []*Contact
	Invitations                   []*GroupChatInvitation
	CommunityChanges              []*communities.CommunityChanges
	AnonymousMetrics              []*appmetrics.AppMetric
	Mailservers                   []mailservers.Mailserver
	CommunityStorenodes           []storenodes.Storenode
	Bookmarks                     []*browsers.Bookmark
	Settings                      []*settings.SyncSettingField
	IdentityImages                []images.IdentityImage
	CustomizationColor            string
	WatchOnlyAccounts             []*accounts.Account
	Keypairs                      []*accounts.Keypair
	AccountsPositions             []*accounts.Account
	TokenPreferences              []walletsettings.TokenPreferences
	CollectiblePreferences        []walletsettings.CollectiblePreferences
	DiscordCategories             []*discord.Category
	DiscordChannels               []*discord.Channel
	DiscordOldestMessageTimestamp int
	BackupHandled                 bool

	// notifications a list of notifications derived from messenger events
	// that are useful to notify the user about
	installations                    map[string]*multidevice.Installation
	notifications                    map[string]*localnotifications.Notification
	requestsToJoinCommunity          map[string]*communities.RequestToJoin
	chats                            map[string]*Chat
	removedChats                     map[string]bool
	removedMessages                  map[string]*RemovedMessage
	deletedMessages                  map[string]string
	communities                      map[string]*communities.Community
	communitiesSettings              map[string]*communities.CommunitySettings
	activityCenterNotifications      map[string]*ActivityCenterNotification
	activityCenterState              *ActivityCenterState
	messages                         map[string]*common.Message
	pinMessages                      map[string]*common.PinMessage
	discordMessages                  map[string]*protobuf.DiscordMessage
	discordMessageAttachments        map[string]*protobuf.DiscordMessageAttachment
	discordMessageAuthors            map[string]*protobuf.DiscordMessageAuthor
	currentStatus                    *UserStatus
	statusUpdates                    map[string]UserStatus
	clearedHistories                 map[string]*ClearedHistory
	verificationRequests             map[string]*verification.Request
	trustStatus                      map[string]verification.TrustStatus
	emojiReactions                   map[string]*EmojiReaction
	savedAddresses                   map[string]*wallet.SavedAddress
	ensUsernameDetails               []*ensservice.UsernameDetail
	updatedProfileShowcaseContactIDs map[string]bool
	seenAndUnseenMessages            map[string]*SeenUnseenMessages
}
2024-11-12 05:46:26 -03:00
Icaro Motta 3787ac5b94 chore(url-preview): Remove old/unused code (#21603) 2024-11-11 22:43:44 -03:00
Icaro Motta a60e39cfd5 Update app metadata for Status 2.31.0 in F-Droid (#21606)
- Assets were compressed from Figma exports.
- Locale for Ukrainian fixed: from `uk` to `uk-UA` according to official reference https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/locale_config.xml.
- Titles for each locale are now translated.

Fixes https://github.com/status-im/status-mobile/issues/21605
2024-11-11 10:58:10 -03:00
Brian Sztamfater a7d330ecb3 fix(swap): refetch swap proposal when switching account (#21518)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-11-10 20:16:11 -03:00
Sean Hagstrom ca22b67d0e fix: only display spectated communities in opened tab (#21548)
This change resolves an issue with un-opened, joined, and pending communities being visible inside the "opened" communities tab. With this change, the "opened" community tab will only display spectated (opened) communities that have not been joined or pending to be joined.
2024-11-05 14:18:14 -08:00
flexsurfer 03ec410862 [#21446] Keycard - Current profile key pair migrate (#21558)
[#21470] Keycard - Keycard initialized but has no keys
2024-11-05 14:48:45 +01:00
Parvesh Monu e43a328c6f Improve push notification service initialization (#21553) 2024-11-05 19:10:15 +05:30
Sean Hagstrom cf72bcbe42 Fix appearance of Create Password and Change Password forms (#21544)
This change fixes the appearance of the disclaimer checkbox inside the create/change password forms to use the user's customization color. Additionally, this change also changes the password-hint success icons to use the check-circle because of its solid opacity.
2024-11-04 10:36:06 -08:00
Lungu Cristian 077b885617 Fix wallet action buttons alignment (#21514)
* fix: wallet-ctas dynamic spacing

* fix: updated bridge icon according to designs
2024-11-04 20:01:54 +02:00
Tetiana Churikova 2e42da5996 gh: added Type (#21472) 2024-11-04 16:53:18 +01:00
Tetiana Churikova f6dc9d1ad3 e2e: skipping waku tests and fixes (#21471) 2024-11-04 16:33:03 +01:00
Mohamed Javid 9f1eb60e21 chore_: Remove Goerli code (#21508)
This commit removes the goerli-related code from the mobile repo.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-11-04 18:10:36 +05:30
Mohamed Javid 8e7d5233df fix(wallet)_: Bridging tx improvements (#21523)
This commit fixes two issues faced in L1 to L2 tx:

- fail with 'L1_ETH_BRG: Value does not match amount' error
- reverted tx due to out of gas error

Status go changes: https://github.com/status-im/status-go/pull/6012

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-11-04 15:04:36 +05:30
Mohamed Javid 4f40fda6a3 fix(wallet)_: Chain prefix for ENS resolved address (#21504)
This commit removes chain prefixes being added to ENS resolved address in send flow

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-11-01 21:09:59 +05:30
flexsurfer f0079961f4 [#21316] Keycard - Allow user to migrate existing Profile to the new … (#21467) 2024-11-01 12:48:07 +01:00
Lungu Cristian 9862abb7eb Fix "Failed to get dApps" error when a session expired (#21531)
* fix: pass the topic instead of entire session

* chore: added logs for future debugging
2024-10-30 15:51:26 +02:00
Brian Sztamfater 6d7697870d feat(swap): add metrics for swaps (#21485)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-10-29 12:01:47 -03:00
Parvesh Monu 4f53a2b11e fix No tabs are available in the app on Graphene OS (#21520) 2024-10-29 20:14:26 +05:30
Siddarth Kumar fd9e8273e1 chore(deps)_: use gradle plugin to get deps (#21502)
related issue : https://github.com/status-im/status-mobile/issues/15447

This commit makes use of https://github.com/gradle/github-dependency-graph-gradle-plugin to generate deps so that we may get rid of the AWK script that parses `gradle` output to figure out `gradle` dependencies.

credits to Vedran for doing initial research on this dependency generator plugin.

We still miss a few dependencies and are not completely able to get rid of the hack list step just yet.

I also moved `react-native-share` out of  `pluginManagement ` block in `android/settings.gradle` because it does not belong there.
2024-10-29 11:39:50 +05:30
Parvesh Monu 6afaba23b5 fix Error when creating an account on e2e build (#21496) 2024-10-29 00:54:07 +05:30
Mohamed Javid 4aef76281c fix(wallet-settings)_: Icon color in missing keypair section (#21498)
This commit fixes the icon color in the missing keypair section

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-10-28 15:53:25 +05:30
Mohamed Javid c62d7d501e fix(wallet)_: token supported networks (#21451)
This commit 
- fixes the networks/chains supported by the token based on the token list fetched from status-go instead of relying on the balance-per-chain map as status-go returns balance for chains only if there is a positive balance
- adds supported-networks key to token data map for network details

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-10-24 16:00:18 +05:30
Sean Hagstrom 65cdb0dfe7 chore: refactor screens definitions and add more navigation events for screens (#21328)
This change refactors the navigation-screens namespace to organise each screen definition into a group based on the app features. It also adds some metrics tracking to all the of the screens defined in the navigation-screens namespace. 

Additionally, in this change we've introduced a new build configuration for shadow-cljs which allows us to conditionally include code for certain shadow-cljs builds. In this case, we've decided to only exclude the metrics re-frame interceptor from being required when running the component-tests build. This is due to a complication with the metrics interceptor depending on the navigation-screens namespace, which would eventually require many other third-party dependencies that do not have mocks defined for the component tests. To avoid defining more mocks, we've avoided requiring the metrics interceptor for now.
2024-10-23 08:28:41 -07:00
Mohsen ea18966f33 [#21439] fix: close swap flow after confirmation (#21466)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-10-23 11:41:36 -03:00
Icaro Motta e1abe5c6e2 feat(onboarding): Present Terms to users upgrading from v1 or those who need to accept updated Terms (#21487)
Cherry-pick https://github.com/status-im/status-mobile/commit/d45eb5ec20ae7757cd99554920e466eabac0bfb1.

Fixes https://github.com/status-im/status-mobile/issues/21113

Related status-go PR: https://github.com/status-im/status-go/pull/5977
2024-10-23 11:26:29 -03:00
Siddarth Kumar cac96b589f chore(ci)_: bump universal apk size limit to 125MB (#21486) 2024-10-23 12:45:59 +05:30
Volodymyr Kozieiev f8d4f56d2d collectible metrics (#21280) 2024-10-22 16:10:14 +01:00
Mohamed Javid 0957fb6e0a fix(wallet)_: Activity tab is selected on navigating back from the swap flow (#21474)
This commit fixes activity tab is selected when navigating back from the swap flow

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-10-22 18:55:19 +05:30
Lungu Cristian 5118a5095d Fix networks on select asset screen (#21403)
* fix: filter tokens by balance on select asset

* feat: added network-list-with-positive-balance

* fix: swaps error when using networks with balance

* fix: hide send/bridge/swap when no token balance
2024-10-22 15:55:37 +03:00
Andrey Bocharnikov 01c5cf2498 fix: client should pass a list with "Symbol" and without "ChainID-" prefix to wallet_fetchMarketValues, wallet_fetchPrices (#21453)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-10-22 09:15:47 -03:00
488 changed files with 10337 additions and 9388 deletions
+1 -2
View File
@@ -1,6 +1,5 @@
CACHED_WEBVIEWS_ENABLED=1
DEBUG_WEBVIEW=1
DEFAULT_NETWORK=mainnet_rpc
DEV_BUILD=1
ETHEREUM_DEV_CLUSTER=1
EXTENSIONS=0
@@ -36,4 +35,4 @@ TEST_NETWORKS_ENABLED=1
SHOW_NOT_IMPLEMENTED_FEATURES=0
ENABLE_ALERT_BANNER=0
FLAG_WALLET_CONNECT_ENABLED=1
LOG_REQUEST_GO=1
API_LOGGING_ENABLED=1
+3 -4
View File
@@ -1,5 +1,4 @@
DEBUG_WEBVIEW=1
DEFAULT_NETWORK=goerli_rpc
ETHEREUM_DEV_CLUSTER=1
EXTENSIONS=0
FLEET=status.staging
@@ -22,8 +21,8 @@ KEYCARD_TEST_MENU=1
QR_READ_TEST_MENU=1
ENABLE_ROOT_ALERT=0
APN_TOPIC=im.status.ethereum.pr
VERIFY_TRANSACTION_CHAIN_ID=5
VERIFY_ENS_CHAIN_ID=5
VERIFY_TRANSACTION_CHAIN_ID=11155111
VERIFY_ENS_CHAIN_ID=11155111
TEST_STATEOFUS=1
DATABASE_MANAGEMENT_ENABLED=1
COMMUNITIES_ENABLED=1
@@ -40,4 +39,4 @@ DELETE_MESSAGE_UNDO_TIME_LIMIT=10000
ENABLE_ALERT_BANNER=0
FLAG_WALLET_CONNECT_ENABLED=1
MOBILE_DATA_SYNCING_TOGGLE_ENABLE=0
LOG_REQUEST_GO=1
API_LOGGING_ENABLED=1
+3 -4
View File
@@ -1,6 +1,5 @@
CACHED_WEBVIEWS_ENABLED=1
DEBUG_WEBVIEW=1
DEFAULT_NETWORK=goerli_rpc
ETHEREUM_DEV_CLUSTER=1
EXTENSIONS=0
GROUP_CHATS_ENABLED=1
@@ -21,8 +20,8 @@ KEYCARD_TEST_MENU=0
ENABLE_ROOT_ALERT=1
DISABLE_WALLET_ON_MOBILE_NETWORK=1
APN_TOPIC=im.status.ethereum.pr
VERIFY_TRANSACTION_CHAIN_ID=5
VERIFY_ENS_CHAIN_ID=5
VERIFY_TRANSACTION_CHAIN_ID=11155111
VERIFY_ENS_CHAIN_ID=11155111
TEST_STATEOFUS=1
BLANK_PREVIEW=0
DATABASE_MANAGEMENT_ENABLED=1
@@ -37,4 +36,4 @@ FAST_CREATE_COMMUNITY_ENABLED=1
TEST_NETWORKS_ENABLED=1
ENABLE_ALERT_BANNER=1
FLAG_WALLET_CONNECT_ENABLED=1
LOG_REQUEST_GO=1
API_LOGGING_ENABLED=1
+1 -2
View File
@@ -1,5 +1,4 @@
DEBUG_WEBVIEW=1
DEFAULT_NETWORK=mainnet_rpc
ETHEREUM_DEV_CLUSTER=1
EXTENSIONS=0
GROUP_CHATS_ENABLED=1
@@ -24,4 +23,4 @@ FAST_CREATE_COMMUNITY_ENABLED=0
TEST_NETWORKS_ENABLED=0
ENABLE_ALERT_BANNER=1
FLAG_WALLET_CONNECT_ENABLED=1
LOG_REQUEST_GO=0
API_LOGGING_ENABLED=0
+1 -2
View File
@@ -1,5 +1,4 @@
DEBUG_WEBVIEW=0
DEFAULT_NETWORK=mainnet_rpc
ETHEREUM_DEV_CLUSTER=0
EXTENSIONS=0
GROUP_CHATS_ENABLED=1
@@ -21,4 +20,4 @@ FAST_CREATE_COMMUNITY_ENABLED=0
TEST_NETWORKS_ENABLED=0
STATUS_PROXY_STAGE_NAME=prod
FLAG_WALLET_CONNECT_ENABLED=1
LOG_REQUEST_GO=0
API_LOGGING_ENABLED=0
+1 -1
View File
@@ -2,7 +2,7 @@
name: Bug Report
about: Bug Report
title: ''
labels: ['bug', ':1234: low prio']
type: 'Bug'
assignees: ''
---
+3
View File
@@ -0,0 +1,3 @@
[submodule "legal-docs"]
path = legal-docs
url = https://github.com/status-im/status-software-legal-documents.git
+3 -1
View File
@@ -1,6 +1,8 @@
{
"ignore_dirs": [
"android/build",
"target"
"target",
".clj-kondo",
".shadow-cljs"
]
}
+1 -1
View File
@@ -1 +1 @@
2.31.1
2.32.0
+1 -1
View File
@@ -92,7 +92,7 @@ For particular example it was failed on `Recover access(password:qwerty, keycard
Not all features of the app could be covered by e2e at the moment:
- Colours or place of an element on UI.
- Real ETH/token transactions. Thats the main reason we have separate .apk build for automation needs - it defaults to Goerli network. Also it has enabled keycard test menu, ENS names and chat commands are also on Goerli network (the same in PR builds, but not in nightlies / release)
- Real ETH/token transactions. Thats the main reason we have separate .apk build for automation needs - it defaults to Sepolia network. Also it has enabled keycard test menu, ENS names and chat commands are also on Sepolia network (the same in PR builds, but not in nightlies / release)
- Autologin/Biometric related actions (autologin available when device meets certain conditions like the it has set unlock password and device is not rooted: all emulators are rooted in SauceLabs)
## Brief flow for test to be automated
+61
View File
@@ -0,0 +1,61 @@
## What is Status Backend Server
Status Backend Server is a http server that runs status-go, it exposed endpoints come from [mobile/status.go](https://github.com/status-im/status-go/blob/master/mobile/status.go) so that you can call them through http requests. It brings the following benefits:
- When verifying changes made in status-go, you only need to run these commands once (unless modifying Kotlin/Objective-C code):
- `make clean && make run-clojure`
- `make run-android` or `make run-ios`
This avoids repeatedly rebuilding and saves development time.
- Debug status-go while running status mobile app
## Solution to use Status Backend Server for mobile development
`StatusBackendClient` is the entry point to use Status Backend Server. We need always to call `status-im.setup.status-backend-client/init` whether `STATUS_BACKEND_SERVER_ENABLED` is `1` or not. If it's not enabled, the invocation to functions in `native-module.core` will be delegated to built-in status-go library, otherwise it will be delegated to status-go running in status-backend server. Currently, all functions has usages in `native-module.core` should be supported delegated to.
NOTE: not all the native functions used `StatusBackendClient`, only the corresponding functions in `native-module.core` has usages should be supported delegated to ATM.
related [PR](https://github.com/status-im/status-mobile/pull/21550)
## Usage
### Add environment variables to your local machine:
```shell
# enable using status backend server or not, otherwise it will use built-in status-go library
export STATUS_BACKEND_SERVER_ENABLED=1
#The host should contain an IP address and a port separated by a colon.
#The port comes from your running status backend server.
#If you run it by PORT=60000 make run-status-backend , then host will likely be 127.0.0.1:60000
export STATUS_BACKEND_SERVER_HOST="127.0.0.1:60000"
export STATUS_BACKEND_SERVER_ROOT_DATA_DIR="/path/to/your/root/data/dir"
```
You need to change `STATUS_BACKEND_SERVER_ROOT_DATA_DIR` to your preferred directory and ensure it exists, it should be in absolute path.
All the db files and log files(api.log/geth.log) and keystore files etc will be stored in this directory.
### Start the status backend server:
```shell
PORT=60000 make run-status-backend
```
MAKE SURE the status-backend is checked out to a revision that's at least compatible with the revision in status-mobile/status-go-version.json before starting the server.
For the Android simulator, you need to reverse the port:
```shell
adb reverse tcp:60000 tcp:60000
```
However, there is restriction when use adb reverse, we use random port for media server. So I'd suggest use "10.0.2.2:60000" as `STATUS_BACKEND_SERVER_HOST`.
### Debug status-go using IDEA
Assume you've already set up the development environment for status-go, open status-go project use IDEA, run `make generate` with terminal in the status-go project root directory to ensure all the generated files are up to date, then open `cmd/status-backend/main.go` file, navigate to function `main()`, click the green play button on the left of `main()`, choose `Modify Run Configuration`, in `Program arguments` section, add `--address=localhost:60000 --media-https=false`, then click `OK`, finally click the green play button on the left of `main()` again and choose `Debug ...`.
Basically, you don't have to run `make generate` again and again, just run it once at the beginning. So you can re-run and debug it faster!
## Known Android simulator issues
- Issue#1: Android simulator may not display images due to TLS certificate validation issues with the image server
- solution: use http instead of https for media server with set env: `export STATUS_BACKEND_SERVER_MEDIA_SERVER_ENABLE_TLS=0`, you also need to set env variable `STATUS_BACKEND_SERVER_IMAGE_SERVER_URI_PREFIX` to "http://10.0.2.2:" so that `image_server.cljs` can work, and to make `/accountInitials` work, you need to copy `Inter-Medium.ttf` to your host machine from the android simulator, let's say you store it in `/Users/mac/Downloads/Inter-Medium.ttf`, then you need to update `get-font-file-ready` manually in `image_server.cljs` to return the correct path so that status backend server can access it.
- Issue#2: exportUnencryptedDatabaseV2/import-multiaccount does not work for android, probably cause of tech debt, I found it during creating the draft PR.
- Issue#3: unable to invoke `multiaccounts_storeIdentityImage` to change avatar image.
- The reason is that we path the absolute path of the image to the backend server, but the image file is stored in the android simulator. the backend server cannot access it as it runs in the host machine.
If you're using ios simulator, you can skip above issues!
## Details for issue#1 if you're interested
- we use `react-native-fast-image` which use okhttpclient behind
- we were using custom cert for https
- we fetch the custom cert through endpoint `ImageServerTLSCert`
- we fetched it through built-in status-go before, now we need to fetch it through status backend server
- we expect `OkHttpClientProvider.setOkHttpClientFactory(StatusOkHttpClientFactory())` to be invoked early(will trigger fetching wrong custom cert via built-in status-go since StatusBackendClient is not initialised yet!) in `MainApplication.kt` before executing clojure code, otherwise we will get black screen after `make run-android` . After deep research, I found there's no way to update the cert okhttpclient used to the correct one return from status backend server
@@ -6,13 +6,13 @@ SECURE ETHEREUM WALLET
The Status crypto wallet allows you to securely send, store, and exchange Ethereum assets such as ETH, SNT, stable coins such as DAI, as well as collectibles. Confidently take control of your cryptocurrency and digital assets with our multichain Ethereum wallet app, supporting mainnet, Arbitrum, and Optimism. The Status blockchain wallet currently only supports ETH, ERC-20, ERC-721, and ERC-1155 assets; it does not support Bitcoin.
PRIVATE MESSENGER
Send private 1:1 and private group chats without anyone snooping on your communications. Status is a messenger app that eliminates centralised message relays for greater privacy and secure messaging. All messages are encrypted with end-to-end encryption. Additionally, no message exposes who the author or the intended recipient is, so nobody, not even Status, knows who is talking to who or what was said.
Send private 1:1 and private group chats without anyone snooping on your communications. Status is a messenger app that eliminates centralized message relays for greater privacy and secure messaging. All messages are encrypted with end-to-end encryption. Additionally, no message exposes who the author or the intended recipient is, so nobody, not even Status, knows who is talking to who or what was said.
EARN WITH DEFI
Put your crypto to work with the latest decentralised finance apps and decentralised exchanges (DEX) such as Maker, Aave, Uniswap, Synthetix, PoolTogether, Zerion, Kyber, and more.
Put your crypto to work with the latest decentralized finance apps and decentralized exchanges (DEX) such as Maker, Aave, Uniswap, Synthetix, PoolTogether, Zerion, Kyber, and more.
CONNECT WITH YOUR COMMUNITY
Explore, connect, and chat with your favourite communities and friends. Whether it is a small group of friends, an artist collective, crypto traders, or the next big organization - text and communicate with Status communities.
Explore, connect, and chat with your favorite communities and friends. Whether it is a small group of friends, an artist collective, crypto traders, or the next big organization - text and communicate with Status communities.
PRIVATE ACCOUNT CREATION
Stay private with pseudo-anonymous account creation. When creating your free account, you will NEVER have to enter a phone number, email address, or bank account. Your wallet private keys are locally generated and securely stored to ensure only you have access to your funds and financial transactions.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 192 KiB

Before

Width:  |  Height:  |  Size: 272 KiB

After

Width:  |  Height:  |  Size: 272 KiB

Before

Width:  |  Height:  |  Size: 263 KiB

After

Width:  |  Height:  |  Size: 263 KiB

Before

Width:  |  Height:  |  Size: 396 KiB

After

Width:  |  Height:  |  Size: 396 KiB

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 222 KiB

Before

Width:  |  Height:  |  Size: 262 KiB

After

Width:  |  Height:  |  Size: 262 KiB

Before

Width:  |  Height:  |  Size: 202 KiB

After

Width:  |  Height:  |  Size: 202 KiB

Before

Width:  |  Height:  |  Size: 425 KiB

After

Width:  |  Height:  |  Size: 425 KiB

+3 -2
View File
@@ -57,10 +57,11 @@ abstract_target 'Status' do
pod 'react-native-config', :path => '../node_modules/react-native-config'
pod 'SSZipArchive', '2.4.3'
# to fix [!] CocoaPods could not find compatible versions for pod "CryptoSwift"
pod 'CryptoSwift', git: "https://github.com/krzyzanowskim/CryptoSwift", tag: '1.8.0'
pod "react-native-status-keycard", path: "../node_modules/react-native-status-keycard"
pod "react-native-status", path: "../modules/react-native-status"
pod "Keycard", git: "https://github.com/status-im/Keycard.swift.git"
pod "Keycard", git: "https://github.com/status-im/Keycard.swift.git", tag: '3.1.1'
pod 'secp256k1', git: "https://github.com/status-im/secp256k1.swift.git", submodules: true
target 'StatusIm' do
+21 -10
View File
@@ -1,6 +1,7 @@
PODS:
- BigInt (5.2.0)
- boost (1.83.0)
- CryptoSwift (1.5.1)
- CryptoSwift (1.8.0)
- DoubleConversion (1.1.6)
- FBLazyVector (0.73.5)
- FBReactNativeSpec (0.73.5):
@@ -16,7 +17,8 @@ PODS:
- hermes-engine/Pre-built (= 0.73.5)
- hermes-engine/Pre-built (0.73.5)
- HMSegmentedControl (1.5.6)
- Keycard (3.0.6):
- Keycard (3.1.0):
- BigInt
- CryptoSwift
- secp256k1
- SSZipArchive
@@ -943,7 +945,7 @@ PODS:
- React
- react-native-status (1.0.0):
- React
- react-native-status-keycard (2.5.39):
- react-native-status-keycard (2.6.2):
- Keycard
- React
- react-native-webview (13.6.3):
@@ -1192,12 +1194,13 @@ PODS:
DEPENDENCIES:
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
- CryptoSwift (from `https://github.com/krzyzanowskim/CryptoSwift`, tag `1.8.0`)
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
- Keycard (from `https://github.com/status-im/Keycard.swift.git`)
- Keycard (from `https://github.com/status-im/Keycard.swift.git`, tag `3.1.1`)
- libevent (~> 2.1.12)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCT-Folly/Fabric (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
@@ -1285,7 +1288,7 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- CryptoSwift
- BigInt
- fmt
- HMSegmentedControl
- libevent
@@ -1299,6 +1302,9 @@ SPEC REPOS:
EXTERNAL SOURCES:
boost:
:podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
CryptoSwift:
:git: https://github.com/krzyzanowskim/CryptoSwift
:tag: 1.8.0
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
FBLazyVector:
@@ -1312,6 +1318,7 @@ EXTERNAL SOURCES:
:tag: hermes-2024-02-20-RNv0.73.5-18f99ace4213052c5e7cdbcd39ee9766cd5df7e4
Keycard:
:git: https://github.com/status-im/Keycard.swift.git
:tag: 3.1.1
RCT-Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
RCTRequired:
@@ -1475,17 +1482,21 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"
CHECKOUT OPTIONS:
CryptoSwift:
:git: https://github.com/krzyzanowskim/CryptoSwift
:tag: 1.8.0
Keycard:
:commit: 17381678bb981c3c553bb7202a26e642cecb1817
:git: https://github.com/status-im/Keycard.swift.git
:tag: 3.1.1
secp256k1:
:commit: 46a1fa30d9b8babeae85ff519050f42394ab5fcc
:git: https://github.com/status-im/secp256k1.swift.git
:submodules: true
SPEC CHECKSUMS:
BigInt: f668a80089607f521586bbe29513d708491ef2f7
boost: d3f49c53809116a5d38da093a8aa78bf551aed09
CryptoSwift: c4f2debceb38bf44c80659afe009f71e23e4a082
CryptoSwift: 52aaf3fce7337552863b1d952e408085f0e65030
DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953
FBLazyVector: 56e0e498dbb513b96c40bac6284729ba4e62672d
FBReactNativeSpec: 146c741a3f40361f6bc13a4ba284678cbedb5881
@@ -1493,7 +1504,7 @@ SPEC CHECKSUMS:
glog: c0eca6ffed0a6fde1965ef26dcc7bf528f052af4
hermes-engine: 1d1835b2cc54c381909d94d1b3c8e0a2f1a94a0e
HMSegmentedControl: 34c1f54d822d8308e7b24f5d901ec674dfa31352
Keycard: ac6df4d91525c3c82635ac24d4ddd9a80aca5fc8
Keycard: 3bd24405b9a875b3b3cf1ab1be69b5c30c5f28bc
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0
@@ -1534,7 +1545,7 @@ SPEC CHECKSUMS:
react-native-shake: de052eaa3eadc4a326b8ddd7ac80c06e8d84528c
react-native-slider: 12bd76d3d568c9c5500825db54123d44b48e4ad4
react-native-status: 21f75d492fd311dc111303da38a7a2b23a8a8466
react-native-status-keycard: f1c1227b2d5984c10fb44db68e4bfd2937f31e98
react-native-status-keycard: 76a5c826352ee1d70de854b3e8b12670946bc1c8
react-native-webview: 88293a0f23eca8465c0433c023ec632930e644d0
React-nativeconfig: 1166714a4f7ea57a0df5c2cb44fbc70f98d580f9
React-NativeModulesApple: 726664e9829eb5eed8170241000e46ead269a05f
@@ -1582,6 +1593,6 @@ SPEC CHECKSUMS:
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
Yoga: a716eea57d0d3430219c0a5a233e1e93ee931eb7
PODFILE CHECKSUM: 5dd4a5279260d370bcdf016158c825ceb404ee06
PODFILE CHECKSUM: 81a66b45adddb083171ade882c343deb4faf2a8b
COCOAPODS: 1.15.2
+8 -1
View File
@@ -29,6 +29,8 @@
#import <Security/Security.h>
#import <react/config/ReactNativeConfig.h>
#import "StatusBackendClient.h"
//TODO: properly import the framework
extern "C" NSString* StatusgoImageServerTLSCert();
@@ -188,7 +190,12 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge;
__block NSURLCredential *credential = nil;
NSString *pemCert = StatusgoImageServerTLSCert();
NSString *pemCert = [StatusBackendClient executeStatusGoRequestWithResult:@"ImageServerTLSCert"
body:@""
statusgoFunction:^NSString *{
return StatusgoImageServerTLSCert();
}];
pemCert = [pemCert stringByReplacingOccurrencesOfString:@"-----BEGIN CERTIFICATE-----\n" withString:@""];
pemCert = [pemCert stringByReplacingOccurrencesOfString:@"\n-----END CERTIFICATE-----" withString:@""];
NSData *derCert = [[NSData alloc] initWithBase64EncodedString:pemCert options:NSDataBase64DecodingIgnoreUnknownCharacters];
Submodule
+1
Submodule legal-docs added at 144f64af0d
@@ -24,25 +24,23 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC
@ReactMethod
fun createAccountAndLogin(createAccountRequest: String) {
Log.d(TAG, "createAccountAndLogin")
val result = Statusgo.createAccountAndLogin(createAccountRequest)
if (result.startsWith("{\"error\":\"\"")) {
Log.d(TAG, "createAccountAndLogin success: $result")
Log.d(TAG, "Geth node started")
} else {
Log.e(TAG, "createAccountAndLogin failed: $result")
}
StatusBackendClient.executeStatusGoRequest(
endpoint = "CreateAccountAndLogin",
requestBody = createAccountRequest,
statusgoFunction = { Statusgo.createAccountAndLogin(createAccountRequest) }
)
}
@ReactMethod
fun restoreAccountAndLogin(restoreAccountRequest: String) {
Log.d(TAG, "restoreAccountAndLogin")
val result = Statusgo.restoreAccountAndLogin(restoreAccountRequest)
if (result.startsWith("{\"error\":\"\"")) {
Log.d(TAG, "restoreAccountAndLogin success: $result")
Log.d(TAG, "Geth node started")
} else {
Log.e(TAG, "restoreAccountAndLogin failed: $result")
}
StatusBackendClient.executeStatusGoRequest(
endpoint = "RestoreAccountAndLogin",
requestBody = restoreAccountRequest,
statusgoFunction = { Statusgo.restoreAccountAndLogin(restoreAccountRequest) }
)
}
private fun updateConfig(jsonConfigString: String, absRootDirPath: String, keystoreDirPath: String): String {
@@ -173,12 +171,7 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC
accountsData,
chatKey
)
if (result.startsWith("{\"error\":\"\"")) {
Log.d(TAG, "saveAccountAndLoginWithKeycard result: $result")
Log.d(TAG, "Geth node started")
} else {
Log.e(TAG, "saveAccountAndLoginWithKeycard failed: $result")
}
utils.handleStatusGoResponse(result, "saveAccountAndLoginWithKeycard")
} catch (e: JSONException) {
Log.e(TAG, "JSON conversion failed: ${e.message}")
}
@@ -189,11 +182,7 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC
Log.d(TAG, "loginWithKeycard")
utils.migrateKeyStoreDir(accountData, password)
val result = Statusgo.loginWithKeycard(accountData, password, chatKey, nodeConfigJSON)
if (result.startsWith("{\"error\":\"\"")) {
Log.d(TAG, "LoginWithKeycard result: $result")
} else {
Log.e(TAG, "LoginWithKeycard failed: $result")
}
utils.handleStatusGoResponse(result, "loginWithKeycard")
}
@ReactMethod
@@ -201,22 +190,17 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC
Log.d(TAG, "loginWithConfig")
utils.migrateKeyStoreDir(accountData, password)
val result = Statusgo.loginWithConfig(accountData, password, configJSON)
if (result.startsWith("{\"error\":\"\"")) {
Log.d(TAG, "LoginWithConfig result: $result")
} else {
Log.e(TAG, "LoginWithConfig failed: $result")
}
utils.handleStatusGoResponse(result, "loginWithConfig")
}
@ReactMethod
fun loginAccount(request: String) {
Log.d(TAG, "loginAccount")
val result = Statusgo.loginAccount(request)
if (result.startsWith("{\"error\":\"\"")) {
Log.d(TAG, "loginAccount result: $result")
} else {
Log.e(TAG, "loginAccount failed: $result")
}
StatusBackendClient.executeStatusGoRequest(
endpoint = "LoginAccount",
requestBody = request,
statusgoFunction = { Statusgo.loginAccount(request) }
)
}
@ReactMethod
@@ -224,16 +208,31 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC
val absRootDirPath = utils.getNoBackupDirectory()
val newKeystoreDir = utils.pathCombine(absRootDirPath, "keystore")
utils.executeRunnableStatusGoMethod(
{ Statusgo.verifyAccountPassword(newKeystoreDir, address, password) },
val jsonParams = JSONObject()
jsonParams.put("keyStoreDir", newKeystoreDir)
jsonParams.put("address", address)
jsonParams.put("password", password)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "VerifyAccountPasswordV2",
requestBody = jsonParams.toString(),
statusgoFunction = { Statusgo.verifyAccountPasswordV2(jsonParams.toString()) },
callback
)
}
@ReactMethod
fun verifyDatabasePassword(keyUID: String, password: String, callback: Callback) {
utils.executeRunnableStatusGoMethod(
{ Statusgo.verifyDatabasePassword(keyUID, password) },
val jsonParams = JSONObject()
jsonParams.put("keyUID", keyUID)
jsonParams.put("password", password)
val jsonString = jsonParams.toString()
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "VerifyDatabasePasswordV2",
requestBody = jsonString,
statusgoFunction = { Statusgo.verifyDatabasePasswordV2(jsonString) },
callback
)
}
@@ -249,79 +248,140 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC
@ReactMethod
private fun initializeApplication(request: String, callback: Callback) {
Log.d(TAG, "initializeApplication")
Log.d(TAG, "[Initializing application $request")
utils.executeRunnableStatusGoMethod({ Statusgo.initializeApplication(request) }, callback)
val jsonParams = JSONObject(request)
// for ios, the log dir will be the same as the root data dir, status-go will default to root data dir if logDir is not provided
jsonParams.put("logDir", utils.getPublicStorageDirectory()?.absolutePath)
val jsonString = jsonParams.toString()
StatusBackendClient.executeStatusGoRequestWithCallback(
"InitializeApplication",
jsonString,
{ Statusgo.initializeApplication(jsonString) },
callback
)
}
@ReactMethod
private fun acceptTerms(callback: Callback) {
Log.d(TAG, "acceptTerms")
utils.executeRunnableStatusGoMethod({ Statusgo.acceptTerms() }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
"AcceptTerms",
"",
{ Statusgo.acceptTerms() },
callback
)
}
@ReactMethod
fun logout() {
Log.d(TAG, "logout")
val runnable = Runnable {
val result = Statusgo.logout()
if (result.startsWith("{\"error\":\"\"")) {
Log.d(TAG, "Logout result: $result")
} else {
Log.e(TAG, "Logout failed: $result")
}
}
StatusThreadPoolExecutor.getInstance().execute(runnable)
StatusBackendClient.executeStatusGoRequest(
endpoint = "Logout",
requestBody = "",
statusgoFunction = { Statusgo.logout() }
)
}
@ReactMethod
fun multiAccountStoreAccount(json: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.multiAccountStoreAccount(json) }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "MultiAccountStoreAccount",
requestBody = json,
statusgoFunction = { Statusgo.multiAccountStoreAccount(json) },
callback = callback
)
}
@ReactMethod
fun multiAccountLoadAccount(json: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.multiAccountLoadAccount(json) }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "MultiAccountLoadAccount",
requestBody = json,
statusgoFunction = { Statusgo.multiAccountLoadAccount(json) },
callback = callback
)
}
@ReactMethod
fun multiAccountDeriveAddresses(json: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.multiAccountDeriveAddresses(json) }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "MultiAccountDeriveAddresses",
requestBody = json,
statusgoFunction = { Statusgo.multiAccountDeriveAddresses(json) },
callback = callback
)
}
@ReactMethod
fun multiAccountGenerateAndDeriveAddresses(json: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.multiAccountGenerateAndDeriveAddresses(json) }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "MultiAccountGenerateAndDeriveAddresses",
requestBody = json,
statusgoFunction = { Statusgo.multiAccountGenerateAndDeriveAddresses(json) },
callback = callback
)
}
@ReactMethod
fun multiAccountStoreDerived(json: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.multiAccountStoreDerivedAccounts(json) }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "MultiAccountStoreDerivedAccounts",
requestBody = json,
statusgoFunction = { Statusgo.multiAccountStoreDerivedAccounts(json) },
callback = callback
)
}
@ReactMethod
fun multiAccountImportMnemonic(json: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.multiAccountImportMnemonic(json) }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "MultiAccountImportMnemonic",
requestBody = json,
statusgoFunction = { Statusgo.multiAccountImportMnemonic(json) },
callback = callback
)
}
@ReactMethod
fun multiAccountImportPrivateKey(json: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.multiAccountImportPrivateKey(json) }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "MultiAccountImportPrivateKey",
requestBody = json,
statusgoFunction = { Statusgo.multiAccountImportPrivateKey(json) },
callback = callback
)
}
@ReactMethod
fun deleteMultiaccount(keyUID: String, callback: Callback) {
val keyStoreDir = utils.getKeyStorePath(keyUID)
utils.executeRunnableStatusGoMethod({ Statusgo.deleteMultiaccount(keyUID, keyStoreDir) }, callback)
val params = JSONObject().apply {
put("keyUID", keyUID)
put("keyStoreDir", keyStoreDir)
}
val jsonString = params.toString()
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "DeleteMultiaccountV2",
requestBody = jsonString,
statusgoFunction = { Statusgo.deleteMultiaccountV2(jsonString) },
callback
)
}
@ReactMethod
fun getRandomMnemonic(callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.getRandomMnemonic() }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
"GetRandomMnemonic",
"",
{ Statusgo.getRandomMnemonic() },
callback
)
}
@ReactMethod
fun createAccountFromMnemonicAndDeriveAccountsForPaths(mnemonic: String, callback: Callback) {
utils.executeRunnableStatusGoMethod(
StatusBackendClient.executeStatusGoRequestWithCallback(
"CreateAccountFromMnemonicAndDeriveAccountsForPaths",
mnemonic,
{ Statusgo.createAccountFromMnemonicAndDeriveAccountsForPaths(mnemonic) },
callback
)
@@ -329,7 +389,12 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC
@ReactMethod
fun createAccountFromPrivateKey(json: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.createAccountFromPrivateKey(json) }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "CreateAccountFromPrivateKey",
requestBody = json,
statusgoFunction = { Statusgo.createAccountFromPrivateKey(json) },
callback = callback
)
}
companion object {
@@ -9,6 +9,8 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import statusgo.Statusgo
import java.io.File
import org.json.JSONObject
import org.json.JSONException
class DatabaseManager(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
@@ -17,22 +19,43 @@ class DatabaseManager(private val reactContext: ReactApplicationContext) : React
override fun getName() = "DatabaseManager"
private fun getExportDBFile(): File {
StatusBackendClient.getInstance()?.let {
if (it.serverEnabled) {
return File(it.rootDataDir, exportDBFileName)
}
}
val pubDirectory = reactContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)
return File(pubDirectory, exportDBFileName)
}
@ReactMethod
fun exportUnencryptedDatabase(accountData: String, password: String, callback: Callback) {
Log.d(TAG, "login")
Log.d(TAG, "exportUnencryptedDatabase")
val newFile = getExportDBFile()
utils.migrateKeyStoreDir(accountData, password)
val result = Statusgo.exportUnencryptedDatabase(accountData, password, newFile.absolutePath)
if (result.startsWith("{\"error\":\"\"")) {
Log.d(TAG, "Login result: $result")
} else {
Log.e(TAG, "Login failed: $result")
try {
val accountJson = JSONObject(accountData)
val params = JSONObject().apply {
put("account", accountJson)
put("password", password)
put("databasePath", newFile.absolutePath)
}
val jsonParams = params.toString()
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "ExportUnencryptedDatabaseV2",
requestBody = jsonParams,
statusgoFunction = { Statusgo.exportUnencryptedDatabaseV2(jsonParams) },
callback = null
)
callback.invoke(newFile.absolutePath)
} catch (e: JSONException) {
Log.e(TAG, "Error parsing account data: ${e.message}")
}
}
@@ -43,11 +66,25 @@ class DatabaseManager(private val reactContext: ReactApplicationContext) : React
val newFile = getExportDBFile()
utils.migrateKeyStoreDir(accountData, password)
val result = Statusgo.importUnencryptedDatabase(accountData, password, newFile.absolutePath)
if (result.startsWith("{\"error\":\"\"")) {
Log.d(TAG, "import result: $result")
} else {
Log.e(TAG, "import failed: $result")
try {
val accountJson = JSONObject(accountData)
val params = JSONObject().apply {
put("account", accountJson)
put("password", password)
put("databasePath", newFile.absolutePath)
}
val jsonParams = params.toString()
StatusBackendClient.executeStatusGoRequest(
endpoint = "ImportUnencryptedDatabaseV2",
requestBody = jsonParams,
statusgoFunction = { Statusgo.importUnencryptedDatabaseV2(jsonParams) }
)
} catch (e: JSONException) {
Log.e(TAG, "Error parsing account data: ${e.message}")
}
}
@@ -7,6 +7,7 @@ import com.facebook.react.bridge.Callback;
import android.util.Log;
import statusgo.Statusgo;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.function.Function;
import android.app.Activity;
import android.view.WindowManager;
@@ -39,67 +40,151 @@ public class EncryptionUtils extends ReactContextBaseJavaModule {
final String commonKeydir = this.utils.pathCombine(this.utils.getNoBackupDirectory(), "/keystore");
final String keydir = this.utils.pathCombine(commonKeydir, keyUID);
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.initKeystore(keydir), callback);
StatusBackendClient.executeStatusGoRequestWithCallback(
"InitKeystore",
keydir,
() -> Statusgo.initKeystore(keydir),
callback
);
}
@ReactMethod
public void reEncryptDbAndKeystore(final String keyUID, final String password, final String newPassword, final Callback callback) throws JSONException {
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.changeDatabasePassword(keyUID, password, newPassword), callback);
JSONObject params = new JSONObject();
params.put("keyUID", keyUID);
params.put("oldPassword", password);
params.put("newPassword", newPassword);
String jsonParams = params.toString();
StatusBackendClient.executeStatusGoRequestWithCallback(
"ChangeDatabasePasswordV2",
jsonParams,
() -> Statusgo.changeDatabasePasswordV2(jsonParams),
callback
);
}
@ReactMethod
public void convertToKeycardAccount(final String keyUID, final String accountData, final String options, final String keycardUID, final String password,
final String newPassword, final Callback callback) throws JSONException {
final String keyStoreDir = this.utils.getKeyStorePath(keyUID);
this.utils.executeRunnableStatusGoMethod(() -> {
Statusgo.initKeystore(keyStoreDir);
return Statusgo.convertToKeycardAccount(accountData, options, keycardUID, password, newPassword);
}, callback);
JSONObject params = new JSONObject();
params.put("keyUID", keyUID);
params.put("account", new JSONObject(accountData));
params.put("settings", new JSONObject(options));
params.put("keycardUID", keycardUID);
params.put("oldPassword", password);
params.put("newPassword", newPassword);
final String jsonParams = params.toString();
StatusBackendClient.executeStatusGoRequest(
"InitKeystore",
keyStoreDir,
() -> Statusgo.initKeystore(keyStoreDir)
);
StatusBackendClient.executeStatusGoRequestWithCallback(
"ConvertToKeycardAccountV2",
jsonParams,
() -> Statusgo.convertToKeycardAccountV2(jsonParams),
callback
);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String encodeTransfer(final String to, final String value) {
return Statusgo.encodeTransfer(to, value);
try {
JSONObject params = new JSONObject();
params.put("to", to);
params.put("value", value);
String jsonParams = params.toString();
return StatusBackendClient.executeStatusGoRequestWithResult(
"EncodeTransferV2",
jsonParams,
() -> Statusgo.encodeTransferV2(jsonParams)
);
} catch (JSONException e) {
Log.e(TAG, "Error creating JSON for encodeTransfer: " + e.getMessage());
return null;
}
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String encodeFunctionCall(final String method, final String paramsJSON) {
return Statusgo.encodeFunctionCall(method, paramsJSON);
try {
JSONObject params = new JSONObject();
params.put("method", method);
params.put("paramsJSON", new JSONObject(paramsJSON));
String jsonString = params.toString();
return StatusBackendClient.executeStatusGoRequestWithResult(
"EncodeFunctionCallV2",
jsonString,
() -> Statusgo.encodeFunctionCallV2(jsonString)
);
} catch (JSONException e) {
Log.e(TAG, "Error creating JSON for encodeFunctionCall: " + e.getMessage());
return null;
}
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String decodeParameters(final String decodeParamJSON) {
return Statusgo.decodeParameters(decodeParamJSON);
return StatusBackendClient.executeStatusGoRequestWithResult(
"DecodeParameters",
decodeParamJSON,
() -> Statusgo.decodeParameters(decodeParamJSON)
);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String hexToNumber(final String hex) {
return Statusgo.hexToNumber(hex);
return StatusBackendClient.executeStatusGoRequestWithResult(
"HexToNumber",
hex,
() -> Statusgo.hexToNumber(hex)
);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String numberToHex(final String numString) {
return Statusgo.numberToHex(numString);
return StatusBackendClient.executeStatusGoRequestWithResult(
"NumberToHex",
numString,
() -> Statusgo.numberToHex(numString)
);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String sha3(final String str) {
return Statusgo.sha3(str);
return StatusBackendClient.executeStatusGoRequestWithResult(
"Sha3",
str,
() -> Statusgo.sha3(str)
);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String utf8ToHex(final String str) {
return Statusgo.utf8ToHex(str);
return StatusBackendClient.executeStatusGoRequestWithResult(
"Utf8ToHex",
str,
() -> Statusgo.utf8ToHex(str)
);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String hexToUtf8(final String str) {
return Statusgo.hexToUtf8(str);
return StatusBackendClient.executeStatusGoRequestWithResult(
"HexToUtf8",
str,
() -> Statusgo.hexToUtf8(str)
);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String serializeLegacyKey(final String publicKey) {
return Statusgo.serializeLegacyKey(publicKey);
return StatusBackendClient.executeStatusGoRequestWithResult(
"SerializeLegacyKey",
publicKey,
() -> Statusgo.serializeLegacyKey(publicKey)
);
}
@ReactMethod
@@ -130,22 +215,46 @@ public class EncryptionUtils extends ReactContextBaseJavaModule {
@ReactMethod
public void hashTransaction(final String txArgsJSON, final Callback callback) throws JSONException {
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.hashTransaction(txArgsJSON), callback);
StatusBackendClient.executeStatusGoRequestWithCallback(
"HashTransaction",
txArgsJSON,
() -> Statusgo.hashTransaction(txArgsJSON),
callback
);
}
@ReactMethod
public void hashMessage(final String message, final Callback callback) throws JSONException {
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.hashMessage(message), callback);
StatusBackendClient.executeStatusGoRequestWithCallback(
"HashMessage",
message,
() -> Statusgo.hashMessage(message),
callback
);
}
@ReactMethod
public void multiformatDeserializePublicKey(final String multiCodecKey, final String base58btc, final Callback callback) throws JSONException {
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.multiformatDeserializePublicKey(multiCodecKey,base58btc), callback);
JSONObject params = new JSONObject();
params.put("key", multiCodecKey);
params.put("outBase", base58btc);
String jsonParams = params.toString();
StatusBackendClient.executeStatusGoRequestWithCallback(
"MultiformatDeserializePublicKeyV2",
jsonParams,
() -> Statusgo.multiformatDeserializePublicKeyV2(jsonParams),
callback
);
}
@ReactMethod
public void deserializeAndCompressKey(final String desktopKey, final Callback callback) throws JSONException {
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.deserializeAndCompressKey(desktopKey), callback);
StatusBackendClient.executeStatusGoRequestWithCallback(
"DeserializeAndCompressKey",
desktopKey,
() -> Statusgo.deserializeAndCompressKey(desktopKey),
callback
);
}
@ReactMethod
@@ -160,7 +269,12 @@ public class EncryptionUtils extends ReactContextBaseJavaModule {
@ReactMethod
public void signMessage(final String rpcParams, final Callback callback) throws JSONException {
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.signMessage(rpcParams), callback);
StatusBackendClient.executeStatusGoRequestWithCallback(
"SignMessage",
rpcParams,
() -> Statusgo.signMessage(rpcParams),
callback
);
}
@ReactMethod
@@ -195,20 +195,6 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
}
}
@ReactMethod
fun initLogging(enabled: Boolean, mobileSystem: Boolean, logLevel: String, logRequestGo: Boolean, callback: Callback) {
val jsonConfig = JSONObject().apply {
put("Enabled", enabled)
put("MobileSystem", mobileSystem)
put("Level", logLevel)
put("File", getGethLogFile().absolutePath)
put("LogRequestGo", logRequestGo)
put("LogRequestFile", getRequestLogFile().absolutePath)
}
val config = jsonConfig.toString()
utils.executeRunnableStatusGoMethod({ Statusgo.initLogging(config) }, callback)
}
@ReactMethod(isBlockingSynchronousMethod = true)
fun logFileDirectory(): String? {
return utils.getPublicStorageDirectory()?.absolutePath
@@ -218,7 +204,7 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
private const val TAG = "LogManager"
private const val gethLogFileName = "geth.log"
private const val statusLogFileName = "Status.log"
private const val requestsLogFileName = "requests.log"
private const val requestsLogFileName = "api.log"
private const val logsZipFileName = "Status-debug-logs.zip"
}
}
@@ -16,7 +16,12 @@ class NetworkManager(private val reactContext: ReactApplicationContext) : ReactC
@ReactMethod
fun startSearchForLocalPairingPeers(callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.startSearchForLocalPairingPeers() }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "StartSearchForLocalPairingPeers",
requestBody = "",
statusgoFunction = { Statusgo.startSearchForLocalPairingPeers() },
callback = callback
)
}
@ReactMethod
@@ -26,48 +31,85 @@ class NetworkManager(private val reactContext: ReactApplicationContext) : ReactC
val keyUID = senderConfig.getString("keyUID")
val keyStorePath = utils.getKeyStorePath(keyUID)
senderConfig.put("keystorePath", keyStorePath)
val jsonString = jsonConfig.toString()
utils.executeRunnableStatusGoMethod(
{ Statusgo.getConnectionStringForBootstrappingAnotherDevice(jsonConfig.toString()) },
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "GetConnectionStringForBootstrappingAnotherDevice",
requestBody = jsonString,
statusgoFunction = { Statusgo.getConnectionStringForBootstrappingAnotherDevice(jsonString) },
callback
)
}
@ReactMethod
fun inputConnectionStringForBootstrapping(connectionString: String, configJSON: String, callback: Callback) {
val jsonConfig = JSONObject(configJSON)
utils.executeRunnableStatusGoMethod(
{ Statusgo.inputConnectionStringForBootstrapping(connectionString, jsonConfig.toString()) },
val receiverClientConfig = JSONObject(configJSON)
val params = JSONObject().apply {
put("connectionString", connectionString)
put("receiverClientConfig", receiverClientConfig)
}
val jsonString = params.toString()
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "InputConnectionStringForBootstrappingV2",
requestBody = jsonString,
statusgoFunction = { Statusgo.inputConnectionStringForBootstrappingV2(jsonString) },
callback
)
}
@ReactMethod
fun sendTransactionWithSignature(txArgsJSON: String, signature: String, callback: Callback) {
utils.executeRunnableStatusGoMethod(
{ Statusgo.sendTransactionWithSignature(txArgsJSON, signature) },
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "SendTransactionWithSignature",
requestBody = txArgsJSON,
statusgoFunction = { Statusgo.sendTransactionWithSignature(txArgsJSON, signature) },
callback
)
}
@ReactMethod
fun sendTransaction(txArgsJSON: String, password: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.sendTransaction(txArgsJSON, password) }, callback)
val jsonParams = JSONObject().apply {
put("txArgs", JSONObject(txArgsJSON))
put("password", password)
}
val jsonString = jsonParams.toString()
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "SendTransactionV2",
requestBody = jsonString,
statusgoFunction = { Statusgo.sendTransactionV2(jsonString) },
callback
)
}
@ReactMethod
fun callRPC(payload: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.callRPC(payload) }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "CallRPC",
requestBody = payload,
statusgoFunction = { Statusgo.callRPC(payload) },
callback = callback
)
}
@ReactMethod
fun callPrivateRPC(payload: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.callPrivateRPC(payload) }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "CallPrivateRPC",
requestBody = payload,
statusgoFunction = { Statusgo.callPrivateRPC(payload) },
callback = callback
)
}
@ReactMethod
fun recover(rpcParams: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.recover(rpcParams) }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "Recover",
requestBody = rpcParams,
statusgoFunction = { Statusgo.recover(rpcParams) },
callback
)
}
@ReactMethod
@@ -77,22 +119,33 @@ class NetworkManager(private val reactContext: ReactApplicationContext) : ReactC
val keyUID = senderConfig.getString("loggedInKeyUid")
val keyStorePath = utils.getKeyStorePath(keyUID)
senderConfig.put("keystorePath", keyStorePath)
val jsonString = jsonConfig.toString()
utils.executeRunnableStatusGoMethod(
{ Statusgo.getConnectionStringForExportingKeypairsKeystores(jsonConfig.toString()) },
callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "GetConnectionStringForExportingKeypairsKeystores",
requestBody = jsonString,
statusgoFunction = { Statusgo.getConnectionStringForExportingKeypairsKeystores(jsonString) },
callback = callback
)
}
@ReactMethod
fun inputConnectionStringForImportingKeypairsKeystores(connectionString: String, configJSON: String, callback: Callback) {
val jsonConfig = JSONObject(configJSON)
val receiverConfig = jsonConfig.getJSONObject("receiverConfig")
val keystoreFilesReceiverClientConfig = JSONObject(configJSON)
val receiverConfig = keystoreFilesReceiverClientConfig.getJSONObject("receiverConfig")
val keyStorePath = utils.pathCombine(utils.getNoBackupDirectory(), "/keystore")
receiverConfig.put("keystorePath", keyStorePath)
utils.executeRunnableStatusGoMethod(
{ Statusgo.inputConnectionStringForImportingKeypairsKeystores(connectionString, jsonConfig.toString()) },
callback
val params = JSONObject().apply {
put("connectionString", connectionString)
put("keystoreFilesReceiverClientConfig", keystoreFilesReceiverClientConfig)
}
val jsonString = params.toString()
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "InputConnectionStringForImportingKeypairsKeystoresV2",
requestBody = jsonString,
statusgoFunction = { Statusgo.inputConnectionStringForImportingKeypairsKeystoresV2(jsonString) },
callback = callback
)
}
}
@@ -0,0 +1,209 @@
package im.status.ethereum.module
import android.util.Log
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
import okhttp3.WebSocket
import okhttp3.WebSocketListener
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import com.facebook.react.bridge.Callback
import java.net.SocketException
import java.net.SocketTimeoutException
import java.util.concurrent.TimeUnit
class StatusBackendClient(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
companion object {
private const val TAG = "StatusBackendClient"
private val JSON = "application/json; charset=utf-8".toMediaType()
private const val TIMEOUT_SECONDS = 30L
@Volatile private var instance: StatusBackendClient? = null
private lateinit var utils: Utils
fun getInstance(): StatusBackendClient? = instance
@JvmStatic
fun executeStatusGoRequest(
endpoint: String,
requestBody: String,
statusgoFunction: () -> String
) {
val statusBackendClient = getInstance()
if (statusBackendClient?.serverEnabled == true) {
val result = statusBackendClient.request(endpoint, requestBody)
result.onSuccess { response ->
utils.handleStatusGoResponse(response, endpoint)
}.onFailure { error ->
Log.e(TAG, "request to $endpoint failed", error)
}
} else {
val result = statusgoFunction()
utils.handleStatusGoResponse(result, endpoint)
}
}
@JvmStatic
fun executeStatusGoRequestWithCallback(
endpoint: String,
requestBody: String,
statusgoFunction: () -> String,
callback: Callback?
) {
val statusBackendClient = getInstance()
if (statusBackendClient?.serverEnabled == true) {
val runnable = Runnable {
val result = statusBackendClient.request(endpoint, requestBody)
result.onSuccess { response ->
callback?.invoke(response)
}.onFailure { error ->
Log.e(TAG, "request to $endpoint failed", error)
callback?.invoke(false)
}
}
StatusThreadPoolExecutor.getInstance().execute(runnable)
} else {
utils.executeRunnableStatusGoMethod(statusgoFunction, callback)
}
}
@JvmStatic
fun executeStatusGoRequestWithResult(
endpoint: String,
requestBody: String,
statusgoFunction: () -> String
): String {
val statusBackendClient = getInstance()
return if (statusBackendClient?.serverEnabled == true) {
val result = statusBackendClient.request(endpoint, requestBody)
result.getOrElse { error ->
Log.e(TAG, "request to $endpoint failed", error)
""
}
} else {
statusgoFunction()
}
}
}
init {
instance = this
utils = Utils(reactContext)
}
override fun getName(): String = "StatusBackendClient"
private val httpClient = OkHttpClient.Builder()
.connectTimeout(TIMEOUT_SECONDS, TimeUnit.SECONDS)
.writeTimeout(TIMEOUT_SECONDS, TimeUnit.SECONDS)
.readTimeout(TIMEOUT_SECONDS, TimeUnit.SECONDS)
.retryOnConnectionFailure(true)
.build()
private val wsClient = OkHttpClient.Builder()
.retryOnConnectionFailure(true)
.build()
private var webSocket: WebSocket? = null
@Volatile var serverEnabled = false
@Volatile private var statusGoEndpoint: String? = null
@Volatile private var signalEndpoint: String? = null
@Volatile var rootDataDir: String? = null
@ReactMethod
fun configStatusBackendServer(
serverEnabled: Boolean,
statusGoEndpoint: String,
signalEndpoint: String,
rootDataDir: String
) {
configure(serverEnabled, statusGoEndpoint, signalEndpoint, rootDataDir)
}
private fun configure(
serverEnabled: Boolean,
statusGoEndpoint: String,
signalEndpoint: String,
rootDataDir: String
) {
Log.d(TAG, "configure: serverEnabled=$serverEnabled, statusGoEndpoint=$statusGoEndpoint, " +
"signalEndpoint=$signalEndpoint, rootDataDir=$rootDataDir")
this.serverEnabled = serverEnabled
if (serverEnabled) {
this.statusGoEndpoint = statusGoEndpoint
this.signalEndpoint = signalEndpoint
this.rootDataDir = rootDataDir
connectWebSocket()
} else {
disconnectWebSocket()
this.statusGoEndpoint = null
this.signalEndpoint = null
this.rootDataDir = null
}
}
private fun connectWebSocket() {
if (!serverEnabled || signalEndpoint == null) {
return
}
val request = Request.Builder()
.url("$signalEndpoint")
.build()
webSocket = wsClient.newWebSocket(request, object : WebSocketListener() {
override fun onMessage(webSocket: WebSocket, text: String) {
StatusModule.getInstance()?.handleSignal(text)
}
override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) {
Log.e(TAG, "WebSocket error: ${t.message}")
}
})
}
private fun disconnectWebSocket() {
webSocket?.cancel()
webSocket = null
}
fun request(endpoint: String, body: String): Result<String> {
if (!serverEnabled || statusGoEndpoint == null) {
return Result.failure(IllegalStateException("Status backend server is not enabled"))
}
val fullUrl = "$statusGoEndpoint$endpoint"
return try {
val request = Request.Builder()
.url(fullUrl)
.post(body.toRequestBody(JSON))
.build()
httpClient.newCall(request).execute().use { response ->
val responseBody = response.body?.string() ?: ""
if (response.isSuccessful) {
Log.d(TAG, "Request to $endpoint succeeded: $responseBody")
Result.success(responseBody)
} else {
val errorMsg = "Request failed with code ${response.code}: $responseBody"
Log.e(TAG, "Request to $endpoint failed: $errorMsg")
Result.failure(Exception(errorMsg))
}
}
} catch (e: Exception) {
when (e) {
is SocketTimeoutException -> Log.e(TAG, "Request to $endpoint timed out", e)
is SocketException -> Log.e(TAG, "Socket error for $endpoint", e)
else -> Log.e(TAG, "Request to $endpoint failed with exception", e)
}
Result.failure(e)
}
}
}
@@ -9,12 +9,17 @@ import statusgo.SignalHandler
import statusgo.Statusgo
import org.json.JSONException
import android.view.WindowManager
import org.json.JSONObject
class StatusModule(private val reactContext: ReactApplicationContext, private val rootedDevice: Boolean) : ReactContextBaseJavaModule(reactContext), LifecycleEventListener, SignalHandler {
companion object {
private const val TAG = "StatusModule"
private var module: StatusModule? = null
fun getInstance(): StatusModule? {
return module
}
}
private val utils: Utils = Utils(reactContext)
@@ -56,45 +61,97 @@ class StatusModule(private val reactContext: ReactApplicationContext, private va
@ReactMethod
fun connectionChange(type: String, isExpensive: Boolean) {
Log.d(TAG, "ConnectionChange: $type, is expensive $isExpensive")
Statusgo.connectionChange(type, if (isExpensive) 1 else 0)
val params = JSONObject().apply {
put("type", type)
put("expensive", isExpensive)
}
val jsonString = params.toString()
StatusBackendClient.executeStatusGoRequest(
endpoint = "ConnectionChangeV2",
requestBody = jsonString,
statusgoFunction = { Statusgo.connectionChangeV2(jsonString) }
)
}
@ReactMethod
fun appStateChange(type: String) {
Log.d(TAG, "AppStateChange: $type")
Statusgo.appStateChange(type)
fun appStateChange(state: String) {
Log.d(TAG, "AppStateChange: $state")
val params = JSONObject().apply {
put("state", state)
}
val jsonString = params.toString()
StatusBackendClient.executeStatusGoRequest(
endpoint = "AppStateChangeV2",
requestBody = jsonString,
statusgoFunction = { Statusgo.appStateChangeV2(jsonString) }
)
}
@ReactMethod
fun startLocalNotifications() {
Log.d(TAG, "startLocalNotifications")
Statusgo.startLocalNotifications()
StatusBackendClient.executeStatusGoRequest(
endpoint = "StartLocalNotifications",
requestBody = "",
statusgoFunction = { Statusgo.startLocalNotifications() }
)
}
@ReactMethod
fun getNodeConfig(callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.getNodeConfig() }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "GetNodeConfig",
requestBody = "",
statusgoFunction = { Statusgo.getNodeConfig() },
callback = callback
)
}
@ReactMethod
fun addCentralizedMetric(request: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.addCentralizedMetric(request) }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "AddCentralizedMetric",
requestBody = request,
statusgoFunction = { Statusgo.addCentralizedMetric(request) },
callback
)
}
@ReactMethod
fun toggleCentralizedMetrics(request: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.toggleCentralizedMetrics(request) }, callback)
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "ToggleCentralizedMetrics",
requestBody = request,
statusgoFunction = { Statusgo.toggleCentralizedMetrics(request) },
callback
)
}
@ReactMethod
fun deleteImportedKey(keyUID: String, address: String, password: String, callback: Callback) {
val keyStoreDir = utils.getKeyStorePath(keyUID)
utils.executeRunnableStatusGoMethod({ Statusgo.deleteImportedKey(address, password, keyStoreDir) }, callback)
val params = JSONObject().apply {
put("address", address)
put("password", password)
put("keyStoreDir", keyStoreDir)
}
val jsonString = params.toString()
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "DeleteImportedKeyV2",
requestBody = jsonString,
statusgoFunction = { Statusgo.deleteImportedKeyV2(jsonString) },
callback
)
}
@ReactMethod(isBlockingSynchronousMethod = true)
fun fleets(): String {
return Statusgo.fleets()
return StatusBackendClient.executeStatusGoRequestWithResult(
endpoint = "Fleets",
requestBody = "",
statusgoFunction = { Statusgo.fleets() }
)
}
override fun getConstants(): Map<String, Any>? {
@@ -9,7 +9,12 @@ import statusgo.Statusgo
class StatusPackage(private val rootedDevice: Boolean) : ReactPackage {
companion object {
fun getImageTLSCert(): String = Statusgo.imageServerTLSCert()
fun getImageTLSCert(): String =
StatusBackendClient.executeStatusGoRequestWithResult(
endpoint = "ImageServerTLSCert",
requestBody = "",
statusgoFunction = { Statusgo.imageServerTLSCert() }
)
}
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
@@ -26,6 +31,7 @@ class StatusPackage(private val rootedDevice: Boolean) : ReactPackage {
add(NetworkManager(reactContext))
add(MailManager(reactContext))
add(RNSelectableTextInputModule(reactContext))
add(StatusBackendClient(reactContext))
}
return modules
@@ -25,6 +25,11 @@ class Utils(private val reactContext: ReactApplicationContext) : ReactContextBas
}
fun getNoBackupDirectory(): String {
StatusBackendClient.getInstance()?.let { client ->
if (client.serverEnabled && client.rootDataDir != null) {
return client.rootDataDir!!
}
}
return reactContext.noBackupFilesDir.absolutePath
}
@@ -34,6 +39,11 @@ class Utils(private val reactContext: ReactApplicationContext) : ReactContextBas
}
fun getPublicStorageDirectory(): File? {
StatusBackendClient.getInstance()?.let { client ->
if (client.serverEnabled && client.rootDataDir != null) {
return File(client.rootDataDir!!)
}
}
// Environment.getExternalStoragePublicDirectory doesn't work as expected on Android Q
// https://developer.android.com/reference/android/os/Environment#getExternalStoragePublicDirectory(java.lang.String)
return reactContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)
@@ -69,8 +79,22 @@ class Utils(private val reactContext: ReactApplicationContext) : ReactContextBas
val keydirFile = File(keydir)
if (!keydirFile.exists() || keydirFile.list().isEmpty()) {
Log.d(TAG, "migrateKeyStoreDir")
Statusgo.migrateKeyStoreDir(accountData, password, commonKeydir, keydir)
Statusgo.initKeystore(keydir)
val jsonParams = JSONObject()
jsonParams.put("account", JSONObject(accountData)) // Remove 'new' keyword
jsonParams.put("password", password)
jsonParams.put("oldDir", commonKeydir)
jsonParams.put("newDir", keydir)
StatusBackendClient.executeStatusGoRequest(
endpoint = "MigrateKeyStoreDirV2",
requestBody = jsonParams.toString(),
statusgoFunction = { Statusgo.migrateKeyStoreDirV2(jsonParams.toString()) }
)
StatusBackendClient.executeStatusGoRequest(
endpoint = "InitKeystore",
requestBody = keydir,
statusgoFunction = { Statusgo.initKeystore(keydir) }
)
}
} catch (e: JSONException) {
Log.e(TAG, "JSON conversion failed: ${e.message}")
@@ -99,15 +123,15 @@ class Utils(private val reactContext: ReactApplicationContext) : ReactContextBas
return false
}
fun executeRunnableStatusGoMethod(method: Supplier<String>, callback: Callback) {
fun executeRunnableStatusGoMethod(method: Supplier<String>, callback: Callback?) {
if (!checkAvailability()) {
callback.invoke(false)
callback?.invoke(false)
return
}
val runnableTask = Runnable {
val res = method.get()
callback.invoke(res)
callback?.invoke(res)
}
StatusThreadPoolExecutor.getInstance().execute(runnableTask)
@@ -115,7 +139,15 @@ class Utils(private val reactContext: ReactApplicationContext) : ReactContextBas
@ReactMethod
fun validateMnemonic(seed: String, callback: Callback) {
executeRunnableStatusGoMethod({ Statusgo.validateMnemonic(seed) }, callback)
val jsonParams = JSONObject()
jsonParams.put("mnemonic", seed)
val jsonString = jsonParams.toString()
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "ValidateMnemonicV2",
requestBody = jsonString,
statusgoFunction = { Statusgo.validateMnemonicV2(jsonString) },
callback
)
}
fun is24Hour(): Boolean {
@@ -124,17 +156,29 @@ class Utils(private val reactContext: ReactApplicationContext) : ReactContextBas
@ReactMethod(isBlockingSynchronousMethod = true)
fun checkAddressChecksum(address: String): String {
return Statusgo.checkAddressChecksum(address)
return StatusBackendClient.executeStatusGoRequestWithResult(
endpoint = "CheckAddressChecksum",
requestBody = address,
statusgoFunction = { Statusgo.checkAddressChecksum(address) }
)
}
@ReactMethod(isBlockingSynchronousMethod = true)
fun isAddress(address: String): String {
return Statusgo.isAddress(address)
return StatusBackendClient.executeStatusGoRequestWithResult(
endpoint = "IsAddress",
requestBody = address,
statusgoFunction = { Statusgo.isAddress(address) }
)
}
@ReactMethod(isBlockingSynchronousMethod = true)
fun toChecksumAddress(address: String): String {
return Statusgo.toChecksumAddress(address)
return StatusBackendClient.executeStatusGoRequestWithResult(
endpoint = "ToChecksumAddress",
requestBody = address,
statusgoFunction = { Statusgo.toChecksumAddress(address) }
)
}
fun readableArrayToStringArray(r: ReadableArray): Array<String> {
@@ -150,6 +194,19 @@ class Utils(private val reactContext: ReactApplicationContext) : ReactContextBas
@ReactMethod(isBlockingSynchronousMethod = true)
fun validateConnectionString(connectionString: String): String {
return Statusgo.validateConnectionString(connectionString)
return StatusBackendClient.executeStatusGoRequestWithResult(
endpoint = "ValidateConnectionString",
requestBody = connectionString,
statusgoFunction = { Statusgo.validateConnectionString(connectionString) }
)
}
fun handleStatusGoResponse(response: String, source: String) {
//TODO(frank) we should remove sensitive data from the response
if (response.startsWith("{\"error\":\"\"")) {
Log.d(TAG, "$source success: $response")
} else {
Log.e(TAG, "$source failed: $response")
}
}
}
@@ -870,7 +870,11 @@ public class PushNotificationHelper {
public void start() {
Log.e(LOG_TAG, "Starting Foreground Service");
Intent serviceIntent = new Intent(context, ForegroundService.class);
context.startService(serviceIntent);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(serviceIntent);
} else {
context.startService(serviceIntent);
}
this.registerBroadcastReceiver();
}
@@ -3,6 +3,7 @@
#import "React/RCTEventDispatcher.h"
#import "Statusgo.h"
#import "Utils.h"
#import "StatusBackendClient.h"
@implementation AccountManager
@@ -12,23 +13,29 @@ RCT_EXPORT_METHOD(createAccountAndLogin:(NSString *)request) {
#if DEBUG
NSLog(@"createAccountAndLogin() method called");
#endif
StatusgoCreateAccountAndLogin(request);
[StatusBackendClient executeStatusGoRequest:@"CreateAccountAndLogin"
body:request
statusgoFunction:^NSString *{
return StatusgoCreateAccountAndLogin(request);
}];
}
RCT_EXPORT_METHOD(restoreAccountAndLogin:(NSString *)request) {
#if DEBUG
NSLog(@"restoreAccountAndLogin() method called");
#endif
StatusgoRestoreAccountAndLogin(request);
[StatusBackendClient executeStatusGoRequest:@"RestoreAccountAndLogin"
body:request
statusgoFunction:^NSString *{
return StatusgoRestoreAccountAndLogin(request);
}];
}
-(NSString *) prepareDirAndUpdateConfig:(NSString *)config
withKeyUID:(NSString *)keyUID {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error = nil;
NSURL *rootUrl =[[fileManager
URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask]
lastObject];
NSURL *rootUrl =[Utils getRootUrl];
NSURL *absTestnetFolderName = [rootUrl URLByAppendingPathComponent:@"ethereum/testnet"];
if (![fileManager fileExistsAtPath:absTestnetFolderName.path])
@@ -102,8 +109,24 @@ RCT_EXPORT_METHOD(deleteMultiaccount:(NSString *)keyUID
NSLog(@"DeleteMultiaccount() method called");
#endif
NSURL *multiaccountKeystoreDir = [Utils getKeyStoreDirForKeyUID:keyUID];
NSString *result = StatusgoDeleteMultiaccount(keyUID, multiaccountKeystoreDir.path);
callback(@[result]);
NSDictionary *params = @{
@"keyUID": keyUID,
@"keyStoreDir": multiaccountKeystoreDir.path
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", error);
return;
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[StatusBackendClient executeStatusGoRequestWithCallback:@"DeleteMultiaccountV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoDeleteMultiaccountV2(jsonString);
}
callback:callback];
}
RCT_EXPORT_METHOD(prepareDirAndUpdateConfig:(NSString *)keyUID
@@ -163,36 +186,69 @@ RCT_EXPORT_METHOD(loginWithConfig:(NSString *)accountData
RCT_EXPORT_METHOD(loginAccount:(NSString *)request) {
#if DEBUG
NSLog(@"LoginAccount() method called");
NSLog(@"loginAccount() method called");
#endif
NSString *result = StatusgoLoginAccount(request);
NSLog(@"%@", result);
[StatusBackendClient executeStatusGoRequest:@"LoginAccount"
body:request
statusgoFunction:^NSString *{
return StatusgoLoginAccount(request);
}];
}
RCT_EXPORT_METHOD(verify:(NSString *)address
password:(NSString *)password
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"VerifyAccountPassword() method called");
NSLog(@"VerifyAccountPasswordV2() method called");
#endif
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *rootUrl =[[fileManager
URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask]
lastObject];
NSURL *absKeystoreUrl = [rootUrl URLByAppendingPathComponent:@"keystore"];
NSString *result = StatusgoVerifyAccountPassword(absKeystoreUrl.path, address, password);
callback(@[result]);
NSURL *rootUrl = [Utils getRootUrl];
NSString *keystorePath = [rootUrl.path stringByAppendingPathComponent:@"keystore"];
NSDictionary *params = @{
@"keyStoreDir": keystorePath,
@"address": address,
@"password": password
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", error);
return;
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[StatusBackendClient executeStatusGoRequestWithCallback:@"VerifyAccountPasswordV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoVerifyAccountPasswordV2(jsonString);
}
callback:callback];
}
RCT_EXPORT_METHOD(verifyDatabasePassword:(NSString *)keyUID
password:(NSString *)password
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"VerifyDatabasePassword() method called");
NSLog(@"VerifyDatabasePasswordV2() method called");
#endif
NSString *result = StatusgoVerifyDatabasePassword(keyUID, password);
callback(@[result]);
NSDictionary *params = @{
@"keyUID": keyUID,
@"password": password
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", error);
return;
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[StatusBackendClient executeStatusGoRequestWithCallback:@"VerifyDatabasePasswordV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoVerifyDatabasePasswordV2(jsonString);
}
callback:callback];
}
RCT_EXPORT_METHOD(initializeApplication:(NSString *)request
@@ -200,62 +256,173 @@ RCT_EXPORT_METHOD(initializeApplication:(NSString *)request
#if DEBUG
NSLog(@"initializeApplication() method called");
#endif
NSString *result = StatusgoInitializeApplication(request);
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"InitializeApplication"
body:request
statusgoFunction:^NSString *{
return StatusgoInitializeApplication(request);
}
callback:callback];
}
RCT_EXPORT_METHOD(acceptTerms:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"acceptTerms() method called");
#endif
NSString *result = StatusgoAcceptTerms();
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"AcceptTerms"
body:@""
statusgoFunction:^NSString *{
return StatusgoAcceptTerms();
}
callback:callback];
}
RCT_EXPORT_METHOD(openAccounts:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"OpenAccounts() method called");
#endif
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *rootUrl =[[fileManager
URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask]
lastObject];
NSURL *rootUrl =[Utils getRootUrl];
NSString *result = StatusgoOpenAccounts(rootUrl.path);
callback(@[result]);
}
RCT_EXPORT_METHOD(logout) {
#if DEBUG
NSLog(@"Logout() method called");
NSLog(@"Logout() method called");
#endif
NSString *result = StatusgoLogout();
[StatusBackendClient executeStatusGoRequest:@"Logout"
body:@""
statusgoFunction:^NSString *{
return StatusgoLogout();
}];
}
NSLog(@"%@", result);
RCT_EXPORT_METHOD(multiAccountStoreAccount:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"MultiAccountStoreAccount() method called");
#endif
[StatusBackendClient executeStatusGoRequestWithCallback:@"MultiAccountStoreAccount"
body:json
statusgoFunction:^NSString *{
return StatusgoMultiAccountStoreAccount(json);
}
callback:callback];
}
RCT_EXPORT_METHOD(multiAccountLoadAccount:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"MultiAccountLoadAccount() method called");
#endif
[StatusBackendClient executeStatusGoRequestWithCallback:@"MultiAccountLoadAccount"
body:json
statusgoFunction:^NSString *{
return StatusgoMultiAccountLoadAccount(json);
}
callback:callback];
}
RCT_EXPORT_METHOD(multiAccountDeriveAddresses:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"multiAccountDeriveAddresses() method called");
#endif
[StatusBackendClient executeStatusGoRequestWithCallback:@"MultiAccountDeriveAddresses"
body:json
statusgoFunction:^NSString *{
return StatusgoMultiAccountDeriveAddresses(json);
}
callback:callback];
}
RCT_EXPORT_METHOD(multiAccountGenerateAndDeriveAddresses:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"MultiAccountGenerateAndDeriveAddresses() method called");
#endif
[StatusBackendClient executeStatusGoRequestWithCallback:@"MultiAccountGenerateAndDeriveAddresses"
body:json
statusgoFunction:^NSString *{
return StatusgoMultiAccountGenerateAndDeriveAddresses(json);
}
callback:callback];
}
RCT_EXPORT_METHOD(multiAccountStoreDerived:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"MultiAccountStoreDerived() method called");
#endif
[StatusBackendClient executeStatusGoRequestWithCallback:@"MultiAccountStoreDerivedAccounts"
body:json
statusgoFunction:^NSString *{
return StatusgoMultiAccountStoreDerivedAccounts(json);
}
callback:callback];
}
RCT_EXPORT_METHOD(multiAccountImportMnemonic:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"MultiAccountImportMnemonic() method called");
#endif
[StatusBackendClient executeStatusGoRequestWithCallback:@"MultiAccountImportMnemonic"
body:json
statusgoFunction:^NSString *{
return StatusgoMultiAccountImportMnemonic(json);
}
callback:callback];
}
RCT_EXPORT_METHOD(multiAccountImportPrivateKey:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"MultiAccountImportPrivateKey() method called");
#endif
[StatusBackendClient executeStatusGoRequestWithCallback:@"MultiAccountImportPrivateKey"
body:json
statusgoFunction:^NSString *{
return StatusgoMultiAccountImportPrivateKey(json);
}
callback:callback];
}
RCT_EXPORT_METHOD(getRandomMnemonic:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"GetRandomMnemonic() method called");
#endif
NSString *result = StatusgoGetRandomMnemonic();
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"GetRandomMnemonic"
body:@""
statusgoFunction:^NSString *{
return StatusgoGetRandomMnemonic();
}
callback:callback];
}
RCT_EXPORT_METHOD(createAccountFromMnemonicAndDeriveAccountsForPaths:(NSString *)mnemonic callback:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(createAccountFromMnemonicAndDeriveAccountsForPaths:(NSString *)mnemonic
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"createAccountFromMnemonicAndDeriveAccountsForPaths() method called");
#endif
NSString *result = StatusgoCreateAccountFromMnemonicAndDeriveAccountsForPaths(mnemonic);
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"CreateAccountFromMnemonicAndDeriveAccountsForPaths"
body:mnemonic
statusgoFunction:^NSString *{
return StatusgoCreateAccountFromMnemonicAndDeriveAccountsForPaths(mnemonic);
}
callback:callback];
}
RCT_EXPORT_METHOD(createAccountFromPrivateKey:(NSString *)configJSON callback:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(createAccountFromPrivateKey:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"createAccountFromPrivateKey() method called");
#endif
NSString *result = StatusgoCreateAccountFromPrivateKey(configJSON);
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"CreateAccountFromPrivateKey"
body:json
statusgoFunction:^NSString *{
return StatusgoCreateAccountFromPrivateKey(json);
}
callback:callback];
}
@end
@@ -3,7 +3,7 @@
#import "React/RCTEventDispatcher.h"
#import "Statusgo.h"
#import "Utils.h"
#import "StatusBackendClient.h"
@implementation DatabaseManager
RCT_EXPORT_MODULE();
@@ -16,8 +16,31 @@ RCT_EXPORT_METHOD(exportUnencryptedDatabase:(NSString *)accountData
#endif
NSString *filePath = [Utils getExportDbFilePath];
StatusgoExportUnencryptedDatabase(accountData, password, filePath);
NSDictionary *params = @{
@"account": [NSJSONSerialization JSONObjectWithData:[accountData dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil],
@"password": password,
@"databasePath": filePath
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", [error localizedDescription]);
callback(@[filePath]);
return;
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[StatusBackendClient executeStatusGoRequestWithCallback:@"ExportUnencryptedDatabaseV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoExportUnencryptedDatabaseV2(jsonString);
}
callback:nil];
callback(@[filePath]);
}
@@ -26,7 +49,31 @@ RCT_EXPORT_METHOD(importUnencryptedDatabase:(NSString *)accountData
#if DEBUG
NSLog(@"importUnencryptedDatabase() method called");
#endif
"";
NSString *filePath = [Utils getExportDbFilePath];
[Utils migrateKeystore:accountData password:password];
NSDictionary *params = @{
@"account": [NSJSONSerialization JSONObjectWithData:[accountData dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil],
@"password": password,
@"databasePath": filePath
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", [error localizedDescription]);
return;
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[StatusBackendClient executeStatusGoRequest:@"ImportUnencryptedDatabaseV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoImportUnencryptedDatabaseV2(jsonString);
}];
}
@@ -3,6 +3,7 @@
#import "React/RCTEventDispatcher.h"
#import "Statusgo.h"
#import "Utils.h"
#import "StatusBackendClient.h"
@implementation EncryptionUtils
@@ -15,21 +16,14 @@ RCT_EXPORT_METHOD(initKeystore:(NSString *)keyUID
#if DEBUG
NSLog(@"initKeystore() method called");
#endif
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *rootUrl =[[fileManager
URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask]
lastObject];
NSURL *commonKeystoreDir = [rootUrl URLByAppendingPathComponent:@"keystore"];
NSURL *keystoreDir = [commonKeystoreDir URLByAppendingPathComponent:keyUID];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
^(void)
{
NSString *res = StatusgoInitKeystore(keystoreDir.path);
NSLog(@"InitKeyStore result %@", res);
callback(@[]);
});
NSURL *multiaccountKeystoreDir = [Utils getKeyStoreDirForKeyUID:keyUID];
[StatusBackendClient executeStatusGoRequestWithCallback:@"InitKeystore"
body:multiaccountKeystoreDir.path
statusgoFunction:^NSString *{
return StatusgoInitKeystore(multiaccountKeystoreDir.path);
}
callback:callback];
}
RCT_EXPORT_METHOD(reEncryptDbAndKeystore:(NSString *)keyUID
@@ -39,9 +33,26 @@ RCT_EXPORT_METHOD(reEncryptDbAndKeystore:(NSString *)keyUID
#if DEBUG
NSLog(@"reEncryptDbAndKeystore() method called");
#endif
// changes password and re-encrypts keystore
NSString *result = StatusgoChangeDatabasePassword(keyUID, currentPassword, newPassword);
callback(@[result]);
// Construct params into JSON string
NSDictionary *params = @{
@"keyUID": keyUID,
@"oldPassword": currentPassword,
@"newPassword": newPassword
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", error);
return;
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[StatusBackendClient executeStatusGoRequestWithCallback:@"ChangeDatabasePasswordV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoChangeDatabasePasswordV2(jsonString);
}
callback:callback];
}
RCT_EXPORT_METHOD(convertToKeycardAccount:(NSString *)keyUID
@@ -55,47 +66,141 @@ RCT_EXPORT_METHOD(convertToKeycardAccount:(NSString *)keyUID
NSLog(@"convertToKeycardAccount() method called");
#endif
NSURL *multiaccountKeystoreDir = [Utils getKeyStoreDirForKeyUID:keyUID];
StatusgoInitKeystore(multiaccountKeystoreDir.path);
NSString *result = StatusgoConvertToKeycardAccount(accountData, settings, keycardUID, currentPassword, newPassword);
callback(@[result]);
// First initialize keystore
[StatusBackendClient executeStatusGoRequest:@"InitKeystore"
body:multiaccountKeystoreDir.path
statusgoFunction:^NSString *{
return StatusgoInitKeystore(multiaccountKeystoreDir.path);
}];
// Prepare parameters for conversion
NSDictionary *params = @{
@"keyUID": keyUID,
@"account": [NSJSONSerialization JSONObjectWithData:[accountData dataUsingEncoding:NSUTF8StringEncoding]
options:0
error:nil],
@"settings": [NSJSONSerialization JSONObjectWithData:[settings dataUsingEncoding:NSUTF8StringEncoding]
options:0
error:nil],
@"keycardUID": keycardUID,
@"oldPassword": currentPassword,
@"newPassword": newPassword
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", [error localizedDescription]);
return;
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[StatusBackendClient executeStatusGoRequestWithCallback:@"ConvertToKeycardAccountV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoConvertToKeycardAccountV2(jsonString);
}
callback:callback];
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(encodeTransfer:(NSString *)to
value:(NSString *)value) {
return StatusgoEncodeTransfer(to,value);
value:(NSString *)value) {
NSDictionary *params = @{
@"to": to,
@"value": value
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", [error localizedDescription]);
return nil;
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
return [StatusBackendClient executeStatusGoRequestWithResult:@"EncodeTransferV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoEncodeTransferV2(jsonString);
}];
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(encodeFunctionCall:(NSString *)method
paramsJSON:(NSString *)paramsJSON) {
return StatusgoEncodeFunctionCall(method,paramsJSON);
paramsJSON:(NSString *)paramsJSON) {
NSDictionary *params = @{
@"method": method,
@"paramsJSON": paramsJSON
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", [error localizedDescription]);
return nil;
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
return [StatusBackendClient executeStatusGoRequestWithResult:@"EncodeFunctionCallV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoEncodeFunctionCallV2(jsonString);
}];
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(decodeParameters:(NSString *)decodeParamJSON) {
return StatusgoDecodeParameters(decodeParamJSON);
return [StatusBackendClient executeStatusGoRequestWithResult:@"DecodeParameters"
body:decodeParamJSON
statusgoFunction:^NSString *{
return StatusgoDecodeParameters(decodeParamJSON);
}];
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(hexToNumber:(NSString *)hex) {
return StatusgoHexToNumber(hex);
return [StatusBackendClient executeStatusGoRequestWithResult:@"HexToNumber"
body:hex
statusgoFunction:^NSString *{
return StatusgoHexToNumber(hex);
}];
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(numberToHex:(NSString *)numString) {
return StatusgoNumberToHex(numString);
return [StatusBackendClient executeStatusGoRequestWithResult:@"NumberToHex"
body:numString
statusgoFunction:^NSString *{
return StatusgoNumberToHex(numString);
}];
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(sha3:(NSString *)str) {
return StatusgoSha3(str);
return [StatusBackendClient executeStatusGoRequestWithResult:@"Sha3"
body:str
statusgoFunction:^NSString *{
return StatusgoSha3(str);
}];
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(utf8ToHex:(NSString *)str) {
return StatusgoUtf8ToHex(str);
return [StatusBackendClient executeStatusGoRequestWithResult:@"Utf8ToHex"
body:str
statusgoFunction:^NSString *{
return StatusgoUtf8ToHex(str);
}];
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(hexToUtf8:(NSString *)str) {
return StatusgoHexToUtf8(str);
return [StatusBackendClient executeStatusGoRequestWithResult:@"HexToUtf8"
body:str
statusgoFunction:^NSString *{
return StatusgoHexToUtf8(str);
}];
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(serializeLegacyKey:(NSString *)str) {
return StatusgoSerializeLegacyKey(str);
return [StatusBackendClient executeStatusGoRequestWithResult:@"SerializeLegacyKey"
body:str
statusgoFunction:^NSString *{
return StatusgoSerializeLegacyKey(str);
}];
}
RCT_EXPORT_METHOD(setBlankPreviewFlag:(BOOL *)newValue)
@@ -110,10 +215,14 @@ RCT_EXPORT_METHOD(setBlankPreviewFlag:(BOOL *)newValue)
RCT_EXPORT_METHOD(hashTransaction:(NSString *)txArgsJSON
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"HashTransaction() method called");
NSLog(@"hashTransaction() method called");
#endif
NSString *result = StatusgoHashTransaction(txArgsJSON);
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"HashTransaction"
body:txArgsJSON
statusgoFunction:^NSString *{
return StatusgoHashTransaction(txArgsJSON);
}
callback:callback];
}
RCT_EXPORT_METHOD(hashMessage:(NSString *)message
@@ -121,8 +230,12 @@ RCT_EXPORT_METHOD(hashMessage:(NSString *)message
#if DEBUG
NSLog(@"hashMessage() method called");
#endif
NSString *result = StatusgoHashMessage(message);
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"HashMessage"
body:message
statusgoFunction:^NSString *{
return StatusgoHashMessage(message);
}
callback:callback];
}
RCT_EXPORT_METHOD(localPairingPreflightOutboundCheck:(RCTResponseSenderBlock)callback) {
@@ -136,14 +249,34 @@ RCT_EXPORT_METHOD(localPairingPreflightOutboundCheck:(RCTResponseSenderBlock)cal
RCT_EXPORT_METHOD(multiformatDeserializePublicKey:(NSString *)multiCodecKey
base58btc:(NSString *)base58btc
callback:(RCTResponseSenderBlock)callback) {
NSString *result = StatusgoMultiformatDeserializePublicKey(multiCodecKey,base58btc);
callback(@[result]);
NSDictionary *params = @{
@"key": multiCodecKey,
@"outBase": base58btc
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", error);
return;
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[StatusBackendClient executeStatusGoRequestWithCallback:@"MultiformatDeserializePublicKeyV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoMultiformatDeserializePublicKeyV2(jsonString);
}
callback:callback];
}
RCT_EXPORT_METHOD(deserializeAndCompressKey:(NSString *)desktopKey
callback:(RCTResponseSenderBlock)callback) {
NSString *result = StatusgoDeserializeAndCompressKey(desktopKey);
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"DeserializeAndCompressKey"
body:desktopKey
statusgoFunction:^NSString *{
return StatusgoDeserializeAndCompressKey(desktopKey);
}
callback:callback];
}
RCT_EXPORT_METHOD(hashTypedData:(NSString *)data
@@ -166,13 +299,14 @@ RCT_EXPORT_METHOD(hashTypedDataV4:(NSString *)data
#pragma mark - SignMessage
RCT_EXPORT_METHOD(signMessage:(NSString *)message
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"SignMessage() method called");
#endif
NSString *result = StatusgoSignMessage(message);
callback(@[result]);
RCT_EXPORT_METHOD(signMessage:(NSString *)rpcParams
callback:(RCTResponseSenderBlock)callback) {
[StatusBackendClient executeStatusGoRequestWithCallback:@"SignMessage"
body:rpcParams
statusgoFunction:^NSString *{
return StatusgoSignMessage(rpcParams);
}
callback:callback];
}
#pragma mark - SignTypedData
@@ -4,6 +4,7 @@
#import "Statusgo.h"
#import "Utils.h"
#import "SSZipArchive.h"
#import "StatusBackendClient.h"
@implementation LogManager
@@ -14,15 +15,12 @@ RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(sendLogs:(NSString *)dbJson
jsLogs:(NSString *)jsLogs
callback:(RCTResponseSenderBlock)callback) {
// TODO: Implement SendLogs for iOS
#if DEBUG
NSLog(@"SendLogs() method called, not implemented");
NSLog(@"SendLogs() method called");
#endif
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error = nil;
NSURL *rootUrl =[[fileManager
URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask]
lastObject];
NSURL *rootUrl =[Utils getRootUrl];
NSURL *zipFile = [rootUrl URLByAppendingPathComponent:@"logs.zip"];
[fileManager removeItemAtPath:zipFile.path error:nil];
@@ -34,42 +32,19 @@ RCT_EXPORT_METHOD(sendLogs:(NSString *)dbJson
NSURL *dbFile = [logsFolderName URLByAppendingPathComponent:@"db.json"];
NSURL *jsLogsFile = [logsFolderName URLByAppendingPathComponent:@"Status.log"];
#if DEBUG
NSString *networkDirPath = @"ethereum/mainnet_rpc_dev";
#else
NSString *networkDirPath = @"ethereum/mainnet_rpc";
#endif
#if DEBUG
NSString *goerliNetworkDirPath = @"ethereum/goerli_rpc_dev";
#else
NSString *goerliNetworkDirPath = @"ethereum/goerli_rpc";
#endif
NSURL *networkDir = [rootUrl URLByAppendingPathComponent:networkDirPath];
NSURL *originalGethLogsFile = [networkDir URLByAppendingPathComponent:@"geth.log"];
NSURL *gethLogsFile = [logsFolderName URLByAppendingPathComponent:@"mainnet_geth.log"];
NSURL *goerliNetworkDir = [rootUrl URLByAppendingPathComponent:goerliNetworkDirPath];
NSURL *goerliGethLogsFile = [goerliNetworkDir URLByAppendingPathComponent:@"geth.log"];
NSURL *goerliLogsFile = [logsFolderName URLByAppendingPathComponent:@"goerli_geth.log"];
NSURL *mainGethLogsFile = [rootUrl URLByAppendingPathComponent:@"geth.log"];
NSURL *mainLogsFile = [logsFolderName URLByAppendingPathComponent:@"geth.log"];
NSURL *requestsLogFile = [rootUrl URLByAppendingPathComponent:@"requests.log"];
NSURL *requestsLogFile = [rootUrl URLByAppendingPathComponent:@"api.log"];
[dbJson writeToFile:dbFile.path atomically:YES encoding:NSUTF8StringEncoding error:nil];
[jsLogs writeToFile:jsLogsFile.path atomically:YES encoding:NSUTF8StringEncoding error:nil];
//NSString* gethLogs = StatusgoExportNodeLogs();
//[gethLogs writeToFile:gethLogsFile.path atomically:YES encoding:NSUTF8StringEncoding error:nil];
[fileManager copyItemAtPath:originalGethLogsFile.path toPath:gethLogsFile.path error:nil];
[fileManager copyItemAtPath:goerliGethLogsFile.path toPath:goerliLogsFile.path error:nil];
[fileManager copyItemAtPath:mainGethLogsFile.path toPath:mainLogsFile.path error:nil];
if ([fileManager fileExistsAtPath:requestsLogFile.path]) {
[fileManager copyItemAtPath:requestsLogFile.path toPath:[logsFolderName URLByAppendingPathComponent:@"requests.log"].path error:nil];
[fileManager copyItemAtPath:requestsLogFile.path toPath:[logsFolderName URLByAppendingPathComponent:@"api.log"].path error:nil];
}
[SSZipArchive createZipFileAtPath:zipFile.path withContentsOfDirectory:logsFolderName.path];
@@ -78,47 +53,9 @@ RCT_EXPORT_METHOD(sendLogs:(NSString *)dbJson
callback(@[zipFile.absoluteString]);
}
RCT_EXPORT_METHOD(initLogging:(BOOL)enabled
mobileSystem:(BOOL)mobileSystem
logLevel:(NSString *)logLevel
logRequestGo:(BOOL)logRequestGo
callback:(RCTResponseSenderBlock)callback)
{
NSString *logDirectory = [self logFileDirectory];
NSString *logFilePath = [logDirectory stringByAppendingPathComponent:@"geth.log"];
NSString *logRequestFilePath = [logDirectory stringByAppendingPathComponent:@"requests.log"];
NSMutableDictionary *jsonConfig = [NSMutableDictionary dictionary];
jsonConfig[@"Enabled"] = @(enabled);
jsonConfig[@"MobileSystem"] = @(mobileSystem);
jsonConfig[@"Level"] = logLevel;
jsonConfig[@"File"] = logFilePath;
jsonConfig[@"LogRequestGo"] = @(logRequestGo);
jsonConfig[@"LogRequestFile"] = logRequestFilePath;
NSError *error = nil;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonConfig options:0 error:&error];
if (error) {
// Handle JSON serialization error
callback(@[error.localizedDescription]);
return;
}
NSString *config = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
// Call your native logging initialization method here
NSString *initResult = StatusgoInitLogging(config);
callback(@[initResult]);
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(logFileDirectory) {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *rootUrl =[[fileManager
URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask]
lastObject];
NSURL *rootUrl = [Utils getRootUrl];
return rootUrl.path;
}
@end
@@ -3,14 +3,18 @@
#import "React/RCTEventDispatcher.h"
#import "Statusgo.h"
#import "Utils.h"
#import "StatusBackendClient.h"
@implementation NetworkManager
RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(startSearchForLocalPairingPeers:(RCTResponseSenderBlock)callback) {
NSString *result = StatusgoStartSearchForLocalPairingPeers();
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"StartSearchForLocalPairingPeers"
body:@""
statusgoFunction:^NSString *{
return StatusgoStartSearchForLocalPairingPeers();
}
callback:callback];
}
RCT_EXPORT_METHOD(getConnectionStringForBootstrappingAnotherDevice:(NSString *)configJSON
@@ -19,6 +23,11 @@ RCT_EXPORT_METHOD(getConnectionStringForBootstrappingAnotherDevice:(NSString *)c
NSData *configData = [configJSON dataUsingEncoding:NSUTF8StringEncoding];
NSError *error;
NSMutableDictionary *configDict = [NSJSONSerialization JSONObjectWithData:configData options:NSJSONReadingMutableContainers error:&error];
if (error) {
NSLog(@"Error parsing JSON: %@", error);
return;
}
NSMutableDictionary *senderConfig = configDict[@"senderConfig"];
NSString *keyUID = senderConfig[@"keyUID"];
NSURL *multiaccountKeystoreDir = [Utils getKeyStoreDirForKeyUID:keyUID];
@@ -27,16 +36,43 @@ RCT_EXPORT_METHOD(getConnectionStringForBootstrappingAnotherDevice:(NSString *)c
[senderConfig setValue:keystoreDir forKey:@"keystorePath"];
NSString *modifiedConfigJSON = [Utils jsonStringWithPrettyPrint:NO fromDictionary:configDict];
NSString *result = StatusgoGetConnectionStringForBootstrappingAnotherDevice(modifiedConfigJSON);
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"GetConnectionStringForBootstrappingAnotherDevice"
body:modifiedConfigJSON
statusgoFunction:^NSString *{
return StatusgoGetConnectionStringForBootstrappingAnotherDevice(modifiedConfigJSON);
}
callback:callback];
}
RCT_EXPORT_METHOD(inputConnectionStringForBootstrapping:(NSString *)cs
configJSON:(NSString *)configJSON
callback:(RCTResponseSenderBlock)callback) {
NSString *result = StatusgoInputConnectionStringForBootstrapping(cs, configJSON);
callback(@[result]);
NSData *configData = [configJSON dataUsingEncoding:NSUTF8StringEncoding];
NSError *jsonError;
NSDictionary *configDict = [NSJSONSerialization JSONObjectWithData:configData options:0 error:&jsonError];
if (jsonError) {
NSLog(@"Error parsing JSON: %@", jsonError);
return;
}
NSDictionary *params = @{
@"connectionString": cs,
@"receiverClientConfig": configDict
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", error);
return;
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[StatusBackendClient executeStatusGoRequestWithCallback:@"InputConnectionStringForBootstrappingV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoInputConnectionStringForBootstrappingV2(jsonString);
}
callback:callback];
}
RCT_EXPORT_METHOD(sendTransactionWithSignature:(NSString *)txArgsJSON
@@ -45,8 +81,12 @@ RCT_EXPORT_METHOD(sendTransactionWithSignature:(NSString *)txArgsJSON
#if DEBUG
NSLog(@"sendTransactionWithSignature() method called");
#endif
NSString *result = StatusgoSendTransactionWithSignature(txArgsJSON, signature);
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"SendTransactionWithSignature"
body:txArgsJSON
statusgoFunction:^NSString *{
return StatusgoSendTransactionWithSignature(txArgsJSON, signature);
}
callback:callback];
}
#pragma mark - SendTransaction
@@ -55,30 +95,53 @@ RCT_EXPORT_METHOD(sendTransaction:(NSString *)txArgsJSON
password:(NSString *)password
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"SendTransaction() method called");
NSLog(@"SendTransactionV2() method called");
#endif
NSString *result = StatusgoSendTransaction(txArgsJSON, password);
callback(@[result]);
NSData *txArgsData = [txArgsJSON dataUsingEncoding:NSUTF8StringEncoding];
NSError *jsonError;
NSDictionary *txArgsDict = [NSJSONSerialization JSONObjectWithData:txArgsData options:0 error:&jsonError];
if (jsonError) {
NSLog(@"Error parsing JSON: %@", jsonError);
return;
}
NSDictionary *params = @{
@"txArgs": txArgsDict,
@"password": password
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", error);
return;
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[StatusBackendClient executeStatusGoRequestWithCallback:@"SendTransactionV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoSendTransactionV2(jsonString);
}
callback:callback];
}
RCT_EXPORT_METHOD(callRPC:(NSString *)payload
callback:(RCTResponseSenderBlock)callback) {
dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSString *result = StatusgoCallRPC(payload);
dispatch_async(dispatch_get_main_queue(), ^{
callback(@[result]);
});
});
[StatusBackendClient executeStatusGoRequestWithCallback:@"CallRPC"
body:payload
statusgoFunction:^NSString *{
return StatusgoCallRPC(payload);
}
callback:callback];
}
RCT_EXPORT_METHOD(callPrivateRPC:(NSString *)payload
callback:(RCTResponseSenderBlock)callback) {
dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSString *result = StatusgoCallPrivateRPC(payload);
dispatch_async(dispatch_get_main_queue(), ^{
callback(@[result]);
});
});
[StatusBackendClient executeStatusGoRequestWithCallback:@"CallPrivateRPC"
body:payload
statusgoFunction:^NSString *{
return StatusgoCallPrivateRPC(payload);
}
callback:callback];
}
#pragma mark - Recover
@@ -88,8 +151,12 @@ RCT_EXPORT_METHOD(recover:(NSString *)message
#if DEBUG
NSLog(@"Recover() method called");
#endif
NSString *result = StatusgoRecover(message);
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"Recover"
body:message
statusgoFunction:^NSString *{
return StatusgoRecover(message);
}
callback:callback];
}
RCT_EXPORT_METHOD(getConnectionStringForExportingKeypairsKeystores:(NSString *)configJSON
@@ -106,8 +173,12 @@ RCT_EXPORT_METHOD(getConnectionStringForExportingKeypairsKeystores:(NSString *)c
[senderConfig setValue:keystoreDir forKey:@"keystorePath"];
NSString *modifiedConfigJSON = [Utils jsonStringWithPrettyPrint:NO fromDictionary:configDict];
NSString *result = StatusgoGetConnectionStringForExportingKeypairsKeystores(modifiedConfigJSON);
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"GetConnectionStringForExportingKeypairsKeystores"
body:modifiedConfigJSON
statusgoFunction:^NSString *{
return StatusgoGetConnectionStringForExportingKeypairsKeystores(modifiedConfigJSON);
}
callback:callback];
}
RCT_EXPORT_METHOD(inputConnectionStringForImportingKeypairsKeystores:(NSString *)cs
@@ -119,14 +190,25 @@ RCT_EXPORT_METHOD(inputConnectionStringForImportingKeypairsKeystores:(NSString *
NSMutableDictionary *configDict = [NSJSONSerialization JSONObjectWithData:configData options:NSJSONReadingMutableContainers error:&error];
NSMutableDictionary *receiverConfig = configDict[@"receiverConfig"];
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *rootUrl =[[fileManager URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask] lastObject];
NSURL *rootUrl =[Utils getRootUrl];
NSURL *multiaccountKeystoreDir = [rootUrl URLByAppendingPathComponent:@"keystore"];
NSString *keystoreDir = multiaccountKeystoreDir.path;
[receiverConfig setValue:keystoreDir forKey:@"keystorePath"];
NSString *modifiedConfigJSON = [Utils jsonStringWithPrettyPrint:NO fromDictionary:configDict];
NSString *result = StatusgoInputConnectionStringForImportingKeypairsKeystores(cs, modifiedConfigJSON);
callback(@[result]);
NSDictionary *params = @{
@"connectionString": cs,
@"keystoreFilesReceiverClientConfig": modifiedConfigJSON
};
NSString *paramsJSON = [Utils jsonStringWithPrettyPrint:NO fromDictionary:params];
[StatusBackendClient executeStatusGoRequestWithCallback:@"InputConnectionStringForImportingKeypairsKeystoresV2"
body:paramsJSON
statusgoFunction:^NSString *{
return StatusgoInputConnectionStringForImportingKeypairsKeystoresV2(paramsJSON);
}
callback:callback];
}
@end
@@ -5,5 +5,6 @@
#import "RCTLog.h"
@interface Status : NSObject <RCTBridgeModule, StatusgoSignalHandler>
+ (Status *)sharedInstance;
- (void)handleSignal:(NSString *)signal;
@end
@@ -2,13 +2,22 @@
#import "React/RCTBridge.h"
#import "React/RCTEventDispatcher.h"
#import "Statusgo.h"
#import "StatusBackendClient.h"
#import "Utils.h"
static RCTBridge *bridge;
@implementation Status
+ (Status *)sharedInstance {
static Status *sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [[self alloc] init];
});
return sharedInstance;
}
- (instancetype)init {
self = [super init];
if (!self) {
@@ -73,74 +82,17 @@ RCT_EXPORT_METHOD(deleteImportedKey:(NSString *)keyUID
password:(NSString *)password
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"DeleteImportedKey() method called");
NSLog(@"DeleteImportedKeyV2() method called");
#endif
NSURL *multiaccountKeystoreDir = [Utils getKeyStoreDirForKeyUID:keyUID];
NSString *result = StatusgoDeleteImportedKey(address, password, multiaccountKeystoreDir.path);
callback(@[result]);
}
RCT_EXPORT_METHOD(multiAccountGenerateAndDeriveAddresses:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"MultiAccountGenerateAndDeriveAddresses() method called");
#endif
NSString *result = StatusgoMultiAccountGenerateAndDeriveAddresses(json);
callback(@[result]);
}
RCT_EXPORT_METHOD(multiAccountStoreAccount:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"MultiAccountStoreAccount() method called");
#endif
NSString *result = StatusgoMultiAccountStoreAccount(json);
callback(@[result]);
}
RCT_EXPORT_METHOD(multiAccountLoadAccount:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"MultiAccountLoadAccount() method called");
#endif
NSString *result = StatusgoMultiAccountLoadAccount(json);
callback(@[result]);
}
RCT_EXPORT_METHOD(multiAccountStoreDerived:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"MultiAccountStoreDerived() method called");
#endif
NSString *result = StatusgoMultiAccountStoreDerivedAccounts(json);
callback(@[result]);
}
RCT_EXPORT_METHOD(multiAccountImportPrivateKey:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"MultiAccountImportPrivateKey() method called");
#endif
NSString *result = StatusgoMultiAccountImportPrivateKey(json);
callback(@[result]);
}
RCT_EXPORT_METHOD(multiAccountImportMnemonic:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"MultiAccountImportMnemonic() method called");
#endif
NSString *result = StatusgoMultiAccountImportMnemonic(json);
callback(@[result]);
}
RCT_EXPORT_METHOD(multiAccountDeriveAddresses:(NSString *)json
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"MultiAccountDeriveAddresses() method called");
#endif
NSString *result = StatusgoMultiAccountDeriveAddresses(json);
callback(@[result]);
NSString *jsonParams = [NSString stringWithFormat:@"{\"address\":\"%@\",\"password\":\"%@\",\"keyStoreDir\":\"%@\"}",
address, password, multiaccountKeystoreDir.path];
[StatusBackendClient executeStatusGoRequestWithCallback:@"DeleteImportedKeyV2"
body:jsonParams
statusgoFunction:^NSString *{
return StatusgoDeleteImportedKeyV2(jsonParams);
}
callback:callback];
}
#pragma mark - GetNodeConfig
@@ -149,12 +101,20 @@ RCT_EXPORT_METHOD(getNodeConfig:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"GetNodeConfig() method called");
#endif
NSString *result = StatusgoGetNodeConfig();
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"GetNodeConfig"
body:@""
statusgoFunction:^NSString *{
return StatusgoGetNodeConfig();
}
callback:callback];
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(fleets) {
return StatusgoFleets();
return [StatusBackendClient executeStatusGoRequestWithResult:@"Fleets"
body:@""
statusgoFunction:^NSString *{
return StatusgoFleets();
}];
}
RCT_EXPORT_METHOD(closeApplication) {
@@ -166,14 +126,55 @@ RCT_EXPORT_METHOD(connectionChange:(NSString *)type
#if DEBUG
NSLog(@"ConnectionChange() method called");
#endif
StatusgoConnectionChange(type, isExpensive ? 1 : 0);
NSDictionary *params = @{
@"type": type,
@"expensive": @(isExpensive)
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params
options:0
error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", error);
return;
}
if (jsonData) {
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[StatusBackendClient executeStatusGoRequest:@"ConnectionChangeV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoConnectionChangeV2(jsonString);
}];
} else {
NSLog(@"Failed to create JSON data");
}
}
RCT_EXPORT_METHOD(appStateChange:(NSString *)type) {
RCT_EXPORT_METHOD(appStateChange:(NSString *)state) {
#if DEBUG
NSLog(@"AppStateChange() method called");
#endif
StatusgoAppStateChange(type);
NSDictionary *params = @{@"state": state};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params
options:0
error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", error);
return;
}
if (jsonData) {
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[StatusBackendClient executeStatusGoRequest:@"AppStateChangeV2"
body:jsonString
statusgoFunction:^NSString *{
return StatusgoAppStateChangeV2(jsonString);
}];
} else {
NSLog(@"Failed to create JSON data");
}
}
RCT_EXPORT_METHOD(addCentralizedMetric:(NSString *)request
@@ -181,8 +182,12 @@ RCT_EXPORT_METHOD(addCentralizedMetric:(NSString *)request
#if DEBUG
NSLog(@"addCentralizedMetric() method called");
#endif
NSString *result = StatusgoAddCentralizedMetric(request);
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"AddCentralizedMetric"
body:request
statusgoFunction:^NSString *{
return StatusgoAddCentralizedMetric(request);
}
callback:callback];
}
RCT_EXPORT_METHOD(toggleCentralizedMetrics:(NSString *)request
@@ -190,15 +195,23 @@ RCT_EXPORT_METHOD(toggleCentralizedMetrics:(NSString *)request
#if DEBUG
NSLog(@"toggleCentralizedMetrics() method called");
#endif
NSString *result = StatusgoToggleCentralizedMetrics(request);
callback(@[result]);
[StatusBackendClient executeStatusGoRequestWithCallback:@"ToggleCentralizedMetrics"
body:request
statusgoFunction:^NSString *{
return StatusgoToggleCentralizedMetrics(request);
}
callback:callback];
}
RCT_EXPORT_METHOD(startLocalNotifications) {
#if DEBUG
NSLog(@"StartLocalNotifications() method called");
#endif
StatusgoStartLocalNotifications();
[StatusBackendClient executeStatusGoRequest:@"StartLocalNotifications"
body:@""
statusgoFunction:^NSString *{
return StatusgoStartLocalNotifications();
}];
}
#pragma mark - deviceinfo
@@ -0,0 +1,31 @@
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
@interface StatusBackendClient : NSObject <RCTBridgeModule>
@property (nonatomic) BOOL serverEnabled;
@property (nonatomic, strong) NSString *statusGoEndpoint;
@property (nonatomic, strong) NSString *signalEndpoint;
@property (nonatomic, strong) NSString *rootDataDir;
@property (nonatomic, strong) NSURLSessionWebSocketTask *webSocket;
// Add sharedInstance class method declaration
+ (instancetype)sharedInstance;
- (void)request:(NSString *)endpoint
body:(NSString *)body
callback:(void (^)(NSString *response, NSError *error))callback;
+ (void)executeStatusGoRequest:(NSString *)endpoint
body:(NSString *)body
statusgoFunction:(NSString * (^)(void))statusgoFunction;
+ (void)executeStatusGoRequestWithCallback:(NSString *)endpoint
body:(NSString *)body
statusgoFunction:(NSString * (^)(void))statusgoFunction
callback:(RCTResponseSenderBlock)callback;
+ (NSString *)executeStatusGoRequestWithResult:(NSString *)endpoint
body:(NSString *)body
statusgoFunction:(NSString * (^)(void))statusgoFunction;
@end
@@ -0,0 +1,279 @@
#import "StatusBackendClient.h"
#import "RCTStatus.h"
#import "Utils.h"
@implementation StatusBackendClient {
NSURLSessionWebSocketTask *_webSocket;
BOOL _serverEnabled;
NSString *_statusGoEndpoint;
NSString *_signalEndpoint;
NSString *_rootDataDir;
NSTimer *_pingTimer;
}
RCT_EXPORT_MODULE();
+ (BOOL)requiresMainQueueSetup {
return YES;
}
+ (instancetype)allocWithZone:(NSZone *)zone {
static StatusBackendClient *sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [super allocWithZone:zone];
});
return sharedInstance;
}
+ (instancetype)sharedInstance {
return [[self alloc] init];
}
- (instancetype)init {
static StatusBackendClient *sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [super init];
if (sharedInstance) {
sharedInstance->_serverEnabled = NO;
sharedInstance->_statusGoEndpoint = nil;
sharedInstance->_signalEndpoint = nil;
sharedInstance->_rootDataDir = nil;
sharedInstance->_webSocket = nil;
}
});
return sharedInstance;
}
- (id)copyWithZone:(NSZone *)zone {
return self;
}
- (BOOL)serverEnabled {
return _serverEnabled;
}
- (NSString *)statusGoEndpoint {
return _statusGoEndpoint;
}
- (NSString *)signalEndpoint {
return _signalEndpoint;
}
- (NSString *)rootDataDir {
return _rootDataDir;
}
- (void)connectWebSocket {
if (!self.serverEnabled || !self.signalEndpoint) {
return;
}
NSString *fullUrl = [NSString stringWithFormat:@"%@", self.signalEndpoint];
NSURL *url = [NSURL URLWithString:fullUrl];
NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
self.webSocket = [session webSocketTaskWithURL:url];
[self.webSocket resume];
[self receiveMessage];
[self startPingTimer];
}
- (void)receiveMessage {
__weak typeof(self) weakSelf = self;
[self.webSocket receiveMessageWithCompletionHandler:^(NSURLSessionWebSocketMessage *message, NSError *error) {
__strong typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf || !strongSelf.webSocket) {
return;
}
if (error) {
NSLog(@"WebSocket error: %@", error);
// Attempt to reconnect after error
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[strongSelf connectWebSocket];
});
return;
}
if (message) {
if (message.type == NSURLSessionWebSocketMessageTypeString && message.string) {
[[Status sharedInstance] handleSignal:message.string];
}
// Continue receiving messages only if the connection is still active
if (strongSelf.webSocket) {
[strongSelf receiveMessage];
}
}
}];
}
- (void)disconnectWebSocket {
[self stopPingTimer];
if (self.webSocket) {
[self.webSocket cancel];
self.webSocket = nil;
}
}
- (void)request:(NSString *)endpoint
body:(NSString *)body
callback:(void (^)(NSString *response, NSError *error))callback {
NSString *fullUrlString = [NSString stringWithFormat:@"%@%@", self.statusGoEndpoint, endpoint];
NSLog(@"StatusGo server is enabled, executing request, endpoint: %@, body: %@", fullUrlString, body);
NSURL *url = [NSURL URLWithString:fullUrlString];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
request.HTTPMethod = @"POST";
[request setValue:@"application/json; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
NSData *bodyData = [body dataUsingEncoding:NSUTF8StringEncoding];
request.HTTPBody = bodyData;
NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
NSURLSession *session = [NSURLSession sessionWithConfiguration:config];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"request error: %@", error);
callback(nil, error);
return;
}
NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
callback(responseString, nil);
}];
[task resume];
}
RCT_EXPORT_METHOD(configStatusBackendServer:(BOOL)serverEnabled
statusGoEndpoint:(NSString *)statusGoEndpoint
signalEndpoint:(NSString *)signalEndpoint
rootDataDir:(NSString *)rootDataDir) {
[self configureWithEnabled:serverEnabled
statusGoEndpoint:statusGoEndpoint
signalEndpoint:signalEndpoint
rootDataDir:rootDataDir];
}
- (void)configureWithEnabled:(BOOL)serverEnabled
statusGoEndpoint:(NSString *)statusGoEndpoint
signalEndpoint:(NSString *)signalEndpoint
rootDataDir:(NSString *)rootDataDir {
_serverEnabled = serverEnabled;
if (serverEnabled) {
_statusGoEndpoint = statusGoEndpoint;
_signalEndpoint = signalEndpoint;
_rootDataDir = rootDataDir;
[self connectWebSocket];
} else {
[self disconnectWebSocket];
_statusGoEndpoint = nil;
_signalEndpoint = nil;
_rootDataDir = nil;
}
}
+ (void)executeStatusGoRequest:(NSString *)endpoint
body:(NSString *)body
statusgoFunction:(NSString * (^)(void))statusgoFunction {
StatusBackendClient *client = [StatusBackendClient sharedInstance];
if (client.serverEnabled) {
[client request:endpoint body:body callback:^(NSString *response, NSError *error) {
[Utils handleStatusGoResponse:response source:endpoint error:error];
}];
} else {
NSString *result = statusgoFunction();
[Utils handleStatusGoResponse:result source:endpoint error:nil];
}
}
+ (void)executeStatusGoRequestWithCallback:(NSString *)endpoint
body:(NSString *)body
statusgoFunction:(NSString * (^)(void))statusgoFunction
callback:(RCTResponseSenderBlock)callback {
StatusBackendClient *client = [StatusBackendClient sharedInstance];
if (client.serverEnabled) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[client request:endpoint body:body callback:^(NSString *response, NSError *error) {
if (error) {
NSLog(@"request to %@ failed: %@", endpoint, error);
if (callback) {
callback(@[@(NO)]);
}
} else {
if (callback) {
callback(@[response]);
}
}
}];
});
} else {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSString *result = statusgoFunction();
if (callback) {
callback(@[result]);
}
});
}
}
+ (NSString *)executeStatusGoRequestWithResult:(NSString *)endpoint
body:(NSString *)body
statusgoFunction:(NSString * (^)(void))statusgoFunction {
StatusBackendClient *client = [StatusBackendClient sharedInstance];
if (client.serverEnabled) {
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
__block NSString *resultString = @"";
[client request:endpoint body:body callback:^(NSString *response, NSError *error) {
if (error) {
NSLog(@"request to %@ failed: %@", endpoint, error);
resultString = @"";
} else {
resultString = response;
}
dispatch_semaphore_signal(semaphore);
}];
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
return resultString;
} else {
return statusgoFunction();
}
}
- (void)startPingTimer {
[self stopPingTimer];
_pingTimer = [NSTimer scheduledTimerWithTimeInterval:30.0
target:self
selector:@selector(sendPing)
userInfo:nil
repeats:YES];
}
- (void)stopPingTimer {
if (_pingTimer) {
[_pingTimer invalidate];
_pingTimer = nil;
}
}
- (void)sendPing {
if (self.webSocket) {
[self.webSocket sendPingWithPongReceiveHandler:^(NSError * _Nullable error) {
if (error) {
NSLog(@"WebSocket ping failed: %@", error);
// Reconnect on ping failure
[self disconnectWebSocket];
[self connectWebSocket];
}
}];
}
}
@end
@@ -6,11 +6,13 @@
@interface Utils : NSObject <RCTBridgeModule>
+ (NSURL *)getRootUrl;
+ (NSString *)jsonStringWithPrettyPrint:(BOOL)prettyPrint fromDictionary:(NSDictionary *)dictionary;
+ (NSString *)jsonStringWithPrettyPrint:(BOOL)prettyPrint fromArray:(NSArray *)array;
+ (NSURL *)getKeyStoreDirForKeyUID:(NSString *)keyUID;
+ (NSString *)getExportDbFilePath;
+ (NSString *)getKeyUID:(NSString *)jsonString;
+ (void)migrateKeystore:(NSString *)accountData password:(NSString *)password;
+ (void)handleStatusGoResponse:(NSString *)response source:(NSString *)source error:(NSError *)error;
@end
@@ -3,11 +3,28 @@
#import "React/RCTEventDispatcher.h"
#import "Statusgo.h"
#import "Utils.h"
#import "StatusBackendClient.h"
@implementation Utils
RCT_EXPORT_MODULE();
#pragma mark - Private Methods
+ (NSURL *)getRootUrl {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *rootUrl;
StatusBackendClient *client = [StatusBackendClient sharedInstance];
if (client.serverEnabled && client.rootDataDir) {
rootUrl = [NSURL fileURLWithPath:client.rootDataDir];
} else {
rootUrl = [[fileManager URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask] lastObject];
}
return rootUrl;
}
+ (NSString *)jsonStringWithPrettyPrint:(BOOL)prettyPrint fromDictionary:(NSDictionary *)dictionary {
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dictionary
@@ -38,7 +55,7 @@ RCT_EXPORT_MODULE();
+ (NSURL *)getKeyStoreDirForKeyUID:(NSString *)keyUID {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *rootUrl = [[fileManager URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask] lastObject];
NSURL *rootUrl = [self getRootUrl];
NSURL *oldKeystoreDir = [rootUrl URLByAppendingPathComponent:@"keystore"];
NSURL *multiaccountKeystoreDir = [oldKeystoreDir URLByAppendingPathComponent:keyUID];
@@ -57,6 +74,11 @@ RCT_EXPORT_MODULE();
}
+ (NSString *) getExportDbFilePath {
StatusBackendClient *client = [StatusBackendClient sharedInstance];
if (client.serverEnabled && client.rootDataDir) {
return [client.rootDataDir stringByAppendingPathComponent:@"export.db"];
}
NSString *filePath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"export.db"];
NSFileManager *fileManager = [NSFileManager defaultManager];
@@ -70,17 +92,36 @@ RCT_EXPORT_MODULE();
+ (void) migrateKeystore:(NSString *)accountData
password:(NSString *)password {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *rootUrl =[[fileManager
URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask]
lastObject];
NSURL *rootUrl =[self getRootUrl];
NSURL *keyUID = [self getKeyStoreDirForKeyUID:accountData];
NSData *jsonData = [accountData dataUsingEncoding:NSUTF8StringEncoding];
NSError *error;
NSDictionary *accountJson = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error];
if (error) {
NSLog(@"Error parsing accountData: %@", error);
return;
}
NSString *keyUID = [self getKeyUID:accountData];
NSURL *oldKeystoreDir = [rootUrl URLByAppendingPathComponent:@"keystore"];
NSURL *multiaccountKeystoreDir = [self getKeyStoreDirForKeyUID:keyUID.path];
NSURL *multiaccountKeystoreDir = [self getKeyStoreDirForKeyUID:keyUID];
NSArray *keys = [fileManager contentsOfDirectoryAtPath:multiaccountKeystoreDir.path error:nil];
if (keys.count == 0) {
NSString *migrationResult = StatusgoMigrateKeyStoreDir(accountData, password, oldKeystoreDir.path, multiaccountKeystoreDir.path);
NSDictionary *params = @{
@"account": accountJson,
@"password": password,
@"oldDir": oldKeystoreDir.path,
@"newDir": multiaccountKeystoreDir.path
};
NSData *paramsJsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating params JSON: %@", error);
return;
}
NSString *jsonString = [[NSString alloc] initWithData:paramsJsonData encoding:NSUTF8StringEncoding];
NSString *migrationResult = StatusgoMigrateKeyStoreDirV2(jsonString);
NSLog(@"keystore migration result %@", migrationResult);
NSString *initKeystoreResult = StatusgoInitKeystore(multiaccountKeystoreDir.path);
@@ -89,18 +130,19 @@ RCT_EXPORT_MODULE();
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(backupDisabledDataDir) {
StatusBackendClient *client = [StatusBackendClient sharedInstance];
if (client.serverEnabled && client.rootDataDir) {
return client.rootDataDir;
}
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *rootUrl =[[fileManager
URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask]
lastObject];
NSURL *rootUrl = [Utils getRootUrl];
return rootUrl.path;
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(keystoreDir) {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *rootUrl =[[fileManager
URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask]
lastObject];
NSURL *rootUrl =[Utils getRootUrl];
NSURL *commonKeystoreDir = [rootUrl URLByAppendingPathComponent:@"keystore"];
@@ -110,9 +152,17 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(keystoreDir) {
RCT_EXPORT_METHOD(validateMnemonic:(NSString *)seed
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"validateMnemonic() method called");
NSLog(@"validateMnemonicV2() method called");
#endif
NSString *result = StatusgoValidateMnemonic(seed);
NSDictionary *params = @{@"mnemonic": seed};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];
if (error) {
NSLog(@"Error creating JSON: %@", error);
return;
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSString *result = StatusgoValidateMnemonicV2(jsonString);
callback(@[result]);
}
@@ -132,4 +182,17 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(validateConnectionString:(NSString *)cs)
return StatusgoValidateConnectionString(cs);
}
+ (void)handleStatusGoResponse:(NSString *)response source:(NSString *)source error:(NSError *)error {
if (error) {
NSLog(@"%@ failed: %@", source, error);
return;
}
if ([response hasPrefix:@"{\"error\":\"\""]) {
NSLog(@"%@ success: %@", source, response);
} else {
NSLog(@"%@ failed: %@", source, response);
}
}
@end
@@ -1946,35 +1946,6 @@ void _ConnectionChange(const FunctionCallbackInfo<Value>& args) {
ConnectionChange(arg0, arg1);
}
void _InitLogging(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
Local<Context> context = isolate->GetCurrentContext();
if (args.Length() != 1) {
// Throw an Error that is passed back to JavaScript
isolate->ThrowException(Exception::TypeError(
String::NewFromUtf8Literal(isolate, "Wrong number of arguments for InitLogging")));
return;
}
// Check the argument types
if (!args[0]->IsString()) {
isolate->ThrowException(Exception::TypeError(
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'logSettingsJSON'")));
return;
}
String::Utf8Value arg0Obj(isolate, args[0]->ToString(context).ToLocalChecked());
char *arg0 = *arg0Obj;
// Call exported Go function, which returns a C string
char *c = InitLogging(arg0);
Local<String> ret = String::NewFromUtf8(isolate, c).ToLocalChecked();
args.GetReturnValue().Set(ret);
delete c;
}
void _RestoreAccountAndLogin(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
Local<Context> context = isolate->GetCurrentContext();
@@ -2064,7 +2035,6 @@ void init(Local<Object> exports) {
NODE_SET_METHOD(exports, "hashTransaction", _HashTransaction);
NODE_SET_METHOD(exports, "connectionChange", _ConnectionChange);
NODE_SET_METHOD(exports, "pollSignal", _PollSignal);
NODE_SET_METHOD(exports, "initLogging", _InitLogging);
NODE_SET_METHOD(exports, "restoreAccountAndLogin", _RestoreAccountAndLogin);
}
+183 -198
View File
@@ -8789,31 +8789,31 @@
},
{
"path": "com/github/status-im/status-keycard-java/android/3.1.1",
"path": "com/github/status-im/status-keycard-java/android/3.1.2",
"repo": "https://jitpack.io",
"files": {
"android-3.1.1.pom": {
"sha1": "ac7e6699628e329dfc028345f32bc41c5d6c2f33",
"sha256": "sha256-EvrtvGGyvB3Fxp72KXYl46pIsxgf8vDMXk9IZjkuEIs="
"android-3.1.2.pom": {
"sha1": "9afce579939bad3c2b6d15787a0c861f6dbd9afa",
"sha256": "sha256-hNYvQQKfHNmbGQw5P0sssZAI11wfRhLir46QdukK0bs="
},
"android-3.1.1.jar": {
"sha1": "26118061c0996fff357ae30cc360e5928c8dd455",
"sha256": "sha256-4IjMQ6ZLAlsk4JC9sumOsRhdOF1F0L3Jl8dbEDOBoJY="
"android-3.1.2.jar": {
"sha1": "46fe72fb8fca5935c73e0df5c10ccdd5c64fca8e",
"sha256": "sha256-QNpDWQ1TWvCWg3YdL4UWSEiafpoHavXSY3VWCN45rtE="
}
}
},
{
"path": "com/github/status-im/status-keycard-java/lib/3.1.1",
"path": "com/github/status-im/status-keycard-java/lib/3.1.2",
"repo": "https://jitpack.io",
"files": {
"lib-3.1.1.pom": {
"sha1": "63c7bbd55ddbf88d1b89941f78158aa07fb46873",
"sha256": "sha256-ERsZGvECIQGlNusSk+13760//JU6SaONxOW9b3AHFvQ="
"lib-3.1.2.pom": {
"sha1": "0c0d8ef7318ba054457dea1e6624e0284aec91ca",
"sha256": "sha256-Vs9p287YNgMD76/egyeHTqlIsENjwbZsspQbzs8QkeY="
},
"lib-3.1.1.jar": {
"sha1": "07f0374f17160c8731350316226ffe0de50f6f31",
"sha256": "sha256-oaolZh+Ad/Dq6byP3SU8z19gUjPdV8wM0Ryobj1Y260="
"lib-3.1.2.jar": {
"sha1": "5df9eef589a72c5a3143f59b0f547092aeb0c309",
"sha256": "sha256-M0P6r96RkgaIjC912Z/VxJgHmfm/ftl7rqYOto8A0Ic="
}
}
},
@@ -9082,16 +9082,16 @@
},
{
"path": "commons-io/commons-io/2.17.0",
"path": "commons-io/commons-io/2.18.0",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"commons-io-2.17.0.pom": {
"sha1": "af3aa19bcc67a14e5d0dad042e7d985f733cdff4",
"sha256": "sha256-SEqTn/9TELjLXGuQKcLc8VXT+TuLjWKF8/VrsroJ/Ek="
"commons-io-2.18.0.pom": {
"sha1": "cbd7a6fd54081f8e3d2a90c3cb74a91a31662a86",
"sha256": "sha256-Y9lpQetE35yQ0q2yrYw/aZwuBl5wcEXF2vcT/KUrz8o="
},
"commons-io-2.17.0.jar": {
"sha1": "ddcc8433eb019fb48fe25207c0278143f3e1d7e2",
"sha256": "sha256-SqTKSPPf0wt4Igt4gdjLk+rECT7JQ2G2vvqUh5mKVQs="
"commons-io-2.18.0.jar": {
"sha1": "44084ef756763795b31c578403dd028ff4a22950",
"sha256": "sha256-88oPjWPEDiOlbVQQHGDV7e4Ta0LYS/uFvHljCTEJz4s="
}
}
},
@@ -10987,20 +10987,20 @@
},
{
"path": "com/fasterxml/jackson/core/jackson-annotations/2.18.0",
"path": "com/fasterxml/jackson/core/jackson-annotations/2.18.2",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"jackson-annotations-2.18.0.pom": {
"sha1": "15e211c936f255998ba87e8a80c14989f9895f08",
"sha256": "sha256-pqA47zy3L8FXW5w4ZdpK2arX0COo1J3K0DeRBlVx6Bw="
"jackson-annotations-2.18.2.pom": {
"sha1": "40ab24a80879d82a46bd3653a43da88917e929c0",
"sha256": "sha256-CyvWlOqJJn7qSBJqilskplI0xkM4dULSRGnRlb+6HPg="
},
"jackson-annotations-2.18.0.jar": {
"sha1": "9bddcc56af9d90f902ef5dba7348102cd12b04e2",
"sha256": "sha256-oJNn0u61Joc6v3N/91TFCF+CBzo4LucsO74VQSIXZx8="
"jackson-annotations-2.18.2.jar": {
"sha1": "985d77751ebc7fce5db115a986bc9aa82f973f4a",
"sha256": "sha256-WBvWEADvdkiUP3gcoFaJ5W0D9gUnSDZajis6m10/oy8="
},
"jackson-annotations-2.18.0.module": {
"sha1": "c84262b96118cbb3bc27bf127735b93b18728a6c",
"sha256": "sha256-DwmMCDBXb8nHVdQ9fzFuinV8k4ErNXdRJbNo/rzWA10="
"jackson-annotations-2.18.2.module": {
"sha1": "9bd316d8447c1738d7bbfcc373693627c38eaea4",
"sha256": "sha256-4Ruvm1NubflNqmNaEBPsPgabhmuOES3cKqBEahVQUNw="
}
}
},
@@ -11021,20 +11021,20 @@
},
{
"path": "com/fasterxml/jackson/core/jackson-core/2.18.0",
"path": "com/fasterxml/jackson/core/jackson-core/2.18.2",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"jackson-core-2.18.0.pom": {
"sha1": "1d9d4da19eb2b14ba2975c254b6bfdd8ac4894fd",
"sha256": "sha256-2u9SqBcSdESKRuwovBCgBQldduysz4Fbp6Y6AaiGf2c="
"jackson-core-2.18.2.pom": {
"sha1": "9a77a48adfca5182e9f8b3ee20ee2b186477b089",
"sha256": "sha256-4GWwA50h9N/ORr1DEEx9dtWFa9cy4qqGDMWkonDtct4="
},
"jackson-core-2.18.0.jar": {
"sha1": "65e8ead7de5d8f7a53e296c363bea3182f21f925",
"sha256": "sha256-IVu9fI/WW+UEy5L/OqHEt5D8exTMpy9FRqrEFDwQG7U="
"jackson-core-2.18.2.jar": {
"sha1": "fb64ccac5c27dca8819418eb4e443a9f496d9ee7",
"sha256": "sha256-2AVK58DRwtL1XSjkYCbr5YkogfP6tfQ5IzGEOBw7Sh8="
},
"jackson-core-2.18.0.module": {
"sha1": "b7e0781f9c8f54d94d5e28bad1816c7a8c3a6799",
"sha256": "sha256-xSmBTu77fwRPz2UL+lJ+60totpYGfLZMGmmUcvs1ZYc="
"jackson-core-2.18.2.module": {
"sha1": "6a97d687f4996c423f97dc56f7e63860581f0f05",
"sha256": "sha256-ynjGBDZ2f8w2zhRrd05PUKnLn2MtExcsRLrojgwDz6I="
}
}
},
@@ -11055,20 +11055,20 @@
},
{
"path": "com/fasterxml/jackson/core/jackson-databind/2.18.0",
"path": "com/fasterxml/jackson/core/jackson-databind/2.18.2",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"jackson-databind-2.18.0.pom": {
"sha1": "3e52a2c42c3824afc2e696dad92f94dd6c1067fb",
"sha256": "sha256-+Mn0Od1EsdAkLWbmlB2pfFe6hONANu7peqHDr/vxugQ="
"jackson-databind-2.18.2.pom": {
"sha1": "65295373e682120eba7894bb6632d6f8d17d5d6c",
"sha256": "sha256-STo9tkR7eo7Ls3JCNMbOZ31y20sE9roAjw6+rqe+Wp0="
},
"jackson-databind-2.18.0.jar": {
"sha1": "8dba1f789a75fc30b59303574fe2b269afa4d3bc",
"sha256": "sha256-K/GSe38yJGg+0BV6HsOw7edRedo+WX14xXLVbtAPnzw="
"jackson-databind-2.18.2.jar": {
"sha1": "deef8697b92141fb6caf7aa86966cff4eec9b04f",
"sha256": "sha256-SzZOaFDciRcvzx1N0muP9UiO2kT/RlfiLdJlID3Vqzw="
},
"jackson-databind-2.18.0.module": {
"sha1": "49c271f0ef5bb935ca797921904e7ebe138925e3",
"sha256": "sha256-LEnsfnQwbUh/lVkbqJiQRhnDKi4/0bWG+z5jIskaTmI="
"jackson-databind-2.18.2.module": {
"sha1": "8bc88e1ebdc91d61f75e1dabb3cdeaca74ad0032",
"sha256": "sha256-jH2sL3J4GNiEeoKqTqxrAXTXnPBN+Q3iJGBy5t005wA="
}
}
},
@@ -11100,12 +11100,12 @@
},
{
"path": "com/fasterxml/jackson/jackson-base/2.18.0",
"path": "com/fasterxml/jackson/jackson-base/2.18.2",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"jackson-base-2.18.0.pom": {
"sha1": "d445ae58e3b3a15aa50a3e3707eaf46463b121e6",
"sha256": "sha256-EFZMv/uFf5BlqhG1hJqMMIw1NfD1PG9Muytvt7NQf5c="
"jackson-base-2.18.2.pom": {
"sha1": "08e5c4c7f519a42a74dac257c922a7adbb4dda1b",
"sha256": "sha256-71dLcvW0iUgET2g3a4dMiK4JoCncjgX2Shwwvftt4Uo="
}
}
},
@@ -11122,12 +11122,12 @@
},
{
"path": "com/fasterxml/jackson/jackson-bom/2.18.0",
"path": "com/fasterxml/jackson/jackson-bom/2.18.2",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"jackson-bom-2.18.0.pom": {
"sha1": "02fecc45cb9609006d979cb8f06f8a571957a0b8",
"sha256": "sha256-ut3oZMpztsoE3p9+5J5knhpeivj4x8FoLHRr5eI0xYc="
"jackson-bom-2.18.2.pom": {
"sha1": "b269a504e4c7d10af05db454c367fb03d6c434b6",
"sha256": "sha256-UkfNwwFyXT9n9+8EkDconVr3CdaXK89LFwluRUjSlWs="
}
}
},
@@ -11144,12 +11144,12 @@
},
{
"path": "com/fasterxml/jackson/jackson-parent/2.18",
"path": "com/fasterxml/jackson/jackson-parent/2.18.1",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"jackson-parent-2.18.pom": {
"sha1": "3696eb746d84dafc7933ec26f13f4fb407530ab0",
"sha256": "sha256-Vp3ADWi05t993oVimeHANT+kC9rxI+DfVj7L7kFlhtk="
"jackson-parent-2.18.1.pom": {
"sha1": "fcd5c9c72aeebb63d13eb4330842fdb8ae4f9a1c",
"sha256": "sha256-0IIvrBoCJoRLitRFySDEmk9hkWnQmxAQp9/u0ZkQmYw="
}
}
},
@@ -11166,12 +11166,12 @@
},
{
"path": "com/fasterxml/jackson/module/jackson-modules-base/2.18.0",
"path": "com/fasterxml/jackson/module/jackson-modules-base/2.18.2",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"jackson-modules-base-2.18.0.pom": {
"sha1": "6c3a68a52acce7482ba68999bd9b06a076b4c0ce",
"sha256": "sha256-vtjbLqeIGzWwOA9V+67R1Wv+P9o6AmB0Ww9dXqzteyk="
"jackson-modules-base-2.18.2.pom": {
"sha1": "a38a7c307ae9250be61ea90b86dab2b3b504f847",
"sha256": "sha256-wVCoPSPNizMiqqSYmEh0J5vi3I1f4qN5B9P1arYOJpw="
}
}
},
@@ -11192,20 +11192,20 @@
},
{
"path": "com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.18.0",
"path": "com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.18.2",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"jackson-module-jaxb-annotations-2.18.0.pom": {
"sha1": "40eb69b3a20fb98faf66bee669b60e0fbda324ad",
"sha256": "sha256-rOb/zJ9+f89Atu3uRVB6FQJdI5N6PbBSxDNSeVdJQ9c="
"jackson-module-jaxb-annotations-2.18.2.pom": {
"sha1": "36b8fbaf3577061bb92ecf23d6aa9d802558fdb4",
"sha256": "sha256-T2FGzIFi5nDA1ERI8q1Iqf9WSeQHFmhM+gSua2Bm+fA="
},
"jackson-module-jaxb-annotations-2.18.0.jar": {
"sha1": "62cc7b7517b752360fef4796e396363a2396d29c",
"sha256": "sha256-WStXNngYHG2Te1dJnDqGrON3knBrVoRFc3FcC7muw30="
"jackson-module-jaxb-annotations-2.18.2.jar": {
"sha1": "048c96032e5a428739e28ff04973717c032df598",
"sha256": "sha256-ZFyk3imYBHPxmubAjXws4OP9JzJE0xVbXao7yC+hPUE="
},
"jackson-module-jaxb-annotations-2.18.0.module": {
"sha1": "7adb3648b6e45a0ce0afd75efca142268ca592a1",
"sha256": "sha256-66HSqRlv9sC7h9CrfZ6Ta5i2y7eZH8DUShi2gtBDmns="
"jackson-module-jaxb-annotations-2.18.2.module": {
"sha1": "2c300d407906f321a9e3d3ecc01cc56696ffc660",
"sha256": "sha256-wRlrUgwa7RJ88R3ka0l9gbxPNVquWqvIFwcwfX6x30U="
}
}
},
@@ -12215,16 +12215,16 @@
},
{
"path": "com/google/errorprone/error_prone_annotations/2.35.1",
"path": "com/google/errorprone/error_prone_annotations/2.36.0",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"error_prone_annotations-2.35.1.pom": {
"sha1": "7b4b876b40f04941ede1e324f2af6261ad514a7b",
"sha256": "sha256-un1clTzvrQU6AlOiJ46g1u+aiW4ZKgMnzHiO9EJBeBc="
"error_prone_annotations-2.36.0.pom": {
"sha1": "daf188a28315b31852ebd550f78f6b764972ee1f",
"sha256": "sha256-15z9N8hfdta3VMdQHuHchEe3smQsI4LXeCUhZr0zHpw="
},
"error_prone_annotations-2.35.1.jar": {
"sha1": "c36f9e12192226278c2b163bf61990b131e59903",
"sha256": "sha256-A7Y/7jjjqG/aMRr1oDV+ZO6kSQmqtSUe0XgRknBQj/U="
"error_prone_annotations-2.36.0.jar": {
"sha1": "227d4d4957ccc3dc5761bd897e3a0ee587e750a7",
"sha256": "sha256-d0QOJwsLyaJJkDxaB2w2pyLEiGyk9CZ18pA6HFPtYaU="
}
}
},
@@ -12362,12 +12362,12 @@
},
{
"path": "com/google/errorprone/error_prone_parent/2.35.1",
"path": "com/google/errorprone/error_prone_parent/2.36.0",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"error_prone_parent-2.35.1.pom": {
"sha1": "ec496cb2eecb573bac52f53e75e677d21b7d79dd",
"sha256": "sha256-vclIzC9eZtiTxFLrVEXgU1TS8PrejWxkUxDYJgEWu0k="
"error_prone_parent-2.36.0.pom": {
"sha1": "f280159378f00e9f428f10887e22f84ebb2c7e9f",
"sha256": "sha256-Okz8imvtYetI6Wl5b8MeoNJwtj5nBZmUamGIOttwlNw="
}
}
},
@@ -12953,12 +12953,12 @@
},
{
"path": "com/google/protobuf/protobuf-bom/4.29.0-RC2",
"path": "com/google/protobuf/protobuf-bom/4.29.0",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"protobuf-bom-4.29.0-RC2.pom": {
"sha1": "9a1d56ef3dcd903fe6188028b41a08cd95b7aed6",
"sha256": "sha256-+fpeoeIYK8Z1Ug+VW8oKTMXIqjvw0QlYTlSXaC7Z268="
"protobuf-bom-4.29.0.pom": {
"sha1": "5542df7ac3708da8bf30756f4ee6d804d04b8c9b",
"sha256": "sha256-3L/Apl6DmDAE0HFOmL8NIGBwEUVbYhk5cowAkmvIyZk="
}
}
},
@@ -13204,16 +13204,16 @@
},
{
"path": "com/google/protobuf/protobuf-java/4.29.0-RC2",
"path": "com/google/protobuf/protobuf-java/4.29.0",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"protobuf-java-4.29.0-RC2.pom": {
"sha1": "6a3b8220cf0191d1cac58f518e8fe089105a6215",
"sha256": "sha256-laBUKUQ7qipRaJ2LniTI0JIqMOTbBMbK2MPX5F6+G9A="
"protobuf-java-4.29.0.pom": {
"sha1": "27c4abe9c47f4aed31cf7acff86853a05f7e85f0",
"sha256": "sha256-7cHftEVG5yel+sU/CQUGv6aN2DB65vEHbv+tVy+S16Q="
},
"protobuf-java-4.29.0-RC2.jar": {
"sha1": "2c26bef798eaf3604cae2487cc7f98fbc30b34b2",
"sha256": "sha256-7UEwvtFLpLMrQFVkcnZC1J3sqc14fsugWtO2/2377YQ="
"protobuf-java-4.29.0.jar": {
"sha1": "ffea90ab158435d68de76951857ef5f8b0f98365",
"sha256": "sha256-FpAYUevl6J/oiqrTwmhmNzaVvC4wYnu4kyhH4vX8LnY="
}
}
},
@@ -13333,12 +13333,12 @@
},
{
"path": "com/google/protobuf/protobuf-parent/4.29.0-RC2",
"path": "com/google/protobuf/protobuf-parent/4.29.0",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"protobuf-parent-4.29.0-RC2.pom": {
"sha1": "87f14265eeeddd4c78ccaed313fe4125e7681442",
"sha256": "sha256-awus769PZSQsjKRKvb1PZe3Z0XoiZ1PetQE3m7dICzU="
"protobuf-parent-4.29.0.pom": {
"sha1": "c35e0844930aea715cc8f4335fee49223b1fe35c",
"sha256": "sha256-jU6O2nh45revZuPCtvWHE839P7bNsHGS3My2HN0uSTA="
}
}
},
@@ -15259,16 +15259,16 @@
},
{
"path": "io/netty/netty-tcnative-classes/2.0.66.Final",
"path": "io/netty/netty-tcnative-classes/2.0.69.Final",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"netty-tcnative-classes-2.0.66.Final.pom": {
"sha1": "75dca372aa373fac57023721582360f84c79e44c",
"sha256": "sha256-SULNAuKRbB+094zKiEHw9yGbuQ+CirdImokCfC76kes="
"netty-tcnative-classes-2.0.69.Final.pom": {
"sha1": "ee65d639d3c5312a4b6369f0d59504ad0c8dfe0b",
"sha256": "sha256-WdoPlJ4r7on1cR6z4Mb9jPeRTmtwwAfza56waIJDAVw="
},
"netty-tcnative-classes-2.0.66.Final.jar": {
"sha1": "9588bd2f891157538a78d86c945aa34bf9308dda",
"sha256": "sha256-ZpqBGhk9wefJ74bLVHpKuS8PNMzo+bhCuQKb9c+gfMU="
"netty-tcnative-classes-2.0.69.Final.jar": {
"sha1": "0f018f36b688bafabe4573af230a8b59cf3c0713",
"sha256": "sha256-C7woSMsJnrP29Ow2UBs2AOGChFfNpB1TMGh/YB7gS+8="
}
}
},
@@ -15285,12 +15285,12 @@
},
{
"path": "io/netty/netty-tcnative-parent/2.0.66.Final",
"path": "io/netty/netty-tcnative-parent/2.0.69.Final",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"netty-tcnative-parent-2.0.66.Final.pom": {
"sha1": "91784588e56a54734c698f08118b4f3b94a58ec1",
"sha256": "sha256-KwF/s8He6rXR6uvsE0ZZt96ueMFNXr/D1JwLMITqc2U="
"netty-tcnative-parent-2.0.69.Final.pom": {
"sha1": "ba3c1cc69d48f0196ee84ecd3c5157c52a987931",
"sha256": "sha256-KVMCcZZjdhDIlPMr2nBQk82HaDFcnxpXOVGnXxeGmvw="
}
}
},
@@ -15804,17 +15804,6 @@
}
},
{
"path": "net/bytebuddy/byte-buddy-parent/1.14.18",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"byte-buddy-parent-1.14.18.pom": {
"sha1": "6b0b1f08e2d2d8166176c80fd22ee3198a26a3cf",
"sha256": "sha256-dpxdCxEV5z9oRSu6qjVrrZtzfV/ge4PUyeSDl1uB/jw="
}
}
},
{
"path": "net/bytebuddy/byte-buddy-parent/1.15.4",
"repo": "https://repo.maven.apache.org/maven2",
@@ -15826,6 +15815,17 @@
}
},
{
"path": "net/bytebuddy/byte-buddy-parent/1.15.10",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"byte-buddy-parent-1.15.10.pom": {
"sha1": "6f8c0f39f52c09fbf4df945ff563f5fd81130724",
"sha256": "sha256-ZX1HwTcRTN8u0plv73gJYTgX3v9k2L4TI/QJiaO6BG4="
}
}
},
{
"path": "net/bytebuddy/byte-buddy/1.11.13",
"repo": "https://repo.maven.apache.org/maven2",
@@ -15856,21 +15856,6 @@
}
},
{
"path": "net/bytebuddy/byte-buddy/1.14.18",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"byte-buddy-1.14.18.pom": {
"sha1": "5f889814c247762909c7007bdf5ef72f2e7cea7a",
"sha256": "sha256-IvsZB4/nBkirYFSSZscUaZaEciaqbm9+iP7MCBRySTk="
},
"byte-buddy-1.14.18.jar": {
"sha1": "0081e9b9a20944626e6757b5950676af901c2485",
"sha256": "sha256-UhF68WlqU6p3wTE1MHStolzL3y31EfKvM/rWcE+pUQQ="
}
}
},
{
"path": "net/bytebuddy/byte-buddy/1.15.4",
"repo": "https://repo.maven.apache.org/maven2",
@@ -15886,6 +15871,21 @@
}
},
{
"path": "net/bytebuddy/byte-buddy/1.15.10",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"byte-buddy-1.15.10.pom": {
"sha1": "c968dc18f092176badbc9bd389ce53cbb6f13aa5",
"sha256": "sha256-BCz/E2+5FPl2I7oremhdmEuGnb+1tFIdx8kiejJZznA="
},
"byte-buddy-1.15.10.jar": {
"sha1": "635c873fadd853c084f84fdc3cbd58c5dd8537f9",
"sha256": "sha256-2DkNIGhaQaK9ymQPlYlCzZG8vyHEJHBJS99XUtmgexQ="
}
}
},
{
"path": "net/java/dev/jna/jna-platform/5.6.0",
"repo": "https://repo.maven.apache.org/maven2",
@@ -16726,12 +16726,12 @@
},
{
"path": "org/apache/commons/commons-parent/74",
"path": "org/apache/commons/commons-parent/78",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"commons-parent-74.pom": {
"sha1": "704abf062c1f6e03f8bcf6929b4777b9af5048a5",
"sha256": "sha256-gOthsMh/3YJqBpMTsotnLaPxiFgy2kR7Uebophl+fss="
"commons-parent-78.pom": {
"sha1": "c59670d5fff6efd8b31013cb579732c75a250b4c",
"sha256": "sha256-Ai0gLmVe3QTyoQ7L5FPZKXeSTTg4Ckyow1nxgXqAMg4="
}
}
},
@@ -17471,20 +17471,20 @@
},
{
"path": "org/checkerframework/checker-qual/3.48.1",
"path": "org/checkerframework/checker-qual/3.48.2",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"checker-qual-3.48.1.pom": {
"sha1": "b6dca63179b1aedebea4b5eb877342e3f6ff8916",
"sha256": "sha256-4vslCCqCrdKE9gwb/yXZMBzX6bJhOIEs3tGEXutCJ8k="
"checker-qual-3.48.2.pom": {
"sha1": "95acb8356a028eeb22171b7330f7bb78cf0f9506",
"sha256": "sha256-Sk+LlzEYgyx4SrUIpzAJ2tAt5Nq/0dFJLWa45MC6HRE="
},
"checker-qual-3.48.1.jar": {
"sha1": "7d8cf1c00aec0042df92f8d71d7f15baaf9773f4",
"sha256": "sha256-Iejf6BA+El2WoyllPKgeh6xDAybb2/KZzqPcGuPwOaI="
"checker-qual-3.48.2.jar": {
"sha1": "2a4797df796b23026b8215545b0d2936bacc52af",
"sha256": "sha256-ryPyDJlbL+3jWx66gRd6mmaUTsZ7jk3uGapMwLcQxrU="
},
"checker-qual-3.48.1.module": {
"sha1": "f1e778df44d6ca615e580cf2bf3c0ad7ad898d6e",
"sha256": "sha256-2By/MdXdg8qGleCloaRz6TS5mq3GpN2UnvT1ll8lYAM="
"checker-qual-3.48.2.module": {
"sha1": "cdf30d8d4b97e12fc85e65e1bd55210a1a084b10",
"sha256": "sha256-D2RjlMmz5KL1aitsZ6C0NAkqxrq3pJvC/wGtjKf08NU="
}
}
},
@@ -17820,27 +17820,27 @@
},
{
"path": "org/easymock/easymock-parent/5.4.0",
"path": "org/easymock/easymock-parent/5.5.0",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"easymock-parent-5.4.0.pom": {
"sha1": "ac49fe5a7d9cfec46d7386f713c5cd5c5afed89f",
"sha256": "sha256-sKGUgoX4OZNIqWxgWTXYJVCnVKTDNfw0SfogL74qAnI="
"easymock-parent-5.5.0.pom": {
"sha1": "a30937cb15aa72370d3841ca217dd04cd24d506c",
"sha256": "sha256-e7FiABT3ApRLbKcywPIh6jLHwyfQ9fM6zuGf/gtAJ6A="
}
}
},
{
"path": "org/easymock/easymock/5.4.0",
"path": "org/easymock/easymock/5.5.0",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"easymock-5.4.0.pom": {
"sha1": "d566a45d12ee304ab0fba3877ebd93ef64469ea8",
"sha256": "sha256-v/kNdi/BrWVB5jCrgeBzJPVflbd5BhE6NKpnqn2HPhk="
"easymock-5.5.0.pom": {
"sha1": "a711c875746fa00d8c929824b0f99ed7f103ac75",
"sha256": "sha256-0TuotyX47NbHANkl9v78MwXLkIGtzLN97cUxr9HzfQY="
},
"easymock-5.4.0.jar": {
"sha1": "eb56bad81c203765f4a5c74aed28142fb0d79354",
"sha256": "sha256-SDUEf+QbVDSRB8EaGEuhIvo8P8cIQHU0ZfdCtJ5+A6M="
"easymock-5.5.0.jar": {
"sha1": "b07e2bcbc7b6bcae190a18b9ced742b6fd9ceec3",
"sha256": "sha256-vwW1axAr6Rx80LutFoTVgJrCzNA4DmhPlEW/3hRBj38="
}
}
},
@@ -19901,16 +19901,16 @@
},
{
"path": "org/jetbrains/kotlin/kotlin-reflect/2.1.0-Beta2",
"path": "org/jetbrains/kotlin/kotlin-reflect/2.1.0",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"kotlin-reflect-2.1.0-Beta2.pom": {
"sha1": "3e7baa22fcb4cc619f4bd40486276a93f3f2a0c3",
"sha256": "sha256-Mh8VtvMp1G9QUK5EgUhLQ0nCEefVB7U0spO9fTwzNkg="
"kotlin-reflect-2.1.0.pom": {
"sha1": "6c72cb76dbf12249eec091d5a7d6ea27a27fcc87",
"sha256": "sha256-nNhLPU9xfJYjXkujtydolcz/1V3kEcfOCz97q1Yu/kI="
},
"kotlin-reflect-2.1.0-Beta2.jar": {
"sha1": "d776709bc948b0d4d1f06d0da76c3754d80d6f50",
"sha256": "sha256-gBuxZsoD8bj+VXCQtpxdW3CeUiyFTSnSWyTW0JLqjRo="
"kotlin-reflect-2.1.0.jar": {
"sha1": "dc3753b59b67d79b7d2f546d51e22a0ec1f082d8",
"sha256": "sha256-tfYI7fqYqM+iNyzBLRitqXS+HFbBCT7/BswGH0/AiLI="
}
}
},
@@ -21579,24 +21579,24 @@
},
{
"path": "org/jetbrains/kotlin/kotlin-stdlib/2.1.0-Beta2",
"path": "org/jetbrains/kotlin/kotlin-stdlib/2.1.0",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"kotlin-stdlib-2.1.0-Beta2.pom": {
"sha1": "9bf48efa052a62e8f741b1da18105848536e0b98",
"sha256": "sha256-yK+DAGdGa23mj4Gpm5qTnpn65U2VBdfG8eXQKG9Ckuw="
"kotlin-stdlib-2.1.0.pom": {
"sha1": "b7c581edbfc43221bf7a18ea76cc482111bba949",
"sha256": "sha256-E05IwXeWwcECfsvmyfHHXHkvU1mHq4nh4d2kP4w2b14="
},
"kotlin-stdlib-2.1.0-Beta2-all.jar": {
"kotlin-stdlib-2.1.0-all.jar": {
"sha1": "37a691f3c171dc54afc64aedcd63da3440df12d3",
"sha256": "sha256-p0EvZtcbzSchw5gweXL7tflAn5RWQ+7gXRCAsomjOcs="
},
"kotlin-stdlib-2.1.0-Beta2.jar": {
"sha1": "9b6eab04a97dfca8f091764bc5bc89604afc7b01",
"sha256": "sha256-a+9Pxnj5YEdA0GUcZbg0Rw2GM8nxKfMZzNWstMvztLs="
"kotlin-stdlib-2.1.0.jar": {
"sha1": "85f8b81009cda5890e54ba67d64b5e599c645020",
"sha256": "sha256-1vkbew8wbMopn+x0+3w05IdNb17FuSWgtN4hkB4RnD8="
},
"kotlin-stdlib-2.1.0-Beta2.module": {
"sha1": "fc5281ea91c36234d3aa0de8e0c70e0f8892a677",
"sha256": "sha256-3yeZ0iUo792hyfKjSIBL692eYtrGQGxNURFP++ylC2w="
"kotlin-stdlib-2.1.0.module": {
"sha1": "10243b69a055e7a0aac5eff98c9509f34b4b5d1e",
"sha256": "sha256-3PvI6L8yzWen763ZHTEVK86YcJEdbsUIePT9tuA+cOI="
}
}
},
@@ -22698,21 +22698,6 @@
}
},
{
"path": "org/ow2/asm/asm/9.7",
"repo": "https://repo.maven.apache.org/maven2",
"files": {
"asm-9.7.pom": {
"sha1": "e2568079bd69f0fdf35fe2d9e7cd9b16db8eff94",
"sha256": "sha256-3gARXx2E86Cy7jpLb2GS0Gb4bRhdZ7nRUi8sgP6sXwA="
},
"asm-9.7.jar": {
"sha1": "073d7b3086e14beb604ced229c302feff6449723",
"sha256": "sha256-rfRtXjSUC98Ujs3Sap7o7qlElqcgNP9xQQZrPupcTp0="
}
}
},
{
"path": "org/ow2/ow2/1.3",
"repo": "https://repo.maven.apache.org/maven2",
+2 -2
View File
@@ -559,8 +559,8 @@ com.github.bumptech.glide:glide:4.12.0
com.github.bumptech.glide:okhttp3-integration:4.12.0
com.github.clans:fab:1.6.4
com.github.gundy:semver4j:0.16.4
com.github.status-im.status-keycard-java:android:3.1.1
com.github.status-im.status-keycard-java:lib:3.1.1
com.github.status-im.status-keycard-java:android:3.1.2
com.github.status-im.status-keycard-java:lib:3.1.2
com.github.status-im:function:0.0.1
com.github.wix-playground:ahbottomnavigation:3.3.0
com.github.wix-playground:reflow-animator:1.0.6
+26 -27
View File
@@ -545,8 +545,8 @@ https://dl.google.com/dl/android/maven2/com/google/testing/platform/launcher/0.0
https://dl.google.com/dl/android/maven2/com/google/test/platform/core-proto/0.0.2-dev/core-proto-0.0.2-dev.pom
https://jitpack.io/com/github/Dimezis/BlurView/version-2.0.4/BlurView-version-2.0.4.pom
https://jitpack.io/com/github/status-im/function/0.0.1/function-0.0.1.pom
https://jitpack.io/com/github/status-im/status-keycard-java/android/3.1.1/android-3.1.1.pom
https://jitpack.io/com/github/status-im/status-keycard-java/lib/3.1.1/lib-3.1.1.pom
https://jitpack.io/com/github/status-im/status-keycard-java/android/3.1.2/android-3.1.2.pom
https://jitpack.io/com/github/status-im/status-keycard-java/lib/3.1.2/lib-3.1.2.pom
https://jitpack.io/com/github/wix-playground/ahbottomnavigation/3.3.0/ahbottomnavigation-3.3.0.pom
https://jitpack.io/com/github/wix-playground/reflow-animator/1.0.6/reflow-animator-1.0.6.pom
https://jitpack.io/com/github/yalantis/ucrop/2.2.6-native/ucrop-2.2.6-native.pom
@@ -564,7 +564,7 @@ https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.10/commons-co
https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.11/commons-codec-1.11.pom
https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.17.1/commons-codec-1.17.1.pom
https://repo.maven.apache.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.pom
https://repo.maven.apache.org/maven2/commons-io/commons-io/2.17.0/commons-io-2.17.0.pom
https://repo.maven.apache.org/maven2/commons-io/commons-io/2.18.0/commons-io-2.18.0.pom
https://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom
https://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2.pom
https://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.3.4/commons-logging-1.3.4.pom
@@ -667,22 +667,22 @@ https://repo.maven.apache.org/maven2/com/facebook/soloader/soloader/0.10.1/soloa
https://repo.maven.apache.org/maven2/com/facebook/soloader/soloader/0.10.5/soloader-0.10.5.pom
https://repo.maven.apache.org/maven2/com/facebook/yoga/proguard-annotations/1.19.0/proguard-annotations-1.19.0.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.11.1/jackson-annotations-2.11.1.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.18.0/jackson-annotations-2.18.0.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.18.2/jackson-annotations-2.18.2.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-core/2.11.1/jackson-core-2.11.1.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-core/2.18.0/jackson-core-2.18.0.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-core/2.18.2/jackson-core-2.18.2.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.11.1/jackson-databind-2.11.1.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.18.0/jackson-databind-2.18.0.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.18.2/jackson-databind-2.18.2.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-xml/2.11.1/jackson-dataformat-xml-2.11.1.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-base/2.11.1/jackson-base-2.11.1.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-base/2.18.0/jackson-base-2.18.0.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-base/2.18.2/jackson-base-2.18.2.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-bom/2.11.1/jackson-bom-2.11.1.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-bom/2.18.0/jackson-bom-2.18.0.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-bom/2.18.2/jackson-bom-2.18.2.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-parent/2.11/jackson-parent-2.11.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-parent/2.18/jackson-parent-2.18.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-parent/2.18.1/jackson-parent-2.18.1.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/module/jackson-modules-base/2.11.1/jackson-modules-base-2.11.1.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/module/jackson-modules-base/2.18.0/jackson-modules-base-2.18.0.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/module/jackson-modules-base/2.18.2/jackson-modules-base-2.18.2.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.11.1/jackson-module-jaxb-annotations-2.11.1.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.18.0/jackson-module-jaxb-annotations-2.18.0.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.18.2/jackson-module-jaxb-annotations-2.18.2.pom
https://repo.maven.apache.org/maven2/com/fasterxml/jackson/module/jackson-module-kotlin/2.11.1/jackson-module-kotlin-2.11.1.pom
https://repo.maven.apache.org/maven2/com/fasterxml/oss-parent/38/oss-parent-38.pom
https://repo.maven.apache.org/maven2/com/fasterxml/oss-parent/61/oss-parent-61.pom
@@ -751,7 +751,7 @@ https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotatio
https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.10.0/error_prone_annotations-2.10.0.pom
https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.11.0/error_prone_annotations-2.11.0.pom
https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.27.0/error_prone_annotations-2.27.0.pom
https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.35.1/error_prone_annotations-2.35.1.pom
https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.36.0/error_prone_annotations-2.36.0.pom
https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_parent/2.0.18/error_prone_parent-2.0.18.pom
https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_parent/2.2.0/error_prone_parent-2.2.0.pom
https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_parent/2.3.1/error_prone_parent-2.3.1.pom
@@ -764,7 +764,7 @@ https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_parent/2.
https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_parent/2.10.0/error_prone_parent-2.10.0.pom
https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_parent/2.11.0/error_prone_parent-2.11.0.pom
https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_parent/2.27.0/error_prone_parent-2.27.0.pom
https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_parent/2.35.1/error_prone_parent-2.35.1.pom
https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_parent/2.36.0/error_prone_parent-2.36.0.pom
https://repo.maven.apache.org/maven2/com/google/flatbuffers/flatbuffers-java/1.12.0/flatbuffers-java-1.12.0.pom
https://repo.maven.apache.org/maven2/com/google/google/1/google-1.pom
https://repo.maven.apache.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.pom
@@ -809,7 +809,7 @@ https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-bom/3.13.0/pro
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-bom/3.17.2/protobuf-bom-3.17.2.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-bom/3.19.2/protobuf-bom-3.19.2.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-bom/3.19.3/protobuf-bom-3.19.3.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-bom/4.29.0-RC2/protobuf-bom-4.29.0-RC2.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-bom/4.29.0/protobuf-bom-4.29.0.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-javalite/3.17.2/protobuf-javalite-3.17.2.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-javalite/3.19.2/protobuf-javalite-3.19.2.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java-util/3.4.0/protobuf-java-util-3.4.0.pom
@@ -826,7 +826,7 @@ https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.13.0/pr
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.17.2/protobuf-java-3.17.2.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.19.2/protobuf-java-3.19.2.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.19.3/protobuf-java-3.19.3.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/4.29.0-RC2/protobuf-java-4.29.0-RC2.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/4.29.0/protobuf-java-4.29.0.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-lite/3.0.1/protobuf-lite-3.0.1.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-parent/3.0.0/protobuf-parent-3.0.0.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-parent/3.4.0/protobuf-parent-3.4.0.pom
@@ -837,7 +837,7 @@ https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-parent/3.13.0/
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-parent/3.17.2/protobuf-parent-3.17.2.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-parent/3.19.2/protobuf-parent-3.19.2.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-parent/3.19.3/protobuf-parent-3.19.3.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-parent/4.29.0-RC2/protobuf-parent-4.29.0-RC2.pom
https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-parent/4.29.0/protobuf-parent-4.29.0.pom
https://repo.maven.apache.org/maven2/com/google/truth/truth-parent/1.4.4/truth-parent-1.4.4.pom
https://repo.maven.apache.org/maven2/com/google/truth/truth/1.4.4/truth-1.4.4.pom
https://repo.maven.apache.org/maven2/com/google/zxing/core/3.4.1/core-3.4.1.pom
@@ -971,9 +971,9 @@ https://repo.maven.apache.org/maven2/io/netty/netty-resolver/4.1.52.Final/netty-
https://repo.maven.apache.org/maven2/io/netty/netty-resolver/4.1.72.Final/netty-resolver-4.1.72.Final.pom
https://repo.maven.apache.org/maven2/io/netty/netty-resolver/5.0.0.Alpha2/netty-resolver-5.0.0.Alpha2.pom
https://repo.maven.apache.org/maven2/io/netty/netty-tcnative-classes/2.0.46.Final/netty-tcnative-classes-2.0.46.Final.pom
https://repo.maven.apache.org/maven2/io/netty/netty-tcnative-classes/2.0.66.Final/netty-tcnative-classes-2.0.66.Final.pom
https://repo.maven.apache.org/maven2/io/netty/netty-tcnative-classes/2.0.69.Final/netty-tcnative-classes-2.0.69.Final.pom
https://repo.maven.apache.org/maven2/io/netty/netty-tcnative-parent/2.0.46.Final/netty-tcnative-parent-2.0.46.Final.pom
https://repo.maven.apache.org/maven2/io/netty/netty-tcnative-parent/2.0.66.Final/netty-tcnative-parent-2.0.66.Final.pom
https://repo.maven.apache.org/maven2/io/netty/netty-tcnative-parent/2.0.69.Final/netty-tcnative-parent-2.0.69.Final.pom
https://repo.maven.apache.org/maven2/io/netty/netty-transport/4.1.34.Final/netty-transport-4.1.34.Final.pom
https://repo.maven.apache.org/maven2/io/netty/netty-transport/4.1.52.Final/netty-transport-4.1.52.Final.pom
https://repo.maven.apache.org/maven2/io/netty/netty-transport/4.1.72.Final/netty-transport-4.1.72.Final.pom
@@ -1009,12 +1009,12 @@ https://repo.maven.apache.org/maven2/net/bytebuddy/byte-buddy-agent/1.11.19/byte
https://repo.maven.apache.org/maven2/net/bytebuddy/byte-buddy-agent/1.15.4/byte-buddy-agent-1.15.4.pom
https://repo.maven.apache.org/maven2/net/bytebuddy/byte-buddy-parent/1.11.13/byte-buddy-parent-1.11.13.pom
https://repo.maven.apache.org/maven2/net/bytebuddy/byte-buddy-parent/1.11.19/byte-buddy-parent-1.11.19.pom
https://repo.maven.apache.org/maven2/net/bytebuddy/byte-buddy-parent/1.14.18/byte-buddy-parent-1.14.18.pom
https://repo.maven.apache.org/maven2/net/bytebuddy/byte-buddy-parent/1.15.4/byte-buddy-parent-1.15.4.pom
https://repo.maven.apache.org/maven2/net/bytebuddy/byte-buddy-parent/1.15.10/byte-buddy-parent-1.15.10.pom
https://repo.maven.apache.org/maven2/net/bytebuddy/byte-buddy/1.11.13/byte-buddy-1.11.13.pom
https://repo.maven.apache.org/maven2/net/bytebuddy/byte-buddy/1.11.19/byte-buddy-1.11.19.pom
https://repo.maven.apache.org/maven2/net/bytebuddy/byte-buddy/1.14.18/byte-buddy-1.14.18.pom
https://repo.maven.apache.org/maven2/net/bytebuddy/byte-buddy/1.15.4/byte-buddy-1.15.4.pom
https://repo.maven.apache.org/maven2/net/bytebuddy/byte-buddy/1.15.10/byte-buddy-1.15.10.pom
https://repo.maven.apache.org/maven2/net/java/dev/jna/jna-platform/5.6.0/jna-platform-5.6.0.pom
https://repo.maven.apache.org/maven2/net/java/dev/jna/jna/5.6.0/jna-5.6.0.pom
https://repo.maven.apache.org/maven2/net/java/jvnet-parent/1/jvnet-parent-1.pom
@@ -1080,7 +1080,7 @@ https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/48/common
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/52/commons-parent-52.pom
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/71/commons-parent-71.pom
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/72/commons-parent-72.pom
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/74/commons-parent-74.pom
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/78/commons-parent-78.pom
https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.pom
https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.2.6/httpclient-4.2.6.pom
https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.pom
@@ -1135,7 +1135,7 @@ https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/2.8.1/che
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/2.11.1/checker-qual-2.11.1.pom
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/3.5.0/checker-qual-3.5.0.pom
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/3.12.0/checker-qual-3.12.0.pom
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/3.48.1/checker-qual-3.48.1.pom
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/3.48.2/checker-qual-3.48.2.pom
https://repo.maven.apache.org/maven2/org/codehaus/codehaus-parent/4/codehaus-parent-4.pom
https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-xml/3.0.9/groovy-xml-3.0.9.pom
https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-xml/3.0.10/groovy-xml-3.0.10.pom
@@ -1158,8 +1158,8 @@ https://repo.maven.apache.org/maven2/org/codehaus/mojo/mojo-parent/84/mojo-paren
https://repo.maven.apache.org/maven2/org/codehaus/woodstox/stax2-api/4.2.1/stax2-api-4.2.1.pom
https://repo.maven.apache.org/maven2/org/easymock/easymockclassextension/3.2/easymockclassextension-3.2.pom
https://repo.maven.apache.org/maven2/org/easymock/easymock-parent/3.2/easymock-parent-3.2.pom
https://repo.maven.apache.org/maven2/org/easymock/easymock-parent/5.4.0/easymock-parent-5.4.0.pom
https://repo.maven.apache.org/maven2/org/easymock/easymock/5.4.0/easymock-5.4.0.pom
https://repo.maven.apache.org/maven2/org/easymock/easymock-parent/5.5.0/easymock-parent-5.5.0.pom
https://repo.maven.apache.org/maven2/org/easymock/easymock/5.5.0/easymock-5.5.0.pom
https://repo.maven.apache.org/maven2/org/eclipse/angus/angus-activation-project/2.0.2/angus-activation-project-2.0.2.pom
https://repo.maven.apache.org/maven2/org/eclipse/angus/angus-activation/2.0.2/angus-activation-2.0.2.pom
https://repo.maven.apache.org/maven2/org/eclipse/ee4j/project/1.0.2/project-1.0.2.pom
@@ -1285,7 +1285,7 @@ https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-reflect/1.6.10/
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-reflect/1.6.20/kotlin-reflect-1.6.20.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-reflect/1.7.10/kotlin-reflect-1.7.10.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-reflect/1.8.20-RC2/kotlin-reflect-1.8.20-RC2.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-reflect/2.1.0-Beta2/kotlin-reflect-2.1.0-Beta2.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-reflect/2.1.0/kotlin-reflect-2.1.0.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-scripting-common/1.6.20/kotlin-scripting-common-1.6.20.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-scripting-common/1.8.0/kotlin-scripting-common-1.8.0.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-scripting-common/1.9.0/kotlin-scripting-common-1.9.0.pom
@@ -1395,7 +1395,7 @@ https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.8.22/k
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.9.0/kotlin-stdlib-1.9.0.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.9.22/kotlin-stdlib-1.9.22.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.9.25/kotlin-stdlib-1.9.25.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/2.1.0-Beta2/kotlin-stdlib-2.1.0-Beta2.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/2.1.0/kotlin-stdlib-2.1.0.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-tooling-core/1.8.0/kotlin-tooling-core-1.8.0.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-tooling-core/1.9.0/kotlin-tooling-core-1.9.0.pom
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-tooling-metadata/1.6.20/kotlin-tooling-metadata-1.6.20.pom
@@ -1471,7 +1471,6 @@ https://repo.maven.apache.org/maven2/org/ow2/asm/asm/8.0.1/asm-8.0.1.pom
https://repo.maven.apache.org/maven2/org/ow2/asm/asm/9.1/asm-9.1.pom
https://repo.maven.apache.org/maven2/org/ow2/asm/asm/9.2/asm-9.2.pom
https://repo.maven.apache.org/maven2/org/ow2/asm/asm/9.7.1/asm-9.7.1.pom
https://repo.maven.apache.org/maven2/org/ow2/asm/asm/9.7/asm-9.7.pom
https://repo.maven.apache.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom
https://repo.maven.apache.org/maven2/org/ow2/ow2/1.5.1/ow2-1.5.1.pom
https://repo.maven.apache.org/maven2/org/ow2/ow2/1.5/ow2-1.5.pom
-5
View File
@@ -44,11 +44,6 @@ in {
doCheck = false;
});
# Downgrade watchman in attempt to fix "too many files open issue"
watchman = callPackage ./pkgs/watchman {
inherit (super.darwin.apple_sdk.frameworks) CoreServices;
autoconf = super.buildPackages.autoconf269;
};
# Package version adjustments
nodejs = super.nodejs_20;
-23
View File
@@ -1,23 +0,0 @@
# Issue
`watchman` was upgraded significantly during the last nixpkgs upgrade (`4.9.0` (Aug 16, 2017) to `2023.01.30.00` - 6 years between):
- https://github.com/status-im/status-mobile/pull/14944
- https://github.com/status-im/nixpkgs/commit/4e9c02bcc709fe1737a746add0e8e0109133d808
Probably causing developers to have "too many files open" issue:
https://github.com/status-im/status-mobile/issues/16341
```
Error: A non-recoverable condition has triggered. Watchman needs your help!
The triggering condition was at timestamp=1687286390: opendir(/Users/javid/Projects/status-mobile/node_modules/metro-core/node_modules/jest-regex-util/build) -> Too many open files
All requests will continue to fail with this message until you resolve
the underlying problem. You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-opendir
```
# Fix
This is an attempt to fix the issue by downgrading the watchman
# Upgrade
When upgrading in the future, please read the comments:
https://github.com/status-im/status-mobile/issues/16341
-48
View File
@@ -1,48 +0,0 @@
{ stdenv, lib, config, fetchFromGitHub, autoconf, automake, pcre
, libtool, pkg-config, openssl
, confFile ? config.watchman.confFile or null
, withApple ? stdenv.isDarwin, CoreServices
}:
stdenv.mkDerivation rec {
pname = "watchman";
version = "4.9.0";
src = fetchFromGitHub {
owner = "facebook";
repo = "watchman";
rev = "v${version}";
sha256 = "0fdaj5pmicm6j17d5q7px800m5rmam1a400x3hv1iiifnmhgnkal";
};
nativeBuildInputs = [ autoconf automake pkg-config libtool ];
buildInputs = [ pcre openssl ]
#++ lib.optionals withApple [ CoreServices ];
++ lib.optionals stdenv.isDarwin [ CoreServices ];
configureFlags = [
"--enable-lenient"
"--enable-conffile=${if confFile == null then "no" else confFile}"
"--with-pcre=yes"
# For security considerations re: --disable-statedir, see:
# https://github.com/facebook/watchman/issues/178
"--disable-statedir"
];
prePatch = ''
patchShebangs .
'';
preConfigure = ''
./autogen.sh
'';
meta = with lib; {
description = "Watches files and takes action when they change";
homepage = "https://facebook.github.io/watchman";
maintainers = with maintainers; [ cstrahan ];
platforms = with platforms; linux ++ darwin;
license = licenses.asl20;
};
}
+1 -1
View File
@@ -66,7 +66,7 @@
"react-native-shake": "^3.3.1",
"react-native-share": "10.0.2",
"react-native-static-safe-area-insets": "^2.2.0",
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.5.39",
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.6.3",
"react-native-svg": "13.10.0",
"react-native-webview": "13.6.3",
"react-syntax-highlighter": "^15.5.0"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

After

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1001 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

+52 -41
View File
@@ -1,9 +1,10 @@
Status Terms of Use
Last updated: 14 August 2024
Last updated: 10 December 2024
1. Introduction
1.1 Who we are
Status is developing a set of open source projects that use peer-to-peer technologies to help people transact securely, communicate freely, and organise with confidence. Anyone participating in these projects helps to build technology and tools that empowers people to advance their own sovereign communities.
@@ -14,7 +15,7 @@ Status does not provide any services, such as financial services, to users of St
1.2 About these terms
These terms are a contract between you and Status and apply to your use of Status Software. The term “Status Software” as used herein means a software developed by Status and is composed of a secure messaging tool, a crypto wallet, and a Web 3 browser integrated together.
These terms are a contract between you and Status and apply to your use of Status Software. The term “Status Software” as used herein means a software developed by Status and is composed of a secure messaging tool and a crypto wallet integrated together.
Please read these terms carefully before using Status Software. By installing or using Status Software on any device, you agree to these terms. If you do not agree, you should not install or use Status Software.
@@ -48,57 +49,56 @@ If a dispute arises between you and Status, we will seek to first solve it amica
At Status, we strive to develop open source software that can serve as a secure communication tool that helps to uphold human rights. Status Software is specifically designed to facilitate the free flow of information, protect the right to private, secure communications and promote the sovereignty of individuals.
Status Software is composed of a secure messaging tool, a crypto wallet, and a Web 3 browser integrated together. The software developed by Status in this regard is simply called “Status Software” and you can find more details about its development on Status GitHub page.
Status Software is composed of a secure messaging tool and a crypto wallet integrated together. The software developed by Status in this regard is simply called “Status Software” and you can find more details about its development on Status GitHub page.
Status Software is open source client software that is designed to be user-friendly and can be installed or run in a web browser on your local desktop or mobile device. You can use Status Software to interact with and participate in Web 3 protocols, applications and peer to peer networks (referred to in these terms collectively, as “Web 3”). Please note that Status Software is not a blockchain protocol, or a blockchain network, a platform or a web-based platform.
Status develops Status Software and makes it available for you to run in a web browser or for your local use on your desktop or mobile device. This means that you are solely responsible for your activity and any potential risk or loss you may incur through using the Status Software as further detailed below in these terms.
Status develops Status Software and makes it available for you to run in a web browser or for your local use on your desktop or mobile device. This means that you are solely responsible for your activity and any potential risk or loss you may incur through using the Status Software as further detailed below in these terms.
As a result of the privacy-first design of Status Software:
1. Status does not store nor have access to user data, messages, or content;
2. Status cannot associate content or actions with individual users. However, users may choose to disclose certain limited information to Status voluntarily, such as when opting in to share usage analytics. This data, shared only through explicit consent of the user, is processed in accordance with our Privacy Policy;
3. Status cannot block or ban users from using Status Software features;
4. Status has no means of monitoring, moderating, removing, modifying or regulating users content or activity, except in Community Spaces created and directly managed by Status.
2.1.1 Wallet
Status Software includes a crypto wallet. We will refer to such wallet functionality in these terms as “Wallet”.
The Wallet is your own personal crypto wallet. This type of wallet is sometimes also called “non-custodial”, “self-custodial” or “self-hosted”, which means you are in complete control of the crypto tokens (the “Digital Assets”) in the Wallet. Status will never have access to or control over your seed phrase, private keys or Digital Assets in your Wallet given its design.
The Wallet is your own personal crypto wallet. This type of wallet is sometimes also called “non-custodial”, “self-custodial” or “self-hosted”, which means you are in complete control of the crypto tokens (the “Digital Assets”) in the Wallet. Status will never have access to or control over your seed phrase, private keys or Digital Assets in your Wallet given its design.
Using the Wallet, you are able to send, receive and store Digital Assets and connect to and interact with third-party services that enable the exchange of Digital Assets for fiat currency and Web 3, including certain blockchain bridges and decentralised exchanges.
Using the Wallet, you are able to send, receive and store Digital Assets and connect to and interact with third-party services that enable the exchange of Digital Assets for fiat currency and Web 3, including certain blockchain bridges and decentralised exchanges.
The Wallet contains the latest security standards, anti-phishing mechanisms and locally generated and stored public and private keys to ensure that your Digital Assets are secured to the highest standards.
The Wallet contains the latest security standards, anti-phishing mechanisms and locally generated and stored public and private keys to ensure that your Digital Assets are secured to the highest standards.
When generating an account, a randomisation process is started on your own device that generates a key pair. Status does not have visibility of or access to your private keys. You are solely responsible for storing and securing your seed phrase and private keys, and creating, storing and securing their backups. If you fail to maintain the appropriate security measures of your private keys, it may result in you losing access to your Wallet and control of any Digital Assets in your Wallet. If you lose or forget your seed phrase or private keys, Status will not be able to help you recover or replace them and further, Status will not be able to assist you with the recovery of your Digital Assets.
When generating an account, a randomisation process is started on your own device that generates a key pair. Status does not have visibility of or access to your private keys. You are solely responsible for storing and securing your seed phrase and private keys, and creating, storing and securing their backups. If you fail to maintain the appropriate security measures of your private keys, it may result in you losing access to your Wallet and control of any Digital Assets in your Wallet. If you lose or forget your seed phrase or private keys, Status will not be able to help you recover or replace them and further, Status will not be able to assist you with the recovery of your Digital Assets.
In order to further enhance the security of storing your private keys, you may also choose to store your keys on a keycard, such as the Status Keycard.
In order to further enhance the security of storing your private keys, you may also choose to store your keys on a keycard, such as the Status Keycard.
2.1.2 Messaging
Status Software includes messaging functionality that enables secure communication between users. We will refer to the messaging functionality of Status Software and the Status Community Spaces collectively in these terms, as “Messaging”.
Status Software includes messaging functionality that enables secure communication between users. We will refer to the messaging functionality of Status Software and the Community Spaces collectively in these terms, as “Messaging”.
Messaging uses an open source, peer-to-peer protocol with end-to-end encryption and metadata suppression to protect your messages from third parties (including Status). End-to-end encryption means that only the sender and recipient of a message can read its contents, and no one else. Peer-to-peer communication is accomplished using the Waku peer-to-peer messaging protocol, which relies on a distributed network of nodes instead of a centralised server. This means that there is no central party or server from which messages can be intercepted, modified or blocked. Learn more about Waku and how it works on Wakus relevant website.
Messaging uses an open source, peer-to-peer protocol with end-to-end encryption and metadata suppression to protect your messages from third parties (including Status). End-to-end encryption means that only the sender and recipient of a message can read its contents, and no one else. Peer-to-peer communication is accomplished using the Waku peer-to-peer messaging protocol, which relies on a distributed network of nodes instead of a centralised server. This means that there is no central party or server from which messages can be intercepted, modified or blocked. Learn more about Waku and how it works on Wakus relevant website.
Within Messaging, you will also be able to participate in Status Community Spaces. This feature allows users to create their own token-gated communities where you can create group chats and engage with your communities, while leveraging the possibilities, functionality and benefits of blockchain technology. You will also be able to create (and join) open and public communities on Status Software that are accessible to other users. We note that content in these open and public communities will be accessible to all other users of Status Software. Nonetheless, all content will still be protected by the same end-to-end encryption utilised in Status Software.
Within Messaging, you will also be able to participate in Community Spaces. This feature allows users to create and join communities with varying access and discoverability options, which may include token-gated communities, private communities and open and public communities, where you can create group chats and engage with your communities. We note that content in all Community Spaces will be accessible to the members of those spaces. For open and public communities, content will be accessible to all other users of Status Software. Nonetheless, all content, regardless of the type of community, will still be protected by the same end-to-end encryption utilised in Status Software.
2.1.2 Web 3 browser
Status Software also includes a Web 3 browser through which you may access and interact with Web 3, exchanges, marketplaces, games and more. We will refer to the Web 3 browser in these terms as the “Web 3 Browser”.
3. Privacy
Status uses an open source, peer-to-peer protocol with end-to-end encryption and metadata suppression, which by design, means that Status (and any third party) is unable to and does not collect, store, own, control or have any visibility or means of access to your identity, Wallet, browsing information, any user private keys, Digital Assets, messages, content, history of interactions, user accounts or any other user information.
Therefore, Status does not (and cannot) monetise any users data or content, such as messages or browser information and Status does not have any interest in doing so.
Status however processes a limited amount of user data to ensure the technical operation of the Status Software, enhance its functionality, and improve the user experience. For more details on this limited process of user data, please refer to our Privacy Policy.
Status processes a limited amount of user data to ensure the technical operation of the Status Software, enhance its functionality, and improve the user experience. For more details on this limited process of user data, please refer to our Privacy Policy.
If you use third party services offered through Status Software, your privacy may not be protected and you will be subject to the privacy terms and conditions of such third parties. Please refer to our full terms regarding third party services below.
4. Using third party services and interacting with Web 3
When using Status Software, you may access or use third party products, services or tools (“Third Party Services”) and interact with Web 3. Status Software is only one means of interacting with these Third Party Services and Web 3 and you can independently utilise other means and tools to do so as well.
Your interactions with Web 3 could include many aspects, such as interacting with smart contracts that reside on blockchain networks, for example to swap Digital Assets or use (crypto) bridges, or deploying your own smart contracts through Status Community Spaces. You may also interact with and participate in peer-to-peer networks which could vary in their level of decentralisation, ranging from more centralised networks controlled by a single party to networks governed by decentralised communities.
Your interactions with Web 3 could include many aspects, such as interacting with smart contracts that reside on blockchain networks, for example to swap Digital Assets or use (crypto) bridges, or deploying your own smart contracts through Community Spaces. You may also interact with and participate in peer-to-peer networks which could vary in their level of decentralisation, ranging from more centralised networks controlled by a single party to networks governed by decentralised communities.
When you use Third Party Services or interact with Web 3, you acknowledge that Status does not control or operate any Third Party Service or Web 3. These products, services, or tools are either controlled, operated, owned, or licensed by the third party providing them, or they may operate autonomously, independently of Status or any other party.
@@ -127,7 +127,7 @@ Although security is a top priority for us and many functions of Status Software
7. Content
At Status, we believe in the sovereignty of individuals and we stand for the cause of personal liberty. We aim to promote social, political, and economic freedoms through Status Software, which is built on the principles of the free flow of information and censorship resistance. Through Status Software, particularly when using Messenger and Status Community Spaces, you will be able to create and interact with various content. We consider content to include anything you (or any other user) create, post, distribute or exchange through Status Software (as well as any future functions that may be added to Status Software), whether its text, links, GIFs, emoji, photos or any other media formats.
At Status, we believe in the sovereignty of individuals and we stand for the cause of personal liberty. We aim to promote social, political, and economic freedoms through Status Software, which is built on the principles of the free flow of information and censorship resistance. Through Status Software, particularly when using Messenger and Community Spaces, you will be able to create and interact with various content. We consider content to include anything you (or any other user) create, post, distribute or exchange through Status Software (as well as any future functions that may be added to Status Software), whether its text, links, GIFs, emoji, photos or any other media formats.
You are solely responsible for any content that you create, post, distribute or submit, messages you exchange or any other activity you may engage in related to your content on or through Status Software and any harm or liability that may result from such content.
@@ -145,25 +145,35 @@ You acknowledge that Status has no means of monitoring, moderating, removing, mo
8.1 Adherence to Status Principles
One of Status goals is the widespread adoption of the decentralised web while also staying true to our Principles. These terms are designed to reflect our Principles, while providing important legal protections for Status and setting out guidelines and terms for the Status Software community of users. We ask that you use Status Software in a way that promotes and aligns with the Status Principles.
One of Status goals is the widespread adoption of the decentralised web while also staying true to our Principles. These terms are designed to reflect our Principles, while providing important legal protections for Status and setting out guidelines and terms for the Status Software community of users. We ask that you use Status Software in a way that promotes and aligns with the Status Principles, and avoid actions that may harm or disrupt the community of users.
8.2 Limitation on certain uses of and acts in Status Software
We strongly encourage users to act responsibly and ethically in their interactions and refrain from (i) inciting harm, violence or illegal activity, (ii) engaging in harassment, abuse or discrimination, and (iii) spreading false or misleading information.
You shall not, nor try to, encourage or assist others using Status Software to:
1. gain or try to gain unauthorised access to Status Software;
2. interfere with or disrupt the integrity, safety, security, availability or performance of Status Software;
3. generate accounts on Status Software through unauthorised means;
4. install or transmit on or through Status Software, any viruses, worms, malware, Trojan horses, or other harmful or destructive code or content;
5. use spam, data mining, or other unsolicited promotional methods, machine generated content, or unethical or unwanted commercial content;
6. engage in phishing, spoofing, or similar fraudulent acts;
7. knowingly spread misinformation or impersonate another person or legal entity;
8. incite, commit or threaten, harm or engage in illegal or inappropriate conduct including stalking, bullying, harassment, intimidation or abuse another individual or group;
9. engage in or organise child sexual exploitation of any kind;
10. use Status Software, if you are subject to sanctions, or otherwise designated on a list of prohibited or restricted parties as maintained by, the United Nations, the European Union or any of its member states or the Singaporean, Swiss or US government, or intend to interact or transact with such parties;
11. violate, misappropriate or infringe the rights of Status, other users of Status Software, or any other third parties in any way, including but not limited to privacy, publicity, intellectual property, confidentiality, property or other rights;
12. engage in any activity through Status Software that may be in violation of applicable law, rules or regulations in your jurisdiction;
13. interfere, disrupt, negatively affect, or inhibit other users from their use of Status Software; or
14. engage in any attack, hack, denial-of-service attack, interference, or exploit of any smart contract in connection with use of Status Software.
If you are a Community Space creator or admin, we encourage you to establish your own guidelines to foster healthy and respectful community environments for your members.
8.2 Community Governance
Community Spaces are self-sovereign environments managed independently by their creators and appointed admins. These users are solely responsible for:
1. establishing and enforcing their own community guidelines;
2. configuring access controls and permissions;
3. managing community membership, including accepting or rejecting requests;
4. moderating content and interactions within their community; and
5. taking actions against community members who violate their community guidelines or behave disruptively, including the ability to exclude or ban members.
By participating in Community Spaces, you acknowledge that community governance lies solely with community creators and their appointed admins. Status cannot monitor, moderate or intervene in community interactions or governance decisions within any Community Space, except in cases where a Community Space is created and directly managed by Status.
8.3 Limitation on certain uses of and acts in Status Software
You agree not to use Status Software, or attempt or assist others to use it, in a manner that:
1. uses unauthorised methods to create or gain access to an account on Status Software;
2. interferes with or disrupts the integrity, safety, security, availability or performance of Status Software;
3. installs or transmits on or through Status Software, any viruses, worms, malware, Trojan horses, or other harmful or destructive code or content;
4. use Status Software, if you are subject to sanctions, or otherwise designated on a list of prohibited or restricted parties as maintained by, the United Nations, the European Union or any of its member states or the Singaporean, Swiss or US government, or intend to interact or transact with such parties;
5. violate, misappropriate or infringe the rights of Status, other users of Status Software, or any other third parties in any way, including but not limited to privacy, publicity, intellectual property, confidentiality, property or other rights;
6. engage in any activity through Status Software that may be in violation of applicable law, rules or regulations in your jurisdiction;
7. interfere, disrupt, negatively affect, or inhibit other users from their use of Status Software; or
8. engage in any attack, hack, denial-of-service attack, interference, or exploit of any smart contract in connection with use of Status Software.
9. Fees
@@ -252,6 +262,7 @@ You release Status from all liability related to any claim, cause of action, con
14. Limitation of liability
Status will not be held liable to you under any contract, negligence, strict liability, or other legal or equitable theory for any lost profits, cost of procurement for substitute services, or any special, incidental, or consequential damages related to, arising from, or in any way connected with these terms, Status, your use of Status Software, particularly where Status has indicated that it is not responsible. This includes without limitation, your use of SNT or other Digital Assets (creating, distributing, transacting in or otherwise) even if Status has been advised of the possibility of such damages.
In any event, Status aggregate liability for any claims is limited to EUR 100 (one hundred Euros). This limitation of liability will apply to the extent permitted by applicable law.
-3
View File
@@ -32,12 +32,9 @@ trap "rm -vf ${SECRETS_FILE_PATH}" EXIT ERR INT QUIT
# Names of variables containing secrets to save in env file.
SECRETS_ENV_VARS=(
'ALCHEMY_ETHEREUM_MAINNET_TOKEN'
'ALCHEMY_ETHEREUM_GOERLI_TOKEN'
'ALCHEMY_ETHEREUM_SEPOLIA_TOKEN'
'ALCHEMY_ARBITRUM_GOERLI_TOKEN'
'ALCHEMY_ARBITRUM_MAINNET_TOKEN'
'ALCHEMY_ARBITRUM_SEPOLIA_TOKEN'
'ALCHEMY_OPTIMISM_GOERLI_TOKEN'
'ALCHEMY_OPTIMISM_MAINNET_TOKEN'
'ALCHEMY_OPTIMISM_SEPOLIA_TOKEN'
'RARIBLE_MAINNET_API_KEY'
+2 -1
View File
@@ -9,7 +9,8 @@ if test -n "$INVALID_CHANGES"; then
exit 1
fi
INVALID_CHANGES2=$(grep -E -r '(status-im\.)' --include '*.cljs' --include '*.clj' './src/utils')
# Add exception for status-im.config in the utils package check
INVALID_CHANGES2=$(grep -E -r '(status-im\.)' --include '*.cljs' --include '*.clj' './src/utils' | grep -v 'status-im.config')
if test -n "$INVALID_CHANGES2"; then
echo "WARNING: status-im are not allowed in utils package"
+55 -56
View File
@@ -51,56 +51,61 @@
;; the target files (a.k.a hot reload). When false, you can manually
;; reload by calling `shadow.cljs.devtools.api/watch-compile-all!`.
:devtools {:autobuild #shadow/env ["SHADOW_AUTOBUILD_ENABLED" :default true :as :bool]}
:dev {:devtools {:before-load-async status-im.setup.hot-reload/before-reload
:after-load-async status-im.setup.hot-reload/reload
:build-notify status-im.setup.hot-reload/build-notify
:preloads [;; The official recommendation is to
;; load the debugger preload first.
flow-storm.api
re-frisk-remote.preload
status-im.setup.schema-preload
;; In order to use component test helpers in the REPL we
;; need to preload namespaces that are not normally required
;; by production code, such as
;; @testing-library/react-native.
test-helpers.component]}
:closure-defines
{status-im.config/POKT_TOKEN #shadow/env "POKT_TOKEN"
status-im.config/INFURA_TOKEN #shadow/env "INFURA_TOKEN"
status-im.config/STATUS_BUILD_PROXY_USER #shadow/env "STATUS_BUILD_PROXY_USER"
status-im.config/STATUS_BUILD_PROXY_PASSWORD #shadow/env "STATUS_BUILD_PROXY_PASSWORD"
status-im.config/MIXPANEL_APP_ID #shadow/env "MIXPANEL_APP_ID"
status-im.config/MIXPANEL_TOKEN #shadow/env "MIXPANEL_TOKEN"
status-im.config/OPENSEA_API_KEY #shadow/env "OPENSEA_API_KEY"
status-im.config/RARIBLE_MAINNET_API_KEY #shadow/env "RARIBLE_MAINNET_API_KEY"
status-im.config/RARIBLE_TESTNET_API_KEY #shadow/env "RARIBLE_TESTNET_API_KEY"
status-im.config/ALCHEMY_ETHEREUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ETHEREUM_MAINNET_TOKEN"
status-im.config/ALCHEMY_ETHEREUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ETHEREUM_GOERLI_TOKEN"
status-im.config/ALCHEMY_ETHEREUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ETHEREUM_SEPOLIA_TOKEN"
status-im.config/ALCHEMY_ARBITRUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ARBITRUM_MAINNET_TOKEN"
status-im.config/ALCHEMY_ARBITRUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ARBITRUM_GOERLI_TOKEN"
status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_GOERLI_TOKEN #shadow/env "ALCHEMY_OPTIMISM_GOERLI_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"}
:compiler-options {:output-feature-set :es5
;; We disable `:fn-deprecated` warnings because we
;; are managing deprecation via clj-kondo and we
;; don't want the terminal output to be littered
;; with warnings on every code reload.
:warnings {:fn-deprecated false}
:closure-defines {re-frame.trace/trace-enabled? true}
:source-map false
;; This seems to be necessary while using the REPL,
;; otherwise sometimes you'll get weird errors when
;; instrumenting functions.
:static-fns false
:infer-externs true
:reader-features #{:mobile}}
;; if you want to use a real device, set your local ip
;; in the SHADOW_HOST env variable to make sure that
;; it will use the right interface
:local-ip #shadow/env "SHADOW_HOST"}
:dev
{:devtools {:before-load-async status-im.setup.hot-reload/before-reload
:after-load-async status-im.setup.hot-reload/reload
:build-notify status-im.setup.hot-reload/build-notify
:preloads [;; The official recommendation is to
;; load the debugger preload first.
flow-storm.api
re-frisk-remote.preload
status-im.setup.schema-preload
;; In order to use component test helpers in the REPL we need to
;; preload namespaces that are not normally required by
;; production code, such as @testing-library/react-native.
test-helpers.component]}
:closure-defines
{status-im.config/POKT_TOKEN #shadow/env "POKT_TOKEN"
status-im.config/INFURA_TOKEN #shadow/env "INFURA_TOKEN"
status-im.config/STATUS_BUILD_PROXY_USER #shadow/env "STATUS_BUILD_PROXY_USER"
status-im.config/STATUS_BUILD_PROXY_PASSWORD #shadow/env "STATUS_BUILD_PROXY_PASSWORD"
status-im.config/STATUS_BACKEND_SERVER_ENABLED #shadow/env "STATUS_BACKEND_SERVER_ENABLED"
status-im.config/STATUS_BACKEND_SERVER_HOST #shadow/env "STATUS_BACKEND_SERVER_HOST"
status-im.config/STATUS_BACKEND_SERVER_MEDIA_SERVER_ENABLE_TLS
#shadow/env "STATUS_BACKEND_SERVER_MEDIA_SERVER_ENABLE_TLS"
status-im.config/STATUS_BACKEND_SERVER_IMAGE_SERVER_URI_PREFIX
#shadow/env "STATUS_BACKEND_SERVER_IMAGE_SERVER_URI_PREFIX"
status-im.config/STATUS_BACKEND_SERVER_ROOT_DATA_DIR #shadow/env
"STATUS_BACKEND_SERVER_ROOT_DATA_DIR"
status-im.config/MIXPANEL_APP_ID #shadow/env "MIXPANEL_APP_ID"
status-im.config/MIXPANEL_TOKEN #shadow/env "MIXPANEL_TOKEN"
status-im.config/OPENSEA_API_KEY #shadow/env "OPENSEA_API_KEY"
status-im.config/RARIBLE_MAINNET_API_KEY #shadow/env "RARIBLE_MAINNET_API_KEY"
status-im.config/RARIBLE_TESTNET_API_KEY #shadow/env "RARIBLE_TESTNET_API_KEY"
status-im.config/ALCHEMY_ETHEREUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ETHEREUM_MAINNET_TOKEN"
status-im.config/ALCHEMY_ETHEREUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ETHEREUM_SEPOLIA_TOKEN"
status-im.config/ALCHEMY_ARBITRUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ARBITRUM_MAINNET_TOKEN"
status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"}
:compiler-options {:output-feature-set :es5
;; We disable `:fn-deprecated` warnings because we
;; are managing deprecation via clj-kondo and we
;; don't want the terminal output to be littered
;; with warnings on every code reload.
:warnings {:fn-deprecated false}
:closure-defines {re-frame.trace/trace-enabled? true}
:source-map false
;; This seems to be necessary while using the REPL,
;; otherwise sometimes you'll get weird errors when
;; instrumenting functions.
:static-fns false
:infer-externs true
:reader-features #{:mobile}}
;; if you want to use a real device, set your local ip
;; in the SHADOW_HOST env variable to make sure that
;; it will use the right interface
:local-ip #shadow/env "SHADOW_HOST"}
:chunks {:fleets legacy.status-im.fleet.default-fleet/default-fleets}
:release
{:closure-defines
@@ -114,13 +119,10 @@
status-im.config/RARIBLE_MAINNET_API_KEY #shadow/env "RARIBLE_MAINNET_API_KEY"
status-im.config/RARIBLE_TESTNET_API_KEY #shadow/env "RARIBLE_TESTNET_API_KEY"
status-im.config/ALCHEMY_ETHEREUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ETHEREUM_MAINNET_TOKEN"
status-im.config/ALCHEMY_ETHEREUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ETHEREUM_GOERLI_TOKEN"
status-im.config/ALCHEMY_ETHEREUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ETHEREUM_SEPOLIA_TOKEN"
status-im.config/ALCHEMY_ARBITRUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ARBITRUM_MAINNET_TOKEN"
status-im.config/ALCHEMY_ARBITRUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ARBITRUM_GOERLI_TOKEN"
status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_GOERLI_TOKEN #shadow/env "ALCHEMY_OPTIMISM_GOERLI_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"}
:compiler-options {:output-feature-set :es6
;;disable for android build as there
@@ -158,13 +160,10 @@
status-im.config/RARIBLE_MAINNET_API_KEY #shadow/env "RARIBLE_MAINNET_API_KEY"
status-im.config/RARIBLE_TESTNET_API_KEY #shadow/env "RARIBLE_TESTNET_API_KEY"
status-im.config/ALCHEMY_ETHEREUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ETHEREUM_MAINNET_TOKEN"
status-im.config/ALCHEMY_ETHEREUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ETHEREUM_GOERLI_TOKEN"
status-im.config/ALCHEMY_ETHEREUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ETHEREUM_SEPOLIA_TOKEN"
status-im.config/ALCHEMY_ARBITRUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ARBITRUM_MAINNET_TOKEN"
status-im.config/ALCHEMY_ARBITRUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ARBITRUM_GOERLI_TOKEN"
status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_GOERLI_TOKEN #shadow/env "ALCHEMY_OPTIMISM_GOERLI_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"
status-im.config/WALLET_CONNECT_PROJECT_ID #shadow/env "WALLET_CONNECT_PROJECT_ID"}
:compiler-options
@@ -10,40 +10,3 @@ export function scrollDownButtonOpacity(chatListScrollY, isComposerFocused, wind
}
});
}
export function jumpToButtonOpacity(scrollDownButtonOpacity, isComposerFocused) {
return useDerivedValue(function () {
'worklet';
return withTiming(scrollDownButtonOpacity.value == 1 || isComposerFocused.value ? 0 : 1);
});
}
export function jumpToButtonPosition(scrollDownButtonOpacity, isComposerFocused) {
return useDerivedValue(function () {
'worklet';
return withTiming(scrollDownButtonOpacity.value == 1 || isComposerFocused.value ? 35 : 0);
});
}
export function composerContainerOpacity(isComposerFocused, isEmptyInput, emptyOpacity) {
return useDerivedValue(function () {
'worklet';
return isEmptyInput.value && !isComposerFocused.value
? withDelay(300, withTiming(emptyOpacity, { duration: 0 }))
: 1;
});
}
export function blurContainerElevation(isComposerFocused, isEmptyInput) {
return useDerivedValue(function () {
'worklet';
return isEmptyInput.value && !isComposerFocused.value ? 10 : 0;
});
}
export function composerElevation(isComposerFocused, isEmptyInput) {
return useDerivedValue(function () {
'worklet';
return isEmptyInput.value && !isComposerFocused.value ? 0 : 10;
});
}
+4 -4
View File
@@ -1,8 +1,8 @@
import { useDerivedValue, withTiming, Easing } from 'react-native-reanimated';
const slideAnimationDuration = 300;
const totalPages = 4;
const pageSize = 100 / totalPages;
const totalPages = 3;
const pageSize = 25;
const easeOut = {
duration: slideAnimationDuration,
@@ -13,7 +13,7 @@ const easeOut = {
export function dynamicProgressBarWidth(staticProgressBarWidth, progress) {
return useDerivedValue(function () {
'worklet';
return (staticProgressBarWidth * (progress.value || 0)) / 100;
return (staticProgressBarWidth * (progress.value || 0)) / 75;
});
}
@@ -26,6 +26,6 @@ export function carouselLeftPosition(windowWidth, progress, isDragging, dragAmou
const baseOffset = (Math.floor(progressValue / pageSize) % totalPages) * windowWidth;
const adjustedOffset = baseOffset === 0 && dragAmountValue > 0 ? baseOffset : -baseOffset + dragAmountValue;
return isDragging.value ? withTiming(adjustedOffset, easeOut) : withTiming(-baseOffset, easeOut);
return isDragging.value ? adjustedOffset : withTiming(-baseOffset, easeOut);
});
}
+2 -37
View File
@@ -1,47 +1,12 @@
import { useDerivedValue, withTiming } from 'react-native-reanimated';
import * as constants from './constants';
export function bottomTabIconColor(
stackId,
selectedStackId,
homeStackState,
passThrough,
selectedTabColor,
defaultColor,
passThroughColor,
) {
export function bottomTabIconColor(stackId, selectedStackId, selectedTabColor, defaultColor) {
return useDerivedValue(function () {
'worklet';
var homeStackStateValue = homeStackState.value;
if (
selectedStackId.value == stackId &&
(homeStackStateValue == constants.OPEN_WITH_ANIMATION || homeStackStateValue == constants.OPEN_WITHOUT_ANIMATION)
) {
if (selectedStackId.value == stackId) {
return selectedTabColor;
} else if (passThrough.value) {
return passThroughColor;
} else {
return defaultColor;
}
});
}
export function bottomTabsHeight(homeStackState, height, extendedHeight) {
return useDerivedValue(function () {
'worklet';
switch (homeStackState.value) {
case constants.OPEN_WITH_ANIMATION:
return withTiming(extendedHeight, constants.LINEAR_EASING);
break;
case constants.CLOSE_WITH_ANIMATION:
return withTiming(height, constants.LINEAR_EASING);
break;
case constants.OPEN_WITHOUT_ANIMATION:
return extendedHeight;
break;
case constants.CLOSE_WITHOUT_ANIMATION:
return height;
break;
}
});
}
-29
View File
@@ -1,29 +0,0 @@
import { Easing } from 'react-native-reanimated';
// Home Stack States
export const CLOSE_WITHOUT_ANIMATION = 0;
export const OPEN_WITHOUT_ANIMATION = 1;
export const CLOSE_WITH_ANIMATION = 2;
export const OPEN_WITH_ANIMATION = 3;
// Floating Screen States
export const CLOSE_SCREEN_WITHOUT_ANIMATION = 0;
export const OPEN_SCREEN_WITHOUT_ANIMATION = 1;
export const CLOSE_SCREEN_WITH_SHELL_ANIMATION = 2;
export const OPEN_SCREEN_WITH_SHELL_ANIMATION = 3;
export const CLOSE_SCREEN_WITH_SLIDE_TO_RIGHT_ANIMATION = 4;
export const OPEN_SCREEN_WITH_SLIDE_FROM_RIGHT_ANIMATION = 5;
export const CLOSE_SCREEN_WITH_SLIDE_TO_BOTTOM_ANIMATION = 6;
export const OPEN_SCREEN_WITH_SLIDE_FROM_BOTTOM_ANIMATION = 7;
export const SHELL_ANIMATION_TIME = 200;
export const LINEAR_EASING = {
duration: SHELL_ANIMATION_TIME,
easing: Easing.bezier(0, 0, 1, 1),
};
export const EASE_OUT_EASING = {
duration: SHELL_ANIMATION_TIME,
easing: Easing.bezier(0, 0, 0.58, 1),
};
-180
View File
@@ -1,180 +0,0 @@
import { useDerivedValue, withTiming, withSequence, withDelay, Easing, runOnJS } from 'react-native-reanimated';
import * as constants from './constants';
// Derived Values
export function screenLeft(screenState, screenWidth, switcherCardLeftPosition) {
return useDerivedValue(function () {
'worklet';
switch (screenState.value) {
case constants.CLOSE_SCREEN_WITHOUT_ANIMATION:
return screenWidth;
case constants.OPEN_SCREEN_WITHOUT_ANIMATION:
// Note - don't use return 0; its not working in ios
// https://github.com/software-mansion/react-native-reanimated/issues/3296#issuecomment-1573900172
return withSequence(withTiming(-1, { duration: 0 }), withTiming(0, { duration: 0 }));
case constants.CLOSE_SCREEN_WITH_SHELL_ANIMATION:
return withSequence(
withTiming(switcherCardLeftPosition, constants.EASE_OUT_EASING),
withTiming(screenWidth, { duration: 0 }),
);
case constants.OPEN_SCREEN_WITH_SHELL_ANIMATION:
return withTiming(0, constants.EASE_OUT_EASING);
case constants.CLOSE_SCREEN_WITH_SLIDE_TO_RIGHT_ANIMATION:
return withTiming(screenWidth, constants.EASE_OUT_EASING);
case constants.OPEN_SCREEN_WITH_SLIDE_FROM_RIGHT_ANIMATION:
return withTiming(0, constants.EASE_OUT_EASING);
case constants.CLOSE_SCREEN_WITH_SLIDE_TO_BOTTOM_ANIMATION:
return withDelay(constants.SHELL_ANIMATION_TIME, withTiming(screenWidth, { duration: 0 }));
case constants.OPEN_SCREEN_WITH_SLIDE_FROM_BOTTOM_ANIMATION:
return 0;
default:
return screenWidth;
}
});
}
export function screenTop(screenState, screenHeight, switcherCardTopPosition) {
return useDerivedValue(function () {
'worklet';
switch (screenState.value) {
case constants.CLOSE_SCREEN_WITHOUT_ANIMATION:
return screenHeight;
case constants.OPEN_SCREEN_WITHOUT_ANIMATION:
return withSequence(withTiming(-1, { duration: 0 }), withTiming(0, { duration: 0 }));
case constants.CLOSE_SCREEN_WITH_SHELL_ANIMATION:
return withSequence(
withTiming(switcherCardTopPosition, constants.EASE_OUT_EASING),
withTiming(screenHeight, { duration: 0 }),
);
case constants.OPEN_SCREEN_WITH_SHELL_ANIMATION:
return withTiming(0, constants.EASE_OUT_EASING);
case constants.CLOSE_SCREEN_WITH_SLIDE_TO_RIGHT_ANIMATION:
return withDelay(constants.SHELL_ANIMATION_TIME, withTiming(screenHeight, { duration: 0 }));
case constants.OPEN_SCREEN_WITH_SLIDE_FROM_RIGHT_ANIMATION:
return 0;
case constants.CLOSE_SCREEN_WITH_SLIDE_TO_BOTTOM_ANIMATION:
return withTiming(screenHeight, constants.EASE_OUT_EASING);
case constants.OPEN_SCREEN_WITH_SLIDE_FROM_BOTTOM_ANIMATION:
return withTiming(0, constants.EASE_OUT_EASING);
default:
return screenHeight;
}
});
}
export function screenWidth(screenState, screenWidth, switcherCardSize) {
return useDerivedValue(function () {
'worklet';
switch (screenState.value) {
case constants.CLOSE_SCREEN_WITH_SHELL_ANIMATION:
return withTiming(switcherCardSize, constants.EASE_OUT_EASING);
case constants.OPEN_SCREEN_WITH_SHELL_ANIMATION:
return withSequence(
withTiming(switcherCardSize, { duration: 0 }),
withTiming(screenWidth, constants.EASE_OUT_EASING),
);
default:
return screenWidth;
}
});
}
export function screenHeight(screenState, screenHeight, switcherCardSize) {
return useDerivedValue(function () {
'worklet';
switch (screenState.value) {
case constants.CLOSE_SCREEN_WITH_SHELL_ANIMATION:
return withTiming(switcherCardSize, constants.EASE_OUT_EASING);
case constants.OPEN_SCREEN_WITH_SHELL_ANIMATION:
return withSequence(
withTiming(switcherCardSize, { duration: 0 }),
withTiming(screenHeight, constants.EASE_OUT_EASING),
);
default:
return screenHeight;
}
});
}
export function screenZIndex(screenState) {
return useDerivedValue(function () {
'worklet';
switch (screenState.value) {
case constants.CLOSE_SCREEN_WITH_SHELL_ANIMATION:
case constants.CLOSE_SCREEN_WITH_SLIDE_TO_RIGHT_ANIMATION:
case constants.CLOSE_SCREEN_WITH_SLIDE_TO_BOTTOM_ANIMATION:
return withDelay(constants.SHELL_ANIMATION_TIME, withTiming(-1, { duration: 0 }));
case constants.CLOSE_SCREEN_WITHOUT_ANIMATION:
return -1;
default:
return 1;
}
});
}
export function screenBorderRadius(screenState) {
return useDerivedValue(function () {
'worklet';
switch (screenState.value) {
case constants.OPEN_SCREEN_WITH_SHELL_ANIMATION:
return withDelay(constants.SHELL_ANIMATION_TIME, withTiming(0, { duration: 0 }));
case constants.OPEN_SCREEN_WITH_SLIDE_FROM_RIGHT_ANIMATION:
case constants.OPEN_SCREEN_WITH_SLIDE_FROM_BOTTOM_ANIMATION:
case constants.OPEN_SCREEN_WITHOUT_ANIMATION:
return 0;
case constants.CLOSE_SCREEN_WITH_SLIDE_TO_RIGHT_ANIMATION:
case constants.CLOSE_SCREEN_WITH_SLIDE_TO_BOTTOM_ANIMATION:
return withDelay(constants.SHELL_ANIMATION_TIME, withTiming(20, { duration: 0 }));
case constants.CLOSE_SCREEN_WITHOUT_ANIMATION:
case constants.CLOSE_SCREEN_WITH_SHELL_ANIMATION:
return 20;
}
});
}
export function screenGestureOnUpdate(screenLeft) {
return function (event) {
'worklet';
const absoluteX = event.absoluteX;
if (absoluteX !== null) {
screenLeft.value = event.absoluteX;
}
};
}
export function screenGestureOnEnd(data) {
return function (event) {
'worklet';
const {
'screen-left': screenLeft,
'screen-state': screenState,
'screen-width': screenWidth,
'left-velocity': leftVelocity,
'right-velocity': rightVelocity,
'screen-closed-callback': screenClosedCallback,
} = data;
const absoluteX = event.absoluteX ?? 0;
const velocityX = event.velocityX ?? 0;
const closeScreen = velocityX > rightVelocity || (velocityX > leftVelocity && absoluteX >= screenWidth / 2);
// Velocity (points/sec) = Distance/time
var animationVelocity = (screenWidth * 1000) / constants.SHELL_ANIMATION_TIME;
if (Math.abs(velocityX) > animationVelocity) {
animationVelocity = velocityX; // Faster fling
}
const newDistance = closeScreen ? screenWidth - absoluteX : absoluteX;
const animationTime = (newDistance * 1000) / animationVelocity;
screenLeft.value = withTiming(closeScreen ? screenWidth : 0, {
duration: animationTime,
easing: Easing.bezier(0, 0, 0.58, 1),
});
if (closeScreen) {
runOnJS(screenClosedCallback)(animationTime);
}
};
}
-97
View File
@@ -1,5 +1,4 @@
import { useDerivedValue, withTiming, withSequence, withDelay } from 'react-native-reanimated';
import * as constants from './constants';
// Derived values for each stack (communities, chat, wallet, browser)
export function stackOpacity(stackId, selectedStackId) {
@@ -15,99 +14,3 @@ export function stackZIndex(stackId, selectedStackId) {
return selectedStackId.value == stackId ? 10 : 9;
});
}
// Derived values for home stack (container)
export function homeStackOpacity(homeStackState) {
return useDerivedValue(function () {
'worklet';
switch (homeStackState.value) {
case constants.OPEN_WITH_ANIMATION:
return withTiming(1, constants.LINEAR_EASING);
case constants.CLOSE_WITH_ANIMATION:
return withTiming(0, constants.LINEAR_EASING);
case constants.OPEN_WITHOUT_ANIMATION:
return 1;
case constants.CLOSE_WITHOUT_ANIMATION:
return 0;
}
});
}
export function homeStackTop(homeStackState, top) {
return useDerivedValue(function () {
'worklet';
switch (homeStackState.value) {
case constants.OPEN_WITH_ANIMATION:
return withTiming(0, constants.LINEAR_EASING);
case constants.CLOSE_WITH_ANIMATION:
return withTiming(top, constants.LINEAR_EASING);
case constants.OPEN_WITHOUT_ANIMATION:
return 0;
case constants.CLOSE_WITHOUT_ANIMATION:
return top;
}
});
}
export function homeStackLeft(selectedStackId, animateHomeStackLeft, homeStackState, left) {
return useDerivedValue(function () {
'worklet';
if (animateHomeStackLeft.value) {
var leftValue = left[selectedStackId.value];
switch (homeStackState.value) {
case constants.OPEN_WITH_ANIMATION:
return withSequence(withTiming(leftValue, { duration: 0 }), withTiming(0, constants.LINEAR_EASING));
case constants.CLOSE_WITH_ANIMATION:
return withTiming(leftValue, constants.LINEAR_EASING);
case constants.OPEN_WITHOUT_ANIMATION:
return 0;
case constants.CLOSE_WITHOUT_ANIMATION:
return leftValue;
}
} else {
return 0;
}
});
}
export function homeStackPointer(homeStackState) {
return useDerivedValue(function () {
'worklet';
var homeStackStateValue = homeStackState.value;
return homeStackStateValue == constants.OPEN_WITH_ANIMATION ||
homeStackStateValue == constants.OPEN_WITHOUT_ANIMATION
? 'auto'
: 'none';
});
}
export function homeStackScale(homeStackState, minimizeScale) {
return useDerivedValue(function () {
'worklet';
switch (homeStackState.value) {
case constants.OPEN_WITH_ANIMATION:
return withTiming(1, constants.LINEAR_EASING);
case constants.CLOSE_WITH_ANIMATION:
return withTiming(minimizeScale, constants.LINEAR_EASING);
case constants.OPEN_WITHOUT_ANIMATION:
return 1;
case constants.CLOSE_WITHOUT_ANIMATION:
return minimizeScale;
}
});
}
export function homeStackBorderRadius(homeStackState) {
return useDerivedValue(function () {
'worklet';
switch (homeStackState.value) {
case constants.OPEN_WITH_ANIMATION:
return withDelay(constants.SHELL_ANIMATION_TIME, withTiming(0, { duration: 0 }));
case constants.CLOSE_WITH_ANIMATION:
case constants.CLOSE_WITHOUT_ANIMATION:
return 20;
case constants.OPEN_WITHOUT_ANIMATION:
return 0;
}
});
}
+25 -23
View File
@@ -2,9 +2,10 @@
(:require
["react-native" :as rn]
["react-native-status-keycard" :default status-keycard]
[oops.core :as oops]
[react-native.platform :as platform]
[taoensso.timbre :as log]
[utils.address :as address]))
[schema.core :as schema]
[taoensso.timbre :as log]))
(defonce event-emitter
(if platform/ios?
@@ -94,22 +95,14 @@
[{:keys [on-success on-failure]}]
(.. status-keycard
(getApplicationInfo)
(then (fn [response]
(let [info (-> response
(js->clj :keywordize-keys true)
(update :key-uid address/normalized-hex))]
(on-success info))))
(then on-success)
(catch on-failure)))
(defn factory-reset
[{:keys [on-success on-failure]}]
(.. status-keycard
(factoryReset)
(then (fn [response]
(let [info (-> response
(js->clj :keywordize-keys true)
(update :key-uid address/normalized-hex))]
(on-success info))))
(then on-success)
(catch on-failure)))
(defn install-applet
@@ -155,6 +148,13 @@
(then on-success)
(catch on-failure)))
(defn save-mnemonic
[{:keys [mnemonic pin on-success on-failure]}]
(.. status-keycard
(saveMnemonic mnemonic pin)
(then on-success)
(catch on-failure)))
(defn unblock-pin
[{:keys [puk new-pin on-success on-failure]}]
(when (and new-pin puk)
@@ -256,17 +256,19 @@
(catch on-failure))))
(defn sign
[{pin :pin path :path card-hash :hash on-success :on-success on-failure :on-failure}]
(when (and pin card-hash)
(if path
(.. status-keycard
(signWithPath pin path card-hash)
(then on-success)
(catch on-failure))
(.. status-keycard
(sign pin card-hash)
(then on-success)
(catch on-failure)))))
[{:keys [pin path hash-data]}]
(if path
(oops/ocall status-keycard "signWithPath" pin path hash-data)
(oops/ocall status-keycard "sign" pin hash-data)))
(schema/=> sign
[:=>
[:cat
[:map
[:pin :string]
[:hash-data :string]
[:path {:optional true} [:maybe :string]]]]
:any])
(defn sign-typed-data
[{card-hash :hash on-success :on-success on-failure :on-failure}]
+12 -12
View File
@@ -306,13 +306,13 @@
{:dispatch [:universal-links/handle-url normalized-url]}
(if config/show-not-implemented-features?
(rf/merge cofx
{:db (assoc db
:browser/options
{:browser-id (:browser-id browser)}
:browser/screen-id :browser)}
{:db (assoc db
:browser/options
{:browser-id (:browser-id browser)}
:browser/screen-id :browser)
:dispatch-n [[:shell/change-tab :browser-stack]]}
(navigation/pop-to-root :shell-stack)
(chat.events/close-chat (:current-chat-id db))
(navigation/change-tab :browser-stack)
(update-browser browser)
(resolve-url nil))
{:linking/open-url url}))))
@@ -323,20 +323,20 @@
[{:keys [db] :as cofx} browser-id]
(let [browser (get-in db [:browser/browsers browser-id])]
(rf/merge cofx
{:db (assoc db
:browser/options
{:browser-id browser-id}
:browser/screen-id :browser)}
{:db (assoc db
:browser/options
{:browser-id browser-id}
:browser/screen-id :browser)
:dispatch-n [[:shell/change-tab :browser-stack]]}
(update-browser browser)
(navigation/change-tab :browser-stack)
(resolve-url nil))))
(rf/defn open-browser-tabs
{:events [:browser.ui/open-browser-tabs]}
[{:keys [db] :as cofx}]
(rf/merge cofx
{:db (assoc db :browser/screen-id :browser-tabs)}
(navigation/change-tab :browser-stack)))
{:db (assoc db :browser/screen-id :browser-tabs)
:dispatch-n [[:shell/change-tab :browser-stack]]}))
(rf/defn web3-error-callback
{:events [:browser.dapp/transaction-on-error]}
+17 -19
View File
@@ -18,25 +18,23 @@
clock-value
"0x0000000000000000000000000000000000000000000000000000000000000000"))
(rf/defn update-chats-in-app-db
{:events [:chats-list/load-success]}
[{:keys [db]} ^js new-chats-js]
(let [{:keys [all-chats chats-home-list]}
(reduce (fn [acc ^js chat-js]
(let [{:keys [chat-id profile-public-key timeline? community-id active] :as chat}
(data-store.chats/<-rpc-js chat-js)]
(cond-> acc
(and (not profile-public-key) (not timeline?) (not community-id) active)
(update :chats-home-list conj chat-id)
:always
(assoc-in [:all-chats chat-id] chat))))
{:all-chats {}
:chats-home-list #{}}
new-chats-js)]
{:db (assoc db
:chats all-chats
:chats-home-list chats-home-list
:chats/loading? false)}))
(rf/reg-event-fx :chats-list/load-success
(fn [{:keys [db]} [^js new-chats-js]]
(let [{:keys [all-chats chats-home-list]}
(reduce (fn [acc ^js chat-js]
(let [{:keys [chat-id profile-public-key timeline? community-id active] :as chat}
(data-store.chats/<-rpc-js chat-js)]
(cond-> acc
(and (not profile-public-key) (not timeline?) (not community-id) active)
(update :chats-home-list conj chat-id)
:always
(assoc-in [:all-chats chat-id] chat))))
{:all-chats {}
:chats-home-list #{}}
new-chats-js)]
{:db (-> db
(update :chats merge all-chats)
(update :chats-home-list into chats-home-list))})))
(rf/defn load-chat-success
{:events [:chats-list/load-chat-success]}
+2 -2
View File
@@ -134,9 +134,9 @@
unmarshal-members))
(re-frame/reg-fx :fetch-chats-preview
(fn [{:keys [on-success]}]
(fn [{:keys [on-success chat-preview-type]}]
(json-rpc/call {:method "wakuext_chatsPreview"
:params []
:params [chat-preview-type]
:js-response true
:on-success #(on-success ^js %)
:on-error #(log/error "failed to fetch chats" 0 -1 %)})))

Some files were not shown because too many files have changed in this diff Show More