Add check for osf extension in folder name
This commit is contained in:
parent
6ec5d526a8
commit
63e4716708
1 changed files with 12 additions and 2 deletions
|
@ -2169,7 +2169,8 @@ public class SettingsHelper {
|
|||
try {
|
||||
ZipEntry entry;
|
||||
while ((entry = zis.getNextEntry()) != null) {
|
||||
if (entry.getName().equals("items.json")) {
|
||||
String fileName = checkEntryName(entry.getName());
|
||||
if (fileName.equals("items.json")) {
|
||||
String itemsJson = null;
|
||||
try {
|
||||
itemsJson = Algorithms.readFromInputStream(ois).toString();
|
||||
|
@ -2215,7 +2216,7 @@ public class SettingsHelper {
|
|||
try {
|
||||
ZipEntry entry;
|
||||
while ((entry = zis.getNextEntry()) != null) {
|
||||
String fileName = entry.getName();
|
||||
String fileName = checkEntryName(entry.getName());
|
||||
SettingsItem item = null;
|
||||
for (SettingsItem settingsItem : items) {
|
||||
if (settingsItem != null && settingsItem.applyFileName(fileName)) {
|
||||
|
@ -2247,6 +2248,15 @@ public class SettingsHelper {
|
|||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
private String checkEntryName(String entryName) {
|
||||
String fileExt = OSMAND_SETTINGS_FILE_EXT + "/";
|
||||
int index = entryName.indexOf(fileExt);
|
||||
if (index != -1) {
|
||||
entryName = entryName.substring(index + fileExt.length());
|
||||
}
|
||||
return entryName;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
|
|
Loading…
Reference in a new issue