[Guide] [Apktool] [Drag2sign] guide for decompiling apks to edit xml files & sign apk
I know there is already an apktool guide here but I have created this one to link with my how to make any status bar transparent guide (link at bottom of this guide)
Things you will need
Java development tools (JDK)
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Apktool
http://code.google.com/p/android-apktool/downloads/list
Place both apktool files in C:\Windows\
This guide will assume
You have correctly installed apktool
Windows is installed on drive c:
How to begin
This guide will assume
you are decompiling SystemUI.apk
place SystemUI.apk and Framework-res.apk from your rom zip or phone to c:\
(note you may also need twframework-res.apk)
For Windows 7 and before
Click start menu
In run box type cmd
Right click cmd & left click run as administrator
Accept security message
For Windows 8.1
Right click start menu button
Select command prompt (Admin)
Accept security message
Type - cd..
Press enter
Type - cd..
Press enter
(you have typed cd dot dot twice)
The prompt should now be c:\
How to decompile
This guide will assume
The decompiled folder will be called newui
Type - apktool if c:\framework-res.apk
Press enter
Type - apktool if c:\SystemUI.apk
Press enter
(note do same with twframework-res.apk if required)
Type - apktool d c:\SystemUI.apk c:\newui
Press enter
The apk has now been decompiled to folder newui in c:\
make any changes you want
How to recompile
This guide will assume
The new apk will be called newSystemUI.apk
Type - apktool b c:\newui c:\newSystemUI.apk
Press enter
It will now build
If no errors are found in your changes it will place the new apk in directory c:\
Once you have recompiled delete newSystemUI.apk
Unzip the orig apk from your rom zip with winrar
Open then decompiled folder newui
There will now be a folder called build
Take out META-INF and AndroidManifest.xml if present
Place this in your decompiled folder in build/apk
Recompile the folder again
For non system apps you can sign your apk with a testkey with this tool
Sign the apk with drag2sign (see attachment)
Unzip drag2sign
Place apk in the folder you unzipped drag2sign to
Drag your apk on top of drag2sign bat file
Once signed change the name of apk back to the name of the original apk
note if you are signing a cyanogenmod SystemUI.apk you need to use zip signer (playstore) to sign the apk with a platform key
Put in a flashable zip and flash with system mounted
For my guide to making any rom status bar transparent see
http://xdaforums.com/showthread.php?t=2204389
I know there is already an apktool guide here but I have created this one to link with my how to make any status bar transparent guide (link at bottom of this guide)
Things you will need
Java development tools (JDK)
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Apktool
http://code.google.com/p/android-apktool/downloads/list
Place both apktool files in C:\Windows\
This guide will assume
You have correctly installed apktool
Windows is installed on drive c:
How to begin
This guide will assume
you are decompiling SystemUI.apk
place SystemUI.apk and Framework-res.apk from your rom zip or phone to c:\
(note you may also need twframework-res.apk)
For Windows 7 and before
Click start menu
In run box type cmd
Right click cmd & left click run as administrator
Accept security message
For Windows 8.1
Right click start menu button
Select command prompt (Admin)
Accept security message
Type - cd..
Press enter
Type - cd..
Press enter
(you have typed cd dot dot twice)
The prompt should now be c:\
How to decompile
This guide will assume
The decompiled folder will be called newui
Type - apktool if c:\framework-res.apk
Press enter
Type - apktool if c:\SystemUI.apk
Press enter
(note do same with twframework-res.apk if required)
Type - apktool d c:\SystemUI.apk c:\newui
Press enter
The apk has now been decompiled to folder newui in c:\
make any changes you want
How to recompile
This guide will assume
The new apk will be called newSystemUI.apk
Type - apktool b c:\newui c:\newSystemUI.apk
Press enter
It will now build
If no errors are found in your changes it will place the new apk in directory c:\
Once you have recompiled delete newSystemUI.apk
Unzip the orig apk from your rom zip with winrar
Open then decompiled folder newui
There will now be a folder called build
Take out META-INF and AndroidManifest.xml if present
Place this in your decompiled folder in build/apk
Recompile the folder again
For non system apps you can sign your apk with a testkey with this tool
Sign the apk with drag2sign (see attachment)
Unzip drag2sign
Place apk in the folder you unzipped drag2sign to
Drag your apk on top of drag2sign bat file
Once signed change the name of apk back to the name of the original apk
note if you are signing a cyanogenmod SystemUI.apk you need to use zip signer (playstore) to sign the apk with a platform key
Put in a flashable zip and flash with system mounted
For my guide to making any rom status bar transparent see
http://xdaforums.com/showthread.php?t=2204389
Attachments
Last edited: