Родитель
ac5cb2f756
Коммит
209f52f0ce
|
@ -133,6 +133,25 @@ namespace Confuser.Core {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines whether the specified type is inherited from a base type.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type">The type.</param>
|
||||||
|
/// <param name="baseType">The full name of base type.</param>
|
||||||
|
/// <returns><c>true</c> if the specified type is inherited from a base type; otherwise, <c>false</c>.</returns>
|
||||||
|
public static bool InheritsFrom(this TypeDef type, string baseType) {
|
||||||
|
if (type.BaseType == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
TypeDef bas = type;
|
||||||
|
do {
|
||||||
|
bas = bas.BaseType.ResolveTypeDefThrow();
|
||||||
|
if (bas.ReflectionFullName == baseType)
|
||||||
|
return true;
|
||||||
|
} while (bas.BaseType != null);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether the specified type implements the specified interface.
|
/// Determines whether the specified type implements the specified interface.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -122,6 +122,10 @@ namespace Confuser.Renamer {
|
||||||
if (type.InheritsFromCorlib("System.Attribute")) {
|
if (type.InheritsFromCorlib("System.Attribute")) {
|
||||||
service.ReduceRenameMode(type, RenameMode.ASCII);
|
service.ReduceRenameMode(type, RenameMode.ASCII);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type.InheritsFrom("System.Configuration.SettingsBase")) {
|
||||||
|
service.SetCanRename(type, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, MethodDef method) {
|
void Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, MethodDef method) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче