diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a460c76a..917eedf97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ - proguard: Added a mandatory `index` field to `JvmFrame` (#1411) by @loewenheim - proguard: Support for source contex (#1414) by @loewenheim - proguard: Field `lineno` on `JvmFrame` is now optional (#1417) by @loewenheim -- proguard: add support for frame signature (#1425 )by @viglia +- proguard: add support for frame signature (#1425 ) by @viglia +- proguard: add the translated and deobfuscated signature even in the case that the the whole frame could not be remapped (#1427) by @viglia ### Dependencies diff --git a/crates/symbolicator-proguard/src/symbolication.rs b/crates/symbolicator-proguard/src/symbolication.rs index 42fc1d673..f5880992e 100644 --- a/crates/symbolicator-proguard/src/symbolication.rs +++ b/crates/symbolicator-proguard/src/symbolication.rs @@ -283,6 +283,11 @@ impl ProguardService { } } + // if there is a signature that has been deobfuscated, + // add it to the mapped frame + if let Some(signature) = &deobfuscated_signature { + mapped_frame.signature = Some(signature.format_signature()); + } return vec![mapped_frame]; } @@ -439,6 +444,17 @@ io.sentry.sample.MainActivity -> io.sentry.sample.MainActivity: index: 2, ..Default::default() }, + JvmFrame { + // this function map is onClickHandler(android.view.View):40 -> t + // not onClickHandler(android.view.View):40 -> onClickHandler + // hence the whole frame remapping should fail, + // but the signature should still be properly translated to java type + function: "onClickHandler".to_owned(), + module: "io.sentry.sample.MainActivity".to_owned(), + signature: Some("(Landroid/view/View;)V".to_owned()), + index: 3, + ..Default::default() + }, ]; let mapping = ProguardMapping::new(proguard_source); @@ -449,7 +465,7 @@ io.sentry.sample.MainActivity -> io.sentry.sample.MainActivity: .flat_map(|frame| ProguardService::map_frame(&[&mapper], frame, None).into_iter()) .collect(); - assert_eq!(mapped_frames.len(), 5); + assert_eq!(mapped_frames.len(), 6); assert_eq!(mapped_frames[0].function, "onClick"); assert_eq!( @@ -485,6 +501,12 @@ io.sentry.sample.MainActivity -> io.sentry.sample.MainActivity: mapped_frames[4].signature.as_ref().unwrap(), "(android.view.View)" ); + + assert_eq!(mapped_frames[5].function, "onClickHandler"); + assert_eq!( + mapped_frames[5].signature.as_ref().unwrap(), + "(android.view.View)" + ); } // based on the Python test `test_sets_inapp_after_resolving`.