最近找到了可以获取 Microsoft Edge 的 Offline Installer (不需要管理员权限安装的 exe 包体,跟官网提供的 enterprise msi 包体不同)的一个 API:
curl -XPOST "https://msedge.api.cdp.microsoft.com/api/v1.1/internal/contents/Browser/namespaces/Default/names/msedge-stable-win-x64/versions/91.0.864.54/files?action=GenerateDownloadInfo&foregroundPriority=true" -d '{"targetingAttributes":{}}'
除了 Offline Installer 外,还有增量包体。应该是 MicrosoftEdgeUpdate
程序调用的 API,用来检查和下载更新。一个返回示例:
[{"FileId":"MicrosoftEdge_X64_91.0.864.54_91.0.864.41.exe","Url":"http://msedge.f.tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/cfa50eb3-534c-46d0-a913-a39d579988b7?P1=1627558634&P2=404&P3=2&P4=HwucV0KjBP5sgCX2JFNT1DJwRmSPPyB6s1Uz1alehA9pHlFW%2bG9u1aD1nouRZDtTluLU1qtiwL2tYXfKmm4dfA%3d%3d","SizeInBytes":8344976,"Hashes":{"Sha1":"pYhI3UY0IAQf7ko9D4eAWuCbYJg=","Sha256":"5e2p9gmu8QMzfWNVXjvXbovZeDxmGHWIkdj1oVbMuk8="},"DeliveryOptimization":{"CatalogId":"5e2p9gmu8QMzfWNVXjvXbovZeDxmGHWIkdj1oVbMuk8=","Properties":{"IntegrityCheckInfo":{"PiecesHashFileUrl":"http://msedge.f.dl.delivery.mp.microsoft.com/filestreamingservice/files/cfa50eb3-534c-46d0-a913-a39d579988b7/pieceshash","HashOfHashes":"w7aWGGXHf/q+ZOy0qpPYy8v4+KPQJbR9WgH6CPRHVuo="}}}},{"FileId":"MicrosoftEdge_X64_91.0.864.54_91.0.864.48.exe","Url":"http://msedge.f.tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/8fe8e0e7-8dec-4df5-96f7-9b645ef693b9?P1=1627558634&P2=404&P3=2&P4=SCEjcYBbLe01zj1N0b9JkhWfOKDSPp5r1VnFEi%2fev2otedtbrAofCNkx8LO3J7Hqld0nCtWk1vUqnB8vwIhkpg%3d%3d","SizeInBytes":7988112,"Hashes":{"Sha1":"bwUU0Xz8PaR2BCa8MjEWRPNFE6o=","Sha256":"7vLwiCEPFLvTGGpj6FaaWJDoCMxpFt170EoAaLP/ew8="},"DeliveryOptimization":{"CatalogId":"7vLwiCEPFLvTGGpj6FaaWJDoCMxpFt170EoAaLP_ew8=","Properties":{"IntegrityCheckInfo":{"PiecesHashFileUrl":"http://msedge.f.dl.delivery.mp.microsoft.com/filestreamingservice/files/8fe8e0e7-8dec-4df5-96f7-9b645ef693b9/pieceshash","HashOfHashes":"c+b0U3LKT+S6jDJqEykw7sNSaQVHu5d1FVwohBFC9Nc="}}}},{"FileId":"MicrosoftEdge_X64_91.0.864.54_91.0.864.53.exe","Url":"http://msedge.f.tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/8f3a0195-f9c4-4804-b75c-d61909420e5d?P1=1627558634&P2=404&P3=2&P4=fxiOAn1XkVuEqJHS1LrXu89onmEJplV%2fOT9XBRB6QXDxTUXIc0nEmuODTku7d%2bOZiFq1Mw0g%2bizmh%2bpvnzoyJQ%3d%3d","SizeInBytes":5313424,"Hashes":{"Sha1":"554gbMA+Mt8P9tH/WrspG79Y1Bg=","Sha256":"0Ar2PCKE4DAHwuLCJMBZwdQfbyNPwfATtJjzwUD6Qqk="},"DeliveryOptimization":{"CatalogId":"0Ar2PCKE4DAHwuLCJMBZwdQfbyNPwfATtJjzwUD6Qqk=","Properties":{"IntegrityCheckInfo":{"PiecesHashFileUrl":"http://msedge.f.dl.delivery.mp.microsoft.com/filestreamingservice/files/8f3a0195-f9c4-4804-b75c-d61909420e5d/pieceshash","HashOfHashes":"wDktXJkxxo7nqsIr32QIC3fX5iVOchaGrj7FIVumQhE="}}}},{"FileId":"MicrosoftEdge_X64_91.0.864.54.exe","Url":"http://msedge.f.tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/8ea0c2f4-26f9-408f-a75d-8d9bcbe1d7e8?P1=1627558634&P2=404&P3=2&P4=OXQZgotFC672T4jLkEsKlF5jui%2fPt1LJyCI64ifymJS2m1cW%2bWYUY0xurPSFT3MMWacKmtsWp2BwCBUritWBbg%3d%3d","SizeInBytes":102998928,"Hashes":{"Sha1":"cX7CNgxfQpSMDpxv5EHjxZoMdAc=","Sha256":"8kzuS/mKg8LlHd0yD2DriJ0B4ZIEG4rCiFP17pxj0C0="},"DeliveryOptimization":{"CatalogId":"8kzuS_mKg8LlHd0yD2DriJ0B4ZIEG4rCiFP17pxj0C0=","Properties":{"IntegrityCheckInfo":{"PiecesHashFileUrl":"http://msedge.f.dl.delivery.mp.microsoft.com/filestreamingservice/files/8ea0c2f4-26f9-408f-a75d-8d9bcbe1d7e8/pieceshash","HashOfHashes":"nPZwsmRwknu0fXGN0UaVpCkIzqDAZf5O/VHsSPgNNCg="}}}}]
取其中一个展开:
{
"FileId": "MicrosoftEdge_X64_91.0.864.54_91.0.864.53.exe",
"Url": "http://msedge.f.tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/8f3a0195-f9c4-4804-b75c-d61909420e5d?P1=1627558634&P2=404&P3=2&P4=fxiOAn1XkVuEqJHS1LrXu89onmEJplV%2fOT9XBRB6QXDxTUXIc0nEmuODTku7d%2bOZiFq1Mw0g%2bizmh%2bpvnzoyJQ%3d%3d",
"SizeInBytes": 5313424,
"Hashes": {
"Sha1": "554gbMA+Mt8P9tH/WrspG79Y1Bg=",
"Sha256": "0Ar2PCKE4DAHwuLCJMBZwdQfbyNPwfATtJjzwUD6Qqk="
},
"DeliveryOptimization": {
"CatalogId": "0Ar2PCKE4DAHwuLCJMBZwdQfbyNPwfATtJjzwUD6Qqk=",
"Properties": {
"IntegrityCheckInfo": {
"PiecesHashFileUrl": "http://msedge.f.dl.delivery.mp.microsoft.com/filestreamingservice/files/8f3a0195-f9c4-4804-b75c-d61909420e5d/pieceshash",
"HashOfHashes": "wDktXJkxxo7nqsIr32QIC3fX5iVOchaGrj7FIVumQhE="
}
}
}
}
接口返回有包体的下载 URL 和哈希。我想下载包体后做哈希校验,问题出现。Sha1
和 Sha256
这两个值看上去应该就是 base64,但 decode 出来后不是目标哈希值。有没有可能是其他类型的编码,求个思路。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.