com.crashlytics.tools.android_2.1.0

OrFolder(localFile3);
        }
      }
      i = 1;
      localPackage.postInstallHook(localArchive1, paramITaskMonitor, localFile1);
      return true;
    }
    finally
    {
      if (i == 0)
      {
        if (localFile2 != null) {
          restoreFolder(localFile2, localFile1);
        }
        localPackage.postInstallHook(localArchive1, paramITaskMonitor, null);
      }
      mFileOp.deleteFileOrFolder(localFile2);
    }
  }
  
  private boolean windowsDestDirLocked(String paramString, File paramFile, final ITaskMonitor paramITaskMonitor)
  {
    String str1 = null;
    
    assert (SdkConstants.CURRENT_PLATFORM == 2);
    
    File localFile = FileOp.append(paramString, new String[] { "tools", "lib", SdkConstants.FN_FIND_LOCK });
    if (mFileOp.exists(localFile)) {
      try
      {
        final StringBuilder localStringBuilder1 = new StringBuilder();
        String[] arrayOfString = { localFile.getAbsolutePath(), paramFile.getAbsolutePath() };
        
        Process localProcess = Runtime.getRuntime().exec(arrayOfString);
        int i = GrabProcessOutput.grabProcessOutput(localProcess, GrabProcessOutput.Wait.WAIT_FOR_READERS, new GrabProcessOutput.IProcessOutput()
        {
          public void out(String paramAnonymousString)
          {
            if (paramAnonymousString != null) {
              localStringBuilder1.append(paramAnonymousString).append("\n");
            }
          }
          
          public void err(String paramAnonymousString)
          {
            if (paramAnonymousString != null) {
              paramITaskMonitor.logError("[find_lock] Error: %1$s", new Object[] { paramAnonymousString });
            }
          }
        });
        if ((i == 0) && (localStringBuilder1.length() > 0))
        {
          String str2 = localStringBuilder1.toString().trim();
          paramITaskMonitor.logError("[find_lock] Directory locked by %1$s", new Object[] { str2 });
          
          TreeSet localTreeSet = new TreeSet(Arrays.asList(str2.split(Pattern.quote(";"))));
          
          StringBuilder localStringBuilder2 = new StringBuilder();
          for (String str3 : localTreeSet) {
            localStringBuilder2.append("\n  - ").append(str3.trim());
          }
          str1 = String.format("-= Warning ! =-\nThe following processes: %1$s\nare locking the following directory: \n  %2$s\nPlease close these applications so that the installation can continue.\nWhen ready, press YES to try again.", new Object[] { localStringBuilder2.toString(), paramFile.getPath() });
        }
      }
      catch (Exception localException)
      {
        paramITaskMonitor.error(localException, "[find_lock failed]", new Object[0]);
      }
    }
    if (str1 == null) {
      str1 = String.format("-= Warning ! =-\nA folder failed to be moved. On Windows this typically means that a program is using that folder (for example Windows Explorer or your anti-virus software.)\nPlease momentarily deactivate your anti-virus software or close any running programs that may be accessing the directory '%1$s'.\nWhen ready, press YES to try again.", new Object[] { paramFile.getPath() });
    }
    boolean bool = paramITaskMonitor.displayPrompt("SDK Manager: failed to install", str1);
    return bool;
  }
  
  private boolean moveFolder(File paramFile1, File paramFile2)
  {
    for (int i = 0; i < 5; i++)
    {
      if (mFileOp.renameTo(paramFile1, paramFile2)) {
        return true;
      }
      try
      {
        Thread.sleep(500L);
      }
      catch (InterruptedException localInterruptedException) {}
    }
    return false;
  }
  
  protected boolean unzipFolder(ArchiveReplacement paramArchiveReplacement, File paramFile1, File paramFile2, ITaskMonitor paramITaskMonitor)
  {
    Archive localArchive = paramArchiveReplacement.getNewArchive();
    Package localPackage = localArchive.getParentPackage();
    String str1 = localPackage.getShortDescription();
    long l1 = localArchive.getSize();
    
    ZipFile localZipFile = null;
    try
    {
      localZipFile = new ZipFile(paramFile1);
      
      long l2 = l1 / 100L;
      long l3 = 0L;
      long l4 = 0L;
      int i = 0;
      
      byte[] arrayOfByte = new byte[65536];
      
      Enumeration localEnumeration = localZipFile.getEntries();
      while (localEnumeration.hasMoreElements())
      {
        ZipArchiveEntry localZipArchiveEntry = (ZipArchiveEntry)localEnumeration.nextElement();
        
        String str2 = localZipArchiveEntry.getName();
        
        str2 = str2.replace('\\', '/');
        
        int j = str2.indexOf('/');
        if ((j >= 0) && (j != str2.length() - 1))
        {
          str2 = str2.substring(j + 1);
          
          File localFile = new File(paramFile2, str2);
          if (str2.endsWith("/"))
          {
            if ((!mFileOp.isDirectory(localFile)) && (!mFileOp.mkdirs(localFile)))
            {
              paramITaskMonitor.logError("Failed to create directory %1$s", new Object[] { localFile.getPath() });
              
              return false;
            }
          }
          else
          {
            if (str2.indexOf('/') != -1)
            {
              localObject1 = localFile.getParentFile();
              if ((!mFileOp.isDirectory((File)localObject1)) && 
                (!mFileOp.mkdirs((File)localObject1)))
              {
                paramITaskMonitor.logError("Failed to create directory %1$s", new Object[] { ((File)localObject1).getPath() });
                
                return false;
              }
            }
            Object localObject1 = null;
            long l5 = localZipArchiveEntry.getSize();
            int m;
            try
            {
              localObject1 = new FileOutputStream(localFile);
              
              InputStream localInputStream = localZipFile.getInputStream(localZipArchiveEntry);
              while ((l5 > 0L) && ((m = localInputStream.read(arrayOfByte, 0, (int)Math.min(l5, arrayOfByte.length))) != -1))
              {
                l5 -= m;
                if (m > 0) {
                  ((FileOutputStream)localObject1).write(arrayOfByte, 0, m);
                }
              }
            }
            catch (EOFException localEOFException)
            {
              paramITaskMonitor.logError("Error uncompressing file %s. Size: %d bytes, Unwritten: %d bytes.", new Object[] { localZipArchiveEntry.getName(), Long.valueOf(localZipArchiveEntry.getSize()), Long.valueOf(l5) });
              
              throw localEOFException;
            }
            finally
            {
              if (localObject1 != null) {
                ((FileOutputStream)localObject1).close();
              }
            }
            localPackage.postUnzipFileHook(localArchive, paramITaskMonitor, mFileOp, localFile, localZipArchiveEntry);
            for (l3 += localZipArchiveEntry.getCompressedSize(); l4 < l3; l4 += l2) {
              paramITaskMonitor.incProgress(1);
            }
            int k = (int)(100L * l3 / l1);
            if (k != i)
            {
              paramITaskMonitor.setDescription("Unzipping %1$s (%2$d%%)", new Object[] { str1, Integer.valueOf(k) });
              i = k;
            }
            if (paramITaskMonitor.isCancelRequested()) {
              return 0;
            }
          }
        }
      }
      return true;
    }
    catch (IOException localIOException1)
    {
      paramITaskMonitor.logError("Unzip failed: %1$s", new Object[] { localIOException1.getMessage() });
    }
    finally
    {
      if (localZipFile != null) {
        try
        {
          localZipFile.close();
        }
        catch (IOException localIOException7) {}
      }
    }
    return false;
  }
  
  private File getNewTempFolder(String paramString1, String paramString2, String paramString3)
  {
    File localFile1 = getTempFolder(paramString1);
    if (!mFileOp.isDirectory(localFile1))
    {
      if (mFileOp.isFile(localFile1)) {
        mFileOp.deleteFileOrFolder(localFile1);
      }
      if (!mFileOp.mkdirs(localFile1)) {
        return null;
      }
    }
    for (int i = 1; i < 100; i++)
    {
      File localFile2 = new File(localFile1, String.format("%1$s.%2$s%3$02d", new Object[] { paramString2, paramString3, Integer.valueOf(i) }));
      if (!mFileOp.exists(localFile2)) {
        return localFile2;
      }
    }
    return null;
  }
  
  private File getTempFolder(String paramString)
  {
    File localFile = new File(paramString, "temp");
    return localFile;
  }
  
  protected boolean generateSourceProperties(Archive paramArchive, File paramFile)
  {
    Properties localProperties = new Properties();
    
    paramArchive.saveProperties(localProperties);
    
    Package localPackage = paramArchive.getParentPackage();
    if (localPackage != null) {
      localPackage.saveProperties(localProperties);
    }
    OutputStream localOutputStream = null;
    try
    {
      File localFile = new File(paramFile, "source.properties");
      
      localOutputStream = mFileOp.newFileOutputStream(localFile);
      
      localProperties.store(localOutputStream, "## Android Tool: Source of this archive.");
      
      return true;
    }
    catch (IOException localIOException1)
    {
      localIOException1.printStackTrace();
    }
    finally
    {
      if (localOutputStream != null) {
        try
        {
          localOutputStream.close();
        }
        catch (IOException localIOException4) {}
      }
    }
    return false;
  }
  
  private boolean restoreFolder(File paramFile1, File paramFile2)
  {
    boolean bool = true;
    
    File[] arrayOfFile1 = mFileOp.listFiles(paramFile1);
    if (arrayOfFile1 == null) {
      return false;
    }
    if (mFileOp.isFile(paramFile2))
    {
      if (!mFileOp.delete(paramFile2)) {
        return false;
      }
    }
    else if (!mFileOp.isDirectory(paramFile2)) {
      mFileOp.mkdirs(paramFile2);
    }
    HashSet localHashSet1 = new HashSet();
    HashSet localHashSet2 = new HashSet();
    File[] arrayOfFile2 = mFileOp.listFiles(paramFile2);
    File localFile3;
    if (arrayOfFile2 != null) {
      for (localFile3 : arrayOfFile2) {
        if (mFileOp.isDirectory(localFile3)) {
          localHashSet1.add(localFile3);
        } else {
          localHashSet2.add(localFile3);
        }
      }
    }
    File localFile4;
    for (localFile3 : arrayOfFile1) {
      if (mFileOp.isDirectory(localFile3))
      {
        localFile4 = new File(paramFile2, localFile3.getName());
        localHashSet1.remove(localFile4);
        if (!restoreFolder(localFile3, localFile4)) {
          bool = false;
        }
      }
    }
    for (??? = localHashSet1.iterator(); ((Iterator)???).hasNext();)
    {
      File localFile1 = (File)((Iterator)???).next();
      mFileOp.deleteFileOrFolder(localFile1);
    }
    for (localFile3 : arrayOfFile1) {
      if (mFileOp.isFile(localFile3))
      {
        localFile4 = new File(paramFile2, localFile3.getName());
        localHashSet2.remove(localFile4);
        try
        {
          mFileOp.copyFile(localFile3, localFile4);
        }
        catch (IOException localIOException)
        {
          bool = false;
        }
      }
    }
    for (??? = localHashSet2.iterator(); ((Iterator)???).hasNext();)
    {
      File localFile2 = (File)((Iterator)???).next();
      mFileOp.deleteFileOrFolder(localFile2);
    }
    return bool;
  }
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.ArchiveInstaller
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

