TypeScript
fix(mobile): Android fingerprint covers Expo native modules again (#20384)
Julius Marminge67bca6c224b3
diff --git a/.github/workflows/mobile-eas-production.yml b/.github/workflows/mobile-eas-production.ymlindex 8ae8ecc742e..16be6ee5f29 100644--- a/.github/workflows/mobile-eas-production.yml+++ b/.github/workflows/mobile-eas-production.yml@@ -234,6 +234,29 @@ jobs:MOBILE_BUILD_PROFILE: ${{ inputs.profile || 'production' }}run: eas build --platform ${{ inputs.platform }} --profile "$MOBILE_BUILD_PROFILE" --auto-submit --non-interactive --no-wait+ # @expo/fingerprint swallows autolinking errors and returns no Expo module+ # sources, so native changes stop moving the hash and OTAs reach binaries+ # that lack them. Refuse to publish any OTA from such a fingerprint.+ - name: Verify fingerprints hash Expo native modules+ if: steps.expo-token.outputs.present == 'true' && (github.event_name == 'push' || inputs.mode == 'update')+ working-directory: apps/mobile+ env:+ EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}+ PLATFORM: ${{ inputs.platform || 'all' }}+ run: |+ if [ "$PLATFORM" = "all" ]; then platforms="ios android"; else platforms="$PLATFORM"; fi+ failed=0+ for platform in $platforms; do+ # eas-cli prints an environment-loaded notice to stdout before the+ # JSON even with --json, so discard everything before the document.+ expo_modules="$(eas fingerprint:generate --platform "$platform" --environment production --json --non-interactive | sed -n '/^{/,$p' | jq --arg reason "expoAutolinking${platform^}" '[.sources[] | select((.reasons // []) | index($reason))] | length')"+ if [ "${expo_modules:-0}" -eq 0 ]; then+ failed=1+ echo ":x: $platform: the native fingerprint hashes no Expo native modules — OTAs and builds skipped" >> "$GITHUB_STEP_SUMMARY"+ fi+ done+ exit "$failed"+- name: Publish OTA update (manual)if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'update'working-directory: apps/mobilediff --git a/patches/@[email protected] b/patches/@[email protected]new file mode 100644index 00000000000..8045438709c--- /dev/null+++ b/patches/@[email protected]@@ -0,0 +1,16 @@+diff --git a/build/sourcer/Expo.js b/build/sourcer/Expo.js+index 785ec516921af68ea5922462a0177112e15c6bb1..8ce5ce7937b83b3677416bf18f4c60d759ba4fcf 100644+--- a/build/sourcer/Expo.js++++ b/build/sourcer/Expo.js+@@ -368,6 +368,11 @@ async function getExpoAutolinkingAndroidSourcesAsync(projectRoot, options, expoA+ }+ if (module1.plugins) {+ for (const plugin of module1.plugins){++ // Gradle plugins resolved from Maven (e.g. expo-widgets' glance fork) have no++ // sourceDir; hashing them would throw and drop every Expo module source.++ if (typeof plugin.sourceDir !== 'string') {++ continue;++ }+ const filePath = (0, _Path.toPosixPath)(_path().default.relative(realProjectRoot, plugin.sourceDir));+ plugin.sourceDir = filePath; // use relative path for the dir+ debug(`Adding expo-modules-autolinking android dir - ${_chalk().default.dim(filePath)}`);diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 5158226ceda..2352964b28d 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -151,6 +151,7 @@ packageExtensionsChecksum: sha256-EowbsmlBFaoO0Ypufw901RnvdyjKG5dcdk2FRbc7Dr0=patchedDependencies:'@clerk/[email protected]': 7a808b92da8460750b85818552e13be3fb73d111691c7db76965970351e124e4'@effect/[email protected]': 2731c9c3761c595f25ddc625a7d61ca376b389d5b3049ecb837c8940f21cfa02+ '@expo/[email protected]': 8fba80d6bbce46c72de427fe8c7907462d262a0bfe50c6b2b7ee9c4e0c61e5e1'@expo/[email protected]': 90fa980e8b6480631fb2fbb04559834e3c612db40c550cd828f11be297d8d760'@expo/[email protected]': 5a26480373850c1a7943919aa21f904151b335a0cb01042109e0746def37923e'@ff-labs/[email protected]': cc71fcec015f4d39bc96ae2e2bf6b0ca678124c722c66a7841efce9d34b5983c@@ -14630,7 +14631,7 @@ snapshots:transitivePeerDependencies:- supports-color- '@expo/[email protected]':+ '@expo/[email protected](patch_hash=8fba80d6bbce46c72de427fe8c7907462d262a0bfe50c6b2b7ee9c4e0c61e5e1)':dependencies:'@expo/env': 2.5.2'@expo/spawn-async': 1.8.0@@ -19629,7 +19630,7 @@ snapshots:'@expo/config': 58.0.6([email protected])'@expo/config-plugins': 58.0.9([email protected])'@expo/devtools': 58.0.2([email protected])([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected])- '@expo/fingerprint': 0.21.5+ '@expo/fingerprint': 0.21.5(patch_hash=8fba80d6bbce46c72de427fe8c7907462d262a0bfe50c6b2b7ee9c4e0c61e5e1)'@expo/local-build-cache-provider': 58.0.6([email protected])'@expo/log-box': 58.0.12(@expo/[email protected])([email protected])([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected])'@expo/log-box-utils': 58.0.2diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 216d337eafb..bed729eb98a 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -332,6 +332,9 @@ patchedDependencies:# Android: a nested WebView hands a vertical drag to its scrolling parent at the page's edge.[email protected]: patches/[email protected]"@expo/[email protected]": patches/@[email protected]+ # Android: Maven-resolved gradle plugins (expo-widgets) have no sourceDir; without this+ # skip, the fingerprint silently drops every Expo native module and OTAs reach stale binaries.+ "@expo/[email protected]": patches/@[email protected]peerDependencyRules:allowAny: