Skip to content

Commit 644a4dd

Browse files
authored
Merge pull request #78 from firebase/master
Merge internal code change
2 parents e99d7aa + 0c98de4 commit 644a4dd

File tree

70 files changed

+5397
-997
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+5397
-997
lines changed

crashlytics/src/cpp/android/crashlytics_android.cc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <jni.h>
1919

2020
#include "app/src/include/firebase/app.h"
21+
#include "app/src/log.h"
2122
#include "app/src/util_android.h"
2223

2324
namespace firebase {
@@ -111,6 +112,22 @@ METHOD_LOOKUP_DEFINITION(java_stack_trace_element,
111112
"java/lang/StackTraceElement",
112113
JAVA_STACK_TRACE_ELEMENT);
113114

115+
// clang-format off
116+
#define CRASHLYTICS_NDK_METHODS(X) \
117+
X(GetInstance, "getInstance", \
118+
"()Lcom/google/firebase/crashlytics/ndk/FirebaseCrashlyticsNdk;", \
119+
util::kMethodTypeStatic), \
120+
X(InstallSignalHandler, "installSignalHandler", \
121+
"()V", \
122+
util::kMethodTypeInstance)
123+
// clang-format on
124+
METHOD_LOOKUP_DECLARATION(firebase_crashlytics_ndk, CRASHLYTICS_NDK_METHODS);
125+
METHOD_LOOKUP_DEFINITION(
126+
firebase_crashlytics_ndk,
127+
PROGUARD_KEEP_CLASS
128+
"com/google/firebase/crashlytics/ndk/FirebaseCrashlyticsNdk",
129+
CRASHLYTICS_NDK_METHODS);
130+
114131
static const int ANDROID_LOG_DEBUG = 3;
115132
static const char* EXCEPTION_MESSAGE_SEPARATOR = " : ";
116133

@@ -177,6 +194,9 @@ CrashlyticsInternal::CrashlyticsInternal(App* app) {
177194
// We cache this value in case it was set to false on a previous run
178195
cached_data_collection_enabled_ =
179196
GetCrashlyticsCollectionEnabled(java_vm_, data_collection_obj_);
197+
198+
// For Unity apps, the signal handler must be explicitly installed
199+
InstallNdkSignalHandler();
180200
}
181201

182202
CrashlyticsInternal::~CrashlyticsInternal() {
@@ -206,6 +226,7 @@ bool CrashlyticsInternal::Initialize(JNIEnv* env, jobject activity) {
206226
}
207227
if (!(firebase_crashlytics::CacheMethodIds(env, activity) &&
208228
firebase_crashlytics::CacheFieldIds(env, activity) &&
229+
firebase_crashlytics_ndk::CacheMethodIds(env, activity) &&
209230
crashlytics_core::CacheFieldIds(env, activity) &&
210231
crashlytics_data_collection::CacheMethodIds(env, activity) &&
211232
java_exception::CacheMethodIds(env, activity) &&
@@ -234,6 +255,19 @@ void CrashlyticsInternal::Terminate() {
234255
}
235256
}
236257

258+
void CrashlyticsInternal::InstallNdkSignalHandler() {
259+
firebase::LogDebug("Installing Crashlytics NDK signal handlers...");
260+
JNIEnv* env = util::GetThreadsafeJNIEnv(java_vm_);
261+
jobject ndk_obj =
262+
env->CallStaticObjectMethod(firebase_crashlytics_ndk::GetClass(),
263+
firebase_crashlytics_ndk::GetMethodId(
264+
firebase_crashlytics_ndk::kGetInstance));
265+
env->CallVoidMethod(ndk_obj,
266+
firebase_crashlytics_ndk::GetMethodId(
267+
firebase_crashlytics_ndk::kInstallSignalHandler));
268+
env->DeleteLocalRef(ndk_obj);
269+
}
270+
237271
void CrashlyticsInternal::Log(const char* message) {
238272
if (!cached_data_collection_enabled_) {
239273
return;

crashlytics/src/cpp/android/crashlytics_android.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class CrashlyticsInternal {
5959
std::vector<firebase::crashlytics::Frame>& frames);
6060
jobject BuildJavaStackTrace(std::vector<Frame>& frames);
6161

62+
void InstallNdkSignalHandler();
63+
6264
static Mutex init_mutex_;
6365
static Mutex data_collection_mutex_;
6466
static int initialize_count_;

docs/readme.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,54 @@ Support
163163

164164
Release Notes
165165
-------------
166-
### Unreleased:
166+
### 8.5.0:
167167
- Changes
168-
- Crashlytics: Upload UnityFramework symbols in addition to the main app
169-
dSYM file to improve symbolication
170-
([#673](https://github.com/firebase/quickstart-unity/issues/673)).
168+
- General (iOS): iOS SDKs are now built using Xcode 13.0.0.
169+
- Crashlytics: Improved crash reporting for Unity Android apps using the
170+
IL2CPP scripting backend. To display symbolicated IL2CPP stack traces in
171+
the Crashlytics console, Android customers will need to upload symbol
172+
files for their builds. See the [Getting Started with Crashlytics Unity]
173+
(https://firebase.google.com/docs/crashlytics/get-started?platform=unity)
174+
Guild for more details.
175+
- Firestore: Fixed an issue where the `Equals()` and `GetHashCode()` methods
176+
of `DocumentSnapshot` would sometimes be inconsistent
177+
([#8647](https://github.com/firebase/firebase-ios-sdk/pull/8647)).
178+
179+
### 8.4.0:
180+
- Changes
181+
- General: Added support for Android x86 64.
182+
- Firestore: Improved the efficiency of progress callbacks in
183+
`LoadBundleAsync()`.
184+
- Firestore: Fixed crashes in Unity Editor on Linux caused by C++ exceptions
185+
failing to be converted to C# exceptions.
186+
- Firestore: Fixed intermittent hangs on Android when exceptions are thrown
187+
by callbacks.
188+
- Firestore: Fixed a crash on Android when `DocumentReference.Set()` was
189+
invoked with an invalid `documentData` value (e.g. an int).
190+
- Firestore: Fixed race conditions in the instance caching, terminate, and
191+
disposal logic of `FirebaseFirestore`.
192+
193+
### 8.3.0:
194+
- Changes
195+
- Firestore: Simplified the API for modifying the settings of a
196+
`FirebaseFirestore` instance. This is a backwards-incompatible change and
197+
requires updates to code that sets `FirebaseFirestore.Settings`.
198+
- Firestore: Changed an argument to `Query.WhereNotIn()` from `List` to
199+
`IEnumerable`, to be consistent with `Query.WhereIn()`.
200+
- Messaging (Android): Fixes an issue with receiving tokens when
201+
initializing the app.
171202

172203
### 8.2.0:
173204
- Changes
174205
- Firestore: Removed `Equals` and `GetHashCode` methods from `Query`,
175206
`QuerySnapshot`, and `DocumentSnapshot` classes. These methods were
176207
unimplemented, and we plan to add proper support for them in a future
177208
release.
209+
- Crashlytics: Upload UnityFramework symbols in addition to the main app
210+
dSYM file to improve symbolication
211+
([#673](https://github.com/firebase/quickstart-unity/issues/673)).
212+
- Messaging: Fixed a duplicate class error when building an application
213+
which also uses Firebase Functions.
178214

179215
### 8.1.0:
180216
- Changes

0 commit comments

Comments
 (0)