From 1c96b61b567f2eb100c7408682bbe82217c00425 Mon Sep 17 00:00:00 2001 From: Gartorware Date: Sat, 29 Jun 2019 14:22:38 +0200 Subject: [PATCH] Updated Readme with instructions about multidex and proguard --- README.md | 441 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 441 insertions(+) diff --git a/README.md b/README.md index 5709818..10556a1 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,447 @@ Appodeal Cordova Plugin includes: + Android Appodeal SDK version 2.4.10 + iOS Appodeal SDK version 2.4.4.3-Beta +### Multidex + +If receiving errors while compiling about method number limites (>65K), please, enable Multidex: + +**For Android X** +``` +cordova plugin add https://github.com/GartorwareCorp/cordova-plugin-androidx-multidex.git +``` + +### Proguard + +If you are using proguard (cordova-plugin-proguard) don't forget to add custom rules: + +
+ Appodeal proguard rules + + ``` + # To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: +#-dontshrink +#-dontoptimize +#-dontobfuscate + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class android.webkit.WebView { +# public *; +#} + +#-injars bin/classes +#-injars libs +#-outjars bin/classes-processed.jar + +# Using Google's License Verification Library +-keep class com.android.vending.licensing.ILicensingService + +# Specifies to write out some more information during processing. +# If the program terminates with an exception, this option will print out the entire stack trace, instead of just the exception message. +-verbose + +# Annotations are represented by attributes that have no direct effect on the execution of the code. +-keepattributes *Annotation* + +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +-keepattributes InnerClasses +-keep class **.R +-keep class **.R$* { + ; +} + +# These options let obfuscated applications or libraries produce stack traces that can still be deciphered later on +-renamesourcefileattribute SourceFile +-keepattributes SourceFile,LineNumberTable + +##---------------Begin: proguard configuration for Cordova ---------- +-keep class org.apache.cordova.** { *; } +-keep public class * extends org.apache.cordova.CordovaPlugin + +-keep class com.google.android.gms.dynamite.DynamiteModule$DynamiteLoaderClassLoader { java.lang.ClassLoader sClassLoader; } +-keep class com.google.android.gms.dynamite.descriptors.com.google.android.gms.flags.ModuleDescriptor { int MODULE_VERSION; } +-keep class com.google.android.gms.dynamite.descriptors.com.google.android.gms.flags.ModuleDescriptor { java.lang.String MODULE_ID; } + +-keep class org.apache.cordova.CordovaBridge { org.apache.cordova.PluginManager pluginManager; } +-keep class org.apache.cordova.CordovaInterfaceImpl { org.apache.cordova.PluginManager pluginManager; } +-keep class org.apache.cordova.CordovaResourceApi { org.apache.cordova.PluginManager pluginManager; } +-keep class org.apache.cordova.CordovaWebViewImpl { org.apache.cordova.PluginManager pluginManager; } +-keep class org.apache.cordova.ResumeCallback { org.apache.cordova.PluginManager pluginManager; } +-keep class org.apache.cordova.engine.SystemWebViewEngine { org.apache.cordova.PluginManager pluginManager; } + +-keep class com.google.gson.internal.UnsafeAllocator { ** theUnsafe; } +-keep class me.leolin.shortcutbadger.ShortcutBadger { ** extraNotification; } +-keep class me.leolin.shortcutbadger.impl.XiaomiHomeBadger { ** messageCount; } +-keep class me.leolin.shortcutbadger.impl.XiaomiHomeBadger { ** extraNotification; } + +-dontnote org.apache.harmony.xnet.provider.jsse.NativeCrypto +-dontnote sun.misc.Unsafe + +-keep class com.worklight.androidgap.push.** { *; } +-keep class com.worklight.wlclient.push.** { *; } + +# apache.http +-optimizations !class/merging/vertical*,!class/merging/horizontal*,!code/simplification/arithmetic,!field/*,!code/allocation/variable + +-keep class net.sqlcipher.** { *; } +-dontwarn net.sqlcipher.** + +-keep class org.codehaus.** { *; } +-keepattributes *Annotation*,EnclosingMethod + +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# Remove debug logs in release build +-assumenosideeffects class android.util.Log { + public static *** d(...); +} + +# These classes contain references to external jars which are not included in the default MobileFirst project. +-dontwarn com.worklight.common.internal.WLTrusteerInternal* +-dontwarn com.worklight.jsonstore.** +-dontwarn org.codehaus.jackson.map.ext.* +-dontwarn com.worklight.androidgap.push.GCMIntentService +-dontwarn com.worklight.androidgap.plugin.WLInitializationPlugin + +-dontwarn android.support.v4.** +-dontwarn android.net.SSLCertificateSocketFactory +-dontwarn android.net.http.* +##---------------End: proguard configuration for Cordova ---------- + +##---------------Begin: proguard configuration for Ionic ---------- +-keep class io.ionic.keyboard.IonicKeyboard.** { *; } +-keep class com.ionicframework.cordova.webview.** { *; } +##---------------End: proguard configuration for Ionic ---------- + +##---------------Begin: proguard configuration for Google Libs ---------- +-keep class com.google.** { *; } +-dontwarn com.google.common.** +-dontwarn com.google.ads.** +##---------------End: proguard configuration for Google Libs ---------- + +##---------------Begin: proguard configuration for Android X ---------- +-dontwarn androidx.** +-keep class androidx.** { *; } +-keep interface androidx.** { *; } +##---------------End: proguard configuration for Android X ---------- + +##---------------Begin: proguard configuration for Gson ---------- +# Gson uses generic type information stored in a class file when working with fields. Proguard +# removes such information by default, so configure it to keep all of it. +-keepattributes Signature + +# For using GSON @Expose annotation +-keepattributes *Annotation* + +# Gson specific classes +-dontwarn sun.misc.** +#-keep class com.google.gson.stream.** { *; } + +# Application classes that will be serialized/deserialized over Gson +-keep class com.google.gson.examples.android.model.** { *; } + +# Prevent proguard from stripping interface information from TypeAdapterFactory, +# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) +-keep class * implements com.google.gson.TypeAdapterFactory +-keep class * implements com.google.gson.JsonSerializer +-keep class * implements com.google.gson.JsonDeserializer +##---------------End: proguard configuration for Gson ---------- + +##---------------Begin: proguard configuration for Admob ---------- +## Google AdMob specific rules ## +## https://developers.google.com/admob/android/quick-start ## + +-keep public class com.google.ads.** { + public *; +} +##---------------End: proguard configuration for Admob ---------- + +##---------------Begin: proguard configuration for Appodeal ---------- +# AdMediator +-keep class com.admediator.** { *; } + +# Appodeal +-keep class com.appodeal.** { *; } +-keep class com.appodealx.** { *; } +-keep class org.nexage.** { *; } +-keepattributes EnclosingMethod, InnerClasses, Signature, JavascriptInterface + +# Amazon +-keep class com.amazon.** { *; } +-dontwarn com.amazon.** + +# Mopub +-keep public class com.mopub.** +-keepclassmembers class com.mopub.** { public *; } +-dontwarn com.mopub.** +-keep class * extends com.mopub.mobileads.CustomEventBanner {} +-keepclassmembers class com.mopub.mobileads.CustomEventBannerAdapter {!private !public !protected *;} +-keep class * extends com.mopub.mobileads.CustomEventInterstitial {} +-keep class * extends com.mopub.nativeads.CustomEventNative {} +-keep class * extends com.mopub.mobileads.CustomEventRewardedVideo {} +-keep class * extends com.mopub.nativeads.CustomEventRewardedAd {} +-keepclassmembers class ** { @com.mopub.common.util.ReflectionTarget *; } +-dontwarn com.mopub.volley.toolbox.** +-keepclassmembers,allowshrinking,allowobfuscation class com.android.volley.NetworkDispatcher { + void processRequest(); +} +-keepclassmembers,allowshrinking,allowobfuscation class com.android.volley.CacheDispatcher { + void processRequest(); +} +-keep public class android.webkit.JavascriptInterface {} +-keepnames class * implements android.os.Parcelable { + public static final ** CREATOR; +} + +# Applovin +-keep class com.applovin.** { *; } +-dontwarn com.applovin.** + +# Facebook +-keep class com.facebook.ads.** { *; } +-keeppackagenames com.facebook.* +-dontwarn com.facebook.ads.** + +# Chartboost +-keep class com.chartboost.** { *; } +-dontwarn com.chartboost.** + +# Unity Ads +-keepattributes SourceFile,LineNumberTable +-keep class com.unity3d.** { *; } +-dontwarn com.unity3d.** + +# Yandex +-keep class com.yandex.metrica.** { *; } +-dontwarn com.yandex.metrica.** +-keep class com.yandex.mobile.ads.** { *; } +-dontwarn com.yandex.mobile.ads.** +-keepattributes *Annotation* +-keep class com.android.installreferrer.api.* { *; } +-dontwarn com.android.installreferrer.api.* + +# StartApp +-keep class com.startapp.** { *;} +-keep class com.truenet.** { *;} +-dontwarn com.startapp.** +-dontwarn android.webkit.JavascriptInterface +-keepattributes Exceptions, InnerClasses, Signature, Deprecated, SourceFile, LineNumberTable, *Annotation*, EnclosingMethod +-dontwarn org.jetbrains.annotations.** + +# Flurry +-keep class com.flurry.** { *; } +-dontwarn com.flurry.** +-keepattributes *Annotation*,EnclosingMethod,Signature +-keepclasseswithmembers class * { + public (android.content.Context, android.util.AttributeSet, int); +} + +# Adcolony +-keep class com.jirbo.adcolony.** { *;} +-keep class com.adcolony.** { *;} +-keep class com.immersion.** { *;} +-dontnote com.immersion.** +-dontwarn android.webkit.** +-dontwarn com.jirbo.adcolony.** +-dontwarn com.adcolony.** +-keepclassmembers class com.adcolony.sdk.ADCNative** { *; } + +# Vungle +-keep class com.vungle.warren.** { *; } +-dontwarn com.vungle.warren.error.VungleError$ErrorCode + +# Vungle/Moat SDK +-keep class com.moat.** { *; } +-dontwarn com.moat.** + +# Vungle/Okio +-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement + +# Vungle/Retrofit +-dontwarn okio.** +-dontwarn retrofit2.Platform$Java8 + +# Vungle/Gson +-keepattributes Signature +-keepattributes *Annotation* +-dontwarn sun.misc.** +-keep class com.google.gson.examples.android.model.** { *; } +-keep class * implements com.google.gson.TypeAdapterFactory +-keep class * implements com.google.gson.JsonSerializer +-keep class * implements com.google.gson.JsonDeserializer + +# Vungle/Google Android Advertising ID +-keep class com.google.android.gms.internal.** { *; } +-dontwarn com.google.android.gms.ads.identifier.** + +# MyTarget +-keep class com.my.target.** { *; } +-dontwarn com.my.target.** + +# Mobvista +-keepattributes Signature +-keepattributes *Annotation* +-keep class com.mintegral.** {*; } +-keep interface com.mintegral.** {*; } +-keep class android.support.v4.** { *; } +-dontwarn com.mintegral.** +-keep class **.R$* { public static final int mintegral*; } +-keep class com.alphab.** {*; } +-keep interface com.alphab.** {*; } + +# Admob +-keep class com.google.android.gms.ads.** { *; } + +# Tapjoy +-keep class com.tapjoy.** { *; } +-dontwarn com.tapjoy.** + +# IronSource +-keepclassmembers class com.ironsource.sdk.controller.IronSourceWebView$JSInterface { public *; } +-keepclassmembers class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } +-keep public class com.google.android.gms.ads.** { public *; } +-dontwarn com.moat.** +-keep class com.moat.** { public protected private *; } +-keep class com.ironsource.adapters.** { *; } +-keepnames class com.ironsource.mediationsdk.IronSource { *; } +-dontwarn com.ironsource.** + +# AdColonyV3 +-keepclassmembers class * { @android.webkit.JavascriptInterface ; } +-keep class com.adcolony.** { *; } +-dontwarn com.adcolony.** +-dontwarn android.app.Activity + +# Inmobi +-keep class com.inmobi.** { *; } +-dontwarn com.inmobi.** +-keep public class com.google.android.gms.** +-dontwarn com.squareup.picasso.** +-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient{ + public *; +} +-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info{ *; } +-keep class com.squareup.picasso.** {*;} +-dontwarn com.squareup.picasso.** +-dontwarn com.squareup.okhttp.** +-keep class com.moat.** {*;} +-dontwarn com.moat.** +-keep class com.integralads.avid.library.* {*;} + +# Google +-keep class com.google.android.gms.common.GooglePlayServicesUtil {*;} +-keep class com.google.android.gms.ads.identifier.** { *; } +-dontwarn com.google.android.gms.** + +# Legacy +-keep class org.apache.http.** { *; } +-dontwarn org.apache.http.** +-dontwarn android.net.http.** + +# Google Play Services library +-keep class * extends java.util.ListResourceBundle { + protected Object[][] getContents(); +} +-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable { + public static final *** NULL; +} +-keepnames class * implements android.os.Parcelable +-keepclassmembers class * implements android.os.Parcelable { + public static final *** CREATOR; +} +-keep @interface android.support.annotation.Keep +-keep @android.support.annotation.Keep class * +-keepclasseswithmembers class * { + @android.support.annotation.Keep ; +} +-keepclasseswithmembers class * { + @android.support.annotation.Keep ; +} +-keep @interface com.google.android.gms.common.annotation.KeepName +-keepnames @com.google.android.gms.common.annotation.KeepName class * +-keepclassmembernames class * { + @com.google.android.gms.common.annotation.KeepName *; +} +-keep @interface com.google.android.gms.common.util.DynamiteApi +-keep public @com.google.android.gms.common.util.DynamiteApi class * { + public ; + public ; +} +-keep class com.google.android.gms.common.GooglePlayServicesNotAvailableException {*;} +-keep class com.google.android.gms.common.GooglePlayServicesRepairableException {*;} + +# Google Play Services library 9.0.0 only +-dontwarn android.security.NetworkSecurityPolicy +-keep public @com.google.android.gms.common.util.DynamiteApi class * { *; } + +# support-v4 +-keep class android.support.v4.app.Fragment { *; } +-keep class android.support.v4.app.FragmentActivity { *; } +-keep class android.support.v4.app.FragmentManager { *; } +-keep class android.support.v4.app.FragmentTransaction { *; } +-keep class android.support.v4.content.ContextCompat { *; } +-keep class android.support.v4.content.LocalBroadcastManager { *; } +-keep class android.support.v4.util.LruCache { *; } +-keep class android.support.v4.view.PagerAdapter { *; } +-keep class android.support.v4.view.ViewPager { *; } +-keep class android.support.v4.content.ContextCompat { *; } + +# support-v7-recyclerview +-keep class android.support.v7.widget.RecyclerView { *; } +-keep class android.support.v7.widget.LinearLayoutManager { *; } + +#MultiDex +-keepnames class android.support.multidex.MultiDex + +# AndroidX +-keep @interface androidx.annotation.Keep +-keep @androidx.annotation.Keep class * +-keepclasseswithmembers class * { + @androidx.annotation.Keep ; +} +-keepclasseswithmembers class * { + @androidx.annotation.Keep ; +} +-keep class androidx.fragment.app.Fragment { *; } +-keep class androidx.fragment.app.FragmentActivity{ *; } +-keep class androidx.fragment.app.FragmentManager { *; } +-keep class androidx.fragment.app.FragmentTransaction { *; } +-keep class androidx.core.content.ContextCompat { *; } +-keep class androidx.localbroadcastmanager.content.LocalBroadcastManager { *; } +-keep class androidx.collection.LruCache { *; } +-keep class androidx.viewpager.widget.PagerAdapter { *; } +-keep class androidx.viewpager.widget.ViewPager { *; } +-keep class androidx.core.content.ContextCompat { *; } +-keep class androidx.appcompat.widget.** { *; } + +# AndroidX Multidex +-keepnames class androidx.multidex.MultiDex + +##---------------End: proguard configuration for Appodeal ---------- + + ``` +
+ + ## Cordova Integration ### Ad Types