AI Chat v1.1.8版本的 MD5 值为:1bcdce875f86738c8cfbf1e5f4064353
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.bytedance.sdk.component.adexpress.d;
import android.app.Activity;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.bytedance.component.sdk.annotation.UiThread;
import com.bytedance.sdk.component.adexpress.b.f;
import com.bytedance.sdk.component.adexpress.b.g;
import com.bytedance.sdk.component.adexpress.b.j;
import com.bytedance.sdk.component.adexpress.b.l;
import com.bytedance.sdk.component.adexpress.b.m;
import com.bytedance.sdk.component.adexpress.theme.ThemeStatusBroadcastReceiver;
import com.bytedance.sdk.component.utils.k;
import com.bytedance.sdk.component.widget.SSWebView;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONObject;
public abstract class a implements com.bytedance.sdk.component.adexpress.a, com.bytedance.sdk.component.adexpress.b.d<SSWebView>, j, com.bytedance.sdk.component.adexpress.theme.a {
public boolean a;
public SSWebView b;
public com.bytedance.sdk.component.adexpress.a.c.b f1078d;
private Context f;
private String g;
private JSONObject h;
private String i;
private volatile f j;
private boolean k;
private g l;
private l m;
private boolean n;
private int o;
public int c = 8;
public AtomicBoolean e = new AtomicBoolean(false);
public a(Context context, l lVar, ThemeStatusBroadcastReceiver themeStatusBroadcastReceiver) {
this.k = false;
this.f = context;
this.m = lVar;
this.g = lVar.c();
this.h = lVar.b();
themeStatusBroadcastReceiver.a(this);
SSWebView b = e.a().b();
this.b = b;
if (b == null) {
if (com.bytedance.sdk.component.adexpress.d.a() != null) {
this.b = new SSWebView(com.bytedance.sdk.component.adexpress.d.a());
return;
}
return;
}
this.k = true;
}
private void c(int i) {
if (this.j != null) {
this.j.a(i);
}
}
public abstract void a(int i);
public SSWebView b() {
return this.b;
}
@Override
public int c() {
return 0;
}
@Override
public SSWebView e() {
return b();
}
public void f() {
if (this.e.get()) {
return;
}
this.e.set(true);
h();
if (this.b.getParent() != null) {
((ViewGroup) this.b.getParent()).removeView(this.b);
}
if (this.a) {
e.a().a(this.b);
} else {
e.a().c(this.b);
}
}
public void g() {
if (b() == null) {
return;
}
try {
b().getWebView().resumeTimers();
} catch (Exception unused) {
}
}
public abstract void h();
public void i() {
}
public void j() {
}
public void k() {
l();
Activity a = com.bytedance.sdk.component.utils.b.a(this.b);
if (a != null) {
this.o = a.hashCode();
}
}
public void l() {
}
public void m() {
}
public void a(String str) {
this.i = str;
}
public void a(g gVar) {
this.l = gVar;
}
@Override
public void a(f fVar) {
this.j = fVar;
if (b() != null && b().getWebView() != null) {
if (!com.bytedance.sdk.component.adexpress.a.b.a.f()) {
this.j.a(102);
return;
} else if (TextUtils.isEmpty(this.i)) {
this.j.a(102);
return;
} else if (this.f1078d == null && !com.bytedance.sdk.component.adexpress.a.b.a.a(this.h)) {
this.j.a(103);
return;
} else {
this.m.d().a(this.k);
if (this.k) {
try {
this.b.m();
this.m.d().b();
k.a(this.b.getWebView(), "javascript:window.SDK_RESET_RENDER();window.SDK_TRIGGER_RENDER();");
return;
} catch (Exception unused) {
com.bytedance.sdk.component.utils.l.b("WebViewRender", "reuse webview load fail ");
e.a().c(this.b);
this.j.a(102);
return;
}
}
SSWebView b = b();
b.m();
this.m.d().b();
b.a(this.i);
return;
}
}
this.j.a(102);
}
public void a(boolean z) {
this.n = z;
}
@Override
public void a(final m mVar) {
if (mVar == null) {
if (this.j != null) {
this.j.a(105);
return;
}
return;
}
boolean a = mVar.a();
final float b = (float) mVar.b();
final float c = (float) mVar.c();
if (b > 0.0f && c > 0.0f) {
this.a = a;
if (Looper.myLooper() == Looper.getMainLooper()) {
a(mVar, b, c);
} else {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
a.this.a(mVar, b, c);
}
});
}
} else if (this.j != null) {
this.j.a(105);
}
}
public void a(m mVar, float f, float f2) {
if (this.a && !this.n) {
a(f, f2);
a(this.c);
if (this.j != null) {
this.j.a(b(), mVar);
return;
}
return;
}
e.a().c(this.b);
c(mVar.h());
}
@Override
public void a(View view, int i, com.bytedance.sdk.component.adexpress.c cVar) {
g gVar = this.l;
if (gVar != null) {
gVar.a(view, i, cVar);
}
}
@UiThread
private void a(float f, float f2) {
this.m.d().c();
int a = (int) com.bytedance.sdk.component.adexpress.c.c.a(this.f, f);
int a2 = (int) com.bytedance.sdk.component.adexpress.c.c.a(this.f, f2);
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) b().getLayoutParams();
if (layoutParams == null) {
layoutParams = new FrameLayout.LayoutParams(a, a2);
}
layoutParams.width = a;
layoutParams.height = a2;
b().setLayoutParams(layoutParams);
}
@Override
public void a(Activity activity) {
if (this.o == 0 || activity == null || activity.hashCode() != this.o) {
return;
}
com.bytedance.sdk.component.utils.l.b("WebViewRender", "release from activity onDestroy");
f();
m();
}
@Override
public int a() {
return this.o;
}
}