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

Search This thread

TheFixItMan

Senior Member
Jul 8, 2012
7,844
4,051
London
[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

1placefiles.png

place SystemUI.apk and Framework-res.apk from your rom zip or phone to c:\
(note you may also need twframework-res.apk)


2cmd.png

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



3cd.png

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



4framework.png

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)


5decompile.png

Type - apktool d c:\SystemUI.apk c:\newui
Press enter


6newfolder.png

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


7compiling.png

Type - apktool b c:\newui c:\newSystemUI.apk
Press enter
It will now build


8newapk.png

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




9sign.png

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

  • drag2sign.zip
    11.4 KB · Views: 1,018
Last edited:

TheFixItMan

Senior Member
Jul 8, 2012
7,844
4,051
London
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
 

pritesh1996

Senior Member
Nov 19, 2012
201
16
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
 

TheFixItMan

Senior Member
Jul 8, 2012
7,844
4,051
London
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...
decompile and recompile without making any changing - if it recompiles it is your changes causing the error
if it doesnt recompile then you need to load the correct framework and twframwork into apk tool

why are you changing the background to #00000000?
I assume you are trying to make it transparent - that is not the way to do it - I have a guide to making it transparent in the theme section and link is at the bottom of this guide in op and also in my sig below this post
 
Last edited:

puli112

Senior Member
Aug 2, 2013
119
60
31
vijayawada
OnePlus 7T
Google Pixel 6 Pro
decompile and recompile without making any changing - if it recompiles it is your changes causing the error
if it doesnt recompile then you need to load the correct framework and twframwork into apk tool

why are you changing the background to #00000000?
I assume you are trying to make it transparent - that is not the way to do it - I have a guide to making it transparent in the theme section and link is at the bottom of this guide in op and also in my sig below this post

i got this error while decompiling systemui.apk from my rom zip................. please help i am new to this
apktool is able o compile other apk but i have problem nly with systemui.apk
 

Attachments

  • log.txt
    1.4 KB · Views: 11

TheFixItMan

Senior Member
Jul 8, 2012
7,844
4,051
London
i got this error while decompiling systemui.apk from my rom zip................. please help i am new to this
apktool is able o compile other apk but i have problem nly with systemui.apk

are you using evo-x4?
if so you need to use the ics framework

download the ics framework from http://d-h.st/QAp
load it into apktool using the if command
you should then be able to decompile evo-x4 apks without error
 
  • Like
Reactions: puli112

TheFixItMan

Senior Member
Jul 8, 2012
7,844
4,051
London
decompiled sucessfully
but got error while compiling..... just edited res\layout]status_bar.xml

unzip the orig SystemUI.apk using winrar/winzip (change the .apk to .zip then unzip)
copy AndroidManifest.xml and META-INF

paste that file and folder in the build folder in your decompiled folder


it will compile as long as the changes you made have no errors
 

puli112

Senior Member
Aug 2, 2013
119
60
31
vijayawada
OnePlus 7T
Google Pixel 6 Pro
unzip the orig SystemUI.apk using winrar/winzip (change the .apk to .zip then unzip)
copy AndroidManifest.xml and META-INF

paste that file and folder in the build folder in your decompiled folder


it will compile as long as the changes you made have no errors

tried doing th same.............. but same result even when no changes are done..........
i using the systemi of cyanocream 3
 

Attachments

  • SystemUI.apk
    652.5 KB · Views: 6

TheFixItMan

Senior Member
Jul 8, 2012
7,844
4,051
London
tried doing th same.............. but same result even when no changes are done..........
i using the systemi of cyanocream 3

ah ok - I dont know what framework that uses and that is a banned rom - you will have to work out what framework was used in order to decompile and recompile

edit
iv just decompiled and recompiled it and it wont recompile because the framework I gave you is ics so the sdk versions different - you need to find out what framework was used to make that systemui.apk
you can try cm7 cm9 and cm10 frameworks-res.apk - you just need to find the right one
 
Last edited:
  • Like
Reactions: puli112

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    [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

    1placefiles.png

    place SystemUI.apk and Framework-res.apk from your rom zip or phone to c:\
    (note you may also need twframework-res.apk)


    2cmd.png

    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



    3cd.png

    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



    4framework.png

    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)


    5decompile.png

    Type - apktool d c:\SystemUI.apk c:\newui
    Press enter


    6newfolder.png

    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


    7compiling.png

    Type - apktool b c:\newui c:\newSystemUI.apk
    Press enter
    It will now build


    8newapk.png

    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




    9sign.png

    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
    1
    do we need to sign system apps?

    I sign all apps - only takes two secs so you might as well
    1
    i got this error while decompiling systemui.apk from my rom zip................. please help i am new to this
    apktool is able o compile other apk but i have problem nly with systemui.apk

    are you using evo-x4?
    if so you need to use the ics framework

    download the ics framework from http://d-h.st/QAp
    load it into apktool using the if command
    you should then be able to decompile evo-x4 apks without error
    1
    tried doing th same.............. but same result even when no changes are done..........
    i using the systemi of cyanocream 3

    ah ok - I dont know what framework that uses and that is a banned rom - you will have to work out what framework was used in order to decompile and recompile

    edit
    iv just decompiled and recompiled it and it wont recompile because the framework I gave you is ics so the sdk versions different - you need to find out what framework was used to make that systemui.apk
    you can try cm7 cm9 and cm10 frameworks-res.apk - you just need to find the right one