SHA256
Block cross-origin POSTs, preserve bounded generated exports without relaxing CSP, bind picker results to their initiating context, erase camera cache and constrain platform permissions. Upgrade vulnerable build/test tooling and lock runtime/build dependencies. JVM regressions, lint and unsigned release builds pass; extended emulator validation remains separate.
24 lines
560 B
Kotlin
24 lines
560 B
Kotlin
package community.yuvomi.mobile
|
|
|
|
/** Never delivers a late system-picker result into a different server/web context. */
|
|
class SelectionGate {
|
|
private var owner: Int? = null
|
|
val outstanding: Boolean get() = owner != null
|
|
|
|
fun begin(generation: Int): Boolean {
|
|
if (outstanding) return false
|
|
owner = generation
|
|
return true
|
|
}
|
|
|
|
fun consume(generation: Int): Boolean {
|
|
val previous = owner
|
|
owner = null
|
|
return previous == generation
|
|
}
|
|
|
|
fun restoreOutstanding() {
|
|
owner = -1
|
|
}
|
|
}
|