cask "wetype" do version "1.4.0,503" sha256 "843af117d30d0665c62660cd383e601733f3a28993f9adac1f6c6dea0eff504b" url "https://download.z.weixin.qq.com/app/mac/#{version.csv.first}/WeTypeInstaller_#{version.csv.first}_#{version.csv.second}.zip" name "WeType" name "微信输入法" desc "Text input app from WeChat team for Chinese users" homepage "https://z.weixin.qq.com/" livecheck do url "https://z.weixin.qq.com/web/api/app_info" regex(/WeTypeInstaller[._-]v?(\d+(?:\.\d+)+)[._-](\d+)\.zip/i) strategy :json do |json, regex| match = json.dig("data", "mac", "download_link")&.match(regex) next if match.blank? "#{match[1]},#{match[2]}" end end auto_updates true depends_on macos: ">= :catalina" installer manual: "WeTypeInstaller_#{version.csv.first}_#{version.csv.second}.app" uninstall delete: "/Library/Input Methods/WeType.app" zap trash: [ "~/Library/Application Support/WeType", "~/Library/Caches/com.tencent.inputmethod.wetype", "~/Library/Caches/WeType", "~/Library/HTTPStorages/com.tencent.inputmethod.wetype", "~/Library/Preferences/com.tencent.inputmethod.wetype.plist", ] end