Remove Kotlin obfuscation via plugin Remove @Metadata tag

In Kotlin, Metadata refers to the metadata that describes Kotlin classes. It contains a description of the properties, functions, annotations, and other information about the class. The functions of Metadata mainly include the following aspects:

  • Reflection: Metadata can be used to obtain class information at runtime, including class names, attributes, functions, etc. Through reflection, we can dynamically access and operate members of a class at runtime.

  • Serialization and deserialization: Metadata can be used to convert class information into a byte stream and store or transmit it. This allows the state of the class to be saved so that it can be restored or reconstructed when needed.

  • Virtual machine optimization: The information in Metadata can help the virtual machine optimize, such as inlining class members, optimizing function calls, etc. This improves program performance and efficiency.

like:

@Metadata(
  mv = {1, 1, 9},
  bv = {1, 0, 2},
  k = 1,
  d1 = {"..."},
  d2 = {"Lcom/bennyhuo/kotlinspecifics/reflect/SubClass;", "Lcom/bennyhuo/kotlinspecifics/reflect/SuperClass;", "()V", "Companion", "production sources for module app"}
)

public final class SubClass extends SuperClass {
   ...
}

But these contents will reveal some information

Insert image description here

Using the https://github.com/oliver-jonas/unmeta plug-in, you can remove the Metadata tag information in the class when packaging

The current attempt is to move the local project to the unmeta project to publish aar, which can be used.
Insert image description here

Guess you like

Origin blog.csdn.net/u011106915/article/details/133019924