Class AndroidManifest


  • public class AndroidManifest
    extends java.lang.Object
    This is a container object for encapsulating data and logic for parsing an Android Manifest file
    Author:
    Ben Holland
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ANDROID_MANIFEST_FILENAME
      Android Manifest file name
    • Constructor Summary

      Constructors 
      Constructor Description
      AndroidManifest​(java.io.File androidManifestFile)
      Constructs an AndroidManifest object from the given AndroidManifest.xml file
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.File getAppIcon()
      Returns the highest resolution app icon located in the workspace or null if no app icons were located
      java.util.ArrayList<java.io.File> getAppIcons()
      Returns an ordered list of File objects pointing to the App icons found in the workspace List is ordered by highest to lowest app icon resolutions Collection may be empty if not app icons were located
      static java.util.Collection<java.io.File> getDependentManifestFiles​(java.lang.String project)
      Returns File objects pointing to AndroidManifest.xml files of projects the given Eclipse Android workspace project depends upon
      static java.io.File getManifestFile​(java.lang.String project)
      Returns a File object pointing to the AndroidManifest.xml file for the given Eclipse Android workspace project
      java.io.File getManifestLocation()
      Returns the location of the AndroidManifest.xml file represented by this object instance
      int getMaxSDKVersion()
      Returns the max supported SDK version (or highest available mapping known in the PermissionMapping if not set)
      int getMinSDKVersion()
      Returns the min supported SDK version
      int getTargetSDKVersion()
      Returns the target supported SDK version
      java.util.HashSet<java.lang.String> getUnidentifedUsesPermissions()
      Returns unidentified requested permissions.
      java.util.Collection<Permission> getUsesPermissions()
      Returns a collection of requested Android Permissions (includes documented, undocumented types)
      static java.util.Collection<AndroidManifest> parseManifestFiles​(java.util.Collection<java.io.File> files)
      Returns a collection of Manifest objects for each AndroidManifest.xml file given
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ANDROID_MANIFEST_FILENAME

        public static final java.lang.String ANDROID_MANIFEST_FILENAME
        Android Manifest file name
        See Also:
        Constant Field Values
    • Constructor Detail

      • AndroidManifest

        public AndroidManifest​(java.io.File androidManifestFile)
                        throws java.io.IOException,
                               java.lang.IllegalArgumentException
        Constructs an AndroidManifest object from the given AndroidManifest.xml file
        Parameters:
        androidManifestFile -
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
    • Method Detail

      • getManifestFile

        public static java.io.File getManifestFile​(java.lang.String project)
                                            throws java.lang.Exception
        Returns a File object pointing to the AndroidManifest.xml file for the given Eclipse Android workspace project
        Parameters:
        project -
        Returns:
        Throws:
        java.lang.Exception
      • getDependentManifestFiles

        public static java.util.Collection<java.io.File> getDependentManifestFiles​(java.lang.String project)
                                                                            throws org.eclipse.core.runtime.CoreException
        Returns File objects pointing to AndroidManifest.xml files of projects the given Eclipse Android workspace project depends upon
        Parameters:
        project -
        Returns:
        Throws:
        org.eclipse.core.runtime.CoreException
      • parseManifestFiles

        public static java.util.Collection<AndroidManifest> parseManifestFiles​(java.util.Collection<java.io.File> files)
                                                                        throws java.lang.IllegalArgumentException,
                                                                               java.io.IOException
        Returns a collection of Manifest objects for each AndroidManifest.xml file given
        Parameters:
        files -
        Returns:
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
      • getUsesPermissions

        public java.util.Collection<Permission> getUsesPermissions()
        Returns a collection of requested Android Permissions (includes documented, undocumented types)
        Returns:
      • getUnidentifedUsesPermissions

        public java.util.HashSet<java.lang.String> getUnidentifedUsesPermissions()
        Returns unidentified requested permissions. These are either custom application permissions or permissions that have not be included in the referenced permission mapping permissions list.
        Returns:
      • getAppIcons

        public java.util.ArrayList<java.io.File> getAppIcons()
        Returns an ordered list of File objects pointing to the App icons found in the workspace List is ordered by highest to lowest app icon resolutions Collection may be empty if not app icons were located
        Returns:
      • getAppIcon

        public java.io.File getAppIcon()
        Returns the highest resolution app icon located in the workspace or null if no app icons were located
        Returns:
      • getManifestLocation

        public java.io.File getManifestLocation()
        Returns the location of the AndroidManifest.xml file represented by this object instance
        Returns:
      • getMinSDKVersion

        public int getMinSDKVersion()
        Returns the min supported SDK version
        Returns:
      • getMaxSDKVersion

        public int getMaxSDKVersion()
        Returns the max supported SDK version (or highest available mapping known in the PermissionMapping if not set)
        Returns:
      • getTargetSDKVersion

        public int getTargetSDKVersion()
        Returns the target supported SDK version
        Returns: