package com.jaredrummler.android.processes.models;

import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import android.text.TextUtils;
import java.io.IOException;

public class AndroidProcess
  implements Parcelable
{
  public static final Parcelable.Creator<AndroidProcess> CREATOR = new Parcelable.Creator()
  {
    public AndroidProcess createFromParcel(Parcel paramAnonymousParcel)
    {
      return new AndroidProcess(paramAnonymousParcel);
    }
    
    public AndroidProcess[] newArray(int paramAnonymousInt)
    {
      return new AndroidProcess[paramAnonymousInt];
    }
  };
  public final String name;
  public final int pid;
  
  public AndroidProcess(int paramInt)
    throws IOException
  {
    this.pid = paramInt;
    this.name = getProcessName(paramInt);
  }
  
  protected AndroidProcess(Parcel paramParcel)
  {
    this.name = paramParcel.readString();
    this.pid = paramParcel.readInt();
  }
  
  static String getProcessName(int paramInt)
    throws IOException
  {
    Object localObject1 = null;
    try
    {
      localObject2 = ProcFile.readFile(String.format("/proc/%d/cmdline", new Object[] { Integer.valueOf(paramInt) })).trim();
      localObject1 = localObject2;
    }
    catch (IOException localIOException)
    {
      Object localObject2;
      for (;;) {}
    }
    localObject2 = localObject1;
    if (TextUtils.isEmpty((CharSequence)localObject1)) {
      localObject2 = Stat.get(paramInt).getComm();
    }
    return (String)localObject2;
  }
  
  public String attr_current()
    throws IOException
  {
    return read("attr/current");
  }
  
  public Cgroup cgroup()
    throws IOException
  {
    return Cgroup.get(this.pid);
  }
  
  public String cmdline()
    throws IOException
  {
    return read("cmdline");
  }
  
  public int describeContents()
  {
    return 0;
  }
  
  public int oom_adj()
    throws IOException
  {
    return Integer.parseInt(read("oom_adj"));
  }
  
  public int oom_score()
    throws IOException
  {
    return Integer.parseInt(read("oom_score"));
  }
  
  public int oom_score_adj()
    throws IOException
  {
    return Integer.parseInt(read("oom_score_adj"));
  }
  
  public String read(String paramString)
    throws IOException
  {
    return ProcFile.readFile(String.format("/proc/%d/%s", new Object[] { Integer.valueOf(this.pid), paramString }));
  }
  
  public Stat stat()
    throws IOException
  {
    return Stat.get(this.pid);
  }
  
  public Statm statm()
    throws IOException
  {
    return Statm.get(this.pid);
  }
  
  public Status status()
    throws IOException
  {
    return Status.get(this.pid);
  }
  
  public String wchan()
    throws IOException
  {
    return read("wchan");
  }
  
  public void writeToParcel(Parcel paramParcel, int paramInt)
  {
    paramParcel.writeString(this.name);
    paramParcel.writeInt(this.pid);
  }
}


/* Location:              /home/enzo/Documents/hacking/malwares/viking-horde/classes.jar!/com/jaredrummler/android/processes/models/AndroidProcess.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */