I have obfuscated my code using proguard. In the code I want to read all classes from a specified package with following code.
URL directoryURL = Thread.currentThread().getContextClassLoader()
.getResource("com/test/ui/controller");
This code does not work because jar created by proguard does not keep package hierarchy. I write a code that reads entries from obfuscated jar.This is output. See that class packages does not kept in zip file. So getResource() does not work.
com/test/ui/controller/a.class
com/test/ui/controller/c.class
com/test/ui/controller/b.class
com/test/ui/controller/d.class
When I run same code with an unobfuscated jar., here is output. Package level is kept in jar.Do you have any idea how can I tell Proguard to create jar by keeping package level.
com/
com/test/
com/test/ui/
com/test/ui/controller/
com/test/ui/controller/a.class
com/test/ui/controller/c.class
com/test/ui/controller/b.class
com/test/ui/controller/d.class