Go to the documentation of this file.
16#ifndef LIEF_DEX_CLASS_H
17#define LIEF_DEX_CLASS_H
40 using access_flags_list_t = std::vector<ACCESS_FLAGS>;
42 using methods_t = std::vector<Method*>;
43 using it_methods = ref_iterator<methods_t&>;
44 using it_const_methods = const_ref_iterator<const methods_t&>;
46 using fields_t = std::vector<Field*>;
47 using it_fields = ref_iterator<fields_t&>;
48 using it_const_fields = const_ref_iterator<const fields_t&>;
50 using it_named_methods = filter_iterator<methods_t&>;
51 using it_const_named_methods = const_filter_iterator<const methods_t&>;
53 using it_named_fields = filter_iterator<fields_t&>;
54 using it_const_named_fields = const_filter_iterator<const fields_t&>;
65 Class(std::string fullname, uint32_t access_flags = ACCESS_FLAGS::ACC_UNKNOWN,
66 Class* parent =
nullptr, std::string source_filename =
"");
73 std::string
name()
const;
79 bool has(ACCESS_FLAGS f)
const;
91 const Class*
parent()
const;
95 it_const_methods
methods()
const;
99 it_named_methods
methods(
const std::string& name);
102 it_const_named_methods
methods(
const std::string& name)
const;
103 it_const_fields
fields()
const;
107 it_named_fields
fields(
const std::string& name);
110 it_const_named_fields
fields(
const std::string& name)
const;
114 size_t index()
const;
118 void accept(Visitor& visitor)
const override;
126 std::string fullname_;
127 uint32_t access_flags_ = ACCESS_FLAGS::ACC_UNKNOWN;
128 Class* parent_ =
nullptr;
131 std::string source_filename_;
133 uint32_t original_index_ = UINT_MAX;
Class which represents a DEX Class (i.e. a Java/Kotlin class)
Definition DEX/Class.hpp:36
it_const_named_fields fields(const std::string &name) const
size_t index() const
Original index in the DEX class pool.
void accept(Visitor &visitor) const override
Class & operator=(const Class &)=delete
access_flags_list_t access_flags() const
Access flags used by this class.
it_const_methods methods() const
Methods implemented in this class.
static std::string package_normalized(const std::string &pkg_name)
bool has_parent() const
True if the current class extends another one.
Class(const Class &)=delete
std::string pretty_name() const
Demangled class name.
bool has(ACCESS_FLAGS f) const
Check if the class has the given access flag.
it_named_fields fields(const std::string &name)
Return Fields having the given name.
it_named_methods methods(const std::string &name)
Return Methods having the given name.
std::string name() const
Class name.
Class(std::string fullname, uint32_t access_flags=ACCESS_FLAGS::ACC_UNKNOWN, Class *parent=nullptr, std::string source_filename="")
dex2dex_class_info_t dex2dex_info() const
De-optimize information.
const std::string & fullname() const
Mangled class name (e.g. Lcom/example/android/MyActivity;)
it_const_fields fields() const
Fields implemented in this class.
const Class * parent() const
Parent class.
it_const_named_methods methods(const std::string &name) const
std::string package_name() const
Package Name.
static std::string fullname_normalized(const std::string &pkg, const std::string &cls_name)
static std::string fullname_normalized(const std::string &pkg_cls)
friend std::ostream & operator<<(std::ostream &os, const Class &cls)
const std::string & source_filename() const
Filename associated with this class (if any)
Class which represent a DEX Field.
Definition Field.hpp:34
Class which represents a DEX::Method.
Definition DEX/Method.hpp:36
Class which parses a DEX file to produce a DEX::File object.
Definition DEX/Parser.hpp:38
Definition DEX/Class.hpp:30
std::unordered_map< Method *, dex2dex_method_info_t > dex2dex_class_info_t
Definition deopt.hpp:28
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41