CCIPTV PRO v3.0.9.1版本的 MD5 值为:e78d4d980447be4a9f823314f45bbf03
以下内容为反编译后的 b.java 源代码,内容仅作参考
package f.g.a.f;
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.util.Log;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import f.g.a.f.d;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
public class b extends WebView implements f.g.a.f.c, d.k {
public final Set<g> b;
public final Handler c;
public f.g.a.f.f f9456d;
public class a implements Runnable {
public final String b;
public final float c;
public a(String str, float f2) {
this.b = str;
this.c = f2;
}
@Override
public void run() {
b bVar = b.this;
bVar.loadUrl("javascript:loadVideo('" + this.b + "', " + this.c + ")");
}
}
public class RunnableC0238b implements Runnable {
public final String b;
public final float c;
public RunnableC0238b(String str, float f2) {
this.b = str;
this.c = f2;
}
@Override
public void run() {
b bVar = b.this;
bVar.loadUrl("javascript:cueVideo('" + this.b + "', " + this.c + ")");
}
}
public class c implements Runnable {
public c() {
}
@Override
public void run() {
b.this.loadUrl("javascript:playVideo()");
}
}
public class d implements Runnable {
public d() {
}
@Override
public void run() {
b.this.loadUrl("javascript:pauseVideo()");
}
}
public class e implements Runnable {
public final float b;
public e(float f2) {
this.b = f2;
}
@Override
public void run() {
b bVar = b.this;
bVar.loadUrl("javascript:seekTo(" + this.b + ")");
}
}
public class f extends WebChromeClient {
public f(b bVar) {
}
@Override
public Bitmap getDefaultVideoPoster() {
Bitmap defaultVideoPoster = super.getDefaultVideoPoster();
return defaultVideoPoster == null ? Bitmap.createBitmap(1, 1, Bitmap.Config.RGB_565) : defaultVideoPoster;
}
}
public b(Context context) {
this(context, null);
}
public b(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public b(Context context, AttributeSet attributeSet, int i2) {
super(context, attributeSet, i2);
this.c = new Handler(Looper.getMainLooper());
this.b = new HashSet();
}
@Override
public void a(String str, float f2) {
this.c.post(new RunnableC0238b(str, f2));
}
@Override
public void b(float f2) {
this.c.post(new e(f2));
}
@Override
public boolean c(g gVar) {
if (gVar == null) {
Log.e("YouTubePlayer", "null YouTubePlayerListener not allowed.");
return false;
}
return this.b.add(gVar);
}
@Override
public void d() {
this.f9456d.a(this);
}
@Override
public void destroy() {
this.b.clear();
this.c.removeCallbacksAndMessages(null);
super.destroy();
}
@Override
public Collection<g> e() {
return Collections.unmodifiableCollection(new HashSet(this.b));
}
@Override
public void f(String str, float f2) {
this.c.post(new a(str, f2));
}
@SuppressLint({"SetJavaScriptEnabled"})
public final void g() {
WebSettings settings = getSettings();
settings.setJavaScriptEnabled(true);
settings.setCacheMode(2);
settings.setMediaPlaybackRequiresUserGesture(false);
addJavascriptInterface(new f.g.a.f.d(this), "YouTubePlayerBridge");
loadDataWithBaseURL("https://www.youtube.com", i(), "text/html", "utf-8", null);
setWebChromeClient(new f(this));
}
public void h(f.g.a.f.f fVar) {
this.f9456d = fVar;
g();
}
public final String i() {
try {
InputStream openRawResource = getResources().openRawResource(f.g.a.e.youtube_player);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(openRawResource, "utf-8"));
StringBuilder sb = new StringBuilder();
while (true) {
String readLine = bufferedReader.readLine();
if (readLine == null) {
openRawResource.close();
return sb.toString();
}
sb.append(readLine);
sb.append("\n");
}
} catch (Exception unused) {
throw new RuntimeException("Can't parse HTML file containing the player.");
}
}
@Override
public void pause() {
this.c.post(new d());
}
@Override
public void play() {
this.c.post(new c());
}
}