APK question [SOLVED] - G1 Q&A, Help & Troubleshooting

I'm trying to edit a few things but I'm not sure how to go about repackaging them as .apk even though I know they're archives. If I open the archive and extract everything how should I go about putting it back together? Is it as simple as throwing it in a .zip file, renaming it to .apk and signing it or am I missing something? I tried doing that with Rosie.apk because it has a lot of wallpapers I won't ever use and I wanted to throw some of my ringtones into it too.

Dyonas said:
I'm trying to edit a few things but I'm not sure how to go about repackaging them as .apk even though I know they're archives. If I open the archive and extract everything how should I go about putting it back together? Is it as simple as throwing it in a .zip file, renaming it to .apk and signing it or am I missing something? I tried doing that with Rosie.apk because it has a lot of wallpapers I won't ever use and I wanted to throw some of my ringtones into it too.
Click to expand...
Click to collapse
there is already another thread somewhere farther down about this, but in short, you need to resign. Stericson did a one-click signing tool, but I was never able to get it working on my machine. I use the same tools, but I have to do the manual sign option, it is still easy, it just uses one more click.
As far as repacking rosie.apk, you should just be able to locate the .png and small.png files you want to replace. Find your new wallpapers, rename them to the names of the wallpapers you want replace. (you will need to resize your 480x320 wallpapers to the small wallpaper dimensions, they are 80x60. easiest way to resize is in MS paint or Gimp. once you rename just drag the files into the open winrar window. For rosie i think wallpapers are in the drawable 480x320 folder. When winrar brings up a prompt, just make sure you have the options selected to add and overwrite existing files or something of the like. It is also a good idea to adb pull your Rosie.apk just in case things go bad you can push a backup to revert you to where you were before. If you got any questions send me a PM or hit me on gtalk- [email protected]

Dyonas said:
I'm trying to edit a few things but I'm not sure how to go about repackaging them as .apk even though I know they're archives. If I open the archive and extract everything how should I go about putting it back together? Is it as simple as throwing it in a .zip file, renaming it to .apk and signing it or am I missing something? I tried doing that with Rosie.apk because it has a lot of wallpapers I won't ever use and I wanted to throw some of my ringtones into it too.
Click to expand...
Click to collapse
You can open Rosie.apk with something like winrar and replace the images without the need to resign. I've done it countless times. There's not much point in removing wallpapers in Rosie though, it will just reduce the size of the apk without any noticeable speed improvment. Most Hero devs use the stock Rosie apk.
As for ringtones, they don't reside in Rosie.apk. You can put them on your FAT32 (or EXT if you have one). Just put the mp3's in /media/audio/ringtones. I highly suggest putting them on ext because when the SD card is mounted in your computer your phone can't access the ringtones. Ext isn't mounted (on windows atleast) so they are still accessible.

Thanks guys, I seem to have it almost done now with this and what I stumbled through

Related

Tux App bar

Ok, maybe I'm going a little overboard here, but I jailbroke the phone just yesterday. I thought that it was time to see what all I would be able to do with it. So i got to looking around trying to figure out what I could skin. /system/app/Launcher.apk provided what i needed to redo the app bar. Here are my results.
I didn't do any modification to the xml files yet. I would like to get where I can edit the images out of those files as well. I removed the up/down arrows, but it was more of a replace with a 1x1px png. you get errors if the files are not put back with the right names or if files are missing. So I'm sure in the xml you would be able to edit it out.
One last thing. There really isn't much space on the /system mount. even when coping the file back up after repacking, I would ofter get not enough space on disk error. Trying again resulted in a success.
How about something else. I am not the best artist or graphics person. I'm sure that my files are larger then they should be. I had to do a 255 index on the color to get the image files down small enough. I'm sure with proper programming on my part, I wouldn't need the bar image, just the tux image. /shrug. I'm tired and going to be.
Enjoy.
Impressive. What does it look like with the apps menu expanded?
Oh, and how do you take screenshots?
It looks like it would noramally but with a tux on it instead of the grey bar. I will have to gt another image up.
The program to take screen shots is ddms (i think). It is in the tools directory of the sdk. Sorry, I just woke up for work.. not much sleep. But I do know if you are running linux it has to be on a 32bit os. It wouldn't run on my 64bit ubuntu.
a question I received
kron2 said:
can you help me i am new to linux and would like to edit some off the images in the app folder on the G1 my phone is jailbroke and i have the files to resign the apk's but don't no how to use them i no how to remove the files from the phone and edit them with rar. and thin i put the files back and rename the file apk but don't no how to resign it i have the emulator and ddms plus eclipse working i would think i resign it after i edit it but don't no where to put the files or how to use signapk.jar thx for your help
Click to expand...
Click to collapse
I don't know how much help I can be with the jar tool. I can tell you what I did though.
I used adb to get the /system/app/Launcher.apk file. The I extracted the file. So now I have the .apk file and a folder with all of the files in it. I then copied the .apk file to make a backup of it, just in case I needed to push it to the device.
Ok now I am set to do the editing of the files. I use Linux so I started gimp up editing an image. Then saved the image, keeping it the same size (56x295 - something like that) as the previous file. The files size (k/mb) will change. You need to keep this as small as you can.
I then started up Archive Manager, I think that you said that you use winrar or something. You might want to try 7zip, not sure though. Onward. I opened the .apk with the archive manager. The allowed me not to have repack the archive. I then dragged and dropped the edited .png file into the same folder I edited it from, into the same folder browsing though the archive manager. This did nothing more than update the .apk archive with the edited file.
then I pushed the file back to the droid. I hit the end button to turn the screen off and then menu x2 to get into the interface again. This refreshed the interface. and my edits were there.
That is about it. I'm going to copy and paste this reply in the forum so others will benefit from your question.

Wasting lots of time and getting nowhere!

I managed to somehow stumble through a few minor edits in the Launcher.apk by relying purely on colour replacement tools but that was messy and I tried to be more accurate and do something that works and looks how I want. Unfortunately it doesn't seem to matter what I do now on any .apk PNGs they don't work. I resign them when I'm done, push to my phone and nada. It either fails to load or half loads then throws up a ton of acore FCs so clearly I'm doing something wrong. Perhaps someone here can point out what I'm doing wrong if I list what I do.
unzip .apk and find image to edit.
Pull image into Photoshop
Change image as needed / wanted
Save file (I haven't touched any .9s yet)
zip the lot back up, rename to .apk and sign
Push file back to phone, reboot.
I've tried pushing the file while in recovery and while it's been running, neither makes a difference and I have little enough hair without resorting to pull it out :| I did just notice in another thread where Ted mentions using Paint.NET to pry open those damned indexed files. I'm going to look at that but earlier if it was indexed I ended up opening it then manually cleaning it up before making sure it was indexed when I saved it again.
That's about it. If anyone can offer insight into the cause I'd be most appreciative
try not resigning individual apks (system apks). After you edit them, zip them back up. put them back into the update.zip that it came from and resign the update.zip and reflash. that should work.
Yeah what I do is unpack the theme/ROM with the .apk I want to edit. Then I unpack the .apk, go into the folder and edit the images I need, then zip the contents of the folder back into a .apk (make sure you zip the contents, not the folder they are in) and replace the current .apk with mine. Then I re-zip the theme/ROM and resign it. it's a long and arduous process, but it works
i use 7-zip, extract the folders i want to edit from the archive, delete all of the .xml's out of it (since they can break something between versions sometimes) then edit my images, go back to the .zip or .apk file (7-zip will open either extension) go to the folder with the images i edited, then drag my images into it.
i never actually never unzip an entire zip or apk and rezip it when i am done. it is rather quick and easy. just make sure that you click ok when it ask you to update the archive.
david1171 said:
i use 7-zip, extract the folders i want to edit from the archive, delete all of the .xml's out of it (since they can break something between versions sometimes) then edit my images, go back to the .zip or .apk file (7-zip will open either extension) go to the folder with the images i edited, then drag my images into it.
i never actually never unzip an entire zip or apk and rezip it when i am done. it is rather quick and easy. just make sure that you click ok when it ask you to update the archive.
Click to expand...
Click to collapse
Hes got the solution..........its the way ive done it from day 1, and 7-zip FTW.
brandenk said:
Hes got the solution..........its the way ive done it from day 1, and 7-zip FTW.
Click to expand...
Click to collapse
well i got it from a certain post you made on how you made themed quickly and easily
Thanks for all the replies I've been a fan of 7-zip for a while, glad to see I'm not alone there! From the sound of it all the re-signing might be the cause so I'll give the method david suggested a whirl!
Are there any major things to avoid? For example, I noticed a lot of the icons don't take the full size of the image like the 3G notification icon or the satellite notification icon. Is it safe to go the full size or will that cause a horrible mess? I don't quite see why the images have so much space around them basically and want to use some of those extra pixels lol
Hey about using metamorph bud? much easier to do then what your doing
Check it out.
www.RelentlessAddictions.com/android
http://forum.xda-developers.com/showthread.php?t=589315
Stericson
If your on windows, its simpler not to unzip the .apk or .zip. Since the begining, there have been problems with the way windows zips files. It seems the way Linux and windows zips files are some what different. There may lie your problem. Simply drag the folder on to your desktop, edit the pngs, then drag the folder back on to the .apk inside the .zip. I also agree with the above statements. Sign the whole zip as one instead of each one independably. You can also erase any apk or jar archive not being editing to make your update smaller and faster to load...
Also, most .apk's are universal, meaning they can be used in any rom. Some are not! Meaning they will break the system. Examples are framework, launcher...
Stericson said:
Hey about using metamorph bud? much easier to do then what your doing
Check it out.
www.RelentlessAddictions.com/android
http://forum.xda-developers.com/showthread.php?t=589315
Stericson
Click to expand...
Click to collapse
I thought about it for simple recolours but this is me trying to teach myself what works and what doesn't before I attempt to make myself a theme. I'm still going to have a look at metamorph though so thanks for the links Stericson.
Quick edit to note that using Paint.NET to change lots of bits in framework-res.apk worked Now I can have a little rest before I tackle things like Launcher and others. Out of all the programs to open indexed PNGs I would've thought Photoshop would do it. I only own Elements but the trial version of CS4 still opened them as corrupt. Strange stuff!

[Q] MIUI Themes Help

Ive been working on a custom theme for MIUI for a while now and I just finished it but everytime I try to load it up on my droid it just puts me on the default theme. Help/Suggestions?
No one has any helpful advice?
Yes, that has been happening to me too, but that is when I try to go from scratch. There are two things I can think of right now that could be stopping that: You are on a mac and you used the built-in archive, and you didn't use astro to delete the MACOSX_. Folder, or you don't have update scripts or code that you need.
You're right about the mac. So how do I get rid of the MACOSX folder?
Scratch that. Just found it. Trying to load the theme now....
And still same default theme.
Actually I might have just found the problem. When I compressed the folder it put the actual theme folder INSIDE the .zip file instead of putting the contents in the .zip file.

[Guide] Simple guide to theming ANY ROM

A lot of people have asked in various threads lately about getting this theme on x rom, or can someone port this theme for me, etc. It really isn't that hard. It actually is pretty much a simple matter of copying and pasting. This will work on any ROM, and it only takes a few minutes, easy enough for an amateur to do it.
1. First, download the ROM that has the theme that you want on your current ROM.
2. Extract framework-res.apk from /system/framework and rename it to framework-res-old.zip and then right click it, and click extract all. Just extract them to currentdirectory\framework-res-old, which should be the default option anyway.
3. Take your current ROM, and extract framework-res.apk from /system/framework, and repeat step 2 except name it framework-res-new.zip.
4. Browse to the framework-res-old\res folder and select all of the folders starting with "drawable", such as "drawable-mdpi"
5. Browse to the framework-res-new\res folder and paste those folders, it should prompt you to merge and replace files and all that jazz, just click yes and do for the next x conflicts. It will copy and replace all of the image files.
6. Go back to the root of your framework-res-new folder, highlight all of the contents, right click, Send to > Compressed (zipped) archive
7. Windows will re-zip framework-res-new. When it finishes, rename the new zip file to framework-res.apk and push it to /system/framework. If you haven't gotten s-off on your phone, you have to do this while in clockwork recovery (make sure you mount /system in the partitions menu, or if you are s-off and booted, type adb shell mount -o rw,remount /system if it gives you memory errors)
For other operating systems, the steps are similar. If you use a linux distro, I'm going to assume you are smart enough to figure out the compression tools and menu items to unzip and rezip the apk files.
NOTE: You don't actually have to change the extensions to .zip, in fact, you won't be able to unless you unchecked hide known file extensions in the windows folder options in control panel. I just thought it would be easier. If you don't want to unhide extensions, just use a tool like 7-zip or winrar to open and extract the APK. In simple terms, all you are doing is replacing the res folder of your new framework-res.apk with the one from the theme you want. Not very hard.
ANOTHER Note: Sense roms are a bit more difficult to theme, since all of the HTC apps are themed from images in com.htc.resources.apk in /system/framework. But if you are on a sense ROM, you probably can just use a MyModes theme. If you do however choose to try this on a sense ROM, it will only theme user and non-HTC apps. This guide will technically work for any ROM but it works best for AOSP based ROMs, like CyanogenMod or ArayrayMod. The only thing is that if there is a change in the color of text, then you have to decompile both framework-res APKs and copy styles.xml from the old one to your new one and recompile it. APKtool or APK Manager both work great for that.
DO A NANDROID BACKUP BEFORE PUSHING THE NEW FRAMEWORK! Sometimes you can get boot loops from screwing with other files in framework-res, or if it is not signed properly. But you shouldn't get boot loops as long as you stay away from XMLs.
how do i extract an apk? it shows up as an apk and when i click extract it does nothing
Sometimes pushing new frameworks cause boot loops fyi..
Happened to me twice :/
Sent from my T-Mobile myTouch 3G Slide using XDA App
purple1 said:
how do i extract an apk? it shows up as an apk and when i click extract it does nothing
Click to expand...
Click to collapse
Did you try renaming it to framework-res.zip rather than .apk? If you have 7-zip or winrar you can also right click, open with, and choose 7-zip or winrar from the choose default program option.
arayray said:
Sometimes pushing new frameworks cause boot loops fyi..
Click to expand...
Click to collapse
Only if you screw with the non-drawable folders. If you leave the XMLs intact and only change the images it boots fine. The boot loops are caused by incompatible or conflicting XML files, which happens when you just push a random framework-res from another ROM, you have to just move the images over.
I use apkmanager for linux and its immensely helpful. Also you can loop one even without modifying the xmls. Least I have that's why the most important part of theming is knowing how to backup/restore or flash sbf or w/e.
Only if you screw with the non-drawable folders. If you leave the XMLs intact and only change the images it boots fine. The boot loops are caused by incompatible or conflicting XML files, which happens when you just push a random framework-res from another ROM, you have to just move the images over.
Click to expand...
Click to collapse
I think you should state that in the OP
Added a note at the bottom, thanks

[Q] Requesting Red Theme for kf1 roms

I was wondering if there were any themers out there that have or can make a red theme for fasty 2.5. I would be very greatful. Ive been trying the past couple weeks but im not doing very good. Alot of boot loops.
PS Fasty 2.5 if a kf1 based rom. If that helps at all.
What you trying to do, I know how to code but I'm new to Java and dalvik code. Learning as I go, but maybe I can help you out.
I don't know what all you've been trying, but what I've had success (to a limited degree) with is to pull a current copy of your framework-res.apk, twframework-res.apk, and systemui.apk files out of /system/framework and /system/app (you may need to dig to find them), then open/unzip the folder with 7zip. Make copies of each apk to a safe place as a backup.
Dig around in each folder and change anything without a .9.png extension. An easy thing to do is just to use photoshop and automate a color shift. (You may have to play around with some icons - they don't like being opened if they're indexed color.)
Once you have some files ready, open the pulled .apk's with 7zip again (use the open archive option), and overwrite the files inside of them with the files you edited.
Once that's done, fire up adb again and push your updated files back to the respective folders they came from.
Reboot, and you should be good to go.
I would like to make a red version of the theme honeysmoke by the creators of fasty. I would post the link to it but the website is down.
First thing is your going to need something like Apkmanager if you don't already have it.
http://forum.xda-developers.com/showthread.php?t=1227179
Like jmtheiss said, pull the system files out and unzip them. I use Paint.net, which isn't photoshop, but works well.
OK i have apk manager i decompiled the framework-res.apk
voldomart13 said:
OK i have apk manager i decompiled the framework-res.apk
Click to expand...
Click to collapse
Well if your just starting out you should select to extract it first and then look in res/drawable-hdpi and you will see some .png files. Just look at your phone and figure out what you want to try to mod that you see in the folder. The same would hold true for systemui and twframework-res, both will have .png files in the res/drawable-hdpi folder. Be careful not to modify .9.png files, they are a special file that is stretchable and most paint programs don't recognize them and are difficult to modify with draw9patch editor.
http://forum.xda-developers.com/showthread.php?t=908270

Categories

Resources