@roeyb Great!
Yes... so you are correct and I updated my script as well to accommodate Catalina. My newest workflow is to take the unaltered DMG from avast and simply rename it to "avast.dmg" (much easier than packaging it) and upload that to Jamf. Then when installing Avast, I tell Jamf in the policy to "Cache" the avast DMG file and NOT install it. That will place the avast.dmg file in the Jamf waiting room which is generally more secured from users as, if I'm remembering correctly, requires root to access or alter. In that same policy that "caches" the avast.dmg file, I run the attached script. The script generally will do the same thing but now notice it also cleans up the associated dmg and .xml file that Jamf uses to determine if a package is cached. At the end of the policy I force an inventory update which tells Jamf that avast is now installed, and I believe also helps in cleaning up that the package has been cached but I don't recall if an inventory update is pertinent to that or not.