getsentry / sentry-unity

Development of Sentry SDK for Unity
https://docs.sentry.io/platforms/unity/
MIT License
206 stars 51 forks source link

Add deobfuscation support #1769

Open rodolfoBee opened 3 weeks ago

rodolfoBee commented 3 weeks ago

Which version of the SDK? It happens on both v2.1.3 and v1.8.0

The deployed code is being obfuscated but Sentry is not showing the deobfuscated function names in the stack trace, even when the necessary DIFs are available in the project.

Reproduction project is available on the internal shadow ticket.

Expected Result

The resulting stack trace in Sentry shows the deobfuscated function names.

Actual Result

Function names in stack trace are obfuscated.

┆Issue is synchronized with this Jira Improvement by Unito

tustanivsky commented 3 weeks ago

Hey @rodolfoBee, here's an update regarding this issue:

It looks that the reproduction project uses this Unity plugin which essentially performs game code obfuscation when targeting Windows platform.

Even though there are DIFs available captured events' callstack can't be properly deobfuscated and symbolicated without a corresponding mapping file that the plugin should generate if configured.

There's also an editor utility provided along with the above plugin that allows viewing deobfuscated error stack traces after specifying the mapping file path and pasting the obfuscated code manually but it is supposed to work on the client only.

Currently, Sentry Unity SDK doesn't upload any third-party mappings along with other debug symbols by default and what's more important those won't be picked up automatically on the server side of things to deobfuscate error callstack unless Sentry supports such integration.

cc @bitsandfoxes

bitsandfoxes commented 2 weeks ago

Currently, Sentry does not offer support for deobfuscation for anything but ProGuard/R8 and DexGuard. That'd be an entirely new feature on Sentry itself. I'm keeping that issue open to gauge interest.