dex++ 0.3.1
C++ and C API reference
Loading...
Searching...
No Matches
dex::apk::Manifest Class Reference

Typed AndroidManifest.xml. More...

#include <apk/manifest.hpp>

Public Member Functions

 Manifest (axml::XmlDocument doc, const ResourceTable *resources=nullptr)
 Read doc.
 
std::string_view package () const
 package attribute of the <manifest> element.
 
std::optional< int64_t > version_code () const
 android:versionCode, if present and known.
 
std::optional< std::string_view > version_name () const
 android:versionName, if present as text.
 
std::optional< int64_t > min_sdk () const
 uses-sdk android:minSdkVersion / targetSdkVersion, if present and known.
 
std::optional< int64_t > target_sdk () const
 
std::optional< uint32_t > version_code_reference () const
 The resource id when android:versionCode, minSdkVersion, targetSdkVersion, debuggable or allowBackup is written as a reference (see the comment at the top of this file); nullopt for a plain value or no attribute.
 
std::optional< uint32_t > min_sdk_reference () const
 
std::optional< uint32_t > target_sdk_reference () const
 
std::optional< uint32_t > debuggable_reference () const
 
std::optional< uint32_t > allow_backup_reference () const
 
const std::vector< std::string > & permissions () const
 android:name of every <uses-permission>.
 
const std::vector< std::string > & declared_permissions () const
 android:name of every <permission> the app itself declares.
 
std::optional< int > declared_permission_protection_level (std::string_view name) const
 android:protectionLevel of an app-declared <permission> (the raw Android value), or nullopt if the permission is not declared by this app, or its level is a resource reference that could not be resolved.
 
const std::vector< Component > & components () const
 All components, or those of one kind.
 
std::vector< const Component * > components_of (Component::Kind kind) const
 
std::optional< std::string_view > launcher_activity () const
 The launcher activity's name, if any (MAIN + LAUNCHER intent filter).
 
std::optional< bool > debuggable () const
 application android:debuggable, if explicitly set and known.
 
std::optional< bool > allow_backup () const
 application android:allowBackup, if explicitly set and known.
 
const axml::XmlDocument & xml () const
 The underlying decoded XML, for attributes this view does not surface.
 

Detailed Description

Typed AndroidManifest.xml.

Built from an axml::XmlDocument.

Constructor & Destructor Documentation

◆ Manifest()

dex::apk::Manifest::Manifest ( axml::XmlDocument  doc,
const ResourceTable *  resources = nullptr 
)
explicit

Read doc.

With resources (the APK's resource table), boolean and integer attributes given as resource references are resolved through it; without, they keep only their reference id. The table is only read here, not kept.

Member Function Documentation

◆ package()

std::string_view dex::apk::Manifest::package ( ) const
inline

package attribute of the <manifest> element.

◆ version_code()

std::optional< int64_t > dex::apk::Manifest::version_code ( ) const
inline

android:versionCode, if present and known.

◆ version_name()

std::optional< std::string_view > dex::apk::Manifest::version_name ( ) const

android:versionName, if present as text.

◆ min_sdk()

std::optional< int64_t > dex::apk::Manifest::min_sdk ( ) const
inline

uses-sdk android:minSdkVersion / targetSdkVersion, if present and known.

◆ target_sdk()

std::optional< int64_t > dex::apk::Manifest::target_sdk ( ) const
inline

◆ version_code_reference()

std::optional< uint32_t > dex::apk::Manifest::version_code_reference ( ) const
inline

The resource id when android:versionCode, minSdkVersion, targetSdkVersion, debuggable or allowBackup is written as a reference (see the comment at the top of this file); nullopt for a plain value or no attribute.

When the matching value accessor returns nullopt and this is set, the reference could not be resolved and the value is unknown.

◆ min_sdk_reference()

std::optional< uint32_t > dex::apk::Manifest::min_sdk_reference ( ) const
inline

◆ target_sdk_reference()

std::optional< uint32_t > dex::apk::Manifest::target_sdk_reference ( ) const
inline

◆ debuggable_reference()

std::optional< uint32_t > dex::apk::Manifest::debuggable_reference ( ) const
inline

◆ allow_backup_reference()

std::optional< uint32_t > dex::apk::Manifest::allow_backup_reference ( ) const
inline

◆ permissions()

const std::vector< std::string > & dex::apk::Manifest::permissions ( ) const
inline

android:name of every <uses-permission>.

◆ declared_permissions()

const std::vector< std::string > & dex::apk::Manifest::declared_permissions ( ) const
inline

android:name of every <permission> the app itself declares.

◆ declared_permission_protection_level()

std::optional< int > dex::apk::Manifest::declared_permission_protection_level ( std::string_view  name) const

android:protectionLevel of an app-declared <permission> (the raw Android value), or nullopt if the permission is not declared by this app, or its level is a resource reference that could not be resolved.

A declaration without the attribute is normal (0). The base level is the low nibble: 0 normal, 1 dangerous, 2 signature, 3 signatureOrSystem; higher bits are flags (e.g. 0x10 privileged). A permission whose level is unknown does not make a component guarded_by_signature_permission.

◆ components()

const std::vector< Component > & dex::apk::Manifest::components ( ) const
inline

All components, or those of one kind.

◆ components_of()

std::vector< const Component * > dex::apk::Manifest::components_of ( Component::Kind  kind) const

◆ launcher_activity()

std::optional< std::string_view > dex::apk::Manifest::launcher_activity ( ) const

The launcher activity's name, if any (MAIN + LAUNCHER intent filter).

◆ debuggable()

std::optional< bool > dex::apk::Manifest::debuggable ( ) const
inline

application android:debuggable, if explicitly set and known.

◆ allow_backup()

std::optional< bool > dex::apk::Manifest::allow_backup ( ) const
inline

application android:allowBackup, if explicitly set and known.

◆ xml()

const axml::XmlDocument & dex::apk::Manifest::xml ( ) const
inline

The underlying decoded XML, for attributes this view does not surface.


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