[Q] Can I get a li'l help w/ merging diff framework-res.apks?.. - Samsung Epic 4G Touch

'K, so'm new 2 android hacking, but I'd like 2 make a framework-res.apk that includes StarBurst's MotoBlur x-itions here, SAShady's CRT Off animation here, & Gingerbread's Overscroll & MotoBlur Orient8ion animations when they become available. How would I go about merging the MotoBlur x-itions w/ the CRT Off animation, as they're both framework-res.apk files? Also, where mite I extract Gingerbread's Overscroll & MotoBlur Orient8ion files, is it from a stock Gingerbread framework-res.apk & MotoBlur (possibly Photon 4G) framework-res.apk? &, how would I know which files 2 extract? Are there any particular s/w tools that I need?
Thnx.

That's going to be a bit of work. I just went through the learning process of decompiling, modifying, and recompiling .apks myself. I don't have the most efficient method down yet, but I can get you started.
First up, are you using an odexed or deodexed ROM?

Thnx 4 the help.
Sycobob said:
...I just went through the learning process of decompiling, modifying, and recompiling .apks...
Click to expand...
Click to collapse
I'd really dig a link(s) to these resources. &, I'd b usin' the Stock ROM, which I'd imagine is odex'd.

EDIT: Man do I feel foolish. I just typed out way more than I needed to, thinking framework-res.apk was odexed. *sigh*. Oh well, I guess I just started the tutorial I was thinking about posting.
This won't be too hard:
Pull your stock framework-res.apk from /system/framework/.
Gather the other modded .apks
Decompile each of the .apks (luckily framework-res.apk doesn't rely on other stuff, so decompiling is easier)
Drag the modified file(s) from one of the decompiled, modded .apks to the stock one overwriting the old file(s)
Repeat for each mod
Recompile the new uber-modded .apk
Push it back onto your phone
Decompiling
You're going to need Apk Manager for decompiling and recompiling.
Place the .apks you want to decompile in the 'to be modded' folder of Apk manager
Run the script in the Apk Manager folder
Enter 22 to 'Set Current Project'
Pick the .apk you want to decompile
Enter 9 to decompile (no dependencies)
Repeat 3-5 for each .apk
Recompiling
(In Apk Manager) Enter 22 to 'Set Current Project'
Enter 11 to compile
Enter y (this is a system app)
Enter y (I haven't been able to get it to work when I answer no here)
Follow the prompt and delete the files you've modified from the 'keep' folder
Go back to the command prompt and press a key to continue
As for actually finding the changes, you're on your own here. I guess you can look for files with different sizes/modified dates or try to search the forums to see if people mention what they had to change for the mod. If two mods change the same file, you're going to have to open the file and make both sets of changes then toss it into the .apk.
Pro tip: if you have Eclipse set up with the Android SDK, you can go to Window > Preferences > XML > XML Files > Editor and check "Split multiple attributes each on a new line" so that when you hit Ctrl+Shift+F while looking at the messy decompiled .xmls it will instantly format it into a more easily read form. <--This is why I love Eclipse
If you don't know how to push the file back into place, it's a bit of a pain without a modded boot.img that allows you to use 'adb remount'. Copy the .apk somewhere on your phone. From command prompt (with phone plugged in):
Code:
adb shell
su
stop
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
cp /wherever/your/file/is/framework-res.apk /system/framework-res.apk
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
reboot
Unless you have CWM and know how to write/reuse an update.zip.

Thnx, Sycobob. I'm just afraid that there'll be an overlap in overwritten files. But'll c.
Sycobob said:
...and updating the archive...ext3
Click to expand...
Click to collapse
&, what d'ya mean by upd8ing the archive, is it signing? Also, I'd thought all of the E4GT partitions were ext4. Didn't even activ8 my E4GT, 'cause'm still tryin' 2 get my TP2 repaired, so I can flip it. Maybe u can help me w/ another Q - I've been lookin' all ovr 4 info on android OS, &'ve been able 2 find what each partition is, using adb cmds, but cannot find, 4 the life of me!, a glossary of sorts on all of androids system files, a la "framework-res.apk is..." I really wanna get n2 android hacking/modding w/o havin' 2 use an app 2 make any & every change that I'd wanna make 2 the OS. Comin' from WiMo, I was very familiar w/ the registry, exploring & hacking it, but there's no real equivalent n android. Also, do go here & vote 4 my Brushed Aluminum Barely There Case with Kickstand suggestion. We're already n 9th place. Thnx again 4 ur help.

System packages don't get signed. By updating, I mean dragging the file into the WinRAR archive which automatically replaces the existing file in the archive, therefor updating it.
All the partitions are ext4. This is where my newbishness shows, I have no idea why I have to use ext3. /dev/block/mmcblk1p21 isn't the correct path either, but it works. In one of ptfdmedics posts he uses the same options. If I use the 'correct' mount -o rw,remount -t ext4 /dev/block/mmcblk0p9 /system it doesn't work. *shrug*
Also, I just realized something I missed in my first post. If you modify an .xml the resources.arsc in the .apk needs to be regenerated. This is done when you decompile and recompile the package. I'll be editing my previous post to reflect this.
As far as a glossary, I have no idea where to find one. I would mind having access to something like that though. If you find something, please post it.
EDIT: don't worry too much about overlap. I'd imagine it'll be easy to find the changes you need to make, then you can just copy+paste the relevant lines. Pro tip: if you have Eclipse set up with the Android SDK, somewhere in Window > Preferences > XML > XML Files > Editor > Check "Split multiple attributes each on a new line" and when you hit Ctrl+Shift+F while looking at the messy decompiled .xmls it will instantly format it into a more easily read form. Adding this to previous post.

Thnx, 4 all of ur help. I've got a lotta wrk ahead of me 2 experiment w/ this stuff. Now, just gotta find the time.

Related

[Updated] - How-to Theme Development

To create themes, or to edit themes to your liking, you will need a working knowledge of android, adb, how to resign apk's, knowledge of your own O/S.
Before you start be aware that you will may end up wiping your phone once, if not more. So lets go over the things that you will need.
You will need JF's RC30, RC8, or ADP1 V1.3, depending on what version you intend to create for.
Here is the link to these: http://forum.xda-developers.com/showthread.php?t=466174
You will also want to get the dev bootloader installed on your phone and to HIGHLY suggest everyone trying your theme to install it as well.
Link to dev bootloader: http://forum.xda-developers.com/showthread.php?t=455860
You will also need to resign all the apks located in /system/app and framework-res.apk located in /system/framework. When you push all of these to your phone.
JesusFreke was kind enough to build a custom signing tool for me that would allow me to right click on an apk and resign it from there. I am posting it here for others to use as well. Note that this is a courtesy of JF, so thank him for it. I cannot stress how much time this has saved me and will save you.
Here is the link: Http://www.FightForthePits.com/testsign(2).zip
Before using this you need to know how to set this up:
I will assume that you have the sdk downloaded and extracted somewhere(if not, do that now), extract both files to the tools directory of your sdk.
Now you will need to add the tools dir of your sdk to the environment variable CLASSPATH.(This is for XP, Vista coming soon)
To do this, right click on My Computer click properties, then choose the tab that says advanced. Click the button that says environmental variables. Go to system variables find the one that says CLASSPATH, double click it, go to the end of variable value. There should be a semicolon ; at the end. type in the path to the testsign.jar located in the tools directory of your SDK, for example the path to my testsign.jar was c:\sdk\android-sdk-windows-1.0_r1\tools\testsign.jar If CLASSPATH is not in your system variables then create it. Secondly, Find the system variable called PATH and add to the end of it, the full path to your sdk directory. For example, mine was c:\sdk\android-sdk-windows-1.0_r2\tools
Now right click the reg file that you extracted and choose to install it, or merge.
Now, right click an apk, do you see an option that says ResignApk? That's how you will resign your .apks and .zips.
If you find the right click menu not working for some reason you can type the following in cmd to sign your files: java testsign whateverfiletosign
Now through doing this you have done two things, first off you have made the resigning process extremely easy, secondly you will not have to cd to the tools dir of the sdk to use adb or any other tool in the sdk.
You will also need a version of linux installed or running vmware with linux, if you want to create, or edit, an update script, which will install the theme onto the users phone.
You will need to be specific in addressing what version your theme is for, RC8, RC30, or ADP1. Make sure every file gets signed. Make sure you test the update.zip before you release it.
Every .apk contains the images relating to itself. However, every apk has the ability to use the images in framework-res.apk. The images for every apk is located inside of itself. To find these images open up the apk, you can rename it to .zip or open it with an archiver of your choice, winrar, winace, etc. Then after opening the apk open the folder called res and inside of that there are folders that are named Drawable, drawable-land, drawable-port, etc. This is where the images are stored.
Ther are some things you cannot edit unless you rebuild the entire apk from source, which we will not go into here.(another tutorial, another time) Just know that at this time you SHOULD NOT edit, or even open images with the extension .9.png. If you do you will have problems...Trust me. These are special images called ninepatch images and android resizes these images to fit wherever android, or any other apk, needs it to. if you do open them or edit them they will no longer render correctly when resized. I believe that in order to edit these you must do so and then put them into the source and rebuild the entire apk.
Before getting started you must also realize that you cannot simply resign one or two apk's and stick them in your phone and expect them to work. You must resign every apk inside of /system/app and framework-res.apk and put them on your phone at the same time.
To simplify this process for you though, I have provided an empty update.zip which you can place all of your resigned apps into and use to update your phone to your custom theme. You can also download someonelses theme and use there files, since they are resigned already. It may also be easier to see what files do what and go where since they have already been edited and are easy to point out.
Now, your ready to start changing things up.
You will now need to open the apk, which you can do by adding .zip after .apk, effectively changing it to a zip. Note that if you are using windows you will need to unhide known file extension types. you can also use your favorite archiver such as winrar, winzip, etc.
See here to unhide known file extension types for Xp: http://www.mediacollege.com/microsoft/windows/extension-change.html
See here to unhide file extension types for Vista: http://maximumpcguides.com/windows-vista/how-to-change-a-file-extension/
After opening the apk go to res and copy the folders that have drawable in their name. Go to your desktop, or wherever, create a new folder called Images, or whatever. Open the folder, paste the drawable folders in there. Now you can see what the files look like without opening them. Btw, you may also want to add -frame, or -launcher, to the end of the folders you cope over to keep them separated from others.
Finally, you've edited the images put them all in the apk renamed it back to an apk and resigned it. Now it's time to push it to your phone and see the changes you've made.
Important! : Whenever pushing files to the phone NEVER do it while the phone is running. Do this in recovery mode! If you do this while the phone is running normally you will begin to lose space in /system.
So, boot into recovery plug your phone in and open a cmd prompt. From the cmd prompt type adb shell mount /system then type the following: adb push c:\whereveryourfileis\whateveryourpushing.apk /system/app (system/framework if your pushing framework-res.apk)
Now reboot your phone. If it doesn't boot, try doing a wipe, if that doesn't work reinstall an update and try again. There are alot of things people can do wrong, I can't explain them all here. If you get real stuck, you can ask for help here or contact me on Gtalk [email protected].
So now your theme is done and your ready to make an update.zip for others to install your theme.
I have created a template for you to make your own update.zip. Just download, add the system apps to app, and framework to framework. Zip it up, SIGN IT, TEST IT YOURSELF, and then distribute it!
Empty update.zip template: Http://www.FightForthePits.com/Androidstuff/update_empty.zip
If anyone has any questions please try asking for help in this thread before emailing me for help Usually I will respond to questions in this forum.
I hope this Tutorial has been helpful. I will add on to it as needed.
Stericson
Links of interest:
Downloading SDK: http://code.google.com/android/intro/installing.html
Using ADB: http://code.google.com/android/reference/adb.html
Working with ninepatch should be straightforward if you use the draw9patch tool included in the SDK. Documentation on usage here:
http://code.google.com/android/reference/draw9patch.html
JF could also save theme users a wipe by resigning /system/app/* and /system/framework/framework-res.apk in his builds with the test keys. Nice tutorial, btw.
However it doesn't. I have used that to no avail. I believe you need to edit the images, put them in the source then rebuild the apks from the source.
As for JF's update, it does not currently wipe your phone after install. So, for him to do this he would have to have his update do a wipe. So technically, they would still have to do this initial wipe.
Stericson
Stericson said:
However it doesn't. I have used that to no avail. I believe you need to edit the images, put them in the source then rebuild the apks from the source.
Click to expand...
Click to collapse
Good point. I thought you could simply drop a similarly dimensioned PNG in but apparently there is some metadata that only the android tool can create.
As for JF's update, it does not currently wipe your phone after install. So, for him to do this he would have to have his update do a wipe. So technically, they would still have to do this initial wipe.
Click to expand...
Click to collapse
True, but a user who is upgrading to a JF update after having put in customized (and test-key signed) system apps will have to wipe again anyway =) Anyone using custom themes will have to wipe every time a JF update (or any update) comes out. However if JF resigns, custom theme users would not have to wipe and stock theme users only have to wipe once. (Nevermind the fact I think everyone should wipe when updating...)
thx stericson this will help big time how long before I can get resigned rc30 last night when you said all the apk. need to be resigned I was like this is going to be a long night but I see jf hooked you up save some big time with his resigning tool
jashsu said:
Good point. I thought you could simply drop a similarly dimensioned PNG in but apparently there is some metadata that only the android tool can create.
True, but a user who is upgrading to a JF update after having put in customized (and test-key signed) system apps will have to wipe again anyway =) Anyone using custom themes will have to wipe every time a JF update (or any update) comes out. However if JF resigns, custom theme users would not have to wipe and stock theme users only have to wipe once. (Nevermind the fact I think everyone should wipe when updating...)
Click to expand...
Click to collapse
Ah, good point
The resigned apps will be released maybye sometime tonight...I had them done but ran into a script problem on adp1 and I have yet to try the rc30 and rc8 ones yet. so I won't release those until I've tested them. If you want to be a Guinea pig however, just let me know
Stericson
Stericson said:
Ah, good point
The resigned apps will be released maybye sometime tonight...I had them done but ran into a script problem on adp1 and I have yet to try the rc30 and rc8 ones yet. so I won't release those until I've tested them. If you want to be a Guinea pig however, just let me know
Stericson
Click to expand...
Click to collapse
The resigned apps have been released, each update file will resign all of apps in /system/app and framework-res.apk. However, these updates make no changes to them whatsoever...Meaning your phone will look just like a brand new phone without any modifications.
rc30 works thx Stericson made it easy for use
Issues with using the update.zip above
Hi all,
I just wanted to point out that after I applied the update.zip above and rebooted applications kept force closing randomly and constantly even through the initial setup (where you have to click the green android to start).
Prior to this, I had JF's RC30 1.3, and the engineering bootloader V2 no sigcheck.
First I did just a alt+s then a alt-w and alt+s. And still nothing.
I'm new to all this so I'm not even sure where to begin troubleshooting. Should I be using the HardSPL?
Thanks in advance and I appologize if this isn't the right place for this post.
Update:
After reflashing with JF's 1.3 RC30 and the problem persisted I noticed that there was a new release 1.31 and this has fixed the problem. I hope this helps anyone else who runs into the same problem.
I still don't know what went wrong though, can anyone shed some light on this? thanks.
Truly there's no telling, sounds like J'f's update fixed it. Can I ask what version you tested?
I would also like to announce that now, thanks to JF, again, you do not have to wipe your phone completely to apply the resigned app updates. However, you will have to re-enter your google info and your call history and other minor things will be gone, but all of your apps will be retained.
Stericson
Alright, I am a little confused........
So I downloaded testsign.zip and extracted it to the tools folder. Then I went into environmental variables and added CLASSPATH with the value D:\Android\tools\testsign.jar and now I am not sure what to do next. Can someone give me some clarification. And btw I am on XP but I can get on linux at home if I need it, but I am a total noob to all this stuff so be gentle.
I'm using http://www.fightforthepits.com/Androidstuff/update_Rc30.zip and have been encountering issues when the phone boots up. As soon as the initial phone setup comes up I get process force close errors, I extracted launcher.apk, edited the files I wanted, repacked it, signed it and then resigned the update.zip. Any ideas what I'm doing wrong? I'm already running JF's RC30 1.31
Did you repack it in linux? Did you resign Launcher.apk? Also, that update file was never meant to be used as a template for an update since it kind of wipes your phone. You should be using update_empy, to push your own theme.
If you want to do only one file at a time, flash that update(update_rc30) then adb push your file into system/app. There are lots of things that you can mess up, most of them are hard to catch too. At any rate, everyone who has made a theme can tell you it's not just a straight forward process, expect errors. I've had more than I count I know....
Trial and error is your best teacher
Stericson
Stericson said:
Did you repack it in linux? Did you resign Launcher.apk? Also, that update file was never meant to be used as a template for an update since it kind of wipes your phone. You should be using update_empy, to push your own theme.
If you want to do only one file at a time, flash that update(update_rc30) then adb push your file into system/app. There are lots of things that you can mess up, most of them are hard to catch too. At any rate, everyone who has made a theme can tell you it's not just a straight forward process, expect errors. I've had more than I count I know....
Trial and error is your best teacher
Stericson
Click to expand...
Click to collapse
Must .apk's be signed if they're pushed over ADB? I'm not running Linux, I'm repacking/signing in windows.
I also had the issue with force close when installing the resigned update from the first post, apps that shouldn't even run on start up were force closing.
Also the IM application was gone, had to do a wipe and go back to jf 1.31 to correct it
I will take another look at the update I provided...
Stericson
did you ever figure out how to change the text on the status bar from black to white?
to do that you have to rebuiuld the entire apk from source and edit an xml document
Stericson
has anyone tried making the icons bigger? I noticed they are 48x48 if we go bigger will that affect anything? Also has anyone been able to remove the text below the icons on the home screen? Oh and where is the tab located that has been made invisible?
*edit
well I tried making the icons bigger and it doesn't really do anything, they don't show up bigger on the screen. Might have something to do with the text underneath, not sure.
Kyeld said:
Must .apk's be signed if they're pushed over ADB? I'm not running Linux, I'm repacking/signing in windows.
Click to expand...
Click to collapse
yes they must be signed.

Integrating Theme switcher

I was wondering if anyone thought about integrating a theme switcher with modified firmwares. I wonder if its possible without having to reboot to install a different skin.
possible!!
i wud thnk its possible bcuz its the same concept as the jf updater!! it wud just bring up a list of themes to choose from and u pic 1 thn it just does the auto reboot and the name change!! in theory it makes since but im not tht good of a dev. so i cud b wrong!! just gotta wait n c i guess!!
acejoker25000 said:
i wud thnk its possible bcuz its the same concept as the jf updater!! it wud just bring up a list of themes to choose from and u pic 1 thn it just does the auto reboot and the name change!! in theory it makes since but im not tht good of a dev. so i cud b wrong!! just gotta wait n c i guess!!
Click to expand...
Click to collapse
Ouch...my head. Your keyboard seems to be missing some letters.
For the OP, you would need to reboot to apply the update.zip, I don't believe it can be applied without the phone rebooting, even if an application was to do the "switching" for you.
it would be like winterboard in the iphone/ipod touch restart every time you change themes. But i dont mind if an app could do the hole process for me
why not?!?
why is it not possible without a reboot?
as far as i know the themes are only images overwriting the original images...
now only some one has to try it ^^
i found the "framework-res.apk" on my phone (ADP1) in /system/framework
now just cp "NEW-Themed-framework-res.apk" to /system/framework
and restart the home app...
or the app that uses these images .. i dont know when there are loaded ... if they are loaded already on boot we need a reboot!
is anyone brave enough to just force cp the theme file
shouldn't do any harm its linux so what ....
lad
ps probably i will -.-
sounds great in theory, and i like the last post about it being linux so who cares, we can always fix it. but personally i would prefer an app similar to the JFupdater app. the main problem with that is that someone (not me) would have to make sure that the server the app reads from always has the most updated themes, and with our devs posting 10 new themes a day and only getting more since RandumAccess has posted 10 himself in the last two days it would get to be quite a headache. i like both ideas, the app seems like the better one, but please let up know if you get the force cp to work, it might get us on our way
ok
dont try it !!!!!
i did it thru the terminal app and after copying i pressed the home button to see i f anything happend...
well yes ... it rebooted ... and it stuck at booting ...
fixing my phone now ....
JUST DONT TRY IT! ....
Doesent it work like openHome and Bettercut ?
just relink the icons with an app?
I liked a themes icons here but hated what they did with the bars so I just copied the /system/app/ apks to mine and it worked without a reboot. I guess you could just make a program that copies apks around but I'm thinking having themes stored in /data/themes and symlinking the apks would work better. What do you guys think?
DeadBody79 said:
Doesent it work like openHome and Bettercut ?
just relink the icons with an app?
Click to expand...
Click to collapse
i thought so...too
thats why i tried to overwrite them ... but it seems that ii's more complex...
but mabye if we place symlink / hardlinks into the theme package..
and link to a location with the new image (so we can change this image)
something like /data/framework/framework-res.apk/res/drawable
ok i played a little with symlinks and hardlinks
what we need are symlinks with an absolute path
we can copy (with cp -d ) these into the package...
i'll try that ...but it may take a while since i never singed a package...
lad
What if you used scripts to rewrite the data and auto save apply the theme then forclose or cause a light reset? I'm assuming the system would have to be completely rebooted for the textures to take effect!?
ok
i have a problem with signing ...(i am runing linux!)
i did everything according to http://developer.android.com/guide/publishing/app-signing.html
signing on the computer works and even the verification says "jar verified" on every apk that is in my package..
just when i want to update on my dream it says :
verifying update package...
E: No signature (58 files)
E: Verification failed
....
how can i find these unsigned files...?
edit:
ohh and you have to compress the zip via : zip -yr newZip.zip dir
to keep the symlinks
lad
The auto sign programs wont work on linux because that makes it much easier to sign the .apk files and the update.zip. I used to do it manually and it takes way more time than using the sign.bat.
ok
signing problem solved ...
i tried to sign with my private key and not with the "public-update.zip-key"
so i managed to update with the symlink .... and it didn't boot
i checked everything again ... the symlink is now a text file (no wonder android didn't like that....)
... but why?
first i thought that th proses of unzip is destroying the symlink ... but on my com the symlink are always kept
then i noticed when signing a new zip is made and that broke the symlink ....
for signing the update.zip and framework.apk i'm using :
java -jar signapk.jar publickey.x509.pem privatekey.pk8 <themeDir>update.zip <themeDir>newUpdate.zip
(well sort of...)
i will now try to "hack" the signing into my own zip
or does anyone know how to sign it without destroying the symlink?
lad
-.-.....
what i did ...
i copied the symlink into the drawable folder of framework...
i made a zip of framework ... i signed that zip
then i unziped it to copy the symlink again (this time into the just unziped folder)
then i touched (with touch) the symlink and made the timestamp the same as the signed zip
then i ziped that folder .... (it is now signed and has the symlink)
now i only needed to zip and sign the whole update.zip ....
(i unpacked both to see if the symlink was still there... it was!)
i copyed it on he android ... and updated succesful
...but then it didn't boot ..... -.-
now what...?
any ideas?
lad
ps i will try to symlink the whole framework-res.apk .....
edit: pps use at own risk
script for Resigning(use it as a nautilus script):
Code:
#!/bin/bash
#
#use as nautilus script
##########################################
#change to the dir where u have the "signapk.jar", "testkey.x509.pem" and t"estkey.pk8"
##########################################
androidModDir=/home/lad/projekt/android/AndroidMod
java -jar $androidModDir/signapk.jar $androidModDir/testkey.x509.pem $androidModDir/testkey.pk8 "$*" "$*".signed
exit 0
script for Verifying"dirty" (use it as a nautilus script):
Code:
#!/bin/bash
#
#use as nautilus script
export i=`jarsigner -verify "$*"`
zenity --info --title "JarVerifier" --text "Well the outcome is:\n $i"
exit 0
I understand every bit of what you're trying to do. As of right now its obvious that a complete reboot to install the update.zip may be needed to install each skin, but I wonder if you can just do a reboot without an update to rewrite over the previous files then the new files would load a different skin. It shouldn't be so hard since the G1 is like any other cpu or OS platform right!? Keep trying you're getting close to it "Lad!" I'm sure there are more people out there in the world that are willing to give you a helping hand in the process of making this all work out. =)
Idea
What if you just created something that asks which theme you want to use. It then opens something like a file manager with a theme directory list
/themes
-->/theme1
-->/theme2
-->/etc
you choose the theme you want. It asks if you want to backup your current update.zip and then copies the update.zip from the theme folder selected to /sdcard and then reboots and applies the update.
Is that possible. Or even if it just reboots and then you press the power + home key when it restarts and then !!! you have applied the new theme. This would allow you to add/remove themes as you see fit.
OK, here you go
Here is a script for gscript to automate theme switching!
http://forum.xda-developers.com/showthread.php?t=486486
Code:
echo "boot-recovery
--update_package=SDCARD:themes/aero/update.zip" > /cache/recovery/command
reboot recovery
I have all my themes located in /sdcard/themes and a folder with the name. So all you have to do is write scripts for each theme and just place a shortcut on the desktop. With bettercut you could make the icon very representative of the theme.
beagz said:
Here is a script for gscript to automate theme switching!
http://forum.xda-developers.com/showthread.php?t=486486
Code:
echo "boot-recovery
--update_package=SDCARD:themes/aero/update.zip" > /cache/recovery/command
reboot recovery
I have all my themes located in /sdcard/themes and a folder with the name. So all you have to do is write scripts for each theme and just place a shortcut on the desktop. With bettercut you could make the icon very representative of the theme.
Click to expand...
Click to collapse
Here is the original post to this thread.
flip0406 said:
I was wondering if anyone thought about integrating a theme switcher with modified firmwares. I wonder if its possible without having to reboot to install a different skin.
Click to expand...
Click to collapse
I guess we'll have to keep searching and testing things until we can get it all together...........
well, I thought this would help until someone can find a way without doing a reboot.
Until then, this was the easiest method I could find.

[Guide] Android Cooking Guide for HD2 [Guide]

heartsurfer008 said:
Well I am desparetly trying to cook a NAND build for my HD2 but there is pretty much less info available for me [a big NOOB in cooking] to try out my luck at cooking..!!!
So I'll appreciate if someone would put some light on it..!!!
PS: - I would appreciate if somebody can provide a detailed info..!!!
Click to expand...
Click to collapse
Finally the tutorial
Make your own Android Build for the HD2 by domineus ​I have always lived by these words- if you give a man a fish, he can eat for a day; but if you teach a man to fish you can eat for a lifetime. Android on the HD2 has always been an interesting thing for me and I know a lot of people that want to create their own builds, but have no idea how. If you ask a build creator or maybe someone in the htc-linux-chat how to get started, there may not be an answer. In fact, some of the perplexing behavior has left me puzzled in several ways - as if how to get an android build is a vaulted secret of knowledge like the holy grail. To be honest, it's not. It's a bit of hard work, a few nods in the right direction, and ultimately it's a community involved project. Just like miui development is a community project spanning actual continents to get this thing on our device every single week! It has led to a lot of questions, in my inbox, of how to begin. For a long time, the answer to the question was not answered until Cass helped me out. I want to do the same and contribute how to get a build of miui (or any android build) to the HTC HD2.
Things you will need
In order to properly start android development, it would be a good idea to make sure you have the following (a lot of it is no duh when you think about it)
A computer running linux
I can't stress that enough. While there is a lot of things you can do in windows, you will need some sort of linux distro in order to get android properly running on your HD2. There are a lot of linux distros you can use; with many using ubuntu as it is the most user friendly. I use Fedora and I am quite happy with the results. It's simple and effective. It gets the job done. Get a distro that you feel can get the job done.
Android SDK - either windows or linux
Android SDK is something that can be freely accessed and downloaded from the following location:
http://developer.android.com/sdk/index.html
It is a developer environment, but probably the most important thing you can use here (for the time being) is logcat. Logcat provides you to visually see the libraries and files working together to get android to work as well as if you run into an issue, it is the first thing you should resort to. For instance, boot reloop? Take a look at your logcat and try again.
A kernel
There are quite a few kernels available for android previously and they are divided into evo kernel or nexus one kernel. Many builders have transitioned to an evo kernel for PPP and a few other nice details but it is totally up to you. I highly recommend hastarin's kernel. For most of the time, it works well. But as you have noted, on MIUI, it hasn't been working as fantastic on other builds.
Donor Files
This is a bit difficult to find because it appears that the files that work best are nexus one builds without CM6.1 modification. So far, only one chef has that and it is tytung's nexus one build. Regardless of whose files you're using (e.g. tytung or darkstone's system which is the preferred choice) you will need a well working android build. You will be pulling several files in order to port.
MIUI itself (well any build honestly just miui is a good example)
This is a given. However, if you download from miui.com you will probably have an untranslated rom with odex files. That's bad. And in Chinese! It would be a good idea to browse the English forum for a deodexed rom with appropriate english translation (apps and frameworks)
-If pulling files from windows, you will need this
system extractor
http://uranus.chrysocome.net/linux/explore2fs-old.htm
I use that if I download in windows. It's relatively straight forward and it allows you to pull the files you need from the system.ext2 you're using and copying them to folders necessary.
build.prop
This you will need. You can find one here:
http://www.multiupload.com/B59IU3S6XY
Patience
Probably the most important thing. One thing I have noticed is you need patience to make it through. Sometimes, your build works, sometimes it doesn't. And it is difficult to still keep going. But gotta pull it all in and keep trying...it does pay off.
Okay so you have your files, a nice linux distribution, your build you want to port (MIUI preferrably) and you're ready to go. Now it's time to begin the process!
Step One - The Setup
I usually grab my files in windows before transitioning to my linux distro to finish the process. If you using windows 7 and you are using explore2fs, you will definitely have to right click on the exe and make it compatible by selecting compatible with windows vista. The file should also need to be run by administrator. If you don't know how to do that you can google compatibility in windows 7.
First thing is first. Create a new folder, you can call it donor_files if you want because name is arbitrary. The most important thing is to just name it. Within that folder, create a new folder called system. Enter the system directory and create a new folder called etc. Within etc, select Once that is done, create a new folder within etc called firmware. Once completed, return back to the system folder, create the folder called lib. In the lib folder, create a new folder called hw. So your folder should look like this:
Folder Name
-system
--etc
---firmware
--lib
---hw
So far so good? Excellent. Now, if you're in windows you will need to do a few things. Extract the system.ext2 of your donor build and place it somewhere you will remember (like your desktop). Now open up explore2fs, select file, and open image file. Under files of type (drop down), select all files and navigate to your system.ext2 file. You should now see the ext loaded on the left side of the program's workspace. Located is a very small + that allows you to view all directories in your ext2 file. Click that.
You will see several system folders on the left and files on the root. Since you haven't selected a specific folder, in the right hand view, you should see the file build.prop. If you did select a folder (like app) you will see some files. And that's okay too. Get a feel of the program.
Now you will do a test file pull. On the left hand side, select the folder etc. On the right window, you will see several files. We want AudioBTID.csv. Once you see the file, right click on AudioBTID.csv and select export file. Navigate to the donor file folder (or whatever you named it) and place the file in system/etc of that folder. Congratulations you just pulled your first file! But you will need a lot more files. Within the same directory, pull gps.conf, hosts, media_profiles.xml and the ppp folder. Now, navigate to firmware and pull the following files:
BCM4329B1_002.002.023.0360.0362.hcd default_france.acdb htcleo.acdb
BCM4329B1_002.002.023.0436.0439.hcd default_nel.acdb yamato_pfp.fw
bcm4329.hcd fw_bcm4329_apsta.bin yamato_pm4.fw
default.acdb fw_bcm4329.bin
Ideally you should not be able to find htcleo.acdb. You can find it here
http://gitorious.org/xdandroid_leo/q...eo/htcleo.acdb
Now in explore2fs, go to the lib directory and pull these files and place them in your lib directory:
libcamera.so
libcamera_client.so
libcameraservice.so
libhtc_ril_wrapper.so
libmm-omxcore.so
liboemcamera.so
libomx_aacdec_sharedlibrary.so
libomx_amrdec_sharedlibrary.so
libomx_amrenc_sharedlibrary.so
libomx_avcdec_sharedlibrary.so
libomx_m4vdec_sharedlibrary.so
libomx_mp3dec_sharedlibrary.so
libomx_sharedlibrary.so
libomx_wmadec_sharedlibrary.so
libomx_wmvdec_sharedlibrary.so
libOmxCore.so
libOmxVdec.so
libOmxVidEnc.so
libqcomm_omx.so
libstagefright_omx.so
Once those files are pulled, navigate to the hw folder of the system and pull the following files:
sensors.htcleo.so
lights.htcleo.so
Once those files are pulled, you can save your donor files to a flash drive and then boot into your linux distro. Login to superuser in terminal. For fedora, the proper method involves typing in su --login and entering your password you set up. Minimize your terminal window.
Extract the miui (or any other build) to your desktop (the focus is the system folder). Ensure the rom is deodexed and in your own language (if its miui, you will have to apply the proper language translations). Now copy the files you pulled from your donor build and apply it to the appropriate folders (usually a copy and a paste-literally). In this instance there will be duplicate files, overwrite them. That's the point! Do not forget the build.prop file I linked to earlier. You should add that to system folder.
So the files are copied, the next step is to restore the minimized terminal window (the one that is logged in as root). cd to where your system is located (not to the system folder itself). Now you will have to enter the following commands in terminal
chmod -R 777 system/etc
chmod 755 system/bin/*
chmod 755 system/xbin/*
rm system/etc/firmware/default*acdb (if you have sound in call issues)
touch system/etc/ppp/active (If you have latest wrapper and need ppp)
chown root:2000 system/bin/pppd
chmod 4755 system/bin/pppd
chown root:root system/xbin/su
chmod 4755 system/xbin/su
chown root:root system/xbin/hci*
chmod 4755 system/xbin/hci*
dd if=/dev/zero of=system.ext2 bs=1048576 count=256
mke2fs -F system.ext2
sudo mount -o loop system.ext2 /mnt2
cp -rp system/* /mnt2
sudo umount /mnt2
A few words on this that I must bold. the /mnt2 directory may not exist. If not, try mnt, that usually works
Once this is done, you will have a nice system.ext2. The only thing you'd need now is a rootfs, a kernel, clrcad.exe and a startup.txt file. Once that is done, you can test your build out.
Any questions
Special thanks to Cass and the htc-linux-chat for the few pointers they gave me.
The guide is by "domineus - http://www.miui-dev.com/" & I take no credit what so ever​
Thanks to "white-energy" for giving us the link..!!!
Hope to have many more Chief's for our HD2, so that we [especially me] can satisfy our hunger to try different builds/ROM's..!!!
Happy Cooking..!!!​
PLEASE PRESS THANKS IF YOU FOUND THIS THREAD USEFUL..!!!​​
+ 1... nobody wants to share information?
I don't know if this help but you can try
http://forum.xda-developers.com/showthread.php?t=897940
These kind of thread pop up once in awhile, but it's going no where, I've never seen well known chef show up in this kind of thread.
knowledge is power, maybe they dont want to share the power
Can anybody out there give us a step by step guide for cooking a NAND ROM for HD2..???
http://www.miui-dev.com/forums/showthread.php?481-Howto-Make-your-own-Android-Build-for-the-HD2
Instead of making a ext image, you should make a yaffs image.. so it can work on Nand
white-energy said:
http://www.miui-dev.com/forums/showthread.php?481-Howto-Make-your-own-Android-Build-for-the-HD2
Instead of making a ext image, you should make a yaffs image.. so it can work on Nand
Click to expand...
Click to collapse
Thank you, please check post 1..!!!
I've been looking for something like this. I want to create my own build for the recovery flasher. I guess the only thing needed would be how to convert from regular nand to recovery.
Thanks bro.
velayo said:
I've been looking for something like this. I want to create my own build for the recovery flasher. I guess the only thing needed would be how to convert from regular nand to recovery.
Thanks bro.
Click to expand...
Click to collapse
I was lookin for the same & credit goes to domineus & white-energy
& "white-energy" comes up with a NAND ROM..!!!
Congrats..!!!
white-energy said:
http://www.miui-dev.com/forums/showthread.php?481-Howto-Make-your-own-Android-Build-for-the-HD2
Instead of making a ext image, you should make a yaffs image.. so it can work on Nand
Click to expand...
Click to collapse
Are you sure its the only difference? Are the nand drivers stored only in the bootimg/initrd and not somewhere in the system.img?
yes or no will do for me thx
Is there a way to edit system.bin files, that comes with the NAND builds. I suppose that is where the ROM is. I want to unpack, edit the included apps and repack. How it is done? How the bin file is done. Google does not give any satisfiable links, did a quick search, though...
i am confused
Which explore 2fs do I download? There are 3 different ones one for binary one for code and optional update source code. I am a noob and tired of not having roms I am happy with. I have windows 7 and xp. I realize this will take time and I am good with it everything thats worth anything takes time.
deckoff said:
Is there a way to edit system.bin files, that comes with the NAND builds. I suppose that is where the ROM is. I want to unpack, edit the included apps and repack. How it is done? How the bin file is done. Google does not give any satisfiable links, did a quick search, though...
Click to expand...
Click to collapse
I think you mean system.img not system.bin
You can extract them with the unyaffs.exe or with the unyaffs command under linux. I have written a guide with attatched utilities here
Additionally birksoffsjunk (seasoned WM guru & chef of ChuckyDroid, ChuckyROM, & Dexter) has made a batch program to make this process easier. It's a work in progress & somethings are still buggy so follow the thread
Between the utility birkoffsjunk made & the tutorial I wrote you should be able to successfully edit & run your own build. Hope this helps.
deckoff said:
Is there a way to edit system.bin files, that comes with the NAND builds. I suppose that is where the ROM is. I want to unpack, edit the included apps and repack. How it is done? How the bin file is done. Google does not give any satisfiable links, did a quick search, though...
Click to expand...
Click to collapse
I think you mean system.img not system.bin
You can extract them with the unyaffs.exe or with the unyaffs command under linux. I have written a guide with attatched utilities here
Additionally birksoffsjunk (seasoned WM guru & chef of ChuckyDroid, ChuckyROM, & Dexter) has made a batch program to make this process easier. It's a work in progress & somethings are still buggy so follow the thread
Between the utility birkoffsjunk made & the tutorial I wrote you should be able to successfully edit & run your own build. Hope this helps.
anyone know how to edit or anything about initrd.gz?
hnamanh said:
anyone know how to edit or anything about initrd.gz?
Click to expand...
Click to collapse
It's an archive that can be decompressed and edited thru linux.
White-Energy use system.bin in his rom
Regarding initr and zimage, there is a guide that you can point me on ?
Thank you
KillaHurtz said:
I think you mean system.img not system.bin
You can extract them with the unyaffs.exe or with the unyaffs command under linux. I have written a guide with attatched utilities here
Additionally birksoffsjunk (seasoned WM guru & chef of ChuckyDroid, ChuckyROM, & Dexter) has made a batch program to make this process easier. It's a work in progress & somethings are still buggy so follow the thread
Between the utility birkoffsjunk made & the tutorial I wrote you should be able to successfully edit & run your own build. Hope this helps.
Click to expand...
Click to collapse
I have only green HTC
Hello
I would like to use Android on my HD2. I was searching and testing many ROMS but I didn´t find any rom which is usable for me. I would like to have a ROM that is without Sense, has Multilanguage support and is on Android 2.2 version.
So I decided that I would make my own.
0) I was reading
HTML:
http://forum.xda-developers.com/showpost.php?p=10291851&postcount=1
and made this procedure.
1)downloaded some ROM from here
2)unpacked this rom in linux with :
Code:
unyaffs system.img
then I got this directories:
Code:
app bin build.prop etc fonts framework lib media usr xbin
3)I downloaded update-cm-6.1.1-N1-signed.zip from CyanogenMod Forum > Downloads > Stable Mod > Nexus One and unpacked. I got : META-INF system boot.img.
4)I copied everything what was described step 0 from directories from step 2 to directory system from step 3
5)I downloaded and copied build.prop from step 0 to system
6) I updated permition like it is described in step 0
7) I created system.img with command : mkyaffs2image . ../system.img
Then I copied this system.img from linux to my windows and put this file in directory in which was different NAND rom. (replaced system.img). After that I flashed my phone and it did not work. Screen was frozen after booting and only green HTC was on display.
Can somebody please help me and give me some advice or some small howto. Does anybody know what can be wrong?
Thank you
Michal Fichtner
I appreciate the guide but damn that is hard to read. It really needs some sort of structure to it, titling proper paragraphs etc.
Hi,
it is possible to combi the dropdown energy widget froom miui and the gingerbread lockscreen into Desire HD Build?
Thats was awesome !
Sorry for my bad english

[TUT] Custom frameworks for Gen 8

So, it seems that more people are taking an interest in making custom frameworks. This isn't really a full tutorial, but I thought it would be helpful to just post some tips on how to go about making your own framework-res.apk, save others a bit of time retreading old ground, since the methods are scattered around the site a bit!
Thanks to wdl1908 for prompting me to do this - should really have done this sooner!
Okay, so basic requirements:
Rooted Gen 8 (Uruk or chulri method)
Original Archos framework-res.apk
zip editor
image editing software
.png's to replace the stock ones with
That's about it! I've been using GIMP on Ubuntu for the image editing, and Phatch for batch resizing, but Photoshop will work just as well on Windows.
Edit: Thanks to wdl1908, have found that Gwenview gives much better results when resizing, compared to Phatch or GIMP. Works on both Ubuntu and KDE.
Use your preferred zip editor to unzip the contents of framework-res.apk to your chosen folder. The main folder of interest is "drawable-mdpi".
The Gen 8's use MDPI resolution images (well, A70 and A101 to at any rate. I think someone mentioned the A32 or A43 used HDPI images). Depending on your .png source, you may need to resize the images. I took my images from themes made for the Desire, which is an HDPI device, so I used GIMP/Phatch to resize them.
In terms of resizing, I compared the size of each new png with the original one, and resized. I know p0rkburn just resizes the images to 66%, but I've had problems with some images not coming out the right size that way. The other thing to watch out for is that not all the images need resizing. Also, some of the textfield and tab_select images are different proportions to their phone equivalents, so again watch out for that.
Once you've replaced the images you want to, they need to be put back into the .apk. I used to copy and paste into the framework-res.apk, but that doesn't work for 9patch files. Also, wdl1908's FrameWorkBuilder makes the compile process so ridiculously easy, there is no reason not to use that instead.
To put the new framework-res.apk on the device, I use this method via ADB wireless, which works fine.
Happy theming!
EDIT: 9patch files
These can be a PITA, until you understand how they work. I used the following two sources to finally crack it :
http://developer.android.com/guide/developing/tools/draw9patch.html
http://forum.xda-developers.com/showthread.php?t=580351
If you are changing 9patch files, you have to decompile and recompile using the FrameWorkBuilder.
I prefer using the draw9patch tool, as it lets you check that the 9patch works as expected.
Spent enough time bashing my head against a brick wall trying to sort out 9patch files, so if I can spare anyone else that, feel free to post/PM..
I'll leave this post here for my recommendations that will be more complex when you need to modify xml files.
In short the procedure is a follows (this needs to be expanded)
unpack the apk to framework-res-UNPACKED dir
decompile the apk to framework-res-DECOMPILED (with apktools)
copy framework-res-MOD to framework-res-DECOMPILED
compile framework-res-COMPILED (with apktools)
unpack the compiled apk to framework-res-COMPILED (with 7za)
remove all the files that are present in framework-res-MOD from the framework-res-UNPACKED dir
remove the file resources.arsc from framework-res-UNPACKED
copy all files from framework-res-UNPACKED to framework-res-COMPILED
zip all files in framework-res-COMPILED to the new framework-res.apk
remove the resources.arsc from that apk file
readd the resources.arsc file without compression to the new apk file
Done
The reason this is so complex is that their are bugs in apktools and the signature needs to be preserved.
FrameWorkBuilder v0.3
README.txt
-------------------------------------------------------------------------------------------------------
Place the script FrameWorkBuilder.sh in a directory and execute.
The script will download all the needed tools.
Place framework-res.apk in the dir framework-res-STOCK
Place mods in framework-res-MOD follow the usual directory structure.
Example:
framework-res-MOD
framework-res-MOD/res
framework-res-MOD/res/drawable-hdpi
framework-res-MOD/res/drawable-mdpi
framework-res-MOD/res/drawable
Execute FrameWorkBuilder.sh to apply the mod.
Modded framework-res.apk will be stored in the directory framework-res-MODDED.
-------------------------------------------------------------------------------------------------------
Changelog
-------------------------------------------------------------------------------------------------------
v0.3 Added xml png duplication check to avoid that animations don't work. .9.png support
v0.2 Added mod checks Added compile failure test
v0.1a BUGFIX cp dirs
v0.1 Initial version
-------------------------------------------------------------------------------------------------------
Have fun modding.
wdl1908 said:
I'll leave this post here for my recommendations that will be more complex when you need to modify xml files.
If you don't mind we'll make it a joined tutorial. I have no time now it's time I got some sleep.
Click to expand...
Click to collapse
I have no idea about editing XML files, but that was the next thing on my "To learn" list. I would be very happy for you to add your knowledge to this thread.
Also, if anyone has info to add/corrections to make, please feel free.
Good stuff, guys. At the very least we can make this a three man party.
The more the merrier!
Guys, can I ask what device you're both using?
fisha21 said:
Guys, can I ask what device you're both using?
Click to expand...
Click to collapse
A101IT with archangel root
A70IT with chulri's root
fisha21 said:
The more the merrier!
Click to expand...
Click to collapse
well, if i can do something, i'm here ;-)
wdl1908 said:
A101IT with archangel root
A70IT with chulri's root
Click to expand...
Click to collapse
Cool, thanks. Also, can I ask how you're viewing the XML files? Every program I've tried won't open them - keep getting error messages about invalid character content.
woti23 said:
well, if i can do something, i'm here ;-)
Click to expand...
Click to collapse
Welcome...
fisha21 said:
Cool, thanks. Also, can I ask how you're viewing the XML files? Every program I've tried won't open them - keep getting error messages about invalid character content.
Click to expand...
Click to collapse
You have to decompile the framework-res.apk with the apktools then all is revealed.
I have an A43it, and I find it to use a mixture of the hdpi and mdpi drawables, it is quite odd how they have it. I am drawing this conclusion because I only changed the hdpi drawables, and some things (status bar pull down for one) stayed original. I am going to work some more on it later today and will update here. My method for pushing to the device uses adb like such:
Code:
adb push framework-res.apk /sdcard/framework-res.apk
adb shell
su
stop
cp /sdcard/framework-res.apk /system/framework/framework-res.apk
chmod 644 /system/framework/framework-res.apk (only needs to be done the first time, as the permissions will adopt those when replacing in the future)
start
This causes the device to do a little soft-reboot (does not perform a proper full shutdown/reboot) that is pretty quick, and avoids any f/c situations you may encounter replacing the file while the system is live.
Edit 2 - ok, I just plain old missed the drawables earlier, they are all in hdpi for the A43. Posting screenshots of what I have put together shortly.
daveid said:
My method for pushing to the device uses adb like such:
Code:
adb push framework-res.apk /sdcard/framework-res.apk
adb shell
su
stop
cp /sdcard/framework-res.apk /system/framework/framework-res.apk
chmod 644 /system/framework/framework-res.apk (only needs to be done the first time, as the permissions will adopt those when replacing in the future)
start
This causes the device to do a little soft-reboot (does not perform a proper full shutdown/reboot) that is pretty quick, and avoids any f/c situations you may encounter replacing the file while the system is live.
Click to expand...
Click to collapse
Great I was looking for that.
wdl1908 said:
[*]compile framework-res-COMPILED (with apktools)
Click to expand...
Click to collapse
Getting stuck on the above step. Have got a folder called framework-res-DECOMPILED. When I try to compile it, the first message I get is:
Code:
w:Could not find sources.
It then runs through the process throwing up multiple error messages, and at the end I am left with an empty Build folder. Any ideas? I read on the Apktool thread that you need to add a classes.dex file to apk that don't already have one?
Thought I'd try your method as my primitive version keeps resulting in faulty apk's the last day or two!
fisha21 said:
Getting stuck on the above step. Have got a folder called framework-res-DECOMPILED. When I try to compile it, the first message I get is:
Code:
w:Could not find sources.
Click to expand...
Click to collapse
No problem there thats only a warning.
fisha21 said:
It then runs through the process throwing up multiple error messages, and at the end I am left with an empty Build folder.
Click to expand...
Click to collapse
What error messages?
fisha21 said:
Any ideas? I read on the Apktool thread that you need to add a classes.dex file to apk that don't already have one?
Click to expand...
Click to collapse
What version of apktools do you have?
never needed any classes.dex in framework-res.apk
fisha21 said:
Thought I'd try your method as my primitive version keeps resulting in faulty apk's the last day or two!
Click to expand...
Click to collapse
I'll try to cleanup my script and post it soon.
I just found out we can have custom boot animations on our gen 8 devices.
search for some bootanimation.zip on the web or go to UOT Kitchen and download one from the kitchen. place it in the directory /data/customization/ and reboot. This works even for the stock firmwares with archangel root.
Enjoy
I've added the first version of my FramWorkBuilder script in the second post.
wdl1908 said:
I've added the first version of my FramWorkBuilder script in the second post.
Click to expand...
Click to collapse
Thanks for the hard work!
Gave it a run through but get the following error messages:
Code:
Applying MOD...cp: cannot stat `/home/sarju/FWB/framework-res-MOD/*': No such file or directory
and
Code:
Copy files from UNPACKED to COMPILED that are not modified...cp: cannot stat `/home/sarju/FWB/WorkSpace/framework-res-UNPACKED/*': No such file or directory
The script is located in the "FWB" folder.
fisha21 said:
Code:
Copy files from UNPACKED to COMPILED that are not modified...cp: cannot stat `/home/sarju/FWB/WorkSpace/framework-res-UNPACKED/*': No such file or directory
The script is located in the "FWB" folder.
Click to expand...
Click to collapse
yeah download the 0.1a version and try again.
wdl1908 said:
yeah download the 0.1a version and try again.
Click to expand...
Click to collapse
Ok, think I'm just being stoopid here. Ran the v0.1a, no error messages BUT
If I use the folder structure "framework-res-MOD>drawable-mdpi", the resulting apk just has the original contents of drawable-mdpi. If I use "framework-res-MOD>res>drawable-mdpi", the resulting pak has an empty drawable-mdpi folder.
fisha21 said:
Ok, think I'm just being stoopid here. Ran the v0.1a, no error messages BUT
If I use the folder structure "framework-res-MOD>drawable-mdpi", the resulting apk just has the original contents of drawable-mdpi. If I use "framework-res-MOD>res>drawable-mdpi", the resulting pak has an empty drawable-mdpi folder.
Click to expand...
Click to collapse
the structure should look like this.
Code:
framework-res-MOD
framework-res-MOD/res
framework-res-MOD/res/drawable-hdpi
framework-res-MOD/res/drawable-ldpi
framework-res-MOD/res/drawable-mdpi
framework-res-MOD/res/drawable
but make sure you remove empty dirs.
I suspect it has to do with empty dirs I'll check that....
Nope tthats not it.
can you zip up the files files-to-remove.txt and log.txt in the WorkSpace dir and post them or via pm if thats possible.

[Q] How to modify and replace framework-res.apk

Hello
I changed some png images with 7zip and copied back to system/framework/ but i got boot loop.
I would like to know how to modify and replace .apk that will work normal?
Thanks
How exactly did you replace the png's? Because the 'normal' proces of unzip-replace-rezip doesn't work.
The most easy way to changes png's:
1. Open framework-res.apk in 7-zip
2. Search for the files you want to change and copy them to your hard disk (do not unzip!!)
3. change the files. Make sure the name stays EXACT the same.
4. Open framework-res.apk and copy your new files in the desired place. By doing so, the original files will be replaced by your files. DO NOT USE ANY COMPRESSION (if asked select 'store').
5. Go into recovery, mount /system and replace the framework-res.apk by the new one. Reboot phone.
Take home message: never unzip
Hope it works now!
Erwin
i went to recovery and hit mount/system. But how can i replace it?
Thanks
urkotheone said:
i went to recovery and hit mount/system. But how can i replace it?
Thanks
Click to expand...
Click to collapse
You have to use adb to do is. I assume you know how to work with it. If not, you have to search for a little tutorial (can't link you right now because I'm using the xda app)
Put the new framework-res.apk in the same folder as adb.exe. Open the command prompt and brows to that same folder. Type in your command prompt:
Code:
adb shell mv system/framework/framework-res.apk system/framework/framework-res.old
adb push framework-res.apk system/framework
adb reboot
Due to the first command, you have a backup of your original framework-res.apk. To restore it, you have to boot in recovery, mount /system and again by the use of the command prompt, type:
Code:
adb shell rm system/framework/framework-res.apk
adb shell mv system/framework/framework-res.old system/framework/framework-res.apk
adb reboot
Erwin
Yeeeeey i did it
Thank you
One more problem
When discharging it's working, but when I charge phone i don't get no battery icon. I believe it's because in original framework i had 100 png animations for charging and now i have only 20. Is there a way to fix this?
urkotheone said:
One more problem
When discharging it's working, but when I charge phone i don't get no battery icon. I believe it's because in original framework i had 100 png animations for charging and now i have only 20. Is there a way to fix this?
Click to expand...
Click to collapse
Then it is going to be much more complicated than that. Perhaps I can explain you in more detail tomorrow, but you will have to look up some things for yourself.
First, you should decompile the framework-res.apk first using apktool. You will notice that it almost looks like it just dezips your apk, but when you look closely, you will see now that you can open and read the xml files.
Second, you have to open res\drawable\stat_sys_battery.xml (or something similar, perhaps it depends on your ROM). Try to understand what is written and make some changes (it is really not that hard) so that your system shows only 20 different images, in stead of 100.
Third, you have to recompile your modified framework-res.apk. Then pull stat_sys_battery.xml out of "your" framework-res.apk into the original framework-res.apk, but again, without unzipping one of them. Do, of course, the same thing with your images.
I must admit, I've been busy with the battery icons myself. It was my plan to do something similar like you did, but I didn't do it yet. So all the things I've written above where the things I was planing to do, but I don't know if it will work, as I never tried it myself. So please, keep me/us informed ;-)
Good luck!
EDIT: I used this site to know how to decompile apk's.
This is an old thread but I wanted to edit my systemUI.apk file with changing out a couple images... if I was to upload the file I edited (by just swapping out the images) to the UOT kitchen and use a mod, say the battery mod, would it make the file usable on my phone or would I get a bootloop or worse?
Basically what I did was opened up the SystemUI.apk file using 7zip and just swapped out the images I wanted (making sure I saved the original ones of course). I didn't unzip/zip anything.. I just opened it using 7zip and then closed it. It didn't ask me if I wanted to save anything though??
Sorry for the stupid question... but I thought it would be an idea as I want to use the UOT to make a mod to the theme I have anyways.
crazy_dragonlady said:
This is an old thread but I wanted to edit my systemUI.apk file with changing out a couple images... if I was to upload the file I edited (by just swapping out the images) to the UOT kitchen and use a mod, say the battery mod, would it make the file usable on my phone or would I get a bootloop or worse?
Basically what I did was opened up the SystemUI.apk file using 7zip and just swapped out the images I wanted (making sure I saved the original ones of course). I didn't unzip/zip anything.. I just opened it using 7zip and then closed it. It didn't ask me if I wanted to save anything though??
Sorry for the stupid question... but I thought it would be an idea as I want to use the UOT to make a mod to the theme I have anyways.
Click to expand...
Click to collapse
I don't know if I understand you fully, but I believe it would: only if the UOT changed the images that you have changed, you will not see the things you have changed.
What I did some time ago was upload my framework en systemui to the UOT, apply the battery mod and than change the battery images with my own. I did that just by opening the apk in WinRAR and adding my images, just like you did.
But if you only want to swapp some images, there is no need for uploading it to the UTO. Just continue as you did. Just make sure that you keep the original systemui.apk on your hdd. In case of a bootloop, you can easely revert.
Is that een answer to your question?
Erwin
Yes, it does.. and thanks. I ended up following the instructions on another thread I found on here... don't remember exactly which one but it basically omitted uploading the files to the UOT. It was a guide on how to theme your phone... sorry but I didn't save the link.
thanks again!
CDL.
urkotheone said:
Hello
I changed some png images with 7zip and copied back to system/framework/ but i got boot loop.
I would like to know how to modify and replace .apk that will work normal?
Thanks
Click to expand...
Click to collapse
Same thing happened to me!
I Wiped Cache, Dalvik Cache, but nothing happened!
I had to flash 2.3.6 Stock ROM via Odin, to make my phone work!
I always work with Winrar, and in there you have the option for compression, which is selected at "medium compression" by default, and that causes bootloops.
So make sure that you don't compress your apk when adding your new png, or it will not work.
Erwin
I change my framework-res.apk from another rom. the problem is when I push long power button, my device going to BOOTANIMATION with out I choose shutdown, restart n etc.. what's wrong with my device??
sorry for my bad eng..
The problem is its another roms framework so things are in different places and some things will be missing, put the framework-res.apk from your rom back and things should go back to normal, mind me asking what tweak or mod you are after using?
Sent from my HTC Wildfire using xda premium
first time I must say sorry, I know this not my device place on XDA, I use MB525.. but I see the same problem here..
I use Ms3ginger mod rom by walter, n I take framework-res.apk from 2.3.6_4.5.2-109 DHT25_themed MultiLanguage, I try to change battery sys-stat but I get bootloop..
once again sorry for my bad eng
If not possible try
Adb remount
First

Categories

Resources