Search Unity

Unity Cloud Build webhook artifact md5sum incorrect

Discussion in 'Unity Build Automation' started by Naphier, Dec 4, 2018.

  1. Naphier

    Naphier

    Joined:
    Aug 4, 2014
    Posts:
    114
    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:
    Code (csharp):
    1. {
    2.   "buildNumber": 5,
    3.   "buildStatus": "success",
    4.   "buildTargetName": "Default Android GearVR",
    5.   "cleanBuild": false,
    6.   "lastBuiltRevision": "3dd49b6761361fac40a241b210721e3730ba801a",
    7.   "links": {
    8.     "api_self": {
    9.       "href": "/api/orgs/virtual-reality-rehab-inc/projects/unitycloudbuildtesting/buildtargets/default-android-gearvr/builds/5",
    10.       "method": "get"
    11.     },
    12.     "api_share": {
    13.       "href": "/api/shares/Zy-DXkw3zE",
    14.       "method": "get"
    15.     },
    16.     "artifacts": [
    17.       {
    18.         "files": [
    19.           {
    20.             "filename": "Default Android GearVR.apk",
    21.             "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",
    22.             "md5sum": "xUEMssO+Xkmv6yw78U/y9Q==",
    23.             "resumable": false,
    24.             "size": 12612804
    25.           }
    26.         ],
    27.         "key": "primary",
    28.         "name": ".APK file",
    29.         "primary": true,
    30.         "show_download": true
    31.       }
    32.     ],
    33.     "dashboard_download": {
    34.       "href": "https://developer.cloud.unity3d.com/build/orgs/virtual-reality-rehab-inc/projects/unitycloudbuildtesting/buildtargets/default-android-gearvr/builds/5/download/",
    35.       "method": "get"
    36.     },
    37.     "dashboard_download_direct": {
    38.       "href": "https://developer.cloud.unity3d.com/build/orgs/virtual-reality-rehab-inc/projects/unitycloudbuildtesting/buildtargets/default-android-gearvr/builds/5/download/direct/",
    39.       "method": "get"
    40.     },
    41.     "dashboard_log": {
    42.       "href": "/build/orgs/virtual-reality-rehab-inc/projects/unitycloudbuildtesting/buildtargets/default-android-gearvr/builds/5/log",
    43.       "method": "get"
    44.     },
    45.     "dashboard_project": {
    46.       "href": "/build/orgs/virtual-reality-rehab-inc/projects/unitycloudbuildtesting",
    47.       "method": "get"
    48.     },
    49.     "dashboard_summary": {
    50.       "href": "/build/orgs/virtual-reality-rehab-inc/projects/unitycloudbuildtesting/buildtargets/default-android-gearvr/builds/5/summary",
    51.       "method": "get"
    52.     },
    53.     "dashboard_url": {
    54.       "href": "https://developer.cloud.unity3d.com",
    55.       "method": "get"
    56.     },
    57.     "share_url": {
    58.       "href": "https://developer.cloud.unity3d.com/share/Zy-DXkw3zE/",
    59.       "method": "get"
    60.     }
    61.   },
    62.   "local": false,
    63.   "orgForeignKey": "redacted",
    64.   "platform": "android",
    65.   "platformName": "Android",
    66.   "projectGuid": "redacted",
    67.   "projectName": "UnityCloudBuildTesting",
    68.   "scmType": "git",
    69.   "startedBy": "redacted"
    70. }
    The APK build is available here:
    https://www.naplandgames.com/vrrbuildtest/UnityCloudBuildTesting/Default_Android_GearVR_20181204_failed.apk

    Thanks!
     
  2. Naphier

    Naphier

    Joined:
    Aug 4, 2014
    Posts:
    114
    Nevermind. I love how twice in 2 days I've answered my own question as soon as I post :p
    For anyone else stumped: The "md5sum" is base64... All is well.
     
  3. timtunity3d

    timtunity3d

    Unity Technologies

    Joined:
    Oct 1, 2015
    Posts:
    131
    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:

    print base64_encode(hex2bin('c5410cb2c3be5e49afeb2c3bf14ff2f5'));