Installing edited .apk files


Last Updated:

  1. lewa

    lewa Well-Known Member This Topic's Starter

    Joined:
    Mar 14, 2010
    Messages:
    76
    Likes Received:
    2
    Why: There's some programs that I love using, but since all programmers aren't graphic designers (and I happen to enjoy graphic design), I just want to change some of the .png files and reinstall the apk.

    The technical stuff:

    I put the edit .apk in the tools folder, run a cmd from there, and:\
    Code (Text):
    1. adb push program.apk /data/app
    I then go to the file in Android Mate, and tap it, and try to install it.

    But when I try to install it, Android Mate says "Application did not install." So there must be an error with it. I figure it's something obvious, like a signing issue. Ideas?
     

    Advertisement
  2. TheProfessional

    TheProfessional Well-Known Member

    Joined:
    Jan 5, 2010
    Messages:
    47
    Likes Received:
    9
    If you extracted the .apk, you need to repack it and resign it.

    However i found the easiest way to replace image files in an .apk is to not extract and simply open it with 7-Zip or WinRAR.
     
  3. T2noob

    T2noob Well-Known Member

    Joined:
    Jan 16, 2010
    Messages:
    471
    Likes Received:
    98
    Yea if you edited they need to be resigned, but you can just replace the files without extracting and it should be ok, I have the files if you need to resign it, but its for linux the are.sh files know as scripts.
     
  4. lewa

    lewa Well-Known Member This Topic's Starter

    Joined:
    Mar 14, 2010
    Messages:
    76
    Likes Received:
    2
    Mmk thanks guys. I was renaming it as a zip, then back to an apk. I'll try opening it in 7zip.
     
  5. droidkevlar

    droidkevlar Well-Known Member

    Joined:
    Jan 28, 2010
    Messages:
    815
    Likes Received:
    111
    You should share these newly designed apps with the rest of us. That is of course the apps you are using were free and not paid. I love a new GUI on a good app.
     
  6. jcase

    jcase Well-Known Member

    Joined:
    Mar 24, 2010
    Messages:
    361
    Likes Received:
    261
    adb install whatever.apk
     
  7. lewa

    lewa Well-Known Member This Topic's Starter

    Joined:
    Mar 14, 2010
    Messages:
    76
    Likes Received:
    2
    LOL thanks.

    Okay, I definitely will :) Yeah, nothing better than a fresh GUI, quite happifying. Getting excited about re-skinning Cestos (best game ever). I've fallen in love with the flat style it came with, but would equally love a more realistic looking version. And the text they used looks terrible. Glad it was on images so I can fix that.

    At some point I might want to set up screenshot capabilities...
     
  8. lewa

    lewa Well-Known Member This Topic's Starter

    Joined:
    Mar 14, 2010
    Messages:
    76
    Likes Received:
    2
    Grr still not installing, error "unexpected exception."

    GrdLock gave me the ROMSign.zip thing, can't figure out how to use it though >.<
     
  9. TheProfessional

    TheProfessional Well-Known Member

    Joined:
    Jan 5, 2010
    Messages:
    47
    Likes Received:
    9
    what .apk are you trying to edit?

    Specifically which files as well?
     
  10. lewa

    lewa Well-Known Member This Topic's Starter

    Joined:
    Mar 14, 2010
    Messages:
    76
    Likes Received:
    2
    Cestos.
    Png files.


    Got the apk from /data/app/
     
  11. TheProfessional

    TheProfessional Well-Known Member

    Joined:
    Jan 5, 2010
    Messages:
    47
    Likes Received:
    9
    Was going to try and see if i could change some arbitrary images inside the .apk, just to see if it would work, but I don't have to that application. Sorry.
     
  12. TheProfessional

    TheProfessional Well-Known Member

    Joined:
    Jan 5, 2010
    Messages:
    47
    Likes Received:
    9
    I downloaded Cestos to see if i could replace some of the image files.

    It worked for me, but i wasn't able to just replace them. I did have to resign it.

    Here's what did (i'm simplifying it a bit under the assumption you have a pretty good idea of what you're doing already).

    1. Replace the images in the original .apk file.
    2. Open the "META-INF" folder and delete all three files: CERT.RSA, CERT.SF, and MANIFEST.SF
    3. Resign it (I use the resigning tool here: General ROM FAQ - Android Central Forums )
     
  13. lewa

    lewa Well-Known Member This Topic's Starter

    Joined:
    Mar 14, 2010
    Messages:
    76
    Likes Received:
    2
  14. TheProfessional

    TheProfessional Well-Known Member

    Joined:
    Jan 5, 2010
    Messages:
    47
    Likes Received:
    9
    Are you using windows?
     
  15. lewa

    lewa Well-Known Member This Topic's Starter

    Joined:
    Mar 14, 2010
    Messages:
    76
    Likes Received:
    2
    Yes, sorry for not specifying. Will add stuff to my sig now...
     
  16. TheProfessional

    TheProfessional Well-Known Member

    Joined:
    Jan 5, 2010
    Messages:
    47
    Likes Received:
    9
    Here's the signing tool for windows.

    Instructions on how to use it are on the site previously posted.

    Added a signing tool for linux.
     

    Attached Files:

  17. Philosophre

    Philosophre Well-Known Member

    Joined:
    Feb 26, 2010
    Messages:
    105
    Likes Received:
    2
    I presume this works for any add to a Zip. Add or subtract files from a ROM, sign it, and I am good to go.
     
  18. Mr.Slave

    Mr.Slave Well-Known Member

    Joined:
    Mar 4, 2010
    Messages:
    271
    Likes Received:
    85
    When I went in and edited some live wallpapers I renamed the .apk to .zip, navigated to the file in 7-zip file manager, right click and select Open Inside. This way you don't have to worry about resigning the .apk and can get at the .png image files to edit or replace them. The only other thing I learned is that the image you are putting in the old ones place is that it must have the exact same properties. I even renamed my new .png file to the file name I was replacing. It is actually really easy.

    Here is a sample of what I did to the live wallpaper NeuralNetwork(NSFW) http://www.megaupload.com/?d=F3GHJFZ0
    When in settings select the dark background and it will change the background.
     
  19. Conap

    Conap Well-Known Member

    Joined:
    Mar 18, 2010
    Messages:
    145
    Likes Received:
    38
    Been fooling around with this whole concept of changing some of the graphics too but when i try to reinstall through "adb install whatever.apk" it is saying can not find "whatever.apk" to install. I've tried putting the file in tools folder and other folders and tried directing adb to the file also with no luck....also the apk will not reinstall through my backup manager does that mean it isn't resigned right or will it have to be installed through adb?

    Edit: Figured out how to get it to find the apk but now says "install failed update incompatible" any ideas? I just wanted to change the htc battery widget to blue to match sense-able0,7 rom lol. I also tried just opening with the 7zip but it still makes me resign it...
     
  20. lewa

    lewa Well-Known Member This Topic's Starter

    Joined:
    Mar 14, 2010
    Messages:
    76
    Likes Received:
    2
    Personally, whenever I even move a file from one folder to another, it becomes unsigned...or at least the lock icon on it goes away.

    Coulld we just remove the signed stuff, and install it as a third-party app?

    EDIT: D'oh, android will only installed signed stuff.
     
  21. lewa

    lewa Well-Known Member This Topic's Starter

    Joined:
    Mar 14, 2010
    Messages:
    76
    Likes Received:
    2
    Hrm. Windows is wonderful.

    So installed the JDK (java SDK...) so I could run the apk signer. Had to prepend the system variable "PATH" with the location of the JDK to get java commands to work in command prompt.

    Now adb commands don't work.
    .
     
  22. Conap

    Conap Well-Known Member

    Joined:
    Mar 18, 2010
    Messages:
    145
    Likes Received:
    38
    So I tried and tried to edit the htc battery widget to make it blue...could not get it to work even with all the great help on here...so finally I downloaded another battery widget from the market...edited the png image from green to blue resigned and it installed perfectly...i'm curious as to why the same process didn't work with the htc battery widget? does it have something to do with them signing their apk's differently? anyway thanks for all the help in this thread and love having a blue batter widget to go with the great sense-able 2.0 rom...
     
  23. lewa

    lewa Well-Known Member This Topic's Starter

    Joined:
    Mar 14, 2010
    Messages:
    76
    Likes Received:
    2
    So, what process did you use to get the new one to work?
    Yeah HTC's stuff is probably more secure.
     
  24. Conap

    Conap Well-Known Member

    Joined:
    Mar 18, 2010
    Messages:
    145
    Likes Received:
    38
    opened the apk in winrar and copied the green color bar for the battery to my desktop, then opened with paintbrush and recolored it to blue and then dropped the new png image back into winrar file to replace the original. resigned the apk then installed through astro backup...couldn't believe it was that easy after messing with the htc app for 3 days lol...
     
  25. lewa

    lewa Well-Known Member This Topic's Starter

    Joined:
    Mar 14, 2010
    Messages:
    76
    Likes Received:
    2
    IT WORKED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Here's a blue battery widget for anyone who's interested: com_geekyouup_android_widgets_battery-signed.apk (58 KB)

    Of course, you gotta uninstall the old one first.

    Here's my documented process for editing an apk:
    1: Pull .apk from /data/app/
    2: Open with 7zip or whatever, edit the files you want, and put them back into the file. Don't unzip and zip it. Just drop the files back into the apk.
    3: Re-sign it.
    4: adb install
     

Share This Page

Loading...