com.crashlytics.tools.android_2.1.0

MANAGE_SPACE_ACTIVITY = "manageSpaceActivity";
  public static final String ATTRIBUTE_EXPORTED = "exported";
  public static final String ATTRIBUTE_RESIZEABLE = "resizeable";
  public static final String ATTRIBUTE_ANYDENSITY = "anyDensity";
  public static final String ATTRIBUTE_SMALLSCREENS = "smallScreens";
  public static final String ATTRIBUTE_NORMALSCREENS = "normalScreens";
  public static final String ATTRIBUTE_LARGESCREENS = "largeScreens";
  public static final String ATTRIBUTE_REQ_5WAYNAV = "reqFiveWayNav";
  public static final String ATTRIBUTE_REQ_NAVIGATION = "reqNavigation";
  public static final String ATTRIBUTE_REQ_HARDKEYBOARD = "reqHardKeyboard";
  public static final String ATTRIBUTE_REQ_KEYBOARDTYPE = "reqKeyboardType";
  public static final String ATTRIBUTE_REQ_TOUCHSCREEN = "reqTouchScreen";
  public static final String ATTRIBUTE_THEME = "theme";
  
  public static IAbstractFile getManifest(IAbstractFolder paramIAbstractFolder)
  {
    IAbstractFile localIAbstractFile = paramIAbstractFolder.getFile("AndroidManifest.xml");
    if (localIAbstractFile.exists()) {
      return localIAbstractFile;
    }
    return null;
  }
  
  public static String getPackage(IAbstractFolder paramIAbstractFolder)
    throws XPathExpressionException, StreamException
  {
    IAbstractFile localIAbstractFile = getManifest(paramIAbstractFolder);
    if (localIAbstractFile != null) {
      return getPackage(localIAbstractFile);
    }
    return null;
  }
  
  public static String getPackage(IAbstractFile paramIAbstractFile)
    throws XPathExpressionException, StreamException
  {
    XPath localXPath = AndroidXPathFactory.newXPath();
    
    return localXPath.evaluate("/manifest/@package", new InputSource(paramIAbstractFile.getContents()));
  }
  
  public static boolean getDebuggable(IAbstractFile paramIAbstractFile)
    throws XPathExpressionException, StreamException
  {
    XPath localXPath = AndroidXPathFactory.newXPath();
    
    String str = localXPath.evaluate("/manifest/application/@android:debuggable", new InputSource(paramIAbstractFile.getContents()));
    
    return Boolean.parseBoolean(str);
  }
  
  public static int getVersionCode(IAbstractFile paramIAbstractFile)
    throws XPathExpressionException, StreamException
  {
    XPath localXPath = AndroidXPathFactory.newXPath();
    
    String str = localXPath.evaluate("/manifest/@android:versionCode", new InputSource(paramIAbstractFile.getContents()));
    try
    {
      return Integer.parseInt(str);
    }
    catch (NumberFormatException localNumberFormatException) {}
    return -1;
  }
  
  public static boolean hasVersionCode(IAbstractFile paramIAbstractFile)
    throws XPathExpressionException, StreamException
  {
    XPath localXPath = AndroidXPathFactory.newXPath();
    
    Object localObject = localXPath.evaluate("/manifest/@android:versionCode", new InputSource(paramIAbstractFile.getContents()), XPathConstants.NODE);
    if (localObject != null)
    {
      Node localNode = (Node)localObject;
      if (localNode.getNodeValue().length() > 0) {
        return true;
      }
    }
    return false;
  }
  
  public static Object getMinSdkVersion(IAbstractFile paramIAbstractFile)
    throws XPathExpressionException, StreamException
  {
    XPath localXPath = AndroidXPathFactory.newXPath();
    
    String str = localXPath.evaluate("/manifest/uses-sdk/@android:minSdkVersion", new InputSource(paramIAbstractFile.getContents()));
    try
    {
      return Integer.valueOf(str);
    }
    catch (NumberFormatException localNumberFormatException)
    {
      if (str.length() > 0) {
        tmpTernaryOp = str;
      }
    }
    return null;
  }
  
  public static Integer getTargetSdkVersion(IAbstractFile paramIAbstractFile)
    throws XPathExpressionException, StreamException
  {
    XPath localXPath = AndroidXPathFactory.newXPath();
    
    String str = localXPath.evaluate("/manifest/uses-sdk/@android:targetSdkVersion", new InputSource(paramIAbstractFile.getContents()));
    try
    {
      return Integer.valueOf(str);
    }
    catch (NumberFormatException localNumberFormatException)
    {
      if (str.length() > 0) {
        tmpTernaryOp = Integer.valueOf(-1);
      }
    }
    return null;
  }
  
  public static String getApplicationIcon(IAbstractFile paramIAbstractFile)
    throws XPathExpressionException, StreamException
  {
    XPath localXPath = AndroidXPathFactory.newXPath();
    
    return localXPath.evaluate("/manifest/application/@android:icon", new InputSource(paramIAbstractFile.getContents()));
  }
  
  public static String getApplicationLabel(IAbstractFile paramIAbstractFile)
    throws XPathExpressionException, StreamException
  {
    XPath localXPath = AndroidXPathFactory.newXPath();
    
    return localXPath.evaluate("/manifest/application/@android:label", new InputSource(paramIAbstractFile.getContents()));
  }
  
  public static String combinePackageAndClassName(String paramString1, String paramString2)
  {
    if ((paramString2 == null) || (paramString2.length() == 0)) {
      return paramString1;
    }
    if ((paramString1 == null) || (paramString1.length() == 0)) {
      return paramString2;
    }
    int i = paramString2.charAt(0) == '.' ? 1 : 0;
    int j = paramString2.indexOf('.') != -1 ? 1 : 0;
    if ((i != 0) || (j == 0))
    {
      if (i != 0) {
        return paramString1 + paramString2;
      }
      return paramString1 + '.' + paramString2;
    }
    return paramString2;
  }
  
  public static String extractActivityName(String paramString1, String paramString2)
  {
    if ((paramString2 != null) && (paramString1 != null) && 
      (paramString2.length() > 0) && (paramString1.startsWith(paramString2)))
    {
      String str = paramString1.substring(paramString2.length());
      if ((str.length() > 0) && (str.charAt(0) == '.')) {
        return str;
      }
    }
    return paramString1;
  }
}

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

