mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-31 11:44:36 +00:00
common deobfuscated name generation in as3 and as2 deobfuscation
This commit is contained in:
@@ -1365,4 +1365,24 @@ public class Helper {
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
public static String getNextId(String str, Map<String, Integer> lastIds) {
|
||||
return getNextId(str, lastIds, false);
|
||||
}
|
||||
|
||||
public static String getNextId(String str, Map<String, Integer> lastIds, boolean addFirst) {
|
||||
Integer a = lastIds.get(str);
|
||||
if (a == null) {
|
||||
lastIds.put(str, 1);
|
||||
if (addFirst) {
|
||||
str += "_1";
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
a++;
|
||||
lastIds.put(str, a);
|
||||
return str + "_" + a;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user