Use `\OCP\JSON::checkAppEnabled('files_sharing');` instead.