Skip to content

Commit

Permalink
Update library leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
pyricau committed Dec 22, 2020
1 parent 7f12f62 commit 8fdc60a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions shark-android/api/shark-android.api
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public abstract class shark/AndroidReferenceMatchers : java/lang/Enum {
public static final field ACTIVITY_CHOOSE_MODEL Lshark/AndroidReferenceMatchers;
public static final field ACTIVITY_CLIENT_RECORD__NEXT_IDLE Lshark/AndroidReferenceMatchers;
public static final field ACTIVITY_MANAGER_MCONTEXT Lshark/AndroidReferenceMatchers;
public static final field APPLICATION_PACKAGE_MANAGER__HAS_SYSTEM_FEATURE_QUERY Lshark/AndroidReferenceMatchers;
public static final field APP_WIDGET_HOST_CALLBACKS Lshark/AndroidReferenceMatchers;
public static final field ASSIST_STRUCTURE Lshark/AndroidReferenceMatchers;
public static final field AUDIO_MANAGER Lshark/AndroidReferenceMatchers;
Expand Down
20 changes: 18 additions & 2 deletions shark-android/src/main/java/shark/AndroidReferenceMatchers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ enum class AndroidReferenceMatchers {
activity has been destroyed.
""".trimIndent()
) {
sdkInt == 28
sdkInt in 28..29
}
}
},
Expand Down Expand Up @@ -682,6 +682,22 @@ enum class AndroidReferenceMatchers {
}
},

APPLICATION_PACKAGE_MANAGER__HAS_SYSTEM_FEATURE_QUERY {
override fun add(references: MutableList<ReferenceMatcher>) {
references += instanceFieldLeak(
"android.app.ApplicationPackageManager\$HasSystemFeatureQuery", "this\$0",
description = """
In Android 11 DP 2 ApplicationPackageManager.HasSystemFeatureQuery was an inner class.
Introduced in https://cs.android.com/android/_/android/platform/frameworks/base/+/89608118192580ffca026b5dacafa637a556d578
Fixed in https://cs.android.com/android/_/android/platform/frameworks/base/+/1f771846c51148b7cb6283e6dc82a216ffaa5353
Related blog: https://dev.to/pyricau/beware-packagemanager-leaks-223g
""".trimIndent()
) {
sdkInt == 29
}
}
},

// ######## Manufacturer specific known leaks ########

// SAMSUNG
Expand Down Expand Up @@ -828,7 +844,7 @@ enum class AndroidReferenceMatchers {
description =
"mLastHoveredView is a static field in TextView that leaks the last hovered" + " view."
) {
manufacturer == SAMSUNG && sdkInt in 19..28
manufacturer == SAMSUNG && sdkInt in 19..29
}
}
},
Expand Down

0 comments on commit 8fdc60a

Please sign in to comment.