Reputation: 234
I downloaded the source code of Android SDK and modified the class android.widget.TextView.
Now, I am trying to figure out how I can replace the actual TextView running on my device with the modified one.
I found that the compiled classes reside in /system/framework on my phone.
Any pointers on how I can replace the appropriate jar & odex file?
Note: I also read in google groups that modifying bits-n-pieces of android will not work, we need to build entire source code.
Upvotes: 2
Views: 5550
Reputation: 23528
I also read in google groups that modifying bits-n-pieces of android will not work, we need to build entire source code.
You don't have to rebuild the entire system if you just want to change a few lines here and there. Basically you need the phone where you can pull (and push!!) files with adb
, and apktool
or smali
, depending on what are you planning to change, resources or code.
In case of resources (localization, translation):
Pull the framework-res.jar from the phone, use apktool if framework-res.jar
to make it default framework for your future manipulations. You have to pull and import framework every time you use new phone or new version of Android.
Pull the file you want to change.
Use apktool d
to decompile the file.
Make the changes you need.
Use apktool b
to compile new file.
Zip and sign.
Push new file to the phone.
In case you want to change code, use framework.jar
instead of framework-res.jar
and smali/backsmali
for compilation/decompilation of .dex
files.
Also, it's always a good idea to make backup copies of the files you are about to change in case when something goes wrong.
Upvotes: 5