public class ArchiveReplacement
  implements IDescription
{
  private final Archive mNewArchive;
  private final Archive mReplaced;
  
  public ArchiveReplacement(Archive paramArchive1, Archive paramArchive2)
  {
    mNewArchive = paramArchive1;
    mReplaced = paramArchive2;
  }
  
  public Archive getNewArchive()
  {
    return mNewArchive;
  }
  
  public Archive getReplaced()
  {
    return mReplaced;
  }
  
  public String getLongDescription()
  {
    if (mNewArchive != null)
    {
      Package localPackage = mNewArchive.getParentPackage();
      if (localPackage != null) {
        return localPackage.getLongDescription();
      }
    }
    return "";
  }
  
  public String getShortDescription()
  {
    if (mNewArchive != null)
    {
      Package localPackage = mNewArchive.getParentPackage();
      if (localPackage != null) {
        return localPackage.getShortDescription();
      }
    }
    return "";
  }
  
  public String toString()
  {
    if (mNewArchive != null)
    {
      Package localPackage = mNewArchive.getParentPackage();
      if (localPackage != null) {
        return localPackage.getShortDescription();
      }
    }
    return super.toString();
  }
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.ArchiveReplacement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

import com.android.sdklib.SdkManager;
import java.io.File;
import java.util.Properties;

public class BrokenPackage
  extends Package
  implements IExactApiLevelDependency, IMinApiLevelDependency
{
  private final int mMinApiLevel;
  private final int mExactApiLevel;
  private final String mShortDescription;
  private final String mLongDescription;
  
  BrokenPackage(Properties paramProperties, String paramString1, String paramString2, int paramInt1, int paramInt2, String paramString3)
  {
    super(null, paramProperties, 0, null, paramString2, null, Archive.Os.ANY, Archive.Arch.ANY, paramString3);
    
    mShortDescription = paramString1;
    mLongDescription = paramString2;
    mMinApiLevel = paramInt1;
    mExactApiLevel = paramInt2;
  }
  
  void saveProperties(Properties paramProperties) {}
  
  public int getMinApiLevel()
  {
    return mMinApiLevel;
  }
  
  public int getExactApiLevel()
  {
    return mExactApiLevel;
  }
  
  public String installId()
  {
    return "";
  }
  
  public String getListDescription()
  {
    return mShortDescription;
  }
  
  public String getShortDescription()
  {
    return mShortDescription;
  }
  
  public String getLongDescription()
  {
    String str = mLongDescription;
    if ((str != null) && (str.length() != 0)) {
      return str;
    }
    str = getDescription();
    if ((str != null) && (str.length() != 0)) {
      return str;
    }
    return getShortDescription();
  }
  
  public File getInstallFolder(String paramString, SdkManager paramSdkManager)
  {
    return null;
  }
  
  public boolean sameItemAs(Package paramPackage)
  {
    if ((paramPackage instanceof BrokenPackage)) {
      return (mShortDescription.equals(mShortDescription)) && (getDescription().equals(paramPackage.getDescription())) && (getMinApiLevel() == ((BrokenPackage)paramPackage).getMinApiLevel());
    }
    return false;
  }
  
  public boolean preInstallHook(Archive paramArchive, ITaskMonitor paramITaskMonitor, String paramString, File paramFile)
  {
    return super.preInstallHook(paramArchive, paramITaskMonitor, paramString, paramFile);
  }
  
  public void postInstallHook(Archive paramArchive, ITaskMonitor paramITaskMonitor, File paramFile)
  {
    super.postInstallHook(paramArchive, paramITaskMonitor, paramFile);
  }
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.BrokenPackage
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

import com.android.sdklib.AndroidVersion;
import com.android.sdklib.SdkManager;
import java.io.File;
import java.util.Map;
import java.util.Properties;
import org.w3c.dom.Node;

public class DocPackage
  extends Package
  implements IPackageVersion
{
  private final AndroidVersion mVersion;
  
  DocPackage(SdkSource paramSdkSource, Node paramNode, String paramString, Map<String, String> paramMap)
  {
    super(paramSdkSource, paramNode, paramString, paramMap);
    
    int i = XmlParserUtils.getXmlInt(paramNode, "api-level", 0);
    String str = XmlParserUtils.getXmlString(paramNode, "codename");
    if (str.length() == 0) {
      str = null;
    }
    mVersion = new AndroidVersion(i, str);
  }
  
  static Package create(SdkSource paramSdkSource, Properties paramProperties, int paramInt1, String paramString1, int paramInt2, String paramString2, String paramString3, String paramString4, Archive.Os paramOs, Archive.Arch paramArch, String paramString5)
  {
    return new DocPackage(paramSdkSource, paramProperties, paramInt1, paramString1, paramInt2, paramString2, paramString3, paramString4, paramOs, paramArch, paramString5);
  }
  
  private DocPackage(SdkSource paramSdkSource, Properties paramProperties, int paramInt1, String paramString1, int paramInt2, String paramString2, String paramString3, String paramString4, Archive.Os paramOs, Archive.Arch paramArch, String paramString5)
  {
    super(paramSdkSource, paramProperties, paramInt2, paramString2, paramString3, paramString4, paramOs, paramArch, paramString5);
    
    mVersion = new AndroidVersion(paramProperties, paramInt1, paramString1);
  }
  
  void saveProperties(Properties paramProperties)
  {
    super.saveProperties(paramProperties);
    
    mVersion.saveProperties(paramProperties);
  }
  
  public AndroidVersion getVersion()
  {
    return mVersion;
  }
  
  public String installId()
  {
    return "doc-" + mVersion.getApiString();
  }
  
  public String getListDescription()
  {
    if (mVersion.isPreview()) {
      return String.format("Documentation for Android '%1$s' Preview SDK%2$s", new Object[] { mVersion.getCodename(), isObsolete() ? " (Obsolete)" : "" });
    }
    return String.format("Documentation for Android SDK%2$s", new Object[] { Integer.valueOf(mVersion.getApiLevel()), isObsolete() ? " (Obsolete)" : "" });
  }
  
  public String getShortDescription()
  {
    if (mVersion.isPreview()) {
      return String.format("Documentation for Android '%1$s' Preview SDK, revision %2$s%3$s", new Object[] { mVersion.getCodename(), Integer.valueOf(getRevision()), isObsolete() ? " (Obsolete)" : "" });
    }
    return String.format("Documentation for Android SDK, API %1$d, revision %2$s%3$s", new Object[] { Integer.valueOf(mVersion.getApiLevel()), Integer.valueOf(getRevision()), isObsolete() ? " (Obsolete)" : "" });
  }
  
  public String getLongDescription()
  {
    String str = getDescription();
    if ((str == null) || (str.length() == 0)) {
      str = getShortDescription();
    }
    if (str.indexOf("revision") == -1) {
      str = str + String.format("\nRevision %1$d%2$s", new Object[] { Integer.valueOf(getRevision()), isObsolete() ? " (Obsolete)" : "" });
    }
    return str;
  }
  
  public File getInstallFolder(String paramString, SdkManager paramSdkManager)
  {
    return new File(paramString, "docs");
  }
  
  public boolean sameItemAs(Package paramPackage)
  {
    if ((paramPackage instanceof DocPackage))
    {
      AndroidVersion localAndroidVersion = ((DocPackage)paramPackage).getVersion();
      return getVersion().equals(localAndroidVersion);
    }
    return false;
  }
  
  public Package.UpdateInfo canBeUpdatedBy(Package paramPackage)
  {
    if (!(paramPackage instanceof DocPackage)) {
      return Package.UpdateInfo.INCOMPATIBLE;
    }
    DocPackage localDocPackage = (DocPackage)paramPackage;
    
    AndroidVersion localAndroidVersion = localDocPackage.getVersion();
    if (localAndroidVersion.equals(mVersion))
    {
      if (paramPackage.getRevision() > getRevision()) {
        return Package.UpdateInfo.UPDATE;
      }
    }
    else if ((localAndroidVersion.getApiLevel() == mVersion.getApiLevel()) && (localAndroidVersion.isPreview())) {
      return Package.UpdateInfo.UPDATE;
    }
    return Package.UpdateInfo.NOT_UPDATE;
  }
  
  public int hashCode()
  {
    int i = super.hashCode();
    i = 31 * i + (mVersion == null ? 0 : mVersion.hashCode());
    return i;
  }
  
  public boolean equals(Object paramObject)
  {
    if (this == paramObject) {
      return true;
    }
    if (!super.equals(paramObject)) {
      return false;
    }
    if (!(paramObject instanceof DocPackage)) {
      return false;
    }
    DocPackage localDocPackage = (DocPackage)paramObject;
    if (mVersion == null)
    {
      if (mVersion != null) {
        return false;
      }
    }
    else if (!mVersion.equals(mVersion)) {
      return false;
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.DocPackage
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

import com.android.sdklib.NullSdkLog;
import com.android.sdklib.SdkManager;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.Properties;
import java.util.regex.Pattern;
import org.w3c.dom.Node;

public class ExtraPackage
  extends MinToolsPackage
  implements IMinApiLevelDependency
{
  private final String mDisplayName;
  private final String mVendorId;
  private final String mVendorDisplay;
  private final String mPath;
  private final String mOldPaths;
  private final int mMinApiLevel;
  private final String[] mProjectFiles;
  
  ExtraPackage(SdkSource paramSdkSource, Node paramNode, String paramString, Map<String, String> paramMap)
  {
    super(paramSdkSource, paramNode, paramString, paramMap);
    
    mPath = XmlParserUtils.getXmlString(paramNode, "path");
    
    String str1 = XmlParserUtils.getXmlString(paramNode, "name-display");
    Object localObject = XmlParserUtils.getXmlString(paramNode, "vendor-display");
    String str2 = XmlParserUtils.getXmlString(paramNode, "vendor-id");
    if (str2.length() == 0)
    {
      String str3 = XmlParserUtils.getXmlString(paramNode, "vendor");
      str2 = sanitizeLegacyVendor(str3);
      if (((String)localObject).length() == 0) {
        localObject = str3;
      }
    }
    if (((String)localObject).length() == 0) {
      localObject = str2;
    }
    mVendorDisplay = ((String)localObject).trim();
    mVendorId = str2.trim();
    if (str1.length() == 0) {
      str1 = getPrettyName();
    }
    mDisplayName = str1.trim();
    
    mMinApiLevel = XmlParserUtils.getXmlInt(paramNode, "min-api-level", 0);
    
    mProjectFiles = parseProjectFiles(XmlParserUtils.getFirstChild(paramNode, "project-files"));
    
    mOldPaths = XmlParserUtils.getXmlString(paramNode, "old-paths");
  }
  
  private String[] parseProjectFiles(Node paramNode)
  {
    ArrayList localArrayList = new ArrayList();
    if (paramNode != null)
    {
      String str1 = paramNode.getNamespaceURI();
      for (Node localNode = paramNode.getFirstChild(); localNode != null; localNode = localNode.getNextSibling()) {
        if ((localNode.getNodeType() == 1) && (str1.equals(localNode.getNamespaceURI())) && ("path".equals(localNode.getLocalName())))
        {
          String str2 = localNode.getTextContent();
          if (str2 != null)
          {
            str2 = str2.trim();
            if (str2.length() > 0) {
              localArrayList.add(str2);
            }
          }
        }
      }
    }
    return (String[])localArrayList.toArray(new String[localArrayList.size()]);
  }
  
  static Package create(SdkSource paramSdkSource, Properties paramProperties, String paramString1, String paramString2, int paramInt, String paramString3, String paramString4, String paramString5, Archive.Os paramOs, Archive.Arch paramArch, String paramString6)
  {
    ExtraPackage localExtraPackage = new ExtraPackage(paramSdkSource, paramProperties, paramString1, paramString2, paramInt, paramString3, paramString4, paramString5, paramOs, paramArch, paramString6);
    
    return localExtraPackage;
  }
  
  protected ExtraPackage(SdkSource paramSdkSource, Properties paramProperties, String paramString1, String paramString2, int paramInt, String paramString3, String paramString4, String paramString5, Archive.Os paramOs, Archive.Arch paramArch, String paramString6)
  {
    super(paramSdkSource, paramProperties, paramInt, paramString3, paramString4, paramString5, paramOs, paramArch, paramString6);
    
    mPath = (paramString2 != null ? paramString2 : getProperty(paramProperties, "Extra.Path", paramString2));
    
    String str1 = getProperty(paramProperties, "Extra.NameDisplay", "");
    Object localObject = getProperty(paramProperties, "Extra.VendorDisplay", "");
    String str2 = paramString1 != null ? paramString1 : getProperty(paramProperties, "Extra.VendorId", "");
    if (str2.length() == 0)
    {
      str3 = getProperty(paramProperties, "Extra.Vendor", "");
      str2 = sanitizeLegacyVendor(str3);
      if (((String)localObject).length() == 0) {
        localObject = str3;
      }
    }
    if (((String)localObject).length() == 0) {
      localObject = str2;
    }
    mVendorDisplay = ((String)localObject).trim();
    mVendorId = str2.trim();
    if (str1.length() == 0) {
      str1 = getPrettyName();
    }
    mDisplayName = str1.trim();
    
    mOldPaths = getProperty(paramProperties, "Extra.OldPaths", null);
    
    mMinApiLevel = Integer.parseInt(getProperty(paramProperties, "Extra.MinApiLevel", Integer.toString(0)));
    
    String str3 = getProperty(paramProperties, "Extra.ProjectFiles", null);
    ArrayList localArrayList = new ArrayList();
    if ((str3 != null) && (str3.length() > 0)) {
      for (String str4 : str3.split(Pattern.quote(File.pathSeparator)))
      {
        str4 = str4.trim();
        if (str4.length() > 0) {
          localArrayList.add(str4);
        }
      }
    }
    mProjectFiles = ((String[])localArrayList.toArray(new String[localArrayList.size()]));
  }
  
  void saveProperties(Properties paramProperties)
  {
    super.saveProperties(paramProperties);
    
    paramProperties.setProperty("Extra.Path", mPath);
    paramProperties.setProperty("Extra.NameDisplay", mDisplayName);
    paramProperties.setProperty("Extra.VendorDisplay", mVendorDisplay);
    paramProperties.setProperty("Extra.VendorId", mVendorId);
    if (getMinApiLevel() != 0) {
      paramProperties.setProperty("Extra.MinApiLevel", Integer.toString(getMinApiLevel()));
    }
    if (mProjectFiles.length > 0)
    {
      StringBuilder localStringBuilder = new StringBuilder();
      for (int i = 0; i < mProjectFiles.length; i++)
      {
        if (i > 0) {
          localStringBuilder.append(File.pathSeparatorChar);
        }
        localStringBuilder.append(mProjectFiles[i]);
      }
      paramProperties.setProperty("Extra.ProjectFiles", localStringBuilder.toString());
    }
    if ((mOldPaths != null) && (mOldPaths.length() > 0)) {
      paramProperties.setProperty("Extra.OldPaths", mOldPaths);
    }
  }
  
  public int getMinApiLevel()
  {
    return mMinApiLevel;
  }
  
  public String[] getProjectFiles()
  {
    return mProjectFiles;
  }
  
  public String[] getOldPaths()
  {
    if ((mOldPaths == null) || (mOldPaths.length() == 0)) {
      return new String[0];
    }
    return mOldPaths.split(";");
  }
  
  public String getPath()
  {
    String str = mPath.replaceAll("[^a-zA-Z0-9-]+", "_");
    if ((str.length() == 0) || (str.equals("_")))
    {
      int i = str.hashCode();
      str = String.format("extra%08x", new Object[] { Integer.valueOf(i) });
    }
    return str;
  }
  
  public String getVendorId()
  {
    return mVendorId;
  }
  
  public String getVendorDisplay()
  {
    return mVendorDisplay;
  }
  
  public String getDisplayName()
  {
    return mDisplayName;
  }
  
  private String sanitizeLegacyVendor(String paramString)
  {
    if ((paramString != null) && (paramString.length() > 0))
    {
      String str = paramString.trim();
      
      str = str.replaceAll("[^a-zA-Z0-9-]+", "_");
      if (str.equals("_"))
      {
        int i = str.hashCode();
        str = String.format("vendor%08x", new Object[] { Integer.valueOf(i) });
      }
      return str;
    }
    return "";
  }
  
  private String getPrettyName()
  {
    String str = mPath;
    if ((mVendorDisplay != null) && (mVendorDisplay.length() > 0) && 
      (str.startsWith(mVendorDisplay + "-"))) {
      str = str.substring(mVendorDisplay.length() + 1);
    }
    if (str != null) {
      str = str.replaceAll("[ _\t\f-]+", " ").trim();
    }
    if ((str == null) || (str.length() == 0)) {
      str = "Unknown Extra";
    }
    if ((mVendorDisplay != null) && (mVendorDisplay.length() > 0))
    {
      str = mVendorDisplay + " " + str;
      str = str.replaceAll("[ _\t\f-]+", " ").trim();
    }
    int i = 0;
    char[] arrayOfChar = str.toCharArray();
    int j = arrayOfChar.length - 1;
    for (int k = 0; k < j; k++) {
      if ((Character.isLowerCase(arrayOfChar[k])) && ((k == 0) || (arrayOfChar[(k - 1)] == ' ')))
      {
        arrayOfChar[k] = Character.toUpperCase(arrayOfChar[k]);
        i = 1;
      }
    }
    if (i != 0) {
      str = new String(arrayOfChar);
    }
    str = str.replaceAll(" Usb ", " USB ");
    str = str.replaceAll(" Api ", " API ");
    
    return str;
  }
  
  public String installId()
  {
    return String.format("extra-%1$s-%2$s", new Object[] { getVendorId(), getPath() });
  }
  
  public String getListDescription()
  {
    String str = String.format("%1$s%2$s", new Object[] { getDisplayName(), isObsolete() ? " (Obsolete)" : "" });
    
    return str;
  }
  
  public String getShortDescription()
  {
    String str = String.format("%1$s, revision %2$d%3$s", new Object[] { getDisplayName(), Integer.valueOf(getRevision()), isObsolete() ? " (Obsolete)" : "" });
    
    return str;
  }
  
  public String getLongDescription()
  {
    String str1 = String.format("%1$s, revision %2$d%3$s\nBy %4$s", new Object[] { getDisplayName(), Integer.valueOf(getRevision()), isObsolete() ? " (Obsolete)" : "", getVendorDisplay() });
    
    String str2 = getDescription();
    if ((str2 != null) && (str2.length() > 0)) {
      str1 = str1 + '\n' + str2;
    }
    if (getMinToolsRevision() != 0) {
      str1 = str1 + String.format("\nRequires tools revision %1$d", new Object[] { Integer.valueOf(getMinToolsRevision()) });
    }
    if (getMinApiLevel() != 0) {
      str1 = str1 + String.format("\nRequires SDK Platform Android API %1$s", new Object[] { Integer.valueOf(getMinApiLevel()) });
    }
    File localFile = getLocalArchivePath();
    if (localFile != null) {
      str1 = str1 + String.format("\nLocation: %1$s", new Object[] { localFile.getAbsolutePath() });
    } else {
      str1 = str1 + String.format("\nInstall path: %1$s", new Object[] { getInstallSubFolder(null).getPath() });
    }
    return str1;
  }
  
  public File getInstallFolder(String paramString, SdkManager paramSdkManager)
  {
    LocalSdkParser localLocalSdkParser = new LocalSdkParser();
    Package[] arrayOfPackage1 = localLocalSdkParser.parseSdk(paramString, paramSdkManager, 1024, new NullTaskMonitor(new NullSdkLog()));
    for (Package localPackage : arrayOfPackage1) {
      if ((sameItemAs(localPackage)) && ((localPackage instanceof ExtraPackage)))
      {
        File localFile = ((ExtraPackage)localPackage).getLocalArchivePath();
        if (localFile != null) {
          return localFile;
        }
      }
    }
    return getInstallSubFolder(paramString);
  }
  
  private File getInstallSubFolder(String paramString)
  {
    File localFile = new File(paramString, "extras");
    
    String str1 = getVendorId();
    if ((str1 != null) && (str1.length() > 0)) {
      localFile = new File(localFile, str1);
    }
    String str2 = getPath();
    if ((str2 != null) && (str2.length() > 0)) {
      localFile = new File(localFile, str2);
    }
    return localFile;
  }
  
  public boolean sameItemAs(Package paramPackage)
  {
    if ((paramPackage instanceof ExtraPackage))
    {
      ExtraPackage localExtraPackage = (ExtraPackage)paramPackage;
      
      String[] arrayOfString1 = localExtraPackage.getOldPaths();
      int i = arrayOfString1.length;
      for (int j = -1; j < i; j++) {
        if (sameVendorAndPath(mVendorId, mPath, mVendorId, j < 0 ? mPath : arrayOfString1[j])) {
          return true;
        }
      }
      String[] arrayOfString2 = getOldPaths();
      int k = arrayOfString2.length;
      for (int m = -1; m < k; m++) {
        if (sameVendorAndPath(mVendorId, m < 0 ? mPath : arrayOfString2[m], mVendorId, mPath)) {
          return true;
        }
      }
    }
    return false;
  }
  
  private static boolean sameVendorAndPath(String paramString1, String paramString2, String paramString3, String paramString4)
  {
    if ((paramString4 != null) && (paramString2 != null) && (paramString1 != null) && 
      (paramString4.equals(paramString1 + '-' + paramString2)) && ((paramString3 == null) || (paramString3.length() == 0) || (paramString3.equals(paramString1)))) {
      return true;
    }
    if ((paramString2 != null) && (paramString4 != null) && (paramString3 != null) && 
      (paramString2.equals(paramString3 + '-' + paramString4)) && ((paramString1 == null) || (paramString1.length() == 0) || (paramString1.equals(paramString3)))) {
      return true;
    }
    if ((paramString2 != null) && (paramString2.equals(paramString4)) && (
      ((paramString1 == null) && (paramString3 == null)) || ((paramString1 != null) && (paramString1.equals(paramString3))))) {
      return true;
    }
    return false;
  }
  
  protected String comparisonKey()
  {
    String str = super.comparisonKey();
    int i = str.indexOf("|r:");
    assert (i > 0);
    str = str.substring(0, i) + "|ve:" + getVendorId() + "|pa:" + getPath() + str.substring(i);
    
    return str;
  }
  
  private File getLocalArchivePath()
  {
    Archive[] arrayOfArchive = getArchives();
    if ((arrayOfArchive.length == 1) && (arrayOfArchive[0].isLocal()))
    {
      File localFile = new File(arrayOfArchive[0].getLocalOsPath());
      if (localFile.isDirectory()) {
        return localFile;
      }
    }
    return null;
  }
  
  public int hashCode()
  {
    int i = super.hashCode();
    i = 31 * i + mMinApiLevel;
    i = 31 * i + (mPath == null ? 0 : mPath.hashCode());
    i = 31 * i + Arrays.hashCode(mProjectFiles);
    i = 31 * i + (mVendorDisplay == null ? 0 : mVendorDisplay.hashCode());
    return i;
  }
  
  public boolean equals(Object paramObject)
  {
    if (this == paramObject) {
      return true;
    }
    if (!super.equals(paramObject)) {
      return false;
    }
    if (!(paramObject instanceof ExtraPackage)) {
      return false;
    }
    ExtraPackage localExtraPackage = (ExtraPackage)paramObject;
    if (mMinApiLevel != mMinApiLevel) {
      return false;
    }
    if (mPath == null)
    {
      if (mPath != null) {
        return false;
      }
    }
    else if (!mPath.equals(mPath)) {
      return false;
    }
    if (!Arrays.equals(mProjectFiles, mProjectFiles)) {
      return false;
    }
    if (mVendorDisplay == null)
    {
      if (mVendorDisplay != null) {
        return false;
      }
    }
    else if (!mVendorDisplay.equals(mVendorDisplay)) {
      return false;
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.ExtraPackage
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

public abstract interface IDescription
{
  public abstract String getShortDescription();
  
  public abstract String getLongDescription();
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.IDescription
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

public abstract interface IExactApiLevelDependency
{
  public static final int API_LEVEL_INVALID = 0;
  
  public abstract int getExactApiLevel();
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.IExactApiLevelDependency
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

import com.android.util.Pair;

public abstract interface ILayoutlibVersion
{
  public static final int LAYOUTLIB_API_NOT_SPECIFIED = 0;
  public static final int LAYOUTLIB_REV_NOT_SPECIFIED = 0;
  
  public abstract Pair<Integer, Integer> getLayoutlibVersion();
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.ILayoutlibVersion
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

public abstract interface IMinApiLevelDependency
{
  public static final int MIN_API_LEVEL_NOT_SPECIFIED = 0;
  
  public abstract int getMinApiLevel();
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.IMinApiLevelDependency
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

public abstract interface IMinPlatformToolsDependency
{
  public static final int MIN_PLATFORM_TOOLS_REV_INVALID = 0;
  
  public abstract int getMinPlatformToolsRevision();
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.IMinPlatformToolsDependency
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

public abstract interface IMinToolsDependency
{
  public static final int MIN_TOOLS_REV_NOT_SPECIFIED = 0;
  
  public abstract int getMinToolsRevision();
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.IMinToolsDependency
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

import com.android.sdklib.AndroidVersion;

public abstract interface IPackageVersion
{
  public abstract AndroidVersion getVersion();
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.IPackageVersion
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

import com.android.sdklib.AndroidVersion;

public abstract interface IPlatformDependency
{
  public abstract AndroidVersion getVersion();
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.IPlatformDependency
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

public abstract interface ITask
{
  public abstract void run(ITaskMonitor paramITaskMonitor);
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.ITask
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

public abstract interface ITaskFactory
{
  public abstract void start(String paramString, ITask paramITask);
  
  public abstract void start(String paramString, ITaskMonitor paramITaskMonitor, ITask paramITask);
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.ITaskFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.internal.repository;

import com.android.sdklib.ISdkLog;

public abstract interface ITaskMonitor
  extends ISdkLog
{
  public abstract void setDescription(String paramString, Object... paramVarArgs);
  
  public abstract void log(String paramString, Object... paramVarArgs);
  
  public abstract void logError(String paramString, Object... paramVarArgs);
  
  public abstract void logVerbose(String paramString, Object... paramVarArgs);
  
  public abstract void setProgressMax(int paramInt);
  
  public abstract int getProgressMax();
  
  public abstract void incProgress(int paramInt);
  
  public abstract int getProgress();
  
  public abstract boolean isCancelRequested();
  
  public abstract ITaskMonitor createSubMonitor(int paramInt);
  
  public abstract boolean displayPrompt(String paramString1, String paramString2);
  
  public abstract UserCredentials displayLoginCredentialsPrompt(String paramString1, String paramString2);
}

/* Location:
 * Qualified Name:     com.android.sdklib.internal.repository.ITaskMonit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd