[Samsung Galaxy S (4G Model)] xc-racer99:
Source Code, Downloads, Root Options

Main Source

https://android.googlesource.com/

Device Specific Source Code

http://github.com/xc-racer99/android_device_samsung_telusgalaxys4gmtd for the device tree (see aosp-7.x branch)

http://github.com/xc-racer99/android_device_samsung_aries-common for the common device tree (see aosp-7.x branch).

http://github.com/xc-racer99/android_kernel_samsung_aries for the kernel (see aosp-7.x branch)

http://github.com/xc-racer99/proprietary_vendor_samsung for the prop blobs (see aosp-7.x branch)

http://github.com/xc-racer99/android_patches for all the patches necessary for the device to work properly (see aosp-7.x branch)

Downloads!

All builds can be downloaded from AndroidFileHost at https://www.androidfilehost.com/?w=files&flid=58191

Gapps

The smallest http://opengapps.org/ package for 7.0 is known to work, but any small 7.0 gapps package should work. However, they will cause the device to slowdown significantly as they use a fair bit of RAM. Gapps are untested on 7.1

This ROM is compatible with MicroG (https://microg.org/ and http://xdaforums.com/android/apps-games/app-microg-gmscore-floss-play-services-t3217616) gapps. This is an open-source reimplementation of Google Play Services that doesn't track you and uses way less battery than the original.

Root

Root is achieved via Magisk or SuperSU.

MagiskDue to our odd partition layout, you need to use my custom Magisk install zip (source code here) attached to this post and not the official install or the Magisk Manager install. Then follow the instructions on how to root/install other modules from http://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445 Also, don't try to use the official Magisk uninstall tool as it won't work.

SuperSU

Please note: I've been told this doesn't work any more, YMMV

Again, we need a custom SuperSU install zip for it to work due to our partition scheme. It should be an all-in-one zip so it's simplier than Magisk (but not open source). This is based off of the latest (at time of writing) 2.79SR1 release, the diff is below

diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary
index d437f6f..3a312bf 100644
--- a/META-INF/com/google/android/update-binary
+++ b/META-INF/com/google/android/update-binary
@@ -642,16 +642,23 @@ detect_systemless_required() {
find_boot_image

CONTINUE=true
+if false ; then
if [ -z "$BOOTIMAGE" ]; then
# no boot image partition detected, abort
return
fi
+fi

# extract ramdisk from boot image
rm -rf /sutmp
mkdir /sutmp

+if false ; then
check_zero "" "" "" "LD_LIBRARY_PATH=$RAMDISKLIB $BIN/sukernel --bootimg-extract-ramdisk $BOOTIMAGE /sutmp/ramdisk.packed"
+else
+ mount /ramdisk
+ cp /ramdisk/ramdisk.img /sutmp/ramdisk.packed
+fi
check_zero "" "" "" "LD_LIBRARY_PATH=$RAMDISKLIB $BIN/sukernel --ungzip /sutmp/ramdisk.packed /sutmp/ramdisk"
if (! $CONTINUE); then return; fi

@@ -1331,6 +1338,8 @@ else
ui_print_always "Boot image patcher"
ui_print "******************"

+if false ; then
+ # SGS Modification - we don't have a "real" boot image
ui_print "- Finding boot image"
find_boot_image

@@ -1357,6 +1366,10 @@ else
fi

check_zero_def "- Extracting ramdisk" "LD_LIBRARY_PATH=$SYSTEMLIB /su/bin/sukernel --bootimg-extract-ramdisk $BOOTIMAGE /sutmp/ramdisk.packed"
+else
+ mount /ramdisk
+ cp /ramdisk/ramdisk.img /sutmp/ramdisk.packed
+fi
check_zero_def "- Decompressing ramdisk" "LD_LIBRARY_PATH=$SYSTEMLIB /su/bin/sukernel --ungzip /sutmp/ramdisk.packed /sutmp/ramdisk"

if ($CONTINUE); then
@@ -1545,6 +1558,7 @@ else
check_zero_def "- Calling user boot image patch script" "sh /data/custom_boot_image_patch.sh /sutmp/boot.img"
fi

+if false ; then
if ($CONTINUE); then
DEV=$(echo `resolve_link $BOOTIMAGE` | grep /dev/block/)
if [ $? -eq 0 ]; then
@@ -1564,6 +1578,10 @@ else

dd if=/sutmp/boot.img of=$BOOTIMAGE bs=4096
fi
+else
+ cp /sutmp/ramdisk.packed /ramdisk/ramdisk.img
+ umount /ramdisk
+fi

rm -rf /sutmp
fi