Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
Merge branch 'develop' into fix/LIVE-2089-welcome-screen-polish
Browse files Browse the repository at this point in the history
  • Loading branch information
ofreyssinet-ledger authored May 2, 2022
2 parents 7818504 + b0839d5 commit 21a5a3e
Show file tree
Hide file tree
Showing 287 changed files with 226 additions and 31,039 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,20 @@ It communicates with the [Ledger Nano X](https://www.ledger.com/pages/ledger-nan

- Node LTS version
- Yarn 1.10.1 or above
- [Full React Native environment setup instructions here, **under "React Native CLI Quickstart" tab**](https://reactnative.dev/docs/environment-setup)

### iOS

- XCode
- Ruby 2.6.8 or above. The macOS built-in Ruby [does not work properly for installing dependencies of the iOS app](https://jeffreymorgan.io/articles/ruby-on-macos-with-rvm/), you have to install Ruby with for instance [Homebrew](https://brew.sh/) or [rvm](https://rvm.io/rvm/install) and make sure that `which ruby` points to that newly installed Ruby.

### Android

- Android Studio
- JDK 11
- Required SDK tools: (go to Android Studio > Tools > SDK Manager > SDK Tools > check "Show Package Details" at the bottom right)
- Android NDK 21.4.7075529 (in case this doc is outdated, check the version specified as `ndkVersion` in `android/build.gradle`)
- CMake 3.10.2

## Scripts

Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ android {
multiDexEnabled true
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 36176143
versionCode 36176144
versionName "3.0.8"
resValue "string", "build_config_package", "com.ledger.live"
testBuildType System.getProperty('testBuildType', 'debug')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@

public class MainApplication extends Application implements ReactApplication {

static {
try {
System.loadLibrary("ledger-core");
} catch (UnsatisfiedLinkError e) {
System.err.println("ledger-core native library failed to load: " + e);
System.exit(1);
}
}

private final ReactNativeHost mReactNativeHost =
new ReactNativeHostWrapper(this, new ReactNativeHost(this) {
@Override
Expand Down
3 changes: 3 additions & 0 deletions fastlane/.env.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ENVFILE=.env.staging
APP_IDENTIFIER="com.ledger.live.dev.staging"
APP_NAME="LL DEV"
37 changes: 26 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,29 @@ import { getEnabled } from "./src/components/HookSentry";
import logReport from "./src/log-report";
import pkg from "./package.json";

const blacklistErrorName = [
"NetworkDown",
// we exclude errors related to user's environment, not fixable by us
const excludedErrorName = [
// networking conditions
"DisconnectedError",
"Network Error",
"NetworkDown",
"NotConnectedError",
"TimeoutError",
"WebsocketConnectionError",
"DisconnectedDeviceDuringOperation",
// bad usage of device
"BleError",
"EthAppPleaseEnableContractData",
"CantOpenDevice",
"DisconnectedDeviceDuringOperation",
"PairingFailed",
];
const blacklistErrorDescription = [
const excludedErrorDescription = [
// networking
/timeout of .* exceeded/,
// base usage of device
/Device .* was disconnected/,
"Invalid channel",
// others
"Transaction signing request was rejected by the user",
];

Expand All @@ -40,16 +55,16 @@ if (Config.SENTRY_DSN && !__DEV__ && !Config.MOCK) {
// NB we do not need to explicitly set the release. we let the native side infers it.
// release: `com.ledger.live@${pkg.version}+${VersionNumber.buildVersion}`,
// dist: String(VersionNumber.buildVersion),
sampleRate: 0.05,
tracesSampleRate: 0.001,
sampleRate: 0.2,
tracesSampleRate: 0.02,
integrations: [
new Sentry.ReactNativeTracing({
routingInstrumentation,
}),
],
beforeSend(event: any) {
if (!getEnabled()) return null;
// If the error matches blacklistErrorName or blacklistErrorDescription,
// If the error matches excludedErrorName or excludedErrorDescription,
// we will not send it to Sentry.
if (event && typeof event === "object") {
const { exception } = event;
Expand All @@ -59,21 +74,21 @@ if (Config.SENTRY_DSN && !__DEV__ && !Config.MOCK) {
Array.isArray(exception.values)
) {
const { values } = exception;
const shouldBlacklist = values.some(item => {
const shouldExclude = values.some(item => {
if (item && typeof item === "object") {
const { type, value } = item;
return (typeof type === "string" &&
blacklistErrorName.some(pattern => type.match(pattern))) ||
excludedErrorName.some(pattern => type.match(pattern))) ||
(typeof value === "string" &&
blacklistErrorDescription.some(pattern =>
excludedErrorDescription.some(pattern =>
value.match(pattern),
))
? event
: null;
}
return null;
});
if (shouldBlacklist) return null;
if (shouldExclude) return null;
}
}

Expand Down
4 changes: 0 additions & 4 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ target 'ledgerlivemobile' do
:hermes_enabled => true
)

pod 'djinni_objc', :path => '../node_modules/@ledgerhq/react-native-ledger-core'
pod 'ledger-core-objc', :path => '../node_modules/@ledgerhq/react-native-ledger-core'
pod 'RNLibLedgerCore', :path => '../node_modules/@ledgerhq/react-native-ledger-core'

pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text', :modular_headers => true

target 'ledgerlivemobileTests' do
Expand Down
24 changes: 3 additions & 21 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ PODS:
- Analytics (4.1.6)
- boost (1.76.0)
- CocoaAsyncSocket (7.6.5)
- djinni_objc (4.19.1)
- DoubleConversion (1.1.6)
- EXApplication (4.0.2):
- ExpoModulesCore
Expand Down Expand Up @@ -143,8 +142,6 @@ PODS:
- GoogleUtilities/Logger
- hermes-engine (0.9.0)
- InputMask (6.1.0)
- ledger-core-objc (4.19.1):
- djinni_objc
- libevent (2.1.12)
- libwebp (1.2.1):
- libwebp/demux (= 1.2.1)
Expand Down Expand Up @@ -524,9 +521,6 @@ PODS:
- React-Core
- RNKeychain (7.0.0):
- React-Core
- RNLibLedgerCore (4.19.1):
- ledger-core-objc
- React
- RNLocalize (2.2.1):
- React-Core
- RNOS (1.2.6):
Expand Down Expand Up @@ -562,7 +556,7 @@ PODS:
- RNScreens (3.12.0):
- React-Core
- React-RCTImage
- RNSentry (3.4.0):
- RNSentry (3.4.1):
- React-Core
- Sentry (= 7.11.0)
- RNShare (6.5.0):
Expand Down Expand Up @@ -593,7 +587,6 @@ PODS:

DEPENDENCIES:
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
- "djinni_objc (from `../node_modules/@ledgerhq/react-native-ledger-core`)"
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- EXApplication (from `../node_modules/expo-application/ios`)
- EXBarCodeScanner (from `../node_modules/expo-barcode-scanner/ios`)
Expand Down Expand Up @@ -631,7 +624,6 @@ DEPENDENCIES:
- FlipperKit/SKIOSNetworkPlugin (= 0.99.0)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- hermes-engine (~> 0.9.0)
- "ledger-core-objc (from `../node_modules/@ledgerhq/react-native-ledger-core`)"
- libevent (~> 2.1.12)
- lottie-ios (from `../node_modules/lottie-ios`)
- lottie-react-native (from `../node_modules/lottie-react-native`)
Expand Down Expand Up @@ -690,7 +682,6 @@ DEPENDENCIES:
- "RNFBRemoteConfig (from `../node_modules/@react-native-firebase/remote-config`)"
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNKeychain (from `../node_modules/react-native-keychain`)
- "RNLibLedgerCore (from `../node_modules/@ledgerhq/react-native-ledger-core`)"
- RNLocalize (from `../node_modules/react-native-localize`)
- RNOS (from `../node_modules/react-native-os`)
- RNReanimated (from `../node_modules/react-native-reanimated`)
Expand Down Expand Up @@ -742,8 +733,6 @@ SPEC REPOS:
EXTERNAL SOURCES:
boost:
:podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
djinni_objc:
:path: "../node_modules/@ledgerhq/react-native-ledger-core"
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
EXApplication:
Expand Down Expand Up @@ -774,8 +763,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/React/FBReactNativeSpec"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
ledger-core-objc:
:path: "../node_modules/@ledgerhq/react-native-ledger-core"
lottie-ios:
:path: "../node_modules/lottie-ios"
lottie-react-native:
Expand Down Expand Up @@ -884,8 +871,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-gesture-handler"
RNKeychain:
:path: "../node_modules/react-native-keychain"
RNLibLedgerCore:
:path: "../node_modules/@ledgerhq/react-native-ledger-core"
RNLocalize:
:path: "../node_modules/react-native-localize"
RNOS:
Expand All @@ -912,7 +897,6 @@ SPEC CHECKSUMS:
Analytics: eefe524436f904b8bb3f8c8c3425280e43b34efc
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
djinni_objc: 54ab066f337b37aceaba6d020b1e6964eead00ba
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
EXApplication: 54fe5bd6268d697771645e8f1aef8b806a65247a
EXBarCodeScanner: e5ca0062d8ad1c4c1d2e386d6a308d5a32213020
Expand Down Expand Up @@ -948,7 +932,6 @@ SPEC CHECKSUMS:
GoogleUtilities: e0913149f6b0625b553d70dae12b49fc62914fd1
hermes-engine: bf7577d12ac6ccf53ab8b5af3c6ccf0dd8458c5c
InputMask: 71d291dc54d2deaeac6512afb6ec2304228c0bb7
ledger-core-objc: cc0290f7cf787ddf1d6a8f8e086acf55f24523a4
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
libwebp: 98a37e597e40bfdb4c911fc98f2c53d0b12d05fc
lottie-ios: c058aeafa76daa4cf64d773554bccc8385d0150e
Expand Down Expand Up @@ -1009,12 +992,11 @@ SPEC CHECKSUMS:
RNFBRemoteConfig: 64d3a17b53c865cdb6a7af5fe28084d1b964a9fb
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNKeychain: f75b8c8b2f17d3b2aa1f25b4a0ac5b83d947ff8f
RNLibLedgerCore: 6d8a54abc2dc2ffa38c33fbb70d5247b97a0091e
RNLocalize: cbcb55d0e19c78086ea4eea20e03fe8000bbbced
RNOS: 6f2f9a70895bbbfbdad7196abd952e7b01d45027
RNReanimated: 32c91e28f5780937b8efc07ddde1bab8d373fe0b
RNScreens: 2559f98b0835103cbef3b26ba77fa61d4bb37ae7
RNSentry: ec3c033c13bcb65c79f19d54ca54c514d1832bb5
RNSentry: fbbdcd7213058e3de5fbaa452b25a06a16b4b382
RNShare: 047d42214f875d731bde73a2b67418638af85ad9
RNSVG: 551acb6562324b1d52a4e0758f7ca0ec234e278f
RNVectorIcons: 31cebfcf94e8cf8686eb5303ae0357da64d7a5a4
Expand All @@ -1026,6 +1008,6 @@ SPEC CHECKSUMS:
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb

PODFILE CHECKSUM: 46b645b965d32ccb1c1a230762f88cb783bf4771
PODFILE CHECKSUM: 706678d86edbba64cabd5f097814715fd00a1b59

COCOAPODS: 1.11.2
10 changes: 0 additions & 10 deletions ios/ledgerlivemobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -587,14 +587,12 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile-frameworks.sh",
"${PODS_ROOT}/../../node_modules/@ledgerhq/react-native-ledger-core/ios/Frameworks/universal/ledger-core.framework",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework/double-conversion",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/hermes.framework/hermes",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ledger-core.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/double-conversion.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework",
Expand Down Expand Up @@ -648,11 +646,9 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile-frameworks.sh",
"${PODS_ROOT}/../../node_modules/@ledgerhq/react-native-ledger-core/ios/Frameworks/universal/ledger-core.framework",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL/OpenSSL.framework/OpenSSL",
);
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ledger-core.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -720,7 +716,6 @@
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/@ledgerhq/react-native-ledger-core/support-lib/**",
"$(SRCROOT)/../node_modules/@segment/analytics-react-native/ios/RNAnalytics",
);
INFOPLIST_FILE = ledgerlivemobileTests/Info.plist;
Expand Down Expand Up @@ -756,7 +751,6 @@
DEVELOPMENT_TEAM = X6LFS5BQKN;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/@ledgerhq/react-native-ledger-core/support-lib/**",
"$(SRCROOT)/../node_modules/@segment/analytics-react-native/ios/RNAnalytics",
);
INFOPLIST_FILE = ledgerlivemobileTests/Info.plist;
Expand Down Expand Up @@ -805,7 +799,6 @@
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/@ledgerhq/react-native-ledger-core/support-lib/**",
"$(SRCROOT)/../node_modules/@segment/analytics-react-native/ios/RNAnalytics",
);
INFOPLIST_FILE = ledgerlivemobile/Info.plist;
Expand Down Expand Up @@ -858,7 +851,6 @@
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/@ledgerhq/react-native-ledger-core/support-lib/**",
"$(SRCROOT)/../node_modules/@segment/analytics-react-native/ios/RNAnalytics",
);
INFOPLIST_FILE = ledgerlivemobile/Info.plist;
Expand Down Expand Up @@ -967,7 +959,6 @@
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/@ledgerhq/react-native-ledger-core/support-lib/**",
"$(SRCROOT)/../node_modules/@segment/analytics-react-native/ios/RNAnalytics",
);
INFOPLIST_FILE = ledgerlivemobile/Info.plist;
Expand Down Expand Up @@ -1004,7 +995,6 @@
DEVELOPMENT_TEAM = X6LFS5BQKN;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/@ledgerhq/react-native-ledger-core/support-lib/**",
"$(SRCROOT)/../node_modules/@segment/analytics-react-native/ios/RNAnalytics",
);
INFOPLIST_FILE = ledgerlivemobileTests/Info.plist;
Expand Down
Loading

0 comments on commit 21a5a3e

Please sign in to comment.