-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #609 from Microsoft/develop
Version 1.2.0
- Loading branch information
Showing
96 changed files
with
3,114 additions
and
677 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "apps/sasquatch/src/main/cpp/google-breakpad"] | ||
path = apps/sasquatch/src/main/cpp/google-breakpad | ||
url = https://github.com/Microsoft/AppCenter-SDK-Android-Breakpad.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Contributing to Visual Studio App Center SDK for Android | ||
|
||
Welcome, and thank you for your interest in contributing to VS App Center SDK for Android! | ||
The goal of this document is to provide a high-level overview of how you can get involved. | ||
|
||
## Sending a pull request | ||
|
||
Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it. | ||
|
||
Please make sure the following is done when submitting a pull request: | ||
|
||
### Workflow and validation | ||
|
||
1. Fork the repository and create your branch from `develop`. | ||
1. Make sure all tests have passed and your code is covered: run `gradlew coverageReport`command to generate report. | ||
1. Make sure that there are no lint errors: run `gradlew assemble lint` command. | ||
1. After creating a pull request, sign the CLA, if you haven't already. | ||
|
||
### Code formatting | ||
|
||
1. Make sure you name all the constants in capital letters. | ||
1. Make sure you name all the classes in upper camel case. | ||
1. Use blank line in-between methods. | ||
1. No newlines within methods except in front of a comment. | ||
1. Make sure you name all the properties/methods in camel case. Start private properties with `m`, static properties with `s`. | ||
1. Use `{}` even if you have single operation in block. | ||
|
||
### Comments | ||
|
||
1. Use capital letter in the beginning of each comment and dot at the end. | ||
1. For comments use `/* */` (multiline) even if it's only one line. | ||
1. Provide JavaDoc for each `public` and `protected` class, method, property. | ||
1. Use blank line between description and tags like `@return` or `@param`. | ||
> Tip: You can configure these options in Android Studio via File > Settings > Editor > Code Style > Java | ||
## Thank You! | ||
|
||
Your contributions to open source, large or small, constantly make projects better. Thank you for taking the time to contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
MY_ROOT_PATH := $(call my-dir)/src/main/cpp | ||
|
||
include $(MY_ROOT_PATH)/google-breakpad/Android.mk | ||
|
||
LOCAL_PATH := $(MY_ROOT_PATH) | ||
|
||
include $(CLEAR_VARS) | ||
|
||
LOCAL_MODULE := SasquatchBreakpad | ||
LOCAL_SRC_FILES := main.cpp | ||
|
||
LOCAL_CPPFLAGS := -D__NDK_R16B__ | ||
LOCAL_LDFLAGS := -latomic | ||
LOCAL_LALIBS += -llog | ||
LOCAL_STATIC_LIBRARIES += breakpad_client | ||
|
||
include $(BUILD_SHARED_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
APP_STL := gnustl_static | ||
APP_PLATFORM := android-9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Sets the minimum version of CMake required to build the native | ||
# library. You should either keep the default value or only pass a | ||
# value of 3.4.0 or lower. | ||
|
||
cmake_minimum_required(VERSION 3.4.1) | ||
|
||
# Creates and names a library, sets it as either STATIC | ||
# or SHARED, and provides the relative paths to its source code. | ||
# You can define multiple libraries, and CMake builds it for you. | ||
# Gradle automatically packages shared libraries with your APK. | ||
|
||
add_library( # Sets the name of the library. | ||
SasquatchBreakpad | ||
|
||
# Sets the library as a shared library. | ||
SHARED | ||
|
||
# Provides a relative path to your source file(s). | ||
# Associated headers in the same location as their source | ||
# file are automatically included. | ||
src/main/cpp/main.cpp ) | ||
|
||
# Searches for a specified prebuilt library and stores the path as a | ||
# variable. Because system libraries are included in the search path by | ||
# default, you only need to specify the name of the public NDK library | ||
# you want to add. CMake verifies that the library exists before | ||
# completing its build. | ||
|
||
find_library( # Sets the name of the path variable. | ||
log-lib | ||
|
||
# Specifies the name of the NDK library that | ||
# you want CMake to locate. | ||
log ) | ||
|
||
# Specifies libraries CMake should link to your target library. You | ||
# can link multiple libraries, such as libraries you define in the | ||
# build script, prebuilt third-party libraries, or system libraries. | ||
|
||
target_link_libraries( # Specifies the target library. | ||
SasquatchBreakpad | ||
|
||
# Links the target library to the log library | ||
# included in the NDK. | ||
${log-lib} ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule google-breakpad
added at
a8dba9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation | ||
* | ||
* All rights reserved. | ||
* | ||
* MIT License | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
* this software and associated documentation files (the "Software"), to deal in the | ||
* Software without restriction, including without limitation the rights to use, copy, | ||
* modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
* and to permit persons to whom the Software is furnished to do so, subject to the | ||
* following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | ||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
#include <jni.h> | ||
#include <string> | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include "android/log.h" | ||
#include "google-breakpad/src/client/linux/handler/exception_handler.h" | ||
#include "google-breakpad/src/client/linux/handler/minidump_descriptor.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
#pragma clang diagnostic push | ||
#pragma clang diagnostic ignored "-Wunused-parameter" | ||
|
||
/* | ||
* Triggered automatically after an attempt to write a minidump file to the breakpad folder. | ||
*/ | ||
bool dumpCallback(const google_breakpad::MinidumpDescriptor &descriptor, | ||
void *context, | ||
bool succeeded) { | ||
|
||
/* Allow system to log the native stack trace. */ | ||
__android_log_print(ANDROID_LOG_INFO, "AppCenterSasquatch", | ||
"Wrote breakpad minidump at %s succeeded=%d\n", descriptor.path(), | ||
succeeded); | ||
return false; | ||
} | ||
#pragma clang diagnostic pop | ||
|
||
/** | ||
* Registers breakpad as the exception handler for NDK code. | ||
* @param env JNI environment. | ||
* @param path minidump directory path returned from Crashes.getMinidumpDirectory() | ||
*/ | ||
void Java_com_microsoft_appcenter_sasquatch_activities_MainActivity_setupNativeCrashesListener( | ||
JNIEnv *env, jobject, jstring path) { | ||
const char *dumpPath = (char *) env->GetStringUTFChars(path, NULL); | ||
google_breakpad::MinidumpDescriptor descriptor(dumpPath); | ||
new google_breakpad::ExceptionHandler(descriptor, NULL, dumpCallback, NULL, true, -1); | ||
env->ReleaseStringUTFChars(path, dumpPath); | ||
} | ||
|
||
#pragma clang diagnostic push | ||
#pragma clang diagnostic ignored "-Wunused-parameter" | ||
#pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection" | ||
jint JNI_OnLoad(JavaVM *vm, void * /*reserved*/) { | ||
__android_log_print(ANDROID_LOG_INFO, "AppCenterSasquatch", "JNI OnLoad"); | ||
return JNI_VERSION_1_4; | ||
} | ||
#pragma clang diagnostic pop | ||
|
||
#pragma clang diagnostic push | ||
#pragma clang diagnostic ignored "-Wunused-parameter" | ||
#pragma ide diagnostic ignored "OCDFAInspection" | ||
void | ||
Java_com_microsoft_appcenter_sasquatch_activities_CrashActivity_nativeDereferenceNullPointer( | ||
JNIEnv *env, | ||
jobject obj) { | ||
volatile int *a = reinterpret_cast<volatile int *>(NULL); | ||
*a = 1; | ||
} | ||
#pragma clang diagnostic pop | ||
|
||
#pragma clang diagnostic push | ||
#pragma ide diagnostic ignored "InfiniteRecursion" | ||
void Java_com_microsoft_appcenter_sasquatch_activities_CrashActivity_nativeStackOverflowCrash( | ||
JNIEnv *env, jobject obj) { | ||
Java_com_microsoft_appcenter_sasquatch_activities_CrashActivity_nativeStackOverflowCrash(env, | ||
obj); | ||
|
||
/* Defeat release build optimization by adding another statement after recursion. */ | ||
__android_log_print(ANDROID_LOG_INFO, "AppCenterSasquatch", | ||
"You will never see this log after an infinite loop."); | ||
} | ||
#pragma clang diagnostic pop | ||
|
||
#pragma clang diagnostic push | ||
#pragma clang diagnostic ignored "-Wunused-parameter" | ||
void | ||
Java_com_microsoft_appcenter_sasquatch_activities_CrashActivity_nativeAbortCall(JNIEnv *env, | ||
jobject obj) { | ||
abort(); | ||
} | ||
#pragma clang diagnostic pop | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 7 additions & 2 deletions
9
apps/sasquatch/src/main/java/com/microsoft/appcenter/crashes/CrashesPrivateHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.