Repository navigation
Check the built Quest package's label, package name and permissions - #32
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
quest-build.ymlruns.github/scripts/check-quest-package.shafter 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) andAssets/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 requestedHAND_TRACKINGagain, or showed another label, would have passed.The check now also fails the build, for an APK and for an AAB, when:
com.CompanionIntelligence.CompanionCapture;Companion Scanin every locale;HAND_TRACKINGis back orINTERNETis gone;oculus.software.handtrackingoroculus.software.eye_trackingfeature.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:
aapt2 dump badging, not only itspackageandtargetSdkVersionlines;uses-permissionanduses-permission-sdk-23names and theuses-featurenames, frombundletool 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 withbundletool dump resources --resource string/app_name --values. bundletool prints nothing for a name that keeps its@or apackage:prefix, so the script drops both.Package name. It must be
com.CompanionIntelligence.CompanionCapture.Label. It must be
Companion Scanin every locale:application-labelandapplication-label-<locale>line. The test fixture, from a debug build, has 86 of them;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-permissionanduses-permission-sdk-23names together must be exactlyexpected_permissions. Each extra and each missing permission is one error that names it.com.oculus.permission.USE_ANCHOR_APIcom.oculus.permission.USE_SCENEhorizonos.permission.HEADSET_CAMERAandroid.permission.CAMERAcom.oculus.permission.USE_PASSTHROUGH_CAMERAandroid.permission.INTERNETcom.CompanionIntelligence.CompanionCapture.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSIONFeatures. The package must not declare
oculus.software.handtrackingoroculus.software.eye_tracking. The app uses controllers only, and the source manifest removes both. The check also fails if it finds nouses-featureat all, so a change in the tools' output cannot make it pass without checking.Everything else is unchanged:
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.shruns the check script without a build or Docker.docker,aapt2,java(for apksigner and bundletool),jarsignerandkeytoolprint fixtures. Thedockerstub runs the inspect script on the machine itself, with the stub tools in place of the image's.aapt2-badging.txtis theaapt2 dump badgingoutput of a debug build of the app.dist/.@com.CompanionIntelligence.CompanionCapture:string/app_name);HAND_TRACKING, and the hand tracking feature;uses-permission-sdk-23one;Docs (
55485b2)README.md, in "Building and releasing the Quest APK", under "More details":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:
git archiveof the commit, in about 3 s;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:
HAND_TRACKINGadded to the expected permissionsuses-permission-sdk-23ignoreduses-permission-sdk-23ignored@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
dockerstub:The bad package's six errors:
frlabel "Companion Capture";BLUETOOTH, withmaxSdkVersion;RECORD_AUDIO, asuses-permission-sdk-23;HAND_TRACKING;oculus.software.handtracking;oculus.software.eye_tracking, inside a<feature-group>.Linters.
gpurunner label.Not verified
expected_permissionsor the source manifest is fixed. For example, an SDK update might add a permission.@string/app_namewith a single default value is inferred from the APK, where every locale shows the default label.<permission>elements the package declares;com.oculus.handtracking.*meta-data.Not changed
.github/scripts/**in a few seconds, as a separate change.Merge notes
main@ae09e37.mainhas since gained Start the Quest app on the GDino preset, with a prompt of common room objects #31 (d1de584), which also changesREADME.md.git merge-treewith the currentmainis clean.🤖 Generated with Claude Code