Closed argraur closed 5 years ago
Yeah it's me again, and I have one more issue :(
Please try reverting this commit - https://github.com/iBotPeaches/Apktool/commit/6e47d3687bce8ae3cafed0846de68635076a8a16 and let me know if the problem persists.
Sure
Hmm can't revert commit. Shows error: error: commit 6e47d3687bce8ae3cafed0846de68635076a8a16 - commit-merge, but -m option is not defined.
still cant revert that commit
error: commit 6e47d3687bce8ae3cafed0846de68635076a8a16 is a merge but no -m option was given.
fatal: revert failed
Okay just hold then. I won't have time till the weekend to investigate.
Finally I reverted that commit by git rebase -i. And after test, It's failed again.
I: Using Apktool 2.2.3-1f1758-SNAPSHOT
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
W: ERROR: 9-patch image /home/argraur/working_directoru/sign_o/SystemUI/res/drawable-xxhdpi/pip_dismiss_scrim.9.png malformed.
W: No marked region found along edge.
W: Found along left edge.
W: ERROR: Failure processing PNG image /home/argraur/working_directoru/sign_o/SystemUI/res/drawable-xxhdpi/pip_dismiss_scrim.9.png
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_5128022422052930085.tmp, p, --forced-package-id, 127, --min-sdk-version, O, --target-sdk-version, O, --version-code, 25, --version-name, O, --no-version-vectors, -F, /tmp/APKTOOL7440049650671455157.tmp, -0, arsc, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /home/argraur/working_directoru/sign_o/SystemUI/res, -M, /home/argraur/working_directoru/sign_o/SystemUI/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:493)
at brut.androlib.Androlib.buildResources(Androlib.java:427)
at brut.androlib.Androlib.build(Androlib.java:326)
at brut.androlib.Androlib.build(Androlib.java:264)
at brut.apktool.Main.cmdBuild(Main.java:231)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_5128022422052930085.tmp, p, --forced-package-id, 127, --min-sdk-version, O, --target-sdk-version, O, --version-code, 25, --version-name, O, --no-version-vectors, -F, /tmp/APKTOOL7440049650671455157.tmp, -0, arsc, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /home/argraur/working_directoru/sign_o/SystemUI/res, -M, /home/argraur/working_directoru/sign_o/SystemUI/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:441)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:479)
... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_5128022422052930085.tmp, p, --forced-package-id, 127, --min-sdk-version, O, --target-sdk-version, O, --version-code, 25, --version-name, O, --no-version-vectors, -F, /tmp/APKTOOL7440049650671455157.tmp, -0, arsc, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /home/argraur/working_directoru/sign_o/SystemUI/res, -M, /home/argraur/working_directoru/sign_o/SystemUI/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:95)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:435)
... 6 more
?
This 9patch image is a 1px wide image which I've never seen before.
However, it reports only 1 patch data blob that is 1 pixel long, which you can see from the below image is inserted in between the 3 pixel wide image. (The size grew from 1px to 3px due to adding 2 pixel for 9patch data)
Since this is affecting only 1px wide/tall images, I'm hesitant to spend any more time on this besides the initial research. It is confirmed, so any additional research or PRs are accepted.
Why you don't want to fix it? This issue appears with SystemUI on stock Android O DP4 only, so it is Android O issue. This bug stops my ROM development
I never said that. I said, "I'm hesitant". This is a 1 pixel image in which we have to insert 9patch data which is very time consuming and I don't yet truly understand when it comes to 1 pixel images.
Read this 3-4 paragraph doc block about the encoded 9patch data - https://github.com/android/platform_frameworks_base/blob/master/libs/androidfw/include/androidfw/ResourceTypes.h#L53
Then apply that to a 1 pixel wide image.
Just test the 2.2.4 self-build, can build the systemUI.apk DP4 after patch the 1px png with draw9patch.jar, but the re-builded systemUI.apk did not work.
@charlescl could you share your self-built apktool ?
@charlescl 2.2.4 (renamed to 2.3.0) was officially released a few days ago. There would be no gain using a custom old build of 2.2.4.
@iBotPeaches Great, but I tried the 2.2.4 and 2.3.0 and still got the 'No marked region found along edge' error when trying to recompile SystemUIGoogle.apk without modification.
So far there is no solution ?
@syrm Fix the affected images so they are proper 9patch images is a temporary solution. If you have the time you can jump into Apktool's 9Patch decoder and investigate if we are making any incorrect assumptions decoding these images.
How can i fix the images i tried to resave them with the 9patch.jar but it still throws the same error above at me. im using an oreo rom (resurection remix) and i have no idea how get this one stupid image to compile.
I meet the same 9patch malformed error. Is there any solution?
@Mi2Sir I've been stuck with this error for a few hours with pip_dismiss_scrim.9.png to fix it I just manually added the marker with an image editor. Don't use mspaint or any other tool that discards alpha. I had the same image iBotPeaches posted, a line was clearly missing on the left side
you just added a vertical white line in the first column? I tried that but still get the error.
Leave the first and last pixels blank, if you have the same image just copy the right pixel column into the left, that did the trick for me. Still I can't get my patched SystemUI to work, it crashes every time, don't know if it's because of this or i'm missing some steps
thanks! This part worked, now I'm having new issues...
same here now: modded SystemUI crashes, log doesn't help much.
@exelix11 did you ever manage to compile a working SystemUI?
Unfortunately no,every time I flash my build with magisk the notifications bar and task switcher stop working, and when I remove it from magisk I get a bootloop with systemUI has stopped, restoring a data backup fixes it. I just got back on Android modding probably there is something I'm missing (odex maybe?)
same here.. I tried the 'copy META-INF and AndroidManifest.xml from original apk' that everybody mentions + zipalign but it just keeps crashing sigh
Yeah tried that as well, still no luck
So there is a solution or not? 2 days I was stranded and didn't find any solution.
i gave up on it. i did it the dirty way. i unpacked the apk created a zip archive and changed the extension to apk. its not optimal but its working.
Unfortunately it's not possible to edit all of the resources this way
I have this problem too, anyone have a temporary solution for this? EDIT: i found the fix, nvm
Ok so, i couldn't get apktool to patch my systemUI so i made an Xposed module to change what i needed and it's working like a charm. Maybe it's not the optimal solution for everyone but it's ok for me and wasn't even that hard to get it working, so if you're still stuck on this give Xposed a try
I have this problem too, anyone have a temporary solution for this? EDIT: i found the fix, nvm
How did you manage to fix this?
Is there any solution on the issue. I have tried on apktool 2.3.4, it doesn't work well yet. Raise same issue as issuer mention.
There is a solution (by @IgorEisberg) in review right now. - https://github.com/iBotPeaches/Apktool/pull/2003/commits/132a370f40377329512f0c3c5c89e82795a76e3c
Been busy.
@iBotPeaches I have searched for the same issue. and found the solution from the issue https://github.com/iBotPeaches/Apktool/issues/2001, While I rebuild with --use-aapt2
It raised another issue as below.
.... res/values/ids.xml:3: error: <item> inner element must either be a resource reference or empty.
.... res/values/ids.xml:4: error: <item> inner element must either be a resource reference or empty.
.... res/values/ids.xml:5: error: <item> inner element must either be a resource reference or empty.
@iBotPeaches When the latest version could be released?
I'm already 4 months behind. Windows builds are broken and I have a stack (2) of pending PRs to merge and a backlog that grows daily. I am hoping to find some weekend time to handle this.
@iBotPeaches OK, Got it. Wish it release soon.
Information
Stacktrace
Steps to Reproduce
java -jar apktool-2.2.3-dirty-small.jar b SystemUI --no-src
APK
GDrive
Questions to ask before submission