From b0c1eaa99357c39d3dc9140a69f0175612bf3282 Mon Sep 17 00:00:00 2001 From: fabriziofff Date: Wed, 18 Aug 2021 12:27:24 +0200 Subject: [PATCH] chore: [IAI-16] Upgrade react-native to 0.64.2 (#3301) * porting to react navigation 4.0 * fix navigation tab * remove old patch * add IsSupportedConfig * fix bottom navigator style * upgrade react native first required changes * add locks * fix test * update calendar-events config and picker to enable android build * upgrade keychain and fix manifest * upgrade clipboard * fix clipboard on android * link art * fix jest react-native-clipboard * fix test * fix typo * fix react-navigation upgrade regression * fix react-navigation upgrade regression * update package * remove legacy okhttp version Co-authored-by: Cristiano Tofani --- .gitattributes | 4 +- _editorconfig | 3 + android/app/build.gradle | 10 +- android/app/src/debug/AndroidManifest.xml | 7 +- android/app/src/main/AndroidManifest.xml | 1 - .../java/it/pagopa/io/app/MainActivity.java | 10 - .../it/pagopa/io/app/MainApplication.java | 14 +- android/app/src/main/res/values/styles.xml | 2 +- android/build.gradle | 7 +- android/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/gradlew.bat | 21 +- android/settings.gradle | 6 +- ios/ItaliaApp.xcodeproj/project.pbxproj | 6 +- ios/ItaliaApp/AppDelegate.m | 6 +- ios/Podfile | 10 +- ios/Podfile.lock | 599 +-- jest.config.js | 2 +- jestSetup.js | 2 + metro.config.js | 2 +- package.json | 28 +- patches/patches.md | 6 + ...native-screen-brightness+2.0.0-alpha.patch | 3521 +++++++++++++++++ .../__test__/bpdSummaryComponent.test.tsx | 1 + .../__test__/EycaDetailComponent.test.tsx | 1 + .../wallet/payment/ScanQrCodeScreen.tsx | 30 +- ts/utils/calendar.ts | 7 +- ts/utils/clipboard.ts | 2 +- yarn.lock | 2969 +++++++------- 29 files changed, 5453 insertions(+), 1828 deletions(-) create mode 100644 _editorconfig create mode 100644 patches/react-native-screen-brightness+2.0.0-alpha.patch diff --git a/.gitattributes b/.gitattributes index e27f70fa490..45a3dcb2a20 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ -*.pbxproj -text -# specific for windows script files +# Windows files should use crlf line endings +# https://help.github.com/articles/dealing-with-line-endings/ *.bat text eol=crlf diff --git a/_editorconfig b/_editorconfig new file mode 100644 index 00000000000..7c286132fe9 --- /dev/null +++ b/_editorconfig @@ -0,0 +1,3 @@ +# Windows files +[*.bat] +end_of_line = crlf diff --git a/android/app/build.gradle b/android/app/build.gradle index c46636ded3c..1b4be87b5cb 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -102,6 +102,7 @@ def enableSeparateBuildPerCPUArchitecture = true def enableProguardInReleaseBuilds = false android { + ndkVersion rootProject.ext.ndkVersion compileSdkVersion rootProject.ext.compileSdkVersion compileOptions { @@ -167,7 +168,7 @@ android { def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = - defaultConfig.versionCode * 10 + versionCodes.get(abi) + defaultConfig.versionCode * 1000 + versionCodes.get(abi) } } } @@ -218,10 +219,6 @@ dependencies { // compile "com.squareup.okhttp3:okhttp:4.2.1" // compile "com.squareup.okhttp3:logging-interceptor:4.2.1" // compile "com.squareup.okhttp3:okhttp-urlconnection:4.2.1" - //OkHttp - implementation ("com.squareup.okhttp3:okhttp:3.12.12"){ - force = true //API 19 support - } implementation 'com.squareup.okhttp3:logging-interceptor:3.12.12' if (enableHermes) { def hermesPath = "../../node_modules/hermes-engine/android/"; @@ -231,7 +228,8 @@ dependencies { implementation jscFlavor } implementation project(':@react-native-community_datetimepicker') - + implementation project(':@react-native-clipboard_clipboard') + implementation project(':react-native-art') } // Run this once to be able to run the application with BUCK diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index fa26aa56e1c..5047b6d533a 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -4,5 +4,10 @@ - + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 4d2b901bd87..8f31ce2203a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -109,7 +109,6 @@ - diff --git a/android/app/src/main/java/it/pagopa/io/app/MainActivity.java b/android/app/src/main/java/it/pagopa/io/app/MainActivity.java index 5fba263c74f..1956c277afb 100644 --- a/android/app/src/main/java/it/pagopa/io/app/MainActivity.java +++ b/android/app/src/main/java/it/pagopa/io/app/MainActivity.java @@ -10,11 +10,7 @@ import com.facebook.react.ReactActivityDelegate; import com.facebook.react.ReactRootView; import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; -import com.calendarevents.CalendarEventsPackage; import org.devio.rn.splashscreen.SplashScreen; -import java.io.BufferedReader; -import java.io.File; -import java.io.InputStreamReader; public class MainActivity extends ReactActivity { @@ -52,12 +48,6 @@ protected ReactRootView createRootView() { }; } - @Override - public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { - CalendarEventsPackage.onRequestPermissionsResult(requestCode, permissions, grantResults); - super.onRequestPermissionsResult(requestCode, permissions, grantResults); - } - private void showAlertDialog(String title, String message) { new AlertDialog.Builder(MainActivity.this).setTitle(title).setMessage(message) diff --git a/android/app/src/main/java/it/pagopa/io/app/MainApplication.java b/android/app/src/main/java/it/pagopa/io/app/MainApplication.java index 40d27c72daf..25ffae182f9 100644 --- a/android/app/src/main/java/it/pagopa/io/app/MainApplication.java +++ b/android/app/src/main/java/it/pagopa/io/app/MainApplication.java @@ -1,7 +1,5 @@ package it.pagopa.io.app; -import androidx.multidex.MultiDexApplication; - import com.robinpowered.react.ScreenBrightness.ScreenBrightnessPackage; import com.AlexanderZaytsev.RNI18n.RNI18nPackage; import com.sha256lib.Sha256Package; @@ -24,7 +22,7 @@ import com.rnfs.RNFSPackage; import com.levelasquez.androidopensettings.AndroidOpenSettingsPackage; import com.swmansion.gesturehandler.react.RNGestureHandlerPackage; -import com.calendarevents.CalendarEventsPackage; +import com.calendarevents.RNCalendarEventsPackage; import com.rnfingerprint.FingerprintAuthPackage; import com.ocetnik.timer.BackgroundTimerPackage; import com.horcrux.svg.SvgPackage; @@ -42,8 +40,11 @@ import it.ipzs.cieidsdk.native_bridge.CiePackage; import com.reactnativecommunity.rnpermissions.RNPermissionsPackage; import com.reactcommunity.rndatetimepicker.RNDateTimePickerPackage; +import com.reactnativecommunity.art.ARTPackage; import com.facebook.react.PackageList; + +import android.app.Application; import android.content.Context; import com.facebook.react.ReactInstanceManager; import java.lang.reflect.InvocationTargetException; @@ -52,7 +53,7 @@ import java.util.Arrays; import java.util.List; -public class MainApplication extends MultiDexApplication implements ReactApplication { +public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = @@ -70,16 +71,17 @@ protected String getJSMainModuleName() { @Override protected List getPackages() { return Arrays.asList(new MainReactPackage(), - new ClipboardPackage(), new ReanimatedPackage(), + new ARTPackage(), new CookieManagerPackage(), + new ClipboardPackage(), new CameraRollPackage(), new RNViewShotPackage(), new JailMonkeyPackage(), new LinearGradientPackage(), new RNSharePackage(), new ScreenBrightnessPackage(), new AsyncStoragePackage(), new QRScanReaderPackage(), new ImagePickerPackage(), new FlagSecurePackage(), new RNFSPackage(), new AndroidOpenSettingsPackage(), - new RNGestureHandlerPackage(), new CalendarEventsPackage(), new RNCWebViewPackage(), + new RNGestureHandlerPackage(), new RNCalendarEventsPackage(), new RNCWebViewPackage(), new FingerprintAuthPackage(), new BackgroundTimerPackage(), new SvgPackage(), new SplashScreenReactPackage(), new ReactNativeExceptionHandlerPackage(), new RNCameraPackage(), new ReactNativePushNotificationPackage(), new KeychainPackage(), new RNI18nPackage(), new Sha256Package(), diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index cd3ed5958e7..60760058920 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,7 +1,7 @@ -