From c3a46252ee6b4b6116ae4a6a681d90acaf9a942a Mon Sep 17 00:00:00 2001 From: Sebastiano Barezzi Date: Mon, 22 Jul 2024 01:45:20 +0200 Subject: [PATCH] apns: Add a XML schema and check apns-conf.xml against it Change-Id: Id115dd7beeafffcdf24e9ff1732490f0ca808279 --- .github/workflows/build/action.yml | 4 + prebuilt/common/Android.bp | 1 + tools/Android.bp | 4 + tools/apns-conf.xsd | 159 +++++++++++++++++++++++++++++ 4 files changed, 168 insertions(+) create mode 100644 tools/Android.bp create mode 100644 tools/apns-conf.xsd diff --git a/.github/workflows/build/action.yml b/.github/workflows/build/action.yml index b808aa0b..d46853f9 100644 --- a/.github/workflows/build/action.yml +++ b/.github/workflows/build/action.yml @@ -8,6 +8,10 @@ runs: shell: bash run: sudo apt -y install libxml2-utils + - name: Validate apns-conf.xml + shell: bash + run: xmllint --noout --schema ./tools/apns-conf.xsd ./prebuilt/common/etc/apns-conf.xml + - name: Validate sensitive_pn.xml shell: bash run: xmllint --noout --schema ./spn/SpnInfo.xsd ./prebuilt/common/etc/sensitive_pn.xml diff --git a/prebuilt/common/Android.bp b/prebuilt/common/Android.bp index a6cf55fd..3985af01 100644 --- a/prebuilt/common/Android.bp +++ b/prebuilt/common/Android.bp @@ -2,6 +2,7 @@ prebuilt_etc_xml { name: "apns-conf.xml", product_specific: true, src: "etc/apns-conf.xml", + schema: ":apns-conf-schema", } prebuilt_etc_xml { diff --git a/tools/Android.bp b/tools/Android.bp new file mode 100644 index 00000000..de18c32d --- /dev/null +++ b/tools/Android.bp @@ -0,0 +1,4 @@ +filegroup { + name: "apns-conf-schema", + srcs: ["apns-conf.xsd"], +} diff --git a/tools/apns-conf.xsd b/tools/apns-conf.xsd new file mode 100644 index 00000000..4dbb06f3 --- /dev/null +++ b/tools/apns-conf.xsd @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +