baiduad测试 v0.0.0版本的 MD5 值为:ef50fc8b78044be49b08cff701993fe5
以下内容为反编译后的 e.java 源代码,内容仅作参考
package com.apicloud.a.i.a.e;
import com.apicloud.a.c.x;
import com.deepe.c.c.t;
import com.eclipsesource.v8.V8ArrayBuffer;
import java.io.ByteArrayOutputStream;
public class e extends com.apicloud.a.i.e<b> {
static String[] a = {"toBlob", "toDataURL"};
private final d b;
public e(com.apicloud.a.d dVar) {
super(dVar);
this.b = new d(dVar);
}
private void a(b bVar, com.apicloud.a.c cVar) {
com.apicloud.a.i.a.e.c.b c = c(bVar, cVar);
com.apicloud.a.c.i iVar = (com.apicloud.a.c.i) cVar.m("onSuccess");
if (c.a()) {
if (iVar != null) {
iVar.a((Object[]) null);
return;
}
return;
}
V8ArrayBuffer a2 = x.a(c.b, e());
if (iVar != null) {
iVar.a(a2, c.a);
}
if (a2 != null) {
a2.close();
}
}
private String b(b bVar, com.apicloud.a.c cVar) {
String b;
com.apicloud.a.i.a.e.c.b c = c(bVar, cVar);
if (c.a() || (b = t.b(c.b)) == null) {
return "data:,";
}
return "data:" + c.a + ";base64," + b;
}
private com.apicloud.a.i.a.e.c.b c(b bVar, com.apicloud.a.c cVar) {
com.apicloud.a.i.a.e.c.b bVar2 = new com.apicloud.a.i.a.e.c.b();
try {
com.apicloud.a.i.a.e.a.c a2 = com.apicloud.a.i.a.e.a.c.a(cVar.s("mimeType"));
int c = a2.c();
Float o = cVar.o("quality");
if (o != null) {
c = (int) (o.floatValue() * 100.0f);
}
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
bVar.e().compress(a2.b(), c, byteArrayOutputStream);
bVar2.b = byteArrayOutputStream.toByteArray();
bVar2.a = a2.a();
} catch (Exception e) {
e().h().b(com.apicloud.a.c.b.a("canvas to byte array error. ", e));
e.printStackTrace();
}
return bVar2;
}
@Override
public d a(b bVar) {
return this.b;
}
@Override
public Object a(b bVar, String str, com.apicloud.a.c cVar, com.apicloud.a.c.e eVar) {
int hashCode = str.hashCode();
if (hashCode != -869401416) {
if (hashCode == -220030358 && str.equals("toDataURL")) {
return b(bVar, cVar);
}
return null;
} else if (str.equals("toBlob")) {
a(bVar, cVar);
return null;
} else {
return null;
}
}
@Override
public String a() {
return "canvas";
}
@Override
public b a(com.apicloud.a.c cVar) {
return new b(e());
}
@Override
public void b(b bVar) {
bVar.d();
super.b((e) bVar);
}
}