WeChat.apk(点击下载) / JsApiRequestSRFile.java


package com.tencent.mm.plugin.appbrand.jsapi.webrtc;

import android.os.Parcel;
import android.os.Parcelable;
import com.tencent.mm.ipcinvoker.e;
import com.tencent.mm.ipcinvoker.extension.XIPCInvoker;
import com.tencent.mm.plugin.appbrand.jsapi.d;
import com.tencent.mm.plugin.appbrand.jsapi.g;
import com.tencent.mm.plugin.appbrand.jsapi.webrtc.l;
import com.tencent.mm.plugin.downloader.model.l;
import com.tencent.mm.plugin.downloader.model.n;
import com.tencent.mm.sdk.platformtools.Log;
import com.tencent.mm.sdk.platformtools.WeChatProcess;
import java.util.concurrent.ConcurrentHashMap;
import kotlin.Metadata;
import kq.y;
import lh4.m;
import org.json.JSONObject;
import vj.r;
import yz3.j;

public final class JsApiRequestSRFile extends d<g> {
    public static final int CTRL_INDEX = 1206;
    public static final String NAME = "requestSRFile";

    /* renamed from: g  reason: collision with root package name */
    public String f90737g = "";

    /* renamed from: h  reason: collision with root package name */
    public String f90738h = "";

    @Metadata(bv = {}, d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0007\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Lcom/tencent/mm/plugin/appbrand/jsapi/webrtc/JsApiRequestSRFile$GetDownloadInfo;", "Landroid/os/Parcelable;", "plugin-appbrand-integration_release"}, k = 1, mv = {1, 7, 1})
    public static final class GetDownloadInfo implements Parcelable {
        public static final Parcelable.Creator<GetDownloadInfo> CREATOR = new a();

        /* renamed from: d  reason: collision with root package name */
        public final String f90739d;

        /* renamed from: e  reason: collision with root package name */
        public final String f90740e;

        public static final class a implements Parcelable.Creator<GetDownloadInfo> {
            /* Return type fixed from 'java.lang.Object' to match base method */
            @Override // android.os.Parcelable.Creator
            public GetDownloadInfo createFromParcel(Parcel parcel) {
                m.g(parcel, "parcel");
                return new GetDownloadInfo(parcel.readString(), parcel.readString());
            }

            /* Return type fixed from 'java.lang.Object[]' to match base method */
            @Override // android.os.Parcelable.Creator
            public GetDownloadInfo[] newArray(int i15) {
                return new GetDownloadInfo[i15];
            }
        }

        public GetDownloadInfo(String str, String str2) {
            m.g(str, "cdnUrl");
            m.g(str2, "fileMd5");
            this.f90739d = str;
            this.f90740e = str2;
        }

        public int describeContents() {
            return 0;
        }

        public void writeToParcel(Parcel parcel, int i15) {
            m.g(parcel, "out");
            parcel.writeString(this.f90739d);
            parcel.writeString(this.f90740e);
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0007\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Lcom/tencent/mm/plugin/appbrand/jsapi/webrtc/JsApiRequestSRFile$GetDownloadStatus;", "Landroid/os/Parcelable;", "plugin-appbrand-integration_release"}, k = 1, mv = {1, 7, 1})
    public static final class GetDownloadStatus implements Parcelable {
        public static final Parcelable.Creator<GetDownloadStatus> CREATOR = new a();

        /* renamed from: d  reason: collision with root package name */
        public final int f90741d;

        public static final class a implements Parcelable.Creator<GetDownloadStatus> {
            /* Return type fixed from 'java.lang.Object' to match base method */
            @Override // android.os.Parcelable.Creator
            public GetDownloadStatus createFromParcel(Parcel parcel) {
                m.g(parcel, "parcel");
                return new GetDownloadStatus(parcel.readInt());
            }

            /* Return type fixed from 'java.lang.Object[]' to match base method */
            @Override // android.os.Parcelable.Creator
            public GetDownloadStatus[] newArray(int i15) {
                return new GetDownloadStatus[i15];
            }
        }

        public GetDownloadStatus(int i15) {
            this.f90741d = i15;
        }

        public int describeContents() {
            return 0;
        }

        public void writeToParcel(Parcel parcel, int i15) {
            m.g(parcel, "out");
            parcel.writeInt(this.f90741d);
        }
    }

    @n40.a
    @Metadata(bv = {}, d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0003\u0018\u00002\u000e\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u00030\u0001B\u0007¢\u0006\u0004\b\u0004\u0010\u0005¨\u0006\u0006"}, d2 = {"Lcom/tencent/mm/plugin/appbrand/jsapi/webrtc/JsApiRequestSRFile$a;", "Lcom/tencent/mm/ipcinvoker/e;", "Lcom/tencent/mm/plugin/appbrand/jsapi/webrtc/JsApiRequestSRFile$GetDownloadInfo;", "Lcom/tencent/mm/plugin/appbrand/jsapi/webrtc/JsApiRequestSRFile$GetDownloadStatus;", "<init>", "()V", "plugin-appbrand-integration_release"}, k = 1, mv = {1, 7, 1})
    public static final class a implements e<GetDownloadInfo, GetDownloadStatus> {
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, com.tencent.mm.ipcinvoker.g] */
        @Override // com.tencent.mm.ipcinvoker.e
        public void invoke(GetDownloadInfo getDownloadInfo, com.tencent.mm.ipcinvoker.g<GetDownloadStatus> gVar) {
            GetDownloadInfo getDownloadInfo2 = getDownloadInfo;
            m.g(getDownloadInfo2, "data");
            l lVar = l.INSTANCE;
            String str = getDownloadInfo2.f90739d;
            String str2 = getDownloadInfo2.f90740e;
            g gVar2 = new g(gVar);
            lVar.getClass();
            n nVar = new n(null);
            nVar.f103517a = str;
            nVar.f103520d = str2;
            nVar.f103522f = 2;
            nVar.f103526j = false;
            if (((ConcurrentHashMap) lVar.f90794e).containsKey(str)) {
                Log.i("MicroMsg.SRDownloadFile", str + " is downloading");
                gVar2.a(5);
                return;
            }
            long b15 = ((l) ((y) j.c(y.class)).fI0()).b(nVar);
            l.b bVar = new l.b(lVar, str, str2, gVar2);
            ((ConcurrentHashMap) lVar.f90793d).put(Long.valueOf(b15), bVar);
            ((ConcurrentHashMap) lVar.f90794e).put(str, bVar);
        }
    }

    @Override // com.tencent.mm.plugin.appbrand.jsapi.d
    public void u(g gVar, JSONObject jSONObject, int i15) {
        if (gVar == null) {
            Log.w("MicroMsg.JsApiRequestSRFile", "invoke, env is null");
            return;
        }
        if (r.o()) {
            this.f90737g = "https://mmgame.qpic.cn/h5/minigame/cloudgame/arm64-v8a.zip";
            this.f90738h = "1ac39c1bb2d8db344b671a40401c4b9a";
        } else {
            this.f90737g = "https://mmgame.qpic.cn/h5/minigame/cloudgame/armeabi-v7a.zip";
            this.f90738h = "da7b68479bd4bd7b510bb66105e65795";
        }
        String str = this.f90737g;
        String str2 = this.f90738h;
        m.g(str, "cdnUrl");
        m.g(str2, "fileMd5");
        XIPCInvoker.a(WeChatProcess.PROCESS_MAIN, new GetDownloadInfo(str, str2), a.class, new h(gVar, i15, this));
    }
}