Using obfuscation dictionaries

ProGuard must be configured so that during obfuscation, names are replaced with randomly generated ones. I read about obfuscationdictionary, but I would like to generate as many names as may be required during obfuscation. How is this possible to implement?

Hi @Paprika,

Thanks for reaching out. Can you clarify what your curious about more? We’re happy to help educate about obfuscation but will need a little more information.

Much appreciated,
Jesse & the Guardsquare Team

1 Like

When obfuscating the code, by default, the names of methods and variables are replaced with names: a, b, c… I would like to make these names randomly generated of a given length. But I have not found an implementation of this, other than generating a large dictionary before obfuscation

@Paprika, if you don’t want to modify ProGuard source code, then generating the dictionary is how it should be done with the -obfuscationdictionary config option. If you want to modify ProGuard code yourself, then you can take a look at how the NameFactory is used here: proguard/base/src/main/java/proguard/obfuscate/ at master · Guardsquare/proguard · GitHub

I hope this helps!

How do I find out what size dictionary to generate for obfuscation? I would like to avoid a situation where there are not enough names in the dictionary and the proguard rolls back to the default naming. Now the only way to implement it is to perform obfuscation and count the rows in the mapping. And is it possible to do without a file at all? That is, to generate names during the obfuscation process.