Editing APK's w/ Mac and Betterzip? - G1 Q&A, Help & Troubleshooting

Ok so i've been easing into learning how to edit apk's, theming I guess you can call it. I'm in the exploratory early stages, here's my question. I use BetterZip on my Mac to edit the apk's (zips). So I copied the facebook.apk from Super D 1.10.3 (built in?) and move the apk to my sdcard and renamed it with a .zip extension. Edit some png's, save it. Return to Root Explorer and rename with the .apk extension again, and install. Install comes back successful but my image changes do not show up? I havent gotten creative with it because I want to know the steps first before getting creative. So i just turned random icons black and such and they remain the same. It "overwrites" the FB app that is installed initially in system/app, should there not be two apk's around? prob not right? If someone could just briefly tell me their steps, and obviously you'd have to have a mac to help. Thanks.
And for the record, i've checked out other threads about editing apk's on a mac and its just too difficult it seems, creating keystores and whatnot? I feel like my method is pretty close, I'm just missing something.

joe.kerwin said:
Ok so i've been easing into learning how to edit apk's, theming I guess you can call it. I'm in the exploratory early stages, here's my question. I use BetterZip on my Mac to edit the apk's (zips). So I copied the facebook.apk from Super D 1.10.3 (built in?) and move the apk to my sdcard and renamed it with a .zip extension. Edit some png's, save it. Return to Root Explorer and rename with the .apk extension again, and install. Install comes back successful but my image changes do not show up? I havent gotten creative with it because I want to know the steps first before getting creative. So i just turned random icons black and such and they remain the same. It "overwrites" the FB app that is installed initially in system/app, should there not be two apk's around? prob not right? If someone could just briefly tell me their steps, and obviously you'd have to have a mac to help. Thanks.
And for the record, i've checked out other threads about editing apk's on a mac and its just too difficult it seems, creating keystores and whatnot? I feel like my method is pretty close, I'm just missing something.
Click to expand...
Click to collapse
I don't know much about mac's but I'm pretty good at theming. How are you signing your modified .apk files? If you don't sign them then they will fail to install.

Double post - sorry

Have you seen this thread - it's a droplet for your mac to sign apks.....maybe it will help?

yeah I have that droplet app to sign apps. Maybe it's just a bad apk to start with? I used the FB apk and edited it, signed it, and tried installing it on a fresh install of Superfast (facebook isn't included in system apps) and it still says "This program will overwrite a system blah blah blah" So maybe i'm just messing with the wrong apk? I haven't tried anything else, I just really wanted to tweak the FB widget, haha. Any advice?

Related

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!

Re-Sign APK after Customizing????

I'm attempting to "theme" (might be a stretch to call what i'm doing a theme) my first app. I started with intuitit's Launcher, modified the pull down icon and the background to suit my likings, dumped the image files back into the archive via 7zip. When I attempt to install to my phone I get this error in the command line:
[INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION]
Thinking this is because I didn't sign it after I made the changes? What is the best, most easiest way to sign my apps? I already have Eclipse installed, a workspace created, the most recent Android SDK files and the Android plugin's configured for Eclipse. But I'm thinking there is just some sort of batch file out there that will self sign the file.
Also, maybe this isn't a signing issue. If not, what is it?
DaveKid said:
I'm attempting to "theme" (might be a stretch to call what i'm doing a theme) my first app. I started with intuitit's Launcher, modified the pull down icon and the background to suit my likings, dumped the image files back into the archive via 7zip. When I attempt to install to my phone I get this error in the command line:
[INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION]
Thinking this is because I didn't sign it after I made the changes? What is the best, most easiest way to sign my apps? I already have Eclipse installed, a workspace created, the most recent Android SDK files and the Android plugin's configured for Eclipse. But I'm thinking there is just some sort of batch file out there that will self sign the file.
Also, maybe this isn't a signing issue. If not, what is it?
Click to expand...
Click to collapse
I use a script I found on the G1 boards...I'll zip it up for you and post it here...Its a modification of the zip signing thing, I use it all the time for Hello IM (horrible company multiple facets btw, no updates anymore they suck) and Chomp SMS
Simply extract the file to any directory, and in the root folder place ur customized APK file then run the sign.bat your file will be named your_app_signed.apk
sometimes I have to remove the META-INF from inside the APK then sign it for it to work (it recreates meta info)
have fun.
Also, you do not name a topic HOW TO unless you are offering a HOW TO, it is misleading...this is a question...you know that...it belongs in Q&A
AbsoluteDesignz said:
Also, you do not name a topic HOW TO unless you are offering a HOW TO, it is misleading...this is a question...you know that...it belongs in Q&A
Click to expand...
Click to collapse
your absolutely right! I sometimes am not sure where the best place is. and [HOW-TO] is definitely misleading.
thanks again for all your help.

