Package jadx.core.dex.visitors
Class ProcessAnonymous
java.lang.Object
jadx.core.dex.visitors.AbstractVisitor
jadx.core.dex.visitors.ProcessAnonymous
- All Implemented Interfaces:
IDexTreeVisitor
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanbadMethodUsage(ClassNode cls, MethodNode useMth, AccessInfo accessFlags) private static booleancanBeAnonymous(ClassNode cls) private static booleancheckForCommonFieldInit(MethodNode ctrMth) Checks: + all in constructors + all usage in one class - same field put (ignored: methods not loaded yet)private static booleancheckForInstanceFieldUsage(ClassNode cls, MethodNode ctr) private static booleancheckMethodsUsage(ClassNode cls, MethodNode ctr, MethodNode ctrUseMth) private static AnonymousClassAttr.InlineTypecheckUsage(ClassNode cls, MethodNode ctr) Checks: - class have only one constructor which used only once (allow common code for field init) - methods or fields not used outside (allow only nested inner classes with synthetic usage) - if constructor used only in class init check if possible inline by instance fieldprivate static @Nullable ArgTypegetBaseType(ClassNode cls) getName()Visitor short idvoidCalled after loading dex tree, but before visitor traversal.private static voidprivate voidmergeAnonymousDeps(RootNode root) private static voidprocessClass(ClassNode cls) private static voidprivate voidbooleanVisit classprivate voidMethods inherited from class jadx.core.dex.visitors.AbstractVisitor
toString, visit
-
Field Details
-
inlineAnonymousClasses
private boolean inlineAnonymousClasses
-
-
Constructor Details
-
ProcessAnonymous
public ProcessAnonymous()
-
-
Method Details
-
init
Description copied from interface:IDexTreeVisitorCalled after loading dex tree, but before visitor traversal.- Specified by:
initin interfaceIDexTreeVisitor- Overrides:
initin classAbstractVisitor
-
visit
Description copied from interface:IDexTreeVisitorVisit class- Specified by:
visitin interfaceIDexTreeVisitor- Overrides:
visitin classAbstractVisitor- Returns:
- false for disable child methods and inner classes traversal
- Throws:
JadxException
-
visitClassAndInners
-
processClass
-
markAnonymousClass
-
undoAnonymousMark
-
mergeAnonymousDeps
-
updateDeps
-
canBeAnonymous
-
checkUsage
Checks: - class have only one constructor which used only once (allow common code for field init) - methods or fields not used outside (allow only nested inner classes with synthetic usage) - if constructor used only in class init check if possible inline by instance field- Returns:
- decided inline type
-
checkMethodsUsage
-
checkForInstanceFieldUsage
-
badMethodUsage
-
checkForCommonFieldInit
Checks: + all in constructors + all usage in one class - same field put (ignored: methods not loaded yet) -
getBaseType
-
getName
Description copied from interface:IDexTreeVisitorVisitor short id- Specified by:
getNamein interfaceIDexTreeVisitor- Overrides:
getNamein classAbstractVisitor
-