修复没有设置 ObfuscatedAssembly列表导致 CustomAttribute没有重定向的bug
parent
c69af127c0
commit
e081c5b3f2
|
@ -68,7 +68,7 @@ namespace Obfuz
|
|||
@"D:\UnityHubs\2022.3.60f1\Editor\Data\PlaybackEngines\windowsstandalonesupport\Variations\il2cpp\Managed",
|
||||
backupPlayerScriptAssembliesPath,
|
||||
},
|
||||
ObfuscationRuleFiles = settings.aotRuleFiles.ToList(),
|
||||
ObfuscationRuleFiles = settings.ruleFiles.ToList(),
|
||||
mappingXmlPath = settings.mappingFile,
|
||||
outputDir = ObfuzSettings.Instance.GetObfuscatedAssemblyOutputDir(buildTarget),
|
||||
};
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace Obfuz
|
|||
|
||||
private readonly IRenamePolicy _renamePolicy;
|
||||
private readonly INameMaker _nameMaker;
|
||||
private readonly SymbolRename _symbolRename;
|
||||
private SymbolRename _symbolRename;
|
||||
|
||||
public IList<string> ObfuscatedAssemblyNames => _obfuzAssemblies.Select(x => x.name).ToList();
|
||||
|
||||
|
@ -44,16 +44,6 @@ namespace Obfuz
|
|||
//_nameMaker = new TestNameMaker();
|
||||
_nameMaker = NameMakerFactory.CreateNameMakerBaseASCIICharSet();
|
||||
|
||||
var ctx = new ObfuscatorContext
|
||||
{
|
||||
assemblyCache = _assemblyCache,
|
||||
assemblies = _obfuzAssemblies,
|
||||
renamePolicy = _renamePolicy,
|
||||
nameMaker = _nameMaker,
|
||||
mappingXmlPath = _options.mappingXmlPath,
|
||||
outputDir = _options.outputDir,
|
||||
};
|
||||
_symbolRename = new SymbolRename(ctx);
|
||||
}
|
||||
|
||||
public void Run()
|
||||
|
@ -100,6 +90,16 @@ namespace Obfuz
|
|||
|
||||
private void Rename()
|
||||
{
|
||||
var ctx = new ObfuscatorContext
|
||||
{
|
||||
assemblyCache = _assemblyCache,
|
||||
assemblies = _obfuzAssemblies,
|
||||
renamePolicy = _renamePolicy,
|
||||
nameMaker = _nameMaker,
|
||||
mappingXmlPath = _options.mappingXmlPath,
|
||||
outputDir = _options.outputDir,
|
||||
};
|
||||
_symbolRename = new SymbolRename(ctx);
|
||||
_symbolRename.Process();
|
||||
}
|
||||
|
||||
|
|
|
@ -30,8 +30,7 @@ namespace Obfuz
|
|||
private SerializedObject _serializedObject;
|
||||
private SerializedProperty _enable;
|
||||
private SerializedProperty _mappingFile;
|
||||
private SerializedProperty _aotRuleFiles;
|
||||
private SerializedProperty _hotUpdateRuleFiles;
|
||||
private SerializedProperty _ruleFiles;
|
||||
|
||||
public ObfuzSettingsProvider() : base("Project/Obfuz", SettingsScope.Project)
|
||||
{
|
||||
|
@ -50,8 +49,7 @@ namespace Obfuz
|
|||
_serializedObject = new SerializedObject(setting);
|
||||
_enable = _serializedObject.FindProperty("enable");
|
||||
_mappingFile = _serializedObject.FindProperty("mappingFile");
|
||||
_aotRuleFiles = _serializedObject.FindProperty("aotRuleFiles");
|
||||
_hotUpdateRuleFiles = _serializedObject.FindProperty("hotUpdateRuleFiles");
|
||||
_ruleFiles = _serializedObject.FindProperty("ruleFiles");
|
||||
}
|
||||
|
||||
private void OnEditorFocused()
|
||||
|
@ -73,8 +71,7 @@ namespace Obfuz
|
|||
|
||||
EditorGUILayout.PropertyField(_enable);
|
||||
EditorGUILayout.PropertyField(_mappingFile);
|
||||
EditorGUILayout.PropertyField(_aotRuleFiles);
|
||||
EditorGUILayout.PropertyField(_hotUpdateRuleFiles);
|
||||
EditorGUILayout.PropertyField(_ruleFiles);
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
|
|
|
@ -15,11 +15,8 @@ namespace Obfuz
|
|||
[Tooltip("path of mapping.xml")]
|
||||
public string mappingFile = "Assets/Obfuz/mapping.xml";
|
||||
|
||||
[Tooltip("obfuscation rule files for aot assemblies")]
|
||||
public string[] aotRuleFiles;
|
||||
|
||||
[Tooltip("obfuscation rule files for hot update assemblies")]
|
||||
public string[] hotUpdateRuleFiles;
|
||||
[Tooltip("obfuscation rule files for assemblies")]
|
||||
public string[] ruleFiles;
|
||||
|
||||
public string ObfuzRootDir => $"Library/Obfuz";
|
||||
|
||||
|
|
Loading…
Reference in New Issue