搜书大师 v23.2版本的 MD5 值为:5ee433f6456b6278bd6e80a5d44df55e
以下内容为反编译后的 d.java 源代码,内容仅作参考
package com.flyersoft.components;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.os.Looper;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.widget.EditText;
import android.widget.TextView;
import com.flyersoft.baseapplication.z2;
import com.lygame.aaa.e50;
import com.lygame.aaa.o50;
import com.qadsdk.s1.s5;
import java.io.File;
import java.lang.Thread;
public class d implements Thread.UncaughtExceptionHandler {
private static d a = new d();
private Activity b;
private Thread.UncaughtExceptionHandler c;
private boolean d;
class a extends Thread {
final TextView a;
final StringBuilder b;
a(final TextView val$tv, final StringBuilder val$sb) {
this.a = val$tv;
this.b = val$sb;
}
@Override
public void run() {
d.this.g(this.a, this.b);
}
}
public class b implements DialogInterface.OnClickListener {
final StringBuilder a;
b(final StringBuilder val$sb) {
this.a = val$sb;
}
@Override
public void onClick(DialogInterface dialog, int which) {
d.e(d.this.c(), "#错误反馈#", this.a.toString(), false);
}
}
public class c implements DialogInterface.OnClickListener {
c() {
}
@Override
public void onClick(DialogInterface dialog, int which) {
e50.Z5(d.this.c(), true);
}
}
public class DialogInterfaceOnClickListenerC0908d implements DialogInterface.OnClickListener {
DialogInterfaceOnClickListenerC0908d() {
}
@Override
public void onClick(DialogInterface dialog, int which) {
}
}
public class e implements DialogInterface.OnClickListener {
final boolean a;
e(final boolean val$restart) {
this.a = val$restart;
}
@Override
public void onClick(DialogInterface dialog, int which) {
if (this.a) {
System.exit(0);
}
}
}
public Context c() {
return z2.getContext();
}
public static void e(Context act, String title, String content, final boolean restart) {
try {
title = title + act.getPackageManager().getPackageInfo(act.getPackageName(), 0).versionName;
e50.M5(content, true);
} catch (Exception e2) {
e50.S0(e2);
}
try {
Intent intent = new Intent("android.intent.action.SEND");
intent.setType("plain/text");
intent.putExtra("android.intent.extra.EMAIL", new String[]{"soushushenqi@163.com"});
intent.putExtra("android.intent.extra.SUBJECT", title);
intent.putExtra("android.intent.extra.TEXT", content);
act.startActivity(intent);
if (restart) {
System.exit(0);
}
} catch (Exception e3) {
e50.S0(e3);
EditText editText = new EditText(act);
editText.setText(content);
new AlertDialog.Builder(act).setTitle("没有找到邮件客户端, 请长按拷贝文本框里的内容, 加客服QQ发送给我们(QQ群: " + z2.qqNumber + "), 谢谢!").setCancelable(false).setView(editText).setPositiveButton("确定", new e(restart)).show();
}
}
private void f() {
System.exit(0);
}
public void g(TextView tv, final StringBuilder sb) {
try {
Looper.prepare();
AlertDialog.Builder builder = new AlertDialog.Builder(c());
builder.setTitle("未知错误").setCancelable(false).setView(tv).setPositiveButton("提交", new b(sb));
if (z2.isOldAppVersion()) {
builder.setNeutralButton("查看新版本", new c());
} else {
builder.setNeutralButton(s5.BTN_CANCEL, new DialogInterfaceOnClickListenerC0908d());
}
builder.show();
Looper.loop();
} catch (Throwable th) {
e50.S0(th);
}
}
public static d getInstance() {
return a;
}
public void d(Activity activity) {
this.b = activity;
if (this.d) {
return;
}
try {
this.d = true;
this.c = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(this);
} catch (Exception e2) {
e50.S0(e2);
}
}
@Override
public void uncaughtException(Thread thread, Throwable ex) {
StringBuilder sb = new StringBuilder();
try {
sb.append("-----------");
String message = ex.getMessage();
String th = message == null ? ex.toString() : message + " | " + ex.toString();
if (th.length() > 0) {
sb.append("\n" + th + "\n-----------");
}
for (StackTraceElement stackTraceElement : ex.getStackTrace()) {
sb.append("\n" + stackTraceElement.toString());
}
} catch (Throwable th2) {
e50.S0(th2);
}
if (sb.toString().contains("Exception thrown on Scheduler.Worker thread. Add `onError` handling")) {
e50.N5("*************RxJava********CRASH*********");
e50.N5(sb.toString());
return;
}
e50.M5("###CRASH ERROR###:\n" + sb.toString(), true);
if (z2.getFileSize(z2.errorSaveFile()) > 100000) {
z2.deleteFile(z2.errorSaveFile());
}
o50.g(z2.errorSaveFile(), "\n\n======CRASH======" + o50.y(Long.valueOf(System.currentTimeMillis())) + Build.ID + "|" + Build.VERSION.RELEASE + "\n" + sb.toString());
if (z2.signatureSubject != null) {
sb.insert(0, z2.signatureSerial + "\n");
}
sb.insert(0, e50.c0());
if (sb.toString().indexOf("ActivityTxt") != -1 && o50.A1(e50.V1)) {
sb.insert(0, o50.v0(e50.V1) + " (" + e50.h1(new File(e50.V1).length()) + ")\n-----------\n");
}
sb.insert(0, "请描述如何操作可以重现这个问题:\n\n-----------\n");
StringBuilder sb2 = new StringBuilder();
sb2.append("应用发生未知错误, 请点击提交按键, 选择邮件方式发送错误日志给我们检查, 谢谢您的支持!");
sb2.append(z2.isOldAppVersion() ? "<br><br>(提示: 应用市场有搜书大师的新版本, 可能已经修复该错误, 建议先升级到新版)" : "");
String sb3 = sb2.toString();
TextView textView = new TextView(c());
textView.setMovementMethod(LinkMovementMethod.getInstance());
textView.setPadding(e50.k0(26.0f), e50.k0(20.0f), e50.k0(26.0f), e50.k0(20.0f));
textView.setText(Html.fromHtml(sb3));
new a(textView, sb).start();
}
}