skylot / jadx

Dex to Java decompiler
Apache License 2.0
41.81k stars 4.88k forks source link

Get some defpackage #118

Closed veryyoung closed 5 years ago

veryyoung commented 8 years ago

For example

import defpackage.ul$a;
import defpackage.ul$b;
import defpackage.uo;
import defpackage.up;
import defpackage.vd;
import defpackage.vj;
import defpackage.vk;
import defpackage.vl;
import defpackage.vm;
import defpackage.vm$1;
import defpackage.vq;
import defpackage.wd;
import defpackage.wl;
import defpackage.wr;
import defpackage.ws;
import defpackage.wt;
import defpackage.wv;
import defpackage.xf;
import defpackage.xm;
import defpackage.yf$e;
import defpackage.yf$h;
import defpackage.yf$j;
jpstotz commented 5 years ago

The app is obfuscated and the "defpackage" is the default package "" (the package without name). The problem is that in the Jadx treeview an entry without name is not (or really difficult) clickable. Therefore "defpackage" is used as replacement.

skylot commented 5 years ago

Actually "defpackage" used for another reason: code will be not compilable if class in default package use any class from other packages, but such classes often use outside classes, so this is easy way to make code compilable.

NebelNidas commented 1 year ago

Can we get an option to turn this off though? I'm using JADX as a library and it moving classes breaks some assumptions

skylot commented 1 year ago

@NebelNidas there is no option to disable only this rename, but you can disable valid flag:

jadxArgs.setRenameValid(false);

or unset all rename flags to disable all renames:

jadxArgs.setRenameFlags(Collections.emptySet());