-
Notifications
You must be signed in to change notification settings - Fork 115
Proguard & TP
Stéphane Nicolas edited this page Sep 24, 2019
·
7 revisions
Here are the rules used by TP 2: (See issue #370 for more information.)
-dontwarn javax.inject.**
-dontwarn javax.annotation.**
-keep class javax.inject.**
-keep class javax.annotation.**
-keepclassmembers class * {
@javax.inject.Inject <init>(...);
@javax.inject.Inject <init>();
@javax.inject.Inject <fields>;
public <init>(...);
}
-keepnames @toothpick.InjectConstructor class *
-keepclasseswithmembernames class * { toothpick.ktp.delegate.* *; }
-keepclassmembers class * {
toothpick.ktp.delegate.* *;
}
In TP 2, consumer projects using Smoothie will receive Proguard configuration for TP. If you cannot use Smoothie, you can still use the Proguard file provided in the Smoothie module.
Here are the rules used by TP 2: (See issue #330 for more information.)
-dontwarn javax.inject.**
-dontwarn javax.annotation.**
-keep class javax.inject.**
-keep class javax.annotation.**
-keepclassmembers class * {
@javax.inject.Inject <init>(...);
@javax.inject.Inject <init>();
@javax.inject.Inject <fields>;
public <init>(...);
}
Since version 1.1.3, TP is compatible with proguard/dexguard obfuscation.
To take advantage of this, you need to:
- Set up the configuration with registries,
- Add
adaptclassstrings **
to your proguard/dexguard config.
If you don't use registries, previous versions of TP will work well with obfuscation. You will need to preserve annotated classes.