Skip to content

[LeakScope] 5 Android lifecycle/memory violations detected #256

@MuhammadTehamsibAliTashfeen

Description

LeakScope: Android Lifecycle & Memory Leak Violations

About this report: This issue was automatically generated by LeakScope, a static analysis tool for Android lifecycle violations and memory leaks built on the Soot framework. This is part of an ongoing academic research study targeting ICSE 2027. No immediate action is required — we would greatly appreciate your feedback on whether these findings are accurate.

Summary

LeakScope detected 5 potential issue(s) across 2 detector type(s):

Severity Count
🔴 High 1
🟡 Medium 0
🟢 Low (improvement opportunity) 4
Detector Count Severity Description
ThreadedUIReference 1 🔴 High Worker thread captures Activity/Fragment/View reference
ViewBindingOpportunity 4 🟢 Low Manual findViewById() calls — ViewBinding migration opportunity

Detailed Findings

🔴 ThreadedUIReference

Worker thread captures Activity/Fragment/View reference

Finding #1EncoderTestActivity

Scenario 1: Worker thread holds UI object reference
Class: com.github.penfeizhou.animation.demo.EncoderTestActivity
Method: void onCreate(android.os.Bundle)
Statement: $r7 = new java.lang.Thread
Captured UI objects:
  - r0 : com.github.penfeizhou.animation.demo.EncoderTestActivity
  - $r4 : android.widget.ImageView
Risk: UI object will be kept in memory until thread completes
Fix: Use WeakReference or avoid passing UI objects to worker threads

🟢 ViewBindingOpportunity

Manual findViewById() calls — ViewBinding migration opportunity

Finding #2APNGTestActivity

View Binding Migration Opportunity
Class: com.github.penfeizhou.animation.demo.APNGTestActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in onCreate
Benefits of View Binding:
- Eliminates boilerplate findViewById() calls
- Compile-time type safety for view references
- Reduced null pointer exceptions
- Cleaner, more maintainable code
Note: This is a code modernization suggestion, not a memory leak

Finding #3AnimationTestActivity

View Binding Migration Opportunity
Class: com.github.penfeizhou.animation.demo.AnimationTestActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in onCreate
Benefits of View Binding:
- Eliminates boilerplate findViewById() calls
- Compile-time type safety for view references
- Reduced null pointer exceptions
- Cleaner, more maintainable code
Note: This is a code modernization suggestion, not a memory leak

Finding #4APNGRecyclerViewTestActivity

View Binding Migration Opportunity
Class: com.github.penfeizhou.animation.demo.APNGRecyclerViewTestActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in onCreate
Benefits of View Binding:
- Eliminates boilerplate findViewById() calls
- Compile-time type safety for view references
- Reduced null pointer exceptions
- Cleaner, more maintainable code
Note: This is a code modernization suggestion, not a memory leak

Finding #5EncoderTestActivity

View Binding Migration Opportunity
Class: com.github.penfeizhou.animation.demo.EncoderTestActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in onCreate
Benefits of View Binding:
- Eliminates boilerplate findViewById() calls
- Compile-time type safety for view references
- Reduced null pointer exceptions
- Cleaner, more maintainable code
Note: This is a code modernization suggestion, not a memory leak

How to respond to this issue:

  • If a finding is a true positive: consider applying the recommended fix and closing this issue.
  • If a finding is a false positive: please leave a comment explaining why — your feedback directly improves our research.
  • If you have questions: reply here or open a discussion.

This report was generated by LeakScope as part of the ICSE 2027 research artifact. Tool analyzes compiled APKs using Soot static analysis on APNG4Android.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions