Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,730,130 Members 53,835 Now Online
XDA Developers Android and Mobile Development Forum

[TUTORIAL]How to unpack/repack .apk files

Tip us?
 
despotovski01
Old
(Last edited by despotovski01; 17th June 2011 at 03:59 PM.) Reason: Updated a broken link
#1  
despotovski01's Avatar
Recognized Developer - OP
Thanks Meter 1838
Posts: 1,450
Join Date: Jan 2011
Cool [TUTORIAL]How to unpack/repack .apk files

Hey guys!
I've made another tutorial. This one is about unpacking and repacking .apk files. This tutorial was made for people who don't want to mess with Command Prompt, or for those who want to do it in graphical user interface.
-------------------------------------------------
Requirements:
-An archive manager, such as WinZip, WinRar, or Power Archiver, that is capable of extracting and making .rar archives
-Formatter (it's a program made by me) - click here to download it. Mirror: http://www.mediafire.com/?5a74bjg475er75d
-------------------------------------------------
Tutorial:
Just follow the steps and you will learn how to unpack/repack .apk file in no time!

How to unpack .apk files:
1. Open Formatter (I assume you already have it downloaded and installed on your computter)
2. Click the "Choose File" button and choose your apk file. Then, in the first text box, enter ".rar" (without quotes). After that, enter your desired name for your .rar archive and click the big "Rename!" button

3. Go to the folder where your .apk file was. You should see a .rar archive, named by the name you entered in Formatter. Extract it with your archive manager

How to repack .apk files:
1. Compress the extracted files in a .rar archive (compress them normally like any other archive)
2. Open Formatter
3. Choose the .rar archive you made a minute ago
4. Set the format to .apk
5. Set the name to whatever you want
6. Click the big "Rename!" button

-------------------------------------------------
Mac OS X users: follow this tutorial (special thanks to daisun):
Quote:
Originally Posted by daisun
For those still interested in editing apks on OS X without unpacking and hence without resigning I have found something that works!

muCommander! Just rename the .apk to .zip and browse it using muCommander just like you would using WinRar! Just tested it, I was able to add and remove files without resigning. The modified apk installed on my phone without a problem!

As for editing xml values you can simply copy the xml file out and edit it using your favourite editor and then copy them back in.

Hope I was able to help some OS X users.

/edit By the way, this method (WinRar or muCommander) also works for editing update.zip. This means you can customise the rom (add/remove system apks, change the boot animation etc) before you flash it.
-------------------------------------------------
That was about it. If you have any problems or questions, feel free ask me. Hitting the "Thanks" button is very appreciated. Feel free to click it if I helped you.
"If you think you can, therefore, you can." - Unknown
"A journey of a thousand miles begins with a single step." - Confucius
"Question everything." - Einstein

"Don't let anyone tell you what you can't do."

My work:
Android Ultimate Toolbox Pro Updated as of 4.5.2013
Boot Animation Factory Updated as of 1.6.2013
Boot Animation Creator Obsolete
Boot Animation Previewer Obsolete

Devices:
LG G2 D802 16GB: Android 4.2.2 Jellybean (stock)
HTC EVO 3D: CyanogenMod 11
The Following 114 Users Say Thank You to despotovski01 For This Useful Post: [ Click to Expand ]
 
Mrbalders
Old
#2  
Junior Member
Thanks Meter 2
Posts: 16
Join Date: Mar 2011
Extremely useful app and instructions, thanks very much for this, now time to play
The Following User Says Thank You to Mrbalders For This Useful Post: [ Click to Expand ]
 
despotovski01
Old
#3  
despotovski01's Avatar
Recognized Developer - OP
Thanks Meter 1838
Posts: 1,450
Join Date: Jan 2011
Quote:
Originally Posted by Mrbalders View Post
Extremely useful app and instructions, thanks very much for this, now time to play
I'm glad you found this tutorial useful.
"If you think you can, therefore, you can." - Unknown
"A journey of a thousand miles begins with a single step." - Confucius
"Question everything." - Einstein

"Don't let anyone tell you what you can't do."

My work:
Android Ultimate Toolbox Pro Updated as of 4.5.2013
Boot Animation Factory Updated as of 1.6.2013
Boot Animation Creator Obsolete
Boot Animation Previewer Obsolete

Devices:
LG G2 D802 16GB: Android 4.2.2 Jellybean (stock)
HTC EVO 3D: CyanogenMod 11
The Following 2 Users Say Thank You to despotovski01 For This Useful Post: [ Click to Expand ]
 
Brut.all
Old
#4  
Recognized Developer
Thanks Meter 332
Posts: 1,467
Join Date: Jul 2009
Why to use special application just to change an extension of some apk file? O_o I think it's much easier to:
  • Choose to open all *.apk files with archive tool. Then set "apk" as extension of output file when compressing.
  • or disable "hide extension of known files" feature in Windows and change file extensions normally - by renaming them.

Also does above tutorial really work? I mean .apk files are zip archives, not rar and I doubt Android can open rar archives.
G+ | apktool | Ingress broot mod | Brut Google Maps (dead)

If you like me you can buy me a droidburger!
The Following 2 Users Say Thank You to Brut.all For This Useful Post: [ Click to Expand ]
 
despotovski01
Old
#5  
despotovski01's Avatar
Recognized Developer - OP
Thanks Meter 1838
Posts: 1,450
Join Date: Jan 2011
Quote:
Originally Posted by Brut.all View Post
Why to use special application just to change an extension of some apk file? O_o I think it's much easier to:
  • Choose to open all *.apk files with archive tool. Then set "apk" as extension of output file when compressing.
  • or disable "hide extension of known files" feature in Windows and change file extensions normally - by renaming them.

Also does above tutorial really work? I mean .apk files are zip archives, not rar and I doubt Android can open rar archives.
Yes, it works. I've tried it myself.
"If you think you can, therefore, you can." - Unknown
"A journey of a thousand miles begins with a single step." - Confucius
"Question everything." - Einstein

"Don't let anyone tell you what you can't do."

My work:
Android Ultimate Toolbox Pro Updated as of 4.5.2013
Boot Animation Factory Updated as of 1.6.2013
Boot Animation Creator Obsolete
Boot Animation Previewer Obsolete

Devices:
LG G2 D802 16GB: Android 4.2.2 Jellybean (stock)
HTC EVO 3D: CyanogenMod 11
The Following User Says Thank You to despotovski01 For This Useful Post: [ Click to Expand ]
 
itskapil
Old
#6  
Senior Member
Thanks Meter 58
Posts: 213
Join Date: Apr 2010
Location: Bhilwara
Definitely cool. Thanks!
The Following 2 Users Say Thank You to itskapil For This Useful Post: [ Click to Expand ]
 
despotovski01
Old
#7  
despotovski01's Avatar
Recognized Developer - OP
Thanks Meter 1838
Posts: 1,450
Join Date: Jan 2011
Quote:
Originally Posted by itskapil View Post
Definitely cool. Thanks!
No prob.
"If you think you can, therefore, you can." - Unknown
"A journey of a thousand miles begins with a single step." - Confucius
"Question everything." - Einstein

"Don't let anyone tell you what you can't do."

My work:
Android Ultimate Toolbox Pro Updated as of 4.5.2013
Boot Animation Factory Updated as of 1.6.2013
Boot Animation Creator Obsolete
Boot Animation Previewer Obsolete

Devices:
LG G2 D802 16GB: Android 4.2.2 Jellybean (stock)
HTC EVO 3D: CyanogenMod 11
 
LiquidSolstice
Old
#8  
LiquidSolstice's Avatar
Recognized Developer
Thanks Meter 4358
Posts: 4,561
Join Date: Jan 2008
Erm, no offense, but this is a bit dim.

You don't need any special programs to check out what's going in an apk. In fact, you don't even need to rename the apk, you can just open the apk using WinRAR or 7Zip, both will handle it just fine.

If you really need renaming, just uncheck "Hide known extensions" in the Explorer options.

This is just a really convoluted and ultimately uneccessary way of doing this.
The Following User Says Thank You to LiquidSolstice For This Useful Post: [ Click to Expand ]
 
despotovski01
Old
#9  
despotovski01's Avatar
Recognized Developer - OP
Thanks Meter 1838
Posts: 1,450
Join Date: Jan 2011
Quote:
Originally Posted by LiquidSolstice View Post
Erm, no offense, but this is a bit dim.

You don't need any special programs to check out what's going in an apk. In fact, you don't even need to rename the apk, you can just open the apk using WinRAR or 7Zip, both will handle it just fine.

If you really need renaming, just uncheck "Hide known extensions" in the Explorer options.

This is just a really convoluted and ultimately uneccessary way of doing this.
I made the tut like this because I didn't know you can hide known extensions in Windows Explorer. I know you can open the apk with every archive manager.
"If you think you can, therefore, you can." - Unknown
"A journey of a thousand miles begins with a single step." - Confucius
"Question everything." - Einstein

"Don't let anyone tell you what you can't do."

My work:
Android Ultimate Toolbox Pro Updated as of 4.5.2013
Boot Animation Factory Updated as of 1.6.2013
Boot Animation Creator Obsolete
Boot Animation Previewer Obsolete

Devices:
LG G2 D802 16GB: Android 4.2.2 Jellybean (stock)
HTC EVO 3D: CyanogenMod 11
 
LiquidSolstice
Old
#10  
LiquidSolstice's Avatar
Recognized Developer
Thanks Meter 4358
Posts: 4,561
Join Date: Jan 2008
Quote:
Originally Posted by despotovski01 View Post
I made the tut like this because I didn't know you can hide known extensions in Windows Explorer. I know you can open the apk with every archive manager.
:X You knew how to build a program that had to do with file extensions but you didn't know about hiding known extensions? It's been around since XP (at least), man.

I'm sorry, I'm not trying to antagonize you. It's a decent effort, I just think it's a bit overkill. Might be a good idea to paint the tutorial in a different way, such as "If you don't want all your extensions showing all the time (which is what the "hide extensions" option would do if disabled), use my guide for those one-off times where you need to rename them".


The Following 2 Users Say Thank You to LiquidSolstice For This Useful Post: [ Click to Expand ]
Tags
android, apk, archive, repack, unpack
THREAD CLOSED
Subscribe
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes