mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
Adding a validation step when searching for the application.properties
file
This commit is contained in:
parent
ce78b860be
commit
1a50107af7
1 changed files with 15 additions and 2 deletions
|
@ -60,8 +60,21 @@ public class ApplicationUtilities {
|
||||||
try {
|
try {
|
||||||
ResourceFile pathFile = new ResourceFile(new File(pathEntry).getCanonicalPath());
|
ResourceFile pathFile = new ResourceFile(new File(pathEntry).getCanonicalPath());
|
||||||
while (pathFile != null && pathFile.exists()) {
|
while (pathFile != null && pathFile.exists()) {
|
||||||
if (new ResourceFile(pathFile, ApplicationProperties.PROPERTY_FILE).exists()) {
|
ResourceFile applicationPropertiesFile =
|
||||||
return pathFile;
|
new ResourceFile(pathFile, ApplicationProperties.PROPERTY_FILE);
|
||||||
|
if (applicationPropertiesFile.exists()) {
|
||||||
|
try {
|
||||||
|
ApplicationProperties applicationProperties =
|
||||||
|
new ApplicationProperties(applicationPropertiesFile);
|
||||||
|
if (!applicationProperties.getApplicationName().isEmpty()) {
|
||||||
|
return pathFile;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (IOException e2) {
|
||||||
|
Msg.error(ApplicationUtilities.class,
|
||||||
|
"Failed to read: " + applicationPropertiesFile, e2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pathFile = pathFile.getParentFile();
|
pathFile = pathFile.getParentFile();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue