AdGuard v3.6.45版本的 MD5 值为:ce30a13dcef92cf942973fffcc6d20fb
以下内容为反编译后的 t.java 源代码,内容仅作参考
package com.adguard.android.a;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import ch.qos.logback.core.joran.action.Action;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Iterator;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.nodes.Document;
public class t {
private static final org.slf4j.c f47a = org.slf4j.d.a(t.class);
public interface a {
void a(Exception exc);
void a(String str, String str2, Bitmap bitmap);
}
private t() {
}
private static Bitmap a(String str) {
try {
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
httpURLConnection.setDoInput(true);
httpURLConnection.connect();
return BitmapFactory.decodeStream(httpURLConnection.getInputStream());
} catch (IOException unused) {
f47a.warn("Error loading bitmap from {}", str);
return null;
}
}
public static void a(final String str, final String str2, final a aVar) {
com.adguard.commons.concurrent.b.a(new Runnable() {
@Override
public final void run() {
t.b(str, str2, aVar);
}
});
}
public static void b(String str, String str2, a aVar) {
String c;
try {
String str3 = "https://www.youtube.com/watch?v=" + str + "&hl=" + str2;
org.jsoup.a.c cVar = new org.jsoup.a.c();
cVar.a(str3);
Document a2 = cVar.b("Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36").a();
org.slf4j.c cVar2 = f47a;
org.jsoup.nodes.g b = a2.e("title").b();
cVar2.info("Video page title: {}", b != null ? org.jsoup.b.c.c(b.r()).trim() : "");
Iterator<org.jsoup.nodes.g> it = a2.e("meta").iterator();
String str4 = null;
String str5 = null;
Bitmap bitmap = null;
while (it.hasNext()) {
org.jsoup.nodes.g next = it.next();
if (StringUtils.equals(next.c("property"), "og:title")) {
str5 = next.c("content");
} else if (StringUtils.equals(next.c("property"), "og:image") && (c = next.c("content")) != null) {
bitmap = a(c);
}
}
Iterator<org.jsoup.nodes.g> it2 = a2.c("itemprop", "author").iterator();
while (it2.hasNext()) {
org.jsoup.select.c c2 = it2.next().c("itemprop", Action.NAME_ATTRIBUTE);
if (!c2.isEmpty()) {
str4 = c2.get(0).c("content");
}
}
aVar.a(str5, str4, bitmap);
} catch (IOException e) {
f47a.warn("Error fetching video page!\n", (Throwable) e);
aVar.a(e);
}
}
}