APKPure.apk(点击下载) / g.java


package e.g.a.u.t;

import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import com.tencent.trpcprotocol.projecta.common.game_info.nano.GameInfo;
import e.g.a.i0.q0;
import i.i.d.e.b;
import java.util.ArrayList;
import java.util.List;
import k.g.c;
import o.k;
import o.m;
import o.p.d;
import o.p.j.a.e;
import o.p.j.a.i;
import o.s.b.p;
import o.s.c.j;
import p.a.b0;

@e(c = "com.apkpure.aegon.minigames.shortcut.MiniGameShortcutUtils$createShortcut$1", f = "MiniGameShortcutUtils.kt", l = {}, m = "invokeSuspend")
public final class g extends i implements p<b0, d<? super m>, Object> {
    public final /* synthetic */ GameInfo $gameInfo;
    public final /* synthetic */ boolean $isDetail;
    public final /* synthetic */ Context $mContext;
    public int label;

    public static final class a extends e.h.a.q.k.i<Bitmap> {

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ Context f7313e;

        /* renamed from: f  reason: collision with root package name */
        public final /* synthetic */ boolean f7314f;

        /* renamed from: g  reason: collision with root package name */
        public final /* synthetic */ GameInfo f7315g;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public a(Context context, boolean z, GameInfo gameInfo) {
            super(Integer.MIN_VALUE, Integer.MIN_VALUE);
            this.f7313e = context;
            this.f7314f = z;
            this.f7315g = gameInfo;
        }

        @Override // e.h.a.q.k.k
        public void b(Object obj, e.h.a.q.l.d dVar) {
            Bitmap bitmap = (Bitmap) obj;
            j.e(bitmap, "resource");
            h hVar = h.f7316a;
            Context context = this.f7313e;
            boolean z = this.f7314f;
            GameInfo gameInfo = this.f7315g;
            try {
                if (!i.i.d.e.d.b(context)) {
                    q0.a("MiniGameShortcutUtils", "createDesktopShortcut: not support");
                    return;
                }
                if (z) {
                    if ((gameInfo == null ? null : Long.valueOf(gameInfo.gameId)) == null) {
                        return;
                    }
                }
                k<String, String, Uri> a2 = hVar.a(z, context, gameInfo);
                String a3 = a2.a();
                String b = a2.b();
                b b2 = hVar.b(context, b, a3, bitmap, a2.d());
                List<b> c = hVar.c(context, b, b2);
                if (!((ArrayList) c).isEmpty()) {
                    i.i.d.e.d.d(context, c);
                } else {
                    i.i.d.e.d.c(context, b2, null);
                }
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public g(boolean z, GameInfo gameInfo, Context context, d<? super g> dVar) {
        super(2, dVar);
        this.$isDetail = z;
        this.$gameInfo = gameInfo;
        this.$mContext = context;
    }

    @Override // o.p.j.a.a
    public final d<m> create(Object obj, d<?> dVar) {
        return new g(this.$isDetail, this.$gameInfo, this.$mContext, dVar);
    }

    @Override // o.p.j.a.a
    public final Object invokeSuspend(Object obj) {
        String str;
        m mVar = m.f15828a;
        if (this.label == 0) {
            c.u0(obj);
            try {
                if (!this.$isDetail) {
                    str = "https://image.winudf.com/v2/user/admin/YWRtaW5f5ri45oiP5Lit5b-D6KeS5qCHLnBuZ18xNjYwMjg0ODU0NDMy/image.png?fakeurl=1";
                } else {
                    GameInfo gameInfo = this.$gameInfo;
                    if (gameInfo == null) {
                        return mVar;
                    }
                    str = gameInfo.iconUrl;
                }
                e.h.a.c.f(this.$mContext).k().d0(str).W(new a(this.$mContext, this.$isDetail, this.$gameInfo));
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            return mVar;
        }
        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
    }

    /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
    @Override // o.s.b.p
    public Object j(b0 b0Var, d<? super m> dVar) {
        return new g(this.$isDetail, this.$gameInfo, this.$mContext, dVar).invokeSuspend(m.f15828a);
    }
}