Home » Android » Remove unwanted packages from downloaded android source before build

Remove unwanted packages from downloaded android source before build

Posted by: admin June 15, 2020 Leave a comment


I have downloaded Android 4.0.1_r1 source code to my local system. I’m working to understand building own custom Android ROM and modify it according to my requirements.

I went through a number of web based tutorials on how to build custom ROMs for Android and I am clear with the overall process. What I’m essentially looking for is a well defined structured way of removing packages that are downloaded along with the source code but not needed for my own version of the build.

Additionally, it would be helpful if someone can provide me links pointing to building android source (guides,books or tutorials) as most of the available resources are based on creating Android APPs using Android SDK and the application framework. Its difficult to find any decent indepth tutorial explaining the entire architecture , source tree and different build guidelines for platform level developers.

How to&Answers:

This is a good book, but it’s not officially out yet (you can get the first few chapters only).

There is no real documentation, but if you hang out with CyanogenMod forums/IRC long enough you can get some insights. You can also ask questions on the official Google Groups, android-porting and android-platform should be helpful. Reading XDA can be helpful too, if you can filter out all the noise.

Generally, the whole thing is quite complicated, and there are parts that are device specific. The only thing that you can remove more or less safely without modifying things (much) are the bundled user-level apps (Calculator, etc). Even some of those may provide some system-level services, so you should watch out.

In short, buy the book, read the groups and ask more specific questions, like ‘how do I modify X in order to do Y. I tried Z and it didn’t quite work.


In addition to the answer, this is the closest I got to find a suitable information for modifying packages in the source code before building. It also has a decent information for memory optimization.


For removing packages please refer to the section
Run Time-Volatile Memory Customization
subsection – Customizing Android Product Package

The article pertains to Froyo , but the concepts are pretty much the same Android 4 ICS.

I have added this for anyone seeking reference material on the same.