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

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.model.v;
import com.tencent.mm.model.v.b;
import com.tencent.mm.plugin.appbrand.config.h;
import com.tencent.mm.plugin.appbrand.g;
import com.tencent.mm.plugin.appbrand.jsapi.a;
import com.tencent.mm.plugin.appbrand.jsapi.audio.JsApiSetBackgroundAudioState.SetBackgroundAudioListenerTask;
import com.tencent.mm.plugin.appbrand.jsapi.audio.JsApiSetBackgroundAudioState.SetBackgroundAudioStateTask;
import com.tencent.mm.plugin.appbrand.jsapi.c;
import com.tencent.mm.plugin.appbrand.p;
import com.tencent.mm.plugin.appbrand.ui.banner.f;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.ytcommon.BuildConfig;
import java.io.File;
import org.json.JSONObject;

public final class JsApiSetBackgroundAudioStateWC extends JsApiSetBackgroundAudioState {
    /* Access modifiers changed, original: protected|final */
    public final SetBackgroundAudioStateTask b(a aVar, c cVar, int i) {
        AppMethodBeat.i(130765);
        SetBackgroundAudioStateTaskWC setBackgroundAudioStateTaskWC = new SetBackgroundAudioStateTaskWC(aVar, cVar, i);
        AppMethodBeat.o(130765);
        return setBackgroundAudioStateTaskWC;
    }

    /* Access modifiers changed, original: protected|final */
    public final SetBackgroundAudioListenerTask a(a aVar, c cVar, int i) {
        AppMethodBeat.i(130766);
        SetBackgroundAudioListenerTaskWC setBackgroundAudioListenerTaskWC = new SetBackgroundAudioListenerTaskWC(aVar, cVar, i);
        AppMethodBeat.o(130766);
        return setBackgroundAudioListenerTaskWC;
    }

    /* Access modifiers changed, original: protected|final */
    public final void a(String str, c cVar) {
        AppMethodBeat.i(130767);
        if (this.hAp != null) {
            h hVar = (h) cVar.aa(h.class);
            this.hAp.cBc = hVar.hhd.gVt;
            this.hAp.cwz = hVar.cwz;
            this.hAp.cBb = p.a(cVar);
            ab.i("MicroMsg.Music.JsApiSetBackgroundAudioState", "pkgType:%d, brandName:%s, appUserName", new Object[]{Integer.valueOf(this.hAp.cBc), this.hAp.cwz, this.hAp.cBb});
            b y = v.Zp().y(str, true);
            synchronized (y) {
                try {
                    f fVar = (f) y.get("StickyBannerChangeListener", null);
                    if (fVar == null) {
                        fVar = new 1(this, y);
                        y.j("pkgType", Integer.valueOf(hVar.hhd.gVt));
                        y.j("StickyBannerChangeListener", fVar);
                        y.j("appId", cVar.getAppId());
                    }
                    if (((g.c) y.get("AppBrandLifeCycle.Listener", null)) == null) {
                        2 2 = new 2(this, y);
                        y.j("AppBrandLifeCycle.Listener", 2);
                        this.hAp.huj = 2;
                    }
                    if (this.hAp instanceof SetBackgroundAudioListenerTaskWC) {
                        ((SetBackgroundAudioListenerTaskWC) this.hAp).hAy = fVar;
                        ((SetBackgroundAudioListenerTaskWC) this.hAp).hAx = y;
                    }
                } finally {
                    while (true) {
                    }
                    AppMethodBeat.o(130767);
                }
            }
            return;
        }
        AppMethodBeat.o(130767);
    }

    /* Access modifiers changed, original: protected|final */
    public final String a(JSONObject jSONObject, c cVar) {
        AppMethodBeat.i(130768);
        String a = super.a(jSONObject, cVar);
        if (a == null || a.length() <= 0) {
            a = BuildConfig.FLAVOR;
            AppMethodBeat.o(130768);
            return a;
        } else if (a.startsWith("http://") || a.startsWith("https://")) {
            AppMethodBeat.o(130768);
            return a;
        } else {
            File yg = cVar.asE().yg(a);
            if (yg == null || !yg.exists()) {
                a = BuildConfig.FLAVOR;
                AppMethodBeat.o(130768);
                return a;
            }
            a = yg.getAbsolutePath();
            if (!a.startsWith("file://")) {
                a = "file://".concat(String.valueOf(a));
            }
            AppMethodBeat.o(130768);
            return a;
        }
    }
}
