Class ClassModifier

java.lang.Object
jadx.core.dex.visitors.AbstractVisitor
jadx.core.dex.visitors.ClassModifier
All Implemented Interfaces:
IDexTreeVisitor

public class ClassModifier extends AbstractVisitor
  • Constructor Details

    • ClassModifier

      public ClassModifier()
  • Method Details

    • visit

      public boolean visit(ClassNode cls) throws JadxException
      Description copied from interface: IDexTreeVisitor
      Visit class
      Specified by:
      visit in interface IDexTreeVisitor
      Overrides:
      visit in class AbstractVisitor
      Returns:
      false for disable child methods and inner classes traversal
      Throws:
      JadxException
    • isEmptySyntheticClass

      private static boolean isEmptySyntheticClass(ClassNode cls)
    • removeSyntheticFields

      private static void removeSyntheticFields(ClassNode cls)
      Remove synthetic fields if type is outer class or class will be inlined (anonymous)
    • removeFieldUsageFromConstructor

      private static boolean removeFieldUsageFromConstructor(MethodNode mth, FieldNode field, ClassNode fieldsCls)
    • removeSyntheticMethods

      private static void removeSyntheticMethods(MethodNode mth)
    • isRemovedClassInArgs

      private static boolean isRemovedClassInArgs(ClassNode cls, List<RegisterArg> mthArgs)
    • modifySyntheticMethod

      private static void modifySyntheticMethod(ClassNode cls, MethodNode mth, InsnNode insn, List<RegisterArg> args)
      Remove synthetic constructor and redirect calls to existing constructor
    • removeBridgeMethod

      private static boolean removeBridgeMethod(ClassNode cls, MethodNode mth)
    • checkSyntheticWrapper

      private static boolean checkSyntheticWrapper(MethodNode mth, InsnNode insn)
    • registersAndCastsOnly

      private static boolean registersAndCastsOnly(InsnArg arg)
    • removeEmptyMethods

      private static void removeEmptyMethods(MethodNode mth)
      Remove public empty constructors (static or default)
    • isNonDefaultConstructorExists

      private static boolean isNonDefaultConstructorExists(MethodNode defCtor)