package B5;

import A6.n;
import O6.p;
import Z6.InterfaceC0382w;
import android.content.Context;
import android.graphics.Bitmap;
import com.google.android.gms.internal.measurement.C1;
import java.io.ByteArrayOutputStream;
import v0.AbstractC1664c;

/* JADX INFO: loaded from: classes.dex */
public final class c extends G6.i implements p {

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public final /* synthetic */ h f999u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public final /* synthetic */ int f1000v;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public c(h hVar, int i, E6.d dVar) {
        super(2, dVar);
        this.f999u = hVar;
        this.f1000v = i;
    }

    @Override // O6.p
    public final Object k(Object obj, Object obj2) {
        return ((c) m((E6.d) obj2, (InterfaceC0382w) obj)).p(n.f457a);
    }

    @Override // G6.a
    public final E6.d m(E6.d dVar, Object obj) {
        return new c(this.f999u, this.f1000v, dVar);
    }

    @Override // G6.a
    public final Object p(Object obj) throws Throwable {
        Object objJ;
        C1.N(obj);
        Context contextO = this.f999u.o();
        int i = this.f1000v;
        if (contextO == null) {
            return null;
        }
        try {
            Bitmap bitmapC = AbstractC1664c.C(contextO, i);
            if (bitmapC == null) {
                objJ = null;
            } else {
                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                bitmapC.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
                objJ = byteArrayOutputStream.toByteArray();
            }
        } catch (Throwable th) {
            objJ = C1.j(th);
        }
        return (byte[]) (objJ instanceof A6.i ? null : objJ);
    }
}
