夏天YY v1.0版本的 MD5 值为:04df6daece98ad4aaa5f0e7a450865f8
以下内容为反编译后的 dk.java 源代码,内容仅作参考
package c.t.m.g;
import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import androidx.core.content.PermissionChecker;
import c.t.m.g.cv;
import c.t.m.g.db;
import com.uc.crashsdk.export.ExitType;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
public class dk extends bw {
private static volatile dk f46c = null;
private static String d = "";
private static volatile String e = "";
private static final AtomicBoolean j = new AtomicBoolean(false);
private a g;
private SimpleDateFormat f = cl.a("HHmmss");
private boolean h = false;
private final ConcurrentHashMap<String, Integer> i = new ConcurrentHashMap<>();
@Override
public String b() {
return "MllcPro";
}
public static void a(String str) {
d = str;
}
public static dk c() {
if (f46c == null) {
synchronized (dk.class) {
if (f46c == null) {
f46c = new dk();
}
}
}
return f46c;
}
public static final void a(String str, String str2) {
c().b(str, str2);
}
public void a(boolean z) {
this.h = z;
}
public void b(String str, String str2) {
cy.a("MllcPro", str + "@" + str2);
if (!f() || this.g == null) {
return;
}
Message obtainMessage = this.g.obtainMessage(ExitType.UNEXP_REASON_ANR);
obtainMessage.obj = this.f.format(new Date()) + "," + str + "," + str2;
obtainMessage.sendToTarget();
}
public void a(long j2) {
if (!f() || this.g == null) {
return;
}
cu.a(this.g, (int) ExitType.UNEXP_REASON_KILL_PROCESS, j2);
}
@Override
public int a(Looper looper) {
cy.a("MllcPro", "startup:isUp->" + this.h);
if (this.h) {
this.g = new a(cs.a("th_loc_extra").getLooper());
cu.a(this.g, 101);
}
this.i.clear();
return 0;
}
@Override
public void a() {
if (this.g != null) {
this.g.a();
this.g = null;
cs.b("th_loc_extra");
}
}
public String a(Context context) {
String[] strArr = {"android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_WIFI_STATE", "android.permission.CHANGE_WIFI_STATE", "android.permission.ACCESS_NETWORK_STATE", "android.permission.CHANGE_NETWORK_STATE", "android.permission.READ_PHONE_STATE"};
int i = context.getApplicationInfo().targetSdkVersion;
int i2 = 0;
for (int i3 = 0; i3 < strArr.length; i3++) {
try {
if (!a(context, strArr[i3], i)) {
i2 |= 1 << i3;
}
} catch (Throwable unused) {
i2 = -1;
}
}
int a2 = fk.a().a(context);
return Build.VERSION.SDK_INT + "&" + i + "&" + i2 + "&" + a2;
}
private boolean a(Context context, String str, int i) {
if (Build.VERSION.SDK_INT >= 23) {
return i < 23 ? PermissionChecker.checkSelfPermission(context, str) == 0 : context.checkSelfPermission(str) == 0;
}
return true;
}
public static String h() {
StringBuilder sb = new StringBuilder();
sb.append(cl.a("yyyyMMdd-HHmmss").format(new Date()));
sb.append(',');
sb.append("");
sb.append(',');
sb.append(di.e());
sb.append(',');
sb.append("");
sb.append(',');
sb.append(di.b());
sb.append(',');
sb.append(de.a(e) ? "" : e);
sb.append(',');
sb.append(di.d());
sb.append(',');
sb.append(di.f());
sb.append(',');
sb.append("");
sb.append(',');
sb.append("");
return sb.toString();
}
public static String i() {
return di.k() + ',' + d + ',' + di.b() + ',' + Build.BRAND + "_," + Build.VERSION.SDK_INT + ',' + db.b() + ',' + di.g() + "," + di.f();
}
public class a extends Handler {
private StringBuffer b;
private long f47c;
public a(Looper looper) {
super(looper);
this.b = new StringBuffer(18432);
}
@Override
public void handleMessage(Message message) {
try {
a(message);
} catch (Throwable th) {
cy.a("MllcPro", "handler message error.", th);
}
}
private void a(Message message) {
switch (message.what) {
case 101:
removeMessages(101);
this.f47c = System.currentTimeMillis();
String stringBuffer = this.b.toString();
this.b.setLength(0);
StringBuffer stringBuffer2 = this.b;
stringBuffer2.append("LOC_CORE");
stringBuffer2.append(',');
stringBuffer2.append(dk.h());
if (!de.a(stringBuffer)) {
this.b.append(stringBuffer);
}
dk.this.b("SYSTEM", dk.i());
removeMessages(102);
cu.a(dk.this.g, 102, 120000L);
dk.this.b("PERMISSION", dk.this.a(ci.a()));
return;
case 102:
removeMessages(102);
cu.a(dk.this.g, 102, 120000L);
dk.this.b("PERMISSION", dk.this.a(ci.a()));
return;
case ExitType.UNEXP_REASON_ANR:
StringBuffer stringBuffer3 = this.b;
stringBuffer3.append('$');
stringBuffer3.append((String) message.obj);
if (this.b.length() < 18432 && System.currentTimeMillis() - this.f47c < 180000) {
return;
}
dk.this.a(this.b.toString(), false);
this.b.setLength(0);
cu.a(dk.this.g, 101);
return;
case ExitType.UNEXP_REASON_EXIT:
dk.this.a("", true);
return;
case ExitType.UNEXP_REASON_KILL_PROCESS:
dk.this.a(this.b.toString(), false);
this.b.setLength(0);
cu.a(dk.this.g, 101);
return;
default:
return;
}
}
public void a() {
StringBuffer stringBuffer = this.b;
stringBuffer.append('$');
stringBuffer.append(dk.this.f.format(new Date()) + ",LOC,shutdown");
String stringBuffer2 = this.b.toString();
this.b.setLength(0);
dk.this.a(stringBuffer2, true);
cu.b(dk.this.g);
}
}
public void a(String str, boolean z) {
try {
cs.a("th_loc_task_t_consume", new b(str.getBytes("UTF-8"), z));
} catch (Throwable th) {
cy.a("MllcPro", "uploadToServerAsync error.", th);
}
}
public class b implements Runnable {
byte[] a;
boolean b;
b(byte[] bArr, boolean z) {
this.b = false;
this.a = bArr;
this.b = z;
}
@Override
public void run() {
if (!de.a(this.a)) {
a(this.a, true, true);
}
if (!this.b || dk.j.get()) {
return;
}
dk.j.set(true);
a();
dk.j.set(false);
}
private void a() {
long j;
int i;
boolean z;
db.a a = db.a();
long j2 = a != db.a.NETWORK_WIFI ? 102400L : 2097152L;
try {
File file = new File(ci.a().getExternalFilesDir("data").getAbsolutePath() + "/mllc");
File[] listFiles = file.listFiles();
if (de.c(listFiles)) {
return;
}
long currentTimeMillis = System.currentTimeMillis();
int length = listFiles.length;
long j3 = 0;
int i2 = 0;
while (true) {
if (i2 >= length) {
break;
}
File file2 = listFiles[i2];
if (j3 >= j2) {
break;
}
if (a(file2, currentTimeMillis)) {
byte[] b = cr.b(file2);
String name = file2.getName();
file2.delete();
if (de.a(b)) {
j = j2;
i = i2;
z = true;
} else {
i = i2;
j3 += b.length;
z = a(b, false, name.endsWith(".enc2"));
StringBuilder sb = new StringBuilder();
j = j2;
sb.append("upload:");
sb.append(name);
sb.append(",");
sb.append(b.length);
sb.append(",");
sb.append(z);
cy.a("MllcPro", sb.toString());
}
if (!z) {
cr.a(file.getAbsolutePath(), 10485760L);
break;
}
} else {
j = j2;
i = i2;
}
i2 = i + 1;
j2 = j;
}
dk.this.b("NET", a + ",up file len:" + j3);
} catch (Throwable th) {
cy.a("MllcPro", "up local file error.", th);
}
}
private boolean a(File file, long j) {
if (file == null || !file.exists()) {
return false;
}
if (j - file.lastModified() >= 2592000000L) {
cr.a(file);
return false;
}
return true;
}
private boolean a(byte[] bArr, boolean z, final boolean z2) {
try {
if (de.a(bArr)) {
return true;
}
final byte[] a = z ? cp.a(bArr, true) : bArr;
if (de.a(a)) {
return true;
}
dk.this.b("NET", "[src,enc]=[" + bArr.length + "," + a.length + "],type=" + db.b());
final boolean[] zArr = {true};
cv.a(z2 ? "https://cs.map.qq.com/atta?type=1&multi=0" : "https://analytics.map.qq.com/tr?mllc", a, new cv.c() {
@Override
public void a(String str) {
cy.a("MllcPro", "upload success:" + str);
}
@Override
public void b(String str) {
cy.a("MllcPro", "upload failed:" + str);
try {
File file = new File(ci.a().getExternalFilesDir("data").getAbsolutePath() + "/mllc");
if (!file.exists()) {
file.mkdirs();
}
StringBuilder sb = new StringBuilder();
sb.append("mllc_");
sb.append(System.currentTimeMillis());
sb.append(z2 ? ".enc2" : ".enc");
cr.a(new File(file, sb.toString()), a, true);
} catch (Throwable unused) {
}
zArr[0] = false;
}
});
return zArr[0];
} catch (Throwable th) {
cy.a("MllcPro", "up byte[] error.", th);
return false;
}
}
}
}