Resigning apks

Usually when I theme an app I move it from /data/app to /system/app and then edit the files and do an update.zip to install the themed application. However, the problem with this is that I am not informed of market updates after moving the app to /system/app. Now I know that some people just edit the apk itself and resign it and that allows it to stay in /data/app.
I tried doing this, edited an apk, resigned it and that part went well. However, then I'm confused. Do I uninstall the app that's sitting in /data/app? Do I just cut and paste the new apk into /data/app? Or do I just install the new apk using Astro or something and let it overwrite the existing one.
I tried all three and it doesn't seem to work for me. It appears like everything went ok and it tells me application installed but none of the edits I make stick. Further, I noticed that in /data/app all the apks are named com.something.something.apk, whereas if you download an edited APK from some website it's usually named Facebook.apk, or Pandora.apk, etc.
So how the heck do I do this? I know the resigning is working because I edited the "Pandora.apk" that I downloaded from another source and resigned it, but when I try to pull from my phone I get the error that it either didn't install, or it does install but no changes happen.
How do you get com.something.something.apk to become Pandora.apk or Facebook.apk and then install it directly without having to do an update.zip??
anyone have a clue?
somebody anybody haha...why do my apps disappear from the app drawer after editing the apk in /data/app??
Dude i feel your pain, i've been in the same position.
Check this out it might help:
What are you editing in the apk?
http://forum.xda-developers.com/showpost.php?p=6479689&postcount=1
If your changing the name then the update can't find the apk, you cant move house but keep the same adress, you wont get your mail!!
Also if your wanting to update the edited apk, it will be overwritten by the updated version so your back to square one.
Hope this helps.
Search for apk tool, it will do what you want.

[GUIDE] How to make mymode themes

Well I haven't had much time lately to make themes but I figured i got enough time to explain how. This is how i do it in windows 7.
1) First thing i assume that you already have androidsdk on the root of your C drive. Lets go ahead and add it to your system path. If it's not called androidsdk go ahead and change it to that. Now open up your startmenu, right click computer, click properties, then click advanced system settings, in the advance system settings select environment variables. In the second box down look for path select it and choose edit. copy and paste this
Code:
;C:\androidsdk\tools
in there. Click okay.
2) download the jre and jdk from here and install them. Now you need to add them to your system path so copy paste this
Code:
;C:\Program Files (x86)\Java\jre6\bin;C:\Program Files (x86)\Java\jdk1.6.0_20\bin
to your system path just like you did in the first step.
3) Download apk manager from here. Now run it and when it says clean out all current projects click yes. Now thats ready to go.
4) Download an image editing program. I use gimp. Also if you don't have it 7-zip
your all set to go now so lets start over with the numbers
1) choose a mymode apk and extract it with 7-zip. Open up the res folder select a png that you want to change and change it with the image editor you chose.
2) when you've changed the images you want open up the original apk as an archive with 7zip. Then place the res folder of the modified unzipped apk into the archive and close the archive.
3) Now open up apk manager and place the mymode apk into the place here for signing folder click script batch choose no then type 15.
4) Now put the newly signed apk into your androidsdk/tools folder and close apk manager.
5) open command prompt and type this
Code:
cd\
cd androidsdk/tools
adb install whatever.apk
I'll update this with pics a more thorough guide.
Thanks to everyone that made this easy
reserved for themes to come
Thanks been waiting for a thread like this.
thanks, if i ever get any free-time between jobs and kid and fiancee i will look into this a little more
This is an awesome guide! I messed around with theming mytouch/g1 back when I had one.. so this will be great to make some themes for the slide..
One question though.. let's say you pull the nest theme.. theme it and re install it.. will it just override the nest theme or in the theme listing will it appear as a new theme and still allow you to have the original theme?
Sent from my T-Mobile myTouch 3G Slide using XDA App
ryanolson7 said:
One question though.. let's say you pull the nest theme.. theme it and re install it.. will it just override the nest theme or in the theme listing will it appear as a new theme and still allow you to have the original theme?
Sent from my T-Mobile myTouch 3G Slide using XDA App
Click to expand...
Click to collapse
The nest theme is in the framework, its not an .apk like the rest, its built into the system. The rest of the mymodes themes are .apks and if you edit those they will override the stock "nest" theme. The only way it will show up different in the theme chooser is if you edit the preview snapshot to be a preview of your theme. If you wanna keep the original theme, the nest theme is it and you should edit a different theme .apk...
-BMFC
Sent from my ROOTED MyTouch3G Slide
Okay so I got the next three days off and I already got two mymode themes pretty much done well their done but I just learned of a way to change the name so they are there own standalone apk instead of using another apk name. I've been using puppypride (which by the way isn't puppies those are full grown dogs) and switching out the pngs and you couldn't have the regular puppypride now you can have both
hope you don't mind but I did a mod of your themes and took out the bubbles since some people always create threads about it
Help with following guide
I am a newb at this so please don't attack me if I am doing something wrong. I have been struggling with following the guide posted to make mymode themes. I have successfully got up to the step of signing the apk file. I modified the files in the free_kick.apk. When I try to use APK Manager 4.8 and using the directions given the file just gets erased and nothing happens. My log file just shows errors. Any help with a more detailed directions one what to do in APK manager as I am trying different things and not getting anywhere. I use the option 15 like told in the guide. I can send my modified apk file to anyone if they can get this to work and get it installed that would be appreciated so much. I hope I can figure this out my own but thought I would try get help from the forums. Thanks in advance.
impimms said:
I am a newb at this so please don't attack me if I am doing something wrong. I have been struggling with following the guide posted to make mymode themes. I have successfully got up to the step of signing the apk file. I modified the files in the free_kick.apk. When I try to use APK Manager 4.8 and using the directions given the file just gets erased and nothing happens. My log file just shows errors. Any help with a more detailed directions one what to do in APK manager as I am trying different things and not getting anywhere. I use the option 15 like told in the guide. I can send my modified apk file to anyone if they can get this to work and get it installed that would be appreciated so much. I hope I can figure this out my own but thought I would try get help from the forums. Thanks in advance.
Click to expand...
Click to collapse
Actually the guide needs to be fixed a little because i'm guessing your getting compiling errors when using apk manager? But the best way to do this is to open up the mymode theme (using 7zip) as an archive delete meta-inf folder then replace the pngs with ones of your choice as long as they are the same scale. Then resign. and install
totally lost
I've followed these directions to a T and when it comes to using the apk manager i am getting nothing, please help
You guys that are having trouble with apk manager...its honestly not necessary to use Apk Manager for this. Mymodes themes are system .apks and shouldn't be re-signed. What you need to do is forget about apk manager (for now) and drop the UNsigned .apk into the ROM update you are using, and resign the whole ROM using the autosign tool created by jesusfreke. Or just adbpush the .apk. but don't resign the .apk.
Here's the link for the autosign tool to sign ROM updates. its in the THIRD POST and its auto-sign .zip, NOT the signing.zip in the first post. you can put it anywhere you want and you just drop (a copy of) your ROM update in the autosign folder, rename it update.zip, then run the sign.bat to sign. it will create another file, update-signed.zip. you shouldnt need to wipe when flashing the same ROM over itself, but i cant guarantee this is true for all ROMs.
you can also make an update that will only flash the .apk to /system/app, and nothing else will be changed. basically just make a copy of the update for the ROM youre using, then delete everything but the /system directory from the zip. then go into that /system directory and delete everything but the /app directory, then go into it and delete all the .apks and odex file or whatevers in there. ALL OF IT. when you are finished you should have an update with nothing in it but a /system/app directory. you put your modded .apk in there in /system/app, and thats it for that.
then you must edit the update script and remove MOST of its contents so that it only does what you want it to. THIS IS IMPORTANT! Go here to learn how to create an update script. what youll need is way simpler than the examples, youll want it to look basically like this...
Code:
assert compatible_with("0.2") == "true"
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
this update script will copy ANYTHING in the /system directory to /system on your device, regardless of subdirectories. that means anything in /system will go in /system, anything in /system/app will go to /system/app, etc. but since you only have one .apk in there it wont mess with anything but what you put in there. this way, you have a NOWIPE update for...well, whatever you want to put in it.
so you just drop the new shortened update-script in /META-INF/com/google/android/
and then use the autosign tool to resign your new update then flash away! This also takes less time cus its only flashing one file instead of flashing a whole ROM just to replace that one file...
hope this helps...
-BMFC
Sent from my T-Mobile myTouch 3G Slide using XDA App
So you cannot do this on t-mobile's rom which is 2.1 right now? I'm leery of rooting in case they ever release froyo
Tbrewer80 said:
So you cannot do this on t-mobile's rom which is 2.1 right now? I'm leery of rooting in case they ever release froyo
Click to expand...
Click to collapse
I'm having issues with this as well... After I do the whole signing apk thing, it installs fine, but when I go to MyModes, the preview is black and when I select it, the MyModes app force closes. I don't get it.

