Modern Apps git

← MAOS.git

maos: move Settings device attestation to Security & privacy

Commit
5d4b9dcce39842f726bb1e263f9e94010ef39fbf
Author
Vayun Mathur <[email protected]>
When
2026-11-17 15:52 UTC (18 days ago)
Parents
88e9e99
Move the "Device attestation" entry out of Settings > Security > Advanced (res/xml/security_advanced_settings.xml) and onto the top-level Security & privacy screen: SecuritySettings, whose dashboard fragment in this tree is res/xml/security_dashboard_settings.xml.

The regenerated patches/packages_apps_Settings_maos_attestation.patch now adds the entry to security_dashboard_settings.xml at order 90, directly above "More security settings" (order 100) and below the lock screen / biometric category (order 10), so it is visible without opening the advanced screen. Following the surrounding entries on that screen (none of which set an icon), the entry sets no icon; it does set settings:keywords like the neighbouring entries. The entry title, summary, fragment (com.android.settings.security.MaosAttestationFragment), Verify now behaviour, and the last-server-verdict status line are unchanged, as are MaosAttestationClient, MaosAttestationFragment, maos_attestation_settings.xml and all strings.

IMPLEMENTATION_README.md is updated to name the new location. build-maos.sh registration is unchanged: the same patch filename is still applied to packages/apps/Settings in the same position in the patch list.

Verification: on pristine Settings files taken from git HEAD in ~/maos/packages/apps/Settings (res/values/strings_ext.xml, res/xml/security_dashboard_settings.xml, res/xml/security_advanced_settings.xml), git apply --check, git apply and git apply -R of the regenerated patch all succeeded, the applied tree contained the new fragment/client/settings files and no entry in security_advanced_settings.xml, the edited XML parsed, and the tree was restored to a clean state after the reverse apply. The regenerated patch also passes git apply --check against the current ~/maos Settings tree with the earlier MAOS Settings patches already applied. No device was available, so no on-device verification was performed.

Diff

IMPLEMENTATION_README.md
diff --git a/IMPLEMENTATION_README.md b/IMPLEMENTATION_README.mdindex 5398a34..52d9fb3 100755--- a/IMPLEMENTATION_README.md+++ b/IMPLEMENTATION_README.md@@ -130,8 +130,9 @@ Server-verified hardware attestation lives in two places:   RootOfTrust (Verified boot state, locked bootloader, verified-boot key   hash, patch levels) against an owner-configured allowlist. - **Device** (`patches/packages_apps_Settings_maos_attestation.patch`,-  applied by `build-maos.sh`): Settings > Security > Advanced > Device-  attestation. One-off and user-triggered only — a "Verify now" action;+  applied by `build-maos.sh`): Settings > Security & privacy > Device+  attestation (on the SecuritySettings dashboard, above More security+  settings). One-off and user-triggered only — a "Verify now" action;   there is no periodic, scheduled, or on-boot verification. The first   verify also enrolls: a hardware key (StrongBox where available, TEE   otherwise, labelled from the server's chain reading) is generated in
patches/packages_apps_Settings_maos_attestation.patch
diff --git a/patches/packages_apps_Settings_maos_attestation.patch b/patches/packages_apps_Settings_maos_attestation.patchindex 6605692..bf8a9d9 100644--- a/patches/packages_apps_Settings_maos_attestation.patch+++ b/patches/packages_apps_Settings_maos_attestation.patch@@ -1,7 +1,8 @@ diff --git a/res/values/strings_ext.xml b/res/values/strings_ext.xml+index 0ac5bf5..2de2e18 100644 --- a/res/values/strings_ext.xml +++ b/res/values/strings_ext.xml-@@ -358,4 +358,18 @@+@@ -371,4 +371,18 @@ For compatibility, this app can still see clipboard metadata, such as whether an      <string name="app_clipboard_read_shared_uid_warning">"The clipboard access setting, blocked access message setting, and temporary Paste access are shared among these apps:  %1$s"</string>  @@ -20,25 +21,9 @@ diff --git a/res/values/strings_ext.xml b/res/values/strings_ext.xml +    <string name="maos_attestation_entry_summary">Server-verified hardware attestation</string> +  </resources>-diff --git a/res/xml/security_advanced_settings.xml b/res/xml/security_advanced_settings.xml---- a/res/xml/security_advanced_settings.xml-+++ b/res/xml/security_advanced_settings.xml-@@ -28,6 +28,13 @@-     <com.android.settingslib.widget.UntitledPreferenceCategory-         android:order="210"-         android:key="security_category" />-+-+    <Preference-+        android:order="220"-+        android:key="maos_attestation"-+        android:title="@string/maos_attestation_entry_title"-+        android:summary="@string/maos_attestation_entry_summary"-+        android:fragment="com.android.settings.security.MaosAttestationFragment" />- -     <Preference-         android:order="230" diff --git a/res/xml/maos_attestation_settings.xml b/res/xml/maos_attestation_settings.xml new file mode 100644+index 0000000..c61a5eb --- /dev/null +++ b/res/xml/maos_attestation_settings.xml @@ -0,0 +1,28 @@@@ -70,8 +55,32 @@ new file mode 100644 +        android:selectable="false" /> + +</PreferenceScreen>+diff --git a/res/xml/security_dashboard_settings.xml b/res/xml/security_dashboard_settings.xml+index 3bb7d69..7f29614 100644+--- a/res/xml/security_dashboard_settings.xml++++ b/res/xml/security_dashboard_settings.xml+@@ -62,6 +62,18 @@+             settings:keywords="@string/keywords_biometric_settings" />+     </PreferenceCategory>+ ++    <!-- MAOS: server-verified device attestation, directly on the++         SecuritySettings dashboard (Settings > Security & privacy),++         above More security settings. Following the surrounding entries++         in this screen, no icon is set. -->++    <Preference++        android:order="90"++        android:key="maos_attestation"++        android:title="@string/maos_attestation_entry_title"++        android:summary="@string/maos_attestation_entry_summary"++        android:fragment="com.android.settings.security.MaosAttestationFragment"++        settings:keywords="@string/maos_attestation_entry_title" />+++     <Preference+         android:order="100"+         android:key="security_advanced_settings" diff --git a/src/com/android/settings/security/MaosAttestationClient.java b/src/com/android/settings/security/MaosAttestationClient.java new file mode 100644+index 0000000..4510591 --- /dev/null +++ b/src/com/android/settings/security/MaosAttestationClient.java @@ -0,0 +1,240 @@@@ -317,6 +326,7 @@ new file mode 100644 +} diff --git a/src/com/android/settings/security/MaosAttestationFragment.java b/src/com/android/settings/security/MaosAttestationFragment.java new file mode 100644+index 0000000..fcfe8ea --- /dev/null +++ b/src/com/android/settings/security/MaosAttestationFragment.java @@ -0,0 +1,122 @@