// Path: sherlock/src/main/java/com/singhajit/sherlock/core/Sherlock.java
// public class Sherlock {
//   private static final String TAG = Sherlock.class.getSimpleName();
//   private static Sherlock instance;
//   private final SherlockDatabaseHelper database;
//   private final CrashReporter crashReporter;
//   private AppInfoProvider appInfoProvider;
// 
//   private Sherlock(Context context) {
//     database = new SherlockDatabaseHelper(context);
//     crashReporter = new CrashReporter(context);
//     appInfoProvider = new DefaultAppInfoProvider(context);
//   }
// 
//   public static void init(final Context context) {
//     Log.d(TAG, "Initializing Sherlock...");
//     instance = new Sherlock(context);
// 
//     final Thread.UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler();
// 
//     Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
//       @Override
//       public void uncaughtException(Thread thread, Throwable throwable) {
//         analyzeAndReportCrash(throwable);
//         handler.uncaughtException(thread, throwable);
//       }
//     });
//   }
// 
//   public static boolean isInitialized() {
//     return instance != null;
//   }
// 
//   public static Sherlock getInstance() {
//     if (!isInitialized()) {
//       throw new SherlockNotInitializedException();
//     }
//     Log.d(TAG, "Returning existing instance...");
//     return instance;
//   }
// 
//   public List<Crash> getAllCrashes() {
//     return getInstance().database.getCrashes();
//   }
// 
//   private static void analyzeAndReportCrash(Throwable throwable) {
//     Log.d(TAG, "Analyzing Crash...");
//     CrashAnalyzer crashAnalyzer = new CrashAnalyzer(throwable);
//     Crash crash = crashAnalyzer.getAnalysis();
//     int crashId = instance.database.insertCrash(CrashRecord.createFrom(crash));
//     crash.setId(crashId);
//     instance.crashReporter.report(new CrashViewModel(crash));
//     Log.d(TAG, "Crash analysis completed!");
//   }
// 
//   public static void setAppInfoProvider(AppInfoProvider appInfoProvider) {
//     getInstance().appInfoProvider = appInfoProvider;
//   }
// 
//   public AppInfoProvider getAppInfoProvider() {
//     return getInstance().appInfoProvider;
//   }
// }


import com.singhajit.sherlock.core.Sherlock;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
package com.singhajit.sherlock.core.investigation;



public class Crash {
  private int id;
  private DeviceInfo deviceInfo;
  private AppInfo appInfo;
  private String place;
  private String reason;
  private String stackTrace;
  private Date date;
  public static final String DATE_FORMAT = "EEE MMM dd kk:mm:ss z yyyy";

  public Crash(String place, String reason, String stackTrace) {
    this.place = place;
    this.stackTrace = stackTrace;
    this.reason = reason;
    this.date = new Date();
    this.deviceInfo = DeviceInfoProvider.getDeviceInfo();
// Path: sherlock/src/main/java/com/singhajit/sherlock/core/Sherlock.java
// public class Sherlock {
//   private static final String TAG = Sherlock.class.getSimpleName();
//   private static Sherlock instance;
//   private final SherlockDatabaseHelper database;
//   private final CrashReporter crashReporter;
//   private AppInfoProvider appInfoProvider;
// 
//   private Sherlock(Context context) {
//     database = new SherlockDatabaseHelper(context);
//     crashReporter = new CrashReporter(context);
//     appInfoProvider = new DefaultAppInfoProvider(context);
//   }
// 
//   public static void init(final Context context) {
//     Log.d(TAG, "Initializing Sherlock...");
//     instance = new Sherlock(context);
// 
//     final Thread.UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler();
// 
//     Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
//       @Override
//       public void uncaughtException(Thread thread, Throwable throwable) {
//         analyzeAndReportCrash(throwable);
//         handler.uncaughtException(thread, throwable);
//       }
//     });
//   }
// 
//   public static boolean isInitialized() {
//     return instance != null;
//   }
// 
//   public static Sherlock getInstance() {
//     if (!isInitialized()) {
//       throw new SherlockNotInitializedException();
//     }
//     Log.d(TAG, "Returning existing instance...");
//     return instance;
//   }
// 
//   public List<Crash> getAllCrashes() {
//     return getInstance().database.getCrashes();
//   }
// 
//   private static void analyzeAndReportCrash(Throwable throwable) {
//     Log.d(TAG, "Analyzing Crash...");
//     CrashAnalyzer crashAnalyzer = new CrashAnalyzer(throwable);
//     Crash crash = crashAnalyzer.getAnalysis();
//     int crashId = instance.database.insertCrash(CrashRecord.createFrom(crash));
//     crash.setId(crashId);
//     instance.crashReporter.report(new CrashViewModel(crash));
//     Log.d(TAG, "Crash analysis completed!");
//   }
// 
//   public static void setAppInfoProvider(AppInfoProvider appInfoProvider) {
//     getInstance().appInfoProvider = appInfoProvider;
//   }
// 
//   public AppInfoProvider getAppInfoProvider() {
//     return getInstance().appInfoProvider;
//   }
// }


// Path: sherlock/src/main/java/com/singhajit/sherlock/core/investigation/Crash.java
import com.singhajit.sherlock.core.Sherlock;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

package com.singhajit.sherlock.core.investigation;



public class Crash {
  private int id;
  private DeviceInfo deviceInfo;
  private AppInfo appInfo;
  private String place;
  private String reason;
  private String stackTrace;
  private Date date;
  public static final String DATE_FORMAT = "EEE MMM dd kk:mm:ss z yyyy";

  public Crash(String place, String reason, String stackTrace) {
    this.place = place;
    this.stackTrace = stackTrace;
    this.reason = reason;
    this.date = new Date();
    this.deviceInfo = DeviceInfoProvider.getDeviceInfo();
    if (Sherlock.isInitialized()) {