Skip to content

Proguard & TP

Stéphane Nicolas edited this page Sep 24, 2019 · 7 revisions

TP 3

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.* *;
}

TP 2

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>(...);
}

TP 1.X:

Since version 1.1.3, TP is compatible with proguard/dexguard obfuscation.

To take advantage of this, you need to:

If you don't use registries, previous versions of TP will work well with obfuscation. You will need to preserve annotated classes.