// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package io.fabric.sdk.android.services.common; import android.content.Context; import io.fabric.sdk.android.Fabric; import io.fabric.sdk.android.Logger; import java.lang.reflect.Method; // Referenced classes of package io.fabric.sdk.android.services.common: // AdvertisingInfoStrategy, AdvertisingInfo class AdvertisingInfoReflectionStrategy implements AdvertisingInfoStrategy { private static final String CLASS_NAME_ADVERTISING_ID_CLIENT = "com.google.android.gms.ads.identifier.AdvertisingIdClient"; private static final String CLASS_NAME_ADVERTISING_ID_CLIENT_INFO = "com.google.android.gms.ads.identifier.AdvertisingIdClient$Info"; private static final String CLASS_NAME_GOOGLE_PLAY_SERVICES_UTILS = "com.google.android.gms.common.GooglePlayServicesUtil"; private static final int GOOGLE_PLAY_SERVICES_SUCCESS_CODE = 0; private static final String METHOD_NAME_GET_ADVERTISING_ID_INFO = "getAdvertisingIdInfo"; private static final String METHOD_NAME_GET_ID = "getId"; private static final String METHOD_NAME_IS_GOOGLE_PLAY_SERVICES_AVAILABLE = "isGooglePlayServicesAvailable"; private static final String METHOD_NAME_IS_LIMITED_AD_TRACKING_ENABLED = "isLimitAdTrackingEnabled"; private final Context context; public AdvertisingInfoReflectionStrategy(Context context1) { context = context1.getApplicationContext(); } private String getAdvertisingId() { String s; try { s = (String)Class.forName("com.google.android.gms.ads.identifier.AdvertisingIdClient$Info").getMethod("getId", new Class[0]).invoke(getInfo(), new Object[0]); } catch (Exception exception) { Fabric.getLogger().w("Fabric", "Could not call getId on com.google.android.gms.ads.identifier.AdvertisingIdClient$Info"); return null; } return s; } private Object getInfo() { Object obj; try { obj = Class.forName("com.google.android.gms.ads.identifier.AdvertisingIdClient").getMethod("getAdvertisingIdInfo", new Class[] { android/content/Context }).invoke(null, new Object[] { context }); } catch (Exception exception) { Fabric.getLogger().w("Fabric", "Could not call getAdvertisingIdInfo on com.google.android.gms.ads.identifier.AdvertisingIdClient"); return null; } return obj; } private boolean isLimitAdTrackingEnabled() { boolean flag; try { flag = ((Boolean)Class.forName("com.google.android.gms.ads.identifier.AdvertisingIdClient$Info").getMethod("isLimitAdTrackingEnabled", new Class[0]).invoke(getInfo(), new Object[0])).booleanValue(); } catch (Exception exception) { Fabric.getLogger().w("Fabric", "Could not call isLimitAdTrackingEnabled on com.google.android.gms.ads.identifier.AdvertisingIdClient$Info"); return false; } return flag; } public AdvertisingInfo getAdvertisingInfo() { if (isGooglePlayServiceAvailable(context)) { return new AdvertisingInfo(getAdvertisingId(), isLimitAdTrackingEnabled()); } else { return null; } } boolean isGooglePlayServiceAvailable(Context context1) { int i; try { i = ((Integer)Class.forName("com.google.android.gms.common.GooglePlayServicesUtil").getMethod("isGooglePlayServicesAvailable", new Class[] { android/content/Context }).invoke(null, new Object[] { context1 })).intValue(); } // Misplaced declaration of an exception variable catch (Context context1) { return false; } return i == 0; } }