cask "adobe-air" do version "51.4.1.2" sha256 "e8051b9051724406a1627de8593b16a135aa411413745aee6bd23379c88de261" url "https://airsdk.wxlift.com/assets/downloads/#{version}/AdobeAIR.dmg" name "Adobe AIR" desc "Framework used in the development of applications and games" homepage "https://airsdk.wxlift.com/" # The download page is rendered using JavaScript with the download links # obtained from https://airsdk.wxlift.com/main..js # Since the is not fixed in the filename, the current JavaScript # file needs to be extracted from the download page. livecheck do url :homepage regex(%r{/v?(\d+(?:\.\d+)+)/AdobeAIR\.dmg}i) strategy :page_match do |page, regex| js_file = page[/src=["']?(main.+\.js)\??["' >]/i, 1] next if js_file.blank? version_page = Homebrew::Livecheck::Strategy.page_content("https://airsdk.wxlift.com/#{js_file}") version_page[:content]&.scan(regex)&.map { |match| match[0] } end end depends_on :macos installer script: { executable: "Adobe AIR Installer.app/Contents/MacOS/Adobe AIR Installer", args: ["-silent"], sudo: true, } uninstall script: { executable: "Adobe AIR Installer.app/Contents/MacOS/Adobe AIR Installer", args: ["-uninstall"], sudo: true, }, rmdir: [ "/Applications/Adobe", "/Applications/Adobe/Flash Player", "/Applications/Adobe/Flash Player/AddIns", ] zap trash: [ "~/Library/Application Support/Adobe/AIR", "~/Library/Caches/com.adobe.air.ApplicationInstaller", ], rmdir: "~/Library/Application Support/Adobe" end