How to root or unroot Samsung galaxy Ace S5830

The Samsung Galaxy Ace is an Android v2.3 Gingerbread smartphone featuring a 3.5 inch capactive touchscreen. The Ace S5830 is powered by a 800 MHz ARM11 processor, with an additional Adreno 200 GPUfor handling graphic intensive apps.
It supports 3G HSDPA connectivity at 7.2 mbps, WiFi, USB and Kies PC Sync data transfer options. This Android phone lets you stay connected via multiple mobile social networking platforms including Facebook, Twitter, Gtalk and Myspace. Benefits of rooting are know to many users. ;)
Before trying this I want to tell you that I have not tried this..... So be careful else your phone would be nothing more useful than brick. The Android blog will not be responsible for any damages. Your warranty will be void.
To root Samsung Galaxy ACE, first you need to install Android Gingerbread 2.3.5 or 2.3.6 on your phone if you are still running on Android Froyo.

Steps to Root

1. Connect your phone via USB to PC. Use Samsung Kies (you can download this software from samsung website) on PC to download and install Android gingerbread update on your smartphone. It would take 2 hrs almost.

2. Take backup of all your phone data on SD card, contacts, messages using Kies.

3. You need to at least charge your phone to 60%.

4. You also need to enable USB Debugging on your phone. This can be enabled by heading to Settings > Applications > Development > USB Debugging.

5. Close apps on your computer such as antivirus software, Samsung Kies PC Suite, and firewall software.

6. Download the root package from - http://adf.ly/AmlD5

7. Copy the downloaded ZIP file to your phone’s SD card root.

8, Switch off your phone. Then press home and power button together to go into recovery mode.

9. From here, choose “Install zip from SD Card” and “Choose Zip (“upd_1.zip”) from SD” using the Volume Up and Volume Down key and the press home button to select it.

10. Install will start and In 5-10 mins root process will finish. Once the rooting process is done, select reboot using volume up and down keys to reboot your phone.

11. Browse the apps in phone now and you will find "superuser" app. It proves rooting is done.

Same way to Unroot phone, download zip from here - http://adf.ly/AmlJM and follow the steps from 7-10.

Happy Rooting!