Skip to content

smalidea

Ben Gruver edited this page Apr 1, 2015 · 20 revisions

smalidea is a smali language plugin for IntelliJ IDEA/Android Studio

It is currently in "alpha" release, and is in active development.

##Features ###Current Features

  • Syntax Highlighting/Syntax Errors
  • Bytecode level debugging
    • Breakpoints
    • Instruction level single stepping
    • Adding watches for arbitrary (non-named) registers
    • Full java-style expression support in locals window, etc. while debugging
  • Find Usages
  • Renaming
  • Referencing smali classes from java code (except it can't actually be compiled, yet)

###Planned Features

  • Auto-complete (instruction names, class/method/field references, etc.)
  • Compile support for smali-only projects
  • Robust error detection (e.g. full bytecode verification)

###Potential Features

  • Compile support for mixed smali+java projects
  • "Introduce new register" intention
  • Expose register type analysis data
    • Show the expected type of a register at any point
    • Find locations where the register's value could have been set

Installation

  1. Download the latest smalidea zip file from the Bitbucket download page
  2. In IDEA/AS, go to Settings->Plugins and click the "Install plugin from disk" button, selecting the downloading smalidea zip file
  3. Click "Apply" and restart IDEA/AS
  4. ???
  5. Profit!

Debugging an application

Note: Single-instruction stepping is only supported in IDEA 14.1 and greater, and any future version of Android Studio based on IDEA 14.1 or greater. In earlier versions, attempting to single step will step to the next .line directive, instead of stepping to the next instruction.

  1. Manually disassemble an application using baksmali into some directory
  2. In IDEA, import a new project, and select the directory containing the smali files
  3. Use the "Create project from existing sources" option when importing the project
  4. Once the project has been created, open a smali file and place a breakpoint
  5. Install/start the application on the device
  6. Run ddms, and select the application's process
  7. In IDEA, Create a new "Remote" debug configuration (Run->Edit Configurations), and change the debug port to 8700
  8. Run->Debug
  9. The application should pause if/when the breakpoint is hit, at which point you can single step, add watches, etc.

Clone this wiki locally