Running baksmali and smali on the device is the easy part (if you do not consider the low memory issue obviously). It is just a matter of converting the jar file into a Dalvik (Android Java virtual machine) executable file.
So basically bytecode to smali. This can be done with the dx utility...