Compiling SystemUI.apk? - Android Q&A, Help & Troubleshooting

I've looked around dozens of threads, but nothing has helped me fix my problem.
I have a Droid Incredible and there is a Quick Settings mod for the dropdown notification bar. My goal is to remove the Hotspot option from that list. When I try decompiling SystemUI.apk with Apktool OR Apkmultitool, I think it works fine. Apktool said there were errors decompiling two images, but I think i fixed those. I have tried installing framework-res.apk and com.htc.resources.apk to decomile it. After making the needed changes and going to compile it, it just spits out errors. No matter what I try I always get an error. What an I doing wrong? What do I need to do to get it to compile without errors?

TeeRom said:
I've looked around dozens of threads, but nothing has helped me fix my problem.
I have a Droid Incredible and there is a Quick Settings mod for the dropdown notification bar. My goal is to remove the Hotspot option from that list. When I try decompiling SystemUI.apk with Apktool OR Apkmultitool, I think it works fine. Apktool said there were errors decompiling two images, but I think i fixed those. I have tried installing framework-res.apk and com.htc.resources.apk to decomile it. After making the needed changes and going to compile it, it just spits out errors. No matter what I try I always get an error. What an I doing wrong? What do I need to do to get it to compile without errors?
Click to expand...
Click to collapse
Might need a bit more info.
What os you running? What commands you running? Have you installed your framework with a tag?
Sent from my Galaxy Nexus using Tapatalk

Evostance said:
Might need a bit more info.
What os you running? What commands you running? Have you installed your framework with a tag?
Sent from my Galaxy Nexus using Tapatalk
Click to expand...
Click to collapse
2.3.4 my own version of stock. In APKtool I was running d and b with SystemUI. Don't know if I installed it with a tag.

pull your framework-res.apk
You can then install a tag by installing it as:
apktool if framework-res.apk droid
Decompile it like you have done, but with the tag:
apktool d -f -t droid SystemUI.apk
Made your changes and then recompile it:
apktool b <Path/To/Decompiled/APK>

Related

Volume Slider Color

