SecureBrain / ruby_apk

analyzing android apk library for ruby
MIT License
83 stars 52 forks source link

Correction in README "Extract dex information" example #9

Closed 8bithero closed 11 years ago

8bithero commented 11 years ago

Extract dex information

Both examples are missing the .each

Example 1

dex.strings do |str|
    puts str
end

Should be

dex.strings.each do |str|
    puts str
end

Example 2

dex.classes do |cls| # cls is Android::Dex::ClassInfo
    puts "class: #{cls.name}"
    cls.virtual_methods.each do |m| # Android::Dex::MethodInfo
      puts "\t#{m.definition}" # puts method definition
    end
end

Should be

dex.classes.each do |cls| # cls is Android::Dex::ClassInfo
    puts "class: #{cls.name}"
    cls.virtual_methods.each do |m| # Android::Dex::MethodInfo
      puts "\t#{m.definition}" # puts method definition
    end
end