package com.worklight.common;

import android.content.Context;
import com.worklight.common.internal.WLTrusteerInternal;
import org.json.JSONObject;

public class WLTrusteer
{
  private static final Logger logger = Logger.getInstance(WLTrusteer.class.getName());
  private static boolean trusteerTest = false;
  private static WLTrusteer wlTrusteer = null;
  private Object _wlTrusteer = null;

  private static boolean checkTrusteerSDK()
  {
    try
    {
      Class.forName("com.trusteer.tas.TAS_CLIENT_INFO");
      logger.info("Trusteer SDK found.");
      return true;
    }
    catch (Throwable localThrowable)
    {
    }
    return false;
  }

  public static WLTrusteer createInstance(Context paramContext)
  {
    try
    {
      if (wlTrusteer != null)
        logger.info("WLTrusteer has already been created.");
      while (true)
      {
        WLTrusteer localWLTrusteer2 = wlTrusteer;
        return localWLTrusteer2;
        if ((wlTrusteer == null) && (!trusteerTest))
        {
          if (checkTrusteerSDK())
          {
            WLTrusteer localWLTrusteer1 = new WLTrusteer();
            if (localWLTrusteer1.init(paramContext))
              wlTrusteer = localWLTrusteer1;
          }
          trusteerTest = true;
        }
      }
    }
    finally
    {
    }
  }

  public static WLTrusteer getInstance()
  {
    return wlTrusteer;
  }

  public static boolean hasTrusteerSDK()
  {
    return wlTrusteer != null;
  }

  private boolean init(Context paramContext)
  {
    if (this._wlTrusteer == null)
      return false;
    return ((WLTrusteerInternal)this._wlTrusteer).init(paramContext);
  }

  protected static void releaseInstance()
  {
    try
    {
      wlTrusteer.finalize();
      wlTrusteer = null;
      trusteerTest = false;
      return;
    }
    catch (Throwable localThrowable)
    {
      logger.warn("WLTrusteer failed to clean up with error " + localThrowable);
    }
  }

  public String getDeviceKey()
  {
    if (!hasTrusteerSDK())
      return null;
    return ((WLTrusteerInternal)this._wlTrusteer).getDeviceKey();
  }

  public JSONObject getRiskAssessment()
  {
    if (!hasTrusteerSDK())
      return new JSONObject();
    if (!((WLTrusteerInternal)this._wlTrusteer).isRiskAssessmentAvailable())
      ((WLTrusteerInternal)this._wlTrusteer).waitForRiskAssessment();
    return ((WLTrusteerInternal)this._wlTrusteer).getRiskAssessmentAsJson();
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.worklight.common.WLTrusteer
 * JD-Core Version:    0.6.2
 */