Sunday, February 20, 2011

smali syntax highlighting for notepad++

update 10/8/2013:
thanks to Ádám Tóth for creating a dark themed version. i've linked to it next to the main version.

update: 11/10/2011:
thanks to Jho for pointing out how to get code folding to work. i updated the syntax file and made a few other tweaks. the link and picture have been updated and here are the instructions for installing (tested with v5.9.6.1):
View -> User-Defined Dialogue...

Click Import

Select smali_npp.xml
       no picture here, use imagination

There will be a message box that says "Import successful."
Any new files you open should have syntax highlighting.

several people have asked for smali highlighting for notepad++. thanks to furrelkt for having already sent me an example. here's what i've come up with:
for dark backgrounds, try this:

there are many limitations for notepad++'s user defined language. i could not get many tokens to highlight correctly, or as well as ultraedit or the highlighter used on this blog. perhaps a full lexer plugin could handle it. if you write one or make improvements to this xml, let me know.


  1. Thank you so much for this!!!

    This is sure to be an absolute blessing on my tired eyes when spending all day digging through smali code now.

    Cheers, =)

  2. U are just an asshole u know? just little crapy asshole. your blog sucks, you suck and all your life sucks too. people like me work many days to leave from android apps and what do you? hey asshole, think about your lifetime

  3. @Anonymous: i'd like to help, but i am not sure what the problem is.

  4. Lohan check your email please.

  5. Thank you!

    Here a highlighting file for Vim

  6. ah very good jon! do you mind if i make a post linking to this? i have been working on my own, but yours is more fleshed out. we even named several things exactly the same. the only thing i could think to add is code folding (ex: '.method' -> '.end method')

  7. This comment has been removed by the author.

  8. @Anonymous:

    Not everyone uses this information to "crack" apps. In fact, most I know use it to tweak and customize system files.

    Install instructions please? I can't seem to get Notepad++ to actually use this file. I've tried import style theme, i've tried copying the file into the notepad++ folder along with the other themes, everything... I just CANNOT get it to actually use it.

  9. aelfwyne, i do not actually use (or like) notepad++. have you tried moving userDefineLang.xml to %APPDATA%\Notepad++\ ? this intolerably weird handling of highlighting is just one of the reasons i don't care much for it.

  10. doesn't work for notepad++ 5
    (notepad++ 5 hangs out )

  11. If you add these lines:

    <Keywords name="Folder+">.method .annotation</Keywords>
    <Keywords name="Folder-">.end\ method .end\ annotation</Keywords>

    and remove all the keywords found here (.method, .annotation, etc) from the other lists, then code block collapsing works

  12. thanks Jho. everything updated and much appreciated.

  13. Still does not work on Notepad++... Import gives no errors but there is NO hiliting at all. Why is it so difficult to actually make something that works?

  14. @Anonymous:
    1) i have no idea what "hiliting" is. is it a sport? is it good or bad that there is none of it?

    2) if it does not work, then i'm very, very curious as to how i was able to get those screen shots. what a mystery, indeed!!

    3) your last question seems to be more of a philosophical / personal crisis that i can't help you with.

    i'd be more helpful if you didn't come off sounding like an ass.

  15. is there any way to remove ads from apk file ?
    Thanks !

  16. Notepad++ highlighting doesn't work after "\"" in a smali file. Maybe it thinks everything thereafter is a string. Can we avoid it ?

    1. 1. Run Notepad
      2. Import user defined language from this topic
      3. Language > Define your language..
      4. Select Smali
      5. Operators
      5. Delimeters 2 > Escape
      6. Write \
      7. Close.
      8. Sucess

    2. Thanks. It worked.

    3. Thank Youu :)

  17. Well, for me it works perfect! Thanks! :)

  18. I've modified your highlight to create a highlight that works better with dark themes..
    you can change to a dark theme in Settings\Style Configurator...

  19. thank you for sharing this!

  20. When I click on view in notepad++ there is no "user defined dialog" option to select. Do I need to enable something in Notepad++ for this option to show?

    1. Its updated. Go to language> define you own
      there click import
      then go to language> user defined
      and its done

  21. holeee shit, thanks for this. Where was this my entire life dude


Do NOT post about or link to specific apps!