Skip to content

Instantly share code, notes, and snippets.

@Trumeet
Created February 24, 2019 20:12
Show Gist options
  • Save Trumeet/bde8f58bac253a97e1a9455bffcf8960 to your computer and use it in GitHub Desktop.
Save Trumeet/bde8f58bac253a97e1a9455bffcf8960 to your computer and use it in GitHub Desktop.
A simple tool to generate styled proguard dictionary
/**
* Proguard dictionary generator
* Usage:
* java Generator [character] [lines]
* Example:
* java Generator A 5
* then you will get:
* A
* Aa
* Aaa
* Aaaa
* Aaaaa
*
*/
public class Generator {
public static void main(String... args) {
if (args.length != 2) {
System.err.println("Unknown args");
System.exit(1);
}
String x = args[0].substring(0, 1);
long lines = Long.parseLong(args[1]);
StringBuilder builder = new StringBuilder();
for (long i = 0; i < lines; i ++) {
for (long j = 0; j < i; j ++) {
builder.append(j == 0 ? x.toUpperCase() : x.toLowerCase());
}
builder.append("\n");
}
System.out.println(builder.toString());
System.exit(0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment