• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Strange APK recompiling issue

xaelith

Android Enthusiast
May 19, 2012
553
258
Utah
Hey all. Having a little issue recompiling an APK, and thought I would see if anyone had any other suggestions beyond the irksome workaround I'm currently using.

Anyway, here's the situation: I'm working on a minor update to my theme, currently working with the SystemUI.apk. I decompiled the file, made the changes I wanted to, and am now trying to button things up. One of the things I changed was I .9'ed a background image. Here's the problem: when I try to recompile, APK Multi-tool loses its breakfast, lunch and dinner for the last three weeks, and spews out a huge list of errors (400+). Because of either the way Linux Terminal works, or due to something with the Linux version of APK Multi-tool (or a combination of both), I can't see the whole list, and past experiences have taught me that a lot of times, the first error is the real problem.

Through trial-and-error, I've found that the background image that I converted to a .9 (and other .9s that I've edited) is what seems to be causing the issue. When I copy over a non-.9 version of the background image, everything compiles easy-cheesy. I can understand the background image, but what really blows my brain is that the other .9s I made changes to are causing problems, as well. Both are .9s; the only difference between the edited and non-edited versions is I either added or removed text...and yet the non-edited .9s compile, and the edited ones cause multitool to spill its guts in errors. :thinking::thinking::thinking: If I can help it, I would really rather not convert the edited .9s to non-.9 pngs (especially since they're supposed to be .9s to begin with), but right now, that seems to be my only option.

Thanks in advance for the help. :)
 
The .9's images are tricky, if you take a close look at any .9 image you will see that there are actual lines/ a box around the image it self. Thats a big must for all .9 images. I had to manually edit the original .9 images from the apk with photoshop and try to change the color without going outside the box/line around the image. I believe thats how i got it work once a while back, i try to stay away from editing them. Quick fix on what you can do is open the apk with winrar and replace the .9 images within winrar then flash the apk and reboot but be aware that if you decompile the apk again and try to recompile it, you will get that long error message again.
 
  • Like
Reactions: xaelith
Upvote 0
Hey bro did you figure this out yet.

Sort of...I found that if I just left the images as regular PNGs instead of converting them to .9s, the APK recompiled without issue. The only problem with that is that now the images don't stretch the way I want them to. Which is fine for 2 out of the 3, because they're just black bars anyhow. :p

The only thing I can think of is the original .9 is some what embeded in to the apk. If you delete the .9 then it has to be put back in as .jpg. Then recompile. This has been my experience.

Didn't know that, but it make sense. One thing I don't get about the JPG, though...do you put that in along with the new .9, or instead of it? Because what I was trying to do was replace a .9 with another .9 of the same name, and in 2 of 3 cases, of the same size and everything, just it went from a black background with red text to all black.

The .9's images are tricky, if you take a close look at any .9 image you will see that there are actual lines/ a box around the image it self. Thats a big must for all .9 images. I had to manually edit the original .9 images from the apk with photoshop and try to change the color without going outside the box/line around the image. I believe thats how i got it work once a while back...

I knew about the lines after playing around with .9s a bit, but didn't realize I had to stay within them. Usually what I do is delete any of the marks around the outside edge by cropping them out, edit the pic as I want, then re-convert the image back into a .9 using the "draw9patch" app that comes with the Android SDK.

...i try to stay away from editing them.

Usually, I do too. :p However, after a few successful attempts, I felt confident that this time wasn't going to be any different...silly me. :rolleyes:

Quick fix on what you can do is open the apk with winrar and replace the .9 images within winrar then flash the apk and reboot but be aware that if you decompile the apk again and try to recompile it, you will get that long error message again.

Good to know, thanks. :D

It's also quite possible that my whole problem is that I upgraded my Ubuntu 12.10 Linux to 13.04 too soon. After all, it's since that update that APK Multi-tool (and APK Manager, for that matter) has refused to work properly. And if memory serves, something about going from one version to another tends to break the Android SDK, though I'm not sure what or why.
 
Upvote 0
I changed it from .9 to .png (sorry I know I stated .jpg in earlier post). I converted the image from a .jpg to .png. Might not be the right way but if memory serves me correct that is the way I changed it.

Back when changing the system backround images. If you tried to use a different .9 image or a .jpg image it would up bring up all those errors. They had to be converted to .png and then the errors would disappear.
 
Upvote 0
I changed it from .9 to .png (sorry I know I stated .jpg in earlier post). I converted the image from a .jpg to .png. Might not be the right way but if memory serves me correct that is the way I changed it.

Back when changing the system backround images. If you tried to use a different .9 image or a .jpg image it would up bring up all those errors. They had to be converted to .png and then the errors would disappear.

Ahh, okay. That might explain why the notification background image didn't wanna compile, at least...I tried changing it from a standard PNG to a .9 PNG. Still fuzzy why the other two were giving me fits, though. :p After all, the old and new images for the other two were practically the exact same. :eek:
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones