|
@@ -7,6 +7,7 @@ import android.content.pm.PackageManager;
|
|
import android.os.Build;
|
|
import android.os.Build;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONException;
|
|
import com.alibaba.fastjson.JSONException;
|
|
|
|
+import com.elvishew.xlog.XLog;
|
|
import com.fxy.BuildConfig;
|
|
import com.fxy.BuildConfig;
|
|
import com.fxy.baselibrary.util.RxTimeTool;
|
|
import com.fxy.baselibrary.util.RxTimeTool;
|
|
import com.fxy.constant.SPCache;
|
|
import com.fxy.constant.SPCache;
|
|
@@ -56,8 +57,10 @@ public class CrashHandler implements UncaughtExceptionHandler {
|
|
public void sendError() {
|
|
public void sendError() {
|
|
//先不发送
|
|
//先不发送
|
|
try {
|
|
try {
|
|
|
|
+
|
|
SharedPreferences sp = mContext.getSharedPreferences("errorInfo", Context.MODE_PRIVATE);
|
|
SharedPreferences sp = mContext.getSharedPreferences("errorInfo", Context.MODE_PRIVATE);
|
|
String data = sp.getString("data", "");
|
|
String data = sp.getString("data", "");
|
|
|
|
+ XLog.e("崩溃信息:",data);
|
|
if (!data.isEmpty()) {
|
|
if (!data.isEmpty()) {
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put("content",data);
|
|
jsonObject.put("content",data);
|
|
@@ -98,6 +101,7 @@ public class CrashHandler implements UncaughtExceptionHandler {
|
|
"崩溃原因:" + throwable.getMessage() + "\n\n" +
|
|
"崩溃原因:" + throwable.getMessage() + "\n\n" +
|
|
"详细信息:" + Arrays.toString(throwable.getStackTrace());
|
|
"详细信息:" + Arrays.toString(throwable.getStackTrace());
|
|
sp.edit().putString("data", stringBuffer).apply();
|
|
sp.edit().putString("data", stringBuffer).apply();
|
|
|
|
+
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|