mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-21 01:07:34 +01:00
feat: Fill missing 9patch lines to fix recompile
Somehow Google manages to compile MiuiSystemUI.apk (and a few other APKs I encountered) with a misformed pip_dismiss_scrim.9.png. Either way, every time I encountered such 9.patch images, the missing lines always indicated a single full div or padding. Apktool already fills missing padding lines, now it can also fill missing divs.
This commit is contained in:
parent
0efccc2d93
commit
1e68bb0ede
@ -65,13 +65,21 @@ public class Res9patchStreamDecoder implements ResStreamDecoder {
|
||||
drawVLine(im2, w + 1, np.padTop + 1, h - np.padBottom);
|
||||
|
||||
int[] xDivs = np.xDivs;
|
||||
for (int i = 0; i < xDivs.length; i += 2) {
|
||||
drawHLine(im2, 0, xDivs[i] + 1, xDivs[i + 1]);
|
||||
if (xDivs.length == 0) {
|
||||
drawHLine(im2, 0, 1, w);
|
||||
} else {
|
||||
for (int i = 0; i < xDivs.length; i += 2) {
|
||||
drawHLine(im2, 0, xDivs[i] + 1, xDivs[i + 1]);
|
||||
}
|
||||
}
|
||||
|
||||
int[] yDivs = np.yDivs;
|
||||
for (int i = 0; i < yDivs.length; i += 2) {
|
||||
drawVLine(im2, 0, yDivs[i] + 1, yDivs[i + 1]);
|
||||
if (yDivs.length == 0) {
|
||||
drawVLine(im2, 0, 1, h);
|
||||
} else {
|
||||
for (int i = 0; i < yDivs.length; i += 2) {
|
||||
drawVLine(im2, 0, yDivs[i] + 1, yDivs[i + 1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Some images additionally use Optical Bounds
|
||||
|
Loading…
x
Reference in New Issue
Block a user