DEV Community

Cover image for The Scope Is Cancelled, the Work Isn’t: Four Quiet Escapes from viewModelScope
Android Expert
Android Expert

Posted on Originally published at Medium

The Scope Is Cancelled, the Work Isn’t: Four Quiet Escapes from viewModelScope

Most Android teams learn one rule early: launch from viewModelScope, and the work stops when the ViewModel is cleared. That rule is true, but it hides a condition. viewModelScope only cancels the work that is still a child of its Job and that cooperates with cancellation. Anything that has been detached, shielded, or never tied to the scope in the first place keeps running after onCleared().

None of the four cases below crash. They show up as battery drain, duplicate network calls, writes that land after the user has left, and memory that refuses to go away. Each section has the same shape: a realistic bug, a deterministic TestScope test that proves it, the fix, and the production failure mode that makes it worth caring about.

four-leaks-overview

The next picture shows where each one breaks the chain between onCleared() and the work that should stop.

scope-escape-routes

The test harness (shared by every example)

Every test below uses the same three pieces. Set them up once.

Dependencies (versions are illustrative; use the current stable releases):

// build.gradle.kts (module)
dependencies {
    // Production code (your ViewModels live in src/main, so these are implementation)
    implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.0")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2")

    // Tests only
    testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2")
    testImplementation("junit:junit:4.13.2")
}
Enter fullscreen mode Exit fullscreen mode

The examples use StateFlow and the other Flow APIs, which come from kotlinx-coroutines-core transitively. If you collect state in Compose, collectAsStateWithLifecycle() additionally needs androidx.lifecycle:lifecycle-runtime-compose in your UI module.

Each snippet below lists its own imports. The “fixed” tests are written as bare @Test methods: add each one to the test class shown just above it.

A rule that replaces Dispatchers.Main. viewModelScope runs on Dispatchers.Main.immediate, which does not exist in a plain JVM test.

import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.StandardTestDispatcher
import kotlinx.coroutines.test.TestDispatcher
import kotlinx.coroutines.test.resetMain
import kotlinx.coroutines.test.setMain
import org.junit.rules.TestWatcher
import org.junit.runner.Description

@OptIn(ExperimentalCoroutinesApi::class)
class MainDispatcherRule(
    private val dispatcher: TestDispatcher = StandardTestDispatcher(),
) : TestWatcher() {
    override fun starting(description: Description) = Dispatchers.setMain(dispatcher)
    override fun finished(description: Description) = Dispatchers.resetMain()
}
Enter fullscreen mode Exit fullscreen mode

A way to trigger the real onCleared() path. Instead of calling viewModelScope.cancel() by hand, which skips the framework's own logic, let a ViewModelStore do it. ViewModelStore.clear() is public and goes through the same code that an Activity or navigation back stack entry uses when it is destroyed.

import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelStore

inline fun <reified VM : ViewModel> ViewModelStore.create(crossinline build: () -> VM): VM =
    ViewModelProvider(
        this,
        object : ViewModelProvider.Factory {
            @Suppress("UNCHECKED_CAST")
            override fun <T : ViewModel> create(modelClass: Class<T>): T = build() as T
        },
    )[VM::class.java]
Enter fullscreen mode Exit fullscreen mode

Because runTest adopts the scheduler of the Dispatchers.Main test dispatcher, everything below shares one virtual clock. delay(100) costs nothing in wall time, and advanceTimeBy lets us stop at an exact moment, such as 250 ms in, and clear the ViewModel there.

A note on style: each leak has two tests. The first is a characterization test that asserts the buggy behavior, so it passes while the bug exists and fails the day someone fixes it by accident. The second asserts the correct behavior against the fixed code.

Leak 1: NonCancellable wrapped around the whole job

The bug

Someone wanted an upload to “finish no matter what,” so they wrapped the body in withContext(NonCancellable).

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.NonCancellable
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

interface ChunkUploader {
    suspend fun upload(chunk: Int)
    suspend fun flushCheckpoint()
}

class LeakyUploadViewModel(
    private val uploader: ChunkUploader,
    private val chunks: Int = 10,
) : ViewModel() {

    fun sync() {
        viewModelScope.launch {
            withContext(NonCancellable) {          // the whole body is now immune
                repeat(chunks) { uploader.upload(it) }
            }
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

NonCancellable is a Job that is always active. When it is placed in the context, the coroutine inside no longer observes cancellation from its parent. The outer launch is cancelled, but the inner block never finds out, so every remaining chunk is still uploaded.

noncancellable-timeline

The test that proves it

import kotlinx.coroutines.delay
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.advanceTimeBy
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.runTest
import org.junit.Assert.assertEquals
import org.junit.Rule
import org.junit.Test

class RecordingUploader : ChunkUploader {
    val uploaded = mutableListOf<Int>()
    var checkpoints = 0

    override suspend fun upload(chunk: Int) {
        delay(100)
        uploaded += chunk
    }

    override suspend fun flushCheckpoint() {
        delay(10)
        checkpoints++
    }
}

@OptIn(ExperimentalCoroutinesApi::class)
class NonCancellableLeakTest {

    @get:Rule
    val main = MainDispatcherRule()

    @Test
    fun `leaky - uploads keep running after the ViewModel is cleared`() = runTest {
        val uploader = RecordingUploader()
        val store = ViewModelStore()
        val vm = store.create { LeakyUploadViewModel(uploader) }

        vm.sync()
        advanceTimeBy(250)                 // chunks 0 and 1 are done
        assertEquals(listOf(0, 1), uploader.uploaded)

        store.clear()                      // the real onCleared() path
        advanceUntilIdle()

        assertEquals((0..9).toList(), uploader.uploaded)   // 8 chunks after clear: the leak
    }
}
Enter fullscreen mode Exit fullscreen mode

The fix

NonCancellable has exactly one legitimate job: protecting short cleanup inside a finally block, where the coroutine is already cancelled and any suspending call would otherwise throw immediately.

// imports: same as LeakyUploadViewModel above
class UploadViewModel(
    private val uploader: ChunkUploader,
    private val chunks: Int = 10,
) : ViewModel() {

    fun sync() {
        viewModelScope.launch {
            try {
                repeat(chunks) { uploader.upload(it) }      // cancellable work
            } finally {
                withContext(NonCancellable) {               // short, bounded cleanup only
                    uploader.flushCheckpoint()
                }
            }
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Add this to NonCancellableLeakTest:

    @Test
    fun `fixed - upload stops on clear and only the checkpoint survives`() = runTest {
        val uploader = RecordingUploader()
        val store = ViewModelStore()
        val vm = store.create { UploadViewModel(uploader) }

        vm.sync()
        advanceTimeBy(250)
        store.clear()
        advanceUntilIdle()

        assertEquals(listOf(0, 1), uploader.uploaded)   // chunk 2 was cut mid-delay
        assertEquals(1, uploader.checkpoints)           // cleanup still ran
    }
Enter fullscreen mode Exit fullscreen mode

The production failure mode

The test uses chunks, but the real version is a profile photo upload that continues after the user has left the screen, a sync that holds a database transaction open, or a payment confirmation that is posted twice because the user retried. The fix above has a second lesson: if the work genuinely must finish no matter what, viewModelScope is the wrong owner. That requirement belongs to WorkManager or to an application-scoped coroutine scope that you inject and can test. Using NonCancellable to push a job past its owner's lifetime hides a design decision inside a flag.

Two review smells to grep for: withContext(NonCancellable) with no finally above it, and NonCancellable around anything that calls the network.

Leak 2: callbackFlow with an empty awaitClose

The bug

A callbackFlow is a bridge from a callback API into a Flow. The contract has two halves: register the callback, and unregister it when the collector goes away. The second half lives in awaitClose.

First, a clarification, because this leak is often described slightly wrong. If you leave awaitClose out entirely, callbackFlow does not silently leak. It throws an IllegalStateException as soon as the block returns, which tells you to end the block with awaitClose. That is the compiler-grade safety net. The leak appears when a developer, annoyed by that exception, satisfies it with the shortest thing that compiles: an empty awaitClose { }, or the no-argument awaitClose() copied from a snippet. The two are the same thing: the block parameter defaults to an empty lambda, so both compile and both clean up nothing.

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.launch

fun interface Listener {
    fun onReading(value: Int)
}

interface SensorSource {
    fun register(listener: Listener)
    fun unregister(listener: Listener)
}

fun SensorSource.leakyReadings(): Flow<Int> = callbackFlow {
    val listener = Listener { trySend(it) }
    register(listener)
    awaitClose { }                      // suspends correctly, cleans up nothing
}

class ReadingsViewModel(readings: Flow<Int>) : ViewModel() {
    private val _latest = MutableStateFlow(0)
    val latest: StateFlow<Int> = _latest

    init {
        viewModelScope.launch { readings.collect { _latest.value = it } }
    }
}
Enter fullscreen mode Exit fullscreen mode

When the ViewModel is cleared, the collector is cancelled and the empty block runs, but the sensor still holds a reference to the listener. The coroutine is gone. The registration is not.

callbackflow-listener-lifecycle

The test that proves it

import kotlinx.coroutines.test.runCurrent

class FakeSensorSource : SensorSource {
    val listeners = mutableSetOf<Listener>()
    override fun register(listener: Listener) { listeners += listener }
    override fun unregister(listener: Listener) { listeners -= listener }
    fun emit(value: Int) = listeners.toList().forEach { it.onReading(value) }
}

@OptIn(ExperimentalCoroutinesApi::class)
class CallbackFlowLeakTest {

    @get:Rule
    val main = MainDispatcherRule()

    @Test
    fun `leaky - listener is still registered after the ViewModel is cleared`() = runTest {
        val source = FakeSensorSource()
        val store = ViewModelStore()
        store.create { ReadingsViewModel(source.leakyReadings()) }

        runCurrent()                                   // let init start collecting
        assertEquals(1, source.listeners.size)

        store.clear()
        runCurrent()

        assertEquals(1, source.listeners.size)         // leaked: the hardware stays subscribed
    }
}
Enter fullscreen mode Exit fullscreen mode

The fix

// extra import: kotlinx.coroutines.flow.conflate (the others are as above)
fun SensorSource.readings(): Flow<Int> = callbackFlow {
    val listener = Listener { trySend(it) }
    register(listener)
    awaitClose { unregister(listener) }                // symmetric with register
}.conflate()                                           // a slow collector sees the latest value
Enter fullscreen mode Exit fullscreen mode

Add this to CallbackFlowLeakTest:

    @Test
    fun `fixed - listener is removed when the ViewModel is cleared`() = runTest {
        val source = FakeSensorSource()
        val store = ViewModelStore()
        val vm = store.create { ReadingsViewModel(source.readings()) }

        runCurrent()
        source.emit(42); runCurrent()
        assertEquals(42, vm.latest.value)
        assertEquals(1, source.listeners.size)

        store.clear()
        runCurrent()

        assertEquals(0, source.listeners.size)
    }
Enter fullscreen mode Exit fullscreen mode

The production failure mode

With a fake, the cost is a counter. With a real SensorManager, LocationManager, ConnectivityManager.NetworkCallback, or a Bluetooth scan, the cost is hardware that stays powered and a system service that holds your callback alive. In the process-death-free happy path nothing breaks; the battery graph just looks worse in the Play Console vitals three weeks later.

Three habits make this class of bug rare:

  • Pair every register with an unregister in the same lexical block, and read them together in review.
  • Use trySend inside callbacks, never send. Callbacks are not suspend contexts, and trySend fails quietly when the channel is closed, which is exactly what happens in the race between cancellation and a late callback.
  • Treat an awaitClose whose lambda is empty as a code smell. Either the API has nothing to release, which is rare, or the cleanup was forgotten.

Leak 3: a library-internal GlobalScope

The bug

This one is not in your code. You wrote the correct thing:

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.async
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

class FeedViewModel(private val fetch: suspend () -> List<Int>) : ViewModel() {
    fun refresh() {
        viewModelScope.launch { fetch() }
    }
}
Enter fullscreen mode Exit fullscreen mode

The fetch function comes from an SDK, an internal shared module, or an older repository class. Inside it, somebody wanted the work on a specific dispatcher and reached for GlobalScope:

class PagedClient(
    private val io: CoroutineDispatcher,
    private val pages: Int = 5,
) {
    val fetched = mutableListOf<Int>()

    @OptIn(DelicateCoroutinesApi::class)
    suspend fun leakyFetchAll(): List<Int> =
        GlobalScope.async(io) { loadPages() }.await()      // detached: no parent Job

    suspend fun fetchAll(): List<Int> =
        withContext(io) { loadPages() }                    // child of the caller

    private suspend fun loadPages(): List<Int> {
        repeat(pages) {
            delay(100)
            fetched += it
        }
        return fetched.toList()
    }
}
Enter fullscreen mode Exit fullscreen mode

await() suspends the caller until the Deferred completes. When the caller is cancelled, await() throws CancellationException, and the caller is done. The Deferred is a different story. It was created on GlobalScope, which has no Job, so nothing tells it to stop. The API looks cancellable from the outside, and the signature gives no hint.

globalscope-job-tree

The test that proves it

import kotlinx.coroutines.test.StandardTestDispatcher

@OptIn(ExperimentalCoroutinesApi::class)
class GlobalScopeLeakTest {

    @get:Rule
    val main = MainDispatcherRule()

    @Test
    fun `leaky - the detached async keeps fetching after the ViewModel is cleared`() = runTest {
        val client = PagedClient(io = StandardTestDispatcher(testScheduler))
        val store = ViewModelStore()
        val vm = store.create { FeedViewModel(client::leakyFetchAll) }

        vm.refresh()
        advanceTimeBy(250)
        assertEquals(listOf(0, 1), client.fetched)

        store.clear()
        advanceUntilIdle()

        assertEquals(listOf(0, 1, 2, 3, 4), client.fetched)    // three more pages after clear
    }
}
Enter fullscreen mode Exit fullscreen mode

The only test-specific trick is passing StandardTestDispatcher(testScheduler) into the client, so the detached coroutine runs on the same virtual clock. Without it, the leak would still exist but you could not observe it deterministically.

The fix

If you own the code, the fix is the withContext version above: the work becomes a child of the caller and inherits its cancellation.

Add this to GlobalScopeLeakTest:

    @Test
    fun `fixed - fetching stops when the ViewModel is cleared`() = runTest {
        val client = PagedClient(io = StandardTestDispatcher(testScheduler))
        val store = ViewModelStore()
        val vm = store.create { FeedViewModel(client::fetchAll) }

        vm.refresh()
        advanceTimeBy(250)
        store.clear()
        advanceUntilIdle()

        assertEquals(listOf(0, 1), client.fetched)
    }
Enter fullscreen mode Exit fullscreen mode

If you do not own the code, you have three options, in order of preference:

  1. Ask for a scope or dispatcher parameter. A library that accepts a CoroutineScope lets you decide the lifetime. This is the right API shape.
  2. Use its cancellation handle. Many callback or Call-style libraries return something cancellable. Bridge it to coroutines so that cancelling the coroutine cancels the call:
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlinx.coroutines.suspendCancellableCoroutine

interface Callback<T> {
    fun onResult(value: T)
    fun onError(error: Throwable)
}

interface LegacyCall<T> {
    fun enqueue(callback: Callback<T>)
    fun cancel()
}

suspend fun <T> LegacyCall<T>.await(): T = suspendCancellableCoroutine { cont ->
    cont.invokeOnCancellation { cancel() }               // the important line
    enqueue(object : Callback<T> {
        override fun onResult(value: T) = cont.resume(value)
        override fun onError(error: Throwable) = cont.resumeWithException(error)
    })
}
Enter fullscreen mode Exit fullscreen mode

3. Bound the damage. Wrap the call in withTimeout, make the operation idempotent, and add a request token so a stale response is dropped on arrival. This does not stop the work, but it stops the work from corrupting state.

The production failure mode

A detached fetch that finishes after the screen is gone is usually harmless on its own. The damage appears in combination: the user rotates or re-enters the screen quickly, a new ViewModel starts a second fetch, and now two loads race to write the same cache. Another common version is an SDK that retries with backoff on a global scope, so a request outlives the screen by minutes.

Finding it in a dependency. The Kotlin compiler marks GlobalScope as a delicate API, but that warning only covers your own sources. To check a dependency, search the compiled classes:

unzip -o some-library.aar classes.jar -d /tmp/lib
unzip -o /tmp/lib/classes.jar -d /tmp/lib/classes
grep -rl "kotlinx/coroutines/GlobalScope" /tmp/lib/classes
Enter fullscreen mode Exit fullscreen mode

Any hit is a class worth reading. For your own code, enable a lint rule that flags GlobalScope usage, such as detekt's GlobalCoroutineUsage, so the problem cannot be re-introduced.

Leak 4: stateIn with SharingStarted.Eagerly

The bug

This is the subtlest of the four, because the scope does cancel correctly. The issue is when the upstream runs, not whether it stops at onCleared().

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.stateIn

class PricesViewModel(
    upstream: Flow<Int>,
    started: SharingStarted,
) : ViewModel() {
    val state: StateFlow<Int> = upstream.stateIn(
        scope = viewModelScope,
        started = started,
        initialValue = 0,
    )
}
Enter fullscreen mode Exit fullscreen mode

With SharingStarted.Eagerly, the upstream starts the moment the ViewModel is constructed and keeps running regardless of subscribers. Its only stopping conditions are that viewModelScope is cancelled, or that the upstream itself completes or throws, and neither depends on whether a single collector exists. If the ViewModel is scoped to an Activity or a navigation graph, as most shared and parent ViewModels are, it can outlive many foreground sessions. In the meantime the app might be in the background, with a database observer, a WebSocket, or a location stream still running for nobody.

statein-sharing-started

The test that proves it

The upstream below emits once and then suspends forever, and it reports when it is active. It is deliberately not an infinite loop: advanceUntilIdle() would never return on one.

import androidx.lifecycle.ViewModelStore
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.test.advanceTimeBy
import kotlinx.coroutines.test.runCurrent
import kotlinx.coroutines.test.runTest
import org.junit.Assert.assertEquals
import org.junit.Rule
import org.junit.Test
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.onCompletion
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.launch

class TrackedUpstream {
    var active = 0
        private set

    val flow: Flow<Int> = flow {
        emit(1)
        awaitCancellation()
    }
        .onStart { active++ }
        .onCompletion { active-- }
}

@OptIn(ExperimentalCoroutinesApi::class)
class StateInEagerlyLeakTest {

    @get:Rule
    val main = MainDispatcherRule()

    @Test
    fun `leaky - Eagerly keeps the upstream hot with no subscriber at all`() = runTest {
        val upstream = TrackedUpstream()
        val store = ViewModelStore()
        val vm = store.create { PricesViewModel(upstream.flow, SharingStarted.Eagerly) }

        runCurrent()
        assertEquals(1, upstream.active)               // nobody is collecting yet

        val ui = launch { vm.state.collect { } }       // the screen appears...
        runCurrent()
        ui.cancel()                                    // ...and goes to the background
        advanceTimeBy(60_000)
        runCurrent()

        assertEquals(1, upstream.active)               // a full minute later: still running
        store.clear()
    }
}
Enter fullscreen mode Exit fullscreen mode

The fix

For anything with a real cost (I/O, radios, sensors, persistent connections), use WhileSubscribed with a grace period.

In production, only the started argument changes:

PricesViewModel(upstream, SharingStarted.WhileSubscribed(stopTimeoutMillis = 5_000))
Enter fullscreen mode Exit fullscreen mode

Add this to StateInEagerlyLeakTest:

    @Test
    fun `fixed - WhileSubscribed starts on demand and stops after the grace period`() = runTest {
        val upstream = TrackedUpstream()
        val store = ViewModelStore()
        val vm = store.create {
            PricesViewModel(upstream.flow, SharingStarted.WhileSubscribed(5_000))
        }

        runCurrent()
        assertEquals(0, upstream.active)               // nothing runs before the first subscriber

        val ui = launch { vm.state.collect { } }
        runCurrent()
        assertEquals(1, upstream.active)

        ui.cancel()
        advanceTimeBy(4_000); runCurrent()
        assertEquals(1, upstream.active)               // still inside the grace period

        advanceTimeBy(1_001); runCurrent()
        assertEquals(0, upstream.active)               // stopped, and the ViewModel is still alive
        store.clear()
    }
Enter fullscreen mode Exit fullscreen mode

Why a grace period and not zero

A configuration change, such as a rotation or a locale switch, destroys the collecting UI and recreates it within a short interval. A stop timeout of zero would tear down and rebuild the upstream on every rotation. Five seconds is the value Android’s architecture guidance uses as a starting point: long enough to bridge a typical configuration change, short enough that a backgrounded app stops its work reasonably quickly. Treat it as a default to tune, because recreation time varies with device and screen complexity. In Compose, pair it with collectAsStateWithLifecycle(). That collector unsubscribes when the lifecycle drops below STARTED, which is what lets the timer run at all. A plain collectAsState() keeps subscribing while the app is in the background and defeats the whole mechanism.

When Eagerly is fine

It is not wrong everywhere. It is a reasonable choice when the upstream is cheap and purely in memory, when you need the first value computed before any UI exists, or when the ViewModel is short-lived by construction. The rule of thumb: ask what the upstream costs while nobody looks. If the answer is “nothing,” Eagerly is fine. If the answer involves a cursor, a socket, a radio, or a license-metered API, it is not.

A short review checklist

Put these four questions into code review. Each one maps to a section above.

  1. Is there a NonCancellable that is not inside a finally?
  2. Does every callbackFlow end with an awaitClose that undoes what the block registered?
  3. Does any suspend function we call, including in third-party code, create a coroutine on a scope we do not control?
  4. For every stateIn, what does the upstream cost when there are zero collectors?

🔚 Wrapping up

The four leaks share a root cause. viewModelScope is a promise about a tree of Jobs, and each leak is a way to put work somewhere off that tree: inside a shield, behind a callback, under a different root, or on a timer that ignores the audience. The tests in this post work because they make "after the ViewModel is cleared" a precise moment on a virtual clock, which turns a vague sense that "something keeps running" into an assertion that either passes or fails.

If you add one thing to your project after reading this, make it the ViewModelStore-based create helper and a MainDispatcherRule. With those two in place, a leak test for any new ViewModel is about a dozen lines.

🔐 Go Beyond Using Android — Master How It’s Actually Secured

If you’re building, testing, or breaking Android apps, understanding the security model beneath the SDK separates developers who follow best practices from those who truly understand why those practices exist. I highly recommend “Mastering Android Security: From Fundamentals to Advanced Practice.” It’s a comprehensive, architecture-first journey through app sandboxing, cryptography, network defense, reverse engineering, and exploitation — spanning everything from AndroidManifest.xml internals to TrustZone and the Verified Boot chain, with hands-on labs at every step.

Top comments (0)