Kotlin disable metadata annotation

Viewed 781

Is there any way to disable Kotlin metadata or just obfuscate them? It's added during compilation. Whole code is well obfuscated but Kotlin library named "kotlin-reflect.jar" leaves method details like class name, method and parameters with type.

@Metadata(mv = {1, 1, 13}, bv = {1, 0, 3}, k = 1, d1 = {"\000\022\n\002\030\002\n\002\030\002\n\000\n\002\020\016\n\002\b\002\030\0002\0020\001B\r\022\006\020\002\032\0020\003?\006\002\020\004R\016\020\002\032\0020\003X?\004?\006\002\n\000�\006\005"}, d2 = {"Lcom/test/SomeException;", "Lcom/test/SomeException;", "errorMessage", "", "(Ljava/lang/String;)V", "build"}) public final class SomeException extends Exception { public SomeException(@NotNull String paramString) { super(paramString); this.errorMessage = paramString; } private final String errorMessage; }

1 Answers

I’ve created 'unmeta', an Android Gradle plug-in that removes all Kotlin @Metadata and @DebugMetadata annotations for release builds.

You can find it here: https://github.com/oliver-jonas/unmeta

It uses ASM and operates directly on the compiled bytecode.

Related