Proguard: avoiding naming collisions with pre-obfuscated library JARs

后端 未结 2 1021
既然无缘
既然无缘 2021-01-18 03:20

It seems that Proguard doesn\'t make any attempt to avoid naming collisions with classes in library JARs when it renames/repackages classes. Is this correct, or have I just

相关标签:
2条回答
  • 2021-01-18 04:03

    From the progaurd manual,

    If an input jar and a library jar contain classes in the same package, the obfuscated output jar may contain class names that overlap with class names in the library jar. This is most likely if the library jar has been obfuscated before, as it will then probably contain classes named 'a', 'b', etc. Packages should therefore never be split across input jars and library jars.

    So it looks like using your own package is the recommended answer.

    0 讨论(0)
  • 2021-01-18 04:07

    In closed libraries to prevent conflict between multiple obfuscated modules/libraries you should use

    -keeppackagenames

    proguard rule to prevent complete classes repackaging, otherwise you can find errors like:

    Duplicate class a.a.a.a in [jetified-lib1] and a.a.a.a in [jetified-lib2]

    0 讨论(0)
提交回复
热议问题