Skip to content

Check the built Quest package's label, package name and permissions - #32

Merged
mrhegemon merged 2 commits into
mainfrom
ci/package-label-permissions
Nov 14, 2026
Merged

mrhegemon merged 2 commits into
mainfrom
ci/package-label-permissions

Conversation

@mrhegemon

Copy link
Copy Markdown
Member

Summary

quest-build.yml runs .github/scripts/check-quest-package.sh after each Quest build, in the debug job and in the release job. The check read the versionCode, versionName, target API level and signature, but not the label or the permissions of the built package. The Unity tests check the project settings (AppIdentityTests) and Assets/Plugins/Android/AndroidManifest.xml (AndroidPermissionsTests). But the Meta XR SDK, Unity and AndroidX add permissions and features to the manifest at build time. So a build that requested HAND_TRACKING again, or showed another label, would have passed.

The check now also fails the build, for an APK and for an AAB, when:

  • the package name is not com.CompanionIntelligence.CompanionCapture;
  • the label is not Companion Scan in every locale;
  • the requested permissions are not exactly the seven the app needs, for example when HAND_TRACKING is back or INTERNET is gone;
  • the package declares the oculus.software.handtracking or oculus.software.eye_tracking feature.

This PR is two commits on main @ ae09e37, and no workflow changes. The checks were tested with stub tools, and with Unity's own Android tools on Windows. Neither the GameCI Unity image nor GitHub Actions ran them.

What changed

The checks (e625d1a)

In .github/scripts/check-quest-package.sh:

  • What the Unity image prints. The inspect script that runs in the image now prints:

    • for an APK, all of aapt2 dump badging, not only its package and targetSdkVersion lines;
    • for an AAB, the package name, the label, the uses-permission and uses-permission-sdk-23 names and the uses-feature names, from bundletool dump manifest --xpath. The feature XPath is //uses-feature, so it includes features inside a <feature-group>.
  • An AAB's label. In an AAB the label is a reference such as @string/app_name. The script then prints every value of that string with bundletool dump resources --resource string/app_name --values. bundletool prints nothing for a name that keeps its @ or a package: prefix, so the script drops both.

  • Package name. It must be com.CompanionIntelligence.CompanionCapture.

  • Label. It must be Companion Scan in every locale:

    • in an APK, on every application-label and application-label-<locale> line. The test fixture, from a debug build, has 86 of them;
    • in an AAB, in every value of the label's string. The string must also have a default value.

    Each wrong label is one error that names its locales, such as "The APK's label is 'Companion Capture', not 'Companion Scan', in: fr".

  • Permissions. The uses-permission and uses-permission-sdk-23 names together must be exactly expected_permissions. Each extra and each missing permission is one error that names it.

    Permission For
    com.oculus.permission.USE_ANCHOR_API Space Setup
    com.oculus.permission.USE_SCENE Space Setup
    horizonos.permission.HEADSET_CAMERA the passthrough cameras
    android.permission.CAMERA the passthrough cameras
    com.oculus.permission.USE_PASSTHROUGH_CAMERA the passthrough cameras; Unity's Meta OpenXR package adds it
    android.permission.INTERNET the CV server
    com.CompanionIntelligence.CompanionCapture.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION AndroidX Core adds it: a signature permission for the app's own receivers
  • Features. The package must not declare oculus.software.handtracking or oculus.software.eye_tracking. The app uses controllers only, and the source manifest removes both. The check also fails if it finds no uses-feature at all, so a change in the tools' output cannot make it pass without checking.

  • Everything else is unchanged:

    • finding the image;
    • the version and signature checks, and the release certificate checks;
    • the files in dist/ and the step outputs.

    On success the log also says "Package checks passed: com.CompanionIntelligence.CompanionCapture, label 'Companion Scan' in every locale, the 7 expected permissions".

Tests for the checks (e625d1a)

.github/scripts/tests/test-check-quest-package.sh runs the check script without a build or Docker.

  • Stubs. Stub docker, aapt2, java (for apksigner and bundletool), jarsigner and keytool print fixtures. The docker stub runs the inspect script on the machine itself, with the stub tools in place of the image's.
  • Fixtures.
    • aapt2-badging.txt is the aapt2 dump badging output of a debug build of the app.
    • The AAB and signature fixtures copy the output format of the same tools in Unity 6000.6.9f1 (aapt2 2.20, apksigner, bundletool 1.17.2). That is how those tools print small packages built and signed with them. The digests are made up.
  • 25 cases, 11 for an APK and 14 for an AAB.
    • What each case checks: the exit code, and the errors by number and by text. A passing case also checks the step outputs and the file in dist/.
    • Pass:
      • a debug build and a release build;
      • in an AAB, a label reference with the package name (@com.CompanionIntelligence.CompanionCapture:string/app_name);
      • in an AAB, a label that is not a reference.
    • Fail:
      • a release build signed with the debug key;
      • HAND_TRACKING, and the hand tracking feature;
      • a wrong label in one locale, and the old label;
      • no label (APK);
      • in an AAB, a label string without a default value, and a label that names no resource;
      • a missing permission, and an extra uses-permission-sdk-23 one;
      • another package name.
  • It needs bash 4.4 or later, awk, and GNU sed and coreutils. Git Bash on Windows works.

Docs (55485b2)

  • README.md, in "Building and releasing the Quest APK", under "More details":
    • a "Manifest" item lists what the check expects and what each permission is for, and says where to change the list;
    • a "Testing the checks" item says how to run the test.
  • docs/qa-ci.md: Job D lists the new checks and the test.

Verification

All on the final commit, 55485b2.

  • The test. 25 of 25 cases pass:

    • on Ubuntu 24.04 (bash 5.2.21, GNU sed 4.9), from a git archive of the commit, in about 3 s;
    • in Git Bash on Windows, from a copy of the commit with LF line endings and from one with CRLF line endings, in about 40 s each.
  • Broken checks fail the test. Nine copies of the script, each with one check broken, ran on Linux. Each fails the cases that cover the broken check:

    Broken check Cases that fail
    HAND_TRACKING added to the expected permissions all 25
    APK: uses-permission-sdk-23 ignored APK: a permission for API 23 and later
    AAB: uses-permission-sdk-23 ignored AAB: a permission for API 23 and later
    no unwanted features the hand tracking feature (APK, AAB)
    AAB: the label's resource looked up with its @ 12 of the 14 AAB cases: all but "a label that names no resource" and "a label that is not a reference"
    AAB: the label's resource looked up with its package prefix AAB: a label reference with the package name
    APK: only the default label read APK: a wrong label in one locale, and the old label
    no package name check another package name (APK, AAB)
    no check for missing permissions a missing permission, and another package name (APK, AAB)
  • Unity's own Android tools. The check script also ran with Unity 6000.6.9f1's Windows tools in place of the stubs, through the docker stub:

    • The tools: aapt2 2.20 and apksigner from build-tools 36.0.0, bundletool 1.17.2, and jarsigner and keytool from Unity's OpenJDK 17.
    • The packages: small APKs and AABs built with these tools. They were signed with two throwaway keys, one with the Android debug certificate's name and one release key.
    • Results:
      • a good package passes as a debug build signed with the debug key, and as a release build signed with the release key, both as an APK and as an AAB;
      • a good package signed with the debug key fails as a release build, with "The release APK is signed with the Android debug certificate" and the same error for the AAB;
      • a bad package fails with the same six errors as an APK and as an AAB.

    The bad package's six errors:

    • the fr label "Companion Capture";
    • BLUETOOTH, with maxSdkVersion;
    • RECORD_AUDIO, as uses-permission-sdk-23;
    • HAND_TRACKING;
    • oculus.software.handtracking;
    • oculus.software.eye_tracking, inside a <feature-group>.
  • Linters.

    • shellcheck 0.11.0 reports nothing on the check script, the inspect script it embeds, the test and the stubs.
    • actionlint 1.7.12 reports nothing when told about the self-hosted gpu runner label.
    • The repo pins neither tool.

Not verified

  • The real build. No Quest build ran with this change, so neither the GameCI Unity image nor GitHub Actions ran these checks.
    • The first build after merging is their first real run.
    • If its package differs from what the check expects, that build fails until expected_permissions or the source manifest is fixed. For example, an SDK update might add a permission.
  • An AAB built by Unity. None was inspected.
    • That its label is @string/app_name with a single default value is inferred from the APK, where every locale shows the default label.
    • The script also handles a reference with the package name, and a plain-text label.
  • The image's tools. The Linux image is assumed to have the same aapt2, apksigner and bundletool versions as the Windows editor used here, with the same output.
  • Not checked:
    • the launcher activity's own label, which is empty today;
    • <permission> elements the package declares;
    • com.oculus.handtracking.* meta-data.

Not changed

  • No workflow changes. The test runs only by hand. A job could run it on pull requests that change .github/scripts/** in a few seconds, as a separate change.

Merge notes

🤖 Generated with Claude Code

mrhegemon and others added 2 commits November 14, 2026 03:01
…ermission

The package check read versionCode, versionName, the target API level and the
signature only. The Unity tests read the project settings and
Assets/Plugins/Android/AndroidManifest.xml, not the manifest of the built
package, where the Meta XR SDK, Unity and AndroidX add permissions and
features. So no check failed if a build requested HAND_TRACKING again or
showed another label.

check-quest-package.sh now also checks, for an APK (aapt2 dump badging) and
for an AAB (bundletool dump manifest and dump resources):
- the package name is com.CompanionIntelligence.CompanionCapture;
- the label is "Companion Scan" in every locale. In an AAB the label is a
  reference such as @string/app_name, so every value of that string is read;
- the requested permissions, uses-permission-sdk-23 included, are exactly
  the seven the app needs, and the log names each other or missing one;
- there is no oculus.software.handtracking or oculus.software.eye_tracking
  feature, which the source manifest removes.

tests/test-check-quest-package.sh runs the script against stub docker, aapt2,
java (apksigner and bundletool), jarsigner and keytool. The APK fixture is the
aapt2 dump badging output of a debug build. The AAB and signature fixtures
follow the output of the tools in Unity 6000.6.9f1 (aapt2 2.20, apksigner
36.0.0, bundletool 1.17.2), taken from small packages built and signed with
them. Of its 25 cases, debug and release builds pass, and HAND_TRACKING, the
hand tracking feature, wrong labels, a missing or extra permission, another
package name and a release package signed with the debug key fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README.md and docs/qa-ci.md now say that the package check reads the built
package: its package name, its label in every locale, the exact permission set
with what each permission is for, and no hand or eye tracking feature. They
say where to change the permission list and how to run the stub test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mrhegemon
mrhegemon merged commit a5d69ee into main Nov 14, 2026
@mrhegemon
mrhegemon deleted the ci/package-label-permissions branch November 14, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant