Initial commit
This commit is contained in:
145
sources/com/tencent/open/a/a.java
Normal file
145
sources/com/tencent/open/a/a.java
Normal file
@@ -0,0 +1,145 @@
|
||||
package com.tencent.open.a;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.Message;
|
||||
import com.ijm.dataencryption.de.DataDecryptTool;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
/* loaded from: classes.dex */
|
||||
public class a extends i implements Handler.Callback {
|
||||
private b a;
|
||||
private FileWriter b;
|
||||
private File c;
|
||||
private char[] d;
|
||||
private volatile g e;
|
||||
private volatile g f;
|
||||
private volatile g g;
|
||||
private volatile g h;
|
||||
private volatile boolean i;
|
||||
private HandlerThread j;
|
||||
private Handler k;
|
||||
|
||||
public a(b bVar) {
|
||||
this(c.b, true, h.a, bVar);
|
||||
}
|
||||
|
||||
private void f() {
|
||||
if (Thread.currentThread() == this.j && !this.i) {
|
||||
this.i = true;
|
||||
i();
|
||||
try {
|
||||
this.h.a(g(), this.d);
|
||||
} catch (IOException unused) {
|
||||
} catch (Throwable th) {
|
||||
this.h.b();
|
||||
throw th;
|
||||
}
|
||||
this.h.b();
|
||||
this.i = false;
|
||||
}
|
||||
}
|
||||
|
||||
private Writer g() {
|
||||
File a = c().a();
|
||||
if ((a != null && !a.equals(this.c)) || (this.b == null && a != null)) {
|
||||
this.c = a;
|
||||
h();
|
||||
try {
|
||||
this.b = new FileWriter(this.c, true);
|
||||
} catch (IOException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return this.b;
|
||||
}
|
||||
|
||||
private void h() {
|
||||
try {
|
||||
if (this.b != null) {
|
||||
this.b.flush();
|
||||
this.b.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void i() {
|
||||
synchronized (this) {
|
||||
if (this.g == this.e) {
|
||||
this.g = this.f;
|
||||
this.h = this.e;
|
||||
} else {
|
||||
this.g = this.e;
|
||||
this.h = this.f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void a() {
|
||||
if (this.k.hasMessages(DataDecryptTool.DECRYPT_SP_FILE)) {
|
||||
this.k.removeMessages(DataDecryptTool.DECRYPT_SP_FILE);
|
||||
}
|
||||
this.k.sendEmptyMessage(DataDecryptTool.DECRYPT_SP_FILE);
|
||||
}
|
||||
|
||||
public void b() {
|
||||
h();
|
||||
this.j.quit();
|
||||
}
|
||||
|
||||
public b c() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.os.Handler.Callback
|
||||
public boolean handleMessage(Message message) {
|
||||
if (message.what != 1024) {
|
||||
return true;
|
||||
}
|
||||
f();
|
||||
return true;
|
||||
}
|
||||
|
||||
public a(int i, boolean z, h hVar, b bVar) {
|
||||
super(i, z, hVar);
|
||||
this.i = false;
|
||||
a(bVar);
|
||||
this.e = new g();
|
||||
this.f = new g();
|
||||
this.g = this.e;
|
||||
this.h = this.f;
|
||||
this.d = new char[bVar.d()];
|
||||
g();
|
||||
this.j = new HandlerThread(bVar.c(), bVar.f());
|
||||
HandlerThread handlerThread = this.j;
|
||||
if (handlerThread != null) {
|
||||
handlerThread.start();
|
||||
}
|
||||
if (!this.j.isAlive() || this.j.getLooper() == null) {
|
||||
return;
|
||||
}
|
||||
this.k = new Handler(this.j.getLooper(), this);
|
||||
}
|
||||
|
||||
@Override // com.tencent.open.a.i
|
||||
protected void a(int i, Thread thread, long j, String str, String str2, Throwable th) {
|
||||
a(e().a(i, thread, j, str, str2, th));
|
||||
}
|
||||
|
||||
protected void a(String str) {
|
||||
this.g.a(str);
|
||||
if (this.g.a() >= c().d()) {
|
||||
a();
|
||||
}
|
||||
}
|
||||
|
||||
public void a(b bVar) {
|
||||
this.a = bVar;
|
||||
}
|
||||
}
|
116
sources/com/tencent/open/a/b.java
Normal file
116
sources/com/tencent/open/a/b.java
Normal file
@@ -0,0 +1,116 @@
|
||||
package com.tencent.open.a;
|
||||
|
||||
import com.tencent.open.a.d;
|
||||
import com.ubt.jimu.base.util.FileUtil;
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
/* loaded from: classes.dex */
|
||||
public class b {
|
||||
private static SimpleDateFormat a = d.C0017d.a("yy.MM.dd.HH");
|
||||
private File g;
|
||||
private String b = "Tracer.File";
|
||||
private int c = Integer.MAX_VALUE;
|
||||
private int d = Integer.MAX_VALUE;
|
||||
private int e = FileUtil.ZIP_BUFFER_SIZE;
|
||||
private long f = 10000;
|
||||
private int h = 10;
|
||||
private String i = ".log";
|
||||
private long j = Long.MAX_VALUE;
|
||||
|
||||
public b(File file, int i, int i2, int i3, String str, long j, int i4, String str2, long j2) {
|
||||
a(file);
|
||||
b(i);
|
||||
a(i2);
|
||||
c(i3);
|
||||
a(str);
|
||||
a(j);
|
||||
d(i4);
|
||||
b(str2);
|
||||
b(j2);
|
||||
}
|
||||
|
||||
private File c(long j) {
|
||||
File b = b();
|
||||
try {
|
||||
return new File(b, c(d(j)));
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
private String d(long j) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(j);
|
||||
return new SimpleDateFormat("yy.MM.dd.HH").format(calendar.getTime());
|
||||
}
|
||||
|
||||
public File a() {
|
||||
return c(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public File b() {
|
||||
File e = e();
|
||||
e.mkdirs();
|
||||
return e;
|
||||
}
|
||||
|
||||
public File e() {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
public int f() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
public void a(String str) {
|
||||
this.b = str;
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
this.c = i;
|
||||
}
|
||||
|
||||
public void b(int i) {
|
||||
this.d = i;
|
||||
}
|
||||
|
||||
public void a(long j) {
|
||||
this.f = j;
|
||||
}
|
||||
|
||||
public void b(String str) {
|
||||
this.i = str;
|
||||
}
|
||||
|
||||
private String c(String str) {
|
||||
return "com.tencent.mobileqq_connectSdk." + str + ".log";
|
||||
}
|
||||
|
||||
public void a(File file) {
|
||||
this.g = file;
|
||||
}
|
||||
|
||||
public void b(long j) {
|
||||
this.j = j;
|
||||
}
|
||||
|
||||
public int d() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public String c() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public void d(int i) {
|
||||
this.h = i;
|
||||
}
|
||||
|
||||
public void c(int i) {
|
||||
this.e = i;
|
||||
}
|
||||
}
|
24
sources/com/tencent/open/a/c.java
Normal file
24
sources/com/tencent/open/a/c.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.tencent.open.a;
|
||||
|
||||
import com.ijm.dataencryption.de.DataDecryptTool;
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import java.io.File;
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
/* loaded from: classes.dex */
|
||||
public class c {
|
||||
public static int a = 62;
|
||||
public static int b = 60;
|
||||
public static String c = "OpenSDK.Client.File.Tracer";
|
||||
public static String d = "Tencent" + File.separator + "msflogs" + File.separator + "com" + File.separator + "tencent" + File.separator + "mobileqq" + File.separator;
|
||||
public static String e = ".log";
|
||||
public static long f = 8388608;
|
||||
public static int g = 262144;
|
||||
public static int h = DataDecryptTool.DECRYPT_SP_FILE;
|
||||
public static int i = XStream.PRIORITY_VERY_HIGH;
|
||||
public static String j = "debug.file.blockcount";
|
||||
public static String k = "debug.file.keepperiod";
|
||||
public static String l = "debug.file.tracelevel";
|
||||
public static int m = 24;
|
||||
public static long n = 604800000;
|
||||
}
|
90
sources/com/tencent/open/a/d.java
Normal file
90
sources/com/tencent/open/a/d.java
Normal file
@@ -0,0 +1,90 @@
|
||||
package com.tencent.open.a;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Environment;
|
||||
import android.os.StatFs;
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
/* loaded from: classes.dex */
|
||||
public class d {
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
public static final class a {
|
||||
public static final boolean a(int i, int i2) {
|
||||
return i2 == (i & i2);
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
public static final class b {
|
||||
public static boolean a() {
|
||||
String externalStorageState = Environment.getExternalStorageState();
|
||||
return "mounted".equals(externalStorageState) || "mounted_ro".equals(externalStorageState);
|
||||
}
|
||||
|
||||
public static c b() {
|
||||
if (a()) {
|
||||
return c.b(Environment.getExternalStorageDirectory());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
public static class c {
|
||||
private File a;
|
||||
private long b;
|
||||
private long c;
|
||||
|
||||
public File a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public long b() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public long c() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return String.format("[%s : %d / %d]", a().getAbsolutePath(), Long.valueOf(c()), Long.valueOf(b()));
|
||||
}
|
||||
|
||||
public void a(File file) {
|
||||
this.a = file;
|
||||
}
|
||||
|
||||
public void b(long j) {
|
||||
this.c = j;
|
||||
}
|
||||
|
||||
public static c b(File file) {
|
||||
c cVar = new c();
|
||||
cVar.a(file);
|
||||
StatFs statFs = new StatFs(file.getAbsolutePath());
|
||||
long blockSize = statFs.getBlockSize();
|
||||
long blockCount = statFs.getBlockCount();
|
||||
long availableBlocks = statFs.getAvailableBlocks();
|
||||
cVar.a(blockCount * blockSize);
|
||||
cVar.b(availableBlocks * blockSize);
|
||||
return cVar;
|
||||
}
|
||||
|
||||
public void a(long j) {
|
||||
this.b = j;
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
/* renamed from: com.tencent.open.a.d$d, reason: collision with other inner class name */
|
||||
public static final class C0017d {
|
||||
@SuppressLint({"SimpleDateFormat"})
|
||||
public static SimpleDateFormat a(String str) {
|
||||
return new SimpleDateFormat(str);
|
||||
}
|
||||
}
|
||||
}
|
35
sources/com/tencent/open/a/e.java
Normal file
35
sources/com/tencent/open/a/e.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.tencent.open.a;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
/* loaded from: classes.dex */
|
||||
public final class e extends i {
|
||||
public static final e a = new e();
|
||||
|
||||
@Override // com.tencent.open.a.i
|
||||
protected void a(int i, Thread thread, long j, String str, String str2, Throwable th) {
|
||||
if (i == 1) {
|
||||
Log.v(str, str2, th);
|
||||
return;
|
||||
}
|
||||
if (i == 2) {
|
||||
Log.d(str, str2, th);
|
||||
return;
|
||||
}
|
||||
if (i == 4) {
|
||||
Log.i(str, str2, th);
|
||||
return;
|
||||
}
|
||||
if (i == 8) {
|
||||
Log.w(str, str2, th);
|
||||
} else if (i == 16) {
|
||||
Log.e(str, str2, th);
|
||||
} else {
|
||||
if (i != 32) {
|
||||
return;
|
||||
}
|
||||
Log.e(str, str2, th);
|
||||
}
|
||||
}
|
||||
}
|
113
sources/com/tencent/open/a/f.java
Normal file
113
sources/com/tencent/open/a/f.java
Normal file
@@ -0,0 +1,113 @@
|
||||
package com.tencent.open.a;
|
||||
|
||||
import android.os.Environment;
|
||||
import android.text.TextUtils;
|
||||
import com.tencent.open.a.d;
|
||||
import java.io.File;
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
/* loaded from: classes.dex */
|
||||
public class f {
|
||||
public static f a = null;
|
||||
protected static final b c = new b(c(), c.m, c.g, c.h, c.c, c.i, 10, c.e, c.n);
|
||||
private static boolean d = false;
|
||||
protected a b = new a(c);
|
||||
|
||||
private f() {
|
||||
}
|
||||
|
||||
public static f a() {
|
||||
if (a == null) {
|
||||
synchronized (f.class) {
|
||||
if (a == null) {
|
||||
a = new f();
|
||||
d = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
public static final void b(String str, String str2) {
|
||||
a().a(2, str, str2, null);
|
||||
}
|
||||
|
||||
public static final void c(String str, String str2) {
|
||||
a().a(4, str, str2, null);
|
||||
}
|
||||
|
||||
public static final void d(String str, String str2) {
|
||||
a().a(8, str, str2, null);
|
||||
}
|
||||
|
||||
public static final void e(String str, String str2) {
|
||||
a().a(16, str, str2, null);
|
||||
}
|
||||
|
||||
public static final void b(String str, String str2, Throwable th) {
|
||||
a().a(16, str, str2, th);
|
||||
}
|
||||
|
||||
protected static File c() {
|
||||
String str = c.d;
|
||||
boolean z = false;
|
||||
try {
|
||||
d.c b = d.b.b();
|
||||
if (b != null) {
|
||||
if (b.c() > c.f) {
|
||||
z = true;
|
||||
}
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
return z ? new File(Environment.getExternalStorageDirectory(), str) : new File(com.tencent.open.utils.d.c(), str);
|
||||
}
|
||||
|
||||
protected void d() {
|
||||
a aVar = this.b;
|
||||
if (aVar != null) {
|
||||
aVar.a();
|
||||
this.b.b();
|
||||
this.b = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void b() {
|
||||
synchronized (f.class) {
|
||||
a().d();
|
||||
if (a != null) {
|
||||
a = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void a(int i, String str, String str2, Throwable th) {
|
||||
a aVar;
|
||||
if (d) {
|
||||
String b = com.tencent.open.utils.d.b();
|
||||
if (!TextUtils.isEmpty(b)) {
|
||||
String str3 = b + " SDK_VERSION:3.3.0.lite";
|
||||
if (this.b == null) {
|
||||
return;
|
||||
}
|
||||
e.a.b(32, Thread.currentThread(), System.currentTimeMillis(), "openSDK_LOG", str3, null);
|
||||
this.b.b(32, Thread.currentThread(), System.currentTimeMillis(), "openSDK_LOG", str3, null);
|
||||
d = false;
|
||||
}
|
||||
}
|
||||
e.a.b(i, Thread.currentThread(), System.currentTimeMillis(), str, str2, th);
|
||||
if (!d.a.a(c.b, i) || (aVar = this.b) == null) {
|
||||
return;
|
||||
}
|
||||
aVar.b(i, Thread.currentThread(), System.currentTimeMillis(), str, str2, th);
|
||||
}
|
||||
|
||||
public static final void a(String str, String str2) {
|
||||
a().a(1, str, str2, null);
|
||||
}
|
||||
|
||||
public static final void a(String str, String str2, Throwable th) {
|
||||
a().a(2, str, str2, th);
|
||||
}
|
||||
}
|
76
sources/com/tencent/open/a/g.java
Normal file
76
sources/com/tencent/open/a/g.java
Normal file
@@ -0,0 +1,76 @@
|
||||
package com.tencent.open.a;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
/* loaded from: classes.dex */
|
||||
public class g implements Iterable<String> {
|
||||
private ConcurrentLinkedQueue<String> a;
|
||||
private AtomicInteger b;
|
||||
|
||||
public g() {
|
||||
this.a = null;
|
||||
this.b = null;
|
||||
this.a = new ConcurrentLinkedQueue<>();
|
||||
this.b = new AtomicInteger(0);
|
||||
}
|
||||
|
||||
public int a(String str) {
|
||||
int length = str.length();
|
||||
this.a.add(str);
|
||||
return this.b.addAndGet(length);
|
||||
}
|
||||
|
||||
public void b() {
|
||||
this.a.clear();
|
||||
this.b.set(0);
|
||||
}
|
||||
|
||||
@Override // java.lang.Iterable
|
||||
public Iterator<String> iterator() {
|
||||
return this.a.iterator();
|
||||
}
|
||||
|
||||
public void a(Writer writer, char[] cArr) throws IOException {
|
||||
if (writer == null || cArr == null || cArr.length == 0) {
|
||||
return;
|
||||
}
|
||||
int length = cArr.length;
|
||||
Iterator<String> it = iterator();
|
||||
int i = length;
|
||||
int i2 = 0;
|
||||
while (it.hasNext()) {
|
||||
String next = it.next();
|
||||
int length2 = next.length();
|
||||
int i3 = 0;
|
||||
while (length2 > 0) {
|
||||
int i4 = i > length2 ? length2 : i;
|
||||
int i5 = i3 + i4;
|
||||
next.getChars(i3, i5, cArr, i2);
|
||||
i -= i4;
|
||||
i2 += i4;
|
||||
length2 -= i4;
|
||||
if (i == 0) {
|
||||
writer.write(cArr, 0, length);
|
||||
i = length;
|
||||
i3 = i5;
|
||||
i2 = 0;
|
||||
} else {
|
||||
i3 = i5;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i2 > 0) {
|
||||
writer.write(cArr, 0, i2);
|
||||
}
|
||||
writer.flush();
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return this.b.get();
|
||||
}
|
||||
}
|
51
sources/com/tencent/open/a/h.java
Normal file
51
sources/com/tencent/open/a/h.java
Normal file
@@ -0,0 +1,51 @@
|
||||
package com.tencent.open.a;
|
||||
|
||||
import android.text.format.Time;
|
||||
import android.util.Log;
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
/* loaded from: classes.dex */
|
||||
public final class h {
|
||||
public static final h a = new h();
|
||||
|
||||
public final String a(int i) {
|
||||
return i != 1 ? i != 2 ? i != 4 ? i != 8 ? i != 16 ? i != 32 ? "-" : "A" : "E" : "W" : "I" : "D" : "V";
|
||||
}
|
||||
|
||||
public String a(int i, Thread thread, long j, String str, String str2, Throwable th) {
|
||||
long j2 = j % 1000;
|
||||
Time time = new Time();
|
||||
time.set(j);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(a(i));
|
||||
sb.append('/');
|
||||
sb.append(time.format("%Y-%m-%d %H:%M:%S"));
|
||||
sb.append('.');
|
||||
if (j2 < 10) {
|
||||
sb.append("00");
|
||||
} else if (j2 < 100) {
|
||||
sb.append('0');
|
||||
}
|
||||
sb.append(j2);
|
||||
sb.append(' ');
|
||||
sb.append('[');
|
||||
if (thread == null) {
|
||||
sb.append("N/A");
|
||||
} else {
|
||||
sb.append(thread.getName());
|
||||
}
|
||||
sb.append(']');
|
||||
sb.append('[');
|
||||
sb.append(str);
|
||||
sb.append(']');
|
||||
sb.append(' ');
|
||||
sb.append(str2);
|
||||
sb.append('\n');
|
||||
if (th != null) {
|
||||
sb.append("* Exception : \n");
|
||||
sb.append(Log.getStackTraceString(th));
|
||||
sb.append('\n');
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
52
sources/com/tencent/open/a/i.java
Normal file
52
sources/com/tencent/open/a/i.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.tencent.open.a;
|
||||
|
||||
import com.tencent.open.a.d;
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class i {
|
||||
private volatile int a;
|
||||
private volatile boolean b;
|
||||
private h c;
|
||||
|
||||
public i() {
|
||||
this(c.a, true, h.a);
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
this.a = i;
|
||||
}
|
||||
|
||||
protected abstract void a(int i, Thread thread, long j, String str, String str2, Throwable th);
|
||||
|
||||
public void b(int i, Thread thread, long j, String str, String str2, Throwable th) {
|
||||
if (d() && d.a.a(this.a, i)) {
|
||||
a(i, thread, j, str, str2, th);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean d() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public h e() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public i(int i, boolean z, h hVar) {
|
||||
this.a = c.a;
|
||||
this.b = true;
|
||||
this.c = h.a;
|
||||
a(i);
|
||||
a(z);
|
||||
a(hVar);
|
||||
}
|
||||
|
||||
public void a(boolean z) {
|
||||
this.b = z;
|
||||
}
|
||||
|
||||
public void a(h hVar) {
|
||||
this.c = hVar;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user