diff --git a/tern/formats/cyclonedx/cyclonedxjson/package_helpers.py b/tern/formats/cyclonedx/cyclonedxjson/package_helpers.py index 63fadc72..5c2f52da 100644 --- a/tern/formats/cyclonedx/cyclonedxjson/package_helpers.py +++ b/tern/formats/cyclonedx/cyclonedxjson/package_helpers.py @@ -26,6 +26,9 @@ def get_package_dict(os_guess, package): purl_name = cyclonedx_common.get_purl_name(package.name, package.pkg_format) purl = PackageURL(purl_type, purl_namespace, purl_name, package.version) + if purl_type == "apk": + # Update purl to remove "apk" from the string + purl = PackageURL(purl_namespace, purl_name, package.version) package_dict['purl'] = str(purl) if package.pkg_license: