Skip to content

chore(android): targetSdk 36 - #742

Merged
islandbitcoin merged 1 commit into
mainfrom
chore/android-targetsdk-36
Sep 24, 2026
Merged

islandbitcoin merged 1 commit into
mainfrom
chore/android-targetsdk-36

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

ENG-605 PR5. targetSdkVersion 35 → 36 (android/build.gradle:8). compileSdk / buildTools were already 36 (#739); minSdk 26 unchanged. Based on #741 (chore/android-edge-to-edge-prep) with origin/main merged in so the flip sits on compileSdk 36; once #741 lands this diff collapses to the two Android files below.

One behaviour change beyond the version bump came out of the audit: android:enableOnBackInvokedCallback="false" on <application> (AndroidManifest.xml:30). Details in row 3.

Android 16 behaviour audit (this tree, RN 0.77.1, @react-navigation/stack 6)

# Android 16 change Where in this tree Decision
1 Edge-to-edge is enforced; windowOptOutEdgeToEdgeEnforcement is disabled. With the decor view no longer fitting system windows, windowSoftInputMode="adjustResize" stops shrinking the content view for the IME (the IME arrives as an inset instead). AndroidManifest.xml:36 adjustResize. IME height is already applied from useAnimatedKeyboard via useKeyboardPaddingStyle (app/hooks/use-keyboard-padding.ts:64) on chat/messages.tsx, GroupChat/SupportGroupChat.tsx, topup-cashout-flow/BridgeAddExternalAccount.tsx; Screen pads insets.bottom (app/components/screen/screen.tsx:47). Core-Modal-hosted forms (BridgeKycModal, quick-zap-modal, the three GroupChat modals) keep the dialog window's own SOFT_INPUT_ADJUST_RESIZE + fitsSystemWindows root. No change. The attribute is harmless on Android ≤14 (still honoured there) and inert on 15+/target 36. Screens with a TextInput inside Screen that have no IME hook (phone-login-input, phone-registration-input, *-validation, email-*-initiate, username-set, contacts-detail, TopupDetails, account-screen) previously relied on the window resize; they are all short forms with the input in the top half, so the keyboard should not cover them — this is the "keyboard on forms" item in the device sweep.
2 screenOrientation, resizableActivity, min/maxAspectRatio, setRequestedOrientation() are ignored on ≥600dp-sw displays (tablets, unfolded foldables, desktop windowing). AndroidManifest.xml:35 screenOrientation="portrait", :33 configChanges includes orientation|screenSize (activity is not recreated on rotate; RN relayouts). No change (no resizableActivity, no PROPERTY_COMPAT_ALLOW_RESTRICTED_RESIZABILITY; the latter is the documented temporary opt-out if the device pass finds breakage, and it stops working at target 37). Phones (<600dp) stay portrait-locked. On large screens the app will rotate; screens that read Dimensions.get() at module load keep stale portrait numbers after a rotate: components/scan/QRCamera.tsx:12 (QR scanner viewport width/height), components/currency-keyboard/currency-keyboard.tsx:9 (keypad row height), contexts/Flashcard.tsx:32 (NFC "Ready to scan" sheet width), screens/get-started-screen/get-started-screen.tsx:28, screens/authentication-screen/username-set.tsx:35, screens/earns-screen/earns-section.tsx:26, screens/invite-friend/InviteFriendSuccess.tsx:16, components/card/EmptyCard.tsx:18, components/advanced-mode-modal/advanced-mode-modal.tsx:29, components/home-screen/QuickStart.tsx:31, components/nostr-quickstart/index.tsx:16. Camera capture (account-upgrade-flow/PhotoUploadField.tsx, vision-camera 4.7.3, no outputOrientation prop) and the QR scanner will render the preview rotated/letterboxed in landscape. No IdentityCapture screen exists on this branch. Tablet/foldable is a device-pass item, not a phone regression.
3 Predictive back: for apps targeting 36 on an Android 16 device, onBackPressed() is no longer called and KEYCODE_BACK is no longer dispatched; back goes through OnBackInvokedDispatcher only. RN 0.77.1 ReactActivity.java:98 only overrides onBackPressed() (no OnBackPressedCallback); that is the sole path that emits JS hardwareBackPress. Consumers of that event in this tree: @react-navigation/stack (JS stack, 138 imports — every stack pop on Android), react-native-modal's onBackButtonPress (node_modules/react-native-modal/dist/modal.js:108; used by CashoutAccountPicker.tsx:76, ChooseWallet.tsx:137, key-modal.tsx:75, import-nsec-modal.tsx:32), core Modal onRequestClose (18 usages, native dialog — unaffected). The only native OnBackPressedCallback registrations are react-native-screens' search bar (FragmentBackPressOverrider.kt), which this app does not use. Nothing else registers with the androidx dispatcher, so on Android 16 a back press would fall through to the system default and leave the app from any screen; onBackButtonPress on every react-native-modal sheet would never fire. Change: android:enableOnBackInvokedCallback="false" on <application> — the opt-out Google documents for exactly this case ("if your app intercepts the back event and you haven't yet migrated"). It restores the legacy onBackPressed() dispatch on Android 16, so RN's BackHandler keeps working; Android ≤15 is unchanged (the attribute already defaulted to false there). Cost: no predictive-back animation. Remove it when RN is bumped to 0.80 or later: upstream ReactActivity.java from 0.80.0 registers an OnBackPressedCallback with the comment "Due to enforced predictive back on targetSdk 36, 'onBackPressed()' is disabled by default" (react/react-native#51096; follow-up #54958 in Dec 2025 fixes re-enabling after invokeDefaultOnBackPressed). #741's "RN 0.77 handles it" note was wrong for this reason. Hardware back on the cashout account picker and on the bank-account screen's remove/default Alert.alert dialogs (bank-accounts-screen.tsx:216,249,406, native — unaffected) are in the device sweep regardless.
4 Window.setStatusBarColor / setNavigationBarColor are no-ops under enforced edge-to-edge (already true on Android 15 at target 35; 16 removes the opt-out). app/app.tsx:85 <StatusBar backgroundColor="#000" barStyle="light-content"> (Android only); screens/chat/NIP17Chat.tsx:177 <StatusBar translucent backgroundColor="transparent">; screens/featured-profile-view/FeaturedProfileView.tsx:152 <StatusBar barStyle="light-content" backgroundColor={VIEW_COLORS.background}>. No StatusBar.setBackgroundColor() / setTranslucent() imperative calls anywhere; Modal statusBarTranslucent unused. No change. backgroundColor becomes a no-op on 15+ (it already is at target 35) but is still honoured on Android ≤14, so removing it would regress the black bar there. barStyle (icon tint via WindowInsetsController) keeps working everywhere. translucent on NIP17Chat sets an insets listener that zeroes the top inset (WindowUtil.kt:20); under edge-to-edge the window is already behind the bar and Screen's SafeAreaView pads the top, so it is redundant but harmless. RN 0.77.1's StatusBar.js emits no edge-to-edge warning for any of these (the warning landed in later RN), so there is nothing to strip to keep logcat clean.
5 Permissions / services Android 14–16 tightened: FOREGROUND_SERVICE_* types (34+), exact alarms, BLUETOOTH_*, READ_MEDIA_*, NFC. Main manifest (AndroidManifest.xml:5-18): INTERNET, CAMERA, ACCESS_FINE_LOCATION, USE_BIOMETRIC, USE_FINGERPRINT, ACCESS_WIFI_STATE, ACCESS_NETWORK_STATE, VIBRATE, READ_CONTACTS; READ_PHONE_STATE and USE_FULL_SCREEN_INTENT removed via tools:node="remove". Merged release manifest (build/intermediates/merged_manifests/release/…/universal/AndroidManifest.xml, sources from manifest-merger-release-report.txt): FOREGROUND_SERVICE + RECEIVE_BOOT_COMPLETED ← androidx.work:work-runtime:2.9.0; SCHEDULE_EXACT_ALARM ← app.notifee:core (trigger notifications; the app never calls createTriggerNotification, so the alarm permission is declared but unused); POST_NOTIFICATIONS ← firebase-messaging:25.0.1 (already requested at runtime, app/utils/notifications.ts:58); NFC ← react-native-nfc-manager; WRITE_EXTERNAL_STORAGE ← breez-sdk-liquid / react-native-fs (inert since API 30). One foreground service: app.notifee.core.ForegroundService with foregroundServiceType="shortService" (declared by notifee-core, satisfies the API 34 type requirement; not started by app code — notifee.registerForegroundService is unused); androidx.work's SystemForegroundService carries no type and is only used by WorkManager's expedited path. No FOREGROUND_SERVICE_* typed permission, no USE_EXACT_ALARM, no BLUETOOTH*, no READ_MEDIA_*. MediaStore#getVersion() becomes per-app at 36; not called in this tree. No change. Nothing here moved between 35 and 36; Android 16's FGS changes (dataSync/mediaProcessing timeouts, SYSTEM_ALERT_WINDOW no longer exempting FGS starts) do not touch shortService. Note for the record: android.permission.NFC reaches the release manifest only via the library's manifest merge (android/app/src/debug/AndroidManifest.xml:8 declares it explicitly, main does not) — pre-existing, works, listed so nobody "fixes" the asymmetry blindly. Plaid's LinkActivity (adjustPan, singleInstance) is the SDK's own and unaffected.
6 16 KB page size (required for new apps/updates on Google Play since Nov 2025; 36 keeps it). From #622: android/app/build.gradle:161-164 packaging { jniLibs { useLegacyPackaging = false } }, AndroidManifest.xml:29 android:extractNativeLibs="false", NDK 27.1.12297006 (android/build.gradle:9), R8 8.7.18, AGP/RN 0.77 defaults (no android.bundle.enableUncompressedNativeLibs in gradle.properties — that property was removed in AGP 8.x; useLegacyPackaging=false is its replacement). No change. All #622 flags are intact on this branch.
7 Other target-36 changes: ScheduledExecutorService.scheduleAtFixedRate replays at most one missed run; MediaStore#getVersion() per-app; safer-intents enforcement is opt-in via intentMatchingFlags; JobScheduler quotas; Bluetooth bond-loss intents. No scheduleAtFixedRate in app code; no Bluetooth; deep links are inbound flash:// only (AndroidManifest.xml:43-55). No change.

Build proof

Production bundle (npx react-native bundle --platform android --dev false …, 18,172,501 bytes) followed by:

./android/gradlew -b ./android/build.gradle assembleRelease -PreactNativeArchitectures=arm64-v8a \
  -Dorg.gradle.jvmargs=-Xmx4g --warning-mode all  # debug-keystore -P overrides as in #733/#735/#739
./android/gradlew -b ./android/build.gradle assembleDebug   -PreactNativeArchitectures=arm64-v8a --warning-mode all
  • assembleRelease: BUILD SUCCESSFUL in 2m 37s, 2223 tasks executed. app-arm64-v8a-release.apk = 105,084,996 bytes (105,084,204 at target 35 in chore(android): compileSdk 36 (target stays 35) #739, +792 B; universal 275,692,877). Merged manifest carries android:targetSdkVersion="36" and enableOnBackInvokedCallback="false".
  • assembleDebug arm64 (device-test path): BUILD SUCCESSFUL in 1m 41s. app-arm64-v8a-debug.apk = 140,939,583 bytes (140,939,483 in chore(android): compileSdk 36 (target stays 35) #739).
  • Warnings: no new ones attributable to the flip. --warning-mode all output is the same set as chore(android): compileSdk 36 (target stays 35) #739: jcenter() Gradle-9 deprecation (6, from library build.gradles), package= in source manifests (geetest-module, notifee, aes-crypto), Kotlin deprecation w: lines in react-native-webview / vision-camera / screens / plaid (library code), and the 8 android.targetSdk using custom value: 36 lines from the firebase/notifee modules picking up the new value.
  • yarn tsc:check clean; yarn test: 120 suites, 1187 passed, 1187 total (1185 on chore(ui): prepare every screen for Android 16 forced edge-to-edge #741; +2 from origin/main).

Device sweep (before this ships in a release)

Device reality check first. Note the OS version of the test Pixel in the results. Every "Android 16" behaviour in the table above (predictive back opt-out, enforced edge-to-edge without opt-out, ignored screenOrientation on large screens) is gated on running on Android 16, so it can only be confirmed on a Pixel 8 Pro on Android 16 or an API 36 emulator (sdk_gphone64_arm64, system image "Android 16.0 (Baklava)"). There is no developer option that forces Android 16 edge-to-edge on an Android 15 device (the "Force edge-to-edge" toggle does not exist); an Android 15 device only validates the target-35 edge-to-edge path, which #741 already prepared for. Run the sweep on both if available: Android 15 (regression) and Android 16 (new behaviour).

Cover gesture nav and 3-button nav on each Android device.

Bottom-anchored screens (content clear of nav bar, no double gap, keyboard does not cover the field in focus):

  • Cashout: CashoutDetails, CashoutConfirmation, TopupDetails, BankTransfer (expect the cosmetic extra nav-bar gap chore(ui): prepare every screen for Android 16 forced edge-to-edge #741 flagged; note whether it is acceptable)
  • Bank account add/edit (BridgeAddExternalAccount: keyboard up → bottom field and submit reachable; BridgeExternalAccountWebView)
  • Send flow (amount keypad currency-keyboard, ChooseWallet sheet, confirmation)
  • Chat (messages, SupportGroupChat): composer on the nav-bar inset at rest; with Gboard + suggestion strip up, composer sits on the strip, no gap, no overlap

Bottom sheets (last row / primary button clear of the nav bar, designed padding intact, not floating twice the inset):

  • CashoutAccountPicker (32 + inset)
  • Bank-account action dialogs on bank-accounts-screen (remove / set default / KYC BridgeKycModal)
  • contact-modal, reports-modal, modal-tooltip, earns-quiz
  • Home-tab sheets AccountCreateModal, CashWalletCutoverModal sit directly on the tab bar (no second inset band)
  • Native-Modal sheets with keyboard up: BridgeKycModal, quick-zap-modal, CreateGroupModal, GroupInfoModal, GroupMembersModal (watch for a double bottom gap on Android; chore(ui): prepare every screen for Android 16 forced edge-to-edge #741 left insets.bottom + 16 in place pending this check)

Keyboard on forms (no IME hook, relied on adjustResize before): phone login/registration input + validation, email login/registration initiate, username-set, contacts-detail, TopupDetails, account-screen — field in focus and its primary button stay visible.

Hardware / gesture back (the enableOnBackInvokedCallback="false" row): on Android 16 specifically —

  • back pops a stack screen instead of leaving the app (any headered screen)
  • back on CashoutAccountPicker closes the sheet (onBackButtonPress), second back pops the screen
  • back on ChooseWallet, key-modal, import-nsec-modal closes the sheet
  • back on a bank-account Alert.alert dialog dismisses the dialog only
  • back on the Home tab root leaves the app (expected)

Integrations:

  • Push notification arrival foreground + background + killed (notifee 9.1.8 / FCM 23.8.8); tap opens the right screen
  • Plaid Link (react-native-plaid-link-sdk 12.8.3) opens, completes, returns
  • Biometrics prompt (unlock + send confirmation)
  • PDF export (react-native-html-to-pdf) + share sheet
  • Geetest captcha at login (WebView sizing under edge-to-edge)
  • NFC Flashcard tap → "Ready to scan" sheet → balance/topup (contexts/Flashcard.tsx, modal-nfc)
  • Camera capture in account upgrade (PhotoUploadField, vision-camera) and QR scanner (QRCamera) — preview fills the viewport, no letterboxing
  • Status bar: icons light on dark backgrounds (app.tsx, FeaturedProfileView); on an Android ≤14 device the black bar still paints

Large screen / foldable (if available, tablet or unfolded Fold on Android 16): rotate to landscape on: QR scanner, keypad, NFC sheet, get-started carousel, earns section. Record which break; decide then whether to add PROPERTY_COMPAT_ALLOW_RESTRICTED_RESIZABILITY (temporary, dies at target 37) or fix the module-load Dimensions.get() reads.

0.7.2 regression list:

🤖 Generated with Claude Code

ENG-605 PR5. targetSdkVersion 35 -> 36 in android/build.gradle;
compileSdk/buildTools were already 36 (#739), minSdk 26 unchanged.

Sets android:enableOnBackInvokedCallback="false" on <application>.
Android 16 enables predictive back for apps targeting 36 and stops
calling Activity.onBackPressed(); RN 0.77.1's ReactActivity only
overrides onBackPressed() (the OnBackPressedCallback registration
landed in RN 0.80), and that override is the only path that emits the
JS hardwareBackPress event. This app is on @react-navigation/stack
(JS stack) and react-native-modal's onBackButtonPress, both driven by
that event, so without the opt-out a back press on an Android 16
device would leave the app from any screen. Remove the attribute when
RN is bumped to 0.80+.

Everything else in the Android 16 audit (edge-to-edge + adjustResize,
screenOrientation on large screens, StatusBar backgroundColor no-ops,
FGS/exact-alarm/NFC permissions, 16 KB packaging from #622) is a
documented no-change; see the PR body.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@islandbitcoin
islandbitcoin force-pushed the chore/android-targetsdk-36 branch from 4278f47 to b6a8c1e Compare September 24, 2026 23:24
@islandbitcoin
islandbitcoin changed the base branch from chore/android-edge-to-edge-prep to main September 24, 2026 23:24
@islandbitcoin
islandbitcoin merged commit 2decace into main Sep 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant