Skip to the content.

firecrasher/ — AGENTS.md

The published library module (com.osama.firecrasher, JitPack artifact com.github.osama-raddad:FireCrasher). Read the root AGENTS.md first for the overall architecture; this file covers what is specific to editing the library.

Source map (src/main/java/com/osama/firecrasher/)

File Role
FireCrasher.kt Public FireCrasher.install + Application.installFireCrasher extension; internal policy: evaluate, recover, dispatchCrash, retryCount, recovery-state persistence.
FireCrasherConfig.kt The install DSL builder (onCrash { }, onPreviousProcessExit { }) and the @FireCrasherDsl marker.
CrashScope.kt onCrash receiver: throwable, activity, level, retryCount, recover(...).
RecoveryLevel.kt The three recovery levels. Ordinals are persisted by the codec — append only, never reorder.
ExitInfo.kt Public Context.historicalExitReasons / Context.lastAbnormalExit extensions.
CrashHandler.kt Internal UncaughtExceptionHandler + ActivityLifecycleCallbacks. Tracks the current activity and live activity count (backStackCount).
FireLooper.kt Reflection-based main loop that survives main-thread exceptions; isSafe guards double-install.
RecoveryState.kt RecoveryStateCodec — encodes recovery progress into a ≤128-byte blob for setProcessStateSummary (API 30+).

Rules for changing this module

Tests (src/test/java/...)

JVM unit tests run under Robolectric — no device needed.

./gradlew :firecrasher:test        # unit tests
./gradlew :firecrasher:apiCheck    # ABI baseline comparison
./gradlew :firecrasher:apiDump     # regenerate the ABI baseline

Suites: RecoveryLevelEvaluationTest (level selection), BackStackCountTest, CrashHandlerTest (crash delivery), FireCrasherDslTest (scope population, auto-recover default, forced-level recover), GoBackDispatchTest (dispatcher vs. legacy back), ExitInfoTest (@Config(sdk = [30, 36])), RecoveryStateCodecTest. Add a test alongside any behavior change.