Question

It exist a parser for the .smali files?
Let me be more explicative:
i need to code a program.
the input of this program is a .smali file.
this program ( thanks to the parser i'm looking for ) should catch every time a global variable is declarated.
next step add some code.
is that possible, or no parser yet exist for a similar task?
Thank you.

Was it helpful?

Solution

This is the parser that smali itself uses when reassembling the smali files.

https://github.com/JesusFreke/smali/blob/master/smali/src/main/antlr/smaliParser.g

Another option might be to use dexlib2 directly to read in a dex file, perform the modifications you want, and write it back out.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top