mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-12 13:57:46 +01:00
Ignore file entries containing '..' in the APK file to fix #1498
Zip/APK files can legally contain entries that point to the parent directory of the one in which the .zip is located. Usually, unzip implementations ignore them by default, and we‘ll do the same.
This commit is contained in:
parent
f979f202c7
commit
693f592b13
@ -136,7 +136,8 @@ public class ZipRODirectory extends AbstractDirectory {
|
|||||||
subname = subname.substring(0, pos);
|
subname = subname.substring(0, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! mDirs.containsKey(subname)) {
|
boolean pointsToParentDirectory = (subname.equals("..") && prefixLen == 0);
|
||||||
|
if (! mDirs.containsKey(subname) && ! pointsToParentDirectory) {
|
||||||
AbstractDirectory dir = new ZipRODirectory(getZipFile(), getPath() + subname + separator);
|
AbstractDirectory dir = new ZipRODirectory(getZipFile(), getPath() + subname + separator);
|
||||||
mDirs.put(subname, dir);
|
mDirs.put(subname, dir);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user