Class: Android::Dex::DexObject::ClassDefItem

Inherits:
Android::Dex::DexObject show all
Defined in:
lib/android/dex/dex_object.rb

Overview

class_def_item

Instance Attribute Summary collapse

Attributes inherited from Android::Dex::DexObject

#size

Class Method Summary collapse

Methods inherited from Android::Dex::DexObject

#[], #initialize, #inspect, #symbols

Constructor Details

This class inherits a constructor from Android::Dex::DexObject

Instance Attribute Details

#class_data_itemClassDataItem (readonly)



256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/android/dex/dex_object.rb', line 256

class ClassDefItem < DexObject
  # @return [Integer] bytes
  def self.size
    4 * 8
  end

  def class_data_item
    # description of class_data_off of class_def_item.
    #   offset from the start of the file to the associated class data
    #   for this item, or 0 if there is no class data for this class.
    if @params[:class_data_off] != 0
      @class_data_item ||= ClassDataItem.new(@data, @params[:class_data_off])
    else
      nil
    end
  end

  private
  def parse
    @params[:class_idx] = read_value(:uint)
    @params[:access_flags] = read_value(:uint)
    @params[:superclass_idx] = read_value(:uint)
    @params[:interfaces_off] = read_value(:uint)
    @params[:source_file_idx] = read_value(:uint)
    @params[:annotations_off] = read_value(:uint)
    @params[:class_data_off] = read_value(:uint)
    @params[:static_values_off] = read_value(:uint) # TODO: not implemented encoded_array_item
  end
end

Class Method Details

.sizeInteger



258
259
260
# File 'lib/android/dex/dex_object.rb', line 258

def self.size
  4 * 8
end