Skip to content

Commit

Permalink
Merge pull request #2659 from square/py/release_mappings
Browse files Browse the repository at this point in the history
Add proguard mapping support for LeakCanary release
  • Loading branch information
pyricau committed Apr 18, 2024
2 parents 4568495 + 03b915a commit c1d9aaf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Expand Up @@ -38,21 +38,23 @@ public final class leakcanary/HeapAnalysisClient$Companion {

public final class leakcanary/HeapAnalysisConfig {
public fun <init> ()V
public fun <init> (Ljava/util/List;Ljava/util/List;Lshark/MetadataExtractor;ZLshark/LeakingObjectFinder;Z)V
public synthetic fun <init> (Ljava/util/List;Ljava/util/List;Lshark/MetadataExtractor;ZLshark/LeakingObjectFinder;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Ljava/util/List;Ljava/util/List;Lshark/MetadataExtractor;ZLshark/LeakingObjectFinder;ZLkotlin/jvm/functions/Function0;)V
public synthetic fun <init> (Ljava/util/List;Ljava/util/List;Lshark/MetadataExtractor;ZLshark/LeakingObjectFinder;ZLkotlin/jvm/functions/Function0;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ljava/util/List;
public final fun component2 ()Ljava/util/List;
public final fun component3 ()Lshark/MetadataExtractor;
public final fun component4 ()Z
public final fun component5 ()Lshark/LeakingObjectFinder;
public final fun component6 ()Z
public final fun copy (Ljava/util/List;Ljava/util/List;Lshark/MetadataExtractor;ZLshark/LeakingObjectFinder;Z)Lleakcanary/HeapAnalysisConfig;
public static synthetic fun copy$default (Lleakcanary/HeapAnalysisConfig;Ljava/util/List;Ljava/util/List;Lshark/MetadataExtractor;ZLshark/LeakingObjectFinder;ZILjava/lang/Object;)Lleakcanary/HeapAnalysisConfig;
public final fun component7 ()Lkotlin/jvm/functions/Function0;
public final fun copy (Ljava/util/List;Ljava/util/List;Lshark/MetadataExtractor;ZLshark/LeakingObjectFinder;ZLkotlin/jvm/functions/Function0;)Lleakcanary/HeapAnalysisConfig;
public static synthetic fun copy$default (Lleakcanary/HeapAnalysisConfig;Ljava/util/List;Ljava/util/List;Lshark/MetadataExtractor;ZLshark/LeakingObjectFinder;ZLkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lleakcanary/HeapAnalysisConfig;
public fun equals (Ljava/lang/Object;)Z
public final fun getComputeRetainedHeapSize ()Z
public final fun getLeakingObjectFinder ()Lshark/LeakingObjectFinder;
public final fun getMetadataExtractor ()Lshark/MetadataExtractor;
public final fun getObjectInspectors ()Ljava/util/List;
public final fun getProguardMappingProvider ()Lkotlin/jvm/functions/Function0;
public final fun getReferenceMatchers ()Ljava/util/List;
public final fun getStripHeapDump ()Z
public fun hashCode ()I
Expand Down
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 c1d9aaf

Please sign in to comment.