1

I'm trying to modify framework.jar. My purpose is to modify the contents of SQLiteDatabase.java inside this jar. I've googled this quite a lot, and found that the way is to edit the .smali file and repackage and pushing the updated jar to the system. But the source of .smali seems to be hard enough to edit (as it's assembly code), so I was wondering if there's any other workaround to avoid this, and edit the Java source instead and then pushing it to the device. I'd really appreciate some help, thanks.

gaurav jain
  • 3,119
  • 3
  • 31
  • 48
  • 1
    As SQLiteDatabase.java is part of the Android platform, I'm afraid that there is no other way to do this than download and modify the Android source code. When you have made your changes you have to build Android yourself and flash it to a device – 0xDEADC0DE Jan 15 '16 at 10:01

1 Answers1

1

One possible hybrid approach might be to download a version of AOSP as close to what's used on your device as possible, make the changes you want to SQLiteDatabase.java in the AOSP source, and then build a framework.jar from AOSP, disassemble it with baksmali, and then copy over the SQLiteDatabase.smali from the AOSP build to your device-specific framework.jar.

There's one other kink you should be aware of - If your device is pre-odexed/pre-oated, then you'll need to deodex the entire framework and all pre-odexed/pre-oated apps, because modifying framework.jar will invalidate any existing oat/odex file.

JesusFreke
  • 19,784
  • 5
  • 65
  • 68