-keep public class com.tds.common.** {*;} -keep public class com.tapsdk.** {*;} -keep class com.tds.** {*;} # proguard.cfg -keepattributes Signature -dontwarn com.jcraft.jzlib.** -keep class com.jcraft.jzlib.** { *;} -dontwarn sun.misc.** -keep class sun.misc.** { *;} -dontwarn com.alibaba.fastjson.** -keep class com.alibaba.fastjson.** { *;} -dontwarn org.ligboy.retrofit2.** -keep class org.ligboy.retrofit2.** { *;} -dontwarn io.reactivex.rxjava2.** -keep class io.reactivex.rxjava2.** { *;} -dontwarn sun.security.** -keep class sun.security.** { *; } -dontwarn com.google.** -keep class com.google.** { *;} -dontwarn com.avos.** -keep class com.avos.** { *;} -dontwarn cn.leancloud.** -keep class cn.leancloud.** { *;} -keep public class android.net.http.SslError -keep public class android.webkit.WebViewClient -dontwarn android.webkit.WebView -dontwarn android.net.http.SslError -dontwarn android.webkit.WebViewClient -dontwarn android.support.** -dontwarn org.apache.** -keep class org.apache.** { *;} -dontwarn org.jivesoftware.smack.** -keep class org.jivesoftware.smack.** { *;} -dontwarn com.loopj.** -keep class com.loopj.** { *;} -dontwarn com.squareup.okhttp.** -keep class com.squareup.okhttp.** { *;} -keep interface com.squareup.okhttp.** { *; } -dontwarn okio.** -dontwarn org.xbill.** -keep class org.xbill.** { *;} -keepattributes *Annotation* > clientId:" + clientId + ",clientToken" + clientToken + ",serverUrl" + serverUrl); // 委托主线程调用 runOnUiThread( new Runnable() { public void run() { com.leopard.taptap.TapNative.InitTapDB(clientId,clientToken,serverUrl,gameChannel,gameVersion); } }); } public boolean CheckLogin() { return com.leopard.taptap.TapNative.CheckLogin(); } public void InitLogin(final String clientId,final String clientToken,final String serverUrl){ android.util.Log.d("Leopard","InitLoginStart ==>> clientId:" + clientId + ",clientToken" + clientToken + ",serverUrl" + serverUrl); runOnUiThread( new Runnable() { public void run() { com.leopard.taptap.TapNative.InitLogin(clientId, clientToken, serverUrl); } }); } public void Login(){ android.util.Log.d("Leopard","LoginStart"); com.leopard.taptap.TapNative.Login(); } public String GetCurrentProfile(){ android.util.Log.d("Leopard","GetCurrentProfile"); return com.leopard.taptap.TapNative.GetCurrentProfile(); } public void tapADNRequestPermissionIfNecessary() { TapAdManager.get().requestPermissionIfNecessary(this); android.util.Log.d("Leopard","RequestPermissionIfNecessary"); } public void tapADNInit( int mediaID, String mediaName, String mediaKey, boolean enableDebug, int avatarLevel ) { android.util.Log.d("Leopard","tapADNInit:mediaName->" + mediaName + ",mediaKey:" + mediaKey); final TapAdConfig config = new TapAdConfig.Builder() .withMediaId(mediaID) // 必选参数。为 TapADN 注册的媒体 ID .withMediaName(mediaName) // 必选参数。为 TapADN 注册的媒体名称 .withMediaKey(mediaKey) // 必选参数。媒体密钥,可以在TapADN后台查看 .withMediaVersion("1") // 必选参数。默认值 "1" .withGameChannel("taptap2") // 必选参数,渠道 // .withTapClientId("0RiAlMny7jiz086FaU") .enableDebug(enableDebug) .withCustomController(new TapAdCustomController() { @Override public boolean isCanUseLocation() { return true; } @Override public TapAdLocation getTapAdLocation() { double longitude = 0; double latitude = 0; double accuracy = 0; return new TapAdLocation(longitude, latitude, accuracy); } @Override public boolean isCanUsePhoneState() { return super.isCanUsePhoneState(); } @Override public String getDevImei() { return super.getDevImei(); } @Override public boolean isCanUseWifiState() { return super.isCanUseWifiState(); } @Override public boolean isCanUseWriteExternal() { return super.isCanUseWriteExternal(); } @Override public String getDevOaid() { // if (inputOaidEditText != null && inputOaidEditText.getText() != null) { // return inputOaidEditText.getText().toString(); // } return "asdf12345"; } @Override public boolean alist() { return super.alist(); } @Override public boolean isCanUseAndroidId() { return true; } @Override public CustomUser provideCustomUser() { return new CustomUser.Builder() .withRealAge(1) // 年龄 .withRealSex(1) // 性别 0:男 1:女 .withAvatarSex(1) // 角色性别 0:男 1:女 .withAvatarLevel(1) // 角色等级 .withNewUserStatus(1) // 是否新玩家 0:否;1:是 .withPayedUserStatus(0) // 是否付费用户 0:否;1:是 .withBeginMissionFinished(1) // 是否通过新手教程 0:否 1:是 .withAvatarPayedToolCnt(0) // 角色当前付费道具数量 .build(); } }) .build(); TapAdSdk.init(this,config); android.util.Log.d("Leopard","TapAdSdkInitOver"); } public TapAdNative tapAdNative; public TapRewardVideoAd lastTapRewardVideoAd; public native void nativeRewardRequestOver(); public boolean isRewardCached(){ return lastTapRewardVideoAd != null; } public void tapADNRequestRewardAD( int spaceID, // 广告后台获取广告位id String rewardName, // 奖品名称 int rewardAmount // 奖品数量 ){ android.util.Log.e("Leopard","tapADNInit:spaceID->" + spaceID); tapAdNative = TapAdManager.get().createAdNative(this); AdRequest adRequest = new AdRequest.Builder() .withSpaceId(spaceID) .withExtra1("{}") .withUserId("123") .withRewordName(rewardName) .withRewordAmount(rewardAmount) .build(); tapAdNative.loadRewardVideoAd(adRequest, new TapAdNative.RewardVideoAdListener() { @Override public void onError(int code, String message) { android.util.Log.e("Leopard","广告获取失败" + message); } @Override public void onRewardVideoAdLoad(TapRewardVideoAd rewardVideoAd) { tapADNPlayRewardAD(); } @Override public void onRewardVideoCached(TapRewardVideoAd rewardVideoAd) { android.util.Log.d("Leopard","广告获取成功"); lastTapRewardVideoAd = rewardVideoAd; GameActivity.this.nativeRewardRequestOver(); } }); } public native void nativeRewardAdPlayOver(); public void tapADNPlayRewardAD(){ if (lastTapRewardVideoAd != null){ lastTapRewardVideoAd.setRewardAdInteractionListener(new TapRewardVideoAd.RewardAdInteractionListener() { @Override public void onAdShow() { // 激励广告已显示 } @Override public void onAdClose() { // 激励广告已经关闭 } @Override public void onVideoComplete() { // 视频播放结束 } @Override public void onVideoError() { // 视频出错 } @Override public void onRewardVerify(boolean rewardVerify, int rewardAmount, String rewardName, int code, String msg) { // 激励任务已完成,游戏可以选择在此时进行玩家奖励,或者进一步通过 s2s 的流程来确认是否可以对当前玩家发放奖励 android.util.Log.d("Leopard","广告播放完毕!"); GameActivity.this.nativeRewardAdPlayOver(); } @Override public void onSkippedVideo() { // 激励广告中玩家点击了跳过视频的按钮 } }); lastTapRewardVideoAd.showRewardVideoAd(this); } else{ android.util.Log.e("Leopard","没有缓存任何的广告"); } } ]]>