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)

Returns class_data_item of this class.

Returns:



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/android/dex/dex_object.rb', line 297

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

Returns bytes.

Returns:

  • (Integer)

    bytes



299
300
301
# File 'lib/android/dex/dex_object.rb', line 299

def self.size
  4 * 8
end