pub struct Aapt2Optimize { /* private fields */ }
Expand description
Preforms resource optimizations on an APK
Implementations§
Source§impl Aapt2Optimize
impl Aapt2Optimize
Sourcepub fn new(output_apk: &Path, output_dir: &Path) -> Self
pub fn new(output_apk: &Path, output_dir: &Path) -> Self
Initialize aapt2 optimize then specifies path to the aapt2 link output APK and Path to the output directory (for splits)
Sourcepub fn config_xml_file(&mut self, config_xml_file: &Path) -> &mut Self
pub fn config_xml_file(&mut self, config_xml_file: &Path) -> &mut Self
Specifies path to XML configuration file
Sourcepub fn apk_artifacts(&mut self, apk_artifacts: bool) -> &mut Self
pub fn apk_artifacts(&mut self, apk_artifacts: bool) -> &mut Self
Print the multi APK artifacts and exit
Sourcepub fn target_densities(&mut self, target_densities: &str) -> &mut Self
pub fn target_densities(&mut self, target_densities: &str) -> &mut Self
Comma separated list of the screen densities that the APK will be optimized for. All the resources that would be unused on devices of the given densities will be removed from the APK
Sourcepub fn resources_config_path(
&mut self,
resources_config_path: &Path,
) -> &mut Self
pub fn resources_config_path( &mut self, resources_config_path: &Path, ) -> &mut Self
Path to the resources.cfg
file containing the list of resources and directives
to each resource. Format: type/resource_name#[directive][,directive]
Sourcepub fn configs_to_include(&mut self, configs_to_include: &str) -> &mut Self
pub fn configs_to_include(&mut self, configs_to_include: &str) -> &mut Self
Comma separated list of configurations to include. The default is all configurations
Sourcepub fn split(&mut self, split: &Path) -> &mut Self
pub fn split(&mut self, split: &Path) -> &mut Self
Split resources matching a set of configs out to a Split APK. Syntax:
`path/to/output.apk;<config>[,<config>[...]].`
On Windows, use a semicolon ;
separator instead
Sourcepub fn keep_artifacts(&mut self, keep_artifacts: &str) -> &mut Self
pub fn keep_artifacts(&mut self, keep_artifacts: &str) -> &mut Self
Comma separated list of artifacts to keep. If none are specified, all artifacts will be kept
Sourcepub fn enable_sparse_encoding(
&mut self,
enable_sparse_encoding: bool,
) -> &mut Self
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
Sourcepub fn collapse_resource_name(
&mut self,
collapse_resource_name: bool,
) -> &mut Self
pub fn collapse_resource_name( &mut self, collapse_resource_name: bool, ) -> &mut Self
Collapses resource names to a single value in the key string pool.
Resources can be exempted using the no_collapse
directive in a file specified by
--resources-config-path
Sourcepub fn shorten_resource_paths(
&mut self,
shorten_resource_paths: bool,
) -> &mut Self
pub fn shorten_resource_paths( &mut self, shorten_resource_paths: bool, ) -> &mut Self
Shortens the paths of resources inside the APK
Sourcepub fn resource_path_shortening_map(
&mut self,
resource_path_shortening_map: &Path,
) -> &mut Self
pub fn resource_path_shortening_map( &mut self, resource_path_shortening_map: &Path, ) -> &mut Self
Path to output the map of old resource paths to shortened paths
Trait Implementations§
Source§impl Clone for Aapt2Optimize
impl Clone for Aapt2Optimize
Source§fn clone(&self) -> Aapt2Optimize
fn clone(&self) -> Aapt2Optimize
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for Aapt2Optimize
impl Default for Aapt2Optimize
Source§fn default() -> Aapt2Optimize
fn default() -> Aapt2Optimize
Auto Trait Implementations§
impl Freeze for Aapt2Optimize
impl RefUnwindSafe for Aapt2Optimize
impl Send for Aapt2Optimize
impl Sync for Aapt2Optimize
impl Unpin for Aapt2Optimize
impl UnwindSafe for Aapt2Optimize
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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