dex++ 0.3.1
C++ and C API reference
Loading...
Searching...
No Matches
dex::apk::Component Struct Reference

One of activity / service / receiver / provider. More...

#include <apk/manifest.hpp>

Public Types

enum class  Kind : uint8_t { Activity , Service , Receiver , Provider }
 

Public Member Functions

bool is_exported () const
 Effective exported state: the explicit flag if present, else inferred — a component with at least one intent filter defaults to exported.
 
bool is_reachable () const
 Reachable by a third-party app: exported and not gated behind a signature-level permission the app declares.
 

Public Attributes

Kind kind
 
std::string name
 android:name, normalized to a fully-qualified class.
 
std::optional< bool > exported
 android:exported: the value written, or the value of the resource it refers to.
 
std::optional< uint32_t > exported_reference
 The resource id when android:exported is written as a reference, such as "@bool/is_exported" (or a theme attribute, "?attr/name"), whether it was resolved or not; nullopt for a plain value or no attribute.
 
std::optional< std::string > permission
 android:permission guarding the component.
 
std::vector< IntentFilter > intent_filters
 
bool guarded_by_signature_permission = false
 Resolved at parse time: true when permission names a permission the app itself declares with a signature / signatureOrSystem protection level — i.e. one a third-party app cannot obtain.
 

Detailed Description

One of activity / service / receiver / provider.

Member Enumeration Documentation

◆ Kind

enum class dex::apk::Component::Kind : uint8_t
strong
Enumerator
Activity 
Service 
Receiver 
Provider 

Member Function Documentation

◆ is_exported()

bool dex::apk::Component::is_exported ( ) const
inline

Effective exported state: the explicit flag if present, else inferred — a component with at least one intent filter defaults to exported.

When android:exported is a reference that could not be resolved, the developer did set the flag but its value is unknown, and the intent-filter rule would be a guess that can hide an exported component. For triage the safe answer is "possibly exported", so this returns true.

◆ is_reachable()

bool dex::apk::Component::is_reachable ( ) const
inline

Reachable by a third-party app: exported and not gated behind a signature-level permission the app declares.

Normal/dangerous-protected components stay reachable (a malicious app can hold those), as do components guarded by an undeclared (e.g. platform) permission.

Member Data Documentation

◆ kind

Kind dex::apk::Component::kind

◆ name

std::string dex::apk::Component::name

android:name, normalized to a fully-qualified class.

◆ exported

std::optional<bool> dex::apk::Component::exported

android:exported: the value written, or the value of the resource it refers to.

nullopt when the attribute is absent, or when it is a reference that could not be resolved (then exported_reference is set).

◆ exported_reference

std::optional<uint32_t> dex::apk::Component::exported_reference

The resource id when android:exported is written as a reference, such as "@bool/is_exported" (or a theme attribute, "?attr/name"), whether it was resolved or not; nullopt for a plain value or no attribute.

◆ permission

std::optional<std::string> dex::apk::Component::permission

android:permission guarding the component.

◆ intent_filters

std::vector<IntentFilter> dex::apk::Component::intent_filters

◆ guarded_by_signature_permission

bool dex::apk::Component::guarded_by_signature_permission = false

Resolved at parse time: true when permission names a permission the app itself declares with a signature / signatureOrSystem protection level — i.e. one a third-party app cannot obtain.

Permissions whose protection level the manifest does not declare (platform permissions like android.permission.DUMP) leave this false.


The documentation for this struct was generated from the following file: