@Override
  public boolean checkAndInitializeSdk(
      @NonNull Activity launcherActivity,
      @NonNull Map<String, Object> localExtras,
      @NonNull Map<String, String> serverExtras)
      throws Exception {
    synchronized (ChartboostRewardedVideo.class) {
      if (sInitialized) {
        return false;
      }

      if (!serverExtras.containsKey(APP_ID_KEY)) {
        throw new IllegalStateException(
            "Chartboost rewarded video initialization" + " failed due to missing application ID.");
      }

      if (!serverExtras.containsKey(APP_SIGNATURE_KEY)) {
        throw new IllegalStateException(
            "Chartboost rewarded video initialization"
                + " failed due to missing application signature.");
      }

      final String appId = serverExtras.get(APP_ID_KEY);
      final String appSignature = serverExtras.get(APP_SIGNATURE_KEY);

      Chartboost.startWithAppId(launcherActivity, appId, appSignature);
      Chartboost.setDelegate(sSingletonChartboostDelegate);

      sInitialized = true;
      return true;
    }
  }
 public boolean isAvailable(String loc, int type) {
   switch (type) {
     case CB_TYPE_INTERSTITIAL:
       return Chartboost.hasInterstitial(loc);
     case CB_TYPE_REWARDED_VIDEO:
       return Chartboost.hasRewardedVideo(loc);
     case CB_TYPE_MORE_APPS:
       return Chartboost.hasMoreApps(loc);
   }
   return false;
 }
 public void cache(String loc, int type) {
   switch (type) {
     case CB_TYPE_INTERSTITIAL:
       Chartboost.cacheInterstitial(loc);
       break;
     case CB_TYPE_REWARDED_VIDEO:
       Chartboost.cacheRewardedVideo(loc);
       break;
     case CB_TYPE_MORE_APPS:
       Chartboost.cacheMoreApps(loc);
       break;
   }
 }
  private void setUpMediationSettingsForRequest(String moPubId) {
    final ChartboostMediationSettings globalSettings =
        MoPubRewardedVideoManager.getGlobalMediationSettings(ChartboostMediationSettings.class);
    final ChartboostMediationSettings instanceSettings =
        MoPubRewardedVideoManager.getInstanceMediationSettings(
            ChartboostMediationSettings.class, moPubId);

    // Instance settings override global settings.
    if (instanceSettings != null) {
      Chartboost.setCustomId(instanceSettings.getCustomId());
    } else if (globalSettings != null) {
      Chartboost.setCustomId(globalSettings.getCustomId());
    }
  }
 protected static String a() {
   String str = null;
   try {
     Info advertisingIdInfo =
         AdvertisingIdClient.getAdvertisingIdInfo(Chartboost.sharedChartboost().getContext());
   } catch (IOException e) {
     String str2 = str;
   } catch (GooglePlayServicesRepairableException e2) {
     str2 = str;
   } catch (GooglePlayServicesNotAvailableException e3) {
     str2 = str;
   }
   if (advertisingIdInfo == null) {
     c.a(a.c);
     return str;
   } else {
     if (advertisingIdInfo.isLimitAdTrackingEnabled()) {
       c.a(a.e);
     } else {
       c.a(a.d);
     }
     try {
       UUID fromString = UUID.fromString(advertisingIdInfo.getId());
       ByteBuffer wrap = ByteBuffer.wrap(new byte[16]);
       wrap.putLong(fromString.getMostSignificantBits());
       wrap.putLong(fromString.getLeastSignificantBits());
       return b.b(wrap.array());
     } catch (IllegalArgumentException e4) {
       CBLogging.a("CBIdentityAdv", "Exception raised retrieveAdvertisingID", e4);
       return advertisingIdInfo.getId().replace("-", AdTrackerConstants.BLANK);
     }
   }
 }
 @Override
 public void showVideo() {
   if (hasVideoAvailable()) {
     Chartboost.showRewardedVideo(mLocation);
   } else {
     MoPubLog.d("Attempted to show Chartboost rewarded video before it was available.");
   }
 }
 public void setAutoCacheAds(boolean shouldCache) {
   Chartboost.setAutoCacheAds(shouldCache);
 }
 public boolean isAnyViewVisible() {
   return Chartboost.isAnyViewVisible();
 }
 @Override
 public void onDestroy() {
   Chartboost.onDestroy((Activity) mContext);
 }
Example #10
0
 @Override
 public void onStop() {
   Chartboost.onStop((Activity) mContext);
 }
Example #11
0
 public void disPassAgeGate(boolean pass) {
   Chartboost.didPassAgeGate(pass);
 }
Example #12
0
 @Override
 public void onPause() {
   Chartboost.onPause((Activity) mContext);
 }
Example #13
0
 public boolean getAutoCacheAds() {
   return Chartboost.getAutoCacheAds();
 }
Example #14
0
 public void closeImpression() {
   Chartboost.closeImpression();
 }
 @Override
 public boolean hasVideoAvailable() {
   return Chartboost.hasRewardedVideo(mLocation);
 }
 @Override
 public void onResume(@NonNull Activity activity) {
   Chartboost.onResume(activity);
 }
 @Override
 public void onStop(@NonNull Activity activity) {
   Chartboost.onStop(activity);
 }
 @Override
 public void onBackPressed(@NonNull Activity activity) {
   Chartboost.onBackPressed();
 }
 @Override
 public void onDestroy(@NonNull Activity activity) {
   Chartboost.onDestroy(activity);
 }