I'm wanting to change the color of the slider when you turn your volume up and down from yellow to another color. I'm running CM7 fascinatemtd ROM by JT, I know which folder it's in and how to do it. My question is, I use Apk Manager to decomplie my framework-res.apk which was pulled from the ROM using 7zip, I've decompiled the apk, edited the XML file, when I went to recompile the framework-res apk using option 11, a error pop up and told me to read the log, I hit enter, answered yes to system question, then went to keep folder and deleted the resources file as instructed, and hit enter, I was left with an unsigned framework-res.apk file, renamed it to framework-res.apk, and pushed it back into ROM with 7zip, rebooted recovery, cleared caches, and installed ROM, but phone wouldn't boot up. So what am I doing wrong...
Obviously not
Sent from my SCH-I500 using XDA App
What color do you want the slider man
Sent from my SCH-I500 using XDA App
Blue would match my theme the HEX code is 11114b...
Sent from my SCH-I500 using XDA Premium App
If apkmanager errors common logic would dictate to read the log and see what is going wrong
Trying to flash a broken apk won't work obviously
I've gotten it to decompile and recompile bit the problem now os the changes I've made don't show up I'm not getting any errors before I was ising a ROM that I themed so I went back and used the original ROM how do I get the changes to stay...
Sent from my SCH-I500 using XDA Premium App
And you're trying to edit progress_horizontal.xml? And changing code to ff11114b leaving the "f's" in?
good day.
Yes
Sent from my SCH-I500 using XDA Premium App
I should rename unsigned framework.res to framework.res right...
Sent from my SCH-I500 using XDA Premium App
And during the compile process, you hit y for "system apk" and hit y for "would you like to copy over any files..............." and from the keep folder delete resources.arsc and continue to compile. And yes rename back to framework-res.apk.
good day.
Answered yes to system app and no to copy over files, didn't delete arsc and changes stayed, but if I install will I get boot loop since I didn't delete arsc....
Sent from my SCH-I500 using XDA Premium App
If I hit y to copy over files the changes don't stay only if I hit n
Sent from my SCH-I500 using XDA Premium App
it worked, by not copying over the files and not deleting the resources arsc file, does anyone know what the XML file name is for the download progress bar color is...and thanks for your help guys...
Here's what I would do if I was on Windows!
Download apktool & dependencies:
http://android-apktool.googlecode.com/files/apktool1.4.1.tar.bz2
http://android-apktool.googlecode.com/files/apktool-install-windows-r04-brut1.tar.bz2
Unpack both archives to your Windows folder. This will make apktool accessible through cmd anywhere.
CD in cmd window to the location of your apk, If you haven't already done so and install the resources by copying or pulling (framework-res.apk, twframework-res.apk for touchwiz) or (framework-res.apk, SystemUI.apk for GB). Once copied to the folder you are cd'd too...
Install the resources
apktool if framework-res.apk
apktool if twframework-res.apk
apktool if SystemUI.apk
Decompile and make your changes..
apktool d framework-res.apk
Recompile when done
apktool b framework-res
If it built succesfully, then make a copy of your framework-res.apk. Then navigate to framework-res/build/apk! Open your copied apk with 7zip and drag n drop res & resources.arsc from framework-res/build/apk inside! Close it up..
Push and test.. On windows you may need to navigate to your sdk directory if not properly setup!
adb push "your_copied_file"/system/framework/framework-res.apk
If you get a failed to write to system, run this first.
adb shell su -c rw
YES got all progress bar colors changed to blue now my CM7 Fascinatemdt ROM is themed all of my drawable hdpi and XML files are complete I might post this as a theme, thank you for your help...
Sent from my SCH-I500 using XDA Premium App
notta said:
Here's what I would do if I was on Windows!
Download apktool & dependencies:
http://android-apktool.googlecode.com/files/apktool1.4.1.tar.bz2
http://android-apktool.googlecode.com/files/apktool-install-windows-r04-brut1.tar.bz2
Unpack both archives to your Windows folder. This will make apktool accessible through cmd anywhere.
CD in cmd window to the location of your apk, If you haven't already done so and install the resources by copying or pulling (framework-res.apk, twframework-res.apk for touchwiz) or (framework-res.apk, SystemUI.apk for GB). Once copied to the folder you are cd'd too...
Install the resources
apktool if framework-res.apk
apktool if twframework-res.apk
apktool if SystemUI.apk
Decompile and make your changes..
apktool d framework-res.apk
Recompile when done
apktool b framework-res
If it built succesfully, then make a copy of your framework-res.apk. Then navigate to framework-res/build/apk! Open your copied apk with 7zip and drag n drop res & resources.arsc from framework-res/build/apk inside! Close it up..
Push and test.. On windows you may need to navigate to your sdk directory if not properly setup!
adb push "your_copied_file"/system/framework/framework-res.apk
If you get a failed to write to system, run this first.
adb shell su -c rw
Click to expand...
Click to collapse
will this work also when trying to decompile/recompile a non system app, like one from the market, that has dependencies
adude247 said:
will this work also when trying to decompile/recompile a non system app, like one from the market, that has dependencies
Click to expand...
Click to collapse
It will work with anything provided you have the resources. Some apk's are picky by means of what you can replace.
The method above is using apktool the way it is supposed to be used. That apkmanager thing sounded crazy with the delete this after that, hit y or n before this. Seems like alot of un-needed steps and confusion!
On linux it's even easier, pretty much fully auto!
notta said:
It will work with anything provided you have the resources. Some apk's are picky by means of what you can replace.
The method above is using apktool the way it is supposed to be used. That apkmanager thing sounded crazy with the delete this after that, hit y or n before this. Seems like alot of un-needed steps and confusion!
On linux it's even easier, pretty much fully auto!
Click to expand...
Click to collapse
yeah, I didn't delete anything just decompiled, edited the XML, and recompiled, that was the only way I could get the changes to stay. Any suggestions on what to use if the above resources don't work to get the apk to decompile, an example of an apk that I want to edit but cant get it to recompile after decompiling and editing the XMLs is....
adude247 said:
yeah, I didn't delete anything just decompiled, edited the XML, and recompiled, that was the only way I could get the changes to stay. Any suggestions on what to use if the above resources don't work to get the apk to decompile, an example of an apk that I want to edit but cant get it to recompile after decompiling and editing the XMLs is....
Click to expand...
Click to collapse
I can't and won't explain getting resources for market apps or generally someone else's work. However there are several ways to approach non-building apk's.
For example aapt has the capability to recompile standalone 9's as well as xml's, which can then be injected into the apk with the 7zip method. Especially useful for minor changes.
Another example for stubborn apk's would be the Eclipse or similar project. This is where you would partially build the files you wanted to change.
Thanks for the advice...
Sent from my SCH-I500 using XDA Premium App

Having issues with decompiling Mms.apk for compression fix

