Struct Aapt2Convert

Source
pub struct Aapt2Convert { /* private fields */ }
Expand description

Converts an apk between binary and proto formats.

Implementations§

Source§

impl Aapt2Convert

Source

pub fn new(output_path: &Path) -> Self

Initialize aapt2 convert and then specifies output path to convert

Source

pub fn output_format(&mut self, output_format: OutputFormat) -> &mut Self

Format of the output. Accepted values are proto and binary. When not set, defaults to binary

Source

pub fn enable_sparse_encoding( &mut self, enable_sparse_encoding: bool, ) -> &mut Self

Enables encoding sparse entries using a binary search tree. This decreases APK size at the cost of resource retrieval performance

Source

pub fn keep_raw_values(&mut self, keep_raw_values: bool) -> &mut Self

Preserve raw attribute values in xml files when using the ‘binary’ output format

Source

pub fn verbose(&mut self, verbose: bool) -> &mut Self

Enables verbose logging

Source

pub fn help(&mut self, help: bool) -> &mut Self

Displays this help menu

Source

pub fn run(&self) -> Result<()>

Executes aapt2 convert with arguments

Trait Implementations§

Source§

impl Default for Aapt2Convert

Source§

fn default() -> Aapt2Convert

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.