package com.tencent.mm.plugin.appbrand.appcache;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.kernel.g;
import com.tencent.mm.plugin.appbrand.appcache.a.a;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.j;

public final class ap {
    final b gUn = new b(this);

    ap() {
        AppMethodBeat.i(59507);
        AppMethodBeat.o(59507);
    }

    public static String avY() {
        AppMethodBeat.i(59508);
        String str = g.RP().cachePath;
        if (!str.endsWith("/")) {
            str = str + "/";
        }
        str = str + "appbrand/pkg/";
        j.aih(str);
        AppMethodBeat.o(59508);
        return str;
    }

    public final int b(a aVar) {
        AppMethodBeat.i(59509);
        if (this.gUn.ajd(aVar.vdC)) {
            ab.i("MicroMsg.AppBrandWxaPkgDownloadPerformer", "addRequestIfNotRunning, urlKey %s already in queue", new Object[]{aVar.vdC});
            AppMethodBeat.o(59509);
            return 0;
        }
        ab.i("MicroMsg.AppBrandWxaPkgDownloadPerformer", "addRequestIfNotRunning, urlKey %s, addResult %d", new Object[]{aVar.vdC, Integer.valueOf(this.gUn.b(aVar))});
        AppMethodBeat.o(59509);
        return this.gUn.b(aVar);
    }
}
