package com.noibu.mobile.reactnative import android.graphics.drawable.Drawable import android.view.View import com.noibu.mobile.sessionreplay.monitors.DrawableStyle import com.noibu.mobile.sessionreplay.monitors.DrawableStyleResolver /** * Resolves RN background/border drawables for the replay walker (registered at * [NoibuModuleImpl.initialize]). The typed access lives in [ReactDrawableStyles] (Java: the RN * classes are Kotlin-internal); hosts on RN < 0.76 lack those classes, so a LinkageError * permanently disables the resolver — they degrade to no RN background/radius/border rather * than crashing. */ internal object ReactDrawableStyleResolver : DrawableStyleResolver { @Volatile private var broken = false override fun resolve(view: View, drawable: Drawable): DrawableStyle? { if (broken) return null return try { ReactDrawableStyles.resolve(view, drawable) } catch (e: LinkageError) { broken = true null } catch (_: Throwable) { null } } }