Tool

smali/baksmali

Assembler and disassembler for the dex format used by Android's Dalvik VM: baksmali turns dex, APK, odex and oat files into smali text, and smali assembles that text back into a dex file. The README says the syntax, loosely based on Jasmin's and dedexer's, supports the full dex format, including annotations and debug and line information. baksmali can also deodex odex and oat files and list a dex file's classes, methods, fields, strings and references, while the dexlib2 library reads and writes dex files from Java.

Targets
App
Category
Android tools
Relationship
Foundation tool
Sources reviewed

Requirements & limits

  • GitHub lists the repository as archived; its last push was on 2024-01-17, and the reviewed master head of 2022-03-08 is ten commits past v2.5.2, the last version, published as org.smali artifacts on Maven Central on 2021-03-03. The README still points downloads to the author's Bitbucket page. Google maintains a fork whose README says it exists because the original is not maintained; it renames the namespace to com.android.tools.smali and publishes 3.x releases (3.0.7 at review) on Google Maven.
  • Java command-line tools and libraries compiled for Java 8 and built with the bundled Gradle 6.8.2 wrapper; scripts/smali and scripts/baksmali are launcher wrappers for the jars. Users supply their own dex, APK, odex or oat files and can set the API level; analyzing or deodexing optimized files needs a matching boot classpath, which for oat files can be the device's boot.oat. dexlib2's version map at this commit stops at dex 039 (API 28) and maps newer ART versions to API 29, so files from later Android releases were not checked.
  • The repository includes small test-fixture dex files under baksmali/src/test/resources and dexlib2/src/test/resources, hand-written smali examples, and deodexerant, a device-side C helper built in an AOSP tree that dumps Dalvik's inline method table for baksmali's -T option. No other dex, APK or system images are committed.
  • There is no LICENSE file, so GitHub detects none; NOTICE releases Ben Gruver's code and Google-copyrighted changes under BSD-style three-clause licenses and says portions taken from the Android Open Source Project are used under Apache-2.0. No file was assembled or disassembled.

About this entry

The description was reviewed against primary sources. This does not establish runtime testing, security auditing or verified compatibility.

Report an outdated entry Suggest a translation fix

Primary sources

  1. README.md GitHub · JesusFreke/smali · Revision 2771eae
  2. NOTICE GitHub · JesusFreke/smali · Revision 2771eae
  3. build.gradle#L34 GitHub · JesusFreke/smali · Revision 2771eae
  4. build.gradle#L88-L91 GitHub · JesusFreke/smali · Revision 2771eae
  5. gradle/wrapper/gradle-wrapper.properties GitHub · JesusFreke/smali · Revision 2771eae
  6. baksmali/src/main/java/org/jf/baksmali/DisassembleCommand.java GitHub · JesusFreke/smali · Revision 2771eae
  7. baksmali/src/main/java/org/jf/baksmali/DeodexCommand.java GitHub · JesusFreke/smali · Revision 2771eae
  8. baksmali/src/main/java/org/jf/baksmali/AnalysisArguments.java#L54-L74 GitHub · JesusFreke/smali · Revision 2771eae
  9. smali/src/main/java/org/jf/smali/AssembleCommand.java GitHub · JesusFreke/smali · Revision 2771eae
  10. dexlib2/src/main/java/org/jf/dexlib2/VersionMap.java GitHub · JesusFreke/smali · Revision 2771eae
  11. deodexerant/README GitHub · JesusFreke/smali · Revision 2771eae
  12. baksmali/src/test/resources GitHub · JesusFreke/smali · Revision 2771eae
  13. https://github.com/JesusFreke/smali/compare/v2.5.2...2771eae0a11f07bd892732232e6ee4e32437230d
  14. https://repo1.maven.org/maven2/org/smali/baksmali/2.5.2/
  15. README.md GitHub · google/smali · Revision 1a36aa3

More in Apps

All 136 entries in Apps