Compare commits

..
Author SHA1 Message Date
Volodymyr Kozieiev d2eb401a16 wip 2025-01-26 16:36:48 +00:00
Volodymyr Kozieiev c568a51c60 Before modifying signing order 2025-01-24 16:55:15 +00:00
Yevheniia Berdnyk f474edf67d e2e: fix for saving logs 2025-01-22 16:03:54 +02:00
Volodymyr Kozieiev dfd90617bf Backend server doc added to readme (#21966) 2025-01-21 12:14:27 +00:00
Yevheniia Berdnyk 9782ba2ac3 e2e: added verifications to fallback test 2025-01-21 11:54:44 +02:00
Brian Sztamfater f0e0c95fe0 feat: integrate base chain (#21876)
Signed-off-by: Brian Sztamfater <brian@status.im>
2025-01-21 01:44:02 -03:00
Mohsen ef7d977299 [#21305] fix: sort assets by value and collectibles by name (#21908)
* [#21305] fix: sort assets by value and collectibles by name

* [#21305] fix: use seq to check name is nil or empty

* [#21305] fix: normalize text to sort properly
2025-01-20 19:41:40 +03:00
Parvesh Monu 70a5ed255f fix keycard sign up ui issues (#21938) 2025-01-20 17:22:13 +05:30
flexsurfer be1347346c [#21578] Keycard - Factory reset a Keycard (#21914) 2025-01-20 12:35:06 +01:00
Volodymyr Kozieiev 803e83ae02 Screens for editing transaction settings (#21838)
* Screens for editing transaction settings

* extra lines removed

* review notes fixed
2025-01-20 11:21:55 +00:00
Yevheniia Berdnyk 64748c939b e2e: fix for test_community_mentions_push_notification 2025-01-20 03:33:27 +02:00
Sean Hagstrom 64fb344197 chore: add support for remote devices with re-frisk server (#21805)
This changes adds support for connecting remotely to re-frisk when running the app on a mobile device. This change is essentially aimed towards better support for introspecting on iOS devices, but these changes should also work for Android devices too. Note, that running in the Android simulator may still require port-forwarding with `adb reverse`.
2025-01-18 05:57:17 +00:00
Sean Hagstrom f27b402205 chore: update status-go with identity images fixes (#21931)
This change integrates status-go changes that fix an underlying issue with generating identity images. Now identity images will be generated with a populated `clock` field, so we no longer need our existing workaround.
2025-01-18 05:37:37 +00:00
Icaro Motta b22744f81e fix(settings): Show current mailserver in legacy settings (#21901)
A regression removed more code than we wanted in
https://github.com/status-im/status-mobile/pull/20730 and the result was
broken functionality in the Legacy settings.

We now show the current mailserver correctly. The data is kept in sync via
signals, just as the original code.

Fixes https://github.com/status-im/status-mobile/issues/21375
2025-01-17 14:26:20 -03:00
Mohamed Javid 174e44c77d fix(wallet)_: Dismiss collectible details screen after a is TX placed (#21909)
This commit fixes the user is not taken to the activity tab after the TX is placed if the user enters the send flow from collectible details screen (inside the account)

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2025-01-16 21:57:06 +05:30
Mohsen 35c5d5ae6a [#21853] fix: unregister event listener after logout (#21873)
* [#21853] fix: check deeplink pending request after wallet connect loaded

* [#21853] fix: isolate the usage of pending deeplink url

* [#21853] fix: remove redundant check for web3 object

* [#21853] fix: unregister event listener after logout

* [#21853] fix: extract handler
2025-01-15 20:33:31 +03:00
frank ae00ecb3e0 ci: support long awaited Xcode 16 (#21345) 2025-01-15 18:49:51 +05:30
flexsurfer 8687282d63 [#21836] Relative derivation paths are not supported by keycard (#21888) 2025-01-15 12:27:51 +01:00
frank 04a97faa43 chore_: remove EncodeTransfer/EncodeFunctionCall/VerifyAccountPassword (#21925) 2025-01-15 17:52:30 +08:00
Parvesh Monu 91d3cd8da8 fix "keycard is not empty" screen shown if keycard moved during create profile flow (#21918) 2025-01-15 13:14:32 +05:30
Parvesh Monu e1a7146f4c fix Keyboard overlaps suggestion bar and validation errors (#21917) 2025-01-15 12:57:35 +05:30
Sean Hagstrom 5dc1bfe03b chore: cleanup event definitions and tests for contact-requests and deleting messages (#21885)
* chore: add error logging events and effects

* chore: restructure tests and effects for delete-message-for-me

* chore: refactor events and effects and tests for chat-contacts

* chore: refactor and add tests for accepting and declining contact request

* chore: refactor chat-contacts rf/defn to defn

* chore: add :fx key as a mergeable effect for rf/merge when running tests

* chore: refactor rf/defn and add tests for delete-message-for-me

* chore: remove log effects for contacts

* chore: remove logs effects for delete-message-for-me

* fix: update chat usage of sync-all

* fix: resolve schema error with missing action-label for contact-request dismissed state

* fix: ensure chat-contacts event error handlers are compatible with re-frame

* fix: ensure delete-message-for-me event error handlers are compatible with re-frame

* chore: refactor and test delete-message events

* chore: refactor log events and effects

* chore: use log effect in delete-message

* chore: use log events and effects inside chat-contacts

* chore: use log effects inside delete-message-for-me

* chore: remove unneeded test for delete-message-for-me

* chore: format bottom-drawer component

* chore: format delete-message

* chore: format delete-message-for-me
2025-01-14 14:41:47 +00:00
Mohamed Javid 2d8ba41d89 fix(wallet)_: General send flow for saved address and scanned address (#21899)
This commit:

- fixes send flow from saved addresses
- adds back send flow from general QR scanner

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2025-01-14 17:57:21 +05:30
Sean Hagstrom 457ed15e0b chore: resolve deprecation warnings related to custom-color and touchable-without-feeback (#21874)
This change refactors the codebase to avoid using deprecated functions and components related to the `custom-color` function (now removed) and the touchable-without-feedback component.
2025-01-14 12:09:49 +00:00
Alexander c11cf22bbb 2.32.x: Update metadata for F-Droid (#21912)
* 2.32.x: Update metadata for F-Droid

* Rollback
2025-01-14 11:43:11 +01:00
Siddarth Kumar 6ffdaa4e25 nix: fix warnings and upgrade to 2.24.11 (#21547)
These warnings are fixed:

```
warning: ignoring the client-specified setting 'keep-derivations', because it is a restricted setting and you are not a trusted user
warning: ignoring the client-specified setting 'keep-outputs', because it is a restricted setting and you are not a trusted user
warning: ignoring the client-specified setting 'sandbox', because it is a restricted setting and you are not a trusted user
warning: ignoring the client-specified setting 'stalled-download-timeout', because it is a restricted setting and you are not a trusted user
warning: ignoring the client-specified setting 'trusted-public-keys', because it is a restricted setting and you are not a trusted user
warning: ignoring the client-specified setting 'trusted-substituters', because it is a restricted setting and you are not a trusted user
```
2025-01-14 09:42:14 +05:30
flexsurfer f56bd54fd3 [#21915] Wrong address generated after creation a new keypair (#21921) 2025-01-13 17:06:59 +01:00
Sean HagstromandAlexander 394648b377 fix: use image clock when updating profile images to cause re-render (#21795) (#21830)
Co-authored-by: Alexander <alwxndr@gmail.com>
2025-01-10 15:01:57 +01:00
Yevheniia Berdnyk 22a606cbab e2e: additional fix for requirements 2025-01-10 14:03:23 +02:00
Sean HagstromandAlexander 1b30b3be80 chore: update legal-docs submodule and resources with updated terms-of-use (#21821) (#21832)
Co-authored-by: Alexander <alwxndr@gmail.com>
2025-01-10 12:27:10 +01:00
Yevheniia Berdnyk 10434b53e0 e2e: fix for requirements and getting username 2025-01-10 03:14:31 +02:00
flexsurfer 0472523a7f [#21652] The main part of a backup flow is missing at Keycard migrati… (#21893) 2025-01-09 19:20:45 +01:00
Volodymyr Kozieiev 770963447a Simplified pull request template (#21900) 2025-01-09 13:48:10 +00:00
Parvesh Monu 874aa9866d On-boarding: re add bio-metric screen to syncing flow (#21890) 2025-01-09 18:22:37 +05:30
Ulises Manuel 32a3f85694 fix(avatars) - Blinking all over the app and improvement in UX (#21782)
* Change multiple uses of `merge` to `assoc` in flat-list wrapper

* Fix fast-image wrapper to avoid blinking

* merge -> assoc usage in chat-item component

* Fix avatar not being updated when the user changes their username

* Fix scalable avatar issues

- On Android, the border was inconsistent depending on the theme.
- Fix animation, simplify the calculation, and now it matches designs

* Avoid blinking by using rn/memo
2025-01-08 18:16:19 -06:00
Volodymyr Kozieiev b88bbda3c5 Reverted some code after cleanup (#21892) 2025-01-08 11:32:44 +00:00
flexsurfer fad5119ceb [#21825] [Android] Java error at the and of faild Migration to a Keycard flow (#21889) 2025-01-08 11:47:53 +01:00
Parvesh Monu 3697f63ab0 Fix syncing flow navigation and designs (#21884) 2025-01-08 11:22:19 +05:30
Mohamed Javid ba8cf8e863 fix(wallet)_: collectible route cleanup on navigating back from TX confirmation page (#21883)
This commit fixes routes not cleaned properly ("Context Canceled" and "No Routes Found" errors thrown on generating the next route) when the user navigates back from the TX confirmation screen using the device's back button/gesture.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2025-01-07 19:04:01 +05:30
Siddarth Kumar ce1d2c4ed8 android: Kotlinify push notifications module (#21881) 2025-01-07 15:45:54 +05:30
Yevheniia Berdnyk 813c60f9e1 e2e: requirements cleanup 2025-01-07 03:07:01 +02:00
Volodymyr Kozieiev 28a81f2dd8 🎄 🧹 New Year cleanup (#21868)
* big cleannup: warnings fixed, unused code removed
2025-01-06 12:03:36 +00:00
Yevheniia Berdnyk 826410b687 e2e: cleanup base_test_case and conftest 2025-01-03 18:14:20 +02:00
Siddarth Kumar 1aa7594c41 android: kotlinify encryption utils (#21878) 2025-01-03 21:21:11 +05:30
Siddarth Kumar 5ff1d70357 android: kotlinify ui helper (#21879) 2025-01-03 21:03:06 +05:30
Siddarth Kumar 2a95f7cfac android: kotlinify root util (#21877) 2025-01-03 20:30:48 +05:30
frank 4654c4a543 fix(sha3)_: support hex string (#21837)
* fix(sha3)_: support hex string

https://github.com/status-im/status-go/compare/84493728...e01e489e
2025-01-03 08:44:02 +08:00
Mohamed Javid baf3b8c9ed fix(wallet)_: Send flow for collectibles (#21871)
This commit fixes

- the send flow for collectibles (ERC721 and ERC1155)
- picking the right balance of the ERC1155 in the send flow from the account page, based on the account viewing by the user
- the balance of ERC1155 is sometimes incorrect if the collectible is present in more than one account of the user

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2025-01-02 23:40:11 +05:30
Brian Sztamfater c6ff90954f fix_: add token and selected network on "Select network to receive" screen (#21872) 2025-01-02 11:40:04 -03:00
Tetiana Churikova c37498a6b2 e2e: big cleanup (#21875) 2024-12-30 21:10:54 +01:00
Brian Sztamfater c1b0f3ae98 fix_: include assets only related to selected network on edit asset drawer on send and bridge flows (#21869)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-12-30 11:36:43 -03:00
Icaro Motta 5007dc757f chore: Bump status-go version to include fix for bad peer check for lightmode (#21865)
Upgrades status-go to version v8.0.0, which includes the fix from PR
https://github.com/status-im/status-go/pull/5964 fix_: bad peer check logic for
lightmode and some fixes.

Might resolve https://github.com/status-im/status-mobile/issues/18031

Areas that may be impacted: we are moving from status-go version 7.0.0 to 8.0.0.
These are the changes:

- https://github.com/status-im/status-go/commit/a4e36d49c * fix_: missing message verifier start-stop ,go-waku updates, lightpush service rate limits (#5964)
- https://github.com/status-im/status-go/commit/810468a57 * test_: create private group tests (#6225)
- https://github.com/status-im/status-go/commit/0cf556bdb * test_: unskip test initialize logging (#6229)
- https://github.com/status-im/status-go/commit/b803918c2 * ci_: pytest-lint correct target pr branch (#6230)
- https://github.com/status-im/status-go/commit/d29120447 * chore(block)!: remove desktop BlockContact function for parity (#6172)
- https://github.com/status-im/status-go/commit/309d17ae5 * feat_: status-backend health endpoint (#6201)
- https://github.com/status-im/status-go/commit/6a5623bac * test_: set proxy creds (#6211)
- https://github.com/status-im/status-go/commit/2172abe95 * fix_: add infuraSecret and statusProxyBlockchainPassword to secrets (#6217)
- https://github.com/status-im/status-go/commit/0f7c26dc9 * test_: skip flaky TestService_IncrementalUpdateMixed (#6205)
- https://github.com/status-im/status-go/commit/75bdda271 * fix_: correct sensitive regex (#6188)
- https://github.com/status-im/status-go/commit/08eee8a64 * test_: add python linters (#6212)
- https://github.com/status-im/status-go/commit/66850321e * fix_: remove logging of rpc endpoint (#6195)
- https://github.com/status-im/status-go/commit/c27c773c2 * chore(wallet)_: from and to chains added to send details
- https://github.com/status-im/status-go/commit/74db63143 * test_: contact requests tests (#6167)
- https://github.com/status-im/status-go/commit/5a8310d5a * fix(pins)_: delete pins when the og message is deleted (#6173)
- https://github.com/status-im/status-go/commit/137698e02 * ci_: bring back cmd coverage (#6204)
- https://github.com/status-im/status-go/commit/1795620df * test_: run functional tests on host (no container) (#6159)
- https://github.com/status-im/status-go/commit/ef177c1c6 * feat_: SensitiveString type (#6190)
- https://github.com/status-im/status-go/commit/8b95c8148 * feat_: graceful shutdown with status-backend (#6189)
- https://github.com/status-im/status-go/commit/e6c2f89f0 * chore_: remove endpoint InitLogging (#6182)
- https://github.com/status-im/status-go/commit/4ccb08f11 * test_: WalletService class (#6171)
- https://github.com/status-im/status-go/commit/943ae1335 * fix(functional-tests)_: disable testnet (#6181)
- https://github.com/status-im/status-go/commit/616a76098 * feat_: api logging signals (#6150)
- https://github.com/status-im/status-go/commit/dfb591874 * fix_: check group error in GetBalancesAtByChain (#6169)
- https://github.com/status-im/status-go/commit/3a0080281 * fix_: create/restore account error signal (#6174)
- https://github.com/status-im/status-go/commit/e7cc53529 * feat(telem)_: track total waku message bandwidth (#6157)
- https://github.com/status-im/status-go/commit/d07e61f61 * fix_: nil *MessengerResponse is a valid result (#6175))
2024-12-26 22:20:43 -03:00
Tetiana Churikova b09f3fa6da logs: enable nightly (#21864) 2024-12-26 13:46:21 +01:00
Yevheniia Berdnyk b11c817392 e2e: LambdaTest 2024-12-26 11:44:48 +02:00
Parvesh Monu 247674b280 Onboarding remove identifiers code and refactor create_or_sync_profile screen (#21668) 2024-12-24 21:34:45 +05:30
Mohsen 07ea097bb4 [#21336] feat: upgrade wallet connect (#21833) 2024-12-24 13:13:52 +03:00
Brian Sztamfater 23d3a2db2a feat(wallet): simplify send and bridge flow ux (#21595)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-12-23 12:00:17 -03:00
Shivek KhuranaandIcaro Motta a85ca5bd3d chore: Give non-destructive instructions when Keycard migration failed (#21844)
Co-authored-by: Icaro Motta <icaro.ldm@gmail.com>
2024-12-20 18:05:11 +05:30
Mohamed Javid 0f036ca9c4 fix_: slider reset in standard authentication (#21831)
This commit fixes the slider-button doesn't reset after the completion of slider in standard authentication with keycard keypairs.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-12-17 17:46:16 +05:30
flexsurfer c19128e8b1 [#21828] Close the flows for adding accounts in keycard accounts (#21829) 2024-12-16 17:49:59 +01:00
Brian Sztamfater 8d615801d1 feat_: optimize endpoint calls when fetching balances (#21802)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-12-16 12:11:09 -03:00
Mohsen 4f6e1897fe [#21135] fix: handle unsupported wallet address (#21820) 2024-12-16 17:54:16 +03:00
Ulises ManuelandShivek Khurana 93b5f8d180 Hide viewing community token requirements under a feature flag (#21814)
Co-authored-by: Shivek Khurana <khuranashivek@outlook.com>
2024-12-16 18:17:06 +05:30
Parvesh Monu 0e607dc293 fix Privacy policy button in learn more sheet open terms-of-use sheet (#21823) 2024-12-16 15:42:17 +05:30
flexsurfer 9ced0e4131 [#21708] [Android] Login with Keycard stucks on Preparing screen from time to time (#21811) 2024-12-13 19:57:26 +01:00
Sean Hagstrom 55ee800e18 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 09:21:09 -08:00
flexsurfer 676998b83b [#21803] Cannot perform transactions/create derived account via keycard using NON default keypairs which existed before keycard migration (#21808) 2024-12-12 16:31:54 +01:00
Ulises Manuel 755ef19315 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-11 13:15:26 -06:00
Ulises Manuel bc9b0f8c87 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-11 11:05:23 -06:00
Yevheniia Berdnyk c8b063493b e2e: False failures fixes 2024-12-11 00:38:34 +02:00
flexsurfer 949e78a17e [#21577] Keycard [Wallet] - Derives next account for profile key pair (#21753) 2024-12-10 18:07:45 +01:00
Mohsen a821ec5a14 [#21763] feat: add feature unavailable for dapps interaction (#21771) 2024-12-10 11:35:44 +01:00
cuiyourong 4648066ec7 chore: fix some typos in comment (#21775) 2024-12-10 09:27:32 +01:00
Ulises ManuelandYevheniia Berdnyk e85bc539d3 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-09 13:55:47 -06:00
Mohamed Javid c26d298573 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 00:56:57 +05:30
Mohamed Javid cdde36ca28 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-10 00:21:00 +05:30
Mohamed Javid 3c3ef20769 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-09 20:02:48 +05:30
Alexander 2150f6db48 Bump release to 2.32.0 (#21773) 2024-12-09 12:26:51 +01:00
Sean Hagstrom 10101a23e6 Feature: add "close community" action to opened/spectated communities (#21687)
This change adds a new action to the action-drawer for opened communities. Now opened communities can be closed by users by pressing on the "Close community" action. Note, that this action will only be available to communities displayed in communities list under the opened tab.
2024-12-06 09:50:40 -08:00
Brian Sztamfater f75fff9dd8 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 13:32:05 -03: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
999 changed files with 15113 additions and 34846 deletions
-185
View File
@@ -1,185 +0,0 @@
legacy.status-im.utils.build/warning-handler
legacy.status-im.utils.build/get-current-sha
status-im.constants/spacing-char
status-im.constants/arg-wrapping-char
legacy.status-im.ios.core/init
legacy.status-im.ui.components.camera/aspects
legacy.status-im.ui.components.camera/capture-targets
legacy.status-im.ui.components.camera/set-torch
legacy.status-im.ui.components.camera/request-access-ios
legacy.status-im.chat.models.message-content/stylings
legacy.status-im.chat.models.message-content/actions
legacy.status-im.chat.models.message-content/blank-string
legacy.status-im.chat.models.message-content/sorted-ranges
legacy.status-im.ethereum.mnemonic/words->passphrase
native-module.core/listener
native-module.core/multiaccount-reset
native-module.core/extract-group-membership-signatures
native-module.core/sign-group-membership
native-module.core/update-mailservers
legacy.status-im.ethereum.abi-spec/bytes-to-hex
legacy.status-im.android.core/init
legacy.status-im.chat.models.message/transport-keys
legacy.status-im.utils.datetime/week
legacy.status-im.utils.datetime/time-ago
legacy.status-im.utils.datetime/format-date
legacy.status-im.utils.datetime/get-ordinal-date
reagent.dom/render
reagent.dom/unmount-component-at-node
reagent.dom/dom-node
reagent.dom/force-update-all
legacy.status-im.multiaccounts.create.core/get-new-key-code
legacy.status-im.ethereum.decode/string
legacy.status-im.ui.screens.network.views/mainnet?
legacy.status-im.data-store.chats/event->string
legacy.status-im.mailserver.constants/seven-days
legacy.status-im.mailserver.constants/connection-timeout
legacy.status-im.hardwallet.card/install-applet
legacy.status-im.hardwallet.card/install-cash-applet
legacy.status-im.multiaccount.login.data-test/all-contacts
legacy.status-im.multiaccount.login.data-test/multiaccounts
legacy.status-im.multiaccount.login.data-test/get-chats
legacy.status-im.multiaccount.login.data-test/transport
legacy.status-im.multiaccount.login.data-test/topics
legacy.status-im.utils.utils/clear-timeout
legacy.status-im.utils.handlers/logged-in
legacy.status-im.multiaccounts.model/credentials
legacy.status-im.multiaccounts.login.core/contract-fleet?
legacy.status-im.multiaccounts.login.core/fetch-nodes
status-im.config/rpc-networks-only?
status-im.config/waku-enabled?
legacy.status-im.utils.pairing/has-paired-installations?
legacy.status-im.tribute-to-talk.core-test/user-cofx
mocks.js-dependencies/action-button
mocks.js-dependencies/camera
mocks.js-dependencies/dismiss-keyboard
mocks.js-dependencies/emoji-picker
mocks.js-dependencies/i18n
mocks.js-dependencies/qr-code
mocks.js-dependencies/svg
mocks.js-dependencies/icons
mocks.js-dependencies/webview
mocks.js-dependencies/desktop-linking
mocks.js-dependencies/desktop-shortcuts
mocks.js-dependencies/snoopy
mocks.js-dependencies/snoopy-filter
mocks.js-dependencies/snoopy-bars
mocks.js-dependencies/snoopy-buffer
mocks.js-dependencies/desktop-menu
mocks.js-dependencies/desktop-config
mocks.js-dependencies/react-native-navigation-twopane
mocks.js-dependencies/react-native-screens
mocks.js-dependencies/react-native-shake
mocks.js-dependencies/back-handler
mocks.js-dependencies/react
mocks.js-dependencies/react-navigation-native
mocks.js-dependencies/react-navigation-stack
mocks.js-dependencies/react-navigation-bottom-tabs
mocks.js-dependencies/react-native-haptic-feedback
mocks.js-dependencies/mock
quo.previews.main/init
legacy.status-im.chat.models.message-list-test/descending-range
legacy.status-im.chat.models.message-list-test/random-range
legacy.status-im.ethereum.eip165/supports?
legacy.status-im.utils.hex/valid-hex?
legacy.status-im.multiaccounts.core/chat-send?
legacy.status-im.hardwallet.simulated-keycard/install-cash-applet
legacy.status-im.hardwallet.simulated-keycard/sign-typed-data
legacy.status-im.utils.core/safe-read-message-content
legacy.status-im.ui.components.react/native-modules
legacy.status-im.ui.components.react/progress-bar
react-native.fs/move-file
react-native.fs/read-dir
react-native.fs/mkdir
react-native.fs/unlink
react-native.fs/file-exists?
legacy.status-im.ui.components.colors/white
legacy.status-im.ui.components.colors/black
legacy.status-im.ui.components.core/animated-header
legacy.status-im.ui.components.core/safe-area-provider
legacy.status-im.ui.components.core/safe-area-consumer
legacy.status-im.ui.components.core/safe-area-view
legacy.status-im.utils.universal-links.core/open!
legacy.status-im.transport.filters.core-test/member-2
legacy.status-im.ui.screens.chat.ttt/one-to-one-chat-description-container
legacy.status-im.ethereum.ens/ttl
legacy.status-im.ethereum.ens/addr-hash
legacy.status-im.ethereum.ens/name-hash
legacy.status-im.ethereum.ens/ABI-hash
legacy.status-im.ethereum.ens/pubkey-hash
legacy.status-im.network.core/get-network
status-im.constants/desktop-content-types
status-im.constants/blocks-per-hour
status-im.constants/one-earth-day
status-im.constants/left-pane-min-width
status-im.constants/system
status-im.constants/contact-discovery
status-im.constants/send-transaction-failed-parse-response
status-im.constants/send-transaction-failed-parse-params
status-im.constants/send-transaction-no-account-selected
status-im.constants/send-transaction-invalid-tx-sender
status-im.constants/web3-get-logs
status-im.constants/web3-transaction-receipt
status-im.constants/web3-new-filter
status-im.constants/web3-new-pending-transaction-filter
status-im.constants/web3-new-block-filter
status-im.constants/web3-uninstall-filter
status-im.constants/web3-get-filter-changes
status-im.constants/web3-shh-post
status-im.constants/web3-shh-new-identity
status-im.constants/web3-shh-has-identity
status-im.constants/web3-shh-new-group
status-im.constants/web3-shh-add-to-group
status-im.constants/web3-shh-new-filter
status-im.constants/web3-shh-uninstall-filter
status-im.constants/web3-shh-get-filter-changes
status-im.constants/web3-shh-get-messages
status-im.constants/status-create-address
status-im.constants/event-transfer-hash
status-im.constants/regx-rtl-characters
status-im.constants/desktop-msg-chars-hard-limit
status-im.constants/debug-metrics
status-im.constants/scan-qr-code
status-im.constants/ipfs-proto-code
status-im.constants/swarm-proto-code
legacy.status-im.multiaccounts.update.publisher/publish-update!
legacy.status-im.utils.async/task-queue
legacy.status-im.utils.async/async-periodic-run!
legacy.status-im.desktop.core/app-root
legacy.status-im.desktop.core/init
legacy.status-im.chat.models-test/test-db
legacy.status-im.ui.components.spacing/padding-vertical
legacy.status-im.utils.money/percent-change
utils.debounce/clear-all
legacy.status-im.transport.db/create-chat
legacy.status-im.utils.priority-map/priority-map
legacy.status-im.utils.priority-map/priority-map-by
legacy.status-im.utils.priority-map/priority-map-keyfn
legacy.status-im.utils.priority-map/empty-message-map
legacy.status-im.wallet.choose-recipient.core/use-default-eth-gas
legacy.status-im.ui.components.animation/decay
legacy.status-im.ui.components.animation/remove-all-listeners
legacy.status-im.ui.components.animation/stop-animation
legacy.status-im.ui.components.animation/animated
legacy.status-im.ui.components.animation/add
legacy.status-im.ui.components.animation/subtract
legacy.status-im.ui.components.animation/get-layout
legacy.status-im.wallet.transactions-test/uri-query-data
legacy.status-im.utils.name/shortened-name
legacy.status-im.ui.components.button.haptic/trigger
legacy.status-im.contact.db/filter-dapps
legacy.status-im.contact.db/filter-group-contacts
legacy.status-im.contact.db/legacy-pending?
legacy.status-im.utils.transducers-test/preview-call-1
legacy.status-im.utils.transducers-test/preview-call-2
legacy.status-im.utils.types/to-string
legacy.status-im.chat.db/datemark?
legacy.status-im.chat.db/gap?
legacy.status-im.chat.db/map->sorted-seq
legacy.status-im.utils.snoopy/status-module-filter
legacy.status-im.utils.snoopy/websocket-filter
legacy.status-im.utils.snoopy/touches-filter
legacy.status-im.utils.snoopy/native-animation-filter
legacy.status-im.utils.snoopy/keyboard-observer-filter
legacy.status-im.utils.multihash/hex
legacy.status-im.utils.multihash/decode-array
+28 -3
View File
@@ -4,7 +4,7 @@
legacy.status-im.utils.views/letsubs clojure.core/let
reagent.core/with-let clojure.core/let
legacy.status-im.utils.fx/defn clj-kondo.lint-as/def-catch-all
utils.re-frame/defn clj-kondo.lint-as/def-catch-all
utils.re-frame/defn clojure.core/defn
quo.react/with-deps-check clojure.core/fn
quo.previews.preview/list-comp clojure.core/for
legacy.status-im.utils.styles/def clojure.core/def
@@ -13,7 +13,29 @@
test-helpers.unit/deftest-event clojure.core/defn
taoensso.tufte/defnp clojure.core/defn}
:linters {:case-duplicate-test {:level :error}
:linters {:clojure-lsp/unused-public-var {:exclude-when-defined-by #{utils.re-frame/defn}
:exclude #{
;; even if we are not
;; using color now, we
;; will need it later
quo.foundations.colors
;; same for funcs from
;; native-module
native-module.core
;; some funcs used
;; temporarily during
;; development
test-helpers.component
test-helpers.unit
;; not sure if unused
;; functions here should
;; be removed:
keycard.keycard
react-native.fs}}
:case-duplicate-test {:level :error}
:case-quoted-test {:level :error}
:case-symbol-test {:level :error}
:clj-kondo-config {:level :error}
@@ -40,7 +62,8 @@
:equals-true {:level :error}
:inline-def {:level :error}
:invalid-arity {:skip-args [legacy.status-im.utils.fx/defn
utils.re-frame/defn]}
utils.re-frame/defn
utils.re-frame/merge]}
:loop-without-recur {:level :error}
:minus-one {:level :error}
:misplaced-docstring {:level :error}
@@ -53,6 +76,8 @@
:redundant-do {:level :error}
:redundant-let {:level :error}
:refer-all {:level :error}
;; ignore error in config itself saying that `:shadowed-fn-param` is unknown
#_{:clj-kondo/ignore [:clj-kondo-config]}
:shadowed-fn-param {:level :error}
:shadowed-var {:level :error
;; We temporarily use :include to define an
+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
+2 -3
View File
@@ -1,9 +1,8 @@
DEBUG_WEBVIEW=1
DEFAULT_NETWORK=mainnet_rpc
ETHEREUM_DEV_CLUSTER=1
EXTENSIONS=0
GROUP_CHATS_ENABLED=1
LOG_LEVEL=info
LOG_LEVEL=debug
MAILSERVER_CONFIRMATIONS_ENABLED=1
MAINNET_WARNING_ENABLED=1
PFS_ENCRYPTION_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=1
+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: ''
---
+16 -34
View File
@@ -1,39 +1,26 @@
[comment]: # (Please replace ... with your information. Remove < and >)
[comment]: # (To auto-close issue on merge, please insert the related issue number after # i.e fixes #566)
If you submit PR for issue with bounty then write here Fixes #NN where NN is issue number
*otherwise*
fixes #...
### Summary
## Summary
[comment]: # (Summarise the problem and how the pull request solves it)
...
<!-- (Optional, remove if no changes to documentation) -->
Documentation change PR (review please): https://github.com/status-im/status.im/pull/xxx
## Review notes
[comment]: # (Optional. Specify if something in particular should be looked at, or ignored, during review)
### Review notes
<!-- (Optional. Specify if something in particular should be looked at, or ignored, during review) -->
## Testing notes
[comment]: # (Optional)
### Testing notes
<!-- (Optional) -->
#### Platforms
<!-- (Optional. Specify which platforms should be tested) -->
### Platforms
[comment]: # (Optional. Specify which platforms should be tested)
- Android
- iOS
- macOS
- Linux
- Windows
#### Areas that maybe impacted
<!-- (Optional. Specify if some specific areas has to be tested, for example 1-1 chats) -->
### Areas that may be impacted
[comment]: # (Optional. Specify if some specific areas need to be tested, such as 1-1 chats)
##### Functional
#### Functional
- 1-1 chats
- public chats
@@ -48,32 +35,27 @@ Documentation change PR (review please): https://github.com/status-im/status.im/
- fleet
- bootnodes
##### Non-functional
#### Non-functional
- battery performance
- CPU performance / speed of the app
- network consumption
### Steps to test
<!-- (Specify exact steps to test if there are such) -->
## Steps to test
[comment]: # (Specify exact steps to test if there are such)
- Open Status
- ...
- Step 3, etc.
<!-- (PRs will only be accepted if squashed into single commit.) -->
### Before and after screenshots comparison
[comment]: # (Can be ready or wip)
status: ready
| Figma (if available) | iOS (if available) | Android (if available)
| --- | --- | --- |
| Please embed Image/Video here of the before and after. | Please embed Image/Video here of the before and after. | Please embed Image/Video here of the before and after. |
status: ready <!-- Can be ready or wip -->
<!-- Uncomment this section for status-go upgrade/dogfooding pull requests
- Specify potentially impacted user flows in _Areas that maybe impacted*.
- Specify potentially impacted user flows in _Areas that may be impacted*.
- Ensure that _Steps to test_ is filled in.
### Risk
+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"
]
}
+4 -4
View File
@@ -43,8 +43,6 @@ export NODE_OPTIONS += --openssl-legacy-provider
# The path can be anything, but home is usually safest.
export KEYSTORE_PATH ?= $(HOME)/.gradle/status-im.keystore
# Our custom config is located in nix/nix.conf
export NIX_USER_CONF_FILES = $(PWD)/nix/nix.conf
# Location of symlinks to derivations that should not be garbage collected
export _NIX_GCROOTS = ./.nix-gcroots
# Defines which variables will be kept for Nix pure shell, use semicolon as divider
@@ -269,9 +267,11 @@ run-metro: export TARGET := clojure
run-metro: ##@run Start Metro to build React Native changes
@scripts/run-metro.sh
export RE_FRISK_PORT ?= 4567
run-re-frisk: export TARGET := clojure
run-re-frisk: ##@run Start re-frisk server
yarn shadow-cljs run re-frisk-remote.core/start
yarn shadow-cljs run re-frisk-remote.core/start ${RE_FRISK_PORT}
# TODO: Migrate this to a Nix recipe, much the same way as nix/mobile/android/targets/release-android.nix
run-android: export TARGET := android
@@ -445,7 +445,7 @@ android-ports: export RCT_METRO_PORT ?= 8081
android-ports: ##@other Add proxies to Android Device/Simulator
adb reverse tcp:$(RCT_METRO_PORT) tcp:$(RCT_METRO_PORT) && \
adb reverse tcp:3449 tcp:3449 && \
adb reverse tcp:4567 tcp:4567 && \
adb reverse tcp:$(RE_FRISK_PORT) tcp:$(RE_FRISK_PORT) && \
adb reverse tcp:$(FLOWSTORM_PORT) tcp:$(FLOWSTORM_PORT) && \
adb forward tcp:5561 tcp:5561
+1 -1
View File
@@ -1 +1 @@
2.30.0
2.32.0
-2
View File
@@ -299,8 +299,6 @@ dependencies {
implementation("com.squareup.okhttp3:okhttp-tls:4.11.0")
implementation("com.google.prefab:cli:2.0.0")
implementation("com.android.tools.build:aapt2:8.1.1-10154469")
implementation "com.github.bumptech.glide:okhttp3-integration:4.12.0"
annotationProcessor "com.github.bumptech.glide:compiler:4.12.0"
}
@@ -1,45 +0,0 @@
package im.status.ethereum
import android.content.Context
import android.os.Handler
import android.os.Looper
import com.bumptech.glide.Glide
import com.bumptech.glide.Registry
import com.bumptech.glide.module.GlideModule
import com.bumptech.glide.GlideBuilder
import com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader
import com.bumptech.glide.load.model.GlideUrl
import java.io.InputStream
import java.util.concurrent.Executors
class CustomGlideModule : GlideModule {
override fun registerComponents(context: Context, glide: Glide, registry: Registry) {
// Create a single thread executor for background operations
val executor = Executors.newSingleThreadExecutor()
val mainHandler = Handler(Looper.getMainLooper())
// Execute network operation in background
executor.execute {
val client = StatusOkHttpClientFactory().createNewNetworkModuleClient()
// Post results back to main thread
mainHandler.post {
client?.let {
val factory = OkHttpUrlLoader.Factory(it)
registry.replace(
GlideUrl::class.java,
InputStream::class.java,
factory
)
}
}
}
// Clean up executor
executor.shutdown()
}
override fun applyOptions(context: Context, builder: GlideBuilder) {
// No additional options needed
}
}
@@ -15,10 +15,8 @@ import cl.json.RNSharePackage
import com.reactnativecommunity.blurview.BlurViewPackage
import im.status.ethereum.keycard.RNStatusKeycardPackage
import im.status.ethereum.module.StatusPackage
import im.status.ethereum.module.StatusBackendClient
import im.status.ethereum.pushnotifications.PushNotificationPackage
import im.status.ethereum.StatusOkHttpClientFactory
import android.util.Log
class MainApplication : NavigationApplication() {
@@ -41,26 +39,6 @@ class MainApplication : NavigationApplication() {
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
override fun createReactInstanceManager() =
super.createReactInstanceManager().apply {
addReactInstanceEventListener {
val serverEnabledEnv = true
val statusGoEndpointEnv = "127.0.0.1:60000"
val rootDataDirEnv = "/Users/frank/Downloads/tmp"
val statusGoEndpoint = "http://${statusGoEndpointEnv}/statusgo/"
val signalEndpoint = "ws://${statusGoEndpointEnv}/signals"
Log.d("MainApplication", "Configuring StatusBackendServer with serverEnabled=$serverEnabledEnv, statusGoEndpoint=$statusGoEndpoint, signalEndpoint=$signalEndpoint, rootDataDir=$rootDataDirEnv")
StatusBackendClient.getInstance()?.configStatusBackendServer(
serverEnabled = serverEnabledEnv,
statusGoEndpoint = statusGoEndpoint,
signalEndpoint = signalEndpoint,
rootDataDir = rootDataDirEnv
)
OkHttpClientProvider.setOkHttpClientFactory(StatusOkHttpClientFactory())
Log.d("MainApplication", "StatusBackendServer configured")
}
}
}
override val reactNativeHost: ReactNativeHost
@@ -69,7 +47,7 @@ class MainApplication : NavigationApplication() {
override fun onCreate() {
super.onCreate()
//OkHttpClientProvider.setOkHttpClientFactory(StatusOkHttpClientFactory())
OkHttpClientProvider.setOkHttpClientFactory(StatusOkHttpClientFactory())
WebView.setWebContentsDebuggingEnabled(BuildConfig.DEBUG_WEBVIEW == "1")
@@ -1,40 +0,0 @@
package im.status.ethereum;
import java.io.File;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/** @author Kevin Kowalewski */
public class RootUtil {
public static boolean isDeviceRooted() {
return checkRootMethod1() || checkRootMethod2() || checkRootMethod3();
}
private static boolean checkRootMethod1() {
String buildTags = android.os.Build.TAGS;
return buildTags != null && buildTags.contains("test-keys");
}
private static boolean checkRootMethod2() {
String[] paths = { "/system/app/Superuser.apk", "/sbin/su", "/system/bin/su", "/system/xbin/su", "/data/local/xbin/su", "/data/local/bin/su", "/system/sd/xbin/su",
"/system/bin/failsafe/su", "/data/local/su" };
for (String path : paths) {
if (new File(path).exists()) return true;
}
return false;
}
private static boolean checkRootMethod3() {
Process process = null;
try {
process = Runtime.getRuntime().exec(new String[] { "/system/xbin/which", "su" });
BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
return in.readLine() != null;
} catch (Throwable t) {
return false;
} finally {
if (process != null) process.destroy();
}
}
}
@@ -0,0 +1,42 @@
package im.status.ethereum
import android.os.Build
import java.io.BufferedReader
import java.io.File
import java.io.InputStreamReader
object RootUtil {
fun isDeviceRooted(): Boolean =
checkRootMethod1() || checkRootMethod2() || checkRootMethod3()
private fun checkRootMethod1(): Boolean =
Build.TAGS?.contains("test-keys") ?: false
private fun checkRootMethod2(): Boolean {
val paths = arrayOf(
"/system/app/Superuser.apk",
"/sbin/su",
"/system/bin/su",
"/system/xbin/su",
"/data/local/xbin/su",
"/data/local/bin/su",
"/system/sd/xbin/su",
"/system/bin/failsafe/su",
"/data/local/su"
)
return paths.any { File(it).exists() }
}
private fun checkRootMethod3(): Boolean {
var process: Process? = null
return try {
process = Runtime.getRuntime().exec(arrayOf("/system/xbin/which", "su"))
BufferedReader(InputStreamReader(process.inputStream)).readLine() != null
} catch (t: Throwable) {
false
} finally {
process?.destroy()
}
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ library 'status-jenkins-lib@v1.9.13'
def isPRBuild = utils.isPRBuild()
pipeline {
agent { label 'linux && x86_64 && nix-2.19' }
agent { label 'linux && x86_64 && nix-2.24' }
options {
timestamps()
+1 -1
View File
@@ -5,7 +5,7 @@ library 'status-jenkins-lib@v1.9.13'
def isPRBuild = utils.isPRBuild()
pipeline {
agent { label 'macos && arm64 && nix-2.19 && xcode-15.1' }
agent { label 'macos && arm64 && nix-2.24 && xcode-16.2' }
parameters {
string(
+1 -1
View File
@@ -5,7 +5,7 @@ library 'status-jenkins-lib@v1.9.13'
def isPRBuild = utils.isPRBuild()
pipeline {
agent { label 'linux && x86_64 && nix-2.19' }
agent { label 'linux && x86_64 && nix-2.24' }
options {
timestamps()
+4 -20
View File
@@ -73,9 +73,9 @@ pipeline {
passwordVariable: 'TESTRAIL_PASS'
),
usernamePassword(
credentialsId: 'sauce-labs-api',
usernameVariable: 'SAUCE_USERNAME',
passwordVariable: 'SAUCE_ACCESS_KEY'
credentialsId: 'lambda-test-api',
usernameVariable: 'LAMBDA_TEST_USERNAME',
passwordVariable: 'LAMBDA_TEST_ACCESS_KEY'
),
string(
credentialsId: 'etherscan-api-key',
@@ -95,8 +95,7 @@ pipeline {
sh 'cp -f $TEST_ETH_ACCOUNTS_FILE users.py'
sh """
python3 -m pytest \
--numprocesses 8 \
--rerun_count=2 \
--numprocesses 9 \
--testrail_report=True \
-m testrail_id \
-m \"nightly\" \
@@ -110,21 +109,6 @@ pipeline {
}
post {
always {
script {
sauce('sauce-labs-cred') {
saucePublisher()
}
}
}
success {
script {
junit(
testDataPublishers: [[$class: 'SauceOnDemandReportPublisher', jobVisibility: 'public']],
testResults: 'test/appium/tests/*.xml'
)
}
}
cleanup {
sh 'make purge'
}
+4 -5
View File
@@ -111,9 +111,9 @@ pipeline {
passwordVariable: 'TESTRAIL_PASS'
),
usernamePassword(
credentialsId: 'sauce-labs-api',
usernameVariable: 'SAUCE_USERNAME',
passwordVariable: 'SAUCE_ACCESS_KEY'
credentialsId: 'lambda-test-api',
usernameVariable: 'LAMBDA_TEST_USERNAME',
passwordVariable: 'LAMBDA_TEST_ACCESS_KEY'
),
string(
credentialsId: 'etherscan-api-key',
@@ -133,8 +133,7 @@ pipeline {
sh 'cp -f $TEST_ETH_ACCOUNTS_FILE users.py'
sh """
python3 -m pytest \
--numprocesses 8 \
--rerun_count=2 \
--numprocesses 9 \
--testrail_report=True \
-k \"${params.KEYWORD_EXPRESSION}\" \
--apk=${params.APK_URL ?: apk_path} \
+1
View File
@@ -16,6 +16,7 @@
- [Patching](patching.md)
- [Creating a pixel perfect UI](pixel-perfection.md)
- [Contributing to status-go](status-go-changes.md)
- [Status Backend Server](use-status-backend-server.md)
- [Malli schemas (recorded demo)](https://www.youtube.com/watch?v=SlRio70aYVI) ([slides](files/forging-code-with-schemas-sep-2023-slides.pdf))
## Testing
+1 -1
View File
@@ -150,7 +150,7 @@ This one is straightforward, just evaluate a navigation dispatch form from anywh
#### REPL-ing a component
This is also straighforward, but there are some small differences. Just like above, we only have to evaluate a dispatch form, as follows:
This is also straightforward, but there are some small differences. Just like above, we only have to evaluate a dispatch form, as follows:
```cljs
;; example debugging a quo component, although it could be any other component e.g. from the `status-im2` ns.
+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
+32 -6
View File
@@ -1,5 +1,14 @@
## Solution to use Status Backend Server
`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.
## 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)
@@ -17,7 +26,7 @@ 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(requests.log/geth.log) and keystore files etc will be stored in this directory.
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
@@ -29,7 +38,24 @@ 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`.
### Known issues
- Android devices may not display images due to TLS certificate validation issues with the image server
- exportUnencryptedDatabaseV2/import-multiaccount does not work for android, probably cause of tech debt, I found it during creating the draft PR.
### 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
@@ -0,0 +1,21 @@
يجمع Status بين برنامج مراسلة مجهول الهوية يركز على الخصوصية ومحفظة العملات المشفرة الآمنة في أداة اتصال قوية واحدة. يمكنك الدردشة مع الأصدقاء والمجتمعات المتنامية. وشراء وتخزين وتبادل الأصول الرقمية.
Status هو نظام تشغيل Ethereum الخاص بك.
محفظة Ethereum آمنة
تتيح لك محفظة العملات المشفرة Status إرسال وتخزين وتبادل أصول Ethereum بأمان مثل ETH وSNT والعملات المستقرة مثل DAI، بالإضافة إلى المقتنيات. تحكم بثقة في عملاتك المشفرة والأصول الرقمية من خلال تطبيق محفظة Ethereum متعددة السلاسل، والذي يدعم الشبكة الرئيسية وArbitrum وOptimism. تدعم محفظة blockchain Status حاليًا أصول ETH وERC-20 وERC-721 وERC-1155 فقط؛ ولا تدعم Bitcoin.
PRIVATE MESSENGER
أرسل محادثات فردية وجماعية خاصة دون أن يتجسس أحد على اتصالاتك. Status هو تطبيق مراسلة يلغي عمليات نقل الرسائل المركزية لمزيد من الخصوصية والمراسلة الآمنة. يتم تشفير جميع الرسائل باستخدام تشفير من البداية إلى النهاية. بالإضافة إلى ذلك، لا تكشف أي رسالة عن هوية المؤلف أو المستلم المقصود، لذلك لا أحد، ولا حتى Status، يعرف من يتحدث إلى من أو ما قيل.
اربح مع DEFI
استخدم عملتك المشفرة مع أحدث تطبيقات التمويل اللامركزية والبورصات اللامركزية (DEX) مثل Maker وAave وUniswap وSynthetix وPoolTogether وZerion وKyber والمزيد.
تواصل مع مجتمعك
استكشف مجتمعاتك وأصدقائك المفضلين وتواصل معهم ودردش معهم. سواء كانت مجموعة صغيرة من الأصدقاء أو مجموعة فنانين أو تجار عملات مشفرة أو منظمة كبيرة قادمة - أرسل رسائل نصية وتواصل مع مجتمعات Status.
إنشاء حساب خاص
ابق خاصًا من خلال إنشاء حساب مجهول الهوية. عند إنشاء حسابك المجاني، لن تضطر أبدًا إلى إدخال رقم هاتف أو عنوان بريد إلكتروني أو حساب مصرفي. يتم إنشاء مفاتيح المحفظة الخاصة بك محليًا وتخزينها بشكل آمن لضمان حصولك أنت فقط على حق الوصول إلى أموالك ومعاملاتك المالية.
@@ -0,0 +1 @@
ربط Private Finance وWeb3
@@ -0,0 +1 @@
Status: محفظة إيثريوم كريبتو
@@ -1,19 +0,0 @@
يجمع Status بين تطبيق مراسلة يركز على الخصوصية تحت اسم مستعار ومحفظة للعملات المشفرة آمنة في أداة تواصل قوية واحدة. تحدث مع الأصدقاء والمجتمعات المتنامية. قم بشراء وتخزين وتبادل الأصول الرقمية.
Status هو نظام التشغيل الخاص بك على Ethereum.
المُرَاسِل الخاص
أرسل محادثات خاصة 1:1 ومحادثات مجموعات خاصة دون أن يتجسس أحد على اتصالاتك. يعد Status تطبيق مراسلة يلغي الحاجة إلى نقاط التوجيه المركزية للرسائل من أجل خصوصية أكبر ومراسلة آمنة. يتم تشفير جميع الرسائل بتشفير من طرف إلى طرف. بالإضافة إلى ذلك، لا تكشف أي رسالة عن هوية المؤلف أو المستلم المستهدف، لذا لا أحد، حتى Status، يعرف من يتحدث مع من أو ماذا قيل.
محفظة Ethereum الآمنة
تتيح لك محفظة Status للعملات المشفرة إرسال وتخزين وتبادل أصول Ethereum مثل ETH و SNT والعملات المستقرة مثل DAI، بالإضافة إلى الأصول الرقمية القابلة للتحصيل بأمان. تحكم بثقة في عملاتك الرقمية وأصولك الرقمية باستخدام تطبيق محفظة Ethereum متعدد السلاسل الخاص بنا، الذي يدعم mainnet و Arbitrum و Optimism. تدعم محفظة Status حاليًا فقط أصول ETH و ERC-20 و ERC-721 و ERC-1155؛ لا تدعم Bitcoin.
اكسب مع DeFi
ضع عملاتك الرقمية في العمل مع أحدث تطبيقات التمويل اللامركزي وتبادلات العملات اللامركزية (DEX) مثل Maker و Aave و Uniswap و Synthetix و PoolTogether و Zerion و Kyber وغيرها.
تواصل مع مجتمعك
استكشف وتواصل وتحدث مع أصدقائك ومجتمعاتك المفضلة. سواء كان ذلك مع مجموعة صغيرة من الأصدقاء، أو مجموعة فنية، أو متداولي العملات المشفرة، أو المنظمة الكبيرة التالية - قم بإرسال النصوص والتواصل مع مجتمعات Status.
إنشاء حساب خاص
ابقَ خاصًا مع إنشاء حساب تحت اسم مستعار. عند إنشاء حسابك المجاني، لن تضطر أبدًا إلى إدخال رقم هاتف أو عنوان بريد إلكتروني أو حساب مصرفي. يتم توليد مفاتيح محفظتك الخاصة محليًا وتخزينها بشكل آمن لضمان أنك الوحيد الذي لديه حق الوصول إلى أموالك ومعاملاتك المالية.
@@ -1 +0,0 @@
محفظة مشفرة و ماسنجر خاص
@@ -2,12 +2,12 @@ Status combines pseudonymous privacy-focused messenger and secure crypto wallet
Status is your Ethereum operating system.
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 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.
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.
EARN WITH DEFI
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.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 KiB

@@ -1 +1 @@
Crypto Wallet & Private Messenger
Connect Private Finance & Web3
+1 -1
View File
@@ -1 +1 @@
Status
Status: Ethereum Crypto Wallet
@@ -1,18 +1,18 @@
Status combina una mensajería centrada en la privacidad pseudónima y una billetera de criptomonedas segura en una poderosa herramienta de comunicación. Chatea con amigos y comunidades en crecimiento. Compra, almacena e intercambia activos digitales.
Status combina una mensajería seudónima centrada en la privacidad y una Billetera de criptomonedas segura en una poderosa herramienta de comunicación. Chatea con amigos y comunidades en crecimiento. Compra, almacena e intercambia activos digitales.
Status es tu sistema operativo para Ethereum.
Status es tu sistema operativo Ethereum.
BILLETERA ETHEREUM SEGURA
La Billetera de criptomonedas Status te permite enviar, almacenar e intercambiar de forma segura activos Ethereum como ETH, SNT, stablecoins como DAI, así como coleccionables. Toma el control de tu criptomoneda y activos digitales con confianza con nuestra Billetera multicadena, compatible con Ethereum Mainnet, Arbitrum y Optimism. La Billetera Status actualmente solo admite activos ETH, ERC-20, ERC-721 y ERC-1155; no admite Bitcoin.
MENSAJERÍA PRIVADA
Envía chats privados 1:1 y chats grupales privados sin que nadie espíe tus comunicaciones. Status es una aplicación de mensajería que elimina los retransmisores de mensajes centralizados para ofrecer mayor privacidad y mensajería segura. Todos los mensajes están cifrados con cifrado de extremo a extremo. Además, ningún mensaje revela quién es el autor o el destinatario previsto, por lo que nadie, ni siquiera Status, sabe quién está hablando con quién o qué se dijo.
BILLETERA SEGURA DE CRIPTOMONEDAS
La billetera de criptomonedas de Status te permite enviar, almacenar e intercambiar de forma segura activos de Ethereum como ETH, SNT, stablecoins como DAI, así como coleccionables digitales. Controla con confianza tus criptomonedas y activos digitales con nuestra aplicación de billetera multichain de Ethereum, que soporta mainnet, Arbitrum y Optimism. La billetera blockchain de Status actualmente solo soporta activos ETH, ERC-20, ERC-721 y ERC-1155; no soporta Bitcoin.
Envía chats privados 1:1 y grupales sin que nadie espíe tus comunicaciones. Status es una aplicación de mensajería que elimina los servidores de mensajes centralizados para una mayor privacidad y una mensajería segura. Todos los mensajes están encriptados de extremo a extremo. Además, ningún mensaje expone quién es el autor o el destinatario previsto, por lo que nadie, ni siquiera Status, sabe quién está hablando con quién o qué se dijo.
GANA CON DEFI
Pon tus criptomonedas a trabajar con las últimas aplicaciones de finanzas descentralizadas y exchanges descentralizados (DEX) como Maker, Aave, Uniswap, Synthetix, PoolTogether, Zerion, Kyber y más.
Pon tus criptomonedas a trabajar con las últimas aplicaciones financieras descentralizadas y plataformas de intercambio descentralizadas (DEX) como Maker, Aave, Uniswap, Synthetix, PoolTogether, Zerion, Kyber y más.
CONECTA CON TU COMUNIDAD
Explora, conecta y chatea con tus comunidades y amigos favoritos. Ya sea un pequeño grupo de amigos, un colectivo de artistas, traders de criptomonedas o la próxima gran organización, envía mensajes y comunícate con las comunidades de Status.
Explora, conéctate y chatea con tus comunidades y amigos. Ya sea un pequeño grupo de amigos, un colectivo de artistas, traders de criptomonedas o la próxima gran organización, envía mensajes de texto y comunícate con las comunidades de Status.
CREACIÓN DE CUENTAS PRIVADAS
Mantén tu privacidad con la creación de cuentas pseudónimas. Al crear tu cuenta gratuita, NUNCA tendrás que ingresar un número de teléfono, dirección de correo electrónico o cuenta bancaria. Las claves privadas de tu billetera se generan localmente y se almacenan de manera segura para garantizar que solo tú tengas acceso a tus fondos y transacciones financieras.
Mantén la privacidad con la creación de cuentas seudónimas. Al crear tu cuenta gratuita, NUNCA tendrás que compartir tu número de teléfono, tu dirección de correo electrónico o una cuenta bancaria. Las claves privadas de tu billetera se generan localmente y se almacenan de forma segura para garantizar que solo tú tienes acceso a tus fondos y transacciones financieras.
@@ -1 +1 @@
Criptobilletera y Chat Privado
Conecta tus finanzas y la web3
@@ -0,0 +1 @@
Status: Billetera Ethereum
@@ -0,0 +1,18 @@
Status combine une messagerie pseudonyme axée sur la confidentialité et un portefeuille cryptographique sécurisé en un seul outil de communication puissant. Discutez avec des amis et des communautés en pleine croissance. Achetez, stockez et échangez des actifs numériques.
Status est votre système d'exploitation Ethereum.
PORTEFEUILLE ETHEREUM SÉCURISÉ
Le portefeuille cryptographique Status vous permet d'envoyer, de stocker et d'échanger en toute sécurité des actifs Ethereum tels que ETH, SNT, des pièces stables telles que DAI, ainsi que des objets de collection. Prenez le contrôle en toute confiance de votre cryptomonnaie et de vos actifs numériques avec notre application de portefeuille Ethereum multichaîne, prenant en charge le réseau principal, Arbitrum et Optimism. Le portefeuille blockchain Status ne prend actuellement en charge que les actifs ETH, ERC-20, ERC-721 et ERC-1155 ; il ne prend pas en charge Bitcoin.
MESSAGERIE PRIVÉE
Envoyez des conversations privées en tête-à-tête et en groupe sans que personne ne surveille vos communications. Status est une application de messagerie qui élimine les relais de messages centralisés pour une plus grande confidentialité et une messagerie sécurisée. Tous les messages sont cryptés avec un cryptage de bout en bout. De plus, aucun message n'expose l'identité de l'auteur ou du destinataire prévu, de sorte que personne, pas même Status, ne sait qui parle à qui ou ce qui a été dit.
GAGNEZ DE L'ARGENT AVEC DEFI
Mettez votre crypto au travail avec les dernières applications financières décentralisées et les échanges décentralisés (DEX) tels que Maker, Aave, Uniswap, Synthetix, PoolTogether, Zerion, Kyber, et plus encore.
CONNECTEZ-VOUS AVEC VOTRE COMMUNAUTÉ
Explorez, connectez-vous et discutez avec vos communautés et amis préférés. Qu'il s'agisse d'un petit groupe d'amis, d'un collectif d'artistes, de traders de crypto-monnaies ou de la prochaine grande organisation, envoyez des SMS et communiquez avec les communautés Status.
CRÉATION DE COMPTE PRIVÉ
Restez privé grâce à la création de compte pseudo-anonyme. Lors de la création de votre compte gratuit, vous n'aurez JAMAIS besoin de saisir un numéro de téléphone, une adresse e-mail ou un compte bancaire. Les clés privées de votre portefeuille sont générées localement et stockées en toute sécurité pour garantir que vous seul avez accès à vos fonds et à vos transactions financières.
@@ -0,0 +1 @@
Finance privée + Web3
@@ -0,0 +1 @@
Status: Portefeuille Ethereum
@@ -0,0 +1,21 @@
Statusは、匿名のプライバシー重視のメッセンジャーと安全な暗号通貨ウォレットを1つの強力なコミュニケーションツールに組み合わせています。友達や成長中のコミュニティとチャットしましょう。デジタル資産を購入、保管、交換しましょう。
StatusはあなたのEthereumオペレーティングシステムです。
安全なEthereumウォレット
Status暗号通貨ウォレットを使用すると、ETH、SNT、DAIなどのステーブルコイン、収集品などのEthereum資産を安全に送信、保管、交換できます。メインネット、Arbitrum、OptimismをサポートするマルチチェーンEthereumウォレットアプリを使用して、暗号通貨とデジタル資産を自信を持って管理できます。 Status ブロックチェーン ウォレットは現在、ETH、ERC-20、ERC-721、ERC-1155 アセットのみをサポートしており、ビットコインはサポートしていません。
プライベート メッセンジャー
誰にも通信を覗かれることなく、プライベートな 1:1 チャットやプライベート グループ チャットを送信できます。Status は、集中型のメッセージ リレーを排除してプライバシーと安全なメッセージングを実現するメッセンジャー アプリです。すべてのメッセージはエンドツーエンドの暗号化で暗号化されます。さらに、メッセージの作成者や宛先の受信者が誰であるかは明らかにされないため、Status でさえ、誰が誰と話しているのか、何が話されたのかを知ることはできません。
DEFI で稼ぐ
Maker、Aave、Uniswap、Synthetix、PoolTogether、Zerion、Kyber などの最新の分散型金融アプリや分散型取引所 (DEX) で暗号通貨を活用しましょう。
コミュニティとつながる
お気に入りのコミュニティや友達を探索、接続、チャットしましょう。少人数の友人グループ、アーティスト集団、暗号通貨トレーダー、または次の大きな組織であっても、Status コミュニティとテキストでやり取りできます。
プライベート アカウントの作成
疑似匿名アカウントの作成でプライバシーを確保します。無料アカウントを作成するときに、電話番号、メール アドレス、銀行口座を入力する必要はありません。ウォレットの秘密鍵はローカルで生成され、安全に保管されるため、資金と金融取引にアクセスできるのはあなただけです。
@@ -0,0 +1 @@
プライベート ファイナンスと Web3 を接続
@@ -0,0 +1 @@
Status: イーサリアム クリプト ウォレット
@@ -1,18 +1,21 @@
Status는 익명성을 보장하는 프라이버시 중심 메신저와 안전한 암호화폐 지갑을 하나의 강력한 커뮤니케이션 도구로 결합했습니다. 친구들과 성장하는 커뮤니티와 채팅하세요. 디지털 자산을 구매, 저장, 교환할 수 있습니다.
Status는 익명의 개인 정보 보호 중심 메신저와 안전한 암호화폐 지갑을 하나의 강력한 커뮤니케이션 도구로 결합니다. 친구 성장하는 커뮤니티와 채팅하세요. 디지털 자산을 구매, 저장 교환하세요.
Status는 당신의 Ethereum 운영체제입니다.
Status는 귀하의 Ethereum 운영 체제입니다.
프라이빗 메신저
개인 1:1 채팅과 비공개 그룹 채팅을 통해 누구도 당신의 통신을 엿볼 수 없습니다. Status는 중앙 집중식 메시지 중계를 제거하여 더 큰 프라이버시와 안전한 메시징을 제공하는 메신저 앱입니다. 모든 메시지는 종단 간 암호화로 보호됩니다. 또한, 어떤 메시지도 작성자나 의도된 수신자의 신원을 노출하지 않기 때문에, Status조차도 누가 누구와 대화하는지, 무슨 말을 했는지 알 수 없습니다.
안전한 이더리움 지갑
Status 암호화폐 지갑을 사용하면 ETH, SNT, DAI와 같은 스테이블 코인, 수집품과 같은 이더리움 자산을 안전하게 보내고, 저장하고, 교환할 수 있습니다. 메인넷, Arbitrum 및 Optimism을 지원하는 멀티체인 이더리움 지갑 앱으로 암호화폐와 디지털 자산을 자신 있게 제어하세요. Status 블록체인 지갑은 현재 ETH, ERC-20, ERC-721 및 ERC-1155 자산만 지원하며 비트코인은 지원하지 않습니다.
안전한 Ethereum 지갑
Status 암호화폐 지갑을 통해 ETH, SNT, DAI와 같은 스테이블코인, 그리고 암호화 수집품과 같은 Ethereum 자산을 안전하게 송금, 저장 및 교환할 수 있습니다. 메인넷, Arbitrum, Optimism을 지원하는 우리의 멀티체인 Ethereum 지갑 앱을 사용해 당신의 암호화폐와 디지털 자산을 자신 있게 관리하세요. Status 블록체인 지갑은 현재 ETH, ERC-20, ERC-721, ERC-1155 자산만 지원하며, Bitcoin은 지원하지 않습니다.
개인 메신저
아무도 귀하의 커뮤니케이션을 엿보지 않고 개인 1:1 및 개인 그룹 채팅을 보내세요. Status는 중앙 집중식 메시지 릴레이를 제거하여 더 큰 프라이버시와 안전한 메시징을 제공하는 메신저 앱입니다. 모든 메시지는 종단 간 암호화로 암호화됩니다. 또한, 메시지에는 작성자 또는 의도된 수신자가 노출되지 않으므로 Status를 포함하여 아무도 누가 누구와 대화하고 있는지 또는 무슨 말을 했는지 알 수 없습니다.
DeFi로 수익 창출
Maker, Aave, Uniswap, Synthetix, PoolTogether, Zerion, Kyber 등 최신 탈중앙화 금융 앱과 탈중앙화 거래소(DEX)를 사용해 암호화폐를 활용하세요.
DEFI로 수익 창출
Maker, Aave, Uniswap, Synthetix, PoolTogether, Zerion, Kyber 등과 같은 최신 분산 금융 앱 및 분산 거래소(DEX)에서 암호화폐를 활용하세요.
커뮤니티와 연결
당신의 좋아하는 커뮤니티와 친구들과 탐색, 연결 및 채팅하세요. 작은 친구 모임이든, 아티스트 집단이든, 암호화폐 거래자든, 다음 큰 조직이든, Status 커뮤니티를 통해 텍스트를 보내고 소통하세요.
프라이빗 계정 생성
익명 계정 생성을 통해 프라이버시를 유지하세요. 무료 계정을 생성할 때 전화번호, 이메일 주소, 은행 계좌를 절대 입력할 필요가 없습니다. 지갑의 개인 키는 로컬에서 생성되고 안전하게 저장되어, 오직 당신만이 자금과 금융 거래에 접근할 수 있습니다.
좋아하는 커뮤니티와 친구를 탐색하고, 연결하고, 채팅하세요. 소규모 친구 그룹, 아티스트 집단, 암호화폐 거래자 또는 차세대 대기업이든 Status 커뮤니티에 문자를 보내고 소통하세요.
개인 계정 생성
익명 계정을 생성하여 개인 정보를 보호하세요. 무료 계정을 만들 때 전화번호, 이메일 주소 또는 은행 계좌를 입력할 필요가 없습니다. 지갑 개인 키는 로컬에서 생성되고 안전하게 저장되어 본인만 자금과 금융 거래에 액세스할 수 있습니다.
@@ -1 +1 @@
암호화폐 지갑 & 비밀 메신저
개인 금융 및 Web3 연결
@@ -0,0 +1 @@
Status: 이더리움 크립토 지갑
@@ -2,22 +2,17 @@ Status é um app de mensagem e uma carteira de criptomoedas focado em privacidad
Status é o seu sistema operacional para Ethereum.
APP DE MENSAGEM PRIVADO
CARTEIRA ETHEREUM SEGURA
A carteira de criptomoedas Status permite que você envie, armazene e troque ativos Ethereum, como ETH, SNT, stablecoins como DAI, além de colecionáveis, de forma segura. Controle com confiança suas criptomoedas e ativos digitais com nosso aplicativo de carteira Ethereum multichain, que suporta Mainnet, Arbitrum e Optimism. A carteira blockchain da Status atualmente suporta apenas ativos ETH, ERC-20, ERC-721 e ERC-1155; não suporta Bitcoin.
APP DE MENSAGEM PRIVADO
Envie mensagens privadas em chats 1:1 ou em grupos. Status é um aplicativo de mensagem descentralizado que foca em privacidade e anonimato. Todas as mensagens são protegidas com criptografia de ponta a ponta. Além disso, nenhuma mensagem revela quem é o(a) autor(a) ou o(a) destinatário(a) pretendido(a), então ninguém, nem mesmo a Status, sabe quem está conversando com quem ou o que foi dito.
CARTEIRA SEGURA DE ETHEREUM
A carteira de criptomoedas Status permite que você envie, armazene e troque ativos Ethereum, como ETH, SNT, stablecoins como DAI, além de colecionáveis, de forma segura. Controle com confiança suas criptomoedas e ativos digitais com nosso aplicativo de carteira Ethereum multichain, que suporta mainnet, Arbitrum e Optimism. A carteira blockchain da Status atualmente suporta apenas ativos ETH, ERC-20, ERC-721 e ERC-1155; não suporta Bitcoin.
MONETIZE COM DEFI E STAKING
Coloque suas criptomoedas para trabalhar (staking) com os mais recentes aplicativos de finanças descentralizadas e exchanges descentralizadas (DEX), como Maker, Aave, Uniswap, Synthetix, PoolTogether, Zerion, Kyber e mais.
CONECTE-SE COM SUA COMUNIDADE
Explore, conecte-se e converse com seus amigos e comunidades favoritas. Seja um grupo de amigos, de artistas, de traders de criptomoedas ou a próxima grande empresa - envie textos e comunique-se através das comunidades da Status.
CRIAÇÃO DE CONTA PRIVADA
Mantenha sua privacidade com a criação de conta anônima. Ao criar sua conta gratuita, você NUNCA precisará inserir um número de telefone, endereço de e-mail ou conta bancária. Suas chaves privadas da carteira são geradas localmente e armazenadas com segurança para garantir que apenas você tenha acesso aos seus fundos e transações financeiras.
@@ -1 +1 @@
Crypto Wallet & Private Chat
Privacidade Financeira e Web3
@@ -0,0 +1 @@
Status: Carteira Ethereum
@@ -1,18 +1,18 @@
Status сочетает в себе мессенджер, ориентированный на анонимность и конфиденциальность, и безопасный криптовалютный кошелек в одном мощном инструменте для общения. Общайтесь с друзьями и развивающимися сообществами. Покупайте, отправляйте и обменивайте цифровые активы.
Status объединяет анонимный мессенджер, ориентированный на конфиденциальность, и защищенный криптокошелек в один мощный инструмент для финансов и общения. Общайтесь с друзьями, находите новые сообщества, а также покупайте, храните и обменивайте цифровые активы.
Status — это ваша операционная система для Ethereum.
ПРИВАТНЫЙ МЕССЕНДЖЕР
Отправляйте приватные сообщения 1:1 и участвуйте в групповых чатах, будучи уверенными в том, что никто не может перехватить или прочитать ваши сообщения. Status — это мессенджер, который устраняет необходимость в централизованных серверах для передачи сообщений, обеспечивая высшую степень конфиденциальности и безопасности. Все сообщения защищены сквозным шифрованием. Более того, ни одно сообщение не раскрывает, кто является автором или предполагаемым получателем, поэтому никто, включая Status, не знает, кто с кем общается и что было сказано.
БЕЗОПАСНЫЙ КОШЕЛЕК ETHEREUM
Крипто-кошелек Status позволяет вам безопасно отправлять, хранить и обменивать активы Ethereum, такие как ETH, SNT, стейблкоины, такие как DAI, а также невзаимозаменяемые токены. Контролируйте свою криптовалюту с помощью нашего криптокошелека для Ethereum, поддерживающего Ethereum, Arbitrum и Optimism. В настоящее время криптокошелек Status поддерживает такие активы ETH, ERC-20, ERC-721 и ERC-1155.
БЕЗОПАСНЫЙ КРИПТОКОШЕЛЕК ДЛЯ ETHEREUM
Кошелек Status позволяет вам безопасно отправлять, хранить и обменивать Ethereum-активы, такие как ETH, SNT, стейблкоины (например, DAI), а также цифровые коллекционные предметы. Контролируйте свои криптовалюты и цифровые активы с уверенностью с помощью нашего мультичейн Ethereum-кошелька, поддерживающего mainnet, Arbitrum и Optimism. Кошелек Status в настоящее время поддерживает активы ETH, ERC-20, ERC-721 и ERC-1155; поддержка Bitcoin отсутствует.
ПРИВАТНИЙ МЕСЕНДЖЕР
Отправляйте приватные сообщения друзьям или группам. Status — это приложение для обмена сообщениями, которое поддерживает децентрализованную систему для повышения конфиденциальности и безопасного обмена сообщениями. Все сообщения зашифрованы с помощью сквозного шифрования. Более того, ни одно сообщение не содержит информации об авторе или получателе, поэтому никто, даже Status, не знает, кто с кем общается или что было отправлено.
ЗАРАБАТЫВАЙТЕ С DEFI
Заставьте свои криптовалюты работать на вас с актуальными приложениями децентрализованных финансов и децентрализованными биржами (DEX), такими как Maker, Aave, Uniswap, Synthetix, PoolTogether, Zerion, Kyber и другими.
Используйте свою криптовалюту для работы с новейшими приложениями для децентрализованных финансов и децентрализованными криптобиржами (DEX), такими как Maker, Aave, Uniswap, Synthetix, PoolTogether, Kyber и другие.
СВЯЗЬ С СООБЩЕСТВОМ
Исследуйте, присоединяйтесь и общайтесь с любимыми сообществами и друзьями. Независимо от того, являетесь ли вы частью небольшой группы друзей, художественного коллектива, трейдеров криптовалют или крупной организации — отправляйте сообщения и общайтесь в сообществах Status.
НАЙДИТЕ ВАШЕ СООБЩЕСТВО
Находите, исследуйте и общайтесь с любимыми сообществами и друзьями. Независимо от того, является ли это небольшой группой друзей, коллективом художников, криптотрейдеров или следующим большим сообществом единомышленников — отправляйте текстовые сообщения и общайтесь с сообществами в Status.
КОНФИДЕНЦИАЛЬНАЯ РЕГИСТРАЦИЯ
Создайте анонимный профиль и оставайтесь конфиденциальными. При создании бесплатного профиля вам НИКОГДА не потребуется вводить номер телефона, адрес электронной почты или банковские данные. Ваши приватные ключи кошелька генерируются локально и хранятся безопасно, чтобы только вы имели доступ к своим средствам и финансовым операциям.
СОЗДАНИЕ ПРИВАТНОГО АККАУНТА
Оставайтесь конфиденциальными с помощью создания анонимного аккаунта. При создании аккаунта вам НИКОГДА не нужно будет вводить номер телефона, адрес электронной почты или банковский счет. Приватные ключи вашего криптокошелька генерируются локально на вашем устройстве и надежно хранятся, чтобы только вы имели доступ к своим средствам и финансовым транзакциям.
@@ -1 +1 @@
Crypto Wallet & Private Chat
Web3 финансы и приват чат
@@ -0,0 +1 @@
Status: Ethereum Криптокошелек
@@ -1,18 +1,18 @@
Status, gizlilik odaklı takma adla kullanılan bir mesajlaşma uygulaması ile güvenli bir kripto cüzdanını birleştirerek güçlü bir iletişim aracı sunar. Arkadaşlarınız ve büyüyen topluluklarla sohbet edin. Dijital varlıklar satın alın, saklayın ve değiştirin.
Status, takma adlı gizlilik odaklı mesajlaşmayı ve güvenli kripto cüzdanını tek bir güçlü iletişim aracında birleştiriyor. Arkadaşlarınızla ve büyüyen topluluklarla sohbet edin. Dijital varlıkları satın alın, saklayın ve değiştirin.
Status, Ethereum için işletim sisteminizdir.
ÖZEL MESAJLAŞMA UYGULAMASI
Özel 1:1 ve grup sohbetlerini kimsenin iletişiminizi gözetlemesine izin vermeden gönderin. Status, merkezi mesaj iletimini ortadan kaldırarak daha fazla gizlilik ve güvenli mesajlaşma sağlayan bir mesajlaşma uygulamasıdır. Tüm mesajlar uçtan uca şifreleme ile korunur. Ayrıca, hiçbir mesaj yazarın veya hedeflenen alıcının kim olduğunu ortaya çıkarmaz, bu yüzden kimse, hatta Status bile, kimin kiminle konuştuğunu veya ne konuşulduğunu bilmez.
Status, Ethereum işletim sisteminizdir.
GÜVENLİ ETHEREUM CÜZDANI
Status kripto cüzdanı, ETH, SNT, DAI gibi stabilcoinler ve koleksiyon gibi Ethereum varlıklarını güvenle göndermenize, saklamanıza ve değiştirmenize olanak tanır. Ana ağ, Arbitrum ve Optimism'i destekleyen çok zincirli Ethereum cüzdan uygulamamızla kripto paralarınız ve dijital varlıklarınız üzerinde güvenle kontrol sahibi olun. Status blok zinciri cüzdanı şu anda yalnızca ETH, ERC-20, ERC-721 ve ERC-1155 varlıklarını destekler; Bitcoin desteklenmemektedir.
Status kripto cüzdanı, ETH, SNT, DAI gibi sabit paralar ve koleksiyonluk eşyalar gibi Ethereum varlıklarını güvenli bir şekilde göndermenize, saklamanıza ve değiştirmenize olanak tanır. Ana ağ, Arbitrum ve Optimism'i destekleyen çok zincirli Ethereum cüzdan uygulamamızla kripto paranızın ve dijital varlıklarınızın kontrolünü güvenle ele alın. Status blok zinciri cüzdanı şu anda yalnızca ETH, ERC-20, ERC-721 ve ERC-1155 varlıklarını destekliyor; Bitcoin'i desteklemiyor.
ÖZEL MESAJLAŞMACI
İletişimlerinizi kimse gözetlemeden özel 1:1 ve özel grup sohbetleri gönderin. Status, daha fazla gizlilik ve güvenli mesajlaşma için merkezi mesaj iletimlerini ortadan kaldıran bir mesajlaşma uygulamasıdır. Tüm mesajlar uçtan uca şifrelemeyle şifrelenir. Ayrıca, hiçbir mesaj yazarının veya hedeflenen alıcının kim olduğunu ifşa etmez, bu nedenle hiç kimse, Status bile kimin kiminle konuştuğunu veya ne söylendiğini bilmez.
DEFI İLE KAZANIN
Kripto paralarınızı Maker, Aave, Uniswap, Synthetix, PoolTogether, Zerion, Kyber gibi en son merkeziyetsiz finans uygulamaları ve merkeziyetsiz borsalar (DEX) ile değerlendirin.
Kripto paranızı Maker, Aave, Uniswap, Synthetix, PoolTogether, Zerion, Kyber ve daha fazlası gibi en son merkezi olmayan finans uygulamaları ve merkezi olmayan borsalarla (DEX) çalıştırın.
TOPLULUĞUNUZLA BAĞLANTI KURUN
Favori topluluklarınız ve arkadaşlarınızla keşfedin, bağlantı kurun ve sohbet edin. İster küçük bir arkadaş grubu, bir sanatçı kolektifi, kripto para tacirleri veya bir sonraki büyük organizasyon olsun - Status topluluklarıyla mesajlaşın ve iletişim kurun.
En sevdiğiniz toplulukları ve arkadaşlarınızla keşfedin, bağlantı kurun ve sohbet edin. İster küçük bir arkadaş grubu, ister bir sanatçı kolektifi, kripto tüccarları veya bir sonraki büyük organizasyon olsun - Status topluluklarıyla mesajlaşın ve iletişim kurun.
ÖZEL HESAP OLUŞTURMA
Takma adla hesap oluşturarak gizliliğinizi koruyun. Ücretsiz hesabınızı oluştururken asla telefon numarası, e-posta adresi veya banka hesabı girmenize gerek yoktur. Cüzdanınızın özel anahtarları yerel olarak oluşturulur ve yalnızca sizin fonlarınıza ve finansal işlemlerinize erişiminiz olmasını sağlamak için güvenli bir şekilde saklanır.
Sahte anonim hesap oluşturma ile gizli kalın. Ücretsiz hesabınızı oluştururken ASLA bir telefon numarası, e-posta adresi veya banka hesabı girmeniz gerekmeyecek. Cüzdan özel anahtarlarınız yerel olarak oluşturulur ve yalnızca sizin fonlarınıza ve finansal işlemlerinize erişebilmenizi sağlamak için güvenli bir şekilde saklanır.
@@ -1 +1 @@
Kripto Cüzdanı ve Özel Sohbet
Özel Finans ve Web3'ü Bağlayın
@@ -0,0 +1 @@
Status Ethereum Kripto Cüzdanı
@@ -0,0 +1,18 @@
Status поєднує анонімний месенджер, орієнтований на конфіденційність та захищений криптогаманець в один потужний інструмент для фінансів та спілкування. Спілкуйтеся з друзями та спільнотами. Купуйте, зберігайте та обмінюйте крипто активи.
Status — це ваша операційна система для Ethereum.
БЕЗПЕЧНИЙ КРИПТОГАМАНЕЦЬ ДЛЯ ETHEREUM
Криптогаманець Status дозволяє безпечно надсилати, зберігати та обмінювати крипто активи на Ethereum, такі як ETH, SNT, стейблкоїни та DAI, а також невзаємозамінні токени. Впевнено контролюйте свої крипто активи за допомогою нашого блокчейн гаманця для Ethereum, який підтримує Ethereum, Arbitrum і Optimism. Криптогаманець Status наразі підтримує такі кприпто активи як ETH, ERC-20, ERC-721 та ERC-1155.
ПРИВАТНИЙ МЕСЕНДЖЕР
Надсилайте приватні повідомлення друзям або групам. Status — це програма для обміну повідомленнями, яка підтримує децентралізовану систему повідомлень для більшої конфіденційності та безпечного обміну повідомленнями. Усі повідомлення зашифровано за допомогою наскрізного шифрування. Крім того, жодне повідомлення не містить інформації про автора чи одержувача, тому ніхто, навіть Status, не знає, хто з ким спілкувється або що було надіслано.
ЗАРОБЛЯЙТЕ З DEFI
Налаштуйте свою криптовалюту на роботу з найновішими програмами для децентралізованих фінансів і децентралізованими крипто біржами (DEX), такими як Maker, Aave, Uniswap, Synthetix, PoolTogether, Kyber тощо.
ЗНАЙДІТЬ ВАШУ СПІЛЬНОТУ
Знаходьте, досліджуйте та спілкуйтеся з улюбленими спільнотами та друзями. Незалежно від того, чи це невелика група друзів, колектив художників, криптотрейдерів чи наступна велика спільнота однодумців – надсилайте текстові повідомлення та спілкуйтеся зі спільнотами у Status.
СТВОРЕННЯ ПРИВАТНОГО ОБЛІКОВОГО ЗАПИСУ
Залишайтеся конфіденційними за допомогою створення анонімного облікового запису. Під час створення облікового запису вам НІКОЛИ не доведеться вводити номер телефону, адресу електронної пошти чи банківський рахунок. Приватні ключі вашого крипто гаманця генеруються локально на вашому пристрої та надійно зберігаються, щоб лише Ви мали доступ до своїх коштів і фінансових транзакцій.
@@ -0,0 +1 @@
Web3 фінанси та приват чат
@@ -0,0 +1 @@
Status Ethereum Криптогаманець
@@ -1,18 +0,0 @@
Status поєднує у собі месенджер, орієнтований на анонімність і конфіденційність, з безпечним криптовалютним гаманцем в одному потужному інструменті для спілкування. Спілкуйтеся з друзями та зростаючими спільнотами. Купуйте, надсилайте та обмінюйте цифрові активи.
Status — це ваша операційна система для Ethereum.
ПРИВАТНИЙ МЕСЕНДЖЕР
Надсилайте приватні повідомлення та беріть участь у групових чатах, будучи впевненими, що ніхто не може перехопити або прочитати ваші листування. Status усуває необхідність у централізованих серверах для передачі повідомлень, забезпечуючи найвищий рівень конфіденційності та безпеки. Усі повідомлення захищені наскрізним шифруванням. Крім того, жодне повідомлення не розкриває, хто є його автором або передбачуваним отримувачем, тому ніхто, включаючи Status, не знає, хто з ким спілкується і що було сказано.
БЕЗПЕЧНИЙ КРИПТОГАМАНЕЦЬ ДЛЯ ETHEREUM
Гаманець Status дозволяє вам безпечно надсилати, зберігати та обмінювати активи Ethereum, такі як ETH, SNT, стейблкоїни (наприклад, DAI), а також цифрові колекційні предмети. Контролюйте свої криптовалюти та цифрові активи з упевненістю за допомогою нашого мультичейн Ethereum-гаманця, що підтримує Mainnet, Arbitrum та Optimism. Гаманець Status наразі підтримує активи ETH, ERC-20, ERC-721 і ERC-1155; підтримка Bitcoin відсутня.
ЗАРОБЛЯЙТЕ ЗА ДОПОМОГОЮ DEFI
Змусьте свої криптовалюти працювати на вас за допомогою актуальних додатків децентралізованих фінансів і децентралізованих бірж (DEX), таких як Maker, Aave, Uniswap, Synthetix, PoolTogether, Zerion, Kyber та інших.
ЗВ’ЯЗОК ІЗ СПІЛЬНОТОЮ
Відкривайте, знаходьте й спілкуйтесь зі своїми улюбленими спільнотами та друзями. Незалежно від того, чи є ви частиною невеликої групи друзів, творчого колективу, криптотрейдерів або великої організації — надсилайте повідомлення та спілкуйтесь у спільнотах Status.
КОНФІДЕНЦІЙНА РЕЄСТРАЦІЯ
Створіть анонімний профіль і залишайтеся конфіденційними. Під час створення безкоштовного профілю вам НІКОЛИ не потрібно буде вводити номер телефону, адресу електронної пошти або банківські дані. Ваші приватні ключі гаманця генеруються локально та зберігаються надійно, щоб лише ви мали доступ до своїх коштів і фінансових операцій.
@@ -1 +0,0 @@
Crypto Wallet & Private Chat
@@ -2,12 +2,12 @@ Status 将保护匿名私密的消息应用,与安全的加密货币钱包结
Status 是你的以太坊操作系统。
安全的以太坊钱包
Status 加密货币钱包支持安全地发送、存储和交换以太坊资产(例如 ETH、SNT)、稳定币(例如 DAI)以及数字藏品。Status 多链以太坊钱包支持主网、Arbitrum 和 Optimism,让您安心掌控加密货币和数字资产。Status 区块链钱包目前仅支持 ETH、ERC-20、ERC-721 和 ERC-1155 资产;不支持 Bitcoin。
私密通信
一对一或同多人发送私密消息,没有人能窥探你的通信内容。Status 不使用中心化消息中继,提升消息的隐私和安全。所有消息都经过端到端加密。此外,消息不含发送或接收者的身份信息,包括 Status 在内的任何人都无法获知消息内容或交流者身份。
安全的以太坊钱包
Status 加密货币钱包支持安全地发送、存储和交换以太坊上的资产,如 ETH、SNT,DAI 等稳定币以及数字藏品。Status 多链以太坊钱包支持主网、Arbitrum 和 Optimism,让您安心掌控加密货币和数字资产。Status 区块链钱包目前仅支持 ETH、ERC-20、ERC-721 和 ERC-1155 资产;不支持 Bitcoin。
赚取 DeFi 收益
使用最新的去中心化金融应用和去中心化交易所 (DEX),如 Maker、Aave、Uniswap、Synthetix、PoolTogether、Zerion、Kyber 等,充分发挥加密货币的作用。
@@ -1 +1 @@
安全地聊天和交易
连接个人金融和Web3
@@ -0,0 +1 @@
Status: 以太坊加密钱包
+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
+22 -9
View File
@@ -1,7 +1,7 @@
PODS:
- BigInt (5.2.0)
- boost (1.83.0)
- CryptoSwift (1.8.3)
- CryptoSwift (1.8.0)
- DoubleConversion (1.1.6)
- FBLazyVector (0.73.5)
- FBReactNativeSpec (0.73.5):
@@ -940,13 +940,15 @@ PODS:
- React
- react-native-orientation-locker (1.5.0):
- React-Core
- react-native-pdf (6.7.5):
- React-Core
- react-native-shake (3.4.0):
- React
- react-native-slider (3.0.0):
- 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):
@@ -1195,12 +1197,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`)
@@ -1238,6 +1241,7 @@ DEPENDENCIES:
- react-native-lottie-splash-screen (from `../node_modules/react-native-lottie-splash-screen`)
- "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
- react-native-orientation-locker (from `../node_modules/react-native-orientation-locker`)
- react-native-pdf (from `../node_modules/react-native-pdf`)
- react-native-shake (from `../node_modules/react-native-shake`)
- "react-native-slider (from `../node_modules/@react-native-community/slider`)"
- react-native-status (from `../modules/react-native-status`)
@@ -1288,7 +1292,6 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- BigInt
- CryptoSwift
- fmt
- HMSegmentedControl
- libevent
@@ -1302,6 +1305,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:
@@ -1315,6 +1321,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:
@@ -1383,6 +1390,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/@react-native-community/netinfo"
react-native-orientation-locker:
:path: "../node_modules/react-native-orientation-locker"
react-native-pdf:
:path: "../node_modules/react-native-pdf"
react-native-shake:
:path: "../node_modules/react-native-shake"
react-native-slider:
@@ -1476,9 +1485,12 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"
CHECKOUT OPTIONS:
CryptoSwift:
:git: https://github.com/krzyzanowskim/CryptoSwift
:tag: 1.8.0
Keycard:
:commit: afb19836d6730ade5035f6f86ad90715be336af2
:git: https://github.com/status-im/Keycard.swift.git
:tag: 3.1.1
secp256k1:
:commit: 4ab977cc2b2d7319be858bcb30a5d189bb149884
:git: https://github.com/status-im/secp256k1.swift.git
@@ -1487,12 +1499,12 @@ CHECKOUT OPTIONS:
SPEC CHECKSUMS:
BigInt: f668a80089607f521586bbe29513d708491ef2f7
boost: d3f49c53809116a5d38da093a8aa78bf551aed09
CryptoSwift: 967f37cea5a3294d9cce358f78861652155be483
CryptoSwift: 52aaf3fce7337552863b1d952e408085f0e65030
DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953
FBLazyVector: 56e0e498dbb513b96c40bac6284729ba4e62672d
FBReactNativeSpec: 146c741a3f40361f6bc13a4ba284678cbedb5881
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 53cc9a00a2af0495ac1613e9fe3df6e646a3f405
glog: c0eca6ffed0a6fde1965ef26dcc7bf528f052af4
hermes-engine: 1d1835b2cc54c381909d94d1b3c8e0a2f1a94a0e
HMSegmentedControl: 34c1f54d822d8308e7b24f5d901ec674dfa31352
Keycard: 3bd24405b9a875b3b3cf1ab1be69b5c30c5f28bc
@@ -1532,10 +1544,11 @@ SPEC CHECKSUMS:
react-native-lottie-splash-screen: 4e1b1fd9d6633f9cd2106d6877eb5ba0147f3e2b
react-native-netinfo: ddaca8bbb9e6e914b1a23787ccb879bc642931c9
react-native-orientation-locker: 851f6510d8046ea2f14aa169b1e01fcd309a94ba
react-native-pdf: 103940c90d62adfd259f63cca99c7c0c306b514c
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
@@ -1583,6 +1596,6 @@ SPEC CHECKSUMS:
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
Yoga: a716eea57d0d3430219c0a5a233e1e93ee931eb7
PODFILE CHECKSUM: 5dd4a5279260d370bcdf016158c825ceb404ee06
PODFILE CHECKSUM: 56d9f695324306d6db368d1172d211dfab55b7cb
COCOAPODS: 1.15.2
-6
View File
@@ -572,7 +572,6 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift/CryptoSwift.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/RNImageCropPickerPrivacyInfo.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
@@ -581,7 +580,6 @@
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CryptoSwift.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNImageCropPickerPrivacyInfo.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNPermissionsPrivacyInfo.bundle",
@@ -618,7 +616,6 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift/CryptoSwift.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/RNImageCropPickerPrivacyInfo.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
@@ -627,7 +624,6 @@
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CryptoSwift.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNImageCropPickerPrivacyInfo.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNPermissionsPrivacyInfo.bundle",
@@ -736,7 +732,6 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift/CryptoSwift.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/RNImageCropPickerPrivacyInfo.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
@@ -745,7 +740,6 @@
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CryptoSwift.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNImageCropPickerPrivacyInfo.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNPermissionsPrivacyInfo.bundle",
Submodule
+1
Submodule legal-docs added at 144f64af0d
+1 -1
View File
@@ -26,4 +26,4 @@ These log files are uploaded to Jenkins as CI job artifacts on failure using `ar
* `set_xcode_version.log` - Output from `node_modules/react-native/scripts/react-native-xcode.sh`.
- Created by redirecting output of `shellScript` in `ios/StatusIm.xcodeproj/project.pbxproj` for "Run Script" build Phase.
* `Status PR-StatusImPR.log - Created by [Fastlane Gym](https://docs.fastlane.tools/actions/gym/).
- Configred via [`Fastfile`](../Fastfile) using `buildlog_path` argument for `build_ios_app`.
- Configured via [`Fastfile`](../Fastfile) using `buildlog_path` argument for `build_ios_app`.
@@ -203,24 +203,6 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC
)
}
@ReactMethod
fun verify(address: String, password: String, callback: Callback) {
val absRootDirPath = utils.getNoBackupDirectory()
val newKeystoreDir = utils.pathCombine(absRootDirPath, "keystore")
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) {
val jsonParams = JSONObject()
@@ -248,10 +230,14 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC
@ReactMethod
private fun initializeApplication(request: String, callback: Callback) {
Log.d(TAG, "initializeApplication")
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",
request,
{ Statusgo.initializeApplication(request) },
jsonString,
{ Statusgo.initializeApplication(jsonString) },
callback
)
}
@@ -1,297 +0,0 @@
package im.status.ethereum.module;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
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;
import android.os.Build;
import android.view.Window;
import android.preference.PreferenceManager;
import android.content.SharedPreferences;
public class EncryptionUtils extends ReactContextBaseJavaModule {
private static final String TAG = "EncryptionUtils";
private ReactApplicationContext reactContext;
private Utils utils;
public EncryptionUtils(ReactApplicationContext reactContext) {
super(reactContext);
this.reactContext = reactContext;
this.utils = new Utils(reactContext);
}
@Override
public String getName() {
return "EncryptionUtils";
}
@ReactMethod
private void initKeystore(final String keyUID, final Callback callback) throws JSONException {
Log.d(TAG, "initKeystore");
final String commonKeydir = this.utils.pathCombine(this.utils.getNoBackupDirectory(), "/keystore");
final String keydir = this.utils.pathCombine(commonKeydir, keyUID);
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 {
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);
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) {
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) {
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 StatusBackendClient.executeStatusGoRequestWithResult(
"DecodeParameters",
decodeParamJSON,
() -> Statusgo.decodeParameters(decodeParamJSON)
);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String hexToNumber(final String hex) {
return StatusBackendClient.executeStatusGoRequestWithResult(
"HexToNumber",
hex,
() -> Statusgo.hexToNumber(hex)
);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String numberToHex(final String numString) {
return StatusBackendClient.executeStatusGoRequestWithResult(
"NumberToHex",
numString,
() -> Statusgo.numberToHex(numString)
);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String sha3(final String str) {
return StatusBackendClient.executeStatusGoRequestWithResult(
"Sha3",
str,
() -> Statusgo.sha3(str)
);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String utf8ToHex(final String str) {
return StatusBackendClient.executeStatusGoRequestWithResult(
"Utf8ToHex",
str,
() -> Statusgo.utf8ToHex(str)
);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String hexToUtf8(final String str) {
return StatusBackendClient.executeStatusGoRequestWithResult(
"HexToUtf8",
str,
() -> Statusgo.hexToUtf8(str)
);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String serializeLegacyKey(final String publicKey) {
return StatusBackendClient.executeStatusGoRequestWithResult(
"SerializeLegacyKey",
publicKey,
() -> Statusgo.serializeLegacyKey(publicKey)
);
}
@ReactMethod
public void setBlankPreviewFlag(final Boolean blankPreview) {
final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this.reactContext);
sharedPrefs.edit().putBoolean("BLANK_PREVIEW", blankPreview).commit();
setSecureFlag();
}
private void setSecureFlag() {
final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this.reactContext);
final boolean setSecure = sharedPrefs.getBoolean("BLANK_PREVIEW", true);
final Activity activity = this.reactContext.getCurrentActivity();
if (activity != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
final Window window = activity.getWindow();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH && setSecure) {
window.addFlags(WindowManager.LayoutParams.FLAG_SECURE);
} else {
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
}
}
});
}
}
@ReactMethod
public void hashTransaction(final String txArgsJSON, final Callback callback) throws JSONException {
StatusBackendClient.executeStatusGoRequestWithCallback(
"HashTransaction",
txArgsJSON,
() -> Statusgo.hashTransaction(txArgsJSON),
callback
);
}
@ReactMethod
public void hashMessage(final String message, final Callback callback) throws JSONException {
StatusBackendClient.executeStatusGoRequestWithCallback(
"HashMessage",
message,
() -> Statusgo.hashMessage(message),
callback
);
}
@ReactMethod
public void multiformatDeserializePublicKey(final String multiCodecKey, final String base58btc, final Callback callback) throws JSONException {
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 {
StatusBackendClient.executeStatusGoRequestWithCallback(
"DeserializeAndCompressKey",
desktopKey,
() -> Statusgo.deserializeAndCompressKey(desktopKey),
callback
);
}
@ReactMethod
public void hashTypedData(final String data, final Callback callback) throws JSONException {
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.hashTypedData(data), callback);
}
@ReactMethod
public void hashTypedDataV4(final String data, final Callback callback) throws JSONException {
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.hashTypedDataV4(data), callback);
}
@ReactMethod
public void signMessage(final String rpcParams, final Callback callback) throws JSONException {
StatusBackendClient.executeStatusGoRequestWithCallback(
"SignMessage",
rpcParams,
() -> Statusgo.signMessage(rpcParams),
callback
);
}
@ReactMethod
public void signTypedData(final String data, final String account, final String password, final Callback callback) throws JSONException {
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.signTypedData(data, account, password), callback);
}
@ReactMethod
public void signTypedDataV4(final String data, final String account, final String password, final Callback callback) throws JSONException {
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.signTypedDataV4(data, account, password), callback);
}
@ReactMethod
public void signGroupMembership(final String content, final Callback callback) throws JSONException {
this.utils.executeRunnableStatusGoMethod(() -> Statusgo.signGroupMembership(content), callback);
}
}
@@ -0,0 +1,258 @@
package im.status.ethereum.module
import android.app.Activity
import android.os.Build
import android.preference.PreferenceManager
import android.util.Log
import android.view.WindowManager
import com.facebook.react.bridge.*
import org.json.JSONException
import org.json.JSONObject
import statusgo.Statusgo
import java.lang.Exception
import java.lang.RuntimeException
class EncryptionUtils(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
private val utils = Utils(reactContext)
companion object {
private const val TAG = "EncryptionUtils"
}
override fun getName(): String = "EncryptionUtils"
@ReactMethod
@Throws(Exception::class)
private fun initKeystore(keyUID: String, callback: Callback) {
Log.d(TAG, "initKeystore")
val commonKeydir = utils.pathCombine(utils.getNoBackupDirectory(), "/keystore")
val keydir = utils.pathCombine(commonKeydir, keyUID)
StatusBackendClient.executeStatusGoRequestWithCallback(
"InitKeystore",
keydir,
{ Statusgo.initKeystore(keydir) },
callback
)
}
@ReactMethod
@Throws(Exception::class)
fun reEncryptDbAndKeystore(keyUID: String, password: String, newPassword: String, callback: Callback) {
val params = JSONObject().apply {
put("keyUID", keyUID)
put("oldPassword", password)
put("newPassword", newPassword)
}
StatusBackendClient.executeStatusGoRequestWithCallback(
"ChangeDatabasePasswordV2",
params.toString(),
{ Statusgo.changeDatabasePasswordV2(params.toString()) },
callback
)
}
@ReactMethod
@Throws(Exception::class)
fun convertToKeycardAccount(
keyUID: String,
accountData: String,
options: String,
keycardUID: String,
password: String,
newPassword: String,
callback: Callback
) {
val keyStoreDir = utils.getKeyStorePath(keyUID)
val params = JSONObject().apply {
put("keyUID", keyUID)
put("account", JSONObject(accountData))
put("settings", JSONObject(options))
put("keycardUID", keycardUID)
put("oldPassword", password)
put("newPassword", newPassword)
}
val jsonParams = params.toString()
StatusBackendClient.executeStatusGoRequest(
"InitKeystore",
keyStoreDir,
{ Statusgo.initKeystore(keyStoreDir) }
)
StatusBackendClient.executeStatusGoRequestWithCallback(
"ConvertToKeycardAccountV2",
jsonParams,
{ Statusgo.convertToKeycardAccountV2(jsonParams) },
callback
)
}
@ReactMethod(isBlockingSynchronousMethod = true)
fun decodeParameters(decodeParamJSON: String): String =
StatusBackendClient.executeStatusGoRequestWithResult(
"DecodeParameters",
decodeParamJSON,
{ Statusgo.decodeParameters(decodeParamJSON) }
)
@ReactMethod(isBlockingSynchronousMethod = true)
fun hexToNumber(hex: String): String =
StatusBackendClient.executeStatusGoRequestWithResult(
"HexToNumber",
hex,
{ Statusgo.hexToNumber(hex) }
)
@ReactMethod(isBlockingSynchronousMethod = true)
fun numberToHex(numString: String): String =
StatusBackendClient.executeStatusGoRequestWithResult(
"NumberToHex",
numString,
{ Statusgo.numberToHex(numString) }
)
@ReactMethod(isBlockingSynchronousMethod = true)
fun sha3(str: String): String =
StatusBackendClient.executeStatusGoRequestWithResult(
"Sha3",
str,
{ Statusgo.sha3(str) }
)
@ReactMethod(isBlockingSynchronousMethod = true)
fun utf8ToHex(str: String): String =
StatusBackendClient.executeStatusGoRequestWithResult(
"Utf8ToHex",
str,
{ Statusgo.utf8ToHex(str) }
)
@ReactMethod(isBlockingSynchronousMethod = true)
fun hexToUtf8(str: String): String =
StatusBackendClient.executeStatusGoRequestWithResult(
"HexToUtf8",
str,
{ Statusgo.hexToUtf8(str) }
)
@ReactMethod(isBlockingSynchronousMethod = true)
fun serializeLegacyKey(publicKey: String): String =
StatusBackendClient.executeStatusGoRequestWithResult(
"SerializeLegacyKey",
publicKey,
{ Statusgo.serializeLegacyKey(publicKey) }
)
@ReactMethod
fun setBlankPreviewFlag(blankPreview: Boolean) {
PreferenceManager.getDefaultSharedPreferences(reactContext)
.edit()
.putBoolean("BLANK_PREVIEW", blankPreview)
.commit()
setSecureFlag()
}
private fun setSecureFlag() {
val sharedPrefs = PreferenceManager.getDefaultSharedPreferences(reactContext)
val setSecure = sharedPrefs.getBoolean("BLANK_PREVIEW", true)
reactContext.currentActivity?.run {
runOnUiThread {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH && setSecure) {
window.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
} else {
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
}
}
}
}
@ReactMethod
@Throws(Exception::class)
fun hashTransaction(txArgsJSON: String, callback: Callback) {
StatusBackendClient.executeStatusGoRequestWithCallback(
"HashTransaction",
txArgsJSON,
{ Statusgo.hashTransaction(txArgsJSON) },
callback
)
}
@ReactMethod
@Throws(Exception::class)
fun hashMessage(message: String, callback: Callback) {
StatusBackendClient.executeStatusGoRequestWithCallback(
"HashMessage",
message,
{ Statusgo.hashMessage(message) },
callback
)
}
@ReactMethod
@Throws(Exception::class)
fun multiformatDeserializePublicKey(multiCodecKey: String, base58btc: String, callback: Callback) {
val params = JSONObject().apply {
put("key", multiCodecKey)
put("outBase", base58btc)
}
StatusBackendClient.executeStatusGoRequestWithCallback(
"MultiformatDeserializePublicKeyV2",
params.toString(),
{ Statusgo.multiformatDeserializePublicKeyV2(params.toString()) },
callback
)
}
@ReactMethod
@Throws(Exception::class)
fun deserializeAndCompressKey(desktopKey: String, callback: Callback) {
StatusBackendClient.executeStatusGoRequestWithCallback(
"DeserializeAndCompressKey",
desktopKey,
{ Statusgo.deserializeAndCompressKey(desktopKey) },
callback
)
}
@ReactMethod
@Throws(Exception::class)
fun hashTypedData(data: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.hashTypedData(data) }, callback)
}
@ReactMethod
@Throws(Exception::class)
fun hashTypedDataV4(data: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.hashTypedDataV4(data) }, callback)
}
@ReactMethod
@Throws(Exception::class)
fun signMessage(rpcParams: String, callback: Callback) {
StatusBackendClient.executeStatusGoRequestWithCallback(
"SignMessage",
rpcParams,
{ Statusgo.signMessage(rpcParams) },
callback
)
}
@ReactMethod
@Throws(Exception::class)
fun signTypedData(data: String, account: String, password: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.signTypedData(data, account, password) }, callback)
}
@ReactMethod
@Throws(Exception::class)
fun signTypedDataV4(data: String, account: String, password: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.signTypedDataV4(data, account, password) }, callback)
}
@ReactMethod
@Throws(Exception::class)
fun signGroupMembership(content: String, callback: Callback) {
utils.executeRunnableStatusGoMethod({ Statusgo.signGroupMembership(content) }, callback)
}
}
@@ -195,25 +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()
StatusBackendClient.executeStatusGoRequestWithCallback(
endpoint = "InitLogging",
requestBody = config,
statusgoFunction = { Statusgo.initLogging(config) },
callback = callback
)
}
@ReactMethod(isBlockingSynchronousMethod = true)
fun logFileDirectory(): String? {
return utils.getPublicStorageDirectory()?.absolutePath
@@ -223,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"
}
}
@@ -24,8 +24,6 @@ class StatusBackendClient(private val reactContext: ReactApplicationContext) : R
@Volatile private var instance: StatusBackendClient? = null
private lateinit var utils: Utils
private val initializationCallbacks = mutableListOf<() -> Unit>()
fun getInstance(): StatusBackendClient? = instance
@JvmStatic
@@ -86,23 +84,9 @@ class StatusBackendClient(private val reactContext: ReactApplicationContext) : R
""
}
} else {
if (endpoint == "ImageServerTLSCert") {
Log.i(TAG, "ImageServerTLSCert endpoint called without server enabled - " +
"stacktrace: ${Thread.currentThread().stackTrace.joinToString("\n")}")
}
statusgoFunction()
}
}
fun addInitializationCallback(callback: () -> Unit) {
if (instance?.initialized == true) {
Log.d(TAG, "Executing initialization callback immediately")
callback()
} else {
Log.d(TAG, "Adding initialization callback")
initializationCallbacks.add(callback)
}
}
}
init {
@@ -125,11 +109,10 @@ class StatusBackendClient(private val reactContext: ReactApplicationContext) : R
private var webSocket: WebSocket? = null
@Volatile var serverEnabled = true
@Volatile var serverEnabled = false
@Volatile private var statusGoEndpoint: String? = null
@Volatile private var signalEndpoint: String? = null
@Volatile var rootDataDir: String? = null
@Volatile var initialized = false
@ReactMethod
fun configStatusBackendServer(
@@ -139,11 +122,6 @@ class StatusBackendClient(private val reactContext: ReactApplicationContext) : R
rootDataDir: String
) {
configure(serverEnabled, statusGoEndpoint, signalEndpoint, rootDataDir)
this.initialized = true
// Execute callbacks
initializationCallbacks.forEach { it() }
initializationCallbacks.clear()
Log.d(TAG, "StatusBackendClient initialized")
}
private fun configure(
@@ -1,124 +0,0 @@
package im.status.ethereum.module;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import android.app.Activity;
import android.util.Log;
import android.os.Build;
import android.webkit.WebView;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import android.webkit.WebStorage;
import android.view.WindowManager;
import com.facebook.react.uimanager.UIManagerModule;
import com.facebook.react.uimanager.UIBlock;
import com.facebook.react.uimanager.NativeViewHierarchyManager;
import android.view.inputmethod.InputMethodManager;
import android.view.View;
import android.widget.EditText;
import android.content.Context;
public class UIHelper extends ReactContextBaseJavaModule {
private static final String TAG = "UIHelper";
private ReactApplicationContext reactContext;
public UIHelper(ReactApplicationContext reactContext) {
super(reactContext);
this.reactContext = reactContext;
}
@Override
public String getName() {
return "UIHelper";
}
@ReactMethod
public void setSoftInputMode(final int mode) {
Log.d(TAG, "setSoftInputMode");
final Activity activity = getCurrentActivity();
if (activity == null) {
return;
}
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
activity.getWindow().setSoftInputMode(mode);
}
});
}
@SuppressWarnings("deprecation")
@ReactMethod
public void clearCookies() {
Log.d(TAG, "clearCookies");
final Activity activity = getCurrentActivity();
if (activity == null) {
return;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
CookieManager.getInstance().removeAllCookies(null);
CookieManager.getInstance().flush();
} else {
CookieSyncManager cookieSyncManager = CookieSyncManager.createInstance(activity);
cookieSyncManager.startSync();
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeAllCookie();
cookieManager.removeSessionCookie();
cookieSyncManager.stopSync();
cookieSyncManager.sync();
}
}
@ReactMethod
public void toggleWebviewDebug(final boolean val) {
Log.d(TAG, "toggleWebviewDebug");
final Activity activity = getCurrentActivity();
if (activity == null) {
return;
}
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
WebView.setWebContentsDebuggingEnabled(val);
}
});
}
@ReactMethod
public void clearStorageAPIs() {
Log.d(TAG, "clearStorageAPIs");
final Activity activity = getCurrentActivity();
if (activity == null) {
return;
}
WebStorage storage = WebStorage.getInstance();
if (storage != null) {
storage.deleteAllData();
}
}
@ReactMethod
public void resetKeyboardInputCursor(final int reactTagToReset, final int selection) {
UIManagerModule uiManager = getReactApplicationContext().getNativeModule(UIManagerModule.class);
uiManager.addUIBlock(new UIBlock() {
@Override
public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {
InputMethodManager imm = (InputMethodManager) getReactApplicationContext().getBaseContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null) {
View viewToReset = nativeViewHierarchyManager.resolveView(reactTagToReset);
imm.restartInput(viewToReset);
try {
EditText textView = (EditText) viewToReset;
textView.setSelection(selection);
} catch (Exception e) {}
}
}
});
}
}
@@ -0,0 +1,97 @@
package im.status.ethereum.module
import android.app.Activity
import android.content.Context
import android.os.Build
import android.util.Log
import android.view.View
import android.view.WindowManager
import android.view.inputmethod.InputMethodManager
import android.webkit.CookieManager
import android.webkit.CookieSyncManager
import android.webkit.WebStorage
import android.webkit.WebView
import android.widget.EditText
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import com.facebook.react.uimanager.NativeViewHierarchyManager
import com.facebook.react.uimanager.UIBlock
import com.facebook.react.uimanager.UIManagerModule
class UIHelper(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
companion object {
private const val TAG = "UIHelper"
}
override fun getName(): String = "UIHelper"
@ReactMethod
fun setSoftInputMode(mode: Int) {
Log.d(TAG, "setSoftInputMode")
getCurrentActivity()?.run {
runOnUiThread {
window.setSoftInputMode(mode)
}
}
}
@Suppress("DEPRECATION")
@ReactMethod
fun clearCookies() {
Log.d(TAG, "clearCookies")
getCurrentActivity()?.let { activity ->
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
CookieManager.getInstance().apply {
removeAllCookies(null)
flush()
}
} else {
CookieSyncManager.createInstance(activity).also { cookieSyncManager ->
cookieSyncManager.startSync()
CookieManager.getInstance().apply {
removeAllCookie()
removeSessionCookie()
}
cookieSyncManager.stopSync()
cookieSyncManager.sync()
}
}
}
}
@ReactMethod
fun toggleWebviewDebug(enabled: Boolean) {
Log.d(TAG, "toggleWebviewDebug")
getCurrentActivity()?.run {
runOnUiThread {
WebView.setWebContentsDebuggingEnabled(enabled)
}
}
}
@ReactMethod
fun clearStorageAPIs() {
Log.d(TAG, "clearStorageAPIs")
getCurrentActivity()?.let {
WebStorage.getInstance()?.deleteAllData()
}
}
@ReactMethod
fun resetKeyboardInputCursor(reactTagToReset: Int, selection: Int) {
reactApplicationContext.getNativeModule(UIManagerModule::class.java)?.addUIBlock(object : UIBlock {
override fun execute(nativeViewHierarchyManager: NativeViewHierarchyManager) {
(reactApplicationContext.baseContext.getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager)?.let { imm ->
val viewToReset = nativeViewHierarchyManager.resolveView(reactTagToReset)
imm.restartInput(viewToReset)
try {
(viewToReset as? EditText)?.setSelection(selection)
} catch (e: Exception) {
// Ignore exceptions during selection setting
}
}
}
})
}
}
@@ -1,109 +0,0 @@
package im.status.ethereum.pushnotifications;
import android.content.Context;
import android.content.Intent;
import android.app.Service;
import android.content.pm.ServiceInfo;
import android.os.IBinder;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.provider.Settings;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import android.os.Build;
import im.status.ethereum.module.R;
public class ForegroundService extends Service {
private static final String CHANNEL_ID = "status-service";
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public int onStartCommand(Intent i, int flags, int startId) {
// NOTE: recent versions of Android require the service to display
// a sticky notification to inform the user that the service is running
Context context = getApplicationContext();
// Create the NotificationChannel, but only on API 26+ because
// the NotificationChannel class is new and not in the support library
Intent intent = null;
String notificationContentText = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationManager notificationManager =
context.getSystemService(NotificationManager.class);
NotificationChannel channel = new NotificationChannel(CHANNEL_ID,
context.getResources().getString(R.string.status_service),
NotificationManager.IMPORTANCE_HIGH);
channel.setShowBadge(false);
notificationManager.createNotificationChannel(channel);
// Create intent that takes the user to the notification channel settings so they can hide it
intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, getPackageName());
intent.putExtra(Settings.EXTRA_CHANNEL_ID, CHANNEL_ID);
notificationContentText = context.getResources().getString(R.string.tap_to_hide_notification);
} else {
// For older versions of android intent takes the user to the Status app
Class intentClass;
String packageName = context.getPackageName();
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(packageName);
String className = launchIntent.getComponent().getClassName();
try {
intentClass = Class.forName(className);
} catch (ClassNotFoundException e) {
e.printStackTrace();
return 0;
}
intent = new Intent(context, intentClass);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setAction(Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
notificationContentText = context.getResources().getString(R.string.keep_status_running);
}
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE);
Intent stopIntent = new Intent(PushNotificationHelper.ACTION_TAP_STOP);
PendingIntent stopPendingIntent = PendingIntent.getBroadcast(context, 0, stopIntent,
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
Notification notification = new NotificationCompat.Builder(context, CHANNEL_ID)
.setSmallIcon(R.drawable.ic_stat_notify_status)
.setContentTitle(context.getResources().getString(R.string.background_service_opened))
.setContentText(notificationContentText)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
.setContentIntent(pendingIntent)
.setNumber(0)
.addAction(R.drawable.ic_stat_notify_status,
context.getResources().getString(R.string.stop),
stopPendingIntent)
.build();
// the id of the foreground notification MUST NOT be 0
if (Build.VERSION.SDK_INT >= 33) {
startForeground(1, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE);
} else {
startForeground(1, notification);
}
return START_STICKY;
}
}
@@ -0,0 +1,122 @@
package im.status.ethereum.pushnotifications
import android.content.Context
import android.content.Intent
import android.app.Service
import android.content.pm.ServiceInfo
import android.os.IBinder
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.provider.Settings
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import android.os.Build
import im.status.ethereum.module.R
class ForegroundService : Service() {
companion object {
private const val CHANNEL_ID = "status-service"
}
override fun onBind(intent: Intent?): IBinder? {
return null
}
override fun onStartCommand(i: Intent?, flags: Int, startId: Int): Int {
// NOTE: recent versions of Android require the service to display
// a sticky notification to inform the user that the service is running
val context = applicationContext
// Create the NotificationChannel, but only on API 26+ because
// the NotificationChannel class is new and not in the support library
// Create notification channel for Android O and above
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val notificationManager = context.getSystemService(NotificationManager::class.java)
val channel = NotificationChannel(
CHANNEL_ID,
context.resources.getString(R.string.status_service),
NotificationManager.IMPORTANCE_HIGH
).apply {
setShowBadge(false)
}
notificationManager.createNotificationChannel(channel)
}
// Initialize intent and notification text based on Android version
val notificationIntent = createNotificationIntent(context)
val notificationText = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.resources.getString(R.string.tap_to_hide_notification)
} else {
context.resources.getString(R.string.keep_status_running)
}
val pendingIntent = PendingIntent.getActivity(
this,
0,
notificationIntent,
PendingIntent.FLAG_IMMUTABLE
)
val stopIntent = Intent(PushNotificationHelper.ACTION_TAP_STOP)
val stopPendingIntent = PendingIntent.getBroadcast(
context,
0,
stopIntent,
PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_IMMUTABLE
)
val notification = NotificationCompat.Builder(context, CHANNEL_ID)
.setSmallIcon(R.drawable.ic_stat_notify_status)
.setContentTitle(context.resources.getString(R.string.background_service_opened))
.setContentText(notificationText)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
.setContentIntent(pendingIntent)
.setNumber(0)
.addAction(
R.drawable.ic_stat_notify_status,
context.resources.getString(R.string.stop),
stopPendingIntent
)
.build()
// the id of the foreground notification MUST NOT be 0
if (Build.VERSION.SDK_INT >= 33) {
startForeground(1, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE)
} else {
startForeground(1, notification)
}
return START_STICKY
}
private fun createNotificationIntent(context: Context): Intent {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// Create intent that takes the user to the notification channel settings
Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS).apply {
putExtra(Settings.EXTRA_APP_PACKAGE, packageName)
putExtra(Settings.EXTRA_CHANNEL_ID, CHANNEL_ID)
}
} else {
// For older versions of android, intent takes the user to the Status app
val packageName = context.packageName
val launchIntent = context.packageManager.getLaunchIntentForPackage(packageName)
val className = launchIntent?.component?.className
try {
val intentClass = Class.forName(className!!)
Intent(context, intentClass).apply {
addCategory(Intent.CATEGORY_BROWSABLE)
action = Intent.ACTION_VIEW
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
}
} catch (e: ClassNotFoundException) {
e.printStackTrace()
// Return an empty intent as fallback
Intent()
}
}
}
}
@@ -1,146 +0,0 @@
package im.status.ethereum.pushnotifications;
import android.app.Activity;
import android.app.Application;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.core.app.NotificationManagerCompat;
import java.security.SecureRandom;
import com.facebook.react.bridge.ActivityEventListener;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableMap;
import android.util.Log;
import im.status.ethereum.pushnotifications.PushNotificationJsDelivery;
public class PushNotification extends ReactContextBaseJavaModule implements ActivityEventListener {
public static final String LOG_TAG = "PushNotification";
private final SecureRandom mRandomNumberGenerator = new SecureRandom();
private PushNotificationHelper pushNotificationHelper;
private PushNotificationJsDelivery delivery;
private ReactApplicationContext reactContext;
private boolean started;
public PushNotification(ReactApplicationContext reactContext) {
super(reactContext);
this.reactContext = reactContext;
reactContext.addActivityEventListener(this);
Application applicationContext = (Application) reactContext.getApplicationContext();
IntentFilter intentFilter = new IntentFilter();
pushNotificationHelper = new PushNotificationHelper(applicationContext, intentFilter);
delivery = new PushNotificationJsDelivery(reactContext);
}
@Override
public String getName() {
return "PushNotification";
}
// removed @Override temporarily just to get it working on different versions of RN
public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
onActivityResult(requestCode, resultCode, data);
}
// removed @Override temporarily just to get it working on different versions of RN
public void onActivityResult(int requestCode, int resultCode, Intent data) {
// Ignored, required to implement ActivityEventListener for RN 0.33
}
private Bundle getBundleFromIntent(Intent intent) {
Bundle bundle = null;
if (intent.hasExtra("notification")) {
bundle = intent.getBundleExtra("notification");
} else if (intent.hasExtra("google.message_id")) {
bundle = new Bundle();
bundle.putBundle("data", intent.getExtras());
}
if(null != bundle && !bundle.getBoolean("foreground", false) && !bundle.containsKey("userInteraction")) {
bundle.putBoolean("userInteraction", true);
}
return bundle;
}
@Override
public void onNewIntent(Intent intent) {
Bundle bundle = this.getBundleFromIntent(intent);
if (bundle != null) {
delivery.notifyNotification(bundle);
}
}
@ReactMethod
/**
* Creates a channel if it does not already exist. Returns whether the channel was created.
*/
public void createChannel(ReadableMap channelInfo, Callback callback) {
boolean created = pushNotificationHelper.createChannel(channelInfo);
if(callback != null) {
callback.invoke(created);
}
}
@ReactMethod
public void presentLocalNotification(ReadableMap details) {
if (!this.started) {
return;
}
Bundle bundle = Arguments.toBundle(details);
// If notification ID is not provided by the user, generate one at random
if (bundle.getString("id") == null) {
bundle.putString("id", String.valueOf(mRandomNumberGenerator.nextInt()));
}
pushNotificationHelper.sendToNotificationCentre(bundle);
}
@ReactMethod
public void clearMessageNotifications(String conversationId) {
if (this.started) {
pushNotificationHelper.clearMessageNotifications(conversationId);
}
}
@ReactMethod
public void clearAllMessageNotifications() {
pushNotificationHelper.clearAllMessageNotifications();
}
@ReactMethod
public void enableNotifications() {
this.started = true;
this.pushNotificationHelper.start();
}
@ReactMethod
public void disableNotifications() {
if (this.started) {
this.started = false;
this.pushNotificationHelper.stop();
}
}
}
@@ -0,0 +1,118 @@
package im.status.ethereum.pushnotifications
import android.app.Activity
import android.app.Application
import android.app.NotificationManager
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Bundle
import android.util.Log
import androidx.annotation.NonNull
import androidx.core.app.NotificationManagerCompat
import com.facebook.react.bridge.*
import im.status.ethereum.pushnotifications.PushNotificationJsDelivery
import java.security.SecureRandom
class PushNotification(reactContext: ReactApplicationContext) :
ReactContextBaseJavaModule(reactContext), ActivityEventListener {
companion object {
const val LOG_TAG = "PushNotification"
}
private val mRandomNumberGenerator = SecureRandom()
private val pushNotificationHelper: PushNotificationHelper
private val delivery: PushNotificationJsDelivery
private val reactContext: ReactApplicationContext = reactContext
private var started: Boolean = false
init {
reactContext.addActivityEventListener(this)
val applicationContext = reactContext.applicationContext as Application
val intentFilter = IntentFilter()
pushNotificationHelper = PushNotificationHelper(applicationContext, intentFilter)
delivery = PushNotificationJsDelivery(reactContext)
}
override fun getName(): String = "PushNotification"
// Primary implementation of ActivityEventListener interface
override fun onActivityResult(activity: Activity, requestCode: Int, resultCode: Int, data: Intent?) {
// Call the helper method with the correct parameter order
handleActivityResult(requestCode, resultCode, data)
}
// Private helper method for handling activity results
private fun handleActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
// Ignored, required to implement ActivityEventListener for RN 0.33
}
private fun getBundleFromIntent(intent: Intent): Bundle? {
return when {
intent.hasExtra("notification") -> intent.getBundleExtra("notification")
intent.hasExtra("google.message_id") -> Bundle().apply {
putBundle("data", intent.extras)
}
else -> null
}?.apply {
if (!getBoolean("foreground", false) && !containsKey("userInteraction")) {
putBoolean("userInteraction", true)
}
}
}
override fun onNewIntent(intent: Intent) {
getBundleFromIntent(intent)?.let { bundle ->
delivery.notifyNotification(bundle)
}
}
@ReactMethod
fun createChannel(channelInfo: ReadableMap, callback: Callback?) {
val created = pushNotificationHelper.createChannel(channelInfo)
callback?.invoke(created)
}
@ReactMethod
fun presentLocalNotification(details: ReadableMap) {
if (!started) return
Arguments.toBundle(details)?.apply {
// If notification ID is not provided by the user, generate one at random
if (getString("id") == null) {
putString("id", mRandomNumberGenerator.nextInt().toString())
}
pushNotificationHelper.sendToNotificationCentre(this)
}
}
@ReactMethod
fun clearMessageNotifications(conversationId: String) {
if (started) {
pushNotificationHelper.clearMessageNotifications(conversationId)
}
}
@ReactMethod
fun clearAllMessageNotifications() {
pushNotificationHelper.clearAllMessageNotifications()
}
@ReactMethod
fun enableNotifications() {
started = true
pushNotificationHelper.start()
}
@ReactMethod
fun disableNotifications() {
if (started) {
started = false
pushNotificationHelper.stop()
}
}
}
@@ -1,93 +0,0 @@
package im.status.ethereum.pushnotifications;
import android.os.Build;
import android.app.Application;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import im.status.ethereum.pushnotifications.PushNotificationJsDelivery;
import static im.status.ethereum.pushnotifications.PushNotification.LOG_TAG;
public class PushNotificationActions extends BroadcastReceiver {
@Override
public void onReceive(final Context context, Intent intent) {
String intentActionPrefix = context.getPackageName() + ".ACTION_";
Log.i(LOG_TAG, "PushNotificationBootEventReceiver loading scheduled notifications");
if (null == intent.getAction() || !intent.getAction().startsWith(intentActionPrefix)) {
return;
}
final Bundle bundle = intent.getBundleExtra("notification");
// Dismiss the notification popup.
NotificationManager manager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);
int notificationID = Integer.parseInt(bundle.getString("id"));
boolean autoCancel = bundle.getBoolean("autoCancel", true);
if(autoCancel) {
if (bundle.containsKey("tag")) {
String tag = bundle.getString("tag");
manager.cancel(tag, notificationID);
} else {
manager.cancel(notificationID);
}
}
boolean invokeApp = bundle.getBoolean("invokeApp", true);
// Notify the action.
if(invokeApp) {
IntentFilter intentFilter = new IntentFilter();
PushNotificationHelper helper = new PushNotificationHelper((Application) context.getApplicationContext(), intentFilter);
helper.invokeApp(bundle);
} else {
// We need to run this on the main thread, as the React code assumes that is true.
// Namely, DevServerHelper constructs a Handler() without a Looper, which triggers:
// "Can't create handler inside thread that has not called Looper.prepare()"
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
public void run() {
// Construct and load our normal React JS code bundle
final ReactInstanceManager mReactInstanceManager = ((ReactApplication) context.getApplicationContext()).getReactNativeHost().getReactInstanceManager();
ReactContext context = mReactInstanceManager.getCurrentReactContext();
PushNotificationJsDelivery delivery = new PushNotificationJsDelivery(context);
// If it's constructed, send a notification
if (context != null) {
delivery.notifyNotificationAction(bundle);
} else {
// Otherwise wait for construction, then send the notification
mReactInstanceManager.addReactInstanceEventListener(new ReactInstanceManager.ReactInstanceEventListener() {
public void onReactContextInitialized(ReactContext context) {
PushNotificationJsDelivery delivery = new PushNotificationJsDelivery(context);
delivery.notifyNotificationAction(bundle);
mReactInstanceManager.removeReactInstanceEventListener(this);
}
});
if (!mReactInstanceManager.hasStartedCreatingInitialContext()) {
// Construct it in the background
mReactInstanceManager.createReactContextInBackground();
}
}
}
});
}
}
}
@@ -0,0 +1,100 @@
package im.status.ethereum.pushnotifications
import android.os.Build
import android.app.Application
import android.app.NotificationManager
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.util.Log
import com.facebook.react.ReactApplication
import com.facebook.react.ReactInstanceManager
import com.facebook.react.bridge.ReactContext
import im.status.ethereum.pushnotifications.PushNotificationJsDelivery
import im.status.ethereum.pushnotifications.PushNotification.Companion.LOG_TAG
/**
* BroadcastReceiver responsible for handling push notification actions.
* This class processes notification interactions and manages their lifecycle.
*/
class PushNotificationActions : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val intentActionPrefix = "${context.packageName}.ACTION_"
Log.i(LOG_TAG, "PushNotificationBootEventReceiver loading scheduled notifications")
if (intent.action == null || !intent.action!!.startsWith(intentActionPrefix)) {
return
}
val bundle = intent.getBundleExtra("notification") ?: return
val manager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val notificationID = bundle.getString("id")?.toInt() ?: return
// Dismiss the notification popup.
val autoCancel = bundle.getBoolean("autoCancel", true)
if (autoCancel) {
bundle.getString("tag")?.let { tag ->
manager.cancel(tag, notificationID)
} ?: run {
manager.cancel(notificationID)
}
}
// Notify the action.
val invokeApp = bundle.getBoolean("invokeApp", true)
if (invokeApp) {
val intentFilter = IntentFilter()
val helper = PushNotificationHelper(
context.applicationContext as Application,
intentFilter
)
helper.invokeApp(bundle)
} else {
// We need to run this on the main thread, as the React code assumes that is true.
// Namely, DevServerHelper constructs a Handler() without a Looper, which triggers:
// "Can't create handler inside thread that has not called Looper.prepare()"
Handler(Looper.getMainLooper()).post {
// Construct and load our normal React JS code bundle
val reactInstanceManager = (context.applicationContext as ReactApplication)
.reactNativeHost
.reactInstanceManager
val currentContext = reactInstanceManager.currentReactContext
when {
// If context exists, deliver notification immediately
currentContext != null -> {
PushNotificationJsDelivery(currentContext)
.notifyNotificationAction(bundle)
}
// Otherwise wait for construction, then send the notification
else -> {
val listener = object : ReactInstanceManager.ReactInstanceEventListener {
override fun onReactContextInitialized(reactContext: ReactContext) {
PushNotificationJsDelivery(reactContext)
.notifyNotificationAction(bundle)
reactInstanceManager.removeReactInstanceEventListener(this)
}
}
// Add the listener and create context if needed
reactInstanceManager.addReactInstanceEventListener(listener)
if (!reactInstanceManager.hasStartedCreatingInitialContext()) {
// Construct it in the background
reactInstanceManager.createReactContextInBackground()
}
}
}
}
}
}
}
@@ -1,886 +0,0 @@
// https://github.com/zo0r/react-native-push-notification/blob/bedc8f646aab67d594f291449fbfa24e07b64fe8/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java Copy-Paste with removed firebase
package im.status.ethereum.pushnotifications;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningAppProcessInfo;
import android.app.AlarmManager;
import android.app.Application;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.BroadcastReceiver;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.media.AudioAttributes;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.service.notification.StatusBarNotification;
import android.util.Log;
import android.util.Base64;
import androidx.annotation.RequiresApi;
import androidx.core.app.NotificationCompat;
import androidx.core.app.Person;
import androidx.core.graphics.drawable.IconCompat;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import org.json.JSONArray;
import org.json.JSONException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.HashMap;
import java.util.Map;
import im.status.ethereum.module.R;
import static im.status.ethereum.pushnotifications.PushNotification.LOG_TAG;
public class PushNotificationHelper {
private Context context;
private static final long DEFAULT_VIBRATION = 300L;
private static final String CHANNEL_ID = "status-im-notifications";
public static final String ACTION_DELETE_NOTIFICATION = "im.status.ethereum.module.DELETE_NOTIFICATION";
public static final String ACTION_TAP_STOP = "im.status.ethereum.module.TAP_STOP";
final int flag = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE : PendingIntent.FLAG_CANCEL_CURRENT;
private NotificationManager notificationManager;
private HashMap<String, Person> persons;
private HashMap<String, StatusMessageGroup> messageGroups;
private IntentFilter intentFilter;
public PushNotificationHelper(Application context, IntentFilter intentFilter) {
this.context = context;
this.intentFilter = intentFilter;
this.persons = new HashMap<String, Person>();
this.messageGroups = new HashMap<String, StatusMessageGroup>();
this.notificationManager = context.getSystemService(NotificationManager.class);
this.registerBroadcastReceiver();
}
public Intent getOpenAppIntent(String deepLink) {
Class intentClass;
String packageName = context.getPackageName();
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(packageName);
String className = launchIntent.getComponent().getClassName();
try {
intentClass = Class.forName(className);
} catch (ClassNotFoundException e) {
e.printStackTrace();
return null;
}
Intent intent = new Intent(context, intentClass);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setAction(Intent.ACTION_VIEW);
//NOTE: you might wonder, why the heck did he decide to set these flags in particular. Well,
//the answer is a simple as it can get in the Android native development world. I noticed
//that my initial setup was opening the app but wasn't triggering any events on the js side, like
//the links do from the browser. So I compared both intents and noticed that the link from
//the browser produces an intent with the flag 0x14000000. I found out that it was the following
//flags in this link:
//https://stackoverflow.com/questions/52390129/android-intent-setflags-issue
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
if (deepLink != null) {
intent.setData(Uri.parse(deepLink));
}
return intent;
}
//NOTE: we use a dynamically created BroadcastReceiver here so that we can capture
//intents from notifications and act on them. For instance when tapping/dismissing
//a chat notification we want to clear the chat so that next messages don't show
//the messages that we have seen again
private final BroadcastReceiver notificationActionReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction() == ACTION_DELETE_NOTIFICATION) {
String groupId = intent.getExtras().getString("im.status.ethereum.groupId");
if (groupId != null) {
cleanGroup(groupId);
}
}
if (intent.getAction() == ACTION_TAP_STOP) {
stop();
System.exit(0);
}
Log.e(LOG_TAG, "intent received: " + intent.getAction());
}
};
public void registerBroadcastReceiver() {
this.intentFilter.addAction(ACTION_DELETE_NOTIFICATION);
this.intentFilter.addAction(ACTION_TAP_STOP);
context.registerReceiver(notificationActionReceiver, this.intentFilter, Context.RECEIVER_EXPORTED);
Log.e(LOG_TAG, "Broadcast Receiver registered");
}
private NotificationManager notificationManager() {
return (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
}
public void invokeApp(Bundle bundle) {
String packageName = context.getPackageName();
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(packageName);
String className = launchIntent.getComponent().getClassName();
try {
Class<?> activityClass = Class.forName(className);
Intent activityIntent = new Intent(context, activityClass);
if(bundle != null) {
activityIntent.putExtra("notification", bundle);
}
activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(activityIntent);
} catch(Exception e) {
Log.e(LOG_TAG, "Class not found", e);
return;
}
}
public void sendToNotificationCentre(final Bundle bundle) {
PushNotificationPicturesAggregator aggregator = new PushNotificationPicturesAggregator(new PushNotificationPicturesAggregator.Callback() {
public void call(Bitmap largeIconImage, Bitmap bigPictureImage) {
sendToNotificationCentreWithPicture(bundle, largeIconImage, bigPictureImage);
}
});
aggregator.setLargeIconUrl(context, bundle.getString("largeIconUrl"));
aggregator.setBigPictureUrl(context, bundle.getString("bigPictureUrl"));
}
public void handleConversation(final Bundle bundle) {
if (bundle.getBoolean("deleted")){
this.removeStatusMessage(bundle);
} else {
this.addStatusMessage(bundle);
}
}
public void clearMessageNotifications(String conversationId) {
notificationManager.cancel(conversationId.hashCode());
cleanGroup(conversationId);
}
public void clearAllMessageNotifications() {
notificationManager.cancelAll();
}
public void sendToNotificationCentreWithPicture(final Bundle bundle, Bitmap largeIconBitmap, Bitmap bigPictureBitmap) {
try {
Class intentClass = getMainActivityClass();
if (intentClass == null) {
Log.e(LOG_TAG, "No activity class found for the notification");
return;
}
if (bundle.getBoolean("isConversation")) {
this.handleConversation(bundle);
return;
}
if (bundle.getString("message") == null) {
// this happens when a 'data' notification is received - we do not synthesize a local notification in this case
Log.d(LOG_TAG, "Ignore this message if you sent data-only notification. Cannot send to notification centre because there is no 'message' field in: " + bundle);
return;
}
String notificationIdString = bundle.getString("id");
if (notificationIdString == null) {
Log.e(LOG_TAG, "No notification ID specified for the notification");
return;
}
Resources res = context.getResources();
String packageName = context.getPackageName();
String title = bundle.getString("title");
if (title == null) {
ApplicationInfo appInfo = context.getApplicationInfo();
title = context.getPackageManager().getApplicationLabel(appInfo).toString();
}
int priority = NotificationCompat.PRIORITY_HIGH;
final String priorityString = bundle.getString("priority");
if (priorityString != null) {
switch (priorityString.toLowerCase()) {
case "max":
priority = NotificationCompat.PRIORITY_MAX;
break;
case "high":
priority = NotificationCompat.PRIORITY_HIGH;
break;
case "low":
priority = NotificationCompat.PRIORITY_LOW;
break;
case "min":
priority = NotificationCompat.PRIORITY_MIN;
break;
case "default":
priority = NotificationCompat.PRIORITY_DEFAULT;
break;
default:
priority = NotificationCompat.PRIORITY_HIGH;
}
}
int visibility = NotificationCompat.VISIBILITY_PRIVATE;
final String visibilityString = bundle.getString("visibility");
if (visibilityString != null) {
switch (visibilityString.toLowerCase()) {
case "private":
visibility = NotificationCompat.VISIBILITY_PRIVATE;
break;
case "public":
visibility = NotificationCompat.VISIBILITY_PUBLIC;
break;
case "secret":
visibility = NotificationCompat.VISIBILITY_SECRET;
break;
default:
visibility = NotificationCompat.VISIBILITY_PRIVATE;
}
}
String channel_id = bundle.getString("channelId");
if(channel_id == null) {
channel_id = this.getNotificationDefaultChannelId();
}
NotificationCompat.Builder notification = new NotificationCompat.Builder(context, channel_id)
.setContentTitle(title)
.setTicker(bundle.getString("ticker"))
.setVisibility(visibility)
.setPriority(priority)
.setAutoCancel(bundle.getBoolean("autoCancel", true))
.setOnlyAlertOnce(bundle.getBoolean("onlyAlertOnce", false));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { // API 24 and higher
// Restore showing timestamp on Android 7+
// Source: https://developer.android.com/reference/android/app/Notification.Builder.html#setShowWhen(boolean)
boolean showWhen = bundle.getBoolean("showWhen", true);
notification.setShowWhen(showWhen);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { // API 26 and higher
// Changing Default mode of notification
notification.setDefaults(Notification.DEFAULT_LIGHTS);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) { // API 20 and higher
String group = bundle.getString("group");
if (group != null) {
notification.setGroup(group);
}
if (bundle.containsKey("groupSummary") || bundle.getBoolean("groupSummary")) {
notification.setGroupSummary(bundle.getBoolean("groupSummary"));
}
}
String numberString = bundle.getString("number");
if (numberString != null) {
notification.setNumber(Integer.parseInt(numberString));
}
// Small icon
int smallIconResId = 0;
String smallIcon = bundle.getString("smallIcon");
if (smallIcon != null && !smallIcon.isEmpty()) {
smallIconResId = res.getIdentifier(smallIcon, "mipmap", packageName);
} else if(smallIcon == null) {
smallIconResId = res.getIdentifier("ic_stat_notify_status", "drawable", packageName);
}
if (smallIconResId == 0) {
smallIconResId = res.getIdentifier("ic_launcher", "mipmap", packageName);
if (smallIconResId == 0) {
smallIconResId = android.R.drawable.ic_dialog_info;
}
}
notification.setSmallIcon(smallIconResId);
// Large icon
if(largeIconBitmap == null) {
int largeIconResId = 0;
String largeIcon = bundle.getString("largeIcon");
if (largeIcon != null && !largeIcon.isEmpty()) {
largeIconResId = res.getIdentifier(largeIcon, "mipmap", packageName);
} else if(largeIcon == null) {
largeIconResId = res.getIdentifier("ic_launcher", "mipmap", packageName);
}
// Before Lolipop there was no large icon for notifications.
if (largeIconResId != 0 && (largeIcon != null || Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)) {
largeIconBitmap = BitmapFactory.decodeResource(res, largeIconResId);
}
}
Bundle author = bundle.getBundle("notificationAuthor");
if (largeIconBitmap == null && author != null) {
String base64Image = author.getString("icon").split(",")[1];
byte[] decodedString = Base64.decode(base64Image, Base64.DEFAULT);
Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
notification.setLargeIcon(getCircleBitmap(decodedByte));
} else if (largeIconBitmap != null){
notification.setLargeIcon(largeIconBitmap);
}
String message = bundle.getString("message");
notification.setContentText(message);
String subText = bundle.getString("subText");
if (subText != null) {
notification.setSubText(subText);
}
String bigText = bundle.getString("bigText");
if (bigText == null) {
bigText = message;
}
NotificationCompat.Style style;
if(bigPictureBitmap != null) {
style = new NotificationCompat.BigPictureStyle()
.bigPicture(bigPictureBitmap)
.setBigContentTitle(title)
.setSummaryText(message);
} else {
style = new NotificationCompat.BigTextStyle().bigText(bigText);
}
notification.setStyle(style);
Intent intent = new Intent(context, intentClass);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
bundle.putBoolean("foreground", this.isApplicationInForeground());
bundle.putBoolean("userInteraction", true);
intent.putExtra("notification", bundle);
Uri soundUri = null;
if (!bundle.containsKey("playSound") || bundle.getBoolean("playSound")) {
String soundName = bundle.getString("soundName");
if (soundName == null) {
soundName = "default";
}
soundUri = getSoundUri(soundName);
notification.setSound(soundUri);
}
if (soundUri == null || Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
notification.setSound(null);
}
if (bundle.containsKey("ongoing") || bundle.getBoolean("ongoing")) {
notification.setOngoing(bundle.getBoolean("ongoing"));
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
notification.setCategory(NotificationCompat.CATEGORY_CALL);
String color = bundle.getString("color");
int defaultColor = -1;
if (color != null) {
notification.setColor(Color.parseColor(color));
} else if (defaultColor != -1) {
notification.setColor(defaultColor);
}
}
int notificationID = notificationIdString.hashCode();
notification.setContentIntent(createOnTapIntent(context, notificationID, bundle.getString("deepLink")))
.setDeleteIntent(createOnDismissedIntent(context, notificationID, bundle.getString("deepLink")));
NotificationManager notificationManager = notificationManager();
long[] vibratePattern = new long[]{0};
if (!bundle.containsKey("vibrate") || bundle.getBoolean("vibrate")) {
long vibration = bundle.containsKey("vibration") ? (long) bundle.getDouble("vibration") : DEFAULT_VIBRATION;
if (vibration == 0)
vibration = DEFAULT_VIBRATION;
vibratePattern = new long[]{0, vibration};
notification.setVibrate(vibratePattern);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// Define the shortcutId
String shortcutId = bundle.getString("shortcutId");
if (shortcutId != null) {
notification.setShortcutId(shortcutId);
}
Long timeoutAfter = (long) bundle.getDouble("timeoutAfter");
if (timeoutAfter != null && timeoutAfter >= 0) {
notification.setTimeoutAfter(timeoutAfter);
}
}
Long when = (long) bundle.getDouble("when");
if (when != null && when >= 0) {
notification.setWhen(when);
}
notification.setUsesChronometer(bundle.getBoolean("usesChronometer", false));
notification.setChannelId(channel_id);
JSONArray actionsArray = null;
try {
actionsArray = bundle.getString("actions") != null ? new JSONArray(bundle.getString("actions")) : null;
} catch (JSONException e) {
Log.e(LOG_TAG, "Exception while converting actions to JSON object.", e);
}
if (actionsArray != null) {
// No icon for now. The icon value of 0 shows no icon.
int icon = 0;
// Add button for each actions.
for (int i = 0; i < actionsArray.length(); i++) {
String action;
try {
action = actionsArray.getString(i);
} catch (JSONException e) {
Log.e(LOG_TAG, "Exception while getting action from actionsArray.", e);
continue;
}
Intent actionIntent = new Intent(context, PushNotificationActions.class);
actionIntent.setAction(packageName + ".ACTION_" + i);
actionIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
// Add "action" for later identifying which button gets pressed.
bundle.putString("action", action);
actionIntent.putExtra("notification", bundle);
actionIntent.setPackage(packageName);
PendingIntent pendingActionIntent = PendingIntent.getBroadcast(context, notificationID, actionIntent,
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
notification.addAction(new NotificationCompat.Action.Builder(icon, action, pendingActionIntent).build());
} else {
notification.addAction(icon, action, pendingActionIntent);
}
}
}
if (!(this.isApplicationInForeground() && bundle.getBoolean("ignoreInForeground"))) {
Notification info = notification.build();
info.defaults |= Notification.DEFAULT_LIGHTS;
if (bundle.containsKey("tag")) {
String tag = bundle.getString("tag");
notificationManager.notify(tag, notificationID, info);
} else {
notificationManager.notify(notificationID, info);
}
}
} catch (Exception e) {
Log.e(LOG_TAG, "failed to send push notification", e);
}
}
private boolean checkOrCreateChannel(NotificationManager manager, String channel_id, String channel_name, String channel_description, Uri soundUri, int importance, long[] vibratePattern, boolean showBadge) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
return false;
if (manager == null)
return false;
NotificationChannel channel = manager.getNotificationChannel(channel_id);
if (
channel == null && channel_name != null && channel_description != null ||
channel != null &&
(
channel_name != null && !channel.getName().equals(channel_name) ||
channel_description != null && !channel.getDescription().equals(channel_description)
)
) {
// If channel doesn't exist create a new one.
// If channel name or description is updated then update the existing channel.
channel = new NotificationChannel(channel_id, channel_name, importance);
channel.setDescription(channel_description);
channel.enableLights(true);
channel.enableVibration(vibratePattern != null);
channel.setVibrationPattern(vibratePattern);
channel.setShowBadge(showBadge);
if (soundUri != null) {
AudioAttributes audioAttributes = new AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setUsage(AudioAttributes.USAGE_NOTIFICATION)
.build();
channel.setSound(soundUri, audioAttributes);
} else {
channel.setSound(null, null);
}
manager.createNotificationChannel(channel);
return true;
}
return false;
}
public boolean createChannel(ReadableMap channelInfo) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
return false;
String channelId = channelInfo.getString("channelId");
String channelName = channelInfo.getString("channelName");
String channelDescription = channelInfo.hasKey("channelDescription") ? channelInfo.getString("channelDescription") : "";
String soundName = channelInfo.hasKey("soundName") ? channelInfo.getString("soundName") : "default";
int importance = channelInfo.hasKey("importance") ? channelInfo.getInt("importance") : 4;
boolean vibrate = channelInfo.hasKey("vibrate") && channelInfo.getBoolean("vibrate");
long[] vibratePattern = vibrate ? new long[] { DEFAULT_VIBRATION } : null;
boolean showBadge = channelInfo.hasKey("showBadge") && channelInfo.getBoolean("showBadge");
NotificationManager manager = notificationManager();
Uri soundUri = getSoundUri(soundName);
return checkOrCreateChannel(manager, channelId, channelName, channelDescription, soundUri, importance, vibratePattern, showBadge);
}
public String getNotificationDefaultChannelId() {
return this.CHANNEL_ID;
}
private Uri getSoundUri(String soundName) {
if (soundName == null || "default".equalsIgnoreCase(soundName)) {
return RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
} else {
// sound name can be full filename, or just the resource name.
// So the strings 'my_sound.mp3' AND 'my_sound' are accepted
// The reason is to make the iOS and android javascript interfaces compatible
int resId;
if (context.getResources().getIdentifier(soundName, "raw", context.getPackageName()) != 0) {
resId = context.getResources().getIdentifier(soundName, "raw", context.getPackageName());
} else {
soundName = soundName.substring(0, soundName.lastIndexOf('.'));
resId = context.getResources().getIdentifier(soundName, "raw", context.getPackageName());
}
return Uri.parse("android.resource://" + context.getPackageName() + "/" + resId);
}
}
public Class getMainActivityClass() {
String packageName = context.getPackageName();
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(packageName);
String className = launchIntent.getComponent().getClassName();
try {
return Class.forName(className);
} catch (ClassNotFoundException e) {
e.printStackTrace();
return null;
}
}
public boolean isApplicationInForeground() {
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<RunningAppProcessInfo> processInfos = activityManager.getRunningAppProcesses();
if (processInfos != null) {
for (RunningAppProcessInfo processInfo : processInfos) {
if (processInfo.processName.equals(context.getPackageName())
&& processInfo.importance == RunningAppProcessInfo.IMPORTANCE_FOREGROUND
&& processInfo.pkgList.length > 0) {
return true;
}
}
}
return false;
}
private Bitmap getCircleBitmap(Bitmap bitmap) {
final Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
bitmap.getHeight(), Bitmap.Config.ARGB_8888);
final Canvas canvas = new Canvas(output);
final int color = Color.RED;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
final RectF rectF = new RectF(rect);
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawOval(rectF, paint);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
bitmap.recycle();
return output;
}
private Person getPerson(Bundle bundle) {
String name = bundle.getString("name");
return new Person.Builder().setName(name).build();
}
private StatusMessage createMessage(Bundle data) {
Person author = getPerson(data.getBundle("notificationAuthor"));
long timeStampLongValue = (long) data.getDouble("timestamp");
return new StatusMessage(data.getString("id"), author, timeStampLongValue, data.getString("message"));
}
private PendingIntent createGroupOnDismissedIntent(Context context, int notificationId, String groupId, String deepLink) {
Intent intent = new Intent(ACTION_DELETE_NOTIFICATION);
intent.putExtra("im.status.ethereum.deepLink", deepLink);
intent.putExtra("im.status.ethereum.groupId", groupId);
return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, flag);
}
private PendingIntent createGroupOnTapIntent(Context context, int notificationId, String groupId, String deepLink) {
Intent intent = getOpenAppIntent(deepLink);
return PendingIntent.getActivity(context.getApplicationContext(), notificationId, intent, flag);
}
private PendingIntent createOnTapIntent(Context context, int notificationId, String deepLink) {
Intent intent = getOpenAppIntent(deepLink);
return PendingIntent.getActivity(context.getApplicationContext(), notificationId, intent, flag);
}
private PendingIntent createOnDismissedIntent(Context context, int notificationId, String deepLink) {
Intent intent = new Intent(ACTION_DELETE_NOTIFICATION);
intent.putExtra("im.status.ethereum.deepLink", deepLink);
return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, flag);
}
public void removeStatusMessage(Bundle bundle) {
String conversationId = bundle.getString("conversationId");
StatusMessageGroup group = this.messageGroups.get(conversationId);
NotificationManager notificationManager = notificationManager();
if (group == null) {
group = new StatusMessageGroup(conversationId);
}
this.messageGroups.put(conversationId, group);
String id = bundle.getString("id");
group.removeMessage(id);
this.showMessages(bundle);
}
public StatusMessageGroup getMessageGroup(String conversationId) {
return this.messageGroups.get(conversationId);
}
public void addStatusMessage(Bundle bundle) {
String conversationId = bundle.getString("conversationId");
StatusMessageGroup group = this.messageGroups.get(conversationId);
NotificationManager notificationManager = notificationManager();
if (group == null) {
group = new StatusMessageGroup(conversationId);
}
this.messageGroups.put(conversationId, group);
group.addMessage(createMessage(bundle));
this.showMessages(bundle);
}
public void showMessages(Bundle bundle) {
String conversationId = bundle.getString("conversationId");
StatusMessageGroup group = this.messageGroups.get(conversationId);
NotificationManager notificationManager = notificationManager();
NotificationCompat.MessagingStyle messagingStyle = new NotificationCompat.MessagingStyle("Me");
ArrayList<StatusMessage> messages = group.getMessages();
if (messages.size() == 0) {
notificationManager.cancel(conversationId.hashCode());
return;
}
for (int i = 0; i < messages.size(); i++) {
StatusMessage message = messages.get(i);
messagingStyle.addMessage(message.getText(),
message.getTimestamp(),
message.getAuthor());
}
if (bundle.getString("title") != null) {
messagingStyle.setConversationTitle(bundle.getString("title"));
}
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, CHANNEL_ID)
.setSmallIcon(R.drawable.ic_stat_notify_status)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
.setStyle(messagingStyle)
.setGroup(conversationId)
.setOnlyAlertOnce(true)
.setGroupSummary(true)
.setContentIntent(createGroupOnTapIntent(context, conversationId.hashCode(), conversationId, bundle.getString("deepLink")))
.setDeleteIntent(createGroupOnDismissedIntent(context, conversationId.hashCode(), conversationId, bundle.getString("deepLink")))
.setNumber(messages.size() + 1)
.setAutoCancel(true);
if (Build.VERSION.SDK_INT >= 21) {
builder.setVibrate(new long[0]);
}
notificationManager.notify(conversationId.hashCode(), builder.build());
}
class StatusMessageGroup {
private ArrayList<StatusMessage> messages;
private String id;
StatusMessageGroup(String id) {
this.id = id;
this.messages = new ArrayList<StatusMessage>();
}
public ArrayList<StatusMessage> getMessages() {
return messages;
}
public void addMessage(StatusMessage message) {
this.messages.add(message);
}
public void removeMessage(String id) {
ArrayList<StatusMessage> newMessages = new ArrayList<StatusMessage>();
for(StatusMessage message: this.messages) {
if(!message.id.equals(id)) {
newMessages.add(message);
}
}
this.messages = newMessages;
}
public String getId() {
return this.id;
}
}
class StatusMessage {
public Person getAuthor() {
return author;
}
public long getTimestamp() {
return timestamp;
}
public String getText() {
return text;
}
private String id;
private Person author;
private long timestamp;
private String text;
StatusMessage(String id, Person author, long timestamp, String text) {
this.id = id;
this.author = author;
this.timestamp = timestamp;
this.text = text;
}
}
private void removeGroup(String groupId) {
this.messageGroups.remove(groupId);
}
private void cleanGroup(String groupId) {
removeGroup(groupId);
if (messageGroups.size() == 0) {
notificationManager.cancelAll();
}
}
public void start() {
Log.e(LOG_TAG, "Starting Foreground Service");
Intent serviceIntent = new Intent(context, ForegroundService.class);
context.startService(serviceIntent);
this.registerBroadcastReceiver();
}
public void stop() {
Log.e(LOG_TAG, "Stopping Foreground Service");
//NOTE: we cancel all the current notifications, because the intents can't be used anymore
//since the broadcast receiver will be killed as well and won't be able to handle any intent
notificationManager.cancelAll();
Intent serviceIntent = new Intent(context, ForegroundService.class);
context.stopService(serviceIntent);
context.unregisterReceiver(notificationActionReceiver);
}
}
@@ -0,0 +1,750 @@
// https://github.com/zo0r/react-native-push-notification/blob/bedc8f646aab67d594f291449fbfa24e07b64fe8/android/src/main/
// java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java Copy-Paste with removed firebase
package im.status.ethereum.pushnotifications
import android.app.ActivityManager
import android.app.ActivityManager.RunningAppProcessInfo
import android.app.AlarmManager
import android.app.Application
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.BroadcastReceiver
import android.content.SharedPreferences
import android.content.pm.ApplicationInfo
import android.content.res.Resources
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Color
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.PorterDuff
import android.graphics.PorterDuffXfermode
import android.graphics.Rect
import android.graphics.RectF
import android.media.AudioAttributes
import android.media.RingtoneManager
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.service.notification.StatusBarNotification
import android.util.Log
import android.util.Base64
import androidx.annotation.RequiresApi
import androidx.core.app.NotificationCompat
import androidx.core.app.Person
import androidx.core.graphics.drawable.IconCompat
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.ReadableArray
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.bridge.WritableArray
import com.facebook.react.bridge.WritableMap
import org.json.JSONArray
import org.json.JSONException
import im.status.ethereum.module.R
import im.status.ethereum.pushnotifications.PushNotification.Companion.LOG_TAG
class PushNotificationHelper(private val context: Application, private val intentFilter: IntentFilter) {
companion object {
private const val DEFAULT_VIBRATION: Long = 300L
private const val CHANNEL_ID = "status-im-notifications"
const val ACTION_DELETE_NOTIFICATION = "im.status.ethereum.module.DELETE_NOTIFICATION"
const val ACTION_TAP_STOP = "im.status.ethereum.module.TAP_STOP"
}
private val flag: Int = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_IMMUTABLE
} else {
PendingIntent.FLAG_CANCEL_CURRENT
}
private val notificationManager: NotificationManager by lazy {
context.getSystemService(NotificationManager::class.java)
}
private val persons: MutableMap<String, Person> = mutableMapOf()
private val messageGroups: MutableMap<String, StatusMessageGroup> = mutableMapOf()
init {
registerBroadcastReceiver()
}
private val notificationActionReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
when (intent.action) {
ACTION_DELETE_NOTIFICATION -> {
intent.extras?.getString("im.status.ethereum.groupId")?.let { groupId ->
cleanGroup(groupId)
}
}
ACTION_TAP_STOP -> {
stop()
System.exit(0)
}
}
Log.e(LOG_TAG, "intent received: ${intent.action}")
}
}
private fun registerBroadcastReceiver() {
intentFilter.apply {
addAction(ACTION_DELETE_NOTIFICATION)
addAction(ACTION_TAP_STOP)
}
context.registerReceiver(notificationActionReceiver, intentFilter, Context.RECEIVER_EXPORTED)
Log.e(LOG_TAG, "Broadcast Receiver registered")
}
fun getOpenAppIntent(deepLink: String?): Intent? {
val packageName = context.packageName
val launchIntent = context.packageManager.getLaunchIntentForPackage(packageName)
val className = launchIntent?.component?.className ?: return null
return try {
val intentClass = Class.forName(className)
Intent(context, intentClass).apply {
addCategory(Intent.CATEGORY_BROWSABLE)
action = Intent.ACTION_VIEW
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
deepLink?.let { data = Uri.parse(it) }
}
} catch (e: ClassNotFoundException) {
e.printStackTrace()
null
}
}
fun invokeApp(bundle: Bundle?) {
val packageName = context.packageName
val launchIntent = context.packageManager.getLaunchIntentForPackage(packageName)
val className = launchIntent?.component?.className ?: return
try {
val activityClass = Class.forName(className)
Intent(context, activityClass).apply {
bundle?.let { putExtra("notification", it) }
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(this)
}
} catch (e: ClassNotFoundException) {
Log.e(LOG_TAG, "Class not found", e)
}
}
fun getMainActivityClass(): Class<*>? {
val packageName = context.packageName
val launchIntent = context.packageManager.getLaunchIntentForPackage(packageName)
val className = launchIntent?.component?.className ?: return null
return try {
Class.forName(className)
} catch (e: ClassNotFoundException) {
e.printStackTrace()
null
}
}
fun isApplicationInForeground(): Boolean {
val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
val processInfos = activityManager.runningAppProcesses ?: return false
return processInfos.any { processInfo ->
processInfo.processName == context.packageName &&
processInfo.importance == RunningAppProcessInfo.IMPORTANCE_FOREGROUND &&
processInfo.pkgList.isNotEmpty()
}
}
private fun getCircleBitmap(bitmap: Bitmap): Bitmap {
val output = Bitmap.createBitmap(bitmap.width, bitmap.height, Bitmap.Config.ARGB_8888)
val canvas = Canvas(output)
val paint = Paint().apply {
isAntiAlias = true
color = Color.RED
}
val rect = Rect(0, 0, bitmap.width, bitmap.height)
val rectF = RectF(rect)
canvas.drawARGB(0, 0, 0, 0)
canvas.drawOval(rectF, paint)
paint.xfermode = PorterDuffXfermode(PorterDuff.Mode.SRC_IN)
canvas.drawBitmap(bitmap, rect, rect, paint)
bitmap.recycle()
return output
}
// Represents a message in a Status conversation
data class StatusMessage(
val id: String,
val author: Person,
val timestamp: Long,
val text: String
)
// Represents a group of messages in a Status conversation
inner class StatusMessageGroup(val id: String) {
private val _messages = mutableListOf<StatusMessage>()
val messages: List<StatusMessage> get() = _messages.toList()
fun addMessage(message: StatusMessage) {
_messages.add(message)
}
fun removeMessage(id: String) {
_messages.removeAll { it.id == id }
}
}
private fun getPerson(bundle: Bundle): Person {
return Person.Builder()
.setName(bundle.getString("name"))
.build()
}
private fun createMessage(data: Bundle): StatusMessage {
val author = getPerson(data.getBundle("notificationAuthor") ?: Bundle())
val timeStampLongValue = data.getDouble("timestamp").toLong()
return StatusMessage(
id = data.getString("id") ?: "",
author = author,
timestamp = timeStampLongValue,
text = data.getString("message") ?: ""
)
}
private fun createGroupOnDismissedIntent(
context: Context,
notificationId: Int,
groupId: String,
deepLink: String?
): PendingIntent {
return Intent(ACTION_DELETE_NOTIFICATION).apply {
putExtra("im.status.ethereum.deepLink", deepLink)
putExtra("im.status.ethereum.groupId", groupId)
}.let { intent ->
PendingIntent.getBroadcast(
context.applicationContext,
notificationId,
intent,
flag
)
}
}
private fun createGroupOnTapIntent(
context: Context,
notificationId: Int,
groupId: String,
deepLink: String?
): PendingIntent {
return getOpenAppIntent(deepLink)?.let { intent ->
PendingIntent.getActivity(
context.applicationContext,
notificationId,
intent,
flag
)
} ?: throw IllegalStateException("Could not create open app intent")
}
private fun createOnTapIntent(
context: Context,
notificationId: Int,
deepLink: String?
): PendingIntent {
return getOpenAppIntent(deepLink)?.let { intent ->
PendingIntent.getActivity(
context.applicationContext,
notificationId,
intent,
flag
)
} ?: throw IllegalStateException("Could not create open app intent")
}
private fun createOnDismissedIntent(
context: Context,
notificationId: Int,
deepLink: String?
): PendingIntent {
return Intent(ACTION_DELETE_NOTIFICATION).apply {
putExtra("im.status.ethereum.deepLink", deepLink)
}.let { intent ->
PendingIntent.getBroadcast(
context.applicationContext,
notificationId,
intent,
flag
)
}
}
fun removeStatusMessage(bundle: Bundle) {
val conversationId = bundle.getString("conversationId") ?: return
val group = messageGroups.getOrPut(conversationId) {
StatusMessageGroup(conversationId)
}
bundle.getString("id")?.let { id ->
group.removeMessage(id)
}
showMessages(bundle)
}
fun getMessageGroup(conversationId: String): StatusMessageGroup? {
return messageGroups[conversationId]
}
fun addStatusMessage(bundle: Bundle) {
val conversationId = bundle.getString("conversationId") ?: return
val group = messageGroups.getOrPut(conversationId) {
StatusMessageGroup(conversationId)
}
group.addMessage(createMessage(bundle))
showMessages(bundle)
}
fun showMessages(bundle: Bundle) {
val conversationId = bundle.getString("conversationId") ?: return
val group = messageGroups[conversationId] ?: return
val messagingStyle = NotificationCompat.MessagingStyle("Me")
// If there are no messages, cancel the notification and return
if (group.messages.isEmpty()) {
notificationManager.cancel(conversationId.hashCode())
return
}
group.messages.forEach { message ->
messagingStyle.addMessage(
message.text,
message.timestamp,
message.author
)
}
// Set conversation title if available
bundle.getString("title")?.let { title ->
messagingStyle.conversationTitle = title
}
val builder = NotificationCompat.Builder(context, CHANNEL_ID).apply {
setSmallIcon(R.drawable.ic_stat_notify_status)
setPriority(NotificationCompat.PRIORITY_HIGH)
setCategory(NotificationCompat.CATEGORY_MESSAGE)
setStyle(messagingStyle)
setGroup(conversationId)
setOnlyAlertOnce(true)
setGroupSummary(true)
setContentIntent(createGroupOnTapIntent(context, conversationId.hashCode(), conversationId, bundle.getString("deepLink")))
setDeleteIntent(createGroupOnDismissedIntent(context, conversationId.hashCode(), conversationId, bundle.getString("deepLink")))
setNumber(group.messages.size + 1)
setAutoCancel(true)
// Set empty vibration pattern for Android 5.0 and above
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
setVibrate(LongArray(0))
}
}
// Show the notification
notificationManager.notify(conversationId.hashCode(), builder.build())
}
fun checkOrCreateChannel(
manager: NotificationManager?,
channelId: String,
channelName: String?,
channelDescription: String?,
soundUri: Uri?,
importance: Int,
vibratePattern: LongArray?,
showBadge: Boolean
): Boolean {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O || manager == null) {
return false
}
val existingChannel = manager.getNotificationChannel(channelId)
val shouldCreateOrUpdate = when {
// Channel doesn't exist and we have required info
existingChannel == null && channelName != null && channelDescription != null -> true
// Channel exists but needs update
existingChannel != null && (
(channelName != null && existingChannel.name != channelName) ||
(channelDescription != null && existingChannel.description != channelDescription)
) -> true
else -> false
}
if (shouldCreateOrUpdate) {
NotificationChannel(channelId, channelName, importance).apply {
description = channelDescription
enableLights(true)
enableVibration(vibratePattern != null)
vibrationPattern = vibratePattern
setShowBadge(showBadge)
// Configure sound
if (soundUri != null) {
val audioAttributes = AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setUsage(AudioAttributes.USAGE_NOTIFICATION)
.build()
setSound(soundUri, audioAttributes)
} else {
setSound(null, null)
}
manager.createNotificationChannel(this)
}
return true
}
return false
}
fun createChannel(channelInfo: ReadableMap): Boolean {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
return false
}
return checkOrCreateChannel(
manager = notificationManager,
channelId = channelInfo.getString("channelId") ?: return false,
channelName = channelInfo.getString("channelName"),
channelDescription = if (channelInfo.hasKey("channelDescription")) {
channelInfo.getString("channelDescription")
} else "",
soundUri = getSoundUri(
if (channelInfo.hasKey("soundName")) {
channelInfo.getString("soundName")
} else "default"
),
importance = if (channelInfo.hasKey("importance")) {
channelInfo.getInt("importance")
} else 4,
vibratePattern = if (channelInfo.hasKey("vibrate") && channelInfo.getBoolean("vibrate")) {
longArrayOf(DEFAULT_VIBRATION)
} else null,
showBadge = channelInfo.hasKey("showBadge") && channelInfo.getBoolean("showBadge")
)
}
fun getNotificationDefaultChannelId(): String = CHANNEL_ID
private fun getSoundUri(soundName: String?): Uri {
return when {
soundName == null || soundName.equals("default", ignoreCase = true) -> {
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
}
else -> {
val resources = context.resources
val packageName = context.packageName
val resId = when {
// Try to find the resource as is
resources.getIdentifier(soundName, "raw", packageName) != 0 -> {
resources.getIdentifier(soundName, "raw", packageName)
}
// Try without file extension
else -> {
val nameWithoutExtension = soundName.substringBeforeLast('.')
resources.getIdentifier(nameWithoutExtension, "raw", packageName)
}
}
Uri.parse("android.resource://$packageName/$resId")
}
}
}
private fun removeGroup(groupId: String) {
messageGroups.remove(groupId)
}
private fun cleanGroup(groupId: String) {
removeGroup(groupId)
if (messageGroups.isEmpty()) {
notificationManager.cancelAll()
}
}
fun start() {
Log.e(LOG_TAG, "Starting Foreground Service")
Intent(context, ForegroundService::class.java).also { serviceIntent ->
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(serviceIntent)
} else {
context.startService(serviceIntent)
}
}
registerBroadcastReceiver()
}
fun stop() {
Log.e(LOG_TAG, "Stopping Foreground Service")
// Cancel all current notifications since their intents won't be valid
// after the broadcast receiver is killed
notificationManager.cancelAll()
Intent(context, ForegroundService::class.java).also { serviceIntent ->
context.stopService(serviceIntent)
}
context.unregisterReceiver(notificationActionReceiver)
}
fun sendToNotificationCentre(bundle: Bundle) {
val aggregator = PushNotificationPicturesAggregator { largeIconImage, bigPictureImage ->
sendToNotificationCentreWithPicture(bundle, largeIconImage, bigPictureImage)
}
aggregator.apply {
setLargeIconUrl(context, bundle.getString("largeIconUrl"))
setBigPictureUrl(context, bundle.getString("bigPictureUrl"))
}
}
fun handleConversation(bundle: Bundle) {
if (bundle.getBoolean("deleted")) {
removeStatusMessage(bundle)
} else {
addStatusMessage(bundle)
}
}
fun clearMessageNotifications(conversationId: String) {
notificationManager.cancel(conversationId.hashCode())
cleanGroup(conversationId)
}
fun clearAllMessageNotifications() {
notificationManager.cancelAll()
}
fun sendToNotificationCentreWithPicture(
bundle: Bundle,
largeIconBitmap: Bitmap?,
bigPictureBitmap: Bitmap?
) {
try {
val intentClass = getMainActivityClass() ?: run {
Log.e(LOG_TAG, "No activity class found for the notification")
return
}
if (bundle.getBoolean("isConversation")) {
handleConversation(bundle)
return
}
if (bundle.getString("message") == null) {
Log.d(LOG_TAG, "Ignore this message if you sent data-only notification. " +
"Cannot send to notification centre because there is no 'message' field in: $bundle")
return
}
val notificationIdString = bundle.getString("id") ?: run {
Log.e(LOG_TAG, "No notification ID specified for the notification")
return
}
val resources = context.resources
val packageName = context.packageName
val title = bundle.getString("title") ?: run {
val appInfo = context.applicationInfo
context.packageManager.getApplicationLabel(appInfo).toString()
}
val priority = when (bundle.getString("priority")?.toLowerCase()) {
"max" -> NotificationCompat.PRIORITY_MAX
"high" -> NotificationCompat.PRIORITY_HIGH
"low" -> NotificationCompat.PRIORITY_LOW
"min" -> NotificationCompat.PRIORITY_MIN
"default" -> NotificationCompat.PRIORITY_DEFAULT
else -> NotificationCompat.PRIORITY_HIGH
}
val visibility = when (bundle.getString("visibility")?.toLowerCase()) {
"private" -> NotificationCompat.VISIBILITY_PRIVATE
"public" -> NotificationCompat.VISIBILITY_PUBLIC
"secret" -> NotificationCompat.VISIBILITY_SECRET
else -> NotificationCompat.VISIBILITY_PRIVATE
}
val channelId = bundle.getString("channelId") ?: getNotificationDefaultChannelId()
NotificationCompat.Builder(context, channelId).apply {
setContentTitle(title)
setTicker(bundle.getString("ticker"))
setVisibility(visibility)
setPriority(priority)
setAutoCancel(bundle.getBoolean("autoCancel", true))
setOnlyAlertOnce(bundle.getBoolean("onlyAlertOnce", false))
// Configure notification based on Android version
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
setShowWhen(bundle.getBoolean("showWhen", true))
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
setDefaults(Notification.DEFAULT_LIGHTS)
}
// Handle group settings for Android KitKat Watch and above
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
bundle.getString("group")?.let { group ->
setGroup(group)
}
if (bundle.containsKey("groupSummary") || bundle.getBoolean("groupSummary")) {
setGroupSummary(bundle.getBoolean("groupSummary"))
}
}
// Set notification number if provided
bundle.getString("number")?.toIntOrNull()?.let { number ->
setNumber(number)
}
val smallIconResId = findSmallIconResourceId(resources, packageName, bundle)
setSmallIcon(smallIconResId)
configureLargeIcon(this, largeIconBitmap, bundle, resources, packageName)
val message = bundle.getString("message") ?: ""
setContentText(message)
bundle.getString("subText")?.let { subText ->
setSubText(subText)
}
val bigText = bundle.getString("bigText") ?: message
val style = when {
bigPictureBitmap != null -> NotificationCompat.BigPictureStyle()
.bigPicture(bigPictureBitmap)
.setBigContentTitle(title)
.setSummaryText(message)
else -> NotificationCompat.BigTextStyle().bigText(bigText)
}
setStyle(style)
val notificationId = notificationIdString.hashCode()
setContentIntent(createOnTapIntent(context, notificationId, bundle.getString("deepLink")))
setDeleteIntent(createOnDismissedIntent(context, notificationId, bundle.getString("deepLink")))
configureSoundAndVibration(this, bundle)
setOngoing(bundle.getBoolean("ongoing", false))
// Handle color for Lollipop and above
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
setCategory(NotificationCompat.CATEGORY_CALL)
bundle.getString("color")?.let { color ->
setColor(Color.parseColor(color))
}
}
// Finally show the notification if conditions are met
if (!(isApplicationInForeground() && bundle.getBoolean("ignoreInForeground"))) {
val notification = build()
notification.defaults = notification.defaults or Notification.DEFAULT_LIGHTS
if (bundle.containsKey("tag")) {
notificationManager.notify(bundle.getString("tag"), notificationId, notification)
} else {
notificationManager.notify(notificationId, notification)
}
}
}
} catch (e: Exception) {
Log.e(LOG_TAG, "Failed to send push notification", e)
}
}
private fun findSmallIconResourceId(resources: Resources, packageName: String, bundle: Bundle): Int {
val smallIcon = bundle.getString("smallIcon")
return when {
!smallIcon.isNullOrEmpty() ->
resources.getIdentifier(smallIcon, "mipmap", packageName)
smallIcon == null ->
resources.getIdentifier("ic_stat_notify_status", "drawable", packageName)
else -> {
val defaultIcon = resources.getIdentifier("ic_launcher", "mipmap", packageName)
defaultIcon.takeIf { it != 0 } ?: android.R.drawable.ic_dialog_info
}
}
}
private fun configureLargeIcon(
builder: NotificationCompat.Builder,
largeIconBitmap: Bitmap?,
bundle: Bundle,
resources: Resources,
packageName: String
) {
var finalLargeIcon = largeIconBitmap
if (finalLargeIcon == null) {
val largeIcon = bundle.getString("largeIcon")
val largeIconResId = when {
!largeIcon.isNullOrEmpty() ->
resources.getIdentifier(largeIcon, "mipmap", packageName)
largeIcon == null ->
resources.getIdentifier("ic_launcher", "mipmap", packageName)
else -> 0
}
if (largeIconResId != 0 && (largeIcon != null || Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)) {
finalLargeIcon = BitmapFactory.decodeResource(resources, largeIconResId)
}
}
bundle.getBundle("notificationAuthor")?.getString("icon")?.let { icon ->
val base64Image = icon.split(",")[1]
val decodedString = Base64.decode(base64Image, Base64.DEFAULT)
val decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.size)
builder.setLargeIcon(getCircleBitmap(decodedByte))
} ?: finalLargeIcon?.let { icon ->
builder.setLargeIcon(icon)
}
}
private fun configureSoundAndVibration(
builder: NotificationCompat.Builder,
bundle: Bundle
) {
var soundUri: Uri? = null
if (!bundle.containsKey("playSound") || bundle.getBoolean("playSound")) {
val soundName = bundle.getString("soundName") ?: "default"
soundUri = getSoundUri(soundName)
builder.setSound(soundUri)
}
if (soundUri == null || Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
builder.setSound(null)
}
if (!bundle.containsKey("vibrate") || bundle.getBoolean("vibrate")) {
val vibration = if (bundle.containsKey("vibration")) {
bundle.getDouble("vibration").toLong()
} else DEFAULT_VIBRATION
val finalVibration = if (vibration == 0L) DEFAULT_VIBRATION else vibration
builder.setVibrate(longArrayOf(0, finalVibration))
}
}
}
@@ -1,86 +0,0 @@
package im.status.ethereum.pushnotifications;
import android.os.Build;
import android.app.Application;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Set;
import static im.status.ethereum.pushnotifications.PushNotification.LOG_TAG;
class PushNotificationJsDelivery {
private ReactContext reactContext;
PushNotificationJsDelivery(ReactContext context){
reactContext = context;
}
String convertJSON(Bundle bundle) {
try {
JSONObject json = convertJSONObject(bundle);
return json.toString();
} catch (JSONException e) {
return null;
}
}
// a Bundle is not a map, so we have to convert it explicitly
private JSONObject convertJSONObject(Bundle bundle) throws JSONException {
JSONObject json = new JSONObject();
Set<String> keys = bundle.keySet();
for (String key : keys) {
Object value = bundle.get(key);
if (value instanceof Bundle) {
json.put(key, convertJSONObject((Bundle)value));
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
json.put(key, JSONObject.wrap(value));
} else {
json.put(key, value);
}
}
return json;
}
void notifyNotification(Bundle bundle) {
String bundleString = convertJSON(bundle);
WritableMap params = Arguments.createMap();
params.putString("dataJSON", bundleString);
sendEvent("remoteNotificationReceived", params);
}
void notifyNotificationAction(Bundle bundle) {
String bundleString = convertJSON(bundle);
WritableMap params = Arguments.createMap();
params.putString("dataJSON", bundleString);
sendEvent("notificationActionReceived", params);
}
void sendEvent(String eventName, Object params) {
if (reactContext.hasActiveCatalystInstance()) {
reactContext
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit(eventName, params);
}
}
}
@@ -0,0 +1,93 @@
package im.status.ethereum.pushnotifications
import android.os.Build
import android.app.Application
import android.app.NotificationManager
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.util.Log
import com.facebook.react.bridge.ReactContext
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.WritableMap
import com.facebook.react.modules.core.DeviceEventManagerModule
import org.json.JSONException
import org.json.JSONObject
import im.status.ethereum.pushnotifications.PushNotification.Companion.LOG_TAG
class PushNotificationJsDelivery(
private val reactContext: ReactContext
) {
/**
* Converts a Bundle to its JSON string representation.
* Returns null if conversion fails.
*/
fun convertJSON(bundle: Bundle): String? {
return try {
convertJSONObject(bundle).toString()
} catch (e: JSONException) {
null
}
}
/**
* Converts a Bundle to a JSONObject, handling nested bundles and different value types.
* This explicit conversion is necessary because Bundle is not a standard map.
*/
@Throws(JSONException::class)
private fun convertJSONObject(bundle: Bundle): JSONObject {
return JSONObject().apply {
// Using Kotlin's for loop syntax and 'apply' scope function
bundle.keySet().forEach { key ->
bundle.get(key)?.let { value ->
when (value) {
is Bundle -> put(key, convertJSONObject(value))
else -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
put(key, JSONObject.wrap(value))
} else {
put(key, value)
}
}
}
}
}
}
/**
* Notifies about a received remote notification by sending an event to JavaScript
*/
fun notifyNotification(bundle: Bundle) {
convertJSON(bundle)?.let { bundleString ->
Arguments.createMap().apply {
putString("dataJSON", bundleString)
sendEvent("remoteNotificationReceived", this)
}
}
}
/**
* Notifies about a notification action by sending an event to JavaScript
*/
fun notifyNotificationAction(bundle: Bundle) {
convertJSON(bundle)?.let { bundleString ->
Arguments.createMap().apply {
putString("dataJSON", bundleString)
sendEvent("notificationActionReceived", this)
}
}
}
/**
* Sends an event to JavaScript if there's an active Catalyst instance
*/
fun sendEvent(eventName: String, params: Any) {
if (reactContext.hasActiveCatalystInstance()) {
reactContext
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
.emit(eventName, params)
}
}
}
@@ -1,27 +0,0 @@
package im.status.ethereum.pushnotifications;
import im.status.ethereum.pushnotifications.PushNotification;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.Collections;
import java.util.List;
public class PushNotificationPackage implements ReactPackage {
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Collections.<NativeModule>singletonList(new PushNotification(reactContext));
}
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
}
@@ -0,0 +1,24 @@
package im.status.ethereum.pushnotifications
import im.status.ethereum.pushnotifications.PushNotification
import com.facebook.react.ReactPackage
import com.facebook.react.bridge.JavaScriptModule
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager
class PushNotificationPackage : ReactPackage {
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
return listOf(PushNotification(reactContext))
}
// Note: This function is deprecated in newer versions of React Native
// but kept for backwards compatibility
fun createJSModules(): List<Class<out JavaScriptModule>> {
return emptyList()
}
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
return emptyList()
}
}
@@ -1,136 +0,0 @@
package im.status.ethereum.pushnotifications;
import androidx.annotation.Nullable;
import com.facebook.common.executors.CallerThreadExecutor;
import com.facebook.common.references.CloseableReference;
import com.facebook.datasource.DataSource;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.common.Priority;
import com.facebook.imagepipeline.core.ImagePipeline;
import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber;
import com.facebook.imagepipeline.image.CloseableImage;
import com.facebook.imagepipeline.request.ImageRequest;
import com.facebook.imagepipeline.request.ImageRequestBuilder;
import android.util.Log;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import java.util.concurrent.atomic.AtomicInteger;
import static im.status.ethereum.pushnotifications.PushNotification.LOG_TAG;
public class PushNotificationPicturesAggregator {
interface Callback {
public void call(Bitmap largeIconImage, Bitmap bigPictureImage);
}
private AtomicInteger count = new AtomicInteger(0);
private Bitmap largeIconImage;
private Bitmap bigPictureImage;
private Callback callback;
public PushNotificationPicturesAggregator(Callback callback) {
this.callback = callback;
}
public void setBigPicture(Bitmap bitmap) {
this.bigPictureImage = bitmap;
this.finished();
}
public void setBigPictureUrl(Context context, String url) {
if(null == url) {
this.setBigPicture(null);
return;
}
Uri uri = null;
try {
uri = Uri.parse(url);
} catch(Exception ex) {
Log.e(LOG_TAG, "Failed to parse bigPictureUrl", ex);
this.setBigPicture(null);
return;
}
final PushNotificationPicturesAggregator aggregator = this;
this.downloadRequest(context, uri, new BaseBitmapDataSubscriber() {
@Override
public void onNewResultImpl(@Nullable Bitmap bitmap) {
aggregator.setBigPicture(bitmap);
}
@Override
public void onFailureImpl(DataSource dataSource) {
aggregator.setBigPicture(null);
}
});
}
public void setLargeIcon(Bitmap bitmap) {
this.largeIconImage = bitmap;
this.finished();
}
public void setLargeIconUrl(Context context, String url) {
if(null == url) {
this.setLargeIcon(null);
return;
}
Uri uri = null;
try {
uri = Uri.parse(url);
} catch(Exception ex) {
Log.e(LOG_TAG, "Failed to parse largeIconUrl", ex);
this.setLargeIcon(null);
return;
}
final PushNotificationPicturesAggregator aggregator = this;
this.downloadRequest(context, uri, new BaseBitmapDataSubscriber() {
@Override
public void onNewResultImpl(@Nullable Bitmap bitmap) {
aggregator.setLargeIcon(bitmap);
}
@Override
public void onFailureImpl(DataSource dataSource) {
aggregator.setLargeIcon(null);
}
});
}
private void downloadRequest(Context context, Uri uri, BaseBitmapDataSubscriber subscriber) {
ImageRequest imageRequest = ImageRequestBuilder
.newBuilderWithSource(uri)
.setRequestPriority(Priority.HIGH)
.setLowestPermittedRequestLevel(ImageRequest.RequestLevel.FULL_FETCH)
.build();
if(!Fresco.hasBeenInitialized()) {
Fresco.initialize(context);
}
DataSource<CloseableReference<CloseableImage>> dataSource = Fresco.getImagePipeline().fetchDecodedImage(imageRequest, context);
dataSource.subscribe(subscriber, CallerThreadExecutor.getInstance());
}
private void finished() {
synchronized(this.count) {
int val = this.count.incrementAndGet();
if(val >= 2 && this.callback != null) {
this.callback.call(this.largeIconImage, this.bigPictureImage);
}
}
}
}

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