package tv.ouya.console.api.store;

import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import tv.ouya.console.api.Product;

public final class AppDetails
  implements Parcelable
{
  public static final Parcelable.Creator<AppDetails> CREATOR = new Parcelable.Creator()
  {
    public AppDetails createFromParcel(Parcel paramAnonymousParcel)
    {
      String str1 = paramAnonymousParcel.readString();
      String str2 = paramAnonymousParcel.readString();
      String str3 = paramAnonymousParcel.readString();
      String str4 = paramAnonymousParcel.readString();
      long l1 = paramAnonymousParcel.readLong();
      String str5 = paramAnonymousParcel.readString();
      String str6 = paramAnonymousParcel.readString();
      ArrayList localArrayList = new ArrayList();
      paramAnonymousParcel.readStringList(localArrayList);
      long l2 = paramAnonymousParcel.readLong();
      String str7 = paramAnonymousParcel.readString();
      String str8 = paramAnonymousParcel.readString();
      String str9 = paramAnonymousParcel.readString();
      boolean bool;
      String str10;
      String str11;
      if (paramAnonymousParcel.readByte() == 1)
      {
        bool = true;
        str10 = paramAnonymousParcel.readString();
        str11 = paramAnonymousParcel.readString();
        if (paramAnonymousParcel.readInt() != 1) {
          break label188;
        }
      }
      label188:
      for (int i = 1;; i = 0)
      {
        Product localProduct = null;
        if (i != 0) {
          localProduct = (Product)Product.CREATOR.createFromParcel(paramAnonymousParcel);
        }
        return new AppDetails(str1, str2, str3, str4, Long.valueOf(l1), str5, str6, localArrayList, Long.valueOf(l2), str7, str8, str9, Boolean.valueOf(bool), str10, str11, localProduct);
        bool = false;
        break;
      }
    }
    
    public AppDetails[] newArray(int paramAnonymousInt)
    {
      return new AppDetails[paramAnonymousInt];
    }
  };
  public Long apkFileSize;
  public String description;
  public String developer;
  public boolean founder;
  public List<String> imageUrls;
  public String latestVersion;
  public Long likeCount;
  public String mainImageFullUrl;
  public String overview;
  public Product primaryProduct;
  public String publishedAt;
  public String rating;
  public String title;
  public String uuid;
  public String versionNumber;
  public String videoUrl;
  
  public AppDetails()
  {
    this.imageUrls = new ArrayList();
  }
  
  public AppDetails(String paramString1, String paramString2, String paramString3, String paramString4, Long paramLong1, String paramString5, String paramString6, List<String> paramList, Long paramLong2, String paramString7, String paramString8, String paramString9, Boolean paramBoolean, String paramString10, String paramString11, Product paramProduct)
  {
    this.title = paramString1;
    this.description = paramString2;
    this.mainImageFullUrl = paramString3;
    this.uuid = paramString4;
    this.apkFileSize = paramLong1;
    this.versionNumber = paramString5;
    this.publishedAt = paramString6;
    this.imageUrls = paramList;
    this.likeCount = paramLong2;
    this.overview = paramString7;
    this.rating = paramString8;
    this.latestVersion = paramString9;
    this.founder = paramBoolean.booleanValue();
    this.developer = paramString10;
    this.videoUrl = paramString11;
    this.primaryProduct = paramProduct;
  }
  
  public AppDetails(JSONObject paramJSONObject)
    throws JSONException
  {
    readFromJSON(paramJSONObject);
  }
  
  public int describeContents()
  {
    return 0;
  }
  
  public boolean equals(Object paramObject)
  {
    if (this == paramObject) {}
    do
    {
      do
      {
        return true;
        if (!(paramObject instanceof AppDetails)) {
          return false;
        }
        paramObject = (AppDetails)paramObject;
        if (!this.description.equals(((AppDetails)paramObject).description)) {
          return false;
        }
        if (!this.mainImageFullUrl.equals(((AppDetails)paramObject).mainImageFullUrl)) {
          return false;
        }
        if (!this.title.equals(((AppDetails)paramObject).title)) {
          return false;
        }
        if (!this.uuid.equals(((AppDetails)paramObject).uuid)) {
          return false;
        }
        if (!this.apkFileSize.equals(((AppDetails)paramObject).apkFileSize)) {
          return false;
        }
        if (!this.versionNumber.equals(((AppDetails)paramObject).versionNumber)) {
          return false;
        }
        if (!this.publishedAt.equals(((AppDetails)paramObject).publishedAt)) {
          return false;
        }
        if (!this.likeCount.equals(((AppDetails)paramObject).likeCount)) {
          return false;
        }
        if (!this.overview.equals(((AppDetails)paramObject).overview)) {
          return false;
        }
        if (!this.rating.equals(((AppDetails)paramObject).rating)) {
          return false;
        }
        if (!this.latestVersion.equals(((AppDetails)paramObject).latestVersion)) {
          return false;
        }
        if (this.founder != ((AppDetails)paramObject).founder) {
          return false;
        }
        if (!this.developer.equals(((AppDetails)paramObject).developer)) {
          return false;
        }
        if (this.videoUrl == null)
        {
          if (((AppDetails)paramObject).videoUrl != null) {
            return false;
          }
        }
        else if (!this.videoUrl.equals(((AppDetails)paramObject).videoUrl)) {
          return false;
        }
        if (this.primaryProduct != null) {
          break;
        }
      } while (((AppDetails)paramObject).primaryProduct == null);
      return false;
    } while (this.primaryProduct.equals(((AppDetails)paramObject).primaryProduct));
    return false;
  }
  
  public AppDescription getDescription(String paramString)
  {
    AppDescription.AppVersion localAppVersion = new AppDescription.AppVersion();
    localAppVersion.setMainImageFullUrl(this.mainImageFullUrl);
    localAppVersion.setUploadedAt(this.publishedAt);
    localAppVersion.setUuid(this.uuid);
    localAppVersion.setContentRating(this.rating);
    HashMap localHashMap = new HashMap();
    localHashMap.put("published", localAppVersion);
    return new AppDescription(paramString, this.title, this.mainImageFullUrl, 0.0D, localHashMap);
  }
  
  public int hashCode()
  {
    return ((this.title.hashCode() * 31 + this.description.hashCode()) * 31 + this.mainImageFullUrl.hashCode()) * 31 + this.uuid.hashCode();
  }
  
  public void readFromJSON(JSONObject paramJSONObject)
    throws JSONException
  {
    this.title = paramJSONObject.optString("title");
    this.description = paramJSONObject.optString("description");
    this.mainImageFullUrl = paramJSONObject.optString("mainImageFullUrl");
    this.uuid = paramJSONObject.optString("uuid");
    this.apkFileSize = Long.valueOf(paramJSONObject.optLong("apkFileSize"));
    this.versionNumber = paramJSONObject.optString("versionNumber");
    this.publishedAt = paramJSONObject.optString("publishedAt");
    this.rating = paramJSONObject.optString("contentRating");
    this.latestVersion = paramJSONObject.optString("latestVersion");
    this.imageUrls = new ArrayList();
    JSONArray localJSONArray2 = paramJSONObject.optJSONArray("filepickerScreenshots");
    JSONArray localJSONArray1;
    if (localJSONArray2 != null)
    {
      localJSONArray1 = localJSONArray2;
      if (localJSONArray2.length() != 0) {}
    }
    else
    {
      localJSONArray1 = paramJSONObject.optJSONArray("screenshots");
    }
    if (localJSONArray1 != null)
    {
      int i = 0;
      while (i < localJSONArray1.length())
      {
        this.imageUrls.add(localJSONArray1.getString(i));
        i += 1;
      }
    }
    this.likeCount = Long.valueOf(paramJSONObject.optLong("likeCount"));
    this.overview = paramJSONObject.optString("overview");
    this.founder = paramJSONObject.optBoolean("founder");
    this.developer = paramJSONObject.optString("developer");
    this.videoUrl = paramJSONObject.optString("videoUrl");
    if (this.videoUrl.equals("null")) {
      this.videoUrl = null;
    }
    paramJSONObject = paramJSONObject.optJSONObject("primaryProduct");
    if (paramJSONObject != null)
    {
      this.primaryProduct = new Product();
      this.primaryProduct.readFromJSONObject(paramJSONObject);
    }
  }
  
  public void writeToParcel(Parcel paramParcel, int paramInt)
  {
    int i = 1;
    paramParcel.writeString(this.title);
    paramParcel.writeString(this.description);
    paramParcel.writeString(this.mainImageFullUrl);
    paramParcel.writeString(this.uuid);
    paramParcel.writeLong(this.apkFileSize.longValue());
    paramParcel.writeString(this.versionNumber);
    paramParcel.writeString(this.publishedAt);
    paramParcel.writeStringList(this.imageUrls);
    paramParcel.writeLong(this.likeCount.longValue());
    paramParcel.writeString(this.overview);
    paramParcel.writeString(this.rating);
    paramParcel.writeString(this.latestVersion);
    byte b;
    if (this.founder)
    {
      b = 1;
      paramParcel.writeByte(b);
      paramParcel.writeString(this.developer);
      paramParcel.writeString(this.videoUrl);
      if (this.primaryProduct == null) {
        break label170;
      }
    }
    for (;;)
    {
      paramParcel.writeInt(i);
      if (this.primaryProduct != null) {
        this.primaryProduct.writeToParcel(paramParcel, paramInt);
      }
      return;
      b = 0;
      break;
      label170:
      i = 0;
    }
  }
}


/* Location:              /home/enzo/Documents/hacking/malwares/viking-horde/classes.jar!/tv/ouya/console/api/store/AppDetails.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */