Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 VASTResource.java 源代码,内容仅作参考
package com.startapp.sdk.ads.video.vast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.startapp.ac;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class VASTResource {
public static final List<String> f54472f = Arrays.asList("image/jpeg", "image/png", "image/bmp", "image/gif");
public static final List<String> f54473g = Collections.singletonList("application/x-javascript");
@NonNull
public final String f54474a;
@NonNull
public final Type f54475b;
@Nullable
public final CreativeType f54476c;
public final int f54477d;
public final int f54478e;
public enum CreativeType {
NONE,
IMAGE,
JAVASCRIPT
}
public enum Type {
STATIC_RESOURCE,
HTML_RESOURCE,
IFRAME_RESOURCE
}
public VASTResource(@NonNull String str, @NonNull Type type, @Nullable CreativeType creativeType, int i11, int i12) {
this.f54474a = str;
this.f54475b = type;
this.f54476c = creativeType;
this.f54477d = i11;
this.f54478e = i12;
}
@NonNull
public String a() {
StringBuilder sb2 = new StringBuilder();
sb2.append("<!DOCTYPE html><html><head>");
sb2.append("<link rel=\"icon\" href=\"data:;base64,iVBORw0KGgo=\" />");
sb2.append("<style type=\"text/css\"> html, body { background-color: black; height: 100%; margin: 0; } #content { border: 0px; position: absolute; top: 50%; left: 50%; margin: -");
sb2.append(this.f54478e / 2);
sb2.append("px 0 0 -");
sb2.append(this.f54477d / 2);
sb2.append("px; }</style>");
sb2.append("<script>function performClick() { top.location.href = \"https://www.startapp.com\"; }</script>");
sb2.append("</head><body onclick=\"performClick()\">");
int ordinal = this.f54475b.ordinal();
if (ordinal == 0) {
CreativeType creativeType = this.f54476c;
if (creativeType == CreativeType.IMAGE) {
sb2.append("<img id=\"content\"");
a(sb2);
} else if (creativeType == CreativeType.JAVASCRIPT) {
sb2.append("<script src=\"");
sb2.append(this.f54474a);
sb2.append("\" />");
}
} else {
if (ordinal == 1) {
return this.f54474a;
}
if (ordinal == 2) {
sb2.append("<iframe id=\"content\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\"");
a(sb2);
}
}
sb2.append("</body></html>");
return sb2.toString();
}
public final void a(@NonNull StringBuilder sb2) {
sb2.append(" width=\"");
sb2.append(this.f54477d);
sb2.append("\"");
sb2.append(" height=\"");
sb2.append(this.f54478e);
sb2.append("\"");
sb2.append(" src=\"");
sb2.append(this.f54474a);
sb2.append("\" />");
}
@Nullable
public static VASTResource a(@NonNull ac acVar, @NonNull Type type, int i11, int i12) {
String f11;
String str;
String a11;
ac b11 = acVar.b("StaticResource", null, null);
String lowerCase = (b11 == null || (a11 = b11.a("creativeType")) == null) ? null : a11.toLowerCase();
CreativeType creativeType = CreativeType.NONE;
int ordinal = type.ordinal();
if (ordinal != 0) {
if (ordinal != 1) {
if (ordinal == 2) {
f11 = acVar.f("IFrameResource");
}
str = null;
} else {
f11 = acVar.f("HTMLResource");
}
str = f11;
} else {
f11 = acVar.f("StaticResource");
if (f11 != null) {
List<String> list = f54472f;
if (!list.contains(lowerCase) && !f54473g.contains(lowerCase)) {
f11 = null;
}
creativeType = list.contains(lowerCase) ? CreativeType.IMAGE : CreativeType.JAVASCRIPT;
str = f11;
}
str = null;
}
CreativeType creativeType2 = creativeType;
if (str == null) {
return null;
}
return new VASTResource(str, type, creativeType2, i11, i12);
}
}