Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile: Enhancements (Graph Loader, Activity Filter, Remaining Currency Support, Scripts update) #396

Merged
merged 16 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ android {
applicationId "com.fetchai.wallet"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 20
versionName "1.0.2"
versionCode 22
versionName "1.0.3"

missingDimensionStrategy 'react-native-camera', 'general'
}
Expand Down
7 changes: 7 additions & 0 deletions packages/mobile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ import * as Sentry from "@sentry/react-native";
const App = require("./src/app").App;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const appName = require("./app.json").name;
export const routingInstrumentation =
new Sentry.ReactNavigationInstrumentation();

Sentry.init({
dsn: process.env["SENTRY_DSN"] || "",
integrations: [
new Sentry.ReactNativeTracing({
routingInstrumentation,
}),
],
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
tracesSampleRate: 1.0,
Expand Down
15 changes: 8 additions & 7 deletions packages/mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ PODS:
- ExpoModulesCore
- Expo (49.0.5):
- ExpoModulesCore
- ExpoAppleAuthentication (6.1.0):
- ExpoAppleAuthentication (6.4.2):
- ExpoModulesCore
- ExpoBlur (12.8.0):
- ExpoModulesCore
Expand Down Expand Up @@ -533,9 +533,10 @@ PODS:
- React-RCTImage
- RNScrypt (1.2.1):
- React
- RNSentry (5.26.0):
- RNSentry (5.32.0):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- Sentry/HybridSDK (= 8.31.1)
- Sentry/HybridSDK (= 8.36.0)
- RNSVG (13.10.0):
- React-Core
- SDWebImage (5.11.1):
Expand All @@ -544,7 +545,7 @@ PODS:
- SDWebImageWebPCoder (0.8.5):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.10)
- Sentry/HybridSDK (8.31.1)
- Sentry/HybridSDK (8.36.0)
- SocketRocket (0.6.1)
- SSZipArchive (2.2.3)
- Yoga (1.14.0)
Expand Down Expand Up @@ -850,7 +851,7 @@ SPEC CHECKSUMS:
EXImageLoader: 34b214f9387e98f3c73989f15d8d5b399c9ab3f7
EXLocation: e5dd52bdf61ccb6153c9e46ad4cb2686c96a35f9
Expo: f2485e8fab9988e5dcee34159df5e475c9c3730c
ExpoAppleAuthentication: 7bdf1a2962ebfe9b00eb4183a17b78d736e57185
ExpoAppleAuthentication: 265219fa0ba1110872079f55f56686b9737b0065
ExpoBlur: 2e733ec3aa76653040b29a833984f128a293295a
ExpoClipboard: ddd3ecf4af93c003667dab75a0f2ed3ae4f73d85
ExpoCrypto: a382ab9a2fa91f0b511ce1fe4d6baecee40a1615
Expand Down Expand Up @@ -918,11 +919,11 @@ SPEC CHECKSUMS:
RNReanimated: c2027c397233801d4aceb7375e000ac87ec2e67d
RNScreens: 6a8a3c6b808aa48dca1780df7b73ea524f602c63
RNScrypt: 95fdef077b482e9fdf8a761120cb69d129ef4016
RNSentry: 601e5dbb9b3fbec6bf6a6e8c8bcc249835494744
RNSentry: bec881f5b16c6b4df4d6f554326ca979e08d6ba2
RNSVG: 80584470ff1ffc7994923ea135a3e5ad825546b9
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
Sentry: 9c1188876ea1291d1a9db4b38c3f17ebd8e6985e
Sentry: f8374b5415bc38dfb5645941b3ae31230fbeae57
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9
Yoga: 6f5ab94cd8b1ecd04b6e973d0bc583ede2a598cc
Expand Down
24 changes: 9 additions & 15 deletions packages/mobile/ios/mobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1540;
LastUpgradeCheck = 1600;
TargetAttributes = {
00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2;
Expand Down Expand Up @@ -784,7 +784,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 2C4F05F9006552DF92ED58F0 /* Pods-mobile-mobileTests.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = T27QU97WCQ;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand Down Expand Up @@ -814,7 +813,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 4D6FEADC1FE4A36A7A6FDAD5 /* Pods-mobile-mobileTests.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = T27QU97WCQ;
Expand Down Expand Up @@ -846,7 +844,7 @@
CODE_SIGN_ENTITLEMENTS = mobile/mobile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 20;
CURRENT_PROJECT_VERSION = 22;
DEVELOPMENT_TEAM = T62N9GYJ92;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = mobile/Info.plist;
Expand All @@ -857,7 +855,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -882,7 +880,7 @@
CODE_SIGN_ENTITLEMENTS = mobile/mobile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 20;
CURRENT_PROJECT_VERSION = 22;
DEVELOPMENT_TEAM = T62N9GYJ92;
INFOPLIST_FILE = mobile/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "ASI Alliance Wallet";
Expand All @@ -892,7 +890,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1073,6 +1071,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
Expand Down Expand Up @@ -1112,10 +1111,7 @@
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "$(inherited)";
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
};
Expand Down Expand Up @@ -1155,6 +1151,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -1189,10 +1186,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = "$(inherited)";
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
7 changes: 4 additions & 3 deletions packages/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"scripts": {
"clean": "sh ./scripts/clean.sh",
"clean:watchman": "sh ./scripts/clean-watchman.sh",
"android": "yarn build:background && yarn build:provider && echo 'Building Android' && expo run:android",
"ios": "yarn build:background && yarn build:provider && echo 'Building iOS' && expo run:ios",
"android:connect": "adb reverse tcp:8081 tcp:8081",
Expand All @@ -24,7 +25,7 @@
"pod-install": "pod-install",
"lint-test": "eslint ./src --ext .js,.jsx,.ts,.tsx && prettier --check ./src app.json metro.config.js --ext .js,.jsx,.ts,.tsx",
"lint-fix": "eslint --fix ./src --ext .js,.jsx,.ts,.tsx && prettier --write ./src app.json metro.config.js --ext .js,.jsx,.ts,.tsx",
"postinstall": "sh ./scripts/fix-android-splash-screen-flash.sh && sh ./scripts/fix-ios-blur-view.sh && sh ./scripts/force-export-ble-manager-from-ledger.sh && sh ./scripts/fix-android-legacy-dependency.sh && sh ./scripts/fix-ios-legacy-pods.sh"
"postinstall": "sh ./scripts/postinstall/exec.sh"
},
"dependencies": {
"@amplitude/react-native": "^2.17.2",
Expand Down Expand Up @@ -66,7 +67,7 @@
"@react-navigation/elements": "^1.3.21",
"@react-navigation/native": "^6.0.13",
"@react-navigation/stack": "^6.3.17",
"@sentry/react-native": "^5.26.0",
"@sentry/react-native": "^5.24.2",
"@toruslabs/fetch-node-details": "=11.0.1",
"@toruslabs/torus.js": "=8.0.1",
"@walletconnect/client": "^1.6.4",
Expand All @@ -84,7 +85,7 @@
"ethers": "^5.7.2",
"eventemitter3": "^4.0.7",
"expo": "^49.0.3",
"expo-apple-authentication": "^6.1.0",
"expo-apple-authentication": "^6.4.2",
"expo-barcode-scanner": "^12.5.3",
"expo-blur": "12.8.0",
"expo-camera": "^13.4.2",
Expand Down
8 changes: 8 additions & 0 deletions packages/mobile/scripts/clean-watchman.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

ROOT=${DIR//\/packages\/mobile\/scripts/}

watchman watch-del "${ROOT}" ; watchman watch-project "${ROOT}"
3 changes: 3 additions & 0 deletions packages/mobile/scripts/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ rm -rf "$DIR/../android/.gradle"
rm -rf "$DIR/../android/build"
rm -rf "$DIR/../android/app/build"

ROOT=${DIR//\/packages\/mobile\/scripts/}
watchman watch-del "${ROOT}" ; watchman watch-project "${ROOT}"

cd "$DIR/../ios"

if [ "$(which xcodebuild 2>/dev/null)" == "" ]; then
Expand Down
12 changes: 0 additions & 12 deletions packages/mobile/scripts/fix-android-splash-screen-flash.sh

This file was deleted.

11 changes: 0 additions & 11 deletions packages/mobile/scripts/force-export-ble-manager-from-ledger.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Update android gradle config of outdated react-native-scrypt lib

DIR="$( cd "$( dirname "$0" )" && pwd -P )"
file_path=${DIR}/../node_modules/react-native-scrypt/android/build.gradle
file_path=${DIR}/../../node_modules/react-native-scrypt/android/build.gradle
# Check if the file exists
if [ ! -f "$file_path" ]; then
echo "Android Error: File '$file_path' not found."
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# We need to set the full background image for the splash screen.
# But, the expo's splash screen module doesn't handle the bakcground as image but the color.
# And, just setting the splashscreen.xml has the background image makes the white flash right before actual app load.
# To fix this problem, this script just replaces some codes on the expo's splash screen module to handle the background as image.

DIR="$( cd "$( dirname "$0" )" && pwd -P )"

cp ${DIR}/android/splashscreen_background.png ${DIR}/../../node_modules/expo-splash-screen/android/src/main/res/drawable/splashscreen_background.png
cp ${DIR}/android/SplashScreenView.kt ${DIR}/../../node_modules/expo-splash-screen/android/src/main/java/expo/modules/splashscreen/SplashScreenView.kt
cp ${DIR}/android/NativeResourcesBasedSplashScreenViewProvider.kt ${DIR}/../../node_modules/expo-splash-screen/android/src/main/java/expo/modules/splashscreen/NativeResourcesBasedSplashScreenViewProvider.kt
24 changes: 24 additions & 0 deletions packages/mobile/scripts/postinstall/exec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

# react-native-ble-plx requires only one instance of BLEManager exists.
# But, react-native-hw-transport-ble uses their instance without exporting that.
# So, to use the react-native-hw-transport-ble's ble manager instance,
# temporarily change the their source code by force.

DIR="$( cd "$( dirname "$0" )" && pwd -P )"

cp ${DIR}/ledger/BleTransport.d.ts ${DIR}/../../node_modules/@ledgerhq/react-native-hw-transport-ble/lib/BleTransport.d.ts
cp ${DIR}/ledger/BleTransport.js ${DIR}/../../node_modules/@ledgerhq/react-native-hw-transport-ble/lib/BleTransport.js

# https://github.com/software-mansion/react-native-reanimated/issues/4783#issuecomment-1732498548
# codepush에서 restart 문제를 해결하기 위해서 대충 이렇게 처리한다.
# 적절해보이는 방법은 아니지만... 이게 아니면 해결법을 찾을 수가 없다...
cp ${DIR}/restart-fix/JSCRuntime.cpp ${DIR}/../../node_modules/react-native/ReactCommon/jsc/JSCRuntime.cpp

#cp ${DIR}/wc/index.js ${DIR}/../../node_modules/@walletconnect/react-native-compat/index.js

. ${DIR}/android/fix-android-legacy-dependency.sh
. ${DIR}/android/fix-android-splash-screen-flash.sh

. ${DIR}/ios/fix-ios-blur-view.sh
. ${DIR}/ios/fix-ios-legacy-pods.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

DIR="$( cd "$( dirname "$0" )" && pwd -P )"

cp ${DIR}/BlurView.mm ${DIR}/../node_modules/@react-native-community/blur/ios/BlurView.mm
cp ${DIR}/ios/BlurView.mm ${DIR}/../../node_modules/@react-native-community/blur/ios/BlurView.mm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

DIR="$( cd "$( dirname "$0" )" && pwd -P )"
file_path=${DIR}/../node_modules/react-native/scripts/react_native_pods.rb
file_path=${DIR}/../../node_modules/react-native/scripts/react_native_pods.rb
# Check if the file exists
if [ ! -f "$file_path" ]; then
echo "iOS Error: File '$file_path' not found."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,14 @@ export default class BluetoothTransport extends Transport {
* observe event with { available: bool, string } // available is generic, type is specific
* an event is emit once and then listened
*/
static observeState(
observer: any
): {
static observeState(observer: any): {
unsubscribe: () => void;
};
static list: () => any;
/**
* Scan for bluetooth Ledger devices
*/
static listen(
observer: any
): {
static listen(observer: any): {
unsubscribe: () => void;
};
/**
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading