feat(libSceAppContent): implement sceAppContentGetEntitlementKey #9638
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9638"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Noxy-HNR on 2026-10-22T05:43:56Z.
What
Converts
sceAppContentGetEntitlementKeyfromNotImplemented_nid_no_patch. The library installs no additional content, so it answers the waysceAppContentGetAddcontInfoalready does:sceAppContentInitializeit answersNOT_INITIALIZED;PARAMETER, as does a label with nonzero padding for SDK 0x01500000 and later, using the threshold ofsceAppContentGetAddcontInfo;DRM_NO_ENTITLEMENTand the 16-byte key is left unchanged.The
(service label, label, 16-byte key)signature follows shadPS4's app_content.h. shadPS4 also answersPARAMETERfor service labels above 7; like the other add-content exports here, this one ignores the service label on purpose. None of it is measured on a console, which its own entry indocs/dev/debt/libSceAppContent.mdrecords; the pending-exports count there drops from 16 to 15. libSceAppContent goes from 16/32 to 17/32 intools/progress.py.Tested
Windows 11 26H2 (build 10.0.26300, WinLibs GCC 15.2.0 r7, full Release build), head 0be7638 on main
01f9930, after #9114 merged:guest_appcontentpasses, 1/1, including #9114'ssceAppContentTemporaryDataMountchecks. It checkssceAppContentGetEntitlementKeybefore initialization, with null arguments, with service labels 0 and 7, with nonzero label padding across SDK 0x014fffff to 0x03500000, and thatDRM_NO_ENTITLEMENTleaves a sentinel-filled key unchanged.tools/check_conventions.py --base origin/mainandtools/check_test_registration.pypass.tools/pr_overlap.pyreports no overlap with other open pull requests; #6044, which conflicts withmain, sharesGuestAppContent.cppbut could not be compared. No title tested.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-22T06:01:42Z.
Review: COMMENTED
Checked against main
4a17c7175and shadPS4 0918faa (src/core/libraries/app_content/app_content.cpp L329-L357):service_label > 7is the only difference, and the debt file records it. The pending-exports count of 16 matches the remainingNotImplemented_nid_no_patchcalls in Export.cpp.sceAppContentGetEntitlementKeysentence lands right before "Its 16-byte layout (DataSize, thenDownloadedSize, both 64-bit)…". That sentence describes the download-progress structure, but it now reads as if it described the entitlement key, which is also 16 bytes. Could the new sentence move after the SharpProspero layout sentence, or could "Its" become "The progress structure's"?Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-10-22T08:13:17Z.
One inconsistency between the code and its debt entry to resolve before merge; the rest verifies clean.
The debt bullet says shadPS4 "also rejects service labels above 7", but the implementation discards
service_label((void)service_label;) and the test only exercises 7 — no value above 7 is rejected. So the entry names behavior the code does not have. Either align with the reference (reject out-of-range service labels like shadPS4) or state in the debt entry's gap sentence that the rejection is deliberately not carried over. As written the code and the doc contradict each other.Verified clean: NOT_INITIALIZED first, PARAMETER for null label/engine-key,
DRM_NO_ENTITLEMENTfor a well-formed label, the output buffer untouched on every error path (the test asserts byte-level equality against a 0x5a sentinel), the label validity threshold matchingsceAppContentGetAddcontInfo's 0x01500000 rule, and the pending-export count going 17 → 16 indocs/dev/debt/libSceAppContent.mdhonestly.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T09:20:55Z.
Review: DISMISSED
The flow and focused test are otherwise consistent with the modeled no-additional-content case, and the test checks the key remains byte-for-byte unchanged. Current-head issues to resolve: - The debt entry says shadPS4 rejects
service_label > 7, but this wrapper castsservice_labelto void and the test has no >7 case. Either match the reference and add boundary tests or explicitly document this deliberate difference. - The debt entry says the entitlement key’s 16-byte layout is(DataSize, DownloadedSize), which is the download-progress structure, not the key. The prior reviewer’s wording note is still present; disambiguate or remove this layout claim. - Exact-head conventions and whitespace checks pass. Hosted eligibility/conventions/intake/labels/report pass, with product jobs skipped. I attempted a local CMake configure forguest_appcontent, but it stops before build because SDL2 is uninitialized and XRandR support is unavailable; I did not run the test. The Windowsguest_appcontentpass is author-reported.I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.