package com.splunk.mint;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Set;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

abstract class BaseDTO
{
  protected static final String UNKNOWN = "NA";
  protected String apiKey;
  protected String appVersionCode;
  protected String appVersionName;
  protected int batteryLevel;
  protected String carrier;
  protected String connection;
  protected String currentView;
  protected HashMap<String, Object> customData;
  protected String device;
  protected ExtraData extraData;
  protected String isFSEncrypted;
  protected String locale;
  protected String osVersion;
  protected String packageName;
  protected String platform = "Android";
  protected String remoteIP;
  protected Boolean rooted;
  protected String screenOrientation;
  protected String sdkVersion = "4.3.0";
  protected String state;
  protected Long timestampMilis = Long.valueOf(System.currentTimeMillis());
  protected EnumActionType type;
  protected String userIdentifier;
  protected String uuid;

  public BaseDTO(EnumActionType paramEnumActionType, HashMap<String, Object> paramHashMap)
  {
    this.type = paramEnumActionType;
    this.apiKey = Properties.API_KEY;
    StringBuilder localStringBuilder = new StringBuilder();
    if (Properties.PHONE_BRAND != null);
    for (String str = Properties.PHONE_BRAND + " "; ; str = "")
    {
      this.device = (str + Properties.PHONE_MODEL);
      this.osVersion = Properties.OS_VERSION;
      this.appVersionCode = Properties.APP_VERSIONCODE;
      this.appVersionName = Properties.APP_VERSIONNAME;
      this.packageName = Properties.APP_PACKAGE;
      this.locale = Properties.LOCALE;
      this.rooted = Boolean.valueOf(Properties.HAS_ROOT);
      this.uuid = Properties.UID;
      this.userIdentifier = Properties.userIdentifier;
      this.carrier = Properties.CARRIER;
      this.remoteIP = "{%#@@#%}";
      this.connection = Properties.CONNECTION;
      this.state = Properties.STATE;
      this.extraData = Properties.extraData;
      this.screenOrientation = Properties.SCREEN_ORIENTATION;
      this.customData = paramHashMap;
      this.isFSEncrypted = Properties.ISFSENCRYPTED;
      this.batteryLevel = Properties.BATTERY_LEVEL;
      this.currentView = Properties.lastView;
      return;
    }
  }

  public JSONObject getBasicDataFixtureJson()
  {
    while (true)
    {
      JSONObject localJSONObject1;
      JSONObject localJSONObject2;
      try
      {
        localJSONObject1 = new JSONObject();
        Map.Entry localEntry2;
        try
        {
          localJSONObject1.put("sdkVersion", this.sdkVersion);
          localJSONObject1.put("apiKey", this.apiKey);
          localJSONObject1.put("platform", this.platform);
          localJSONObject1.put("device", this.device);
          localJSONObject1.put("osVersion", this.osVersion);
          localJSONObject1.put("locale", this.locale);
          localJSONObject1.put("uuid", this.uuid);
          localJSONObject1.put("userIdentifier", this.userIdentifier);
          localJSONObject1.put("batteryLevel", this.batteryLevel);
          localJSONObject1.put("carrier", this.carrier);
          localJSONObject1.put("remoteIP", this.remoteIP);
          localJSONObject1.put("appVersionCode", this.appVersionCode);
          localJSONObject1.put("appVersionName", this.appVersionName);
          localJSONObject1.put("packageName", this.packageName);
          localJSONObject1.put("connection", this.connection);
          localJSONObject1.put("state", this.state);
          localJSONObject1.put("currentView", this.currentView);
          localJSONObject1.put("screenOrientation", this.screenOrientation);
          localJSONObject2 = new JSONObject();
          if ((this.extraData == null) || (this.extraData.isEmpty()))
            break label341;
          Iterator localIterator3 = this.extraData.entrySet().iterator();
          if (!localIterator3.hasNext())
            break label341;
          localEntry2 = (Map.Entry)localIterator3.next();
          if (localEntry2.getValue() != null)
            continue;
          localJSONObject2.put((String)localEntry2.getKey(), "null");
          continue;
        }
        catch (JSONException localJSONException)
        {
          localJSONException.printStackTrace();
        }
        return localJSONObject1;
        localJSONObject2.put((String)localEntry2.getKey(), localEntry2.getValue());
        continue;
      }
      finally
      {
      }
      label341: if ((this.customData != null) && (!this.customData.isEmpty()))
      {
        Iterator localIterator2 = this.customData.entrySet().iterator();
        while (localIterator2.hasNext())
        {
          Map.Entry localEntry1 = (Map.Entry)localIterator2.next();
          if (localEntry1.getValue() == null)
            localJSONObject2.put((String)localEntry1.getKey(), "null");
          else
            localJSONObject2.put((String)localEntry1.getKey(), localEntry1.getValue());
        }
      }
      localJSONObject1.put("extraData", localJSONObject2);
      JSONArray localJSONArray = new JSONArray();
      if (Properties.transactions != null)
      {
        Iterator localIterator1 = Properties.transactions.iterator();
        while (localIterator1.hasNext())
          localJSONArray.put((String)localIterator1.next());
      }
      localJSONObject1.put("transactions", localJSONArray);
    }
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.splunk.mint.BaseDTO
 * JD-Core Version:    0.6.2
 */