Skip to content

[LeakScope] 19 Android lifecycle/memory violations detected #15

@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 19 potential issue(s) across 2 detector type(s):

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

Detailed Findings

🔴 ThreadedUIReference

Worker thread captures Activity/Fragment/View reference

Finding #1ImportExportSettingsActivity\n// (Full source code omitted for brevity)\n"

{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.ImportExportSettingsActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.ImportExportSettingsActivity\nMethod: void deleteAllEntries()\nStatement: $r1 \u003d new si.uni_lj.fe.lablog.ImportExportSettingsActivity$$ExternalSyntheticLambda7\nCaptured UI objects:\n  - r0 : si.uni_lj.fe.lablog.ImportExportSettingsActivity\nRisk: UI object will be kept in memory until thread completes\nFix: Use WeakReference or avoid passing UI objects to worker threads\n"
}
{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.ImportExportSettingsActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.ImportExportSettingsActivity\nM
… (truncated for brevity)

Finding #2NewKeyActivity\n// (Full source code omitted for brevity)\n"

{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.NewKeyActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.NewKeyActivity\nMethod: void lambda$onCreate$4$si-uni_lj-fe-lablog-NewKeyActivity(android.view.View)\nStatement: $r9 \u003d new java.lang.Thread\nCaptured UI objects:\n  - r0 : si.uni_lj.fe.lablog.NewKeyActivity\nRisk: UI object will be kept in memory until thread completes\nFix: Use WeakReference or avoid passing UI objects to worker threads\n"
}
{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.NewKeyActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.NewKeyActivity\nMethod: void lambda$onCreate$4$si-uni_lj-fe-lablog-NewKeyActivity(android.vi
… (truncated for brevity)

Finding #3RecentKeysActivity\n// (Full source code omitted for brevity)\n"

{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.RecentKeysActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.RecentKeysActivity\nMethod: void checkIfKeyCanBeDeleted(si.uni_lj.fe.lablog.data.Key)\nStatement: $r2 \u003d new java.lang.Thread\nCaptured UI objects:\n  - r0 : si.uni_lj.fe.lablog.RecentKeysActivity\nRisk: UI object will be kept in memory until thread completes\nFix: Use WeakReference or avoid passing UI objects to worker threads\n"
}
{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.RecentKeysActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.RecentKeysActivity\nMethod: void checkIfKeyCanBeDeleted(si.uni_lj.fe.lablog.data.Key)\nStatemen
… (truncated for brevity)

Finding #4SearchActivity\n// (Full source code omitted for brevity)\n"

{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.SearchActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.SearchActivity\nMethod: void loadKeyTypeMap()\nStatement: $r2 \u003d new si.uni_lj.fe.lablog.SearchActivity$$ExternalSyntheticLambda0\nCaptured UI objects:\n  - r0 : si.uni_lj.fe.lablog.SearchActivity\nRisk: UI object will be kept in memory until thread completes\nFix: Use WeakReference or avoid passing UI objects to worker threads\n"
}
{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.SearchActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.SearchActivity\nMethod: void performSearch()\nStatement: $r1 \u003d new si.uni_lj.fe.lablog.SearchActiv
… (truncated for brevity)

Finding #5NewEntryActivity\n// (Full source code omitted for brevity)\n"

{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.NewEntryActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.NewEntryActivity\nMethod: void checkIfKeyCanBeDeleted(si.uni_lj.fe.lablog.data.Key)\nStatement: $r2 \u003d new java.lang.Thread\nCaptured UI objects:\n  - r0 : si.uni_lj.fe.lablog.NewEntryActivity\nRisk: UI object will be kept in memory until thread completes\nFix: Use WeakReference or avoid passing UI objects to worker threads\n"
}
{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.NewEntryActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.NewEntryActivity\nMethod: void checkIfKeyCanBeDeleted(si.uni_lj.fe.lablog.data.Key)\nStatement: $r3 \u0
… (truncated for brevity)

Finding #6LatestEntryActivity

Scenario 1: Worker thread holds UI object reference
Class: si.uni_lj.fe.lablog.LatestEntryActivity
Method: void loadEntriesAndKeyTypes()
Statement: $r2 = new si.uni_lj.fe.lablog.LatestEntryActivity$$ExternalSyntheticLambda1
Captured UI objects:
  - r0 : si.uni_lj.fe.lablog.LatestEntryActivity
Risk: UI object will be kept in memory until thread completes
Fix: Use WeakReference or avoid passing UI objects to worker threads

Finding #7MainActivity\n// (Full source code omitted for brevity)\n"

{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.MainActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.MainActivity\nMethod: void loadAndDisplayLatestEntry()\nStatement: $r2 \u003d new si.uni_lj.fe.lablog.MainActivity$$ExternalSyntheticLambda0\nCaptured UI objects:\n  - r0 : si.uni_lj.fe.lablog.MainActivity\nRisk: UI object will be kept in memory until thread completes\nFix: Use WeakReference or avoid passing UI objects to worker threads\n"
}
{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.MainActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.MainActivity\nMethod: void loadAndDisplayTimestamps()\nStatement: $r2 \u003d new si.uni_lj.fe.lablog.M
… (truncated for brevity)

Finding #8StatusActivity\n// (Full source code omitted for brevity)\n"

{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.StatusActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.StatusActivity\nMethod: void handleEntryProcess(java.lang.String,long,boolean)\nStatement: $r3 \u003d new java.lang.Thread\nCaptured UI objects:\n  - r0 : si.uni_lj.fe.lablog.StatusActivity\nRisk: UI object will be kept in memory until thread completes\nFix: Use WeakReference or avoid passing UI objects to worker threads\n"
}
{
  "text_input": "package si.uni_lj.fe.lablog;\n\n// Class: si.uni_lj.fe.lablog.StatusActivity\n// (Full source code omitted for brevity)\n",
  "output": "Yes",
  "project": "fe",
  "explanation": "Scenario 1: Worker thread holds UI object reference\nClass: si.uni_lj.fe.lablog.StatusActivity\nMethod: void handleEntryProcess(java.lang.String,long,boolean)\nStatement: $r2 \u003d new si.uni_l
… (truncated for brevity)

🟢 ViewBindingOpportunity

Manual findViewById() calls — ViewBinding migration opportunity

Finding #9ImportExportSettingsActivity

View Binding Migration Opportunity
Class: si.uni_lj.fe.lablog.ImportExportSettingsActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • 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 #10NewKeyActivity

View Binding Migration Opportunity
Class: si.uni_lj.fe.lablog.NewKeyActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • 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 #11AboutSettingsActivity

View Binding Migration Opportunity
Class: si.uni_lj.fe.lablog.AboutSettingsActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in onCreate
  • 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 #12RecentKeysActivity

View Binding Migration Opportunity
Class: si.uni_lj.fe.lablog.RecentKeysActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in onCreate
  • findViewById in onCreate
  • 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 #13SearchActivity

View Binding Migration Opportunity
Class: si.uni_lj.fe.lablog.SearchActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • 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 #14NewEntryActivity

View Binding Migration Opportunity
Class: si.uni_lj.fe.lablog.NewEntryActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in createKeyCard
  • findViewById in createKeyCard
  • findViewById in createKeyCard
  • findViewById in createKeyCard
  • findViewById in createKeyCard
  • findViewById in createKeyCard
  • findViewById in createKeyCard
  • findViewById in createKeyCard
  • findViewById in createKeyCard
  • findViewById in createKeyCard
  • findViewById in createKeyCard
  • findViewById in createKeyCard
  • findViewById in createKeyCard
  • findViewById in createKeyCard
  • findViewById in saveEntry
  • findViewById in saveEntry
  • findViewById in saveEntry
  • findViewById in saveEntry
  • findViewById in saveEntry
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreat
… (truncated for brevity)

Finding #15LatestEntryActivity

View Binding Migration Opportunity
Class: si.uni_lj.fe.lablog.LatestEntryActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • 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 #16 — MQTTSettingsActivity

View Binding Migration Opportunity
Class: si.uni_lj.fe.lablog.MQTTSettingsActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • 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 #17 — MainActivity

View Binding Migration Opportunity
Class: si.uni_lj.fe.lablog.MainActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in lambda$loadAndDisplayLatestEntry$4$si-uni_lj-fe-lablog-MainActivity
  • findViewById in lambda$loadAndDisplayLatestEntry$5$si-uni_lj-fe-lablog-MainActivity
  • findViewById in lambda$loadAndDisplayTimestamps$8$si-uni_lj-fe-lablog-MainActivity
  • findViewById in lambda$loadAndDisplayTimestamps$8$si-uni_lj-fe-lablog-MainActivity
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • 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 #18 — StatusActivity

View Binding Migration Opportunity
Class: si.uni_lj.fe.lablog.StatusActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in onCreate
  • findViewById in onCreate
  • 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 #19 — SettingsActivity

View Binding Migration Opportunity
Class: si.uni_lj.fe.lablog.SettingsActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • findViewById in onCreate
  • 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 LabLog.

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