Java Question Using Proguard to obfuscate libraries?

Discussion in 'Libraries developers questions' started by keirS, Feb 25, 2015.

  1. keirS

    keirS Well-Known Member Licensed User

    I have been playing around with Proguard to obfuscate a library with some limited success. I have made list of rules that need to be kept. Can anyone confirm they are correct?

    Package name:
    Cannot be obfuscated
    Class file names:
    Can only be obfuscated if the class isn't directly referenced by B4A.
    Class names:
    Can only be obfuscated if the class isn't directly called by B4A.
    Method names:
    Can only be obfuscated if the method isn't directly called by B4A.

    It would seem to me to get the best out of obfuscation I would essentially need to write a class that just handled the calls from b4A and then called methods in other classes that are not referenced by B4A?
  2. Erel

    Erel Administrator Staff Member Licensed User

    Put all the classes in the same package.

    The exposed methods should be public and all others should have the default scope (package - private) or be private.
    You can then obfuscate all method named except of the public methods.
    keirS likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice