mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-07 01:04:26 +02:00
Switch to loop for checking extensions we are treating as raw
- 9patch (samsung) - regular (apple) - I imagine this list will grow over time
This commit is contained in:
parent
c7f4dfe1db
commit
085e8f66ef
@ -75,11 +75,13 @@ public class ResFileDecoder {
|
|||||||
outFileName = outResName + ".r.9" + ext;
|
outFileName = outResName + ".r.9" + ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for samsung qmg & spi
|
// check for raw 9patch images
|
||||||
if (inFileName.toLowerCase().endsWith(".qmg") || inFileName.toLowerCase().endsWith(".spi")) {
|
for (String extension : RAW_9PATCH_IMAGE_EXTENSIONS) {
|
||||||
|
if (inFileName.toLowerCase().endsWith("." + extension)) {
|
||||||
copyRaw(inDir, outDir, outFileName);
|
copyRaw(inDir, outDir, outFileName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check for xml 9 patches which are just xml files
|
// check for xml 9 patches which are just xml files
|
||||||
if (inFileName.toLowerCase().endsWith(".xml")) {
|
if (inFileName.toLowerCase().endsWith(".xml")) {
|
||||||
@ -100,6 +102,15 @@ public class ResFileDecoder {
|
|||||||
outFileName = outResName + ext;
|
outFileName = outResName + ext;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check for raw image
|
||||||
|
for (String extension : RAW_IMAGE_EXTENSIONS) {
|
||||||
|
if (inFileName.toLowerCase().endsWith("." + extension)) {
|
||||||
|
copyRaw(inDir, outDir, outFileName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!".xml".equals(ext)) {
|
if (!".xml".equals(ext)) {
|
||||||
decode(inDir, inFileName, outDir, outFileName, "raw");
|
decode(inDir, inFileName, outDir, outFileName, "raw");
|
||||||
return;
|
return;
|
||||||
@ -148,4 +159,13 @@ public class ResFileDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final static Logger LOGGER = Logger.getLogger(ResFileDecoder.class.getName());
|
private final static Logger LOGGER = Logger.getLogger(ResFileDecoder.class.getName());
|
||||||
|
|
||||||
|
private final static String[] RAW_IMAGE_EXTENSIONS = new String[] {
|
||||||
|
"m4a", // apple
|
||||||
|
};
|
||||||
|
|
||||||
|
private final static String[] RAW_9PATCH_IMAGE_EXTENSIONS = new String[] {
|
||||||
|
"qmg", // samsung
|
||||||
|
"spi", // samsung
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user