From fb579237ad585e821b4ec495166c7bf3854e75c5 Mon Sep 17 00:00:00 2001 From: wu bobo Date: Sun, 20 Oct 2024 09:04:42 +0800 Subject: [PATCH 1/3] Supports `resource` attribute for `meta_data` --- cargo-apk/src/apk.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cargo-apk/src/apk.rs b/cargo-apk/src/apk.rs index a4be306..b99aef6 100644 --- a/cargo-apk/src/apk.rs +++ b/cargo-apk/src/apk.rs @@ -176,7 +176,8 @@ impl<'a> ApkBuilder<'a> { manifest.application.activity.meta_data.push(MetaData { name: "android.app.lib_name".to_string(), - value: artifact.name.replace('-', "_"), + value: Some(artifact.name.replace('-', "_")), + resource: None, }); let crate_path = self.cmd.manifest().parent().expect("invalid manifest path"); From 1c58899577ab9019523d98cd19b92be204f713db Mon Sep 17 00:00:00 2001 From: wu bobo Date: Sun, 20 Oct 2024 09:06:19 +0800 Subject: [PATCH 2/3] Supports `resource` attribute for `meta_data` --- ndk-build/src/manifest.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ndk-build/src/manifest.rs b/ndk-build/src/manifest.rs index 6e3696c..b0b79f8 100644 --- a/ndk-build/src/manifest.rs +++ b/ndk-build/src/manifest.rs @@ -220,7 +220,9 @@ pub struct MetaData { #[serde(rename(serialize = "android:name"))] pub name: String, #[serde(rename(serialize = "android:value"))] - pub value: String, + pub value: Option, + #[serde(rename(serialize = "android:resource"))] + pub resource: Option, } /// Android [uses-feature element](https://developer.android.com/guide/topics/manifest/uses-feature-element). From 29aa4621ebf92b2420dc5d24f3b097f0bc819200 Mon Sep 17 00:00:00 2001 From: wu bobo Date: Sun, 20 Oct 2024 09:07:28 +0800 Subject: [PATCH 3/3] Update README.md --- cargo-apk/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/cargo-apk/README.md b/cargo-apk/README.md index 2dae917..f16c476 100644 --- a/cargo-apk/README.md +++ b/cargo-apk/README.md @@ -181,7 +181,6 @@ uses_cleartext_traffic = true # See https://developer.android.com/guide/topics/manifest/meta-data-element # # Note: there can be several .meta_data entries. -# Note: the `resource` attribute is currently not supported. [[package.metadata.android.application.meta_data]] name = "com.samsung.android.vr.application.mode" value = "vr_only" @@ -225,7 +224,6 @@ always_retain_task_state = true # See https://developer.android.com/guide/topics/manifest/meta-data-element # # Note: there can be several .meta_data entries. -# Note: the `resource` attribute is currently not supported. [[package.metadata.android.application.activity.meta_data]] name = "com.oculus.vr.focusaware" value = "true"