public async void VerifyRemoteAssetBundle(RemoteAssetBundle bundle, bool verified)
    {
        Object jwt      = GUIConfigureTab.jwtFile;
        string endpoint = FormatEndpoint(uploadEndpoint);

        if (!string.IsNullOrEmpty(endpoint))
        {
            string jwtName = jwt ? jwt.name : null;
            try
            {
                EditorUtility.DisplayProgressBar("Remote Asset Bundles", string.Format("Updating Asset Bundle {0} from {1}", bundle.info.name, bundle.appName), 1.0f);
                RemoteAssetBundle newBundle = await RemoteAssetBundleUtils.VerifyAssetBundle(endpoint, bundle, verified, jwtName);

                GUIEditTab.AddMessage(string.Format("Successfully Updated Asset Bundle {0} from app {1}", bundle.info.name, bundle.appName), MessageStatus.Success);
                EditorUtility.DisplayProgressBar("Remote Asset Bundles", "The content of the manifest has changed - refreshing now ...", 1.0f);
                await OnLoadManifests();

                GUIEditTab.SelectCurrentManifest(bundle.appName);
                EditorUtility.ClearProgressBar();
            }
            catch (System.Exception ex)
            {
                EditorUtility.ClearProgressBar();
                GUIEditTab.AddMessage(string.Format("Unable to update Asset Bundle {0} from app {1}. \n Reason: {2}", bundle.info.name, bundle.appName, ex.Message), MessageStatus.Error);
                throw;
            }
        }
    }
Example #2
0
        public IEnumerator VerifyUpdateAssetBundle()
        {
            Debug.Log("Testing RemoteAssetBundleUtils.VerifyAssetBundle");
            Task <RemoteAssetBundle> task = RemoteAssetBundleUtils.VerifyAssetBundle(TestConstants.TEST_SERVER_URL, bundle, true, TestConstants.JWT_TOKEN_NAME);

            while (!task.IsCompleted)
            {
                yield return(null);
            }
            bundle = task.Result;
            Assert.IsTrue(bundle.toHash128().isValid);
            Assert.IsTrue(bundle.verified);
        }