Unity Cloud Build webhook artifact md5sum incorrect

Hello,
I’m downloading a build via the json that comes through via webhook. Webhook json reports a “md5sum” of xUEMssO+Xkmv6yw78U/y9Q== whereas PHP and other md5 generators report the checksum as c5410cb2c3be5e49afeb2c3bf14ff2f5. The file size is correct and the file itself is OK. What is the “md5sum” property in the json’s articfacts/files/md5sum actually for? Because it’s not the file…

Here’s the json:

{
  "buildNumber": 5,
  "buildStatus": "success",
  "buildTargetName": "Default Android GearVR",
  "cleanBuild": false,
  "lastBuiltRevision": "3dd49b6761361fac40a241b210721e3730ba801a",
  "links": {
    "api_self": {
      "href": "/api/orgs/virtual-reality-rehab-inc/projects/unitycloudbuildtesting/buildtargets/default-android-gearvr/builds/5",
      "method": "get"
    },
    "api_share": {
      "href": "/api/shares/Zy-DXkw3zE",
      "method": "get"
    },
    "artifacts": [
      {
        "files": [
          {
            "filename": "Default Android GearVR.apk",
            "href": "https://storage.googleapis.com/unitycloud-build-user-svc-live-build/2473928866007%2Ff27be5f6-db91-424e-9838-81d096bc6912%2Fdefault-android-gearvr-5%2FDefault%20Android%20GearVR.apk?GoogleAccessId=signurl-sa%40unity-cs-cloudbuild-prd.iam.gserviceaccount.com&Expires=1543934186&Signature=C2SVB63oSmjwCRWziIUS3RMbO1cOX1mU7RHTXCXr4L3IRy9Um1aajYSQcXjB2UFwP65o3LX0uNJOu1p5%2FWoUVoNVcFBAmQPoIxO9%2B1APBdXhSi2uibfOUodd2nIdINKfG0Z6neYvWKXl%2Fyp%2B%2BzkbesA3KJI%2B%2BIuL8lQiySSBncenaICfIXCqtSN4KED874%2FlDf8BbHkZMmOClRdBkazyGtUbHk%2FmMUOnKU36fHYfTFqxd50gzOZiIM%2BzcEWFYVP0CzyLaqPUB097zFyDSKdoXg1qM71WGnljyXm3%2BkuyA3aMw6aJCLHDXjcUW%2BeepKbOiYKOxAWsQQPOOT47hMaT4g%3D%3D&response-content-type=application%2Foctet-stream&response-content-disposition=attachment%3B%20filename%3Dvirtual-reality-rehab-inc-unitycloudbuildtesting-default-android-gearvr-5.apk",
            "md5sum": "xUEMssO+Xkmv6yw78U/y9Q==",
            "resumable": false,
            "size": 12612804
          }
        ],
        "key": "primary",
        "name": ".APK file",
        "primary": true,
        "show_download": true
      }
    ],
    "dashboard_download": {
      "href": "https://developer.cloud.unity3d.com/build/orgs/virtual-reality-rehab-inc/projects/unitycloudbuildtesting/buildtargets/default-android-gearvr/builds/5/download/",
      "method": "get"
    },
    "dashboard_download_direct": {
      "href": "https://developer.cloud.unity3d.com/build/orgs/virtual-reality-rehab-inc/projects/unitycloudbuildtesting/buildtargets/default-android-gearvr/builds/5/download/direct/",
      "method": "get"
    },
    "dashboard_log": {
      "href": "/build/orgs/virtual-reality-rehab-inc/projects/unitycloudbuildtesting/buildtargets/default-android-gearvr/builds/5/log",
      "method": "get"
    },
    "dashboard_project": {
      "href": "/build/orgs/virtual-reality-rehab-inc/projects/unitycloudbuildtesting",
      "method": "get"
    },
    "dashboard_summary": {
      "href": "/build/orgs/virtual-reality-rehab-inc/projects/unitycloudbuildtesting/buildtargets/default-android-gearvr/builds/5/summary",
      "method": "get"
    },
    "dashboard_url": {
      "href": "https://developer.cloud.unity3d.com",
      "method": "get"
    },
    "share_url": {
      "href": "https://developer.cloud.unity3d.com/share/Zy-DXkw3zE/",
      "method": "get"
    }
  },
  "local": false,
  "orgForeignKey": "redacted",
  "platform": "android",
  "platformName": "Android",
  "projectGuid": "redacted",
  "projectName": "UnityCloudBuildTesting",
  "scmType": "git",
  "startedBy": "redacted"
}

The APK build is available here:
https://www.naplandgames.com/vrrbuildtest/UnityCloudBuildTesting/Default_Android_GearVR_20181204_failed.apk

Thanks!

Nevermind. I love how twice in 2 days I’ve answered my own question as soon as I post :stuck_out_tongue:
For anyone else stumped: The “md5sum” is base64… All is well.

Yup. It’s the binary value encoded as base64 rather than the hex. If you have the hex string you can decode it in php like so:

[CODESHORTCUT]print base64_encode(hex2bin(‘c5410cb2c3be5e49afeb2c3bf14ff2f5’));[/CODESHORTCUT]