// called from native Android plugin, from separate thread public void OnSuccess(string buildPath, string[] paths, string[] hashes, string summaryHash) { var fileHashes = new FileHash[hashes.Length]; for (var i = 0; i < hashes.Length; i++) { var hash = hashes[i]; var path = paths[i]; fileHashes[i] = new FileHash(path, hash); } var buildHashes = new BuildHashes(buildPath, fileHashes, summaryHash); parent.Complete(HashGeneratorResult.FromBuildHashes(buildHashes)); }
public override void Execute() { base.Execute(); try { var buildFolder = Path.GetFullPath(Application.dataPath + @"\..\"); var t = new Thread(GenerateHashThread); t.Start(buildFolder); } catch (Exception e) { Debug.LogError(ACTkConstants.LogPrefix + "Something went wrong while calculating hash!\n" + e); Complete(HashGeneratorResult.FromError(e.ToString())); } }
private void GenerateHashThread(object folder) { var buildFolder = (string)folder; try { var sha1 = new SHA1Wrapper(); #if ENABLE_IL2CPP var il2cpp = true; #else var il2cpp = false; #endif var buildHashes = GetBuildHashes(buildFolder, CodeHashGenerator.GetFileFiltersStandaloneWindows(il2cpp), sha1); sha1.Clear(); Complete(HashGeneratorResult.FromBuildHashes(buildHashes)); } catch (Exception e) { Debug.LogError(ACTkConstants.LogPrefix + "Something went wrong in thread: " + e); Complete(HashGeneratorResult.FromError(e.ToString())); } }
// called from native Android plugin, from separate thread public void OnError(string errorMessage) { parent.Complete(HashGeneratorResult.FromError(errorMessage)); }
// called from native Android plugin, from separate thread public void OnSuccess(string hash) { parent.Complete(HashGeneratorResult.FromCodeHash(hash)); }