public static bool VerifyNdkDir(string ndkPath) { string fileName = Path.Combine(ndkPath, "RELEASE.TXT"); string message = "Unable to detect NDK version, please pick a different folder."; try { FileInfo info = new FileInfo(fileName); if (info.Exists && (info.Length < 0x40L)) { string str3 = File.ReadAllText(info.FullName).Trim(); if (str3.Contains(AndroidIl2CppNativeCodeBuilder.AndroidNdkVersionString)) { return(true); } message = $"NDK {str3} is incompatible with IL2CPP. IL2CPP requires {AndroidIl2CppNativeCodeBuilder.AndroidNdkVersionString}."; } } catch (Exception) { Console.WriteLine("Unable to stat '{0}'", fileName); } string componentVersion = AndroidComponentVersion.GetComponentVersion(ndkPath); if (!componentVersion.Equals("0")) { message = $"NDK {componentVersion} is incompatible with IL2CPP. IL2CPP requires {AndroidIl2CppNativeCodeBuilder.AndroidNdkVersionString}."; } switch (EditorUtility.DisplayDialogComplex("Invalid NDK version", message, "Ok", "Cancel", "Download")) { case 1: throw new UnityException(message); case 2: Application.OpenURL(DownloadUrl); break; } return(false); }
public string BuildToolsVersion(Command.WaitingForProcessToExit waitingForProcessToExit) => AndroidComponentVersion.GetComponentVersion(this.SDKBuildToolsDir);