Appodeal 是一个广告平台的集合,主要针对海外市场,集成的广告源比较全面,但是由于sdk的开发者是俄罗斯人,所以接入主要看文档,遇到问题沟通时需要英语基础,不过技术支持比较好,问题回复很快,cocos2dx继续接入Android原生,目前主流sdk为cocos定制的版本基本没有了,大部分都要接入平台原生的sdk了。
Appodeal Android sdk文档(需要科学上网)
https://www.appodeal.com/sdk/documentation?framework=1&full=1&platform=1
1:接入版本选择这个版本 MultiDex,避免出现Android64K溢出的问题
2:将jar文件和aar文件拷如到app/libs 文件夹下
3:在build.gradle中添加,注意用到google官方的包 版本号要一致,比如play-services-ads是15.0.0,play-services-location也必须是15.0.0。
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
flatDir {
dirs 'libs'
}
}
}
dependencies {
//Appodeal start
compile 'com.google.android.gms:play-services-ads:15.0.0'
compile 'com.google.android.gms:play-services-location:15.0.0'
compile 'com.squareup.picasso:picasso:2.5.2' //for Inmobi
compile name: 'adcolony-sdk-3.2.1', ext: 'aar'
compile name: 'mmedia-6.4.0', ext: 'aar'
compile name: 'mobvista_alphab', ext: 'aar'
compile name: 'mobvista_appwall', ext: 'aar'
compile name: 'mobvista_appwallext', ext: 'aar'
compile name: 'mobvista_common', ext: 'aar'
compile name: 'mobvista_interstitial', ext: 'aar'
compile name: 'mobvista_mvdownloads', ext: 'aar'
compile name: 'mobvista_mvjscommon', ext: 'aar'
compile name: 'mobvista_mvnative', ext: 'aar'
compile name: 'mobvista_nativeex', ext: 'aar'
compile name: 'mobvista_offerwall', ext: 'aar'
compile name: 'mobvista_playercommon', ext: 'aar'
compile name: 'mobvista_reward', ext: 'aar'
compile name: 'mobvista_videocommon', ext: 'aar'
compile name: 'mobvista_videofeeds', ext: 'aar'
//Appodeal end
}
4:在Manifest添加
<activity android:name="com.appodeal.ads.InterstitialActivity"
android:configChanges="orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity android:name="com.appodeal.ads.VideoActivity"
android:configChanges="orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity android:name="com.appodeal.ads.LoaderActivity"
android:configChanges="orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity android:name="com.appodeal.ads.VideoPlayerActivity"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"/>
<receiver android:name="com.appodeal.ads.AppodealPackageAddedReceiver" android:exported="true" android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
<activity android:name="com.appodeal.ads.TestActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
tools:replace="android:theme" />
<activity android:name="com.chartboost.sdk.CBImpressionActivity" android:excludeFromRecents="true"
android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity android:name="com.applovin.adview.AppLovinInterstitialActivity" android:configChanges="orientation|screenSize"/>
<activity android:name="com.applovin.adview.AppLovinConfirmationActivity" android:configChanges="orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.MoPubActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.mopub.common.MoPubBrowser"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity android:name="com.mopub.mobileads.MraidActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity android:name="com.mopub.mobileads.RewardedMraidActivity"
android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="org.nexage.sourcekit.vast.activity.VASTActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="org.nexage.sourcekit.vast.activity.VPAIDActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity android:name="com.appodeal.ads.networks.vpaid.VPAIDActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity android:name="com.amazon.device.ads.AdActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.my.target.ads.MyTargetActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:hardwareAccelerated="true"/>
<!--suppress AndroidDomInspection -->
<activity android:name="com.facebook.ads.AudienceNetworkActivity" android:configChanges="keyboardHidden|orientation|screenSize" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.startapp.android.publish.ads.list3d.List3DActivity"
android:theme="@android:style/Theme" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.startapp.android.publish.adsCommon.activities.OverlayActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboardHidden|screenSize" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.startapp.android.publish.adsCommon.activities.FullScreenActivity"
android:theme="@android:style/Theme"
android:configChanges="orientation|keyboardHidden|screenSize" />
<!--suppress AndroidDomInspection -->
<service android:name="com.startapp.android.publish.common.metaData.PeriodicMetaDataService" />
<!--suppress AndroidDomInspection -->
<service android:name="com.startapp.android.publish.common.metaData.InfoEventService" />
<receiver android:name="com.startapp.android.publish.common.metaData.BootCompleteListener" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service android:name="com.yandex.metrica.MetricaService" android:enabled="true"
android:exported="true" android:process=":Metrica">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="com.yandex.metrica.IMetricaService" />
<data android:scheme="metrica" />
</intent-filter>
<meta-data android:name="metrica:api:level" android:value="58" />
</service>
<receiver android:name="com.yandex.metrica.MetricaEventHandler"
android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<!--suppress AndroidDomInspection -->
<activity android:name="com.yandex.mobile.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<activity android:name="com.unity3d.ads.adunit.AdUnitActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="true" />
<activity android:name="com.unity3d.ads.adunit.AdUnitSoftwareActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="false" />
<activity android:name="com.unity3d.ads2.adunit.AdUnitActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="true" />
<activity android:name="com.unity3d.ads2.adunit.AdUnitSoftwareActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="false" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.jirbo.adcolony.AdColonyOverlay"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.jirbo.adcolony.AdColonyFullscreen"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.jirbo.adcolony.AdColonyBrowser"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.vungle.publisher.VideoFullScreenAdActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<!--suppress AndroidDomInspection -->
<activity android:name="com.vungle.publisher.MraidFullScreenAdActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
<!--suppress AndroidDomInspection -->
<activity android:name="com.vungle.publisher.FlexViewAdActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
<!--suppress AndroidDomInspection -->
<activity android:name="com.flurry.android.FlurryFullscreenTakeoverActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.flurry.android.FlurryShareActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.flurry.android.FlurryTileAdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.flurry.android.FlurryBrowserActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity android:name="com.mobvista.msdk.offerwall.view.MVOfferWallActivity"
android:configChanges="screenSize|orientation"
android:screenOrientation="portrait" />
<activity android:name="com.mobvista.msdk.offerwall.view.MVOfferWallRewardVideoActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity android:name="com.mobvista.msdk.reward.player.MVRewardVideoActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity android:name="com.mobvista.msdk.videofeeds.vfplayer.VideoFeedsActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" />
<activity android:name="com.mobvista.msdk.out.LoadingActivity" />
<activity android:name="com.mobvista.msdk.interstitial.view.MVInterstitialActivity"
android:configChanges="orientation|screenSize"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity android:name="com.mobvista.msdk.shell.MVActivity"
android:configChanges="keyboard|orientation"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.tapjoy.TJAdUnitActivity" android:configChanges="orientation|keyboardHidden|screenSize"
android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.tapjoy.mraid.view.ActionHandler" android:configChanges="orientation|keyboardHidden|screenSize" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.tapjoy.mraid.view.Browser" android:configChanges="orientation|keyboardHidden|screenSize" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.tapjoy.TJContentActivity" android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar" android:hardwareAccelerated="true" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.ironsource.sdk.controller.ControllerActivity" android:configChanges="orientation|screenSize"
android:hardwareAccelerated="true" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.ironsource.sdk.controller.InterstitialActivity" android:configChanges="orientation|screenSize"
android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.ironsource.sdk.controller.OpenUrlActivity" android:configChanges="orientation|screenSize"
android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent" />
<!--suppress AndroidDomInspection -->
<activity android:name="com.adcolony.sdk.AdColonyInterstitialActivity" android:configChanges="keyboardHidden|orientation|screenSize"
android:hardwareAccelerated="true"/>
<!--suppress AndroidDomInspection -->
<activity android:name="com.adcolony.sdk.AdColonyAdViewActivity" android:configChanges="keyboardHidden|orientation|screenSize"
android:hardwareAccelerated="true"/>
<activity android:name="com.inmobi.rendering.InMobiAdActivity" android:configChanges="keyboardHidden|orientation|keyboard|smallestScreenSize|screenSize|screenLayout"
android:hardwareAccelerated="true" android:resizeableActivity="false" android:theme="@android:style/Theme.NoTitleBar" />
<receiver android:name="com.inmobi.commons.core.utilities.uid.ImIdShareBroadCastReceiver" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="com.inmobi.share.id"/>
</intent-filter>
</receiver>
<meta-data android:name="presage_key" android:value="000000"/>
<service android:name="io.presage.PresageService" android:enabled="true" android:exported="true" android:process=":remote">
<intent-filter>
<action android:name="io.presage.PresageService.PIVOT" />
</intent-filter>
</service>
<activity android:name="io.presage.activities.PresageActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="io.presage.intent.action.LAUNCH_WEBVIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<receiver android:name="io.presage.receiver.NetworkChangeReceiver">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
<action android:name="io.presage.receiver.NetworkChangeReceiver.ONDESTROY" />
</intent-filter>
</receiver>
<receiver android:name="io.presage.receiver.AlarmReceiver" />
<provider
android:name="io.presage.provider.PresageProvider"
android:authorities="${applicationId}.PresageProvider"
android:enabled="true"
android:exported="true" />
<!--optional, remove if not using Millennial Media-->
<provider
android:name="com.millennialmedia.internal.utils.MediaContentProvider"
android:authorities="${applicationId}.MediaContentProvider"
android:grantUriPermissions="true"
android:exported="false" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!--optional -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!--optional -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!--optional-->
5:在 Manifest中有个tools错误,就是没有添加命名空间,加上这句 :xmlns:tools="http://schemas.android.com/tools",在manifest标签下,另外,在unity3d中也会经常出现这个问题,解决方法是相同的。
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.test"
android:installLocation="auto"
xmlns:tools="http://schemas.android.com/tools">
6:添加忽略混淆,如果遇到找不到类的情况,一定要添加这个选项
# Appodeal
-keep class com.appodeal.** { *; }
-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 {}
-keepclassmembers class ** { @com.mopub.common.util.ReflectionTarget *; }
-dontwarn com.mopub.volley.toolbox.**
# 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*
# StartApp
-keep class com.startapp.** { *;}
-dontwarn com.startapp.**
-dontwarn android.webkit.JavascriptInterface
-keepattributes Exceptions, InnerClasses, Signature, Deprecated, SourceFile, LineNumberTable, *Annotation*, EnclosingMethod
# Flurry
-keep class com.flurry.** { *; }
-dontwarn com.flurry.**
-keepattributes *Annotation*,EnclosingMethod,Signature
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
# Avocarrot
-keep class com.avocarrot.** { *; }
-keepclassmembers class com.avocarrot.** { *; }
-dontwarn com.avocarrot.**
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
# 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
-keepattributes *Annotation*, Signature
-keep class com.vungle.** { *;}
-dontwarn com.vungle.**
-dontnote com.vungle.**
-dontwarn com.moat.**
-keep class com.moat.analytics.mobile.vng.** { *;}
-keep class com.moat.** { public protected private *; }
-keep class dagger.**
-dontwarn de.greenrobot.event.util.**
-keep class de.greenrobot.event.**
-keep class javax.inject.**
-keep class rx.**
-dontwarn rx.**
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
long producerIndex;
long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
rx.internal.util.atomic.LinkedQueueNode producerNode;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
rx.internal.util.atomic.LinkedQueueNode consumerNode;
}
# MyTarget
-keep class com.my.target.** { *; }
-dontwarn com.my.target.**
# Mobvista
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.mobvista.** {*; }
-keep interface com.mobvista.** {*; }
-keep class android.support.v4.** { *; }
-dontwarn com.mobvista.**
-keep class **.R$* { public static final int mobvista*; }
-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.** { *; }
-dontwarn com.ironsource.**
# AdColonyV3
-keepclassmembers class * { @android.webkit.JavascriptInterface <methods>; }
-keep class com.adcolony.** { *; }
-dontwarn com.adcolony.**
-dontwarn android.app.Activity
#Appnext
-keep class com.appnext.** { *; }
-dontwarn com.appnext.**
# Inmobi
-keep class com.inmobi.** { *; }
-dontwarn com.inmobi.**
-dontwarn com.squareup.picasso.**
-keep class com.squareup.picasso.** {*;}
-dontwarn com.squareup.picasso.**
-dontwarn com.squareup.okhttp.**
-keep class com.moat.** {*;}
-dontwarn com.moat.**
# MMdeia
-keepclassmembers class com.millennialmedia** {public *;}
-keep class com.millennialmedia**
-dontwarn com.millennialmedia.**
# Ogury
-dontwarn io.presage.**
-dontnote io.presage.**
-dontwarn shared_presage.**
-dontwarn org.codehaus.**
-keepattributes Signature
-keep class shared_presage.** { *; }
-keep class io.presage.** { *; }
-keepclassmembers class io.presage.** { *; }
-keepattributes *Annotation*
-keepattributes JavascriptInterface
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
-dontnote okhttp3.**
-dontnote okio.**
-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn javax.annotation.Nullable
-dontwarn javax.annotation.ParametersAreNonnullByDefault
-dontnote sun.misc.Unsafe
-dontnote android.net.http.*
-dontnote org.apache.commons.codec.**
-dontnote org.apache.http.**
-dontwarn org.apache.commons.collections.BeanMap
-dontwarn java.beans.**
-dontnote com.google.gson.**
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
# 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 <fields>;
}
-keepclasseswithmembers class * {
@android.support.annotation.Keep <methods>;
}
-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 <fields>;
public <methods>;
}
-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 { *; }
最后,广告的sdk已接入成功,吐槽一下,这个广告在开始加载的时候,会造成程序的卡顿,1,2秒钟,而且这是个广告源的合集,不能删除里面的广告源,这个会造成包体变大,cocos还好,unity3d包体会增加近10M左右。
如有错误,大家可以一起交流
联系方式 qq: 940299880