Skip to content

Prevent root/jailbreak detection from blocking startup#2391

Merged
lemnik merged 6 commits intonextfrom
PLAT-15668/bg-root-detection
Feb 25, 2026
Merged

Prevent root/jailbreak detection from blocking startup#2391
lemnik merged 6 commits intonextfrom
PLAT-15668/bg-root-detection

Conversation

@lemnik
Copy link
Copy Markdown
Contributor

@lemnik lemnik commented Feb 23, 2026

Goal

Improve startup time to not requiring the isRooted flag to be known before the Client constructor returns.

Design

Moved the root detection onto a low priority, dedicated background thread. The existing executors were not used because root detection can always be done in parallel, and we don't want other startup processes being blocked by it (due to queuing).

Once root detection is complete, a new SynchronizeState message is broadcast which causes the NDK to build its cache of app/device/context and retrieve the new isRooted value as part of that process.

Changes

This PR also includes some fixes to the device-id generation & NDK context attribute handling which were exposed by the higher-level changes. These issues caused previously passing tests to start failing.

Testing

Manual testing and relied on existing tests.

@lemnik lemnik force-pushed the PLAT-15668/bg-root-detection branch from c603c10 to 6e29df1 Compare February 23, 2026 09:52
@bugsnagbot
Copy link
Copy Markdown
Collaborator

bugsnagbot commented Feb 23, 2026

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1850.73 1608.22
arm64_v8a 659.71 413.95
armeabi_v7a 598.28 352.52
x86 729.33 483.57
x86_64 700.66 459.0

Generated by 🚫 Danger

@lemnik lemnik force-pushed the PLAT-15668/bg-root-detection branch from de7f47c to 582d8f6 Compare February 23, 2026 13:51
@lemnik lemnik marked this pull request as ready for review February 24, 2026 10:18
@lemnik lemnik requested a review from YYChen01988 as a code owner February 24, 2026 10:18
@lemnik lemnik changed the title Stop root/jailbreak detection blocking startup Prevent root/jailbreak detection blocking startup Feb 24, 2026
@lemnik lemnik changed the title Prevent root/jailbreak detection blocking startup Prevent root/jailbreak detection from blocking startup Feb 24, 2026
Copy link
Copy Markdown
Contributor

@hamudi-ahmed hamudi-ahmed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lemnik lemnik merged commit 5a6fd3e into next Feb 25, 2026
42 checks passed
@lemnik lemnik deleted the PLAT-15668/bg-root-detection branch February 25, 2026 14:03
@lemnik lemnik mentioned this pull request Mar 2, 2026
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.

4 participants