Skip to content

Commit

Permalink
Update bugsnag-android v6.5.0 (#766)
Browse files Browse the repository at this point in the history
  • Loading branch information
clr182 authored Jun 3, 2024
1 parent 81aa576 commit c83ddfc
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 12 deletions.
1 change: 0 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ steps:
- "--device=ANDROID_10|ANDROID_11|ANDROID_12|ANDROID_13"
- "--no-tunnel"
- "--aws-public-ip"
- "--fail-fast"
concurrency: 25
concurrency_group: "bitbar"
concurrency_method: eager
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@

### Dependencies

Update bugsnag-cocoa to [v6.28.1](https://github.com/bugsnag/bugsnag-cocoa/releases/tag/v6.28.1) [#774](https://github.com/bugsnag/bugsnag-unity/pull/774)
- Update bugsnag-cocoa to [v6.28.1](https://github.com/bugsnag/bugsnag-cocoa/releases/tag/v6.28.1) [#774](https://github.com/bugsnag/bugsnag-unity/pull/774)

- Update bugsnag-android from [v5.30.0](https://github.com/bugsnag/bugsnag-android/releases/tag/v5.30.0) to [v6.5.0](https://github.com/bugsnag/bugsnag-android/releases/tag/v6.5.0)


## 7.7.6 (2024-05-17)

Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ def assemble_android filter_abis=true

# copy unity lib
unity_lib = File.join("bugsnag-android-unity", "build", "outputs", "aar", "bugsnag-android-unity-release.aar")

FileUtils.cp android_core_lib, File.join(android_dir, "bugsnag-android-release.aar")
FileUtils.cp ndk_lib, File.join(android_dir, "bugsnag-android-ndk-release.aar")
FileUtils.cp ndk_lib, File.join(android_dir, "bugsnag-plugin-android-ndk-release.aar")
FileUtils.cp anr_lib, File.join(android_dir, "bugsnag-plugin-android-anr-release.aar")
FileUtils.cp unity_lib, File.join(android_dir, "bugsnag-android-unity-release.aar")
FileUtils.mkdir File.join(android_dir, "Kotlin")
FileUtils.cp kotlin_stdlib, File.join(android_dir, "Kotlin/kotlin-stdlib.jar")
FileUtils.cp kotlin_stdlib_common, File.join(android_dir, "Kotlin/kotlin-stdlib-common.jar")
FileUtils.cp kotlin_annotations, File.join(android_dir, "Kotlin/kotlin-annotations.jar")

end

namespace :plugin do
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion bugsnag-android
Submodule bugsnag-android updated 366 files
25 changes: 19 additions & 6 deletions src/BugsnagUnity/Native/Android/NativeInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public NativeInterface(Configuration cfg)
{
_configuration = cfg;
AndroidJavaObject config = CreateNativeConfig(cfg);
ConfigureNotifierInfo(config);
Unity2019OrNewer = IsUnity2019OrNewer();
MainThread = Thread.CurrentThread;
using (AndroidJavaClass system = new AndroidJavaClass("java.lang.System"))
Expand Down Expand Up @@ -312,10 +313,9 @@ public NativeInterface(Configuration cfg)
activityName = AndroidJNI.GetStringUTFChars(activityNameObject.GetRawObject());
}
}
sessionTracker.Call("updateForegroundTracker", activityName, true, 0L);
sessionTracker.Call("updateContext", activityName, true);
}

ConfigureNotifierInfo(client);
}
}

Expand Down Expand Up @@ -456,7 +456,7 @@ AndroidJavaObject CreateNativeConfig(Configuration config)
// set DiscardedClasses
if (config.DiscardClasses != null && config.DiscardClasses.Length > 0)
{
obj.Call("setDiscardClasses", GetAndroidStringSetFromArray(config.DiscardClasses));
obj.Call("setDiscardClasses", GetAndroidRegexPatternSetFromArray(config.DiscardClasses));
}

// set ProjectPackages
Expand All @@ -468,7 +468,7 @@ AndroidJavaObject CreateNativeConfig(Configuration config)
// set redacted keys
if (config.RedactedKeys != null && config.RedactedKeys.Length > 0)
{
obj.Call("setRedactedKeys", GetAndroidStringSetFromArray(config.RedactedKeys));
obj.Call("setRedactedKeys", GetAndroidRegexPatternSetFromArray(config.RedactedKeys));
}

// add unity event callback
Expand Down Expand Up @@ -508,11 +508,24 @@ private AndroidJavaObject GetAndroidStringSetFromArray(string[] array)
return set;
}

private void ConfigureNotifierInfo(AndroidJavaObject client)
private AndroidJavaObject GetAndroidRegexPatternSetFromArray(string[] array)
{
using (AndroidJavaObject notifier = client.Get<AndroidJavaObject>("notifier"))
AndroidJavaObject set = new AndroidJavaObject("java.util.HashSet");
AndroidJavaClass patternClass = new AndroidJavaClass("java.util.regex.Pattern");

foreach (var item in array)
{
AndroidJavaObject pattern = patternClass.CallStatic<AndroidJavaObject>("compile", item);
set.Call<bool>("add", pattern);
}

return set;
}

private void ConfigureNotifierInfo(AndroidJavaObject config)
{
using (AndroidJavaObject notifier = config.Call<AndroidJavaObject>("getNotifier"))
{
AndroidJavaObject androidNotifier = new AndroidJavaObject("com.bugsnag.android.Notifier");
androidNotifier.Call("setUrl", androidNotifier.Get<string>("url"));
androidNotifier.Call("setName", androidNotifier.Get<string>("name"));
Expand Down
2 changes: 1 addition & 1 deletion src/BugsnagUnity/Native/Android/NativeThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal class NativeThread : NativePayloadClassWrapper, IThread
{
public NativeThread(AndroidJavaObject androidJavaObject) : base(androidJavaObject){}

public string Id { get => GetNativeLong("getId").ToString(); set => SetNativeLong("setId",long.Parse(value)); }
public string Id { get => GetNativeString("getId"); set => SetNativeString("setId",value); }

public bool? ErrorReportingThread => GetNativeBool("getErrorReportingThread");

Expand Down

0 comments on commit c83ddfc

Please sign in to comment.