-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Feature Description
Add the ability to hook all methods of a class by specifying only the class field in the hook configuration, without needing to enumerate individual methods.
Motivation
When analyzing apps, it's often useful to monitor all activity on a specific class without knowing all its methods in advance. Previously, users had to either:
- Manually list all methods using the
methodsarray - Hook specific methods individually
This was tedious and error-prone, especially for classes with many methods.
Implementation
The feature has been implemented in frooky/android/base_script.js by enhancing the buildHookOperations function to:
- Detect when only
classis specified (nomethodormethods) - Use Java reflection to enumerate all declared methods of the class
- Automatically hook all overloads of each method found
- Skip methods that cannot be hooked (e.g., synthetic methods, constructors)
Usage
Simply specify the class without any method fields:
{
"category": "STORAGE",
"hooks": [
{
"class": "android.app.SharedPreferencesImpl$EditorImpl"
}
]
}This will hook all methods such as:
putStringputIntputBooleanapplycommit- And all other methods in the class
Example Output
When running with a class-only hook, the summary shows all methods that were hooked:
{
"type": "summary",
"hooks": [...13 methods hooked...],
"totalHooks": 13,
"errors": [],
"totalErrors": 0
}Documentation
Documentation has been updated in docs/usage.md to explain this feature.
Benefits
- Comprehensive coverage: Capture all method calls on a class
- Less maintenance: No need to update hook files when methods are added
- Discovery: Helps identify which methods are actually being called
- Convenience: Simpler hook configurations for exploratory analysis
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request