Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,805,540 Members 38,373 Now Online
XDA Developers Android and Mobile Development Forum

[Guide] [Apktool] [Drag2sign] guide for decompiling apks to edit xml files & sign apk

Tip us?
 
marcussmith2626
Old
(Last edited by marcussmith2626; 19th March 2014 at 01:54 PM.)
#1  
marcussmith2626's Avatar
Recognized Contributor - OP
Thanks Meter 2,399
Posts: 4,439
Join Date: Jul 2012
Location: London
Default [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/ja...ads/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://forum.xda-developers.com/show....php?t=2204389
Attached Files
File Type: zip drag2sign.zip - [Click for QR Code] (11.4 KB, 640 views)

My Work And Threads For Galaxy Y GT-S5360


My PM is not a Question & Answer thread - Dont treat it as such!
The Following 14 Users Say Thank You to marcussmith2626 For This Useful Post: [ Click to Expand ]
 
TheDeadEnd
Old
(Last edited by Steve0007; 25th March 2013 at 10:44 PM.)
#2  
Account currently disabled
Thanks Meter 80
Posts: 340
Join Date: Feb 2013
Location: Developer at Team HybriDroid
Good guide!:thumbsup:
 
marcussmith2626
Old
(Last edited by marcussmith2626; 25th March 2013 at 11:02 PM.)
#3  
marcussmith2626's Avatar
Recognized Contributor - OP
Thanks Meter 2,399
Posts: 4,439
Join Date: Jul 2012
Location: London
Quote:
Originally Posted by death_sinker View Post
Good guide
Thanks
The Following User Says Thank You to marcussmith2626 For This Useful Post: [ Click to Expand ]
 
Reynaldi
Old
#4  
Senior Member
Thanks Meter 11
Posts: 118
Join Date: Oct 2012
Location: Makassar

 
DONATE TO ME
do we need to sign system apps?
 
marcussmith2626
Old
#5  
marcussmith2626's Avatar
Recognized Contributor - OP
Thanks Meter 2,399
Posts: 4,439
Join Date: Jul 2012
Location: London
Quote:
Originally Posted by Reynaldi View Post
do we need to sign system apps?
I sign all apps - only takes two secs so you might as well
The Following User Says Thank You to marcussmith2626 For This Useful Post: [ Click to Expand ]
 
marcussmith2626
Old
#6  
marcussmith2626's Avatar
Recognized Contributor - OP
Thanks Meter 2,399
Posts: 4,439
Join Date: Jul 2012
Location: London
Added drag2sign guide - see attachment in first post
 
sankoranga
Old
#7  
Senior Member
Thanks Meter 15
Posts: 108
Join Date: Aug 2012
error:unable to access jarfile C://windows//apktool.jar ???
 
marcussmith2626
Old
#8  
marcussmith2626's Avatar
Recognized Contributor - OP
Thanks Meter 2,399
Posts: 4,439
Join Date: Jul 2012
Location: London
Quote:
Originally Posted by sankoranga View Post
error:unable to access jarfile C://windows//apktool.jar ???
This guide assumes you have installed apktool correctly
download apktool and place the two files in c:\windows
you also need to install the java development tools
links at top of post

help on installing apktool correctly can be found on the apktool website
 
Renate NST
Old
#9  
Renate NST's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 804
Posts: 1,991
Join Date: Feb 2012
Location: Boston
With exactly what key does this sign?

I note from the above screenshot that it is a "Universal APK singer".
That means that it can sing in any key?

Even if there is some "universal key", this will break things using android:sharedUserId

 
pritesh1996
Old
#10  
pritesh1996's Avatar
Senior Member
Thanks Meter 9
Posts: 156
Join Date: Nov 2012
Location: surat,gujarat
Error!!

I decompile systemui.apk
Thn i change the value of android :background to #00000000
In status_bar.xml
N i change the quickpanal plamm background.
N status_bar background.9 in ldpi..
I m using galaxy y.
N ussrv6 rom
This systemui.apk is ussrv6's syatemui.apk...
N here it is my error...


ully_in_g declared here is not defined.

c:\newui\res\values\public.xml:83: error: Public symbol drawable/stat_sys_data_f

ully_in_h declared here is not defined.

c:\newui\res\values\public.xml:84: error: Public symbol drawable/stat_sys_data_f

ully_inandout_1x declared here is not defined.

c:\newui\res\values\public.xml:85: error: Public symbol drawable/stat_sys_data_f

ully_inandout_3g declared here is not defined.

c:\newui\res\values\public.xml:86: error: Public symbol drawable/stat_sys_data_f

ully_inandout_3g_plus declared here is not defined.

c:\newui\res\values\public.xml:87: error: Public symbol drawable/stat_sys_data_f

ully_inandout_4g declared here is not defined.

c:\newui\res\values\public.xml:88: error: Public symbol drawable/stat_sys_data_f

ully_inandout_e declared here is not defined.

c:\newui\res\values\public.xml:89: error: Public symbol drawable/stat_sys_data_f

ully_inandout_g declared here is not defined.

c:\newui\res\values\public.xml:90: error: Public symbol drawable/stat_sys_data_f

ully_inandout_h declared here is not defined.

c:\newui\res\values\public.xml:91: error: Public symbol drawable/stat_sys_data_f

ully_out_1x declared here is not defined.

c:\newui\res\values\public.xml:92: error: Public symbol drawable/stat_sys_data_f

ully_out_3g declared here is not defined.

c:\newui\res\values\public.xml:93: error: Public symbol drawable/stat_sys_data_f

ully_out_3g_plus declared here is not defined.

c:\newui\res\values\public.xml:94: error: Public symbol drawable/stat_sys_data_f

ully_out_4g declared here is not defined.

c:\newui\res\values\public.xml:95: error: Public symbol drawable/stat_sys_data_f

ully_out_e declared here is not defined.

c:\newui\res\values\public.xml:96: error: Public symbol drawable/stat_sys_data_f

ully_out_g declared here is not defined.

c:\newui\res\values\public.xml:97: error: Public symbol drawable/stat_sys_data_f

ully_out_h declared here is not defined.

c:\newui\res\values\public.xml:98: error: Public symbol drawable/stat_sys_data_i

n_1x declared here is not defined.

c:\newui\res\values\public.xml:99: error: Public symbol drawable/stat_sys_data_i

n_3g declared here is not defined.

c:\newui\res\values\public.xml:100: error: Public symbol drawable/stat_sys_data_

in_3g_plus declared here is not defined.

c:\newui\res\values\public.xml:101: error: Public symbol drawable/stat_sys_data_

in_4g declared here is not defined.

c:\newui\res\values\public.xml:102: error: Public symbol drawable/stat_sys_data_

in_e declared here is not defined.

c:\newui\res\values\public.xml:103: error: Public symbol drawable/stat_sys_data_

in_g declared here is not defined.

c:\newui\res\values\public.xml:104: error: Public symbol drawable/stat_sys_data_

in_h declared here is not defined.

c:\newui\res\values\public.xml:198: error: Public symbol drawable/stat_sys_data_

inadnout_e declared here is not defined.

c:\newui\res\values\public.xml:199: error: Public symbol drawable/stat_sys_data_

inadnout_h declared here is not defined.

c:\newui\res\values\public.xml:105: error: Public symbol drawable/stat_sys_data_

inandout_1x declared here is not defined.

c:\newui\res\values\public.xml:106: error: Public symbol drawable/stat_sys_data_

inandout_3g declared here is not defined.

c:\newui\res\values\public.xml:107: error: Public symbol drawable/stat_sys_data_

inandout_3g_plus declared here is not defined.

c:\newui\res\values\public.xml:108: error: Public symbol drawable/stat_sys_data_

inandout_4g declared here is not defined.

c:\newui\res\values\public.xml:109: error: Public symbol drawable/stat_sys_data_

inandout_e declared here is not defined.

c:\newui\res\values\public.xml:110: error: Public symbol drawable/stat_sys_data_

inandout_g declared here is not defined.

c:\newui\res\values\public.xml:111: error: Public symbol drawable/stat_sys_data_

inandout_h declared here is not defined.

c:\newui\res\values\public.xml:112: error: Public symbol drawable/stat_sys_data_

out_1x declared here is not defined.

c:\newui\res\values\public.xml:113: error: Public symbol drawable/stat_sys_data_

out_3g declared here is not defined.

c:\newui\res\values\public.xml:114: error: Public symbol drawable/stat_sys_data_

out_3g_plus declared here is not defined.

c:\newui\res\values\public.xml:115: error: Public symbol drawable/stat_sys_data_

out_4g declared here is not defined.

c:\newui\res\values\public.xml:116: error: Public symbol drawable/stat_sys_data_

out_e declared here is not defined.

c:\newui\res\values\public.xml:117: error: Public symbol drawable/stat_sys_data_

out_g declared here is not defined.

c:\newui\res\values\public.xml:118: error: Public symbol drawable/stat_sys_data_

out_h declared here is not defined.

c:\newui\res\values\public.xml:173: error: Public symbol drawable/stat_sys_data_

usb declared here is not defined.

c:\newui\res\values\public.xml:174: error: Public symbol drawable/stat_sys_data_

wimax_signal_0 declared here is not defined.

c:\newui\res\values\public.xml:175: error: Public symbol drawable/stat_sys_data_

wimax_signal_0_fully declared here is not defined.

c:\newui\res\values\public.xml:176: error: Public symbol drawable/stat_sys_data_

wimax_signal_1 declared here is not defined.

c:\newui\res\values\public.xml:177: error: Public symbol drawable/stat_sys_data_

wimax_signal_1_fully declared here is not defined.

c:\newui\res\values\public.xml:178: error: Public symbol drawable/stat_sys_data_

wimax_signal_2 declared here is not defined.

c:\newui\res\values\public.xml:179: error: Public symbol drawable/stat_sys_data_

wimax_signal_2_fully declared here is not defined.

c:\newui\res\values\public.xml:180: error: Public symbol drawable/stat_sys_data_

wimax_signal_3 declared here is not defined.

c:\newui\res\values\public.xml:181: error: Public symbol drawable/stat_sys_data_

wimax_signal_3_fully declared here is not defined.

c:\newui\res\values\public.xml:182: error: Public symbol drawable/stat_sys_data_

wimax_signal_disconnected declared here is not defined.

c:\newui\res\values\public.xml:183: error: Public symbol drawable/stat_sys_data_

wimax_signal_idle declared here is not defined.

c:\newui\res\values\public.xml:200: error: Public symbol drawable/stat_sys_downl

oad_anim0 declared here is not defined.

c:\newui\res\values\public.xml:201: error: Public symbol drawable/stat_sys_downl

oad_anim1 declared here is not defined.

c:\newui\res\values\public.xml:202: error: Public symbol drawable/stat_sys_downl

oad_anim2 declared here is not defined.

c:\newui\res\values\public.xml:203: error: Public symbol drawable/stat_sys_downl

oad_anim3 declared here is not defined.

c:\newui\res\values\public.xml:204: error: Public symbol drawable/stat_sys_downl

oad_anim4 declared here is not defined.

c:\newui\res\values\public.xml:205: error: Public symbol drawable/stat_sys_downl

oad_anim5 declared here is not defined.

c:\newui\res\values\public.xml:119: error: Public symbol drawable/stat_sys_gps_a

cquiring declared here is not defined.

c:\newui\res\values\public.xml:163: error: Public symbol drawable/stat_sys_gps_a

cquiring1 declared here is not defined.

c:\newui\res\values\public.xml:164: error: Public symbol drawable/stat_sys_gps_a

cquiring2 declared here is not defined.

c:\newui\res\values\public.xml:165: error: Public symbol drawable/stat_sys_gps_a

cquiring3 declared here is not defined.

c:\newui\res\values\public.xml:166: error: Public symbol drawable/stat_sys_gps_a

cquiring4 declared here is not defined.

c:\newui\res\values\public.xml:16: error: Public symbol drawable/stat_sys_gps_ac

quiring_anim declared here is not defined.

c:\newui\res\values\public.xml:167: error: Public symbol drawable/stat_sys_gps_o

n declared here is not defined.

c:\newui\res\values\public.xml:206: error: Public symbol drawable/stat_sys_heads

et declared here is not defined.

c:\newui\res\values\public.xml:120: error: Public symbol drawable/stat_sys_no_si

m declared here is not defined.

c:\newui\res\values\public.xml:207: error: Public symbol drawable/stat_sys_phone

_call declared here is not defined.

c:\newui\res\values\public.xml:208: error: Public symbol drawable/stat_sys_phone

_call_bluetooth declared here is not defined.

c:\newui\res\values\public.xml:209: error: Public symbol drawable/stat_sys_phone

_call_forward declared here is not defined.

c:\newui\res\values\public.xml:210: error: Public symbol drawable/stat_sys_phone

_call_on_hold declared here is not defined.

c:\newui\res\values\public.xml:121: error: Public symbol drawable/stat_sys_r_sig

nal_0 declared here is not defined.

c:\newui\res\values\public.xml:122: error: Public symbol drawable/stat_sys_r_sig

nal_0_fully declared here is not defined.

c:\newui\res\values\public.xml:123: error: Public symbol drawable/stat_sys_r_sig

nal_1 declared here is not defined.

c:\newui\res\values\public.xml:124: error: Public symbol drawable/stat_sys_r_sig

nal_1_fully declared here is not defined.

c:\newui\res\values\public.xml:125: error: Public symbol drawable/stat_sys_r_sig

nal_2 declared here is not defined.

c:\newui\res\values\public.xml:126: error: Public symbol drawable/stat_sys_r_sig

nal_2_fully declared here is not defined.

c:\newui\res\values\public.xml:127: error: Public symbol drawable/stat_sys_r_sig

nal_3 declared here is not defined.

c:\newui\res\values\public.xml:128: error: Public symbol drawable/stat_sys_r_sig

nal_3_fully declared here is not defined.

c:\newui\res\values\public.xml:129: error: Public symbol drawable/stat_sys_r_sig

nal_4 declared here is not defined.

c:\newui\res\values\public.xml:130: error: Public symbol drawable/stat_sys_r_sig

nal_4_fully declared here is not defined.

c:\newui\res\values\public.xml:131: error: Public symbol drawable/stat_sys_ringe

r_silent declared here is not defined.

c:\newui\res\values\public.xml:132: error: Public symbol drawable/stat_sys_ringe

r_vibrate declared here is not defined.

c:\newui\res\values\public.xml:133: error: Public symbol drawable/stat_sys_roami

ng_cdma_0 declared here is not defined.

c:\newui\res\values\public.xml:184: error: Public symbol drawable/stat_sys_roami

ng_cdma_0_fully declared here is not defined.

c:\newui\res\values\public.xml:17: error: Public symbol drawable/stat_sys_roamin

g_cdma_flash declared here is not defined.

c:\newui\res\values\public.xml:134: error: Public symbol drawable/stat_sys_roami

ng_cdma_flash_anim0 declared here is not defined.

c:\newui\res\values\public.xml:135: error: Public symbol drawable/stat_sys_roami

ng_cdma_flash_anim1 declared here is not defined.

c:\newui\res\values\public.xml:136: error: Public symbol drawable/stat_sys_signa

l_0 declared here is not defined.

c:\newui\res\values\public.xml:137: error: Public symbol drawable/stat_sys_signa

l_0_fully declared here is not defined.

c:\newui\res\values\public.xml:138: error: Public symbol drawable/stat_sys_signa

l_1 declared here is not defined.

c:\newui\res\values\public.xml:139: error: Public symbol drawable/stat_sys_signa

l_1_fully declared here is not defined.

c:\newui\res\values\public.xml:140: error: Public symbol drawable/stat_sys_signa

l_2 declared here is not defined.

c:\newui\res\values\public.xml:141: error: Public symbol drawable/stat_sys_signa

l_2_fully declared here is not defined.

c:\newui\res\values\public.xml:142: error: Public symbol drawable/stat_sys_signa

l_3 declared here is not defined.

c:\newui\res\values\public.xml:143: error: Public symbol drawable/stat_sys_signa

l_3_fully declared here is not defined.

c:\newui\res\values\public.xml:144: error: Public symbol drawable/stat_sys_signa

l_4 declared here is not defined.

c:\newui\res\values\public.xml:145: error: Public symbol drawable/stat_sys_signa

l_4_fully declared here is not defined.

c:\newui\res\values\public.xml:146: error: Public symbol drawable/stat_sys_signa

l_flightmode declared here is not defined.

c:\newui\res\values\public.xml:227: error: Public symbol drawable/stat_sys_signa

l_in declared here is not defined.

c:\newui\res\values\public.xml:228: error: Public symbol drawable/stat_sys_signa

l_inout declared here is not defined.

c:\newui\res\values\public.xml:185: error: Public symbol drawable/stat_sys_signa

l_min declared her
be happpy!!!

Tags
apk, apktool, compiling, decompiling, xml
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes