[Tool] Fast Deodexer and Update.zip builder Scripts [OSX / Linux] - Xoom Android Development

I wrote some little tools to deodex a Xoom directly. I used the tips from here so thanks to dhemke17.
There are all needed tools packaged in the zip file (smali, baksmali, signapk and the certs). First you have to unzip to a folder of your choice, then you have to edit deodex.sh and set the path to your android sdk. After that you can run the tool. It will then adb pull the framework and app files from your device and deodex them. After that you can use buildupdatezip.sh to build a signed-update.zip with your new files.
As always, USE AT YOUR OWN RISK!

lowtraxx said:
I wrote some little tools to deodex a Xoom directly. I used the tips from here so thanks to dhemke17.
There are all needed tools packaged in the zip file (smali, baksmali, signapk and the certs). First you have to unzip to a folder of your choice, then you have to edit deodex.sh and set the path to your android sdk. After that you can run the tool. It will then adb pull the framework and app files from your device and deodex them. After that you can use buildupdatezip.sh to build a signed-update.zip with your new files.
As always, USE AT YOUR OWN RISK!
Click to expand...
Click to collapse
This is exactly what I was hoping for!

Nice script man...just used it for the first time...already had the files pulled, so I had to make a couple tweaks to it. I gave me some trouble at the start, but then I got it to go without a problem! Thanks a lot man.

Related

