sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Deobfuscate activities class names in spans

Open lcian opened this issue 10 months ago • 3 comments

Problem Statement

This came up as a feature request from a customer. They are using our performance features along with DexGuard or ProGuard. They complained that their Android spans often include obfuscated class names for activities, which makes it hard for them to get value out of the feature (considering also that these obfuscated names can change between different builds/releases).

Solution Brainstorm

Not sure if this can be solved on the SDK side or would require symbolication

lcian avatar Mar 03 '25 10:03 lcian

Let's check if DexGuard is capable of renaming Activities (and if there's a way to e.g. disable this)

markushi avatar Mar 12 '25 10:03 markushi

We're putting it down in the backlog due to potential costs of running symbolication over spans. If this becomes a thing in the future, we can revisit the priority.

romtsn avatar Mar 19 '25 14:03 romtsn

https://dexprotector.com/docs is capable of renaming Activities:

Obfuscation of AndroidManifest: Applications/ActivityNames/ContentProviders/Receivers class names mangling

We also shouldn't forget about Fragments, as they are even more subject to being obfuscated.

markushi avatar Apr 02 '25 07:04 markushi

I'm going to close this for the time being as it's unrealistic that we'll get to it considering costs of deobfuscating large volumes of data (spans, logs and breadcrumbs). Our suggestion going forward would be to exclude the classes that are being sent as part of the aforementioned data from obfuscation using the following proguard rule:

-keepnames my.class.Name

This comment provides more background: https://github.com/getsentry/sentry/issues/59154#issuecomment-2729985855. If we reconsider this decision we'll reopen the relevant issues in the future.

romtsn avatar Sep 16 '25 19:09 romtsn