mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 01:39:21 +02:00
GP-0: Fixing enablement of installed extensions in dev mode
This commit is contained in:
parent
cde92ede12
commit
605d579070
3 changed files with 12 additions and 17 deletions
|
@ -4,9 +4,9 @@
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* 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
|
* {@return true if this extension is installed under an installation folder or inside of a
|
||||||
* source control repository folder.
|
* 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() {
|
public boolean isInstalledInInstallationFolder() {
|
||||||
if (installDir == null) {
|
if (installDir == null) {
|
||||||
|
@ -287,11 +285,10 @@ public class ExtensionDetails implements Comparable<ExtensionDetails> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// extDirs.get(0) is the user extension dir
|
// extDirs.get(0) is the user extension dir
|
||||||
ResourceFile appExtDir = extDirs.get(1);
|
return extDirs.stream()
|
||||||
if (FileUtilities.isPathContainedWithin(appExtDir.getFile(false), installDir)) {
|
.skip(1)
|
||||||
return true;
|
.anyMatch(
|
||||||
}
|
dir -> FileUtilities.isPathContainedWithin(dir.getFile(false), installDir));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -227,9 +227,8 @@ public class GhidraApplicationLayout extends ApplicationLayout {
|
||||||
* Returns a prioritized list of directories where Ghidra extensions are installed. These
|
* Returns a prioritized list of directories where Ghidra extensions are installed. These
|
||||||
* should be at the following locations:<br>
|
* should be at the following locations:<br>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li><code>[user settings dir]/Extensions</code></li>
|
* <li>{@code [user settings dir]/Extensions}</li>
|
||||||
* <li><code>[application install dir]/Ghidra/Extensions</code> (Release Mode)</li>
|
* <li>{@code [application root dirs]/Extensions}</li>
|
||||||
* <li><code>ghidra/Ghidra/Extensions</code> (Development Mode)</li>
|
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @return the install folder, or null if can't be determined
|
* @return the install folder, or null if can't be determined
|
||||||
|
|
|
@ -129,9 +129,8 @@ public abstract class ApplicationLayout {
|
||||||
* Returns a prioritized {@link List ordered list} of the application Extensions installation
|
* Returns a prioritized {@link List ordered list} of the application Extensions installation
|
||||||
* directories. Typically, the values may be any of the following locations:<br>
|
* directories. Typically, the values may be any of the following locations:<br>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li><code>[user settings dir]/Extensions</code></li>
|
* <li>{@code [user settings dir]/Extensions}</li>
|
||||||
* <li><code>[application install dir]/Ghidra/Extensions</code> (Release Mode)</li>
|
* <li>{@code [application root dirs]/Extensions}</li>
|
||||||
* <li><code>ghidra/Ghidra/Extensions</code> (Development Mode)</li>
|
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @return an {@link List ordered list} of the application Extensions installation directories.
|
* @return an {@link List ordered list} of the application Extensions installation directories.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue