保持课程"实施"当Proguard混淆时

时间:2015-06-02 17:05:29

标签: java android proguard obfuscation

我的问题是在运行Proguard 模糊处理后更改了类定义 (注意-dontobfuscate打开时它没有改变!)。

define('KEY1', 'ChangeMe1');
define('KEY2', 'ChangeMe2');
define('KEY3', 'ChangeMe3');

变成了:

package com.google.ads.mediation.inmobi;

...
import com.google.ads.AdSize;
import com.google.ads.AdRequest.ErrorCode;
import com.google.ads.mediation.MediationAdRequest;
import com.google.ads.mediation.MediationBannerAdapter;
import com.google.ads.mediation.MediationBannerListener;
import com.google.ads.mediation.MediationInterstitialAdapter;
import com.google.ads.mediation.MediationInterstitialListener;
import com.google.ads.mediation.inmobi.InMobiAdapterExtras;
import com.google.ads.mediation.inmobi.InMobiAdapterServerParameters;
import com.inmobi.commons.AnimationType;
import com.inmobi.commons.GenderType;
import com.inmobi.commons.InMobi;
import com.inmobi.monetization.IMBanner;
import com.inmobi.monetization.IMBannerListener;
import com.inmobi.monetization.IMErrorCode;
import com.inmobi.monetization.IMIncentivisedListener;
import com.inmobi.monetization.IMInterstitial;
import com.inmobi.monetization.IMInterstitialListener;
import com.inmobi.monetization.IMInterstitial.State;
...

public final class InMobiAdapter implements MediationInterstitialAdapter<InMobiAdapterExtras, InMobiAdapterServerParameters>, MediationBannerAdapter<InMobiAdapterExtras, InMobiAdapterServerParameters> {

我的proguard设置在下面所以我这就是InmobiAdapter类的代码没有被混淆的原因。但是我的 MediationInterstitialAdapter界面等从那里被抛出

package com.google.ads.mediation.inmobi;

...
import com.google.ads.AdSize;
import com.google.ads.AdRequest.ErrorCode;
import com.google.ads.mediation.MediationAdRequest;
import com.google.ads.mediation.MediationBannerListener;
import com.google.ads.mediation.MediationInterstitialListener;
import com.google.ads.mediation.inmobi.InMobiAdapterExtras;
import com.google.ads.mediation.inmobi.InMobiAdapterServerParameters;
import com.inmobi.commons.AnimationType;
import com.inmobi.commons.GenderType;
import com.inmobi.commons.InMobi;
import com.inmobi.monetization.IMBanner;
import com.inmobi.monetization.IMBannerListener;
import com.inmobi.monetization.IMErrorCode;
import com.inmobi.monetization.IMIncentivisedListener;
import com.inmobi.monetization.IMInterstitial;
import com.inmobi.monetization.IMInterstitialListener;
import com.inmobi.monetization.IMInterstitial.State;
...

public final class InMobiAdapter {

我应该设置什么来保持&#34;实现......&#34; 部分

1 个答案:

答案 0 :(得分:0)

为您的所有界面执行此操作

-keep interface com.google.ads.mediation.MediationBannerAdapter{
&lt;methods&gt;;}