mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-04 18:12:54 +01: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,10 +75,12 @@ public class ResFileDecoder {
|
||||
outFileName = outResName + ".r.9" + ext;
|
||||
}
|
||||
|
||||
// check for samsung qmg & spi
|
||||
if (inFileName.toLowerCase().endsWith(".qmg") || inFileName.toLowerCase().endsWith(".spi")) {
|
||||
copyRaw(inDir, outDir, outFileName);
|
||||
return;
|
||||
// check for raw 9patch images
|
||||
for (String extension : RAW_9PATCH_IMAGE_EXTENSIONS) {
|
||||
if (inFileName.toLowerCase().endsWith("." + extension)) {
|
||||
copyRaw(inDir, outDir, outFileName);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// check for xml 9 patches which are just xml files
|
||||
@ -100,6 +102,15 @@ public class ResFileDecoder {
|
||||
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)) {
|
||||
decode(inDir, inFileName, outDir, outFileName, "raw");
|
||||
return;
|
||||
@ -148,4 +159,13 @@ public class ResFileDecoder {
|
||||
}
|
||||
|
||||
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…
Reference in New Issue
Block a user