0

This could be a rather crazy question, but I wanted to get some insight on it before I spend all the time trying it.

Is it possible to rebuild framework.jar (like say pulling the framework.jar from MIUI), decompile it to smali and then rebuilt it from scratch (via reading through and remaking it yourself into java)?

I planned on doing that + taking the similar files from Cyanogen mod as a reference to build off of. The reason I was interested in doing all this was because I have a phone that needs the Radio Interface Layer more or less rebuilt and it's just become too much of a hassle to deal with editing the smali directly and debugging it.

I figured I would ask here because people would be less quick to rush to judgment on whether it was possible or not. I don't see why it wouldnt work if you are adding everything correctly (in theory) and rebuilt the classes.dex file in the source after.

Main reason I am asking is part of an effort to port MIUI to my phone. I figured the lesser of too headaches was rewriting the java and rebuilding a working framework.jar (which has parts in it that are not in the CM7 or AOSP sources) than editing the framework.jar that comes with MIUI to work correctly.

yarly
  • 7
  • 1
  • 5

1 Answers1

1

While there are various ways to decompile a dex file back into java, none of them will produce java that is perfectly compilable. You would have to spend tons of effort cleaning up the java code from a decompiler, to get it to compile. It's pretty much not an option for something as big as that.

Your best bet is to get something like AOSP or CM working on your phone, so that you can build the framework yourself directly, with whatever modifications you need.

JesusFreke
  • 19,784
  • 5
  • 65
  • 68
  • CM7 is already out for my phone (unofficially). I was just working on the effort to port MIUI to it, which happens to have some libraries and modifications in the framework.jar that are not in CM7. I figured I could reverse the MIUI and add it into the framework related packages on CM7 and rebuild it to work for MIUI. – yarly Oct 07 '11 at 22:06
  • Heh. That's precisely why I don't care for custom roms who don't release their source :). I assume you've done a diff of the framework between MIUI and CM? You might be able to get away with doing a decompilation on the files that are related to the specific features that you want to port or something – JesusFreke Oct 07 '11 at 22:23
  • Ah yeah, I did do that and was just going to try to work out the changes with that. I appriciate your quick reply and I've seen out around on IRC on freenode in #smali so I'm glad you noticed my question and took the time to reply. Thanks! – yarly Oct 07 '11 at 22:45