Class: Android::Dex::DexObject::EncodedMethod

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

Overview

encoded_method

Instance Attribute Summary collapse

Attributes inherited from Android::Dex::DexObject

#size

Method Summary

Methods inherited from Android::Dex::DexObject

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

Constructor Details

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

Instance Attribute Details

#code_itemCodeItem (readonly)

Returns code_item of the method.

Returns:

  • (CodeItem)

    code_item of the method



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/android/dex/dex_object.rb', line 356

class EncodedMethod < DexObject
  def code_item
    # description of code_off in code_data_item.
    #   offset from the start of the file to the code structure for this method,
    #   or 0 if this method is either abstract or native.
    unless @params[:code_off] == 0
      @code_item ||= CodeItem.new(@data, @params[:code_off])
    else
      nil
    end
  end

  private
  def parse
    @params[:method_idx_diff] = read_uleb
    @params[:access_flags] = read_uleb
    @params[:code_off] = read_uleb
  end
end