[Q] Confused former Windows Phone 6.5 user/themer

Hi Guys,
I'm coming from Windows Mobile 6.5 where theming was a bit different:
When I started with 6.5 I used to think the only way to change the look of my phone interface was to flash a custom rom, but then I realized I could theme individual components (6.5 theme, Taskbar, Icons, Start Menu, ect) and it turned out to be pretty easy.
With Android I'm begining to think the opposite exists, is it basically true that in order for me to change the colors of the taskbar, or menus, taskbar icons - I have to use a custom rom?
I have been reading over these threads for the past three days and I have learned a lot, but I'm still confused...
I used to do M2D themes and change the xml and such, but when I read the Android theming guides ALL of it seems foreign to me...does't seem like I can just swap out pngs for pngs I made in Photoshop Am I making this seem more difficult than it is?
Are there individual themes for my taskbar, dialer, ect (not roms)? And if so can a former Windows Phone user explain them in comparison to installing a cab?
I know I have a ton of questions so any help at all would be appreciated
Thanks
MEGA MAN
There are MANY apps out there that will allow you to make these changes. Do some searches on the market and you'll find them. Do some research into rooting your phone (at your own risk) which will allow even more options.
You do not have to use a custom ROM to theme your phone, but it makes it a lot easier overall. AFAIK, you still have to have your phone rooted to theme more than icons.
To theme images, it really is just swapping out your images for the images already there as long as they contain the same dimensions, format (pretty much always .png), and name.
The .xml files are easiest to edit if you have decompiled the apk with a tool call apktool, because then they are in readable format.
Apktool is also really great for getting .9.png's in decompiled format with the stock guidelines intact.
You can theme various different components with an app called Metamorph or Ninjamorph, otherwise, you're going to have all your different parts together.
I've been theming android for getting close to two years now, so if you would like more help, you can PM/email (david1667jones gmail) me for more specific answers.
megaman - ain't it a trip coming from WM to android? yeah...WM seems such a simpler way. especially CHT2...that is really the best modding system ever.
been experimenting for the past 2-3 weeks and have been successful. (even have a usable CM7 theme that i may post...)
so let's hash this out. maybe teach eacho other a thing or two. if i am being too basic, let me know.
apk - like a cab. tricky thing is that (i believe) if you edit an apk, you replace the entire apk. unlike a cab where you can replace 1 single file. there are theme programs (metamorph - haven't used it, ADW and others that allow replacement with a single file...but they take a little work. nothing easy like cabs for WM.)
to begin you need 7zip (or winrar i hear works.) this will allow you to open apks, replace files and restore them in seconds:
http://www.7-zip.org/
i assume your rom is rooted (i really don't understand the term, but it allows freedom to mod your phone. i am using an HD2 - WM phone - running nand android so by default my phone is rooted.)
let's explore - take any apk and open it with 7zip. you will see 3 files (this is off of memory as i am at work right now.) open them and look around. ((want to find your installed apks and back them up? search market for Astro. (settings> backup and save your apks to your sd card)))
under res you will see drawable folders - this is the jackpot. in there you will see your images. there is a lot of redundancy in apks. the trick is finding the right image. try changing some, etc. this is the most basic of theming.
before moving on to xmls, etc (which there are quite good guides for this) just try the above. when you replace the files move up the folder hierarchy and it will ask you something about saving/restoring - cilck yes. the apk is now modded.
install the apk and see the changes.
however, if you are editing the core apks - system and framework-res, we will need to talk about how to do that (i use clockworkmod flashing...easy to do.)
let me know if this helps.
Thank you guys so much for your knowledge!
I do have my phone rooted and I have bootloader installed
The one reason I thought that I had to download a "ROM" is because I keep reading about having to be deodexed in order to modify...and I was underthe impression that most custom roms provide this deodexing?
on to APK's...I do have 7Zip and I have opened some up and found where the graphics are...now I am actually extracting the apk so I can manually go through each folder and see whats there including graphics...there does seem to be another way of opening the APK with 7Zip and not actually extracting it, but I don't thing I can actually see the image previews this way. >>>so I extract, change my desired images, re-zip and change the file extention back to .apk - BUT then I read about signing APK's? ...and signing zips?
After some researching I found a thread in which someone posted something like they make a copy of there current ROM "theme?" and then copy it in zip form on to their PC where they goe through all of the desired APKs and then Zip it back together and install it from the screen that you get to after holding the power button and home (recovery screen maybe?) <<< Anyway is this possible? This seem most like what we did in windows phone...but again I think where I'm getting caught up is the signing aspect...I've seen auto signers, but I feel like the ones I've seen were only for XP and I have Windows 7.
Woo... ok wrote a lot there - if you have anytime to elaborate on anything, I'd be happy to hear.
...and jsmccabe - that HD2 is one awesome device...I remember everybody asking if Windows 7 would everbe available and now you guys are dual booting with WP7 and Android - AWESOME!!! (if I didnt have Verizon
megaman...sorry it took a bit. "real life" and all that...
megaman 2 said:
The one reason I thought that I had to download a "ROM" is because I keep reading about having to be deodexed in order to modify...and I was underthe impression that most custom roms provide this deodexing?
Click to expand...
Click to collapse
- not sure what deodexed means. is your rom cm7? if so, tmobile themes is an "easy" way to make a theme.
- are you theming to share or for yourself? if the latter just replace the the files in your rom and flashe the rom. if the former, what type of rom?
megaman 2 said:
on to APK's...I do have 7Zip and I have opened some up and found where the graphics are...now I am actually extracting the apk so I can manually go through each folder and see whats there including graphics...there does seem to be another way of opening the APK with 7Zip and not actually extracting it, but I don't thing I can actually see the image previews this way. >>>so I extract, change my desired images, re-zip and change the file extention back to .apk - BUT then I read about signing APK's? ...and signing zips?
Click to expand...
Click to collapse
- you can extract to make life easier. but when you are ready to make the changes just drag the new icons into the original apk. it will update it for you and you can install it and done.
megaman 2 said:
After some researching I found a thread in which someone posted something like they make a copy of there current ROM "theme?" and then copy it in zip form on to their PC where they goe through all of the desired APKs and then Zip it back together and install it from the screen that you get to after holding the power button and home (recovery screen maybe?) <<< Anyway is this possible? This seem most like what we did in windows phone...but again I think where I'm getting caught up is the signing aspect...I've seen auto signers, but I feel like the ones I've seen were only for XP and I have Windows 7.
Click to expand...
Click to collapse
CWM themes are pretty easy to do. i started with this, the problem is it replaces the entire apk to replace 1 image. which if you are modifying systemui or frameworks, may overwrite other things (colors that you didn't want to.) easiest thing to do....find an already established CWM theme and keeping the same structure, replace the images and flash via CWM.
let me know if you want more details...cheers and good luck!

Categories

Resources