Ghidra is a software reverse engineering (SRE) framework
GP-0: Fixing enablement of installed extensions in dev mode
Ryan Kurtz605d579070d6
diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/util/extensions/ExtensionDetails.java b/Ghidra/Framework/Generic/src/main/java/ghidra/util/extensions/ExtensionDetails.javaindex 3042a7be4c..c6e477782d 100644--- a/Ghidra/Framework/Generic/src/main/java/ghidra/util/extensions/ExtensionDetails.java+++ b/Ghidra/Framework/Generic/src/main/java/ghidra/util/extensions/ExtensionDetails.java@@ -4,9 +4,9 @@* Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at- *+ ** http://www.apache.org/licenses/LICENSE-2.0- *+ ** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.@@ -268,10 +268,8 @@ public class ExtensionDetails implements Comparable<ExtensionDetails> {}/**- * Returns true if this extension is installed under an installation folder or inside of a- * source control repository folder.- * @return true if this extension is installed under an installation folder or inside of a- * source control repository folder.+ * {@return true if this extension is installed under an installation folder or inside of a+ * source control repository folder}*/public boolean isInstalledInInstallationFolder() {if (installDir == null) {@@ -287,11 +285,10 @@ public class ExtensionDetails implements Comparable<ExtensionDetails> {}// extDirs.get(0) is the user extension dir- ResourceFile appExtDir = extDirs.get(1);- if (FileUtilities.isPathContainedWithin(appExtDir.getFile(false), installDir)) {- return true;- }- return false;+ return extDirs.stream()+ .skip(1)+ .anyMatch(+ dir -> FileUtilities.isPathContainedWithin(dir.getFile(false), installDir));}/**diff --git a/Ghidra/Framework/Utility/src/main/java/ghidra/GhidraApplicationLayout.java b/Ghidra/Framework/Utility/src/main/java/ghidra/GhidraApplicationLayout.javaindex e0a9336ad3..619213ae65 100644--- a/Ghidra/Framework/Utility/src/main/java/ghidra/GhidraApplicationLayout.java+++ b/Ghidra/Framework/Utility/src/main/java/ghidra/GhidraApplicationLayout.java@@ -227,9 +227,8 @@ public class GhidraApplicationLayout extends ApplicationLayout {* Returns a prioritized list of directories where Ghidra extensions are installed. These* should be at the following locations:<br>* <ul>- * <li><code>[user settings dir]/Extensions</code></li>- * <li><code>[application install dir]/Ghidra/Extensions</code> (Release Mode)</li>- * <li><code>ghidra/Ghidra/Extensions</code> (Development Mode)</li>+ * <li>{@code [user settings dir]/Extensions}</li>+ * <li>{@code [application root dirs]/Extensions}</li>* </ul>** @return the install folder, or null if can't be determineddiff --git a/Ghidra/Framework/Utility/src/main/java/utility/application/ApplicationLayout.java b/Ghidra/Framework/Utility/src/main/java/utility/application/ApplicationLayout.javaindex a7fd7b0653..e7967d3051 100644--- a/Ghidra/Framework/Utility/src/main/java/utility/application/ApplicationLayout.java+++ b/Ghidra/Framework/Utility/src/main/java/utility/application/ApplicationLayout.java@@ -129,9 +129,8 @@ public abstract class ApplicationLayout {* Returns a prioritized {@link List ordered list} of the application Extensions installation* directories. Typically, the values may be any of the following locations:<br>* <ul>- * <li><code>[user settings dir]/Extensions</code></li>- * <li><code>[application install dir]/Ghidra/Extensions</code> (Release Mode)</li>- * <li><code>ghidra/Ghidra/Extensions</code> (Development Mode)</li>+ * <li>{@code [user settings dir]/Extensions}</li>+ * <li>{@code [application root dirs]/Extensions}</li>* </ul>** @return an {@link List ordered list} of the application Extensions installation directories.