├── README ├── app ├── AndroidManifest.xml ├── generate_header.sh ├── jni │ ├── Android.mk │ ├── Application.mk │ ├── native_lib.cpp │ └── native_lib.h ├── local.properties ├── pom.xml ├── project.properties ├── res │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-ldpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── layout │ │ └── main.xml │ └── values │ │ └── strings.xml └── src │ └── name │ └── antonsmirnov │ └── android │ └── acra_breakpad │ └── app │ ├── App.java │ ├── MainActivity.java │ └── NativeLib.java ├── compile.sh ├── lib ├── AndroidManifest.xml ├── generate_header.sh ├── jni │ ├── Android.mk │ ├── Application.mk │ ├── breakpad │ ├── native_exception_handler.cpp │ └── native_exception_handler.h ├── pom.xml ├── res │ └── values │ │ └── strings.xml └── src │ └── name │ └── antonsmirnov │ └── android │ └── acra_breakpad │ ├── NativeException.java │ └── NativeExceptionHandler.java └── pom.xml /README: -------------------------------------------------------------------------------- 1 | Acra-breakpad 2 | ============= 3 | 4 | Integration for Acra and google-breakpad: catch native crashes using ACRA 5 | 6 | How to build: 7 | 0. clone forked ACRA with binary attachments support (https://github.com/4ntoine/acra) and build the project (mvn clean install) 8 | 1. Go to lib/jni 9 | 2. clone (https://code.google.com/p/google-breakpad/source/checkout) or symlink google-breakpad sources to 'lib/jni/breakpad' 10 | 3. edit lib/jni/Android.mk to set current local path after breakpad is build (sorry for doing it in a bit hacky way) 11 | 4. ndk-build 12 | 5. Go to app/jni 13 | 6. ndk-build 14 | 7. Go to project root directory 15 | 8. mvn clean install 16 | 17 | How to test: 18 | 1. Launch the app 19 | 2. Click "Test catch" 20 | -------------------------------------------------------------------------------- /app/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/generate_header.sh: -------------------------------------------------------------------------------- 1 | javah -classpath ./target/classes -o ./jni/native_lib.h name.antonsmirnov.android.acra_breakpad.app.NativeLib 2 | -------------------------------------------------------------------------------- /app/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_MODULE := native 5 | LOCAL_SRC_FILES := native_lib.cpp 6 | LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog 7 | #LOCAL_CPP_FEATURES += exceptions 8 | 9 | # ARM (coffeecatch) 10 | #LOCAL_CFLAGS := -funwind-tables -Wl,--no-merge-exidx-entries 11 | 12 | include $(BUILD_SHARED_LIBRARY) -------------------------------------------------------------------------------- /app/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := all 2 | #APP_CPPFLAGS += -fexceptions 3 | #APP_STL := gnustl_shared -------------------------------------------------------------------------------- /app/jni/native_lib.cpp: -------------------------------------------------------------------------------- 1 | #include "native_lib.h" 2 | 3 | #include 4 | 5 | void debug(const char *format, ... ) { 6 | va_list argptr; 7 | va_start(argptr, format); 8 | __android_log_vprint(ANDROID_LOG_ERROR, "NATIVE_LIB", format, argptr); 9 | va_end(argptr); 10 | } 11 | 12 | JNIEXPORT jint JNICALL Java_name_antonsmirnov_android_acra_1breakpad_app_NativeLib_native_1func 13 | (JNIEnv *env, jclass self, jstring tmp1, jobject tmp2, jobject tmp3) 14 | { 15 | debug("testing crash\n"); 16 | 17 | char *ptr = 0; 18 | *ptr = '!'; // ERROR HERE! 19 | 20 | debug("unreachable\n"); 21 | } -------------------------------------------------------------------------------- /app/jni/native_lib.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class name_antonsmirnov_android_acra_breakpad_app_NativeLib */ 4 | 5 | #ifndef _Included_name_antonsmirnov_android_acra_breakpad_app_NativeLib 6 | #define _Included_name_antonsmirnov_android_acra_breakpad_app_NativeLib 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: name_antonsmirnov_android_acra_breakpad_app_NativeLib 12 | * Method: native_func 13 | * Signature: (Ljava/lang/String;Ljava/util/List;Ljava/lang/Object;)I 14 | */ 15 | JNIEXPORT jint JNICALL Java_name_antonsmirnov_android_acra_1breakpad_app_NativeLib_native_1func 16 | (JNIEnv *, jclass, jstring, jobject, jobject); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /app/local.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must *NOT* be checked into Version Control Systems, 5 | # as it contains information specific to your local configuration. 6 | 7 | # location of the SDK. This is only used by Ant 8 | # For customization when using a Version Control System, please read the 9 | # header note. 10 | sdk.dir=/softdev/android-sdk_r21 11 | -------------------------------------------------------------------------------- /app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 4.0.0 7 | 8 | name.antonsmirnov.android 9 | acra_breakpad_demo 10 | 1.0 11 | apk 12 | acra_breakpad demo app 13 | Acra-breakpad integration demo app 14 | 15 | 16 | 17 | Anton Smirnov 18 | dev@antonsmirnov.name 19 | 20 | 21 | 22 | 23 | 24 | 25 | com.google.android 26 | android 27 | 4.0.1.2 28 | provided 29 | 30 | 31 | 32 | 33 | ch.acra 34 | acra 35 | 5.0.0-SNAPSHOT 36 | 37 | 38 | 39 | 40 | name.antonsmirnov.android 41 | acra_breakpad 42 | 1.0 43 | apklib 44 | 45 | 46 | 47 | 48 | 49 | src 50 | 51 | 52 | 53 | com.jayway.maven.plugins.android.generation2 54 | android-maven-plugin 55 | 3.6.0 56 | 57 | 58 | alignApk 59 | install 60 | 61 | 62 | 63 | ${project.basedir}/src 64 | ${project.basedir}/res 65 | 66 | 16 67 | 68 | true 69 | 70 | true 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /app/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-16 15 | android.library.reference.1=../lib 16 | -------------------------------------------------------------------------------- /app/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4ntoine/Acra-breakpad/35a681e60175432c24020c12db56f3e8d2d5dd39/app/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4ntoine/Acra-breakpad/35a681e60175432c24020c12db56f3e8d2d5dd39/app/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /app/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4ntoine/Acra-breakpad/35a681e60175432c24020c12db56f3e8d2d5dd39/app/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4ntoine/Acra-breakpad/35a681e60175432c24020c12db56f3e8d2d5dd39/app/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 |