I want to modify the byte code of ".dex" file in text format, and then assemble the text to dex file again. Have to make sure the final ".apk" is usable.
I want to know some tools rather than make an assembler all by myself.
smali/baksmali is exactly what you want.