Hey guys I have an evo 4g I am trying to apply steelH's Mms compression fix and I'm wondering what I'm doing wrong. I extracted the MMS.apk file along with the framework-res.apk file into the apktool directory to install the framework with the apktool if framework-res.apk command and it said that it was installed then I tried to decompile with apktool d Mms.apk and it just gave me a bunch of errors and at the end it said that it needed the proper framework files but the folder with all the decompiled files were still there. So I went ahead and found the imagemodel.smali file and made the necessary changes and tried to recompile it but it gives me a bunch of errors that you can see in this screenshot. Any idea what I should do to fix this so I can recompile and put the MMS.apk file back into my phone with the fix?
Usually when you get the weird characters it means the apk did not decompile properly, make sure when you decompile the SystemUI.apk you also put framework-res .apk In your apktool folder. Then in cmd type
apktool if framework-res.apk
apktool d SystemUI.apk
Well if you take a look at the screenshot my framework-res.apk is in the folder with the apktool and the Mms.apk which I wanted to decompile and those are the commands I used except I didnt need to decompile systemUI but rather Mms.apk. So I'm wondering what I'm doing wrong since I've done exactly what you suggested in the first place. the 1.apk is from the first command as it installed correctly according to cmd.
Have you type those word in cmd? You need to type in those code while decompiling ssystem app
Accidentally sent from my Google Nexus S using XDA Premium
yes i typed in cmd: apktool if framework-res.apk but not apktool d systemui.apk I don't want to decompile that file. I'm confused about why you're telling me to decompile that file. can you please give me an explanation as to why I need to decompile that file to decompile mms.apk?
EDIT: Nevermind, I figured out what the problem was. I also needed to bring out and install the resources from the rom for the decompile to work.
SprintTouchPro2 said:
yes i typed in cmd: apktool if framework-res.apk but not apktool d systemui.apk I don't want to decompile that file. I'm confused about why you're telling me to decompile that file. can you please give me an explanation as to why I need to decompile that file to decompile mms.apk?
EDIT: Nevermind, I figured out what the problem was. I also needed to bring out and install the resources from the rom for the decompile to work.
Click to expand...
Click to collapse
Can you post more info on this?

Decompiling SystemUI.apk problem

I've been trying to decompile SystemUI to mod a couple xml's. Whenever I try with apkmanager I get errors. I know there's some trick to get this to work with framework. Can anyone help a noob out?
tallgrasshawk said:
I've been trying to decompile SystemUI to mod a couple xml's. Whenever I try with apkmanager I get errors. I know there's some trick to get this to work with framework. Can anyone help a noob out?
Click to expand...
Click to collapse
its better to bring the error log here, its located in apk manager directory log.txt
When at the PC I will zip up my apktool and run you through what I do
---------- Post added at 05:08 AM ---------- Previous post was at 04:53 AM ----------
Here is my APKtool folder (I doubt it matters but I keep it in the C drive) C:\apktool
http://dl.dropbox.com/u/22063477/apktool.zip
1. apktool if framework-res.apk (this is the stock framework from whatever rom you are working on)
2. apktool d -f SystemUI.apk (seem to have better luck with using the force command)
3. make your edits
4. apktool b -f SystemUI SystemUIedit.apk
5. clap with glee that after bashing your head into a wall like I have been you can now edit XML's
6. now come help me fix some things in my themes
Don't you also have to install the twframework as well?
tallgrasshawk said:
Don't you also have to install the twframework as well?
Click to expand...
Click to collapse
I didnt have to but may want to avoid some of the phantom file missing errors
Hmm. I get the res folder decompiled but I still get a smali folder as well. And looking at the xml's I think I'm getting in over my head.
tallgrasshawk said:
Hmm. I get the res folder decompiled but I still get a smali folder as well. And looking at the xml's I think I'm getting in over my head.
Click to expand...
Click to collapse
here is what I did and it seemed to help me get teh basic understanding (changing clock color etc)
there is a app called CSDiff you can use it to compare diff in a folder, so I decompiled two SystemUI's one stock one themed and then took a look at what changed in the XML then can test and recompile. has worked ok for me so far lol
Thanks for the help boosted. I think I got the color figured out. Do you know how to change the font as well? I don't really see that in the xml anywhere.
tallgrasshawk said:
Thanks for the help boosted. I think I got the color figured out. Do you know how to change the font as well? I don't really see that in the xml anywhere.
Click to expand...
Click to collapse
this gave me a headache more than helped but may help you out a bit..
http://www.xoomforums.com/forum/mot...guide-xml-breakout-themeing-full-details.html
Hey boosted, have you seen this version of apktool? It allows the decompiling of SystemUI, etc. with no problem. Rename current apktool.jar and name this new one apktool.jar and put it into APKmanager's "other" folder.
Comment deleted

