private static void DrawInjectionSection() { using (var changed = new EditorGUI.ChangeCheckScope()) { var fold = GUITools.DrawFoldHeader("Injection Detector", ACTkEditorPrefsSettings.InjectionFoldout); if (changed.changed) { ACTkEditorPrefsSettings.InjectionFoldout = fold; } } if (!ACTkEditorPrefsSettings.InjectionFoldout) { return; } GUILayout.Space(-3f); using (GUITools.Vertical(GUITools.PanelWithBackground)) { var enableInjectionDetector = ACTkSettings.Instance.InjectionDetectorEnabled; if (SettingsUtils.IsIL2CPPEnabled()) { EditorGUILayout.HelpBox("Injection is not possible in IL2CPP,\n" + "this detector is not needed in IL2CPP builds", MessageType.Info, true); GUILayout.Space(5f); } else if (!InjectionRoutines.IsTargetPlatformCompatible()) { EditorGUILayout.HelpBox( "Injection Detection is only supported in non-IL2CPP Standalone and Android builds", MessageType.Warning, true); GUILayout.Space(5f); } using (new GUILayout.HorizontalScope()) { EditorGUI.BeginChangeCheck(); enableInjectionDetector = EditorGUILayout.ToggleLeft(new GUIContent( "Add mono injection detection support to build", "Injection Detector checks assemblies against whitelist. " + "Please enable this option if you're using Injection Detector " + "and default whitelist will be generated while Unity builds resulting build.\n" + "Has no effect for IL2CPP or unsupported platforms."), enableInjectionDetector ); if (EditorGUI.EndChangeCheck()) { ACTkSettings.Instance.InjectionDetectorEnabled = enableInjectionDetector; } } GUILayout.Space(3); if (GUILayout.Button(new GUIContent( "Edit Custom Whitelist (" + ACTkSettings.Instance.InjectionDetectorWhiteList.Count + ")", "Fill any external assemblies which are not included into the project to the user-defined whitelist to make Injection Detector aware of them.")) ) { UserWhitelistEditor.ShowWindow(); } GUILayout.Space(3); } }
private static void ShowAssembliesWhitelistWindow() { UserWhitelistEditor.ShowWindow(); }