1. Are you ready for the Galaxy S20? Here is everything we know so far!

[Tutorial] How to edit smali files

Discussion in 'Android Devices' started by nuttmeg, Aug 21, 2012.

  1. nuttmeg

    nuttmeg Extreme Android User
    Thread Starter

    Posting what i found, Thanks goes to Yorzua over @ XDA: http://forum.xda-developers.com/showthread.php?t=1052731

    Thought this would make a semi good tut for anyone that wants to try and learn what smali is and how to create one.

    Tools needed :

    This is an example of a smali file changed (in this case, Global.Actions.smali located in android.policy.jar)

    _______________ Power Menu modded (smali changed) ______________


    Open my zip kit ( recomended in a Theming Folder for example with apkmanager and all files you would like to mod )

    What you get :
    • Baksmali
    • Baksmali ( executable Jar File )
    • Command.exe ( Shell file )
    • Notepad text with the two commands for decompile and compile already made for you ( just copy and paste into command.exe )
    • Smali
    • Smali ( executable Jar File )

    1. So the only thing you need is to place your apk in the smali kit folder

    2. To Decompile :

    java -jar baksmali.jar -x yourfile -o classout
    (classout folder can be renamed to whatever you want, doesnt matter until you dont forget to change the name too in the second command)

    3. Make the modifications you want for smali files

    4. To Compile again :

    java -Xmx512M -jar smali.jar classout -o classes.dex

    5. Copy and paste the file classes.dex into your apk _ you will overwrite the old one.

    Thanks to Rafalense

    1. If you follow my Tuto, you should always use apk manager 4.9 editing framework as you want to mod xml __ even better with XP rather than any windows else.
    2. Apk manager is not needed to decompile/recompile png's
    3. you just forget zip and use instead 7zip which allow you to directly drag any file you want to another zip without decompiling/compiling.
    4. Another rule is that you cant drag a xml from a zip to your hdd folder.
      you must decompile the apk first. if the xml is already modded, then you can drag it everywhere and re-drag it where you want.
    5. Never set framework-res as 1.apk
      apk manager does everything for you, you just need to decompile,
      set always level of compression to 0 in order to avoid issues during compilation work on the framework folder decompiled and just compile.
    6. If you proceed step by step, you should be fine.
    7. Note that systemUI.apk gives a lot of issues during decompilation
      Smali files are included in systemUI so better use my tool for smali's files
    8. Last one, i will prepare a tuto to take out the title in Power menu soon

    1. Download the Forums for Android™ app!


  2. Fuzzy13

    Fuzzy13 Extreme Android User

    This is awesome. Looking at the word smali makes me twitch though. Ish looks like some unidentified language.

    I would love if someone could port the ics power menu. Hint hint
    nuttmeg likes this.
  3. nuttmeg

    nuttmeg Extreme Android User
    Thread Starter

    I'd tinker with it around 3 am and got mad as hell and grab a cigar, you think messing with xml was a headache, this is horrible. ahahaha
  4. ShinySide

    ShinySide Extreme Android User

    That would be an understatment. Ahaha
    nuttmeg likes this.
  5. nuttmeg

    nuttmeg Extreme Android User
    Thread Starter

    i had to watch myself for a minute there when i had posted that, that smali had me HOT. lmao
  6. ShinySide

    ShinySide Extreme Android User

    I posted about samli once..Looked something like this when I hit post: **** ** ******* ****** *** ***** **** ******** ****** * *** * *****!!!!!!!!!!!!!!!!! :D

LG Esteem Forum

The LG Esteem release date was October 2011. Features and Specs include a 4.3" inch screen, 5MP camera, 512GB RAM, Snapdragon S2 processor, and 1500mAh battery.

October 2011
Release Date

Share This Page