[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.

[GUIDE] A Beginner's Guide To Theming

The basic part of a theme is the UI (User Interface) icons.
These icons are situated in three system files:
1. framework-res.apk
2. twframework-res.apk
3. SystemUI.apk
NOTE: Your phone should have the de-odexed versions of these files.
You may get them here http://android.modaco.com/topic/342915-samsung-galaxy-s-deodexedzipaligned-xxjvq-files/#entry1754033 .
MISSION 1 (GET THE FILES)
In order to get these files your phone needs to be rooted and you should have a system file explorer like Yaffs Explorer. The easiest way to root your phone is by flashing a kernel that provides root.
The framework-res.apk is situated in the folder /system/framework/
The twframework-res.apk is situated in the folder /system/framework/
The SystemUI.apk is situated in the folder /system/app/
Copy those files and put it in your sd card and then transfer those files to your PC.
These files will be used as the template for the new theme.
[OPTIONAL] Make a copy of these three files as back-up.
MISSION 1 COMPLETE
MISSION 2 (THE MYSTERIOUS CHANGE)
In order to change the icons there are three ways
a.The Easy way (not the correct way: might cause FCs )
b.The Hard way (recommended for risk takers )
c.Use the online theme kitchen (recommended for beginners )
[ http://uot.dakra.lt/ ]
NOTE:You may have to use both b. and c.
a. The Easy way
You need a program like 7-zip installed in your PC.
Method
-Open the apk using 7-zip.
-Go to the folder named res
-Extract the folder named drawable-hdpi
-Edit the images you want to edit [ DO NOT EDIT .9png IMAGES ]
-Replace the original icons with modified icons(drag & drop into
drawable-hdpi folder)
Tips
-Keep the original image dimensions
-Don't edit .9 pngs
b. The Hard way
This consists of decompiling the apk, modifying the required images, compiling the modified
images and replacing the original icons with the compiled icons.
You will need:
1.Apk Manager
(go here for instructions http://forum.xda-developers.com/showthread.php?t=695701 )
2.xUltimate compiler
(go here for instructions http://www.droidforums.net/forum/xeudoxus/47283-release-xultimate.html )
3.7-zip
Method
-Go to the main folder of Apk Manager
-Put the apk in the folder named place-apk-here-for-modding
- In order to decompile all APKs when working with the i9000, you have to install the framework files with apktool.
- Download apktool and put it on an easy accessable place (like C:\)
- Also put the STOCK framework-res.apk and twframework-res.apk files in the same directory.
- Open a new CMD (Press Windows Key + R), write CMD and press ENTER.
- type "cd .." (without the quotes)
- repeat the "cd .." so you're on C:\ now.
- write: java -jar apktool.jar if framework-res.apk
- repeat, just with twframework-res.apk: java -jar apktool.jar if twframework-res.apk
- This will ensure, it will load the correct resource table and you won't have any errors because of the dependees
-Run Script.bat file
-Select option 9 to decompile the apk
-Go to the folder named "projects" (the decompiled apk folder should be there)
-Inside the decompiled apk folder go to the folder /res/drawable-hdpi
-Modify the icons you want to change(KEEP THE BORDERS OF .9png IMAGES
UNTOUCHED)
-Open the main folder for xUltimate
-Go to the folder \example1\res\drawable-hdpi
-Delete the icons present there
-Put the modified icons
-Go to the main folder for xUltimate and run the xUltimate.exe file
-The compiled icons can be found in the folder
\done\example1\res\drawable-hdpi
-Replace the original icons with the compiled icons USING 7-zip
MISSION 2 COMPLETE
MISSION 3 (SEE THE CHANGE)
To see how your new theme looks like, you should put the modified files back to where they
belong.
There are two ways of doing this:
1. By using the system file explorer
Before doing so make sure that the system is write-enabled. You can do this
by using Damian Tweak app. If you are using Yaffs Explorer make sure you
have enabled root access
in the app's settings.
2. By making a CWM package (safer)
Use the Zip file provided. Replace the original files with moded files and install
using
CWM.
MISSION 3 COMPLETE
HAPPY THEMING
reserved
reserved
I have to thank you so much!
The first Tutorial I found that was understandable for beginners too.
Big Big Big Thanks!
nightm4r399 said:
I have to thank you so much!
The first Tutorial I found that was understandable for beginners too.
Big Big Big Thanks!
Click to expand...
Click to collapse
I'm glad it helped .
Exactly what I needed. Thank you for good guide.
hackeron said:
Exactly what I needed. Thank you for good guide.
Click to expand...
Click to collapse
Great .
Btw do you know how to make this a Sticky Thread?
SCIENTYREAL said:
Great .
Btw do you know how to make this a Sticky Thread?
Click to expand...
Click to collapse
You have to ask a moderator to do this
I have some additions to the guide
The red code is added by me.
Method b) the hard way
-Go to the main folder of Apk Manager
-Put the apk in the folder named place-apk-here-for-modding
- In order to decompile all APKs when working with the i9000, you have to install the framework files with apktool.
- Download apktool and put it on an easy accessable place (like C:\)
- Also put the STOCK framework-res.apk and twframework-res.apk files in the same directory.
- Open a new CMD (Press Windows Key + R), write CMD and press ENTER.
- type "cd .." (without the quotes)
- repeat the "cd .." so you're on C:\ now.
- write: java -jar apktool.jar if framework-res.apk
- repeat, just with twframework-res.apk: java -jar apktool.jar if twframework-res.apk
- This will ensure, it will load the correct resource table and you won't have any errors because of the dependees
-Run Script.bat file
-Select option 9 to decompile the apk
-Go to the folder named "projects" (the decompiled apk folder should be there)
-Inside the decompiled apk folder go to the folder /res/drawable-hdpi
-Modify the icons you want to change(KEEP THE BORDERS OF .9png IMAGES
UNTOUCHED)
-Open the main folder for xUltimate
-Go to the folder \example1\res\drawable-hdpi
-Delete the icons present there
-Put the modified icons
-Go to the main folder for xUltimate and run the xUltimate.exe file
-The compiled icons can be found in the folder
\done\example1\res\drawable-hdpi
-Replace the original icons with the compiled icons USING 7-zip
Click to expand...
Click to collapse
Darkyy said:
You have to ask a moderator to do this
I have some additions to the guide
The red code is added by me.
Method b) the hard way
Click to expand...
Click to collapse
Thanks for replying Darkyy .
So, i Get a ADB not found thing? WHat should i do?
roxyroot said:
So, i Get a ADB not found thing? WHat should i do?
Click to expand...
Click to collapse
You should have Android SDK installed for Apk Manager to work.
The link on how to use Apk Manager is given in the first post, under apk manager. I'll post it again here
http://forum.xda-developers.com/showthread.php?t=695701
Here is the link for Android SDK
http://developer.android.com/sdk/index.html
Btw you should also have Java Development Kit (JDK) installed.
I cant seem to find the twframework-res.apk, it's not in the system/framework folder. I have a sony ericsson play.
Do you know where the android settings menu icons are? the ones you see when you go into android settings. Like wireless & Networks, call settings, sound and so on.
thanks great guide.
SCIENTYREAL said:
You should have Android SDK installed for Apk Manager to work.
The link on how to use Apk Manager is given in the first post, under apk manager. I'll post it again here
http://forum.xda-developers.com/showthread.php?t=695701
Here is the link for Android SDK
http://developer.android.com/sdk/index.html
Btw you should also have Java Development Kit (JDK) installed.
Click to expand...
Click to collapse
I have android SDK (obviously), JRE and i used it the same way given, stilll..The error..I have a SGS SCL i9003...
hackit said:
I cant seem to find the twframework-res.apk, it's not in the system/framework folder. I have a sony ericsson play.
Do you know where the android settings menu icons are? the ones you see when you go into android settings. Like wireless & Networks, call settings, sound and so on.
thanks great guide.
Click to expand...
Click to collapse
Twframework-res is only found in Samsung devices. No need to worry about it. The settings icons are found in settings.apk. Settings.apk is inside the folder system/app.
Sorry for replying late.
bangalorerohan said:
I have android SDK (obviously), JRE and i used it the same way given, stilll..The error..I have a SGS SCL i9003...
Click to expand...
Click to collapse
To be honest I don't know the exact cause of the error. Have you updated Android SDK. You should click on the main SDK icon and it should show all the available updates. Select
the updates and download the files. Sorry if you have already done it.
Sorry for the late reply.
:laugh:
I forgot how to do it and now I am reading my own guide.
Thanks for this great guide! Will come in handy soon

[Q] How Can I Make CWM Flashable Zip ?

Hello ,
How can I make CWM flashable zip ?
I'm making mod but I can't make flashable zip
Example : I made icon pack for Contacts , mms, video player. Carry the system folder manually. And set permissions. This is very exhausting. I want to make flashable zip.Please make detailed guide. If you help me I would be happy. Thank you.
Arnadel said:
Hello ,
How can I make CWM flashable zip ?
I'm making mod but I can't make flashable zip
Example : I made icon pack for Contacts , mms, video player. Carry the system folder manually. And set permissions. This is very exhausting. I want to make flashable zip.Please make detailed guide. If you help me I would be happy. Thank you.
Click to expand...
Click to collapse
Scripts for creating flashable zips and signing apk/zip files
Just wanted to share a few scripts that I have created for making things a little bit easier. These are bash scripts so they are only going to be functional in a bash shell such as Linux or OS X. If you're running on Windows then you might be able to execute these in Cygwin but I don't know that for certain. You could simply run the same commands in a DOS prompt. You might have to change syntax a little and manually execute them, but the basic process is the same.
I'm going to assume that you are familiar with adb. If not, go learn about it -- download the Android SDK, install the platform-tools, and make sure you can use it! You will probably want it to be in your PATH variable so that you can execute it at any time from a command line.
The next thing you will need is apktool installed, so that you can extract and build .apk files. This can be found here:
http://code.google.com/p/android-apktool/
Now we can move on to using these scripts. There are three files included inside of the scripts.zip file attached to this post. The zip file contains the following:
1. signit: This script will sign a .zip file or a .apk file. If you send in a .apk file as an argument then it will also zipalign the file. It uses testkeys to sign files. 2. createzip: This script will create a skeleton zip file for you. It will print out some instructions to help guide you with the creation. 3. update-binary: This file will never change. It's an interpreter for Edify scripts -- which is what YOU will be writing! You need to include an Edify script inside of the zip file so that recovery knows what exactly you want it to do. This file should be carried around inside of each zip as it converts your Edify script into something that recovery can actually understand and execute.
You will need to make sure that signit and createzip are executable. I would just use chmod +x on them.
The fourth and final thing you need is testsign.jar. You can get it here:
http://code.google.com/p/zen-droid/d...n.jar&can=2&q=
If you look at the top of the createzip/signit script you will see that the the variable binLoc gets set to /usr/local/bin. What this means is that you should place all four of the above files into that location. If you don't like /usr/local/bin then just change the binLoc variable to point to some other directory where you will store these 4 files, and make sure that directory is in your PATH variable.
We'll start by just modifying some images in a single file. For example, let's modify the battery icons in /system/framework/framework-res.apk. I'm not going to add or remove any icons that didn't previously exist, I'm simply going to change a few of them. If you really want to get into modifying some files then you will need to decompile the file in order to change any corresponding XML files (sidetrack -- if you're curious then look in res/drawable at the following 3 files: stat_sys_battery.xml, stat_sys_battery_charge.xml, zzz_stat_sys_battery_1.xml). I'm going to throw this step into the instructions, not because it's necessary here, but because it's a good idea to know how to do it anyway. So let's try and modify our icons!
The basic steps would be something like what I outline below. Before you try this I suggest you make a full backup in recovery just in case something goes wrong. I have reviewed the steps below several times and even walked through them to make sure they are correct so they should work for you.
1. Get the apk file:
Code: $ adb pull /system/framework/framework-res.apk
Copy this file somewhere safe because we are going to push it back to the phone later (you probably won't want to keep the edits we make in step 3 below indefinitely).
2. Decompile it with apktool:
Code: $ apktool d framework-res.apk
3. Update the necessary files:
Step 2 should have unpacked the file into a folder named framework-res. We want to update the necessary files inside of it. The battery icons are all stored res/drawable-hdpi. Navigate to that directory and look for files like stat_sys_battery_*.png. These are the images that get displayed while your phone is running on battery power. The charging images are stat_sys_battery_charge_anim*.png. If you have a set of icons that you want to use then simply paste those icons in and overwrite the existing ones. You can move on to the next step.
If you don't already have images lined up then we can just modify some existing ones to verify that your changes worked. I'll assume you have the stock MikG battery icons (or some way of knowing what your current charge level is) so take note of what your current charge level is, and then modify a few of those images around that area. For example, if your phone is currently at 65% then maybe you will want to modify stat_sys_battery_charge_anim66.png, stat_sys_battery_charge_anim67.png, stat_sys_battery_charge_anim68.png, etc. Just open up these files in GIMP, Photoshop, or whatever. Don't change their size but just change something -- maybe change the color from white to green. Or you could just draw some lines on them. Just make some changes that will be noticeable and then save the files.
4. Package it back up:
Code: $ apktool b framework-res framework-res.apk
5. Sign it using the signit script:
Code: $ signit framework-res.apk
6. Create a skeleton zip file using the createzip script:
Code: $ createzip system/framework framework-res.apk
Note that the createzip script accepts 2 arguments. The first is the directory where the file needs to go, and the second is the name of the .apk file. If you wish, you can run the script without any arguments and it will prompt you for the values. In either case it will give you instructions for what to do next. Here is an example in interactive mode (values that I typed in are highlighted in blue):
Code: $ createzip Please enter the directory that your apk file will go in Example: system/framework system/framework Please enter the apk file to put into this zip Example: framework-res.apk framework-res.apk Creating appropriate directory structure Directory structure complete. A sample updater-script file has been created for you. This sample script will push a file to the /system mount point.
Next steps: 1. If necessary, modify the file /home/gamblor/Desktop/scripts/zip/META-INF/com/google/android/updater-script
2. When script is complete then zip up the directory and sign it: $ cd zip $ zip -r name.zip * $ signit name.zip
7. Make the actual zip file:
Zip up the directory in a recursive fashion using the exact instructions supplied by the script. Note that the createzip script will build a sample updater-script file for you, which says to mount /system and push the files over to it (since that's what most flashable zips do anyway). For this reason, you shouldn't actually need to modify that script at all for the purposes of this tutorial. It doesn't do anything fancy like scroll text across the screen, but it should do the trick to get the file installed. Feel free to open it up with a text editor and see what it does. It will also copy the file framework-res.zip to the appropriate location so everything is in place and we can create our actual zip:
Code: $ cd zip $ zip -r battery-icons.zip * $ signit battery-icons.zip
8. Flash it like you would any other file:
At this point you should have a file named battery-icons-signed.zip. Copy that file to your sdcard and then reboot into recovery and flash it (remember to backup first, if you haven't already). If everything goes well then you should be able to reboot and then check the battery icons for the percentage level that you modified. If everything went well then you should see your modified icons. Congratulations!
As a side note, if you're making mods for yourself and don't plan on creating a flashable zip (or maybe not just yet), you can easily just push the file in adb. This saves you from having to make a zip file, sign it, copy it to your zip card, reboot, and then flash from recovery. So you can just replace step 6 above with the following commands and stop after this:
Code: $ adb remount $ adb shell stop $ adb push framework-res.apk /system/framework $ adb shell start
Obviously since this post was supposed to demonstrate creating a zip file, I included those instructions. But pushing stuff in adb is a shortcut if you're just looking to test things out on a single phone and don't want to waste time dropping into recovery. Remember that file that I told you save away in step 1? Well, if you want to restore your battery icons so that some of them don't have weird colors/marks on them then cd into the directory where you saved the original file away, and then just run the 4 commands above. It should replace the file with the original one, thus setting the battery icons back to the way they were before you ever ran any of the commands above.

Theming Statusbar

Hey everyone.
Here is the deal:
I want to theme my statusbar to make it look like stock jelly bean (from nexus). It's possible to do that using apps such as "ROM Toolbox", but the problem is: The rom must be deodexed and mine isn't.
So I found this "how to" to deodex an apk in another forum:
Code:
Thanks all. Have successfully done what I wanted now
For info, this is what I did.
Created a new folder called 'system' in c:\android-sdk\tools. Obtained the odexed framework folder and placed that in the system folder. Then created a folder called app in the system folder and placed the Rosie.apk and Rosie.odex inside.
Then via cmd, entered the 'system/app' folder, so for me it was...
c:\android-sdk\tools\system\app
From there I ran the following command to end of that path: baksmali.jar -d ../framework -x Rosie.odex
This produced an out folder will all the decompiled .smali files etc. From there I was able to get to the Launcher.smali that i wanted, but to recompile to a classes.dex file you simply run the following command: smali.jar out
This produces an 'out.dex' that you can rename to 'classes.dex'
I am sure there are other commands that you can use to name files accordingly etc but this is what worked for me for what I wanted, so hopefully it will be of some help to people... if they can understand anything I've written.
Is that simple as it looks? I was planning to deodex only the file needed to customize the statusbar. I think it's the framework-res.apk.
Is there any other way to do that?
As I'm new on this deodex stuff, I would appreciate some help.
fndpena said:
Hey everyone.
Here is the deal:
I want to theme my statusbar to make it look like stock jelly bean (from nexus). It's possible to do that using apps such as "ROM Toolbox", but the problem is: The rom must be deodexed and mine isn't.
So I found this "how to" to deodex an apk in another forum:
Code:
Thanks all. Have successfully done what I wanted now
For info, this is what I did.
Created a new folder called 'system' in c:\android-sdk\tools. Obtained the odexed framework folder and placed that in the system folder. Then created a folder called app in the system folder and placed the Rosie.apk and Rosie.odex inside.
Then via cmd, entered the 'system/app' folder, so for me it was...
c:\android-sdk\tools\system\app
From there I ran the following command to end of that path: baksmali.jar -d ../framework -x Rosie.odex
This produced an out folder will all the decompiled .smali files etc. From there I was able to get to the Launcher.smali that i wanted, but to recompile to a classes.dex file you simply run the following command: smali.jar out
This produces an 'out.dex' that you can rename to 'classes.dex'
I am sure there are other commands that you can use to name files accordingly etc but this is what worked for me for what I wanted, so hopefully it will be of some help to people... if they can understand anything I've written.
Is that simple as it looks? I was planning to deodex only the file needed to customize the statusbar. I think it's the framework-res.apk.
Is there any other way to do that?
As I'm new on this deodex stuff, I would appreciate some help.
Click to expand...
Click to collapse
The statusbar is SystemUI.apk.. framework-res.apk deals with all the system pop ups etc.
I would recommend starting off with a deodexed base rom, for eg. wanams..
I would also recommend using apktool rather then baksmali.. iv had great success with apktool..
EDIT: You can find deodexed wanam base rom in general section of this section of the forum.
fOmey said:
The statusbar is SystemUI.apk.. framework-res.apk deals with all the system pop ups etc.
I would recommend starting off with a deodexed base rom, for eg. wanams..
I would also recommend using apktool rather then baksmali.. iv had great success with apktool..
Click to expand...
Click to collapse
Unfortunally, flash a new rom is not an option for me right now.
Is that OK to deodex only ONE apk in order to do what I want? In this case SystemUI.apk.
I just have to deodex it using apktool and put it back to android system?
do what fences do, compile it and put in the split test system, remember it is a system app
XxeAgLeAnGeLxX said:
do what fences do, compile it and put in the split test system, remember it is a system app
Click to expand...
Click to collapse
Sorry, but what is "split test system"?
EDIT: Nevermind... I did some research and now I'm running an AVD on android emulator.
I'll soon test the deodexed SystemUI.apk and post results. Thanks for the tips...

Categories

Resources