Markus A.
Markus A.

Reputation: 12742

ProGuard package name shortening

I'm working on an Android project which is automatically run through ProGuard when I package it for distribution.

With the Android default settings, ProGuard obfuscates the class and package names to mostly single letters, but keeps the package hierarchy around. So, if I for example have a package like

com.example.foo.bar.something.else.my.class.net

that contains come class Blah, ProGuard will turn this into something like

a.b.b.c.a.c.a.a.b.a

where the last a stands for the class name Blah.

Is there some switch that tells ProGuard to collapse the entire package hierarchy into a single identifier, i.e turn the above example into something like dw.a instead where dw stands for a.b.b.c.a.c.a.a.b?

Upvotes: 4

Views: 1376

Answers (1)

Markus A.
Markus A.

Reputation: 12742

Found it:

      -flattenpackagehierarchy

without providing a package_name does the trick.

Upvotes: 2

Related Questions