-
Notifications
You must be signed in to change notification settings - Fork 0
AndroidAppInspector
AndroidAppInspector
is an abstract class designed to inspect Android classes, methods, and statements. You can define custom actions for inspection and control the inspection process through settings and filters.
AndroidAppInspector
allows you to selectively inspect classes, methods, and statements within Android applications. It utilizes the Soot framework.
Examines the specified SootClass. Implementation required.
Examines the specified SootMethod. Implementation required.
Examines the specified statement (Unit). Implementation required.
Sets criteria to decide whether to examine classes, methods, and/or statements.
Starts the inspection process, examining elements based on criteria and optional filters.
Optional filter for classes. Default is true.
Optional filter for methods. Default is true.
Optional filter for statements. Default is true.
public class MyInspector extends AndroidAppInspector {
@Override
public void examineClass(SootClass sc) {
// Custom code here
}
@Override
public void examineMethod(SootMethod sm) {
// Custom code here
}
@Override
public void examineStatement(Unit u) {
// Custom code here
}
}
MyInspector inspector = new MyInspector();
inspector.run();
MyInspector inspector = new MyInspector();
inspector.setExaminationCriteria(true, false, true); // Only examine classes and statements
inspector.run();
public class FilteredInspector extends AndroidAppInspector {
@Override
protected boolean shouldExamineClass(SootClass sc) {
return sc.isPublic(); // Only examine public classes
}
// Implement other abstract methods as needed
}
FilteredInspector inspector = new FilteredInspector();
inspector.run();
These examples showcase how to use AndroidAppInspector
to create customized inspection behaviors.