Search code examples
androidandroid-activityproguardandroid-proguardsecurity-by-obscurity

Is there a way to obscure the activities with Proguard in Android?


I know that Proguard does not obscure the names of the activities that are declared in the manifest.xml. Is there anyway a way to obscure them?


Solution

  • You can definitely obscure them, by disabling the standard Proguard rules.

    But in doing so, your app launcher icon will be removed every time the user updates the app, as the icon is linked directly to the name of the package and the activity. If that name changes, the icon is removed.

    That's just one of many pitfalls that will happen if you do this.

    So i'd advise against it.
    That proguard rule is in the default proguard file for a reason.

    You could simply name your Activity something obscured manually, like "b.java". Then Proguard will keep that name, and it'll look obscured. But then your code would be quite hard to read.