diff --git a/app/src/main/kotlin/io/flamenet/messenger/app/MainActivity.kt b/app/src/main/kotlin/io/flamenet/messenger/app/MainActivity.kt index ef7f9bf..a25b3a7 100644 --- a/app/src/main/kotlin/io/flamenet/messenger/app/MainActivity.kt +++ b/app/src/main/kotlin/io/flamenet/messenger/app/MainActivity.kt @@ -63,6 +63,29 @@ class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + // 🔴 **Screenshots off, and out of the recents thumbnail.** + // + // The second half is the one that matters and the one nobody thinks + // about: without FLAG_SECURE, Android captures whatever is on screen + // into the recent-apps preview and WRITES IT TO DISK. An open + // conversation therefore exists as a plaintext bitmap outside every + // protection this app has — the ratchet, the sealed history file, the + // ThisDeviceOnly key — none of which cover a screenshot the OS took of + // the rendered thread. + // + // ⚠️ iOS has had the equivalent since the app lock landed: it obscures + // the switcher snapshot on `scenePhase`. Android had nothing at all. + // Two platforms disagreeing about a security guarantee is how one of + // them ends up being the one that leaks. + // + // ⚠️ It also blocks screen recording and casting, which is the point, + // and is not something to make optional: a setting here is a setting + // people leave off and then get surprised by. + window.setFlags( + android.view.WindowManager.LayoutParams.FLAG_SECURE, + android.view.WindowManager.LayoutParams.FLAG_SECURE, + ) + // ⚠️ Runtime permission on API 33+, which is this app's minSdk. Without // it the service runs and every alert is dropped silently — no error, // no banner, and nothing on screen to say why. Ask once here rather