mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-06 10:05:54 +01:00
QMG are not 9patches
- skip these by copying raw
This commit is contained in:
parent
986b585f26
commit
3e6fc8c5ef
@ -21,6 +21,7 @@ import brut.androlib.err.CantFind9PatchChunk;
|
||||
import brut.androlib.res.data.ResResource;
|
||||
import brut.androlib.res.data.value.ResBoolValue;
|
||||
import brut.androlib.res.data.value.ResFileValue;
|
||||
import brut.directory.DirUtil;
|
||||
import brut.directory.Directory;
|
||||
import brut.directory.DirectoryException;
|
||||
import java.io.*;
|
||||
@ -61,7 +62,7 @@ public class ResFileDecoder {
|
||||
return;
|
||||
}
|
||||
if (typeName.equals("drawable") || typeName.equals("mipmap")) {
|
||||
if (inFileName.toLowerCase().endsWith(".9." + ext)) {
|
||||
if (inFileName.toLowerCase().endsWith(".9" + ext)) {
|
||||
outFileName = outResName + ".9" + ext;
|
||||
|
||||
// check for htc .r.9.png
|
||||
@ -69,6 +70,12 @@ public class ResFileDecoder {
|
||||
outFileName = outResName + ".r.9" + ext;
|
||||
}
|
||||
|
||||
// check for samsung qmg
|
||||
if (inFileName.toLowerCase().endsWith(".qmg")) {
|
||||
copyRaw(inDir, outDir, outFileName);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
decode(inDir, inFileName, outDir, outFileName, "9patch");
|
||||
return;
|
||||
@ -121,6 +128,14 @@ public class ResFileDecoder {
|
||||
}
|
||||
}
|
||||
|
||||
public void copyRaw(Directory inDir, Directory outDir, String filename) throws AndrolibException {
|
||||
try {
|
||||
DirUtil.copyToDir(inDir, outDir, filename);
|
||||
} catch (DirectoryException ex) {
|
||||
throw new AndrolibException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void decodeManifest(Directory inDir, String inFileName,
|
||||
Directory outDir, String outFileName) throws AndrolibException {
|
||||
InputStream in = null;
|
||||
|
Loading…
Reference in New Issue
Block a user