Status Bar Force Closes

I'm trying to do some editing to the status_bar.xml, but anything I do causes force closes and no status bar.
I'm pulling SystemUI.apk via ADB, decompiling with APK Multi-Tool, making a change in the status_bar.xml as small as changing the background color of it, compiling with APK Multi-Tools, and pushing with ADB. Every time, it just disappears and starts spam force closing.
Any ideas?
EDIT: Changing ANYTHING from SystemUI.apk seems to cause force closes.
Muffunz said:
I'm trying to do some editing to the status_bar.xml, but anything I do causes force closes and no status bar.
I'm pulling SystemUI.apk via ADB, decompiling with APK Multi-Tool, making a change in the status_bar.xml as small as changing the background color of it, compiling with APK Multi-Tools, and pushing with ADB. Every time, it just disappears and starts spam force closing.
Any ideas?
EDIT: Changing ANYTHING from SystemUI.apk seems to cause force closes.
Click to expand...
Click to collapse
What rom are you running? How are you installing the modded apk? What exactly are you trying to change? Are you making multiple mods at once? If you're modding any xml within the apk and it fc's when you install it, it's either not compiling properly or the changes you made aren't kosher. Try using apk manager with the latest apk tool to decompile and compile and see if that helps.
Also, if all you wanna do is change the status bar background color, just decompile the systemui.apk, edit statusbar_background.9.png (without breaking the pixel guides) recompile the apk, and instead of flashing the recompiled apk, extract that .png and drop it into the stock apk and flash that.
10tonhammr said:
What rom are you running? How are you installing the modded apk? What exactly are you trying to change? Are you making multiple mods at once? If you're modding any xml within the apk and it fc's when you install it, it's either not compiling properly or the changes you made aren't kosher. Try using apk manager with the latest apk tool to decompile and compile and see if that helps.
Also, if all you wanna do is change the status bar background color, just decompile the systemui.apk, edit statusbar_background.9.png (without breaking the pixel guides) recompile the apk, and instead of flashing the recompiled apk, extract that .png and drop it into the stock apk and flash that.
Click to expand...
Click to collapse
I'm on UnNamed, and I'm pushing the APKs via ADB in command prompt. I'm trying to change the color of the status bar right now, but I'd also like to change the icons. I did what you suggested, but it didn't change anything. Bar is still there and no force closes, but it's still the same color even though the 9.png file is a different color.
Muffunz said:
I'm on UnNamed, and I'm pushing the APKs via ADB in command prompt. I'm trying to change the color of the status bar right now, but I'd also like to change the icons. I did what you suggested, but it didn't change anything. Bar is still there and no force closes, but it's still the same color even though the 9.png file is a different color.
Click to expand...
Click to collapse
Do this, the compiled systemui that's giving you fc open it and the unmodified version. Drag nine patch image you edited to the unedited systemui
Sent from my SGH-I777 using Tapatalk
10tonhammr said:
What rom are you running? How are you installing the modded apk? What exactly are you trying to change? Are you making multiple mods at once? If you're modding any xml within the apk and it fc's when you install it, it's either not compiling properly or the changes you made aren't kosher. Try using apk manager with the latest apk tool to decompile and compile and see if that helps.
Also, if all you wanna do is change the status bar background color, just decompile the systemui.apk, edit statusbar_background.9.png (without breaking the pixel guides) recompile the apk, and instead of flashing the recompiled apk, extract that .png and drop it into the stock apk and flash that.
Click to expand...
Click to collapse
jivy26 said:
Do this, the compiled systemui that's giving you fc open it and the unmodified version. Drag nine patch image you edited to the unedited systemui
Sent from my SGH-I777 using Tapatalk
Click to expand...
Click to collapse
I tried that. Nothing happened, the status bar didn't change.
Muffunz said:
I tried that. Nothing happened, the status bar didn't change.
Click to expand...
Click to collapse
Don't adb push it. Just flash it. Download winrar (google it). Download one of my themes (or any theme) for unnamed, delete all the the folders except "system" and "Meta". Open system folder and delete eveything except "apps" folder. Open apps folder and delete everything. Add your modded systemui.apk to the apps folder and flash in cwm.
Its MUCH MUCH easier to use APK Manager and have it push it as an unsigned system app. After you push it, run an "adb shell killall system_server" <-- does a quick system reset, and you can test it out.
I'm not sure what changed but I finally got APK Manager set up to be able to push things itself, and I finally got a change to go through! Thanks for the help guys.

