Search in sources :

Example 6 with JPackage

use of jadx.gui.treemodel.JPackage in project jadx by skylot.

the class RenameDialog method processPackage.

private void processPackage(List<JavaNode> toUpdate) {
    String rawFullPkg = ((JPackage) node).getFullName();
    String rawFullPkgDot = rawFullPkg + ".";
    for (JavaClass cls : mainWindow.getWrapper().getClasses()) {
        String clsPkg = cls.getClassNode().getClassInfo().getPackage();
        // search all classes in package
        if (clsPkg.equals(rawFullPkg) || clsPkg.startsWith(rawFullPkgDot)) {
            toUpdate.add(cls);
            // also include all usages (for import fix)
            toUpdate.addAll(cls.getUseIn());
        }
    }
}
Also used : JavaClass(jadx.api.JavaClass) JPackage(jadx.gui.treemodel.JPackage)

Aggregations

JPackage (jadx.gui.treemodel.JPackage)6 JClass (jadx.gui.treemodel.JClass)3 JMethod (jadx.gui.treemodel.JMethod)3 JavaNode (jadx.api.JavaNode)2 JadxRuntimeException (jadx.core.utils.exceptions.JadxRuntimeException)2 JField (jadx.gui.treemodel.JField)2 JLoadableNode (jadx.gui.treemodel.JLoadableNode)2 JNode (jadx.gui.treemodel.JNode)2 Level (ch.qos.logback.classic.Level)1 EMPTY_RUNNABLE (io.reactivex.internal.functions.Functions.EMPTY_RUNNABLE)1 JadxArgs (jadx.api.JadxArgs)1 JavaClass (jadx.api.JavaClass)1 JavaMethod (jadx.api.JavaMethod)1 JavaVariable (jadx.api.JavaVariable)1 ResourceFile (jadx.api.ResourceFile)1 JadxCodeRename (jadx.api.data.impl.JadxCodeRename)1 RootNode (jadx.core.dex.nodes.RootNode)1 RenameVisitor (jadx.core.dex.visitors.rename.RenameVisitor)1 StringUtils (jadx.core.utils.StringUtils)1 Utils (jadx.core.utils.Utils)1