Skip to content

Commit

Permalink
Add proguard mapping support for LeakCanary release
Browse files Browse the repository at this point in the history
  • Loading branch information
pyricau committed Apr 18, 2024
1 parent a9da75e commit 9973ea8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Expand Up @@ -4,12 +4,13 @@ import shark.AndroidMetadataExtractor
import shark.AndroidObjectInspectors
import shark.AndroidReferenceMatchers
import shark.FilteringLeakingObjectFinder
import shark.IgnoredReferenceMatcher
import shark.LeakingObjectFinder
import shark.LibraryLeakReferenceMatcher
import shark.MetadataExtractor
import shark.ObjectInspector
import shark.IgnoredReferenceMatcher
import shark.ProguardMapping
import shark.ReferenceMatcher
import shark.LibraryLeakReferenceMatcher

data class HeapAnalysisConfig(

Expand Down Expand Up @@ -71,5 +72,7 @@ data class HeapAnalysisConfig(
* zeroes. This increases the overall processing time but limits the amount of time the heap
* dump exists on disk with potential PII.
*/
val stripHeapDump: Boolean = false
val stripHeapDump: Boolean = false,

val proguardMappingProvider: () -> ProguardMapping? = { null }
)
Expand Up @@ -280,7 +280,7 @@ internal class RealHeapAnalysisJob(
}
}

return deletingFileSourceProvider.openHeapGraph().use { graph ->
return deletingFileSourceProvider.openHeapGraph(config.proguardMappingProvider()).use { graph ->
val heapAnalysis = analyzeHeap(heapDumpFile, graph)
val lruCacheStats = (graph as HprofHeapGraph).lruCacheStats()
val randomAccessStats =
Expand Down

0 comments on commit 9973ea8

Please sign in to comment.