MEGA STAR IPTV v3.4版本的 MD5 值为:f68c82adeb6c1166a42c50cbe0c3cfa6

以下内容为反编译后的 b.java 源代码,内容仅作参考


package m7;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Handler;
import android.os.Looper;
import android.util.AttributeSet;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import i7.f;
import java.io.InputStream;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import x8.l;
public final class b extends WebView implements i7.e, f.b {
    private s8.b<? super i7.e, p8.e> f8812b;
    private final HashSet<j7.d> f8813c;
    private final Handler f8814d;
    private boolean f8815e;

    static final class a implements Runnable {
        final String f8817c;
        final float f8818d;

        a(String str, float f9) {
            this.f8817c = str;
            this.f8818d = f9;
        }

        @Override
        public final void run() {
            b bVar = b.this;
            bVar.loadUrl("javascript:cueVideo('" + this.f8817c + "', " + this.f8818d + ')');
        }
    }

    public static final class C0128b extends WebChromeClient {
        C0128b() {
        }

        @Override
        public Bitmap getDefaultVideoPoster() {
            Bitmap defaultVideoPoster = super.getDefaultVideoPoster();
            return defaultVideoPoster != null ? defaultVideoPoster : Bitmap.createBitmap(1, 1, Bitmap.Config.RGB_565);
        }
    }

    static final class c implements Runnable {
        final String f8820c;
        final float f8821d;

        c(String str, float f9) {
            this.f8820c = str;
            this.f8821d = f9;
        }

        @Override
        public final void run() {
            b bVar = b.this;
            bVar.loadUrl("javascript:loadVideo('" + this.f8820c + "', " + this.f8821d + ')');
        }
    }

    public static final class d implements Runnable {
        d() {
        }

        @Override
        public final void run() {
            b.this.loadUrl("javascript:pauseVideo()");
        }
    }

    static final class e implements Runnable {
        e() {
        }

        @Override
        public final void run() {
            b.this.loadUrl("javascript:playVideo()");
        }
    }

    static final class f implements Runnable {
        final float f8825c;

        f(float f9) {
            this.f8825c = f9;
        }

        @Override
        public final void run() {
            b bVar = b.this;
            bVar.loadUrl("javascript:seekTo(" + this.f8825c + ')');
        }
    }

    static final class g implements Runnable {
        final int f8827c;

        g(int i9) {
            this.f8827c = i9;
        }

        @Override
        public final void run() {
            b bVar = b.this;
            bVar.loadUrl("javascript:setVolume(" + this.f8827c + ')');
        }
    }

    public b(Context context, AttributeSet attributeSet, int i9) {
        super(context, attributeSet, i9);
        t8.c.c(context, "context");
        this.f8813c = new HashSet<>();
        this.f8814d = new Handler(Looper.getMainLooper());
    }

    public b(Context context, AttributeSet attributeSet, int i9, int i10, t8.a aVar) {
        this(context, (i10 & 2) != 0 ? null : attributeSet, (i10 & 4) != 0 ? 0 : i9);
    }

    @SuppressLint({"SetJavaScriptEnabled"})
    private final void h(k7.a aVar) {
        String e9;
        WebSettings settings = getSettings();
        t8.c.b(settings, "settings");
        settings.setJavaScriptEnabled(true);
        WebSettings settings2 = getSettings();
        t8.c.b(settings2, "settings");
        settings2.setMediaPlaybackRequiresUserGesture(false);
        WebSettings settings3 = getSettings();
        t8.c.b(settings3, "settings");
        settings3.setCacheMode(2);
        addJavascriptInterface(new i7.f(this), "YouTubePlayerBridge");
        l7.e eVar = l7.e.f8654a;
        InputStream openRawResource = getResources().openRawResource(h7.f.ayp_youtube_player);
        t8.c.b(openRawResource, "resources.openRawResourc…R.raw.ayp_youtube_player)");
        e9 = l.e(eVar.b(openRawResource), "<<injectedPlayerVars>>", aVar.toString(), false, 4, null);
        loadDataWithBaseURL(aVar.b(), e9, "text/html", "utf-8", null);
        setWebChromeClient(new C0128b());
    }

    @Override
    public void a() {
        this.f8814d.post(new e());
    }

    @Override
    public void b(float f9) {
        this.f8814d.post(new f(f9));
    }

    @Override
    public boolean c(j7.d dVar) {
        t8.c.c(dVar, "listener");
        return this.f8813c.add(dVar);
    }

    @Override
    public void d() {
        s8.b<? super i7.e, p8.e> bVar = this.f8812b;
        if (bVar == null) {
            t8.c.h("youTubePlayerInitListener");
        }
        bVar.c(this);
    }

    @Override
    public void destroy() {
        this.f8813c.clear();
        this.f8814d.removeCallbacksAndMessages(null);
        super.destroy();
    }

    @Override
    public boolean e(j7.d dVar) {
        t8.c.c(dVar, "listener");
        return this.f8813c.remove(dVar);
    }

    @Override
    public void f(String str, float f9) {
        t8.c.c(str, "videoId");
        this.f8814d.post(new c(str, f9));
    }

    @Override
    public void g(String str, float f9) {
        t8.c.c(str, "videoId");
        this.f8814d.post(new a(str, f9));
    }

    @Override
    public i7.e getInstance() {
        return this;
    }

    @Override
    public Collection<j7.d> getListeners() {
        Collection<j7.d> unmodifiableCollection = Collections.unmodifiableCollection(new HashSet(this.f8813c));
        t8.c.b(unmodifiableCollection, "Collections.unmodifiable…(youTubePlayerListeners))");
        return unmodifiableCollection;
    }

    public final void i(s8.b<? super i7.e, p8.e> bVar, k7.a aVar) {
        t8.c.c(bVar, "initListener");
        this.f8812b = bVar;
        if (aVar == null) {
            aVar = k7.a.f8225c.a();
        }
        h(aVar);
    }

    public final boolean j() {
        return this.f8815e;
    }

    @Override
    protected void onWindowVisibilityChanged(int i9) {
        if (this.f8815e && (i9 == 8 || i9 == 4)) {
            return;
        }
        super.onWindowVisibilityChanged(i9);
    }

    @Override
    public void pause() {
        this.f8814d.post(new d());
    }

    public final void setBackgroundPlaybackEnabled$core_release(boolean z9) {
        this.f8815e = z9;
    }

    public void setVolume(int i9) {
        if (!(i9 >= 0 && i9 <= 100)) {
            throw new IllegalArgumentException("Volume must be between 0 and 100".toString());
        }
        this.f8814d.post(new g(i9));
    }
}