如何使用proguard牙签规则?

我在我的项目中使用TP。
我正在使用TP注入一些对象。 但是当我在应用程序中使用proguard规则时。 它在调试模式下工作正常但是在释放模式下给出null对象,所有通过@Inject注解注入的对象。

我在这个项目中工作,除了问题#146以外,还需要添加更多的东西。 有一个来自android支持注释库的@Keep注解设置,可以用来标记一个类不被混淆,我必须在一些kotlin数据类上做这个改造,而kotlin-reflect库不能播放混淆很好。 无论如何,要点可以在这里find。 另外,你可能要特别的告诉它不要在你生成的非reflectionregistry和工厂实现的包中生成的FactoryRegistry类中的任何东西混淆。

# Note that if we could use kapt to generate registries, possible to get rid of this -keepattributes Annotation # Do not obfuscate classes with Injected Constructors -keepclasseswithmembernames class * { @javax.inject.Inject (...); } # Do not obfuscate classes with Injected Fields -keepclasseswithmembernames class * { @javax.inject.Inject ; } # Do not obfuscate classes with Injected Methods -keepclasseswithmembernames class * { @javax.inject.Inject ; } -keep @android.support.annotation.Keep class * -keep @javax.inject.Singleton class * -dontwarn javax.inject.** -dontwarn javax.annotation.** -keep class **$$Factory { *; } -keep class **$$MemberInjector { *; } -adaptclassstrings -keep class toothpick.** { *; }