@@ -66,6 +66,19 @@ internal AttributeProvider AttributeProvider
6666 }
6767 }
6868
69+ #if UNITY_ANDROID
70+ private bool _useProguard = false ;
71+
72+ /// <summary>
73+ /// Allow to enable Proguard support for captured Exceptions.
74+ /// </summary>
75+ /// <param name="symbolicationId">Proguard map symbolication id</param>
76+ public void UseProguard ( String symbolicationId ) {
77+ _useProguard = true ;
78+ AttributeProvider [ "symbolication_id" ] = symbolicationId ;
79+ }
80+ #endif
81+
6982#if ! UNITY_WEBGL
7083 private BacktraceMetrics _metrics ;
7184
@@ -971,7 +984,11 @@ internal void OnAnrDetected(string stackTrace)
971984 {
972985 Breadcrumbs . FromMonoBehavior ( anrMessage , LogType . Warning , new Dictionary < string , string > { { "stackTrace" , stackTrace } } ) ;
973986 }
974- SendUnhandledException ( hang ) ;
987+ var report = new BacktraceReport ( hang ) ;
988+ if ( _useProguard ) {
989+ report . UseSymbolication ( "proguard" ) ;
990+ }
991+ SendUnhandledExceptionReport ( report ) ;
975992 }
976993
977994 /// <summary>
@@ -988,15 +1005,20 @@ internal void HandleUnhandledExceptionsFromAndroidBackgroundThread(string backgr
9881005 }
9891006 var message = backgroundExceptionMessage . Substring ( 0 , splitIndex ) ;
9901007 var stackTrace = backgroundExceptionMessage . Substring ( splitIndex ) ;
1008+ var report = new BacktraceReport ( new BacktraceUnhandledException ( message , stackTrace ) ) ;
1009+ if ( _useProguard ) {
1010+ report . UseSymbolication ( "proguard" ) ;
1011+ }
1012+
9911013 if ( Database != null )
9921014 {
993- var backtraceData = new BacktraceReport ( new BacktraceUnhandledException ( message , stackTrace ) ) . ToBacktraceData ( null , GameObjectDepth ) ;
1015+ var backtraceData = report . ToBacktraceData ( null , GameObjectDepth ) ;
9941016 AttributeProvider . AddAttributes ( backtraceData . Attributes . Attributes ) ;
9951017 Database . Add ( backtraceData ) ;
9961018 }
9971019 else
9981020 {
999- HandleUnityMessage ( message , stackTrace , LogType . Exception ) ;
1021+ SendUnhandledExceptionReport ( report ) ;
10001022 }
10011023 var androidNativeClient = _nativeClient as Runtime . Native . Android . NativeClient ;
10021024 if ( androidNativeClient != null )
@@ -1125,7 +1147,7 @@ internal void HandleUnityMessage(string message, string stackTrace, LogType type
11251147 } ;
11261148 }
11271149
1128- SendUnhandledException ( exception , invokeSkipApi ) ;
1150+ SendUnhandledExceptionReport ( new BacktraceReport ( exception ) , invokeSkipApi ) ;
11291151 }
11301152
11311153 /// <summary>
@@ -1142,15 +1164,15 @@ private bool SamplingShouldSkip()
11421164 return value > Configuration . Sampling ;
11431165 }
11441166
1145- private void SendUnhandledException ( BacktraceUnhandledException exception , bool invokeSkipApi = true )
1167+ private void SendUnhandledExceptionReport ( BacktraceReport report , bool invokeSkipApi = true )
11461168 {
11471169 if ( OnUnhandledApplicationException != null )
11481170 {
1149- OnUnhandledApplicationException . Invoke ( exception ) ;
1171+ OnUnhandledApplicationException . Invoke ( report . Exception ) ;
11501172 }
1151- if ( ShouldSendReport ( exception , null , null , invokeSkipApi ) )
1173+ if ( ShouldSendReport ( report . Exception , null , null , invokeSkipApi ) )
11521174 {
1153- SendReport ( new BacktraceReport ( exception ) ) ;
1175+ SendReport ( report ) ;
11541176 }
11551177 }
11561178
0 commit comments