[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,052
London
im new at this and im getting an error at decompile SystemUI.apk

either you have not loaded the framework into apk using
if framework-res.apk

or you are using the wrong framework

remember that the framework-res.apk that comes with the rom may not always be the framework used to build parts of the rom

eg jellybean framework may have been used to build the systemui for a gingerbread rom
also most 3rd party apps are build with jellybean framework

so make sure you have loaded framework-res.apk into apktool and its the right one
 
D

Deleted member 5768396

Guest
grammar ftw.

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

^
translation?
 

TheFixItMan

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

^
translation?

as said

once compiled
unzip the orig apk and copy meta-inf and androidmanifest.xml to your decompiledapk/build/apk
then recopile again

or you can just resign the apk - if a cyanongenmod system app sign with a platform key
if installing as a user app you can sign with a test key
 

crash613

Senior Member
Mar 13, 2008
267
40
ok, maybe i am barking up the wrong tree, but would this tool help me with the following.

As we all know Facebook has updated to ver 14. Ver 14 requires a separate messaging app that a lot of people are complaining about. I have the apk for version 13. i can install it and i can use the built in messaging app. this is what i want.

however, it updates in the app store. I do not want it to. YES I KNOW I CAN DISABLE UPDATING FOR THE APP STORE but this disables it for ALL apps. I just want Facebook ONLY to not update.

i had a similar situation awhile back with another program. i did not like the direction the company took the app and wanted to keep an older version.

At that time, someone took the apk and decompiled it. they broke the signature and recompiled. I installed it. from that point forward it will not update. I want to do the same thing to version 13 of the Facebook app.

Is this the tool i would need? how would i go about doing this?

thanks.
 

billysam

Senior Member
Oct 3, 2014
551
302
A little too much

Well It looks like the last thing you suggested me for swipe function to run on gingerbread SGY has brought me to completely new platform and back to you.

The Apk multi tool, handling the SystemUI.apk, framework-res.apk and framework.jar files for me is like operating these patients in operating room of whose problems, I know nothing about.
The first requirement of the post that deals with the swipe function stated to decompile the SystemUI.apk by apk multi tool and decompile framework.jar with baskmali

can't both be decompile with same process? or I have to go through both?

it's like I had filled a form for being in the medical college for treatment, study and learn and I have been led to the surgery departments straight away!!

I ain't complaining though but
what else can I do with these? I have also ended up downloading samsung theme designer and want to test my hands on theming. will these help in building?

btw, I have just created a qmg animated file for SGY shutdown screen and it does work. my first. where could I post? I ain't pro, just beginning to learn and contributing to the community.
 

TheFixItMan

Senior Member
Jul 8, 2012
7,844
4,052
London
Well It looks like the last thing you suggested me for swipe function to run on gingerbread SGY has brought me to completely new platform and back to you.

The Apk multi tool, handling the SystemUI.apk, framework-res.apk and framework.jar files for me is like operating these patients in operating room of whose problems, I know nothing about.
The first requirement of the post that deals with the swipe function stated to decompile the SystemUI.apk by apk multi tool and decompile framework.jar with baskmali

can't both be decompile with same process? or I have to go through both?

it's like I had filled a form for being in the medical college for treatment, study and learn and I have been led to the surgery departments straight away!!

I ain't complaining though but
what else can I do with these? I have also ended up downloading samsung theme designer and want to test my hands on theming. will these help in building?

btw, I have just created a qmg animated file for SGY shutdown screen and it does work. my first. where could I post? I ain't pro, just beginning to learn and contributing to the community.


Apktool here uses backsmali to decompile the apk


You can decompile both apk and jar files using this tool

Just put
apktool d framework.jar WhereToDecompileTo

And to recompile put
apktool b NameOfDecompiledFolder newframework.jar

Rename the file back to the name of the original before putting in a flashable zip

Just as a note for the future if you want to decompile android.policy.jar rename it to policy.jar first as apktool doesn't like multiple dots in the name


You can put your boot animation in a flashable zip and post it in the themes section
 
Last edited:
  • Like
Reactions: billysam

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