int02h
01/10/2020, 11:59 AM@Metadata
annotation? Because I can extract class member original names even if ProGuard/R8 has obfusacted the class.
Does it make reverse engineering easier because bytecode of the class contains information about its members in @Metadata
annotation?diesieben07
01/10/2020, 12:01 PM@Metadata
contains detailed information about the class.
You can test what exactly is contained using https://github.com/JetBrains/kotlin/blob/master/libraries/kotlinx-metadata/jvm/ReadMe.mdint02h
01/10/2020, 12:04 PMdiesieben07
01/10/2020, 12:04 PMint02h
01/10/2020, 12:07 PMdiesieben07
01/10/2020, 12:08 PMint02h
01/10/2020, 12:14 PMprimaryConstructor
property of KClass
returns null
if @Metadata
is shrinked by ProGuard/R8. So Moshi will not work in that conditions.diesieben07
01/10/2020, 12:21 PMprimaryConstructor
will work after obfuscation, because constructors cannot be renamed. But other reflective operations will fail anyways, because the names in @Metadata
do not match the actual names of your members anymore.int02h
01/10/2020, 12:36 PMprimaryConstructor
returns null
because flag indicating primary constructor is also inside @Metadata
annotation.
But if I try to get class properties with, for example,
declaredMemberProperties
the I get properties with their original names even if ProGuard/R8 turned and @Metadata
is preserved.diesieben07
01/10/2020, 12:39 PMget()
) is probably not going to work, because it cant find the actual field/method to accessint02h
01/10/2020, 12:45 PMdiesieben07
01/10/2020, 12:47 PMint02h
01/10/2020, 12:49 PM-keep
all class members without any obfuscation to get it work properly.diesieben07
01/10/2020, 12:59 PMint02h
01/10/2020, 1:01 PM@Metadata
annotation but allow R8 to rename class members it won’t work because of reason you’ve described above (https://kotlinlang.slack.com/archives/C0AVAB92L/p1578659941007300?thread_ts=1578657597.005400&cid=C0AVAB92L)diesieben07
01/10/2020, 1:02 PMint02h
01/10/2020, 1:03 PMdiesieben07
01/10/2020, 1:03 PMint02h
01/10/2020, 1:04 PMTim Van Den Broecke
01/16/2020, 10:40 AMint02h
01/16/2020, 12:31 PM