Skip to content

Commit fcd3989

Browse files
cynthiajoanGooglerCynthia Jiang
authored
Merge from internal (#204)
* Initial import of the Firebase Unity SDK - 434873250 Update Firebase.Editor.dll to search for a "python" execu... by jsimantov <[email protected]> - 433819934 Update Unity FIS GetInstance and Auth GetAuth to always c... by Googler <[email protected]> - 427297110 Update the version number and guids for 8.8.1 by amaurice <[email protected]> - 424921630 Fix TimeSpan being used incorrectly in RC Unity by amaurice <[email protected]> - 424476677 Update the Unity version for M110 release (8.8.0) by amaurice <[email protected]> - 424457207 Update Crashlytics Android SDK version for Firebase Unity... by Googler <[email protected]> - 424440457 Import firebase/firebase-cpp-sdk from GitHub. by amaurice <[email protected]> - 423184695 Roll-up EDM4U version for Firebase SDK by chkuang <[email protected]> - 421668891 Add script to copy unity github produced release artifact... by cynthiajiang <[email protected]> PiperOrigin-RevId: 434873250 * Merge remote-tracking branch 'origin/master' into ghm Co-authored-by: Googler <[email protected]> Co-authored-by: Cynthia Jiang <[email protected]>
1 parent ee7e45d commit fcd3989

File tree

10 files changed

+703
-11
lines changed

10 files changed

+703
-11
lines changed

app/src/cpp_instance_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#include <unordered_map>
2424

2525
#include "app/src/assert.h"
26-
#include "app/src/log.h"
2726
#include "app/src/include/firebase/internal/mutex.h"
27+
#include "app/src/log.h"
2828

2929
namespace firebase {
3030

auth/src/swig/auth.i

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,19 @@ static CppInstanceManager<Auth> g_auth_instances;
437437
return instance;
438438
}
439439

440+
%csmethodmodifiers LogHeartbeatInternal(App* app) "internal";
441+
static void LogHeartbeatInternal(App* app) {
442+
// Call the internal getter in order to trigger usage logging.
443+
::firebase::MutexLock lock(
444+
::firebase::auth::g_auth_instances.mutex());
445+
firebase::auth::Auth* instance = firebase::auth::Auth::GetAuth(app);
446+
// Future-proof against the possibility of the instance having no other
447+
// references by incrementing and decrementing the reference counter so that
448+
// memory can be freed if the reference count reaches zero.
449+
::firebase::auth::g_auth_instances.AddReference(instance);
450+
::firebase::auth::g_auth_instances.ReleaseReference(instance);
451+
}
452+
440453
// Release and decrement the reference count to a C++ instance
441454
%csmethodmodifiers ReleaseReferenceInternal(firebase::auth::Auth* instance) "internal";
442455
static void ReleaseReferenceInternal(firebase::auth::Auth* instance) {
@@ -522,7 +535,10 @@ static CppInstanceManager<Auth> g_auth_instances;
522535
lock (appCPtrToAuth) {
523536
System.IntPtr appCPtr = FirebaseApp.getCPtr(app).Handle;
524537
auth = ProxyFromAppCPtr(appCPtr);
525-
if (auth != null) return auth;
538+
if (auth != null) {
539+
LogHeartbeatInternal(app);
540+
return auth;
541+
}
526542
InitResult init_result;
527543
FirebaseApp.TranslateDllNotFoundException(() => {
528544
auth = GetAuthInternal(app, out init_result);

crashlytics/src/cpp/common/crashlytics.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
#include "app/src/assert.h"
2222
#include "app/src/cleanup_notifier.h"
2323
#include "app/src/include/firebase/app.h"
24+
#include "app/src/include/firebase/internal/mutex.h"
2425
#include "app/src/include/firebase/version.h"
2526
#include "app/src/log.h"
26-
#include "app/src/include/firebase/internal/mutex.h"
2727
#include "app/src/util.h"
2828

2929
#if defined(__ANDROID__)

docs/readme.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,31 @@ Support
163163

164164
Release Notes
165165
-------------
166-
### UNRELEASED
166+
### 8.9.0
167167
- Changes
168+
- General (Editor, macOS): Support non-default "python" executable names,
169+
common in newer macOS versions.
170+
171+
### 8.8.1
172+
- Changes
173+
- General (iOS): Fixed additional issues on iOS 15 caused by early
174+
initialization of Firebase iOS SDK.
175+
176+
### 8.8.0
177+
- Changes
178+
- General (iOS): Another possible fix for an intermittent crash on iOS 15
179+
caused by constructing C++ objects during Objective-C's `+load` method.
168180
- Storage: Added a method to access the url of a storage instance.
181+
- Crashlytics (Android): Updated internal Crashpad version to commit
182+
`281ba7`. With this change, disabling tagged pointers is no longer
183+
required, so the following can be removed from your manifest's
184+
application tag: `android:allowNativeHeapPointerTagging=false`.
185+
- Crashlytics (Android): Improved runtime efficiency of the
186+
[`SetCustomKey` functions](/docs/crashlytics/customize-crash-reports?platform=unity#add-keys),
187+
significantly reducing the number objects created and disk writes when
188+
keys are updated frequently.
189+
- Remote Config: Fixed an issue where the TimeSpan field of FetchDataAsync
190+
was being used incorrectly.
169191

170192
### 8.7.0:
171193
- Changes

editor/app/src/PythonExecutor.cs

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,53 @@ public string ScriptPath {
114114
}
115115
}
116116

117-
private const string PYTHON_INTERPRETER = "python";
117+
private static readonly string[] PYTHON_INTERPRETERS = {
118+
"python", "python3", "python3.8","python3.7", "python2.7", "python2"
119+
};
120+
121+
private static string s_pythonInterpreter = null;
122+
123+
private static void FindPythonInterpreter() {
124+
// Run each entry in PYTHON_INTERPRETERS in sequence until we get one
125+
// that succeeds.
126+
foreach (string interpreter in PYTHON_INTERPRETERS) {
127+
try {
128+
CommandLine.Result result = CommandLine.Run(interpreter, "--version");
129+
if (result.exitCode == 0) {
130+
s_pythonInterpreter = interpreter;
131+
// Found one, finished!
132+
return;
133+
}
134+
}
135+
catch(Exception e) {
136+
// This one failed, ignore and move on to the next one.
137+
}
138+
}
139+
// Fall back to the first option in case none worked, so this doesn't
140+
// keep retrying.
141+
Debug.LogError(
142+
"Could not find a working python interpreter. " +
143+
"Please make sure one of the following is in your PATH: " +
144+
String.Join(" ", PYTHON_INTERPRETERS));
145+
s_pythonInterpreter = PYTHON_INTERPRETERS[0];
146+
}
147+
148+
private static string PythonInterpreter {
149+
get {
150+
if (s_pythonInterpreter == null) {
151+
FindPythonInterpreter();
152+
}
153+
return s_pythonInterpreter;
154+
}
155+
}
118156

119157
/// <summary>
120158
/// Get the executable to run the script.
121159
/// </summary>
122160
public string Executable {
123161
get {
124162
return Application.platform == RuntimePlatform.WindowsEditor ?
125-
ScriptPath : PYTHON_INTERPRETER;
163+
ScriptPath : PythonInterpreter;
126164
}
127165
}
128166

@@ -132,7 +170,7 @@ public string Executable {
132170
/// <param name="arguments">List of arguments to pass to the script.</param>
133171
/// <returns>List of arguments to pass to the Executable to run the script.</returns>
134172
public IEnumerable<string> GetArguments(IEnumerable<string> arguments) {
135-
if (Executable != PYTHON_INTERPRETER) return arguments;
173+
if (Executable != PythonInterpreter) return arguments;
136174
var argsWithScript = new List<string>();
137175
argsWithScript.Add(String.Format("\"{0}\"", ScriptPath));
138176
argsWithScript.AddRange(arguments);
@@ -155,7 +193,7 @@ public string GetCommand(IEnumerable<string> arguments) {
155193
/// If execution fails on Windows 7/8, suggest potential remidies.
156194
/// </summary>
157195
private CommandLine.Result SuggestWorkaroundsOnFailure(CommandLine.Result result) {
158-
if (result.exitCode != 0 && Executable != PYTHON_INTERPRETER) {
196+
if (result.exitCode != 0 && Executable != PythonInterpreter) {
159197
Debug.LogWarning(String.Format(DocRef.PythonScriptExecutionFailed, result.message,
160198
Executable));
161199
}

installations/src/swig/installations.i

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,20 @@ static CppInstanceManager<Installations> g_installations_instances;
6161
return instance;
6262
}
6363

64+
%csmethodmodifiers LogHeartbeatInternal(App* app) "internal";
65+
static void LogHeartbeatInternal(App* app) {
66+
// Call the internal getter in order to trigger usage logging.
67+
::firebase::MutexLock lock(
68+
::firebase::installations::g_installations_instances.mutex());
69+
firebase::installations::Installations* instance =
70+
firebase::installations::Installations::GetInstance(app);
71+
// Future-proof against the possibility of the instance having no other
72+
// references by incrementing and decrementing the reference counter so that
73+
// memory can be freed if the reference count reaches zero.
74+
::firebase::installations::g_installations_instances.AddReference(instance);
75+
::firebase::installations::g_installations_instances.ReleaseReference(instance);
76+
}
77+
6478
%csmethodmodifiers ReleaseReferenceInternal(firebase::installations::Installations* instance) "internal";
6579
static void ReleaseReferenceInternal(
6680
firebase::installations::Installations* instance) {
@@ -145,7 +159,10 @@ static CppInstanceManager<Installations> g_installations_instances;
145159
lock (installationsByAppCPtr) {
146160
System.IntPtr appCPtr = FirebaseApp.getCPtr(app).Handle;
147161
installations = ProxyFromAppCPtr(appCPtr);
148-
if (installations != null) return installations;
162+
if (installations != null) {
163+
LogHeartbeatInternal(app);
164+
return installations;
165+
}
149166
FirebaseApp.TranslateDllNotFoundException(() => {
150167
installations = GetInstallationsInternal(app);
151168
});

0 commit comments

Comments
 (0)