Related
ok, so I am working on reskinning sense, I'm using DamageControl 2.1 right now and I was able to edit some of the files used in com.htc.resources.apk without problem.
The problem I am having right now is whenever I try and modify a file in rosie, repack and resign and adb push it back to the phone, sense force closes until I revert back to the orginial file, has anyone run into the same issue?
I am going to download the latest framework to see if there might be an issue with signing caused by not having the latest one. I really can't remember which version I'm running.
i give you credit, i wouldn't even attempt to try this on my phone.
Quick question, is there a reason why you're resigning the .apk? There is no need too.
I was under the impression, perhaps uneccesarily, that whenever you modify an apk it needs to be resigned to prevent problems.
I've always done this, I have never had a problem with that practice in the past which is why it perplexed me now. As I already stated, there was no problems when I modified com.HTC.resources.apk
I'm drunk
obelisk79 said:
ok, so I am working on reskinning sense, I'm using DamageControl 2.1 right now and I was able to edit some of the files used in com.htc.resources.apk without problem.
The problem I am having right now is whenever I try and modify a file in rosie, repack and resign and adb push it back to the phone, sense force closes until I revert back to the orginial file, has anyone run into the same issue?
I am going to download the latest framework to see if there might be an issue with signing caused by not having the latest one. I really can't remember which version I'm running.
Click to expand...
Click to collapse
There is images where the name is yadayad08.png, well the number might not be 08 it might be another number and i really dont feel like diggin into it right now, but the images with that number in the end have scripts attatched to the or it written into the image. Have you looked into that. Sorry if I have been %100 clear but ther is images with scripts actually written inside of them......... if you can follow what i'm sayin...:\ I'm drunk......... anyway i'll look into it right now and be back so I dont look like a complete douchebag
So some images have a script stored in the same file? I have never heard of that before. I'd like to see some examples if possible, and how exactly do you modify them?
Time to put my Google-fu to good use.
Edit: whatcha drinking?
The file I am trying to modify is common_mainnav_scroller3.png. maybe that will help. I'm not at my laptop right now, so I am not able to try modifying it without resigning.
I also found some info about the images with scripts attached to them. I have a utility now to modify that stuff, however looking around some more I also think the files with a filename.9.png are the applicable files. I'm not modifying them right now.
obelisk79 said:
The file I am trying to modify is common_mainnav_scroller3.png. maybe that will help. I'm not at my laptop right now, so I am not able to try modifying it without resigning.
I also found some info about the images with scripts attached to them. I have a utility now to modify that stuff, however looking around some more I also think the files with a filename.9.png are the applicable files. I'm not modifying them right now.
Click to expand...
Click to collapse
yea i know forsure the.9 files have scripts attached however if your just changing something as small as an icon I don't think it should matter. Not sure though, i was trying to port a theme and i ran into this situation im not a linux guru so I kind of gave it up
I do not resign the .apk after modifying them If you are only changing images just make sure the new image has the same name and just open the .apk and drag n drop the image into the folder where it needs to be it will over write the old image and store the new one.
I have modified the Rosie.apk and com.htc.resources.apk many times to change things in the taskbar change over to Espresso etc
if you are only changing .png files just drag and drop.
Also like cheyne1 said files or .png's with xxxx.9.png etc in them are more than just .png files and replacing them will cause all sorts of issues if the new file is not made correctly
well, lesson learned... drag-n-drop worked. didn't think rosie apk was going to be so testy. thanks for the help.
Deprecated.
Deprecated.
Deprecated.
I must be missing something..but how do i get to the com/android/server/status?
backdown said:
I must be missing something..but how do i get to the com/android/server/status?
Click to expand...
Click to collapse
This reference assumes that you already know how to recompile a framework file using smali/baksmali.
You're my hero for this, steel.
Just saying.
This is something that has driven me straight up the wall. Having so many useless icons means that when I finally do get some notifications, they get pushed right off the edge. I really can only seem to fit ~4 notifications most of the time before I get the arrow.
Well I've got the necessary lines changed to take out the location icons... Now to repackage it. Thanks for this!
Uh... I've never signed a .jar before. Anyone???
EDIT: I attached the services.jar I edited. It has to be signed for the phone to even boot up. Hopefully someone can sign this.
This is hot... I like it a lot. I have been looking for something like this for quiet awhile. Now to read up on smali/baksmali. I know how to edit a .jar file but there are "files" within that file.... Great... But I have to learn at least one thing a day right. If anyone has insight for me feel free to enlighten us but google search will suffice for now.
webby_s said:
This is hot... I like it a lot. I have been looking for something like this for quiet awhile. Now to read up on smali/baksmali. I know how to edit a .jar file but there are "files" within that file.... Great... But I have to learn at least one thing a day right. If anyone has insight for me feel free to enlighten us but google search will suffice for now.
Click to expand...
Click to collapse
Start here: http://code.google.com/p/smali/.
Thank you very much for posting this. This has been something bothering me since I got the device.
I have no idea how to use these tools, but I will figure them out.
EDIT: Figured it out. The steps worked! My taskbar is so clean and beautiful now!
Here are some VERY BASIC directions. Use at your own risk. They worked for me.
Make a backup of your services.jar on your device (or alternatively make a nandroid backup): adb shell cp /system/framework/services.jar /system/framework/services.jar.bak
Get services.jar from your device: adb pull /system/framework/services.jar .
Extract classes.dex from services.jar
Decompile the .dex file: java -jar baksmali.jar classes.dex -o outputdir
Make desired edits to the files now in outputdir/
Recompile the .dex file: java -Xmx512M -jar smali.jar outputdir/ -o classes.dex
Add the new (modified) classes.dex file to the existing services.jar file (which is actually a zip file)
Cross your fingers and push services.jar back to your device: adb push services.jar /system/framework/services.jar
Reboot device: adb reboot
How about someone post two edited and signed files to share with everyone else...?
EVOme said:
How about someone post two edited and signed files to share with everyone else...?
Click to expand...
Click to collapse
I believe (please correct me if I'm wrong) the services.jar could be different in certain ROMs or themes. It's better to make the edits yourself on the file that came off your device to preserve the integrity of the rest of your system.
EDIT: What we need is an app that makes the edits on the device for us...
Thanks, Xak
EVOme said:
Thanks, Xak
Click to expand...
Click to collapse
Sure thing. By the way, I love (and concur with) your avatar
So, as usual, I made this a lot more complicated than it needs to be. Somehow I was un-signing services.jar. I don't know. I got it to work now though. WORD!
many thanks to xak and the OP. with your help i was easily able to get rid of that pesky gps on/off icon! i appreciate the tips
Nice, this made me learn smali/baksmali and edit services.jar according to what I want.
Thanks!
webby_s said:
This is hot... I like it a lot. I have been looking for something like this for quiet awhile. Now to read up on smali/baksmali. I know how to edit a .jar file but there are "files" within that file.... Great... But I have to learn at least one thing a day right. If anyone has insight for me feel free to enlighten us but google search will suffice for now.
Click to expand...
Click to collapse
Very useful information about services.jar, smali/baksmali, classes.dex can be found HERE
As someone else mentioned, they learned how to use smali/baksmali and do customizations themselves. My OP along with the link posted here gives you all the info you need to perform these mods yourself, and at the same time you will learn a great deal on customizing your evo; The benefits of which are endless!
One final note, you need to use the services.jar from the ROM you are running, THEY ARE NOT interchangeable due to the fact that almost all ROM devs add some customizations into their roms.
SteelH - thanks for posting this! I love learning new things, so this was interesting... wasn't exactly sure where to start though, so these steps from xak were a great help.
xak944 said:
Thank you very much for posting this. This has been something bothering me since I got the device.
I have no idea how to use these tools, but I will figure them out.
EDIT: Figured it out. The steps worked! My taskbar is so clean and beautiful now!
Here are some VERY BASIC directions. Use at your own risk. They worked for me.
Make a backup of your services.jar on your device (or alternatively make a nandroid backup): adb shell cp /system/framework/services.jar /system/framework/services.jar.bak
Get services.jar from your device: adb pull /system/framework/services.jar .
Extract classes.dex from services.jar
Decompile the .dex file: java -jar baksmali.jar classes.dex -o outputdir
Make desired edits to the files now in outputdir/
Recompile the .dex file: java -Xmx512M -jar smali.jar outputdir/ -o classes.dex
Add the new (modified) classes.dex file to the existing services.jar file (which is actually a zip file)
Cross your fingers and push services.jar back to your device: adb push services.jar /system/framework/services.jar
Reboot device: adb reboot
Click to expand...
Click to collapse
In addition to these steps, I wanted to mention a few things... these might be obvious to most, but hopefully they help someone.
- to extract and re-add classes.dex from/to services.jar, use winzip
- to modify the .smali files that Steel mentions, use notepad
- you will need to mount /system as read/write before you can push services.jar back to the phone
- it took a long time for my phone to reboot... i got pretty nervous
thanks again, I love not having the alarm and gps icons taking up space
I wanted to get some insight, direction and perhaps guidance on how to take the existing Deodexed ED2 ROM and get inside and make some edits, remove bloatware, replace Touchwiz with a different launcher etc. I am not looking to build a full blown custom ROM, I am just looking to edit a stock (yet deodexed) ROM to meet my needs.
Any help would be greatly appreciated so I can learn more about this process.
There are two ways you can do it. First way, that is usually a little easier to work with, is to extract the zip file, make the changes you want, and re-zip the whole thing. The other method is to just open the zip file (7zip or similar will make this a little easier) and add/delete stuff as you want. It eliminates the decompress/recompress part, but is a little harder to work with unless you know exactly what you want to do.
As far as figuring out what to remove and such, some files are named in a manner that they are easy to figure out (Mms.apk for example) and other files are not (Dlna.apk is AllShare). If you want to figure out what an APK file is, a good indication is sometimes opening it with say 7zip (they are essentially zip files) and extracting res/drawable-hdpi/icon.png and you can see what the icon is. Astro File Manager can also give you some info on the specific Apks, as can Titanium Backup I believe.
As for replacing things (like the launcher) it is as simple as taking one out and putting another in for most stuff. I will let you know that I had battery drain issues when I removed the stock TWLauncher, but I believe I know how to fix it then. A lot of stuff though, if you are replacing things, you'll want to do 1 or 2 things at a time and also be familiar with logcat as it is an invaluable tool when testing out ROM changes and problems.
Thanks imnuts, I will start to play with a zip file and go from there. As you mentioned the bloatware is in the system folder and not the data folder so perhaps I will just delete the bloat, and install GB Launcher on my phone and make it default so that TW is still there just not in use.
Hi,
a little late, but...
did you actually make this work? I'm trying the exact same thing, but my 4ext recovery always aborts the installation. Do I need to sign it or what is wrong?
Thanks a lot...
Please use the Q&A Forum for questions Thanks
Moving to Q&A
By any chance could someone tell me the best way to make a rom, I have a droid 3 and really want to make a rom but I don't know where to start, thanks in advance
Sent from my DROID3 using XDA App
The best roms start with 3 eggs and little bit of milk to make them fluffy. Whisk briskly!
If you want to jump in, this is a good place to start http://source.android.com/source/index.html
If you just want to dip your toe in the water, then you could start with modding roms, such as adding/removing apks, theming, writing update scripts.
Find a rom and unzip it. Look inside, poke around. Don't be shy-take things apart. Peel back the layers until you find xml and png files. Then, put it all back together and see if you can get it to flash.
Thanks
Sent from my DROID3 using XDA App
thanks so much for the info!
If you download a rom and unzip it, there will be a META-INF folder- look in here- there will be some crypto certs and a com/google/android/ folder which will have the updater-script and update-binary. The script is how the phone knows what to do with the rom. Read through the script and try to decipher what it is actually doing. It will be different for some roms. For example, the cyanogen roms will back up some system apps and replace them after flashing.
You might also come across a boot.img in the root directory of the rom. If you do, there will be some instructions in the updater-script for what to do with it.
Next look in the system/app directory- you'll find a bunch of apk files. These are actually in zip format, so you could unzip them to see what is inside.
A basic test would be to add or remove an apk to the system apps and then get it to flash. Of course you'll need a rooted phone and maybe jarsigner or signapk. Signing a rom will put all those CERT.RSA files back into the META-INF/ folder, which contain crypto hashes of all the files and the names of the files. Some recoveries will allow you to flash an unsigned rom, but you might as well figure out how to sign them. It's in the android link I posted earlier.
Good luck!
Thank you for that also this is very helpful I was kinda confused on where to start with aosp, also that the droid 3 has a locked bootloader
Sent from my DROID3 using XDA App
By any chance would you know how to do some theming? If I understand right it has to do with decompiling the framework-res and systemui apks, and replacing some pngs and xmls with others right?
Sent from my DROID3 using XDA App
I just got started with this so I am by no means an expert. I think you'll want to start by deodexing a rom so that you can make changes to the res, xml, etc. I think most stock apps come as a two part package- an .apk file and an .odex file, both with the same names. Find a stock app and look in the framework and app folders. De-odex-ing takes the odex file, de-compiles it, and then recompiles it into a classes.dex file that is put back into the apk or jar file. This configuration will should allow you to make changes without having to compile the rom from scratch... at least that is my understanding.
Find an apk that doesn't have an odex file and look for the classes.dex file inside. Then take a peak in the res folder in the apk. In the res folder you'll find all sorts of xml and png files.
To get started with decompiling, you'll want baksmali http://code.google.com/p/smali/wiki/DeodexInstructions
Take a look at the issues. JesusFreke wrote some interesting comments in issue 61.
I think there are a few other packages that will do the same thing, and there are certainly a few scripts that will work too.
I ran into some issues with deodexing honeycomb- I outlined the process here http://forum.xda-developers.com/showthread.php?t=1324653.
This is also a good source http://wiki.sdx-developers.com/index.php/How_to_deodex_a_ROM
Good info, thanks.
thank you you have been extremely helpful, im gonna try to get my rom out by sometime this week thank you
I just did some mini-theming. I have an ASUS Transformer- the stock rom has it's own back/menu/home buttons. I wanted a more complete honeycomb look, so I grabbed the stock honeycomb versions from a xoom rom, and added them into my deodexed stock ASUS SystemUI.apk. Oddly enough, if I signed the apk, it wouldn't work, but if I left it unsigned, it works fine.
thats odd, i thought you needed to sign it for it to work
Hi,
I decided to try to make a modification of an existing ROM which would suit me better right after flashing. Nothing large, only adding some apps and stuff. But Ive got a couple of questions:
1) Ive read some apps cant run from /system partition. Looks like that (at least) one of mine is one of them - it FCs when in /system/apps or /system/priv-apps. Is there any workaround to make this work? I dont want to lose it when doing factory reset (or to flash the ROM again after every factory reset).
2) I wanted to add langunages (http://forum.xda-developers.com/showthread.php?t=2602704) but according to forums those files are odexed. How could I deodex them to make them run on an deodexed ROM?
3) I want to include the faux kernel but Im not sure if simply copying those files into the ROM would do ... in the other cases it went ok but Im not sure about the kernel - Im afraid I could break something.
4) Can I also use the ROM file to store other files? I mean - if I put files into the ROM in /data/media/0/ would it simply appear in my home directory or could this break anything - by which I mean to destroy my existing files?
Thanks for any leads!
michalurban said:
Hi,
I decided to try to make a modification of an existing ROM which would suit me better right after flashing. Nothing large, only adding some apps and stuff. But Ive got a couple of questions:
1) Ive read some apps cant run from /system partition. Looks like that (at least) one of mine is one of them - it FCs when in /system/apps or /system/priv-apps. Is there any workaround to make this work? I dont want to lose it when doing factory reset (or to flash the ROM again after every factory reset).
2) I wanted to add langunages (http://forum.xda-developers.com/showthread.php?t=2602704) but according to forums those files are odexed. How could I deodex them to make them run on an deodexed ROM?
3) I want to include the faux kernel but Im not sure if simply copying those files into the ROM would do ... in the other cases it went ok but Im not sure about the kernel - Im afraid I could break something.
4) Can I also use the ROM file to store other files? I mean - if I put files into the ROM in /data/media/0/ would it simply appear in my home directory or could this break anything - by which I mean to destroy my existing files?
Thanks for any leads!
Click to expand...
Click to collapse
1) What is the app? on system/app they should work fine since kitkat update, i think
2) To deodex i used a kitchen i got out of foro nexus (cant get the link atm) that only worked on linux. If you want to translate things in your rom, i think it can be done without deodexing, im not sure.
3) Copy paste should work fine but if you take a look at faux's meta inf, see what's there, merge it with your rom's meta inf. But it should work with cp
4) You can use the meta inf to link files to storage like your sdcard, yes. However, if you try to put a wallpaper somewhere inside the rom it wont show up
anerik said:
1) What is the app? on system/app they should work fine since kitkat update, i think
2) To deodex i used a kitchen i got out of foro nexus (cant get the link atm) that only worked on linux. If you want to translate things in your rom, i think it can be done without deodexing, im not sure.
3) Copy paste should work fine but if you take a look at faux's meta inf, see what's there, merge it with your rom's meta inf. But it should work with cp
4) You can use the meta inf to link files to storage like your sdcard, yes. However, if you try to put a wallpaper somewhere inside the rom it wont show up
Click to expand...
Click to collapse
Thanks very much for your reply! Now:
1) The app is a game, Traffic Racer. When I flash a ROM where this app has been put in /data/app it runs fine. In /system/app or /system/priv-app it FCs. As you say it should work Ill try to do it again - but I tried it twice in /system/priv-app and once in /system/app already so I dont believe it would work. BTW I use APKs from update.zip created by TiBa if it could be relevant.
2) Linux is not a problem so Ill try to find the link here.
3) Ill try only to copy the files first before messing with meta files.
4) I only want to store some apps config backup files (for Apex launcher and Agenda widget mainly).
michalurban said:
Thanks very much for your reply! Now:
1) The app is a game, Traffic Racer. When I flash a ROM where this app has been put in /data/app it runs fine. In /system/app or /system/priv-app it FCs. As you say it should work Ill try to do it again - but I tried it twice in /system/priv-app and once in /system/app already so I dont believe it would work. BTW I use APKs from update.zip created by TiBa if it could be relevant.
2) Linux is not a problem so Ill try to find the link here.
3) Ill try only to copy the files first before messing with meta files.
4) I only want to store some apps config backup files (for Apex launcher and Agenda widget mainly).
Click to expand...
Click to collapse
Oh, games could cause issues, yes. Better leave it on data app. Messing with meta inf is totally easier than it sounds anyways and could help fixing any possible bugs, you gotta try it. Backup files i dont think they'll work on the rom but you can store them into storage/emulated/legacy which is the storage, though you could do this any other easier way
anerik said:
Oh, games could cause issues, yes. Better leave it on data app. Messing with meta inf is totally easier than it sounds anyways and could help fixing any possible bugs, you gotta try it. Backup files i dont think they'll work on the rom but you can store them into storage/emulated/legacy which is the storage, though you could do this any other easier way
Click to expand...
Click to collapse
Thanks again! Ive got one more question about including the faux kernel. The updater-script is supposed to run this command during the installation in CWM:
Code:
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
... which I dont know how to implement. If I would only copy all files it would overwrite the original boot.img (Kitkat+ 1.1 original anyway) - which im not sure is the same. So Im not sure if it wont screw something up ...
Or is this extraction the same as copying it? Does the "/dev/block/platform/msm_sdcc.1/by-name/boot" just mean - "its a block device on first SD, partition name boot"?
michalurban said:
Thanks again! Ive got one more question about including the faux kernel. The updater-script is supposed to run this command during the installation in CWM:
Code:
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
... which I dont know how to implement. If I would only copy all files it would overwrite the original boot.img (Kitkat+ 1.1 original anyway) - which im not sure is the same. So Im not sure if it wont screw something up ...
Or is this extraction the same as copying it? Does the "/dev/block/platform/msm_sdcc.1/by-name/boot" just mean - "its a block device on first SD, partition name boot"?
Click to expand...
Click to collapse
Put faux's boot.img on the rom first, then on updater script go to the line that refers to extracting boot.img (should be like the last one) and replace that with the command on faux's updater script. That means it will extract it in that directory, nothing else. Be sure to copy modules aswell and set the perms
Q&A threads should be created in the Q&A forum... not the Development forum.
Thread moved.
One more question - is there a special way how to pack the ZIP file? Cause I unpacked a ROM, added some apks, packed it but it didnt work (no error, just ended at "opening rom" or what the CWM message is) ... but when I modified existing ZIP it went fine ...