Skip to content

Commit

Permalink
fix: use '$' for inner classes also in methods and fields (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
skylot committed Dec 22, 2018
1 parent e0624ce commit a841d0e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
12 changes: 7 additions & 5 deletions jadx-core/src/main/java/jadx/core/deobf/DeobfPresets.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,16 @@ private void dumpMapping() throws IOException {
}
}
for (FieldInfo fld : deobfuscator.getFldMap().keySet()) {
list.add(String.format("f %s = %s", fld.getFullId(), fld.getAlias()));
list.add(String.format("f %s = %s", fld.getRawFullId(), fld.getAlias()));
}
for (MethodInfo mth : deobfuscator.getMthMap().keySet()) {
list.add(String.format("m %s = %s", mth.getFullId(), mth.getAlias()));
list.add(String.format("m %s = %s", mth.getRawFullId(), mth.getAlias()));
}
Collections.sort(list);
FileUtils.writeLines(deobfMapFile, MAP_FILE_CHARSET, list);
list.clear();
if (LOG.isDebugEnabled()) {
LOG.debug("Deobfuscation map file saved as: {}", deobfMapFile);
}
}

private static void dfsPackageName(List<String> list, String prefix, PackageNode node) {
Expand All @@ -140,11 +142,11 @@ public String getForCls(ClassInfo cls) {
}

public String getForFld(FieldInfo fld) {
return fldPresetMap.get(fld.getFullId());
return fldPresetMap.get(fld.getRawFullId());
}

public String getForMth(MethodInfo mth) {
return mthPresetMap.get(mth.getFullId());
return mthPresetMap.get(mth.getRawFullId());
}

public void clear() {
Expand Down
4 changes: 4 additions & 0 deletions jadx-core/src/main/java/jadx/core/dex/info/FieldInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ public String getFullId() {
return declClass.getFullName() + "." + name + ":" + TypeGen.signature(type);
}

public String getRawFullId() {
return declClass.makeRawFullName() + "." + name + ":" + TypeGen.signature(type);
}

public boolean isRenamed() {
return !name.equals(alias);
}
Expand Down
4 changes: 4 additions & 0 deletions jadx-core/src/main/java/jadx/core/dex/info/MethodInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public String getFullId() {
return declClass.getFullName() + "." + shortId;
}

public String getRawFullId() {
return declClass.makeRawFullName() + "." + shortId;
}

/**
* Method name and signature
*/
Expand Down

0 comments on commit a841d0e

Please sign in to comment.