[GUIDE] Porting Vibrant Roms To SGS4G
Porting Vibrant Roms To SGS4G
***EDITED FROM A GTALK WITH DR. HONK***
ALL CREDIT GOES TO DR. HONK FOR TEACHING ME AND FOR KRYLON360 FOR TEACHING DR. HONK!!!
THANKS FOR LETTING ME POST THIS AND FOR YOUR PATIENCE!!!
OK, Well CWM is now final and it's time to start PORTING!!!
***Most Vibrant roms are 2.2, so you will be downgrading your OS.
Also, if it's a i9k port, it might require more work. (button mapping, etc.)***
TOOLS
1. Install Android SDK
2. Download Smali.jar & baksmali.jar from
http://code.google.com/p/smali/
3. Both files will have version numbers on the end. take those off.
4. Place both files in /tools directory in sdk.
5. Download Beyond Compare.
6. Download 7 zip.
7. Download A FLASHABLE SGS4G ROM.
8. Download the Vibrant Rom you wish to Port.
9. Download Ammend2Edify (somewhere on XDA)
INSTRUCTIONS:
Note: To DECOMPILE (FROM /TOOLS) "java - jar baksmali.jar -o directory_out/ classes.dex" To COMPILE (FROM /TOOLS) "java -Xmx512M -jar smali.jar source_directory/ -o New_Classes.dex"
1.)Okay, so there are four files that need to be edited. They are framework.jar, services.jar, Settings.apk and android_policy.jar.
2.)Using 7-zip, you need to extract the classes.dex from each file mentioned, for both the rom you want to port and the flashable SGS4g Rom you are comparing it to. This has to be done, since the vibrant and sgs4g have totally swapped partitions.
3.)Extract one at a time. Place classes.dex into /tools, Decompile to directory_out. ( i.e, if using KD1 flashable and extracting framework.jar, then name directory_out KD1_framework)
4.)Once you have extracted & decompiled the classes.dex from each of the four files, Open Beyond Compare.
5.)Load the two directoies you want to compare and hit the compare button. select binary.
6.)Look for anything with storage information. Either STORAGE info .. or anything for /sdcard. Here's the problem ... internal storage and external storage. those are swapped.
7.) you replace that part .. and only that part.
Example:
on framework.jar .. you want to look at Android\os\Environment.smali
everything there need to be swapped, from /mnt/sdcard to /mnt/sd/external_sd
and vice versa
Same goes with Landroid/os/Environment;->INTERNAL_STORAGE_DIRECTORY .. that needs to be Landroid/os/Environment;->EXTERNAL_STORAGE_DIRECTORY
8.)You will see a lot of differences .. ignore any line differences. ALL YOU NEED IS STORAGE. :)
9.)There might not be differences in every file, depending on the rom to be ported with the exception of settings.apk. USB Mounting will not work if not edited properly!
10.)Once edited, go back into command prompt and compile. the new_classes.dex will appear in the /tools category.
11.)Open the Vibrant Rom in 7 zip and go back to the location of the classes.dex file you extracted. delete it and copy over the new_classes.dex. rename it to classes.dex. you'll get a prompt from 7 zip that the archive has changed. accept to update the archive.
12.)Repeat this proces for each classes.dex edited.
so that's the jar and apk files!
WI-FI:
1.)You will need to copy over /system/etc/wifi from sgs4g ROM to the new port ROM.
2.)Then you also need to copy several files ... /system/bin/wpa*../system/bin/wifi* ../system/bin/*ril* .. /system/lib/*ril*
3.)Then you also need to copy over /system/etc/vold*
CHANGING THE MODEM & KERNEL.
1.)Open the Vibrant Rom in 7 Zip and Delete ZImage(kernel) and Modem.bin
2.)Open the SGS4G Rom and Copy over Modem.bin & Zimage.
3.)Thank Krylon360 for catching my brain farts.
AMMEND2EDIFY:
Most Roms you'll find for the vibrant are using ammend scripting. Download the Program & the updated phone database for it from XDA and follow the OP instructions to get it set up.
That's it!

FLASH AWAY!!!
ALL CREDIT GOES TO DR. HONK FOR TEACHING ME AND FOR KRYLON360 FOR TEACHING DR. HONK!!!
THANKS FOR LETTING ME POST THIS AND FOR YOUR PATIENCE!!!