[Q] Modifying SystemUI.apk xml file

I am using kyanROM and love it! One little tweak I was looking to make was in the notification it has kyanROM along the bottom. I was looking to replace that with my nickname. I am new to modding Android, so any help or tips would be appreciated.
Here are the steps I took and the issues I encountered:
Using NinjaMorph I extracted/decompiled SystemUI
I copied the files over to my PC
Looking through the files (not an exhaustive search mind you), I found one, tw_status_bar_tracking.xml, that had android:text="@string/kyanROM and android:layout_gravity="bottom". This looked promising to me, so I changed kyanROM to the name I wanted to use.
After saving, I copied this file back to my phone and opened the projected in NinjaMorph and said replace the original xml file with my new xml file.
"Finished" the project and closed out NinjaMorph.
Immediately experienced issues. SystemUI stopped working. Rebooting did nothing. So I restored my nandroid backup in order to start over. Back in NinjaMorph, I extracted SystemUI again and copied all files to my PC. Searching the contents of all files (a more exhaustive search) I found 4 instances of the phrase kyanROM:
First was the original in tw_status_bar_tracking.xml and said android:text="@string/kyanROM"
Second is in values\public.xml and says <public type="string" name="kyanROM" id="0x7f0800cd" />
The last two hits are from the same line in values\strings.xml and say <string name="kyanROM">kyanROM</string>
Now, assuming I'm correct that I need to mod SystemUI, after looking at the search results I'm thinking the change I need to make is to the last hit on my search, thus making it <string name="kyanROM">myName</string>. Then, when tw_status_bar_tracking.xml looks for the string kyanROM, it will display myName.
So, am I correct that in order to make this change I need to be in SystemUI? And If that is correct, is my proposed change correct - modifying the strings.xml file to show <string name="kyanROM">myName</string>?
If I do those, go into NinjaMorph and say to replace the original file with my new file I then should see myName along the bottom of the notification dropdown. Thoughts???
So I started over, this time I pulled the SystemUI.apk using adb. Then using apktool I did "apktook if SystermUI.apk". Then, apktool d SystermUI.apk ./mod". Found the file I *think* I need to modify (\values\strings.xml) and replaced kyanROM with myName. Saved the file.
Now I'm trying to recompile the file. I run the following apktool b -f -d mod. When I run this I get the error: Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml.
1) Am I modifying the correct file to place myName at the bottom of the notification screen?
2) How do I fix the PathNotExist error? I've looked at some solutions, but none seem to have worked.
Actually you need framework-res.apk from /system/framework installed through apk tool.
Pull framwork-res.apk and install it as you did for systemui.
After installing framework,type
apktool d systemui.apk
Now make the necessary changes and type
apktool b systemui
To recompile it back.
Note:after you recompile,you need to add meta-inf folder from original apk to your new recompiled apk to make it work.
Sent from my GT-N7000 using xda app-developers app
OK, I think I'm with you.
I need both SystemUI and framework-res in order to modify SystemUI
Install both (apktool if NameOfApk.apk)
decompile (apktool d SystemUI.apk)
make changes
recompile (apktool b SystemUI) but not the framework-res since I made no changes to it
And thanks for the tip about adding the meta-inf folder. I knew this, but since I never gotten that far to test, I'd probably forget to do that.
cyberpac9 said:
OK, I think I'm with you.
I need both SystemUI and framework-res in order to modify SystemUI
Install both (apktool if NameOfApk.apk)
decompile (apktool d SystemUI.apk)
make changes
recompile (apktool b SystemUI) but not the framework-res since I made no changes to it
And thanks for the tip about adding the meta-inf folder. I knew this, but since I never gotten that far to test, I'd probably forget to do that.
Click to expand...
Click to collapse
Installing framework-res.apk alone is enough if you have Samsung phone and have the latest apktool...
Sent from my GT-N7000 using xda app-developers app
vijai2011 said:
Installing framework-res.apk alone is enough if you have Samsung phone and have the latest apktool...
Sent from my GT-N7000 using xda app-developers app
Click to expand...
Click to collapse
OK, I installed both - no harm I guess. So I have made all my changes, updated the apk with the meta folder, etc. I'm ready to push this over to my phone. Using adb, do I need to remount or can I just do the following: adb push S:\apk\SystemUI.apk /system/app/
Well, I took a shot and just did the adb push without remount. I think it worked. We'll see if there are any issues moving forward. Yay! Many thanks....
edit: I noticed it reset my wallpaper, easy fix. Wonder if anything else would've been reset by this change?

Categories

Resources