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

fix android builds: update hermes commit hash #7781

Merged
merged 2 commits into from
Nov 14, 2023
Merged
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
30 changes: 15 additions & 15 deletions patches/react-native+0.71.14.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ index 1379ffd..340f48d 100644
--- a/node_modules/react-native/Libraries/Core/InitializeCore.js
+++ b/node_modules/react-native/Libraries/Core/InitializeCore.js
@@ -24,26 +24,51 @@

'use strict';

+const Platform = require('../Utilities/Platform');
+
+if (Platform.OS === 'ios' && !global?.HermesInternal) {
Expand All @@ -27,7 +27,7 @@ index 1379ffd..340f48d 100644
+}
+
const start = Date.now();

require('./setUpGlobals');
+// require('./setUpDOM'); Introduced in RN v0.72, ensure included when upgrading patch
require('./setUpPerformance');
Expand All @@ -50,18 +50,18 @@ index 1379ffd..340f48d 100644
+ require('./setUpDeveloperTools'); // console.log calls visible in Metro from here
require('../LogBox/LogBox').install();
}

-require('../ReactNative/AppRegistry');
+require('../ReactNative/AppRegistry'); // reflect-metadata imported after here causes: https://github.com/LavaMoat/docs/issues/26

const GlobalPerformanceLogger = require('../Utilities/GlobalPerformanceLogger');
// We could just call GlobalPerformanceLogger.markPoint at the top of the file,
diff --git a/node_modules/react-native/ReactAndroid/build.gradle b/node_modules/react-native/ReactAndroid/build.gradle
index 155cb59..053550c 100644
--- a/node_modules/react-native/ReactAndroid/build.gradle
+++ b/node_modules/react-native/ReactAndroid/build.gradle
@@ -420,12 +420,9 @@ android {

// Used to override the NDK path/version on internal CI or by allowing
// users to customize the NDK path/version from their root project (e.g. for M1 support)
- if (rootProject.hasProperty("ndkPath")) {
Expand All @@ -73,7 +73,7 @@ index 155cb59..053550c 100644
+
+ // Added patch to apply ndk Path from MetaMask app gradle.build this is required for M1 Bitrise builds to work
+ ndkPath = project.getProperties().get("ndkPath")

defaultConfig {
minSdkVersion(21)
diff --git a/node_modules/react-native/ReactAndroid/hermes-engine/build.gradle b/node_modules/react-native/ReactAndroid/hermes-engine/build.gradle
Expand All @@ -83,31 +83,31 @@ index c714f87..dca2750 100644
@@ -43,11 +43,11 @@ def overrideHermesDir = System.getenv("REACT_NATIVE_OVERRIDE_HERMES_DIR") != nul
def hermesDir = System.getenv("REACT_NATIVE_OVERRIDE_HERMES_DIR") ?: new File(reactNativeRootDir, "sdks/hermes")
def hermesBuildDir = new File("$buildDir/hermes")

-def hermesVersion = "main"
-def hermesVersionFile = new File(reactNativeRootDir, "sdks/.hermesversion")
-if (hermesVersionFile.exists()) {
- hermesVersion = hermesVersionFile.text
-}
+def hermesVersion = "ae2ac688c3faf868d2360a10a7791226ed5702fb"
+def hermesVersion = "52725e889185e53277e629f1f7043aa2913c97a9"
+// def hermesVersionFile = new File(reactNativeRootDir, "sdks/.hermesversion")
+// if (hermesVersionFile.exists()) {
+// hermesVersion = hermesVersionFile.text
+// }
def ndkBuildJobs = Runtime.runtime.availableProcessors().toString()
def prefabHeadersDir = new File("$buildDir/prefab-headers")

@@ -59,7 +59,7 @@ def skipPrefabPublishing = System.getenv("REACT_NATIVE_HERMES_SKIP_PREFAB") != n
def jsiDir = new File(reactNativeRootDir, "ReactCommon/jsi")

task downloadHermes(type: Download) {
- src("https://github.com/facebook/hermes/tarball/${hermesVersion}")
+ src("https://github.com/MetaMask/hermes/tarball/${hermesVersion}")
onlyIfNewer(true)
overwrite(false)
dest(new File(downloadsDir, "hermes.tar.gz"))
@@ -120,12 +120,9 @@ android {

// Used to override the NDK path/version on internal CI or by allowing
// users to customize the NDK path/version from their root project (e.g. for M1 support)
- if (rootProject.hasProperty("ndkPath")) {
Expand All @@ -119,7 +119,7 @@ index c714f87..dca2750 100644
+
+ // Added patch to apply ndk Path from MetaMask app gradle.build this is required for M1 Bitrise builds to work
+ ndkPath = project.getProperties().get("ndkPath")

defaultConfig {
minSdkVersion 21
diff --git a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java
Expand All @@ -137,7 +137,7 @@ index 290bd23..20d85e0 100644
@@ -94,6 +95,16 @@ public class ReactEditText extends AppCompatEditText
/** A count of events sent to JS or C++. */
protected int mNativeEventCount;

+ /**
+ * Taken from EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING We can't use that
+ * value directly as it was only added on Oreo, but we can apply the value
Expand All @@ -149,7 +149,7 @@ index 290bd23..20d85e0 100644
+ /** Samsung Device Check */
+ private static final Boolean IS_SAMSUNG_DEVICE = Build.MANUFACTURER.equals(SAMSUNG_MANUFACTURER_NAME);
private static final int UNSET = -1;

private @Nullable ArrayList<TextWatcher> mListeners;
@@ -253,16 +264,24 @@ public class ReactEditText extends AppCompatEditText
@Override
Expand Down
Loading