import org.xml.sax.ErrorHandler;
import org.xml.sax.Locator;

public abstract interface AndroidManifestParser$ManifestErrorHandler
  extends ErrorHandler
{
  public abstract void handleError(Exception paramException, int paramInt);
  
  public abstract void checkClass(Locator paramLocator, String paramString1, String paramString2, boolean paramBoolean);
}

/* Location:
 * Qualified Name:     com.android.sdklib.xml.AndroidManifestParser.ManifestErrorHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.xml;

import com.android.io.IAbstractFile;
import com.android.resources.Keyboard;
import com.android.resources.Navigation;
import com.android.resources.TouchScreen;
import java.util.ArrayList;
import java.util.Locale;
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;

class AndroidManifestParser$ManifestHandler
  extends DefaultHandler
{
  private final ManifestData mManifestData;
  private final AndroidManifestParser.ManifestErrorHandler mErrorHandler;
  private int mCurrentLevel = 0;
  private int mValidLevel = 0;
  private ManifestData.Activity mCurrentActivity = null;
  private Locator mLocator;
  
  AndroidManifestParser$ManifestHandler(IAbstractFile paramIAbstractFile, ManifestData paramManifestData, AndroidManifestParser.ManifestErrorHandler paramManifestErrorHandler)
  {
    mManifestData = paramManifestData;
    mErrorHandler = paramManifestErrorHandler;
  }
  
  public void setDocumentLocator(Locator paramLocator)
  {
    mLocator = paramLocator;
    super.setDocumentLocator(paramLocator);
  }
  
  public void startElement(String paramString1, String paramString2, String paramString3, Attributes paramAttributes)
    throws SAXException
  {
    try
    {
      if (mManifestData == null) {
        return;
      }
      if (mValidLevel == mCurrentLevel)
      {
        Object localObject1;
        String str;
        switch (mValidLevel)
        {
        case 0: 
          if ("manifest".equals(paramString2))
          {
            mManifestData.mPackage = getAttributeValue(paramAttributes, "package", false);
            
            localObject1 = getAttributeValue(paramAttributes, "versionCode", true);
            if (localObject1 != null) {
              try
              {
                mManifestData.mVersionCode = Integer.valueOf((String)localObject1);
              }
              catch (NumberFormatException localNumberFormatException1) {}
            }
            mValidLevel += 1;
          }
          break;
        case 1: 
          if ("application".equals(paramString2))
          {
            str = getAttributeValue(paramAttributes, "process", true);
            if (str != null) {
              mManifestData.addProcessName(str);
            }
            str = getAttributeValue(paramAttributes, "debuggable", true);
            if (str != null) {
              mManifestData.mDebuggable = Boolean.valueOf(Boolean.parseBoolean(str));
            }
            mValidLevel += 1;
          }
          else if ("uses-sdk".equals(paramString2))
          {
            mManifestData.setMinSdkVersionString(getAttributeValue(paramAttributes, "minSdkVersion", true));
            
            mManifestData.setTargetSdkVersionString(getAttributeValue(paramAttributes, "targetSdkVersion", true));
          }
          else if ("instrumentation".equals(paramString2))
          {
            processInstrumentationNode(paramAttributes);
          }
          else if ("supports-screens".equals(paramString2))
          {
            processSupportsScreensNode(paramAttributes);
          }
          else if ("uses-configuration".equals(paramString2))
          {
            processUsesConfiguration(paramAttributes);
          }
          else if ("uses-feature".equals(paramString2))
          {
            localObject1 = new ManifestData.UsesFeature();
            
            str = getAttributeValue(paramAttributes, "name", true);
            if (str != null) {
              mName = str;
            }
            str = getAttributeValue(paramAttributes, "required", true);
            if (str != null)
            {
              Boolean localBoolean1 = Boolean.valueOf(str);
              if (localBoolean1 != null) {
                mRequired = localBoolean1;
              }
            }
            str = getAttributeValue(paramAttributes, "glEsVersion", true);
            if (str != null) {
              try
              {
                int i = Integer.decode(str).intValue();
                mGlEsVersion = i;
              }
              catch (NumberFormatException localNumberFormatException2) {}
            }
            mManifestData.mFeatures.add(localObject1);
          }
          break;
        case 2: 
          if ("activity".equals(paramString2))
          {
            processActivityNode(paramAttributes);
            mValidLevel += 1;
          }
          else if ("service".equals(paramString2))
          {
            processNode(paramAttributes, "android.app.Service");
            mValidLevel += 1;
          }
          else if ("receiver".equals(paramString2))
          {
            processNode(paramAttributes, "android.content.BroadcastReceiver");
            mValidLevel += 1;
          }
          else if ("provider".equals(paramString2))
          {
            processNode(paramAttributes, "android.content.ContentProvider");
            mValidLevel += 1;
          }
          else if ("uses-library".equals(paramString2))
          {
            str = getAttributeValue(paramAttributes, "name", true);
            if (str != null)
            {
              localObject1 = new ManifestData.UsesLibrary();
              mName = str;
              
              str = getAttributeValue(paramAttributes, "required", true);
              if (str != null)
              {
                Boolean localBoolean2 = Boolean.valueOf(str);
                if (localBoolean2 != null) {
                  mRequired = localBoolean2;
                }
              }
              mManifestData.mLibraries.add(localObject1);
            }
          }
          break;
        case 3: 
          if ((mCurrentActivity != null) && ("intent-filter".equals(paramString2)))
          {
            mCurrentActivity.resetIntentFilter();
            mValidLevel += 1;
          }
          break;
        case 4: 
          if (mCurrentActivity != null) {
            if ("action".equals(paramString2))
            {
              localObject1 = getAttributeValue(paramAttributes, "name", true);
              if (localObject1 != null)
              {
                mCurrentActivity.setHasAction(true);
                mCurrentActivity.setHasMainAction("android.intent.action.MAIN".equals(localObject1));
              }
            }
            else if ("category".equals(paramString2))
            {
              localObject1 = getAttributeValue(paramAttributes, "name", true);
              if ("android.intent.category.LAUNCHER".equals(localObject1)) {
                mCurrentActivity.setHasLauncherCategory(true);
              }
            }
          }
          break;
        }
      }
      mCurrentLevel += 1;
    }
    finally
    {
      super.startElement(paramString1, paramString2, paramString3, paramAttributes);
    }
  }
  
  public void endElement(String paramString1, String paramString2, String paramString3)
    throws SAXException
  {
    try
    {
      if (mManifestData == null) {
        return;
      }
      if (mValidLevel == mCurrentLevel) {
        mValidLevel -= 1;
      }
      mCurrentLevel -= 1;
      if (mValidLevel == mCurrentLevel) {
        switch (mValidLevel)
        {
        case 2: 
          mCurrentActivity = null;
          break;
        case 3: 
          if ((mManifestData.mLauncherActivity == null) && (mCurrentActivity != null) && (mCurrentActivity.isHomeActivity()) && (mCurrentActivity.isExported())) {
            mManifestData.mLauncherActivity = mCurrentActivity;
          }
          break;
        }
      }
    }
    finally
    {
      super.endElement(paramString1, paramString2, paramString3);
    }
  }
  
  public void error(SAXParseException paramSAXParseException)
  {
    if (mErrorHandler != null) {
      mErrorHandler.handleError(paramSAXParseException, paramSAXParseException.getLineNumber());
    }
  }
  
  public void fatalError(SAXParseException paramSAXParseException)
  {
    if (mErrorHandler != null) {
      mErrorHandler.handleError(paramSAXParseException, paramSAXParseException.getLineNumber());
    }
  }
  
  public void warning(SAXParseException paramSAXParseException)
    throws SAXException
  {
    if (mErrorHandler != null) {
      mErrorHandler.warning(paramSAXParseException);
    }
  }
  
  private void processActivityNode(Attributes paramAttributes)
  {
    String str1 = getAttributeValue(paramAttributes, "name", true);
    if (str1 != null)
    {
      str1 = AndroidManifest.combinePackageAndClassName(mManifestData.mPackage, str1);
      
      str2 = getAttributeValue(paramAttributes, "exported", true);
      
      boolean bool = (str2 == null) || (str2.toLowerCase(Locale.US).equals("true"));
      
      mCurrentActivity = new ManifestData.Activity(str1, bool);
      mManifestData.mActivities.add(mCurrentActivity);
      if (mErrorHandler != null) {
        mErrorHandler.checkClass(mLocator, str1, "android.app.Activity", true);
      }
    }
    else
    {
      mCurrentActivity = null;
    }
    String str2 = getAttributeValue(paramAttributes, "process", true);
    if (str2 != null) {
      mManifestData.addProcessName(str2);
    }
  }
  
  private void processNode(Attributes paramAttributes, String paramString)
  {
    String str1 = getAttributeValue(paramAttributes, "name", true);
    if (str1 != null)
    {
      str1 = AndroidManifest.combinePackageAndClassName(mManifestData.mPackage, str1);
      if (mErrorHandler != null) {
        mErrorHandler.checkClass(mLocator, str1, paramString, false);
      }
    }
    String str2 = getAttributeValue(paramAttributes, "process", true);
    if (str2 != null) {
      mManifestData.addProcessName(str2);
    }
  }
  
  private void processInstrumentationNode(Attributes paramAttributes)
  {
    String str1 = getAttributeValue(paramAttributes, "name", true);
    if (str1 != null)
    {
      String str2 = AndroidManifest.combinePackageAndClassName(mManifestData.mPackage, str1);
      
      String str3 = getAttributeValue(paramAttributes, "targetPackage", true);
      
      mManifestData.mInstrumentations.add(new ManifestData.Instrumentation(str2, str3));
      if (mErrorHandler != null) {
        mErrorHandler.checkClass(mLocator, str2, "android.app.Instrumentation", true);
      }
    }
  }
  
  private void processSupportsScreensNode(Attributes paramAttributes)
  {
    mManifestData.mSupportsScreensFromManifest = new ManifestData.SupportsScreens();
    
    mManifestData.mSupportsScreensFromManifest.setResizeable(getAttributeBooleanValue(paramAttributes, "resizeable", true));
    
    mManifestData.mSupportsScreensFromManifest.setAnyDensity(getAttributeBooleanValue(paramAttributes, "anyDensity", true));
    
    mManifestData.mSupportsScreensFromManifest.setSmallScreens(getAttributeBooleanValue(paramAttributes, "smallScreens", true));
    
    mManifestData.mSupportsScreensFromManifest.setNormalScreens(getAttributeBooleanValue(paramAttributes, "normalScreens", true));
    
    mManifestData.mSupportsScreensFromManifest.setLargeScreens(getAttributeBooleanValue(paramAttributes, "largeScreens", true));
  }
  
  private void processUsesConfiguration(Attributes paramAttributes)
  {
    mManifestData.mUsesConfiguration = new ManifestData.UsesConfiguration();
    
    mManifestData.mUsesConfiguration.mReqFiveWayNav = getAttributeBooleanValue(paramAttributes, "reqFiveWayNav", true);
    
    mManifestData.mUsesConfiguration.mReqNavigation = Navigation.getEnum(getAttributeValue(paramAttributes, "reqNavigation", true));
    
    mManifestData.mUsesConfiguration.mReqHardKeyboard = getAttributeBooleanValue(paramAttributes, "reqHardKeyboard", true);
    
    mManifestData.mUsesConfiguration.mReqKeyboardType = Keyboard.getEnum(getAttributeValue(paramAttributes, "reqKeyboardType", true));
    
    mManifestData.mUsesConfiguration.mReqTouchScreen = TouchScreen.getEnum(getAttributeValue(paramAttributes, "reqTouchScreen", true));
  }
  
  private String getAttributeValue(Attributes paramAttributes, String paramString, boolean paramBoolean)
  {
    int i = paramAttributes.getLength();
    for (int j = 0; j < i; j++) {
      if ((paramString.equals(paramAttributes.getLocalName(j))) && (((paramBoolean) && ("http://schemas.android.com/apk/res/android".equals(paramAttributes.getURI(j)))) || ((!paramBoolean) && (paramAttributes.getURI(j).length() == 0)))) {
        return paramAttributes.getValue(j);
      }
    }
    return null;
  }
  
  private Boolean getAttributeBooleanValue(Attributes paramAttributes, String paramString, boolean paramBoolean)
  {
    int i = paramAttributes.getLength();
    for (int j = 0; j < i; j++) {
      if ((paramString.equals(paramAttributes.getLocalName(j))) && (((paramBoolean) && ("http://schemas.android.com/apk/res/android".equals(paramAttributes.getURI(j)))) || ((!paramBoolean) && (paramAttributes.getURI(j).length() == 0))))
      {
        String str = paramAttributes.getValue(j);
        if (str != null) {
          return Boolean.valueOf(str);
        }
        return null;
      }
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     com.android.sdklib.xml.AndroidManifestParser.ManifestHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.xml;

import com.android.io.IAbstractFile;
import com.android.io.IAbstractFolder;
import com.android.io.StreamException;
import com.android.resources.Keyboard;
import com.android.resources.Navigation;
import com.android.resources.TouchScreen;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Locale;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;

public class AndroidManifestParser
{
  private static final int LEVEL_TOP = 0;
  private static final int LEVEL_INSIDE_MANIFEST = 1;
  private static final int LEVEL_INSIDE_APPLICATION = 2;
  private static final int LEVEL_INSIDE_APP_COMPONENT = 3;
  private static final int LEVEL_INSIDE_INTENT_FILTER = 4;
  private static final String ACTION_MAIN = "android.intent.action.MAIN";
  private static final String CATEGORY_LAUNCHER = "android.intent.category.LAUNCHER";
  
  private static class ManifestHandler
    extends DefaultHandler
  {
    private final ManifestData mManifestData;
    private final AndroidManifestParser.ManifestErrorHandler mErrorHandler;
    private int mCurrentLevel = 0;
    private int mValidLevel = 0;
    private ManifestData.Activity mCurrentActivity = null;
    private Locator mLocator;
    
    ManifestHandler(IAbstractFile paramIAbstractFile, ManifestData paramManifestData, AndroidManifestParser.ManifestErrorHandler paramManifestErrorHandler)
    {
      mManifestData = paramManifestData;
      mErrorHandler = paramManifestErrorHandler;
    }
    
    public void setDocumentLocator(Locator paramLocator)
    {
      mLocator = paramLocator;
      super.setDocumentLocator(paramLocator);
    }
    
    public void startElement(String paramString1, String paramString2, String paramString3, Attributes paramAttributes)
      throws SAXException
    {
      try
      {
        if (mManifestData == null) {
          return;
        }
        if (mValidLevel == mCurrentLevel)
        {
          Object localObject1;
          String str;
          switch (mValidLevel)
          {
          case 0: 
            if ("manifest".equals(paramString2))
            {
              mManifestData.mPackage = getAttributeValue(paramAttributes, "package", false);
              
              localObject1 = getAttributeValue(paramAttributes, "versionCode", true);
              if (localObject1 != null) {
                try
                {
                  mManifestData.mVersionCode = Integer.valueOf((String)localObject1);
                }
                catch (NumberFormatException localNumberFormatException1) {}
              }
              mValidLevel += 1;
            }
            break;
          case 1: 
            if ("application".equals(paramString2))
            {
              str = getAttributeValue(paramAttributes, "process", true);
              if (str != null) {
                mManifestData.addProcessName(str);
              }
              str = getAttributeValue(paramAttributes, "debuggable", true);
              if (str != null) {
                mManifestData.mDebuggable = Boolean.valueOf(Boolean.parseBoolean(str));
              }
              mValidLevel += 1;
            }
            else if ("uses-sdk".equals(paramString2))
            {
              mManifestData.setMinSdkVersionString(getAttributeValue(paramAttributes, "minSdkVersion", true));
              
              mManifestData.setTargetSdkVersionString(getAttributeValue(paramAttributes, "targetSdkVersion", true));
            }
            else if ("instrumentation".equals(paramString2))
            {
              processInstrumentationNode(paramAttributes);
            }
            else if ("supports-screens".equals(paramString2))
            {
              processSupportsScreensNode(paramAttributes);
            }
            else if ("uses-configuration".equals(paramString2))
            {
              processUsesConfiguration(paramAttributes);
            }
            else if ("uses-feature".equals(paramString2))
            {
              localObject1 = new ManifestData.UsesFeature();
              
              str = getAttributeValue(paramAttributes, "name", true);
              if (str != null) {
                mName = str;
              }
              str = getAttributeValue(paramAttributes, "required", true);
              if (str != null)
              {
                Boolean localBoolean1 = Boolean.valueOf(str);
                if (localBoolean1 != null) {
                  mRequired = localBoolean1;
                }
              }
              str = getAttributeValue(paramAttributes, "glEsVersion", true);
              if (str != null) {
                try
                {
                  int i = Integer.decode(str).intValue();
                  mGlEsVersion = i;
                }
                catch (NumberFormatException localNumberFormatException2) {}
              }
              mManifestData.mFeatures.add(localObject1);
            }
            break;
          case 2: 
            if ("activity".equals(paramString2))
            {
              processActivityNode(paramAttributes);
              mValidLevel += 1;
            }
            else if ("service".equals(paramString2))
            {
              processNode(paramAttributes, "android.app.Service");
              mValidLevel += 1;
            }
            else if ("receiver".equals(paramString2))
            {
              processNode(paramAttributes, "android.content.BroadcastReceiver");
              mValidLevel += 1;
            }
            else if ("provider".equals(paramString2))
            {
              processNode(paramAttributes, "android.content.ContentProvider");
              mValidLevel += 1;
            }
            else if ("uses-library".equals(paramString2))
            {
              str = getAttributeValue(paramAttributes, "name", true);
              if (str != null)
              {
                localObject1 = new ManifestData.UsesLibrary();
                mName = str;
                
                str = getAttributeValue(paramAttributes, "required", true);
                if (str != null)
                {
                  Boolean localBoolean2 = Boolean.valueOf(str);
                  if (localBoolean2 != null) {
                    mRequired = localBoolean2;
                  }
                }
                mManifestData.mLibraries.add(localObject1);
              }
            }
            break;
          case 3: 
            if ((mCurrentActivity != null) && ("intent-filter".equals(paramString2)))
            {
              mCurrentActivity.resetIntentFilter();
              mValidLevel += 1;
            }
            break;
          case 4: 
            if (mCurrentActivity != null) {
              if ("action".equals(paramString2))
              {
                localObject1 = getAttributeValue(paramAttributes, "name", true);
                if (localObject1 != null)
                {
                  mCurrentActivity.setHasAction(true);
                  mCurrentActivity.setHasMainAction("android.intent.action.MAIN".equals(localObject1));
                }
              }
              else if ("category".equals(paramString2))
              {
                localObject1 = getAttributeValue(paramAttributes, "name", true);
                if ("android.intent.category.LAUNCHER".equals(localObject1)) {
                  mCurrentActivity.setHasLauncherCategory(true);
                }
              }
            }
            break;
          }
        }
        mCurrentLevel += 1;
      }
      finally
      {
        super.startElement(paramString1, paramString2, paramString3, paramAttributes);
      }
    }
    
    public void endElement(String paramString1, String paramString2, String paramString3)
      throws SAXException
    {
      try
      {
        if (mManifestData == null) {
          return;
        }
        if (mValidLevel == mCurrentLevel) {
          mValidLevel -= 1;
        }
        mCurrentLevel -= 1;
        if (mValidLevel == mCurrentLevel) {
          switch (mValidLevel)
          {
          case 2: 
            mCurrentActivity = null;
            break;
          case 3: 
            if ((mManifestData.mLauncherActivity == null) && (mCurrentActivity != null) && (mCurrentActivity.isHomeActivity()) && (mCurrentActivity.isExported())) {
              mManifestData.mLauncherActivity = mCurrentActivity;
            }
            break;
          }
        }
      }
      finally
      {
        super.endElement(paramString1, paramString2, paramString3);
      }
    }
    
    public void error(SAXParseException paramSAXParseException)
    {
      if (mErrorHandler != null) {
        mErrorHandler.handleError(paramSAXParseException, paramSAXParseException.getLineNumber());
      }
    }
    
    public void fatalError(SAXParseException paramSAXParseException)
    {
      if (mErrorHandler != null) {
        mErrorHandler.handleError(paramSAXParseException, paramSAXParseException.getLineNumber());
      }
    }
    
    public void warning(SAXParseException paramSAXParseException)
      throws SAXException
    {
      if (mErrorHandler != null) {
        mErrorHandler.warning(paramSAXParseException);
      }
    }
    
    private void processActivityNode(Attributes paramAttributes)
    {
      String str1 = getAttributeValue(paramAttributes, "name", true);
      if (str1 != null)
      {
        str1 = AndroidManifest.combinePackageAndClassName(mManifestData.mPackage, str1);
        
        str2 = getAttributeValue(paramAttributes, "exported", true);
        
        boolean bool = (str2 == null) || (str2.toLowerCase(Locale.US).equals("true"));
        
        mCurrentActivity = new ManifestData.Activity(str1, bool);
        mManifestData.mActivities.add(mCurrentActivity);
        if (mErrorHandler != null) {
          mErrorHandler.checkClass(mLocator, str1, "android.app.Activity", true);
        }
      }
      else
      {
        mCurrentActivity = null;
      }
      String str2 = getAttributeValue(paramAttributes, "process", true);
      if (str2 != null) {
        mManifestData.addProcessName(str2);
      }
    }
    
    private void processNode(Attributes paramAttributes, String paramString)
    {
      String str1 = getAttributeValue(paramAttributes, "name", true);
      if (str1 != null)
      {
        str1 = AndroidManifest.combinePackageAndClassName(mManifestData.mPackage, str1);
        if (mErrorHandler != null) {
          mErrorHandler.checkClass(mLocator, str1, paramString, false);
        }
      }
      String str2 = getAttributeValue(paramAttributes, "process", true);
      if (str2 != null) {
        mManifestData.addProcessName(str2);
      }
    }
    
    private void processInstrumentationNode(Attributes paramAttributes)
    {
      String str1 = getAttributeValue(paramAttributes, "name", true);
      if (str1 != null)
      {
        String str2 = AndroidManifest.combinePackageAndClassName(mManifestData.mPackage, str1);
        
        String str3 = getAttributeValue(paramAttributes, "targetPackage", true);
        
        mManifestData.mInstrumentations.add(new ManifestData.Instrumentation(str2, str3));
        if (mErrorHandler != null) {
          mErrorHandler.checkClass(mLocator, str2, "android.app.Instrumentation", true);
        }
      }
    }
    
    private void processSupportsScreensNode(Attributes paramAttributes)
    {
      mManifestData.mSupportsScreensFromManifest = new ManifestData.SupportsScreens();
      
      mManifestData.mSupportsScreensFromManifest.setResizeable(getAttributeBooleanValue(paramAttributes, "resizeable", true));
      
      mManifestData.mSupportsScreensFromManifest.setAnyDensity(getAttributeBooleanValue(paramAttributes, "anyDensity", true));
      
      mManifestData.mSupportsScreensFromManifest.setSmallScreens(getAttributeBooleanValue(paramAttributes, "smallScreens", true));
      
      mManifestData.mSupportsScreensFromManifest.setNormalScreens(getAttributeBooleanValue(paramAttributes, "normalScreens", true));
      
      mManifestData.mSupportsScreensFromManifest.setLargeScreens(getAttributeBooleanValue(paramAttributes, "largeScreens", true));
    }
    
    private void processUsesConfiguration(Attributes paramAttributes)
    {
      mManifestData.mUsesConfiguration = new ManifestData.UsesConfiguration();
      
      mManifestData.mUsesConfiguration.mReqFiveWayNav = getAttributeBooleanValue(paramAttributes, "reqFiveWayNav", true);
      
      mManifestData.mUsesConfiguration.mReqNavigation = Navigation.getEnum(getAttributeValue(paramAttributes, "reqNavigation", true));
      
      mManifestData.mUsesConfiguration.mReqHardKeyboard = getAttributeBooleanValue(paramAttributes, "reqHardKeyboard", true);
      
      mManifestData.mUsesConfiguration.mReqKeyboardType = Keyboard.getEnum(getAttributeValue(paramAttributes, "reqKeyboardType", true));
      
      mManifestData.mUsesConfiguration.mReqTouchScreen = TouchScreen.getEnum(getAttributeValue(paramAttributes, "reqTouchScreen", true));
    }
    
    private String getAttributeValue(Attributes paramAttributes, String paramString, boolean paramBoolean)
    {
      int i = paramAttributes.getLength();
      for (int j = 0; j < i; j++) {
        if ((paramString.equals(paramAttributes.getLocalName(j))) && (((paramBoolean) && ("http://schemas.android.com/apk/res/android".equals(paramAttributes.getURI(j)))) || ((!paramBoolean) && (paramAttributes.getURI(j).length() == 0)))) {
          return paramAttributes.getValue(j);
        }
      }
      return null;
    }
    
    private Boolean getAttributeBooleanValue(Attributes paramAttributes, String paramString, boolean paramBoolean)
    {
      int i = paramAttributes.getLength();
      for (int j = 0; j < i; j++) {
        if ((paramString.equals(paramAttributes.getLocalName(j))) && (((paramBoolean) && ("http://schemas.android.com/apk/res/android".equals(paramAttributes.getURI(j)))) || ((!paramBoolean) && (paramAttributes.getURI(j).length() == 0))))
        {
          String str = paramAttributes.getValue(j);
          if (str != null) {
            return Boolean.valueOf(str);
          }
          return null;
        }
      }
      return null;
    }
  }
  
  private static final SAXParserFactory sParserFactory = ;
  
  static
  {
    sParserFactory.setNamespaceAware(true);
  }
  
  public static ManifestData parse(IAbstractFile paramIAbstractFile, boolean paramBoolean, ManifestErrorHandler paramManifestErrorHandler)
    throws SAXException, IOException, StreamException, ParserConfigurationException
  {
    if (paramIAbstractFile != null)
    {
      SAXParser localSAXParser = sParserFactory.newSAXParser();
      
      ManifestData localManifestData = null;
      if (paramBoolean) {
        localManifestData = new ManifestData();
      }
      ManifestHandler localManifestHandler = new ManifestHandler(paramIAbstractFile, localManifestData, paramManifestErrorHandler);
      
      localSAXParser.parse(new InputSource(paramIAbstractFile.getContents()), localManifestHandler);
      
      return localManifestData;
    }
    return null;
  }
  
  public static ManifestData parse(IAbstractFile paramIAbstractFile)
    throws SAXException, IOException, StreamException, ParserConfigurationException
  {
    return parse(paramIAbstractFile, true, null);
  }
  
  public static ManifestData parse(IAbstractFolder paramIAbstractFolder)
    throws SAXException, IOException, StreamException, ParserConfigurationException
  {
    IAbstractFile localIAbstractFile = AndroidManifest.getManifest(paramIAbstractFolder);
    if (localIAbstractFile == null) {
      throw new FileNotFoundException();
    }
    return parse(localIAbstractFile, true, null);
  }
  
  public static ManifestData parse(InputStream paramInputStream)
    throws SAXException, IOException, StreamException, ParserConfigurationException
  {
    if (paramInputStream != null)
    {
      SAXParser localSAXParser = sParserFactory.newSAXParser();
      
      ManifestData localManifestData = new ManifestData();
      
      ManifestHandler localManifestHandler = new ManifestHandler(null, localManifestData, null);
      localSAXParser.parse(new InputSource(paramInputStream), localManifestHandler);
      
      return localManifestData;
    }
    return null;
  }
  
  public static abstract interface ManifestErrorHandler
    extends ErrorHandler
  {
    public abstract void handleError(Exception paramException, int paramInt);
    
    public abstract void checkClass(Locator paramLocator, String paramString1, String paramString2, boolean paramBoolean);
  }
}

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

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.xml.namespace.NamespaceContext;

class AndroidXPathFactory$AndroidNamespaceContext
  implements NamespaceContext
{
  private static final AndroidNamespaceContext sThis = new AndroidNamespaceContext("android");
  private final String mAndroidPrefix;
  private final List<String> mAndroidPrefixes = new ArrayList();
  
  private static AndroidNamespaceContext getDefault()
  {
    return sThis;
  }
  
  public AndroidXPathFactory$AndroidNamespaceContext(String paramString)
  {
    mAndroidPrefix = paramString;
    mAndroidPrefixes.add(mAndroidPrefix);
  }
  
  public String getNamespaceURI(String paramString)
  {
    if ((paramString != null) && 
      (paramString.equals(mAndroidPrefix))) {
      return "http://schemas.android.com/apk/res/android";
    }
    return "";
  }
  
  public String getPrefix(String paramString)
  {
    if ("http://schemas.android.com/apk/res/android".equals(paramString)) {
      return mAndroidPrefix;
    }
    return null;
  }
  
  public Iterator<?> getPrefixes(String paramString)
  {
    if ("http://schemas.android.com/apk/res/android".equals(paramString)) {
      return mAndroidPrefixes.iterator();
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     com.android.sdklib.xml.AndroidXPathFactory.AndroidNamespaceContext
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.android.sdklib.xml;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.xml.namespace.NamespaceContext;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathFactory;

public class AndroidXPathFactory
{
  public static final String DEFAULT_NS_PREFIX = "android";
  private static final XPathFactory sFactory = ;
  
  private static class AndroidNamespaceContext
    implements NamespaceContext
  {
    private static final AndroidNamespaceContext sThis = new AndroidNamespaceContext("android");
    private final String mAndroidPrefix;
    private final List<String> mAndroidPrefixes = new ArrayList();
    
    private static AndroidNamespaceContext getDefault()
    {
      return sThis;
    }
    
    public AndroidNamespaceContext(String paramString)
    {
      mAndroidPrefix = paramString;
      mAndroidPrefixes.add(mAndroidPrefix);
    }
    
    public String getNamespaceURI(String paramString)
    {
      if ((paramString != null) && 
        (paramString.equals(mAndroidPrefix))) {
        return "http://schemas.android.com/apk/res/android";
      }
      return "";
    }
    
    public String getPrefix(String paramString)
    {
      if ("http://schemas.android.com/apk/res/android".equals(paramString)) {
        return mAndroidPrefix;
      }
      return null;
    }
    
    public Iterator<?> getPrefixes(String paramString)
    {
      if ("http://schemas.android.co
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