A reference to a class by its type descriptor, which may or may not be defined in the loaded DEX files: the superclass, the interfaces and the declaring class of a member are ClassRefs, because they can name a class from outside the app, such as "Ljava/lang/Object;".
More...
#include <analysis/class_ref.hpp>
A reference to a class by its type descriptor, which may or may not be defined in the loaded DEX files: the superclass, the interfaces and the declaring class of a member are ClassRefs, because they can name a class from outside the app, such as "Ljava/lang/Object;".
Get one from Class::superclass(), Class::interfaces(), Method::declaring_class() or Field::declaring_class(). ClassRef keeps shared ownership of the analysis, so it stays valid after every AnalysisContext wrapper has been destroyed, and it owns its descriptor. To look a class up by a descriptor you have, use AnalysisContext::find_class().
◆ descriptor()
| std::string_view dex::ClassRef::descriptor |
( |
| ) |
const |
|
inline |
The 'L...;' type descriptor string (e.g. "Ljava/lang/Object;").
The returned view is valid for this ClassRef's lifetime.
◆ resolve()
| std::optional< Class > dex::ClassRef::resolve |
( |
| ) |
const |
◆ is_resolved()
| bool dex::ClassRef::is_resolved |
( |
| ) |
const |
◆ operator==()
| bool dex::ClassRef::operator== |
( |
const ClassRef & |
| ) |
const |
|
default |
Two references are equal when they come from the same analysis (one AnalysisContext, or copies of it) and name the same descriptor.
References from two contexts that loaded the same file are not equal. std::hash<ClassRef> is consistent with it.
◆ std::hash< ClassRef >
◆ Class
◆ Method
◆ Field
The documentation for this class was generated from the following file: