Hello, I'm trying to customize a rom and I'm running into some issues rebuilding SystemUI.apk.
I'm not sure if it matters, but for reference I'm using MoDaCo Custom ROM.
Here is my process:
Installed apktool 1.4.3 along with aapt from the ICS android SDK platform-tools
Extracted the SystemUI.apk file from the rom zip
Used apktool to extract SystemUI.apk
Made my change (edited navigation_bar.xml to put the buttons in the order I wanted)
Rebuilt SystemUI.apk with apktool. No errors.
Put the SystemUI.apk file back into the rom zip
Flashed the rom with CWR
However, once I get into android, there is no notification bar and no navigation bar. The launcher is just expanded to take up the whole screen. I believe apktool isn't rebuilding SystemUI.apk tool correctly, but I'm not really sure where to go from here. Is there some framework I'm missing for apktool that I need to add?
Any insight is appreciated. Thanks.
I'd start by just working with SystemUI.apk, not the entire rom zip.
Install the rom, confirm it's working.
Pull SystemUI.apk from the rom.
Decode it, make NO changes, re-endcode it then:
Code:
adb remount
adb shell stop
adb shell cp /system/app/SystemUI.apk /system/app/SystemUI.bak
adb push SystemUI.apk /system/app/
adb shell start
That will confirm your apktool and aapt and framework are working.
Also this way you can test each edit much more quickly.
Assuming this works then do the above procedure with your edited XML - you need to re-endcode then take the xml from one apk to the other.
If that does NOT work then you know there's a problem with your XML.
Related
I use Battery Indicator and don't like having two battery gauges at the top. I'm running Myns RLS5. Thanks
Any help would be great, as I need to remove the clock for the same reason. Who has the skills - please?!
Sent through space & time on the wings of 4G
You guys can do this yourself, look HERE
Anseri said:
SteelH said:
7. HOW-TO hide the clock
This reference assumes that you already know how to recompile a framework file using smali/baksmali.
Click to expand...
Click to collapse
This is the gotcha - I am not familiar with the Samali/baksmali tool, and the documentation I was able to find was not helpful.
Suggestions?
Click to expand...
Click to collapse
tgearman said:
Anseri said:
This is the gotcha - I am not familiar with the Samali/baksmali tool, and the documentation I was able to find was not helpful.
Suggestions?
Click to expand...
Click to collapse
Me neither. I was hoping to find a flashable zip file that would take care of this but no luck yet.
Click to expand...
Click to collapse
wirenut110 & tgearman - PM me if you want me to custom,ize your services.jar to remove whatever you would like removed.
For the clock removal (3.70) can't link it from my phone but the paper clip in Myn's Rom thread has it. (3.70 OTA no clock)
Sent from my PC36100 using XDA App
Im making a DIY guide right now. itl include how to use smali/baksmali
Skullmonkey said:
Im making a DIY guide right now. itl include how to use smali/baksmali
Click to expand...
Click to collapse
You could start with this:
1. Connect phone using USB and check that you can see your device using: adb devices
2. in your SDK/tools directory from command line do:
Code:
adb pull /system/framework/services.jar services.jar
3. Make a backup of the services.jar file that just popped in the tools folder just in case!
4. Download smali and baksmali from http://code.google.com/p/smali/ and place them in the tools folder. Rename the files to baksmali.jar and smali.jar to save on typing later
5. Open the services.jar file with something such as winrar or 7zip or whatever you prefer
6. Copy out the classes.dex file to your SKD/tools folder
7. run following from command line:
Code:
java -jar baksmali.jar -o classout/ classes.dex
8. Now browse to your new folders /classout/
9. Open the file you want to edit (i.e. the smali file) in something like notepad or context or any text editor, edit it, then save it
10. Now back to the command line and from your SDK/tools folder run:
Code:
java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
11. If the above finishes without errors you should have a file called new-classes.dex in your SDK/tools folder now that is the same size as your classes.dex file.
12. Rename the old classes.dex file to classes-old.dex and rename the new-classes.dex file to classes.dex
13. Open the services.jar file with your archiving tool again from step 5 and replace the existing classes.dex file with our new classes.dex we just created.
14. From command line run:
Code:
adb remount
15. also from command line:
Code:
adb push services.jar /system/framework/
16. Finally run:
Code:
adb shell reboot
ok... this is what i put together... either way will work
Purpose:
This will let you remove various status bar elements such as the clock and battery icons.
Disclaimer:
I am not responsible for any damage done to your phone. Always do a nandroid backup before doing any changes to your phone.
Requirements:
- (bak)smali
- Text Editor (I use Notepad++)
Instructions:
1. Extract classes.dex from services.jar (best to get a clean copy from your rom found in /system/framework/) and place it in your SDK/Tools folder.
2. Open a command prompt/terminal and change the directory to your SDK/Tools folder
3. Run this command (without quotes)
"java -jar baksmali.jar -o classout/ classes.dex" ~Tells baksmali to take classes.dex and decompile it into a folder called classout/
4. Delete classes.dex file from your SDK/Tools folder (saves confusion later)
5. Remove whatever you would like. SteelH has a post on all of these located here.
6. Now that all your changes are made, we need to recompile classes.dex. To do this, run this command (without quotes and capitalization matters)
"java -Xmx512M -jar smali.jar classout/ -o classes.dex" ~tells smali to take the classout/ folder and recompile it to classes.dex
7. Take classes.dex and add it to your services.jar overwriting the old one.
8. Use your favorite method to flash to your phone. If you need to create an update.zip, you can download a blank one in the attached file and place services.jar in the system/framework/ folder of the zip archive and flash like normal.
Click to expand...
Click to collapse
I see on Myn's thread someone posted a zip to remove the clock that is for the latest framework.
Find out who posted it and send then your mod request directly. I'd run it down for you, but I'm out to dinner my phone is going to get confiscated if I don't put it back in my pocket soon...
Sent through space & time on the wings of 4G
OK guys, have a look HERE. This should solve all your problems.
SteelH - you are THE MAN!!
Sent through space & time on the wings of 4G
Worked like a champ - just had to toggle signature verification.
Thank you very much, kind Sir. It's folks like you that make XDA rock!
SteelH said:
OK guys, have a look HERE. This should solve all your problems.
Click to expand...
Click to collapse
Thanks SteelH. That worked.
I've tried my hardest on my own, but I cannot seem to decompile and compile the systemui.apk properly without throwing brut errors. I've used APK manager and apktool, and both give me errors about the dependencies I'm trying to use. For reference, I'm using NilsP's last release of 2.1/3.0 business sense.
What am I trying to do?: remove the gprsone icon from the statusbar. I know the .png is transparent, but still takes space up on the bar.
Reference thread: http://forum.xda-developers.com/showthread.php?t=1231831
Any pointers? I've attached the framework-res and systemui in case somebody needs it to help.
Sure I can help. With apktook, you need to register your resources which are framework-res.apk and com.htc.resources.apk. Once you've registered those, then decompile the SystemUI.apk with apktool.
EDIT: Here's a quick little "How To" I use for apktool.
Put com.htc.resources/framework-res.apk's into the C:\Users\<username>\apktool folder (or where ever you keep your apktool)
Go to that directory in a CMD window, and type in:
apktool if framework-res.apk
Hit Enter
apktool if com.htc.resources.apk
Hit Enter
Decompile run: apktool d <apk name>.apk
Compile run: apktool b <apk folder name only>
After you compile it, the apk will be in the dist folder. So for SystemUI.apk, the folder is named SystemUI. Open SystemUI/dist, and move the SystemUI.apk folder to your desktop. Use 7zip to open the original SystemUI.apk, extract the META-INF folder and Android Manifest. Open the new SystemUI.apk and put the META-INF and Android Manifest files into this new apk. You should be good to go then.
If you get really stuck, let me know and upload your com.htc.resources.apk, and I can help you out.
Attached are successful screenshots of registering your resources and decompiling successsfully, then recompiling successfully for reference as to what you should see. I used a Rosie.apk, but it'd be the same with SystemUI.apk.
Thank you for taking the time out to help!
Sorry but I followed your instructions to a T, but my phone won't get past the HBOOT (i think that's the correct term)
This time, I didn't get compile errors with apktool, but I'm not sure I did everything correctly.
I've attached my com.htc.resources.apk
http://www.mediafire.com/?2yoijsmr954md1g
Okay, I downloaded your SystemUI.apk file, and removed the classes.dex file using 7zip and decompiled that using a Java command and baksmali. I made the edits, recompiled the new classes.dex file using a Java command and smali.
It's a different way of doing things, and how I first learned to hide the location icon, and status bar clock so I feel most comfortable with doing it that way.
Attached is the updated SystemUI.apk you provided, with *hopefully* a hidden location icon from the status bar.
The easiest way to do this:
Hook phone up to computer via USB, reboot into Recovey.
Mount /system.
Open command prompt, CD to your SDK/platform-tools directory.
Type in: adb shell
Type in: cd /system/app
Type in: cp SystemUI.apk SystemUI.bak
NOTE: This makes a copy of SystemUI.apk named SystemUI.bak.
Type in: rm SystemUI.apk
NOTE: This removes SystemUI.apk, we can always to the opposite of the cp command from above to get the original back.
Type in: exit
Now make sure your modded SystemUI.apk is in your SDK/platform-tools folder, then type: adb push SystemUI.apk /system/app/
Now let's make sure that the permissions will be correct, so adb shell back into your phone, and then type cd /system/app.
Lastly, type: chmod 0644 SystemUI.apk
Hit Enter.
Type in: exit
We're done, reboot your phone.
I want to say thanks for helping me out today.
I learned some things and got the location icon removed from the statusbar.
This sounds like a win!
kschwarz88 said:
I want to say thanks for helping me out today.
I learned some things and got the location icon removed from the statusbar.
This sounds like a win!
Click to expand...
Click to collapse
Dude, that's great to hear! I love sharing what I've learned, and am glad you took the time and learned something! This stuff is fun, so continue learning!
It's a total win! If you wanna know the Java commands to decompile classes.dex, let me know, and I can pass that knowledge on!
Sent from my ADR6300 using xda premium
I'm far from a novice when it comes to this stuff, but for some reason I still can't seem to push any modded framework back to my phone. Maybe some of the talented themers that mod multiple frameworks for different ROMS can help.
My method thus far:
Decompile framework with apktool 1.4.2 (1.4.3 gives errors in public.xml and after researching is supposedly a bug in the apktool version)
-Copy projects folder and framework-res.apk to apkmultitool
-recompile with changes using apktool 1.4.3 in ApkMultiTool
-no errors so far in either decompile or compile.
-rename unsigned framework to framework-res.apk
-adb push ./"framework-res.apk" /system/framework
-changes are visible in framework, shortly before apps start force closing like mad.
Questions:
-Do i need to push framework over adb from CWM with /system mounted, or can i do it from within a booted OS?
-I only have one framework installed to C:/, but it's for a slightly older build (AOKP b23) - could that be the culprit?
-How would i go about overwriting an installed framework for when i update builds, so it's always using the current framework?
Thanks guys.
This sounds bad but did you actually install the framework you were modifying? I had the same issues with framework editing with ICS. My lockscreen would go all over the place.
Put the framework-res into the "Place-here-for-modifying" folder and type this command in CMD
java -jar other/apktool.jar if place-apk-here-for-modding/framework-res.apk
Click to expand...
Click to collapse
I have a batchfile that does it for me automatically. Try that. If you've installed the framework already then I'm baffled by this.
EDIT: Saw the whole post and it seems the current installed framework WILL be the culprit. Any older version of a framework (especially AOKP) will screw up. You just need to use the batch file I'm using to keep on top of it. I install the framework everytime I edit a framework. I'm a little OCD like that.
If you need the batch file, PM me.
artvandelay440 said:
I'm far from a novice when it comes to this stuff, but for some reason I still can't seem to push any modded framework back to my phone. Maybe some of the talented themers that mod multiple frameworks for different ROMS can help.
My method thus far:
Decompile framework with apktool 1.4.2 (1.4.3 gives errors in public.xml and after researching is supposedly a bug in the apktool version)
-Copy projects folder and framework-res.apk to apkmultitool
-recompile with changes using apktool 1.4.3 in ApkMultiTool
-no errors so far in either decompile or compile.
-rename unsigned framework to framework-res.apk
-adb push ./"framework-res.apk" /system/framework
-changes are visible in framework, shortly before apps start force closing like mad.
Questions:
-Do i need to push framework over adb from CWM with /system mounted, or can i do it from within a booted OS?
-I only have one framework installed to C:/, but it's for a slightly older build (AOKP b23) - could that be the culprit?
-How would i go about overwriting an installed framework for when i update builds, so it's always using the current framework?
Thanks guys.
Click to expand...
Click to collapse
I don't think it's good to push framework while the phone is in use. I always push system stuff while in recovery. That way the 'android' portion of the phone isn't running and you can replace what you need to.
I haven't tried replacing the framework for Galaxy Nexus but for the SGS2, I usually do a sync and reboot immediately after pushing the file:
Code:
$ adb push framework-res.apk /sdcard/framework-res.apk
$ adb shell
# mount -o remount,rw /system
# sync
# cat /sdcard/framework-res.apk > /system/framework/framework-res.apk
# sync
# reboot
It hasn't failed once for me.
I've managed to get ApkMultiTool updated to decompile and compile without any errors now, eliminating the need to use a different program. However, now when i push modded framework to the phone, it simply hangs at the animation on boot. I made sure i only had b25 framework installed this time (thanks Nitroz) but the darn thing still won't boot. grrrrr.
-Decompile/Compile with Apk multitool using apktool 1.4.3 and only edit 2 .png images.
-rename unsignedframework-res.apk to framework-res.apk
-adb reboot recovery
-mount /system
-adb push ./"framework-res.apk" /system/framework
-hangs up at boot animation.
-FML
I even tried not using apkmultitool at all and just using console commands with apktool itself and still got the exact same result.
Really appreciate the help so far, and if everyone is out of ideas, that's ok.
DO THIS AT YOUR OWN RISK MODDING FRAMEWORK IS DANGEROUS READ EVERYTHING BEFORE DOING ANYTHING
Im not responsible for bricks
your house burning down
your cat gone missing
or your phone blowing up
Ok this is NOT my idea here is the original thread http://forum.xda-developers.com/showthread.php?t=1364757
first you will need the android sdk http://developer.android.com/sdk/index.html
you need to install it on your C: directory eg:/android/android sdk
notepad++ is needed to
7zip is also needed and you need to set it as default program for apks
and apktool http://code.google.com/p/android-ap...mmary+Uploaded+ReleaseDate+Size+DownloadCount use apktool 1.4.2 if you get problems with 1.4.3 you will need apktool installer and apktool once extracted put them in a folder in the C: directory and add them to path eg; C:/android/apktool/
THE ANDROID SDK AND APKTOOL NEED TO BE ADDED TO PATH OR NONE OF THIS WILL WORK!
lets get started!
the decompile
1: open command promt and type in
Code:
cd android
(make this folder b4 you start in your user)
2:then
Code:
adb remount
if you installed adb correctly it will say remount succeeded
3:then type this in
Code:
adb pull /system/framework/framework-res.apk
once its done pulling apk
go to android in your user and you will see (if you did it right) framework-res.apk
4: back to cmd and type in
Code:
apktool d framework-res.apk
let it do its stuff
once done goto android in your user and the apk will be decompiled there for you
the modding
1: open up framework-res click on res and scroll down to values open it and click on bools
2: open bools in notepad++ and find "config_showNavigationBar" and set to true
3: now open dimens and find "navigation_bar_height" and set to 34.0dip
4:if your running a kernel like glitch devils you can disable the touch key backlights using nstools
5: done!
the recompile
you will need to switch out the appt in the folder you put apktool and stuff eg:were i put mine C:/android/apktool/
new appt http://www.mediafire.com/?0q52u6v8vdkpq1i
1:switch out appt with the new one
2:goto cmd and type
Code:
apktool b framework-res
then press enter
3:if you did everything right (installing android sdk and apktool) this part should take about 5min
4:if the recompile succeeded kiss your self (joking)
5: open android in your user (NOT ON C: DRIVE) and click on framework-res you will see a new folder called "build" click on it and
you will se three files one of these is "AndroidManifest" leave that well alone open framework-res.apkin 7zip and drag the two folders in "build" into the apk again dont drag androidManifest once the modded filles are in the apk close 7zip
adb push it back to your phone
1:in command promt type
Code:
adb push framework-res.apk /system/framework/
2:when push is complete type
Code:
adb reboot
this will now reboot your phone
3: once booted up you should see the three touch keys at the bottom of your screen everything will look cramped
so goto market and download LCD Density Modder and change the dpi from 240 to 228 reboot and enjoy
obviously this guide is for NOOBS this is not my idea just wanted to give people a easier guide to modding framework
all credit goes to evilisto not me hope you do what you want!!!
this will also work on
nexus s
nexus one
galaxy s II
vibrant
crappy
and galaxy note
other phone you probably can but these are the only ones ive tried it on try on other phones at your on risk
happy modding
peace
Many of you have been asking me how I customize my Defy mini.
Well there you go with a tutorial.
So first things first.
-- Your phone must be rooted
-- Somewhere on your computer you have the Android Debug Bridge (adb) and fastboot
-- I supposed you know what you are doing so if it doesn't work / brick your phone / etc... you and you only are responsible for this.
-- I can help you make it work, but please provide me enough information so can really help you
-- All the files you should need are in the tools.rar archive attached
So, this being said, let's begin.
First things first. To proceed, you will need to extract two files. framework-res.apk and systemUI.apk
Code:
adb pull /system/framework/framework-res.apk framework-res.apk
adb pull /system/app/systemUI.apk systemUI.apk
Then go to http://uot.dakra.lt/ with your favorite browser :laugh:
Go to kitchen, go through your customization.
Do try to change the loockscreen it won't work
If you change the battery icon, the animation when charging will not work
You can select gingerbread option.
Resolution has to be set to mdpi (320x480)
In the File upload section
Select your rom from kitchen's list, and upload your own files : choose Upload system files and upload the systemUI and framework-res extracted earlier
Choose any update binary on the list.
Then go to summary. If everything's green you are good to go, you can submit your work to kitchen.
You'll get a order number. Then just wait in the pickup section to get back your new, awesomely customize files !
Before install this update with CWM recovery, you have to change the updater-binary.
To do so open the UOT zip with 7zip for instance. And change the META-INF\com\google\android\updater-binary with the one in the tools archive
Then your good for installation !
Code:
adb push UOT-XX-XX-XX-XX-X.zip /sdcard/UOT.zip
adb reboot bootloader
fastboot boot recovery.img
Choose install zip form sd card, reboot and enjoy !
Hi.
Code:
adb pull /system/framework-res.apk framework-res.apk
adb pull /app/systemUI.apk systemUI.apk
File not Found.
Do u try that ? i'm not sure :'D
U mean this or ? ->
Code:
adb pull /system/framework/framework-res.apk
adb pull /system/app/SystemUI.apk
Thanks for this TUT
Tubii said:
Hi.
Code:
adb pull /system/framework-res.apk framework-res.apk
adb pull /app/systemUI.apk systemUI.apk
File not Found.
Do u try that ? i'm not sure :'D
U mean this or ? ->
Code:
adb pull /system/framework/framework-res.apk
adb pull /system/app/SystemUI.apk
Thanks for this TUT
Click to expand...
Click to collapse
You are right. I'll correct that, thanks.