Class

org.argus.amandroid.core.parser

ARSCFileParser

Related Doc: package parser

Permalink

class ARSCFileParser extends AnyRef

Parser for reading out the contents of Android's resource.arsc file. Structure declarations and comments taken from the Android source code and ported from java to scala.

adapted from Steven Arzt

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ARSCFileParser
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ARSCFileParser()

    Permalink

Type Members

  1. sealed abstract class AbstractResource extends AnyRef

    Permalink

    Abstract base class for all Android resources.

  2. case class AttributeResource(attributeID: Int) extends AbstractResource with Product with Serializable

    Permalink

    Android resource containing an attribute resource identifier.

  3. case class BooleanResource(value: Boolean) extends AbstractResource with Product with Serializable

    Permalink

    Android resource containing boolean data.

  4. case class ColorResource(a: Int, r: Int, g: Int, b: Int) extends AbstractResource with Product with Serializable

    Permalink

    Android resource containing color data.

  5. case class ComplexResource(value: MMap[String, AbstractResource]) extends AbstractResource with Product with Serializable

    Permalink

    Android resource containing complex map data.

  6. case class DimensionResource(value: Int, unit: Dimension.Value) extends AbstractResource with Product with Serializable

    Permalink

    Android resource containing dimension data like "11pt".

  7. case class FloatResource(value: Float) extends AbstractResource with Product with Serializable

    Permalink

    Android resource containing a single-precision floating point number

  8. case class IntegerResource(value: Int) extends AbstractResource with Product with Serializable

    Permalink

    Android resource containing integer data.

  9. case class NullResource() extends AbstractResource with Product with Serializable

    Permalink

    Android resource that does not contain any data

  10. case class ReferenceResource(referenceID: Int) extends AbstractResource with Product with Serializable

    Permalink

    Android resource containing a reference to another resource.

  11. class ResChunk_Header extends AnyRef

    Permalink

    Header that appears at the front of every data chunk in a resource

    Header that appears at the front of every data chunk in a resource

    Attributes
    protected
  12. class ResConfig extends AnyRef

    Permalink

    A configuration in an Android resource file.

    A configuration in an Android resource file. All resources are associated with a configuration (which may be the default one).

  13. class ResPackage extends AnyRef

    Permalink
  14. class ResStringPool_Header extends AnyRef

    Permalink
    Attributes
    protected
  15. class ResTable_Config extends AnyRef

    Permalink

    Describes a particular resource configuration.

    Describes a particular resource configuration.

    Attributes
    protected
  16. class ResTable_Entry extends AnyRef

    Permalink

    This is the beginning of information about an entry in the resource table.

    This is the beginning of information about an entry in the resource table. It holds the reference to the name of this entry, and is immediately followed by one of: * A Res_value structure, if FLAG_COMPLEX is -not- set * An array of ResTable_Map structures, if FLAG_COMPLEX is set. These supply a set of name/value mappings of data.

    Attributes
    protected
  17. class ResTable_Header extends AnyRef

    Permalink
    Attributes
    protected
  18. class ResTable_Map extends AnyRef

    Permalink

    A single name/value mapping that is part of a complex resource entry.

    A single name/value mapping that is part of a complex resource entry.

    Attributes
    protected
  19. class ResTable_Map_Entry extends ResTable_Entry

    Permalink

    Extended form of a ResTable_Entry for map entries, defining a parent map resource from which to inherit values.

    Extended form of a ResTable_Entry for map entries, defining a parent map resource from which to inherit values.

    Attributes
    protected
  20. class ResTable_Package extends AnyRef

    Permalink
    Attributes
    protected
  21. class ResTable_Type extends AnyRef

    Permalink

    A collection of resource entries for a particular resource data type.

    A collection of resource entries for a particular resource data type. Followed by an array of uint32_t defining the resource values, corresponding to the array of type strings in the ResTable_Package::typeStrings string block. Each of these hold an index from entriesStart a value of NO_ENTRY means that entry is not defined.

    There may be multiple of these chunks for a particular resource type, supply different configuration variations for the resource values of that type.

    It would be nice to have an additional ordered index of entries, so we can do a binary search if trying to find a resource by string name.

    Attributes
    protected
  22. class ResTable_TypeSpec extends AnyRef

    Permalink

    A specification of the resources defined by a particular type.

    A specification of the resources defined by a particular type.

    There should be one of these chunks for each resource type.

    This structure is followed by an array of integers providing the set of configuration change flags (ResTable_Config::CONFIG_*) that have multiple resources for that configuration. In addition, the high bit is set if that resource has been made public.

    Attributes
    protected
  23. class ResType extends AnyRef

    Permalink

    A resource type in an Android resource file.

    A resource type in an Android resource file. All resources are associated with a type.

  24. case class Res_Value() extends Product with Serializable

    Permalink

    Representation of a value in a resource, supplying type information.

    Representation of a value in a resource, supplying type information.

    Attributes
    protected
  25. case class ResourceId(packageId: Int, typeId: Int, itemIndex: Int) extends Product with Serializable

    Permalink

    Class containing the data encoded in an Android resource ID

  26. case class StringResource(value: String) extends AbstractResource with Product with Serializable

    Permalink

    Android resource containing string data.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def ARSCFileParser(): Unit

    Permalink
  5. final val ATTR_FEW: Int

    Permalink
    Attributes
    protected
  6. final val ATTR_L10N: Int

    Permalink

    Localization of this resource is can be encouraged or required with an aapt flag if this is set

    Localization of this resource is can be encouraged or required with an aapt flag if this is set

    Attributes
    protected
  7. final val ATTR_MANY: Int

    Permalink
    Attributes
    protected
  8. final val ATTR_MAX: Int

    Permalink

    For integral attributes, this is the maximum value it can hold.

    For integral attributes, this is the maximum value it can hold.

    Attributes
    protected
  9. final val ATTR_MIN: Int

    Permalink

    For integral attributes, this is the minimum value it can hold.

    For integral attributes, this is the minimum value it can hold.

    Attributes
    protected
  10. final val ATTR_ONE: Int

    Permalink
    Attributes
    protected
  11. final val ATTR_OTHER: Int

    Permalink
    Attributes
    protected
  12. final val ATTR_TWO: Int

    Permalink
    Attributes
    protected
  13. final val ATTR_TYPE: Int

    Permalink

    This entry holds the attribute's type code.

    This entry holds the attribute's type code.

    Attributes
    protected
  14. final val ATTR_ZERO: Int

    Permalink
    Attributes
    protected
  15. final val COMPLEX_MANTISSA_MASK: Int(16777215)

    Permalink
    Attributes
    protected
  16. final val COMPLEX_MANTISSA_SHIFT: Int(8)

    Permalink

    Where the actual value is.

    Where the actual value is. This gives us 23 bits of precision. The top bit is the sign.

    Attributes
    protected
  17. final val COMPLEX_RADIX_0p23: Int(3)

    Permalink

    The mantissa magnitude is 0 bits -- i.e, 0x0.nnnnnn

    The mantissa magnitude is 0 bits -- i.e, 0x0.nnnnnn

    Attributes
    protected
  18. final val COMPLEX_RADIX_16p7: Int(1)

    Permalink

    The mantissa magnitude is 16 bits -- i.e, 0xnnnn.nn

    The mantissa magnitude is 16 bits -- i.e, 0xnnnn.nn

    Attributes
    protected
  19. final val COMPLEX_RADIX_23p0: Int(0)

    Permalink

    The mantissa is an integral number -- i.e., 0xnnnnnn.0

    The mantissa is an integral number -- i.e., 0xnnnnnn.0

    Attributes
    protected
  20. final val COMPLEX_RADIX_8p15: Int(2)

    Permalink

    The mantissa magnitude is 8 bits -- i.e, 0xnn.nnnn

    The mantissa magnitude is 8 bits -- i.e, 0xnn.nnnn

    Attributes
    protected
  21. final val COMPLEX_RADIX_MASK: Int(3)

    Permalink
    Attributes
    protected
  22. final val COMPLEX_RADIX_SHIFT: Int(4)

    Permalink

    Where the radix information is, telling where the decimal place appears in the mantissa.

    Where the radix information is, telling where the decimal place appears in the mantissa. This give us 4 possible fixed point representations as defined below.

    Attributes
    protected
  23. final val COMPLEX_UNIT_DIP: Int(1)

    Permalink

    TYPE_DIMENSION: Value is Device Independent Pixels.

    TYPE_DIMENSION: Value is Device Independent Pixels.

    Attributes
    protected
  24. final val COMPLEX_UNIT_FRACTION: Int(0)

    Permalink

    TYPE_FRACTION: A basic fraction of the overall size.

    TYPE_FRACTION: A basic fraction of the overall size.

    Attributes
    protected
  25. final val COMPLEX_UNIT_FRACTION_PARENT: Int(1)

    Permalink

    TYPE_FRACTION: A fraction of the parent size.

    TYPE_FRACTION: A fraction of the parent size.

    Attributes
    protected
  26. final val COMPLEX_UNIT_IN: Int(4)

    Permalink

    TYPE_DIMENSION: Value is in inches.

    TYPE_DIMENSION: Value is in inches.

    Attributes
    protected
  27. final val COMPLEX_UNIT_MASK: Int(15)

    Permalink
    Attributes
    protected
  28. final val COMPLEX_UNIT_MM: Int(5)

    Permalink

    TYPE_DIMENSION: Value is in millimeters.

    TYPE_DIMENSION: Value is in millimeters.

    Attributes
    protected
  29. final val COMPLEX_UNIT_PT: Int(3)

    Permalink

    TYPE_DIMENSION: Value is in points.

    TYPE_DIMENSION: Value is in points.

    Attributes
    protected
  30. final val COMPLEX_UNIT_PX: Int(0)

    Permalink

    TYPE_DIMENSION: Value is raw pixels.

    TYPE_DIMENSION: Value is raw pixels.

    Attributes
    protected
  31. final val COMPLEX_UNIT_SHIFT: Int(0)

    Permalink

    Where the unit type information is.

    Where the unit type information is. This gives us 16 possible types, as defined below.

    Attributes
    protected
  32. final val COMPLEX_UNIT_SP: Int(2)

    Permalink

    TYPE_DIMENSION: Value is a Scaled device independent Pixels.

    TYPE_DIMENSION: Value is a Scaled device independent Pixels.

    Attributes
    protected
  33. object Dimension extends Enumeration

    Permalink

    Enumeration containing all dimension units available in Android

  34. final val FLAG_COMPLEX: Int(1)

    Permalink

    If set, this is a complex entry, holding a set of name/value mappings.

    If set, this is a complex entry, holding a set of name/value mappings. It is followed by an array of ResTable_Map structures.

  35. final val FLAG_PUBLIC: Int(2)

    Permalink

    If set, this resource has been declared public, so libraries are allowed to reference it.

  36. final val NO_ENTRY: Int(-1)

    Permalink
    Attributes
    protected
  37. final val RES_STRING_POOL_TYPE: Int(1)

    Permalink
    Attributes
    protected
  38. final val RES_TABLE_PACKAGE_TYPE: Int(512)

    Permalink
    Attributes
    protected
  39. final val RES_TABLE_TYPE: Int(2)

    Permalink
    Attributes
    protected
  40. final val RES_TABLE_TYPE_SPEC_TYPE: Int(514)

    Permalink
    Attributes
    protected
  41. final val RES_TABLE_TYPE_TYPE: Int(513)

    Permalink
    Attributes
    protected
  42. final val SORTED_FLAG: Int(1)

    Permalink
    Attributes
    protected
  43. final val SPEC_PUBLIC: Int(1073741824)

    Permalink
    Attributes
    protected
  44. final val TITLE: String("ARSCFileParser")

    Permalink
  45. final val TYPE_ATTRIBUTE: Int(2)

    Permalink

    The 'data' holds an attribute resource identifier.

    The 'data' holds an attribute resource identifier.

    Attributes
    protected
  46. final val TYPE_DIMENSION: Int(5)

    Permalink

    The 'data' holds a complex number encoding a dimension value, such as "100in".

    The 'data' holds a complex number encoding a dimension value, such as "100in".

    Attributes
    protected
  47. final val TYPE_FIRST_COLOR_INT: Int(28)

    Permalink

    Beginning of color integer flavors...

    Beginning of color integer flavors...

    Attributes
    protected
  48. final val TYPE_FIRST_INT: Int(16)

    Permalink

    Beginning of integer flavors...

    Beginning of integer flavors...

    Attributes
    protected
  49. final val TYPE_FLOAT: Int(4)

    Permalink

    The 'data' holds a single-precision floating point number.

    The 'data' holds a single-precision floating point number.

    Attributes
    protected
  50. final val TYPE_FRACTION: Int(6)

    Permalink

    The 'data' holds a complex number encoding a fraction of a container.

    The 'data' holds a complex number encoding a fraction of a container.

    Attributes
    protected
  51. final val TYPE_INT_BOOLEAN: Int(18)

    Permalink

    The 'data' is either 0 or 1, for input "false" or "true" respectively.

    The 'data' is either 0 or 1, for input "false" or "true" respectively.

    Attributes
    protected
  52. final val TYPE_INT_COLOR_ARGB4: Int(30)

    Permalink

    The 'data' is a raw integer value of the form #argb.

    The 'data' is a raw integer value of the form #argb.

    Attributes
    protected
  53. final val TYPE_INT_COLOR_ARGB8: Int(28)

    Permalink

    The 'data' is a raw integer value of the form #aarrggbb.

    The 'data' is a raw integer value of the form #aarrggbb.

    Attributes
    protected
  54. final val TYPE_INT_COLOR_RGB4: Int(31)

    Permalink

    The 'data' is a raw integer value of the form #rgb.

    The 'data' is a raw integer value of the form #rgb.

    Attributes
    protected
  55. final val TYPE_INT_COLOR_RGB8: Int(29)

    Permalink

    The 'data' is a raw integer value of the form #rrggbb.

    The 'data' is a raw integer value of the form #rrggbb.

    Attributes
    protected
  56. final val TYPE_INT_DEC: Int(16)

    Permalink

    The 'data' is a raw integer value of the form n..n.

    The 'data' is a raw integer value of the form n..n.

    Attributes
    protected
  57. final val TYPE_INT_HEX: Int(17)

    Permalink

    The 'data' is a raw integer value of the form 0xn..n.

    The 'data' is a raw integer value of the form 0xn..n.

    Attributes
    protected
  58. final val TYPE_LAST_COLOR_INT: Int(31)

    Permalink

    ...end of integer flavors.

    ...end of integer flavors.

    Attributes
    protected
  59. final val TYPE_LAST_INT: Int(31)

    Permalink

    ...end of integer flavors.

    ...end of integer flavors.

    Attributes
    protected
  60. final val TYPE_NULL: Int(0)

    Permalink

    Contains no data

    Contains no data

    Attributes
    protected
  61. final val TYPE_REFERENCE: Int(1)

    Permalink

    The 'data' holds a ResTable_ref, a reference to another resource table entry.

    The 'data' holds a ResTable_ref, a reference to another resource table entry.

    Attributes
    protected
  62. final val TYPE_STRING: Int(3)

    Permalink

    The 'data' holds an index into the containing resource table's global value string pool.

    The 'data' holds an index into the containing resource table's global value string pool.

    Attributes
    protected
  63. final val UTF8_FLAG: Int(256)

    Permalink
    Attributes
    protected
  64. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  65. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  66. def doParse(stream: InputStream): Unit

    Permalink
  67. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  68. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  69. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  70. def findResource(resourceId: Int): AbstractResource

    Permalink

    Finds the resource with the given Android resource ID.

    Finds the resource with the given Android resource ID. This method is configuration-agnostic and simply returns the first match it finds.

    resourceId

    The Android resource ID for which to the find the resource object

    returns

    The resource object with the given Android resource ID if it has been found, otherwise null.

  71. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  72. def getGlobalStringPool: Map[Int, String]

    Permalink
  73. def getPackages: List[ResPackage]

    Permalink
  74. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  75. def isAttribute(map: ResTable_Map): Boolean

    Permalink

    Checks whether the given complex map entry is one of the well-known attributes.

    Checks whether the given complex map entry is one of the well-known attributes.

    map

    The map entry to check

    returns

    True if the given entry is one of the well-known attributes, otherwise false.

    Attributes
    protected
  76. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  77. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  78. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  79. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  80. def parse(apkUri: FileResourceUri): Unit

    Permalink
  81. def parseResourceId(resourceId: Int): ResourceId

    Permalink

    Parses an Android resource ID into its components

    Parses an Android resource ID into its components

    resourceId

    The numeric resource ID to parse

    returns

    The data contained in the given Android resource ID

  82. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  83. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  84. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  85. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  86. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped