SDK proguard configuration

android

#1

I’m investigating your SDK to use in our app and one of the requirements is small footprint of the library.
MoPub SDK has more than 700kB just for adv placement.
We are interesting only in NativeAds, so most of code can be removed.
Proguard should do it, but I checked you rules and you just skip all public mopub classes from minification by

-keepclassmembers class com.mopub.** { public ; }
-keep public class com.mopub.
*

Why? Purpose of this rules is keep only classes or class members which is called by reflection. All other class should be kept only if is used. This decrease proguard effectivity.


#2

Hello,

Unfortunately some of the code utilized for the banner and interstitial ad units are also utilized by native ads. So at the moment, most of the code cannot be removed because it will break the structure of native ads and how they’re loaded and rendered. Because the code is not as modular yet, we have to keep most of the public mopub classes in our Proguard file in order to ensure that nothing gets removed accidentally.

You can still remove lines 11 and 12 of the Proguard file in order to cut down on some of the methods utilized by our SDK, but know that it will not remove many of those banner/interstitial methods.

Best,
Laura

Solutions Engineer @ Twitter-MoPub