flat_z has been researching RAPs and RIFs for years with one of the more recent PS3 RIF to RAP / RAP to RIF converters being RifConv GUI, and today he hinted at how to install PS4 PKG Files (Tutorial) with the function itself rather than through the PS4 Debug Settings.
@BadChoicesZ in the Shoutbox briefly explained this and reminded us what @flatz mentioned on Twitter, that as you'll still need a RIF file to make the PS4 Package playable.
Below are the related Tweets for PlayStation 4 developers and others interested:
Code:libSceAppInstUtil.sprx: sceAppInstUtilAppInstallPkg("/user/data/XXX.pkg", 0);
And before anyone asks why this is news ( ) it is because... IT'S FLAT_Z WHO SPOKE!!!
Finally, below are a few video demos of what appears to be installing PS4 PKG's on Debug / Retail Firmware from #MadPictures via @toni1988 in the Shoutbox!
The uint64 at +0x408 (or +0x8 from start of actual RIF data) is used to locate accompanying data in act.dat.
See 0x28C0D0 (verify RIF) and 0x289D20 (decrypt RIF) in SceShellCore.