publicstaticstringGetLicenseType(Platform platform, string version, bool fromExtension) { FusionLicenseProvider.claimLicenseKeyURL = FusionLicenseProvider.GetClaimLicenseURL(platform); if (!FusionLicenseProvider.IsBoldLicenseValidation) { if (!FusionLicenseProvider.isDesignerModeValidated) { FusionLicenseProvider.isAppDesignerMode = FusionLicenseProvider.IsDesignerMode(); FusionLicenseProvider.isDesignerModeValidated = true; } if (!fromExtension) { if (FusionLicenseProvider.IsDesigner() || FusionLicenseProvider.isAppDesignerMode) { returnnull; } if (!FusionLicenseProvider.isSyncfusionApp && platform == Platform.Utility && FusionLicenseProvider.IsSyncfusionPFXSigned()) { FusionLicenseProvider.isSyncfusionApp = true; returnnull; } } if (platform == Platform.FileFormats && !string.IsNullOrEmpty(FusionLicenseProvider.fileFormatExceptionMessage) && !FusionLicenseProvider.isSyncfusionApp) { if (FusionLicenseProvider.Platforms != null && FusionLicenseProvider.Platforms.Count > 0) { FusionLicenseProvider.Platforms.Clear(); } return FusionLicenseProvider.fileFormatExceptionMessage; } if (((LicenseManager.UsageMode == LicenseUsageMode.Runtime && !FusionLicenseProvider.isLicenseExceptionShown) || platform == Platform.FileFormats || (FusionLicenseProvider.licenseValidatedEffectiveControlsCount > 5 && FusionLicenseProvider.isLicenseExceptionShown)) && !FusionLicenseProvider.isSyncfusionApp) { if (FusionLicenseProvider.isSinglePlatform) { FusionLicenseProvider.Platforms.Add(platform); } FusionLicenseProvider.isSinglePlatform = true; // 如果验证过了就跳过,这里是破解点! if ((!FusionLicenseProvider.isLicensed && !FusionLicenseProvider.isTrial) || platform == Platform.FileFormats) { LicenseType licenseType; if (!fromExtension) { licenseType = FusionLicenseProvider.GetModeOfLicense(platform); // 解密Key,获取许可证类型 } else { licenseType = FusionLicenseProvider.GetModeOfLicense(platform, version); // 解密Key,获取许可证类型 } FusionLicenseProvider.Platforms.Clear(); if (licenseType != LicenseType.Licensed && licenseType != LicenseType.Trial) { FieldInfo field = licenseType.GetType().GetField(licenseType.ToString()); DescriptionAttribute[] array = (DescriptionAttribute[])field.GetCustomAttributes(typeof(DescriptionAttribute), false); if (array != null && array.Length > 0) { string text = array[0].Description; text = text.Replace("##LicenseVersion", FusionLicenseProvider.invalidVersion); if (!fromExtension) { text = text.Replace("##Requireversion", CoreAssembly.StudioCoreVersion); } else { text = text.Replace("##Requireversion", version); } if (!fromExtension && platform != Platform.FileFormats) { FusionLicenseProvider.isLicenseExceptionShown = true; } if (!string.IsNullOrEmpty(text) && string.IsNullOrEmpty(FusionLicenseProvider.fileFormatExceptionMessage)) { FusionLicenseProvider.fileFormatExceptionMessage = text; } return text; } } } FusionLicenseProvider.Platforms.Clear(); } } returnnull; }
该控件用一个静态私有变量来记录验证状态,这里有可趁之机,将这个变量改为true,直接验证通过。
1 2 3 4 5 6 7 8 9 10
privatestaticboolCrackSyncfusion() { var t = typeof(FusionLicenseProvider); var fi = t.GetField("isLicensed", BindingFlags.NonPublic | BindingFlags.Static); if (fi == null) returnfalse;