Skip to content

Commit

Permalink
Add support for manifest attributes: android:extractNativeLibs, `an…
Browse files Browse the repository at this point in the history
…droid:usesCleartextTraffic`, `android:alwaysRetainTaskState`.
  • Loading branch information
James2022-rgb committed Jan 7, 2023
1 parent 0f47f04 commit 7cf18a3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cargo-apk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ icon = "@mipmap/ic_launcher"
# Defaults to the compiled artifact's name.
label = "Application Name"

# See https://developer.android.com/guide/topics/manifest/application-element#extractNativeLibs
extract_native_libs = true

# See https://developer.android.com/guide/topics/manifest/application-element#usesCleartextTraffic
uses_cleartext_traffic = true

# See https://developer.android.com/guide/topics/manifest/meta-data-element
#
# Note: there can be several .meta_data entries.
Expand Down Expand Up @@ -192,6 +198,9 @@ exported = true
# Defaults to true on Android >= 24, no effect on earlier API levels
resizeable_activity = false

# See https://developer.android.com/guide/topics/manifest/activity-element#always
always_retain_task_state = true

# See https://developer.android.com/guide/topics/manifest/meta-data-element
#
# Note: there can be several .meta_data entries.
Expand Down
2 changes: 2 additions & 0 deletions ndk-build/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

- Add `android:extractNativeLibs`, `android:usesCleartextTraffic`, attributes to the manifest's `Application` element, and `android:alwaysRetainTaskState` to the `Activity` element.

# 0.9.0 (2022-11-23)

- Add `ndk::DEFAULT_DEV_KEYSTORE_PASSWORD` and make `apk::ApkConfig::apk` public. ([#358](https://github.com/rust-windowing/android-ndk-rs/pull/358))
Expand Down
7 changes: 7 additions & 0 deletions ndk-build/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ pub struct Application {
#[serde(rename(serialize = "android:label"))]
#[serde(default)]
pub label: String,
#[serde(rename(serialize = "android:extractNativeLibs"))]
pub extract_native_libs: Option<bool>,
#[serde(rename(serialize = "android:usesCleartextTraffic"))]
pub uses_cleartext_traffic: Option<bool>,

#[serde(rename(serialize = "meta-data"))]
#[serde(default)]
Expand Down Expand Up @@ -104,6 +108,8 @@ pub struct Activity {
pub exported: Option<bool>,
#[serde(rename(serialize = "android:resizeableActivity"))]
pub resizeable_activity: Option<bool>,
#[serde(rename(serialize = "android:alwaysRetainTaskState"))]
pub always_retain_task_state: Option<bool>,

#[serde(rename(serialize = "meta-data"))]
#[serde(default)]
Expand All @@ -124,6 +130,7 @@ impl Default for Activity {
orientation: None,
exported: None,
resizeable_activity: None,
always_retain_task_state: None,
meta_data: Default::default(),
intent_filter: Default::default(),
}
Expand Down

0 comments on commit 7cf18a3

Please sign in to comment.