Taken from: http://iaudiophile.net/forums/showthread.php?t=27464
Disclaimer: The following text and images are for illustrative purposes, and following the instructions therein will be at your own risk.
After 2 years of heavy use and abuse, My D2 was finally giving up. The battery was getting hotter during use with each passing day, and one day, I noticed that one corner of the D2's back was bulging out, pushing the rear case open by a few millimetres. this gap grew larger over the course of the next few days, and although the D2 was soldiering on like a Champ, without complaint, I thought it would be wise to leave it be, until i found out what the Issue was. A Quick look in these forums confirmed that it was battery leakage, and looking for spare batteries gave me the option of mailing the D2 to Korea@the cost of about $80, or Going the DIY way.
Someone on Anythingbutipod had already done the homework - a thread about replacement batteries mentioned the Nokia BP-4L battery pack, which seemed to be a perfect fit for the D2's battery area. Luckily, I own a Nokia Eseries E63, which uses the same battery. I tried to fit the Nokia battery in the D2, after opening it up, and it fit like a glove.
This is the state my battery was found in, swelling up from one corner. the copper foil felt like there was some liquid behind...thankfully, the package was intact, and there was no spillage onto the D2's innards.
Next step was to buy a BP-4L battery, which cost me the equivalent of $46. Some Knockoffs can be had for as low as $18, but Genuine Nokia Batteries are VERY reliable, last long and not leak, swell, or explode. The BP-4L is particularly expensive, because it is found in the ESeries and some NSeries phones, that represent the top-end line of Nokia. Nonetheless, the battery is indeed the _best_ phone battery out there. I then had to remove the wiring from the D2's battery using a Soldering Iron. The Leads were then soldered onto the Contacts of the Nokia Battery, and sealed with a drop of Epoxy. Note that the contacts are Very small, and your regular Soldering Iron will not do. You need to use one with a very fine tip, commonly used for Cellphone and electronics repair. Do not use any liquid/Rosin/wax for the solder, as it might penetrate the battery and cause problems.
The battery was then seated into the back cover. The default battery pack is wider, but just as thick and long as the Nokia BP-4L. this leaves a gap on both sides, but the back cover has some sort of double-sided tape stuck on it to keep the original battery in place, and the replacement battery will usually catch on to that. Otherwise, you could use the sort of double-sided tape used by photo-framers, which is very thin and holds well.
The Acid test was to test the charging, and it worked fine! I used the OEM Battery from my 3-month old E63, and gave the phone a new Battery (less Risk, i guessed)
This battery was at about 80% charge and it showed up as 3 bars on the battery indicator.
The Casing now closes up completely, without any gaps or cracks.
Project finished! The Player is functioning normally as I type this, and the overheating I mentioned is absent. Next Step will be to benchmark battery performance.
Notes-The BP-4L is a 3.7V, 1500 mAh battery, 100 mAh less than the OEM battery. this will obviously mean a lower playback time, but as everybody knows, all batteries lose capacity over time, affecting playback time. So this hack might not give you the much-vaunted 52 hour playback time, but something like 48-50 hours, which is still great. Moreover, Nokia Batteries go through stringent quality control, and they often do more than what it says on the box. Some websites are selling 1800 mAh replacement batteries for the D2, but they seem to be sourced from someplace like Shenzhen, home of the KIRF... so i'd trust a 1500 mAh Genuine Nokia Battery over some dubious 1800 mAh battery anyday. Just my Two cents.