3 sha256 "c04dd170cf0ef1c9fd6d442c556fb9e8cc9a698ebb997254389e161c29f54a8d"
5 url "https://qn.cache.wpscdn.cn/kdocs/apk/kdesktopmac/KDocs_#{version.csv.second}_v#{version.csv.first}.dmg",
6 verified: "qn.cache.wpscdn.cn/kdocs/apk/kdesktopmac/"
8 desc "Online collaborate editor for Word, Excel and PPT documents"
9 homepage "https://www.kdocs.cn/"
12 url "https://www.kdocs.cn/kd/api/configure/list?idList=appOfficial"
13 regex(/kdocs[._-](\d+(?:\.\d+)*)[._-]v?(\d+(?:\.\d+)+)\.dmg/i)
14 strategy :json do |json, regex|
15 json_string = json.dig("data", "appOfficial")
16 next if json_string.blank?
18 app_json = Homebrew::Livecheck::Strategy::Json.parse_json(json_string)
19 match = app_json.dig("kdesktopMacOfficial", 0, "url")&.match(regex)
22 "#{match[2]},#{match[1]}"
26 depends_on macos: ">= :high_sierra"
31 "~/Library/Preferences/com.kingsoft.kdocs.mac.plist",
32 "~/Library/Saved Application State/com.kingsoft.kdocs.mac.savedState",