You don't need to extract anything-. Android is open source. WOOT!
Complete source code: AOSP homepage
Are you working with a specific device? If so check the manufacturers website. Most manufacturers provide the customized source code for their devices. Samsung and HTC release code for nearly all their devices, Sony does for some, Motorola probably does too. It's definitely available for Nexus devices.
XDA really is your best resource though. Learning some of the lingo will help you search. What you want to do is 'brew' your own custom rom.