-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Sentry.NET SDK to 3.27.0 and support symbolication on Android (#…
…135)
- Loading branch information
1 parent
a36c46d
commit c61f61e
Showing
7 changed files
with
86 additions
and
15 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
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
57 changes: 57 additions & 0 deletions
57
Src/Sentry.Xamarin/Internals/SentryAndroidHelpers.droid.cs
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,57 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Sentry.Android.AssemblyReader; | ||
using Sentry.Extensibility; | ||
|
||
using Appliction = Android.App.Application; | ||
using AndroidBuild = Android.OS.Build; | ||
|
||
namespace Sentry.Xamarin.Internals | ||
{ | ||
internal static class SentryAndroidHelpers | ||
{ | ||
public static IList<string> GetSupportedAbis() | ||
{ | ||
var result = AndroidBuild.SupportedAbis; | ||
if (result != null) | ||
{ | ||
return result; | ||
} | ||
|
||
#pragma warning disable CS0618 | ||
var abi = AndroidBuild.CpuAbi; | ||
#pragma warning restore CS0618 | ||
|
||
return abi != null ? new[] {abi} : Array.Empty<string>(); | ||
} | ||
|
||
public static IAndroidAssemblyReader? GetAndroidAssemblyReader(IDiagnosticLogger? logger) | ||
{ | ||
var apkPath = Appliction.Context.ApplicationInfo?.SourceDir; | ||
if (apkPath == null) | ||
{ | ||
logger?.LogWarning("Can't determine APK path."); | ||
return null; | ||
} | ||
|
||
if (!File.Exists(apkPath)) | ||
{ | ||
logger?.LogWarning("APK doesn't exist at {0}", apkPath); | ||
return null; | ||
} | ||
|
||
try | ||
{ | ||
var supportedAbis = GetSupportedAbis(); | ||
return AndroidAssemblyReaderFactory.Open(apkPath, supportedAbis, | ||
logger: (message, args) => logger?.Log(SentryLevel.Debug, message, args: args)); | ||
} | ||
catch (Exception ex) | ||
{ | ||
logger?.LogError("Cannot create assembly reader.", ex); | ||
return null; | ||
} | ||
} | ||
} | ||
} |
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