Why after obfuscation in androidx.navigation NavControllerViewModel renamed, but NavController don't renamed?
Asked
Active
Viewed 92 times
0
-
It's probably used by reflection somewhere, which prevents it. – Nicolas Nov 16 '20 at 12:40
-
2Does this answer your question? [Why does R8 not rename all methods and classes?](https://stackoverflow.com/questions/58680021/why-does-r8-not-rename-all-methods-and-classes) – Ruli Nov 16 '20 at 15:17
-
@Nicolas Is there an easy way to find out where a class is being used through reflection? – Александр Серебряков Nov 17 '20 at 05:06
1 Answers
0
R8 can give some indication as to why a certain class and/or member is still in the program after shrinking/obfuscation by adding a -whyareyoukeeping
into the configuration file. -whyareyoukeeping
takes a class specification like the -keep
rules and will report on the classes/members matched by that class specification. E.g. for the class androidx.navigation.NavController
try adding the following to the configuration file:
-whyareyoukeeping class androidx.navigation.NavController
It might not say directly why it is not renamed, but can give a good indication as of why.

sgjesse
- 3,793
- 14
- 17
-
I am not interested in why a class is being keep, it should be keep, I am interested in why it is not renamed when other classes in the same package are renamed and I do not see an easy way to figure it out – Александр Серебряков Nov 21 '20 at 08:05