Skip to content

Commit

Permalink
Merge pull request #770 from dorianvp/bump_rn_0.74.0
Browse files Browse the repository at this point in the history
Bump react-native to 0.74.0
  • Loading branch information
juanky201271 authored Feb 12, 2025
2 parents 5fede0d + 9a9e30c commit e2dc035
Show file tree
Hide file tree
Showing 35 changed files with 317 additions and 600 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
**/.xcode.env.local

# Exclude compiled libs
android/app/src/main/jniLibs
Expand Down Expand Up @@ -76,7 +77,7 @@ buck-out/
*.jsbundle

# CocoaPods
/ios/Pods/
**/Pods/
/ios/Podfile.lock

# e2e test logs
Expand Down
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ ruby ">= 2.6.10"
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
21 changes: 21 additions & 0 deletions __mocks__/react-native-vision-camera.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Simple mock for Camera
export const Camera = () => null;

// Mock that returns a mocked camera object
export const useCameraDevice = jest.fn(() => ({
id: 'mocked-camera',
name: 'Mock Camera',
position: 'back',
}));

// Mock that returns permission status and a request function
export const useCameraPermission = jest.fn(() => ({
hasPermission: true,
requestPermission: jest.fn(),
}));

// Mock that provides a mocked scanner function
export const useCodeScanner = jest.fn(() => ({
codeTypes: ['qr', 'ean-13'],
onCodeScanned: jest.fn(),
}));
4 changes: 1 addition & 3 deletions __tests__/__snapshots__/Scanner.snapshot.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ exports[`Component Scanner - test Scanner - snapshot 1`] = `
"width": "100%",
}
}
>
<mockQRCodeScanner />
</RCTSafeAreaView>
/>
`;
5 changes: 2 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 218 // Real
versionName "zingo-1.11.0" // Real
missingDimensionStrategy 'react-native-camera', 'general'
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
Expand Down Expand Up @@ -225,7 +224,6 @@ android.applicationVariants.configureEach { variant ->
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")

androidTestImplementation('com.wix:detox:20.27.2')
implementation 'androidx.appcompat:appcompat:1.7.0'
Expand Down Expand Up @@ -258,7 +256,8 @@ dependencies {
implementation "androidx.work:work-rxjava2:$work_version"

// optional - GCMNetworkManager support
implementation "androidx.work:work-gcm:$work_version"
// GCM is deprecated
//implementation "androidx.work:work-gcm:$work_version"

// optional - Test helpers
androidTestImplementation "androidx.work:work-testing:$work_version"
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.CAMERA"
tools:ignore="PermissionImpliesUnsupportedChromeOsHardware" />

<application
android:usesCleartextTraffic="false"
Expand Down
42 changes: 21 additions & 21 deletions android/app/src/main/java/org/ZingoLabs/Zingo/MainApplication.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.ZingoLabs.Zingo

import android.app.Application
import android.content.Context
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
Expand All @@ -10,39 +11,39 @@ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.soloader.SoLoader
import android.content.Context
import java.lang.ref.WeakReference

class MainApplication : Application(), ReactApplication {

override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
add(RPCPackage())
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here,
// for example:
// add(MyReactNativePackage())
add(RPCPackage())
}

override fun getJSMainModuleName(): String = "index"

override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG

override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}

override fun getJSMainModuleName(): String = "index"

override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG

override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}


override val reactHost: ReactHost
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
get() = getDefaultReactHost(applicationContext, reactNativeHost)

override fun onCreate() {
super.onCreate()
context = WeakReference(applicationContext)


SoLoader.init(this, false)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
// If you opted-in for the New Architecture, we load the native entry point for this
// app.
load()
}
}
Expand All @@ -58,4 +59,3 @@ class MainApplication : Application(), ReactApplication {
}
}
}

22 changes: 4 additions & 18 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
minSdkVersion = 24
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "24.0.8215888"
kotlinVersion = '1.8.22'
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"
}
repositories {
google()
Expand All @@ -16,7 +16,7 @@ buildscript {
dependencies {
classpath('com.android.tools.build:gradle:8.3.2')
classpath("com.facebook.react:react-native-gradle-plugin")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}

Expand All @@ -31,18 +31,4 @@ allprojects {
maven { url 'https://www.jitpack.io' }
}
}

// this is not the best solution, but while the libraries have no namespace...
// https://discuss.gradle.org/t/namespace-not-specified-for-agp-8-0-0/45850/5

//subprojects {
// afterEvaluate { project ->
// if (project.hasProperty('android')) {
// project.android {
// if (namespace == null) {
// namespace project.group
// }
// }
// }
// }
//}

2 changes: 2 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ hermesEnabled=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false

VisionCamera_enableCodeScanner=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Fri Jan 24 19:05:10 MST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 5 additions & 1 deletion android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ APP_ARGS=`save "$@"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command, following the shell quoting and substitution rules
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

exec "$JAVACMD" "$@"
21 changes: 11 additions & 10 deletions android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,12 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
4 changes: 2 additions & 2 deletions app/LoadedApp/LoadedApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ export class LoadedAppClass extends Component<LoadedAppClassProps, LoadedAppClas
},
{ text: translate('cancel') as string, style: 'cancel' },
],
{ cancelable: false, userInterfaceStyle: 'light' },
{ cancelable: false },
);
} else if (item === MenuItemEnum.TipZingoLabs) {
const { translate } = this.state;
Expand All @@ -1209,7 +1209,7 @@ export class LoadedAppClass extends Component<LoadedAppClassProps, LoadedAppClas
style: 'cancel',
},
],
{ cancelable: false, userInterfaceStyle: 'light' },
{ cancelable: false },
);
} else if (item === MenuItemEnum.AddressBook) {
this.setState({
Expand Down
4 changes: 2 additions & 2 deletions app/LoadingApp/LoadingApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ export class LoadingAppClass extends Component<LoadingAppClassProps, LoadingAppC
onPress: () => reject(),
},
],
{ cancelable: false, userInterfaceStyle: 'light' },
{ cancelable: false },
);
});
};
Expand Down Expand Up @@ -1243,7 +1243,7 @@ export class LoadingAppClass extends Component<LoadingAppClassProps, LoadingAppC
},
{ text: this.props.translate('cancel') as string, style: 'cancel' },
],
{ cancelable: false, userInterfaceStyle: 'light' },
{ cancelable: false },
);
}
};
Expand Down
2 changes: 1 addition & 1 deletion app/LoadingApp/components/StartMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ const StartMenu: React.FunctionComponent<StartMenuProps> = ({
},
{ text: translate('cancel') as string, style: 'cancel' },
],
{ cancelable: false, userInterfaceStyle: 'light' },
{ cancelable: false },
);
} else {
createNewWallet();
Expand Down
2 changes: 1 addition & 1 deletion app/createAlert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const createAlert = async (
},
{ text: translate('cancel') as string, style: 'cancel' },
],
{ cancelable: false, userInterfaceStyle: 'light' },
{ cancelable: false },
);
} else {
// no email button
Expand Down
6 changes: 3 additions & 3 deletions app/recoveryWalletInfo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Keychain from 'react-native-keychain';
import { GlobalConst, WalletType } from './AppState';

const options = (biometrics: Keychain.BIOMETRY_TYPE | null): Keychain.Options => {
const options = (biometrics: Keychain.BIOMETRY_TYPE | null): Keychain.BaseOptions => {
return {
service: GlobalConst.serviceKeyChain,
accessControl: Keychain.ACCESS_CONTROL.BIOMETRY_CURRENT_SET_OR_DEVICE_PASSCODE, // for both
Expand All @@ -11,8 +11,8 @@ const options = (biometrics: Keychain.BIOMETRY_TYPE | null): Keychain.Options =>
// with biometrics in the device -> SECURE HARDWARE
securityLevel: biometrics ? Keychain.SECURITY_LEVEL.SECURE_HARDWARE : Keychain.SECURITY_LEVEL.SECURE_SOFTWARE,
// with biometrics in the device -> RSA
storage: biometrics ? Keychain.STORAGE_TYPE.RSA : Keychain.STORAGE_TYPE.AES,
} as Keychain.Options;
storage: biometrics ? Keychain.STORAGE_TYPE.RSA : Keychain.STORAGE_TYPE.AES_GCM,
} as Keychain.BaseOptions;
};

export const saveRecoveryWalletInfo = async (keys: WalletType): Promise<void> => {
Expand Down
2 changes: 1 addition & 1 deletion components/AddressBook/components/AbSummaryLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const AbSummaryLine: React.FunctionComponent<AbSummaryLineProps> = ({
},
{ text: translate('cancel') as string, style: 'cancel' },
],
{ cancelable: false, userInterfaceStyle: 'light' },
{ cancelable: false },
);
};

Expand Down
2 changes: 1 addition & 1 deletion components/Components/PriceFetcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const PriceFetcher: React.FunctionComponent<PriceFetcherProps> = ({ setZecPrice,
{ text: translate('send.fetch-button') as string, onPress: () => onPressFetch() },
{ text: translate('cancel') as string, style: 'cancel' },
],
{ cancelable: false, userInterfaceStyle: 'light' },
{ cancelable: false },
);
};

Expand Down
Loading

0 comments on commit e2dc035

Please sign in to comment.