Search in sources :

Example 1 with ErrorReporter

use of org.acra.ErrorReporter in project android by cSploit.

the class CrashReporter method notifyChildCrashed.

public static void notifyChildCrashed(int childID, int signal) {
    ErrorReporter reporter = ACRA.getErrorReporter();
    reporter.putCustomData("childID", Integer.toString(childID));
    notifyNativeError(reporter, new ChildManager.ChildDiedException(signal));
}
Also used : ErrorReporter(org.acra.ErrorReporter)

Example 2 with ErrorReporter

use of org.acra.ErrorReporter in project J2ME-Loader by nikita36078.

the class MicroLoader method loadMIDletList.

LinkedHashMap<String, String> loadMIDletList() throws IOException {
    LinkedHashMap<String, String> midlets = new LinkedHashMap<>();
    Descriptor descriptor = new Descriptor(new File(appDir, Config.MIDLET_MANIFEST_FILE), false);
    Map<String, String> attr = descriptor.getAttrs();
    ErrorReporter errorReporter = ACRA.getErrorReporter();
    String report = errorReporter.getCustomData(Constants.KEY_APPCENTER_ATTACHMENT);
    StringBuilder sb = new StringBuilder();
    if (report != null) {
        sb.append(report).append("\n");
    }
    sb.append(Descriptor.MIDLET_NAME).append(": ").append(descriptor.getName()).append("\n");
    sb.append(Descriptor.MIDLET_VENDOR).append(": ").append(descriptor.getVendor()).append("\n");
    sb.append(Descriptor.MIDLET_VERSION).append(": ").append(descriptor.getVersion());
    errorReporter.putCustomData(Constants.KEY_APPCENTER_ATTACHMENT, sb.toString());
    MIDlet.initProps(attr);
    for (Map.Entry<String, String> entry : attr.entrySet()) {
        if (entry.getKey().matches("MIDlet-[0-9]+")) {
            String tmp = entry.getValue();
            String clazz = tmp.substring(tmp.lastIndexOf(',') + 1).trim();
            String title = tmp.substring(0, tmp.indexOf(',')).trim();
            midlets.put(clazz, title);
        }
    }
    return midlets;
}
Also used : ErrorReporter(org.acra.ErrorReporter) Descriptor(ru.woesss.j2me.jar.Descriptor) File(java.io.File) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

ErrorReporter (org.acra.ErrorReporter)2 File (java.io.File)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 Descriptor (ru.woesss.j2me.jar.Descriptor)1