allstars v1.0.7版本的 MD5 值为:b2f9c811cb17ebef182dbe530299e37a

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


package com.iptv.vsaclient;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.os.Process;
import android.support.v7.a.u;
import android.view.KeyEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.google.android.exoplayer.AspectRatioFrameLayout;
import com.google.android.exoplayer.i.al;
import com.google.android.exoplayer.text.SubtitleLayout;
import com.iptv.allstart.R;
import com.iptv.vsaclient.a.l;
import com.iptv.vsaclient.a.n;
import com.iptv.vsaclient.a.o;
import com.swift.sandhook.utils.FileUtils;
import java.util.List;
public class Main extends u implements SurfaceHolder.Callback, com.google.android.exoplayer.a.e, com.iptv.vsaclient.a.g, com.iptv.vsaclient.a.j {
    public AspectRatioFrameLayout j;
    public SurfaceView k;
    public RelativeLayout l;
    public WebView m;
    public com.iptv.vsaclient.a.f n;
    public Uri q;
    private View w;
    private SubtitleLayout x;
    private String y;
    private com.google.android.exoplayer.a.b z;
    public String i = "1.0.7";
    public long o = 0;
    public boolean p = false;
    public int r = 2;
    public String s = "";
    public boolean t = false;
    public String u = "content_id";
    public String v = "";

    private void a(View view) {
        view.setSystemUiVisibility(4871);
    }

    private com.iptv.vsaclient.a.k l() {
        String a = al.a((Context) this, "vsaClient");
        switch (this.r) {
            case 0:
                return new com.iptv.vsaclient.a.a(this, a, this.q.toString(), new o(this.u, this.v));
            case 1:
                return new l(this, a, this.q.toString(), new n());
            case 2:
                return new com.iptv.vsaclient.a.d(this, a, this.q.toString(), this.t ? this.s : "");
            case 3:
                return new com.iptv.vsaclient.a.c(this, a, this.q, this.t ? this.s : "");
            default:
                throw new IllegalStateException("Unsupported type: " + this.r);
        }
    }

    private void m() {
        this.w.setVisibility(0);
    }

    private void n() {
        this.x.setStyle(new com.google.android.exoplayer.text.a(-1, 0, 0, 1, -16777216, null));
        this.x.setFractionalTextSize(1.2f * 0.0533f);
    }

    @Override
    public void a(int i, int i2, int i3, float f) {
        this.j.setAspectRatio(i2 == 0 ? 1.0f : (i * f) / i2);
    }

    public void a(long j) {
        if (this.q != null) {
            n();
            if (this.n == null) {
                this.n = new com.iptv.vsaclient.a.f(l());
                this.n.a((com.iptv.vsaclient.a.j) this);
                this.n.a((com.iptv.vsaclient.a.g) this);
                this.n.a(j);
                this.n.e();
            }
            this.n.b(this.k.getHolder().getSurface());
            this.n.a(true);
            if (!this.t || this.s == "") {
                this.n.a(2, -1);
            } else {
                this.n.a(2, 0);
            }
        }
    }

    @Override
    public void a(com.google.android.exoplayer.a.a aVar) {
        if (this.n == null || this.q == null) {
            return;
        }
        this.o = this.n.h();
        j();
        a(this.o);
    }

    @Override
    public void a(Exception exc) {
        this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.playererrorEvent)");
    }

    @Override
    public void a(List list) {
        this.x.setCues(list);
    }

    @Override
    public void a(boolean z, int i) {
        switch (i) {
            case 1:
                m();
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.playeridleEvent)");
                return;
            case 2:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.playerpreparingEvent)");
                return;
            case 3:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.playerbufferingEvent)");
                return;
            case 4:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.playerreadyEvent)");
                this.w.setVisibility(8);
                return;
            case 5:
                m();
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.playerendedEvent)");
                return;
            default:
                return;
        }
    }

    public void b(boolean z) {
        if (this.n != null) {
            this.n.f();
            this.n = null;
        }
        if (z) {
            m();
        }
    }

    public void c(boolean z) {
        SharedPreferences.Editor edit = getSharedPreferences("main", 0).edit();
        edit.putBoolean("AutoStartApplication", z);
        edit.commit();
    }

    public void j() {
        b(true);
    }

    public boolean k() {
        return getSharedPreferences("main", 0).getBoolean("AutoStartApplication", false);
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        getWindow().setFlags(FileUtils.FileMode.MODE_ISGID, FileUtils.FileMode.MODE_ISGID);
        this.y = getApplicationContext().getDir("databases", 0).getPath();
        setContentView(R.layout.activity_main);
        this.l = (RelativeLayout) findViewById(R.id.connect_error);
        TextView textView = (TextView) findViewById(R.id.exclamation);
        textView.setTypeface(Typeface.createFromAsset(getAssets(), "awesome.ttf"));
        textView.setText("\uf06a");
        ((TextView) findViewById(R.id.message)).setText(getString(R.string.service_connect_failure));
        this.w = findViewById(R.id.shutter);
        this.j = (AspectRatioFrameLayout) findViewById(R.id.video_frame);
        this.k = (SurfaceView) findViewById(R.id.surface_view);
        this.k.getHolder().addCallback(this);
        this.x = (SubtitleLayout) findViewById(R.id.subtitles);
        this.m = (WebView) findViewById(R.id.user_interface);
        this.m.addJavascriptInterface(new d(this), "vsaClient");
        a((View) this.l);
        a((View) this.m);
        this.m.setBackgroundColor(0);
        this.m.setWebViewClient(new b(this));
        this.m.setPadding(0, 0, 0, 0);
        WebSettings settings = this.m.getSettings();
        settings.setUserAgentString(settings.getUserAgentString() + " vsaClient/" + this.i);
        settings.setDomStorageEnabled(true);
        settings.setCacheMode(2);
        settings.setDatabaseEnabled(true);
        settings.setDatabasePath(this.y);
        settings.setJavaScriptEnabled(true);
        settings.setLoadWithOverviewMode(true);
        settings.setUseWideViewPort(true);
        settings.setDisplayZoomControls(false);
        settings.setBuiltInZoomControls(false);
        settings.setSupportZoom(false);
        this.m.loadUrl(getString(R.string.app_url));
        this.z = new com.google.android.exoplayer.a.b(this, this);
        this.z.a();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.z.b();
        j();
    }

    @Override
    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        switch (i) {
            case 4:
                if (this.l.getVisibility() != 0) {
                    this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.backbuttonEvent)");
                    return true;
                }
                Process.killProcess(Process.myPid());
                System.exit(0);
                return true;
            case 24:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.volumeupEvent)");
                return true;
            case 25:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.volumedownEvent)");
                return true;
            case android.support.v7.b.l.Theme_colorPrimary:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.menubuttonEvent)");
                return true;
            case android.support.v7.b.l.Theme_colorControlNormal:
            case 126:
            case 127:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.pauseEvent)");
                return true;
            case android.support.v7.b.l.Theme_colorControlHighlight:
            case android.support.v7.b.l.Theme_controlBackground:
            case 272:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.ffwdEvent)");
                return true;
            case android.support.v7.b.l.Theme_colorButtonNormal:
            case android.support.v7.b.l.Theme_colorSwitchThumbNormal:
            case 273:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.rewEvent)");
                return true;
            case 131:
            case 183:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.redF1Event)");
                return true;
            case 132:
            case 184:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.greenF2Event)");
                return true;
            case 133:
            case 185:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.yellowF3Event)");
                return true;
            case 134:
            case 186:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.blueF4Event)");
                return true;
            case 164:
                this.m.loadUrl("javascript:document.dispatchEvent(vsaEvents.volumemuteEvent)");
                return true;
            default:
                return super.onKeyDown(i, keyEvent);
        }
    }

    @Override
    public void onNewIntent(Intent intent) {
        j();
        setIntent(intent);
    }

    @Override
    public void onPause() {
        super.onPause();
        if (this.n != null) {
            this.p = this.n.c().isPlaying();
            this.o = this.n.h();
            j();
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        a((View) this.m);
        if (this.q == null || !this.p) {
            return;
        }
        a(this.o);
    }

    @Override
    public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
    }

    @Override
    public void surfaceCreated(SurfaceHolder surfaceHolder) {
        if (this.n != null) {
            this.n.b(surfaceHolder.getSurface());
        }
    }

    @Override
    public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
        if (this.n != null) {
            this.n.d();
        }
    }
}