Question

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.

Was it helpful?

Solution

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.

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