yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy S (4G Model)] xc-racer99:
Thanks Time!

Thanks Time!

This would not have been possible without the following people:

Thanks to humberos for bringing Lollipop to the first-gen Galaxy S series. This would not have been possible without his work.

Thanks to FB and Dao for their work on the CM-11 device tree. I used several of their fixes.

Thanks to noiphonehere for his device trees and kernel, most of my work was based off of his.

Thanks to the OMAP4 AOSP team for their work on porting CMA to a 3.0 kernel.

Thanks to bhundven and the other members of teamacid for their work on the aries kernel.

Thanks to all others that have helped get this phone to where it is today!

Thanks to vcmerritt. A name you're probably not familiar with, but he was the only one to create something for the T959P and without him I'd still be on stock...

Build your own!

Follow https://source.android.com/source/initializing.html. The branch you want when you run repo init is the latest tag from https://source.android.com/source/build-numbers.html#source-code-tags-and-builds for your desired android version (7.0 or 7.1). Before you run repo sync, from the WORKING_DIRECTORY/.repo folder, run "git clone https://github.com/xc-racer99/local_manifests -b BRANCH" where BRANCH is either aosp-7.0 or aosp-7.1. Continue on with the build guide, the device codename you want is "galaxys4gmtd".

If you want to build the kernel, follow the instructions in WORKING_DIRECTORY/kernel/samsung/aries/AOSP_README. Put the resulting arch/arm/boot/zImage in device/samsung/galaxys4gmtd-kernel

Other aries devices (captivate, i9000, i9000B, vibrant) should be fairly easy to do (ie the galaxysmtd on my github as well as the captivate trees work). The fascinate and p1 would need a fair bit of work.

Changelogs

Changelog for 2016-12-19

December security patches

goes back to the older graphics drivers so hardware recording works but has a kernel patch to prevent crashes

Tweaked the graphics drivers options so it seems a little bit faster

Tweaked the RIL a little bit for better stability

Other things I've forgotten about, see github for details

Changelog for 2016-12-19-V2

Kernel without slowdowns....

Changelog for 2017-1-19

selinux to enforcing - this may break the T959V's GPS - if it does, let me know and send me a dmesg and I'll fix it

Update to the interactive governor - should have less slowdowns if using the default governor

Slightly better RIL reliability (I think)

Better low memory killing - we now don't run out of memory as often

Hardware decoding re-enabled

Slightly less intensive background services

Based on 7.1.1_r13
[Samsung Galaxy S (4G Model)] pickandrew:
Link for the download ROM is not working... it is private... ?!?
[Samsung Galaxy S (4G Model)] Shaggy_thecat:
Here is the link to the rom that is not private https://www.androidfilehost.com/?w=files&flid=58191
[Samsung Galaxy S (4G Model)] xc-racer99:
Thanks, I used the link that I would use if I was already logged in, my bad. OP is now updated.
[Samsung Galaxy S (4G Model)] graycow9:
It's been a while, no home internet and very busy life lately :P but the time I did get The 7.0 zip to flash (0930) it was running very well, no random reboots and limited freezes (just 1 really)

BUT. I always reinstall a new ROM to get the process down and- I haven't been able to get it running again. Let alone with root which I haven't managed to do. When I install the ROM now it gives me a quick first boot however it says encryption unsuccessful and asks me to reset. Resetting and factory resetting as well as formatting won't help it.

Excellent work ^_^ you're becoming the new SGS4G guru around here :D

As for a new setting in the dev options, labeled Consistent Logging-- if I turn this on is it A: Safe in terms of information vulnerability and B: Will it fill up my SD card quickly with a mass amount of logging data?
[Samsung Galaxy S (4G Model)] xc-racer99:
Hmm, flash the ROM, go into recovery, change the filesystem of /data to ext4 or f2fs. The error sounds as if the sdcard is formatted as fat while it shouldn't be. If that doesn't work, please send me the contents of /sdcard/aries_mtd.log after you've installed it.

Hadn't noticed the new "persistent logging" section. I suspect that what it does it keep the logcat contents over a reboot. Since the logcat does have a max size, it is probably safe to enable it. I highly doubt it contains any more info than a regular logcat.
[Samsung Galaxy S (4G Model)] Domunus:
Thanks for keeping this device alive in this community! My kids wanted to use it for simple games so I dusted it off and came here to see if anything was still in development and sure enough there was!

I tested going from BML stock and it worked! I had to restart the install 5 times, but it ultimately took. The first two times installed TWRP, then it rebooted into TWRP. Then it took 3 additional times before it went through the whole install. It booted up fine, but I had messed up and forgot to do a full reset before install gapps. So it would boot the encryption screen telling me it was interrupted and I had to reset the phone. Unfortunately at that point no matter what I did it would always boot to that encryption error screen. So I wiped completed and started over but mistakenly flashed the 7.1 build. It went through but was stuck on a boot loop. So now i can't install 7.0 because it keeps telling me it can't install over newer builds. Is there anything I can do to fix this or do i have to start from stock all over again?

Edited* Update

I went ahead and started from scratch but still ran in to the same problem with the encryption. Didn't install gapps this time.
[Samsung Galaxy S (4G Model)] xc-racer99:
Ok, sounds like a messed up somewhere. I'll do some testing and try to release an updated build. Could you please post the output of /sdcard/aries_bml.log and /sdcard/aries_mtd.log? The "Encryption Unsuccessful" message sounds as if the SD wasn't properly formatted to ext4/f2fs.
[Samsung Galaxy S (4G Model)] Domunus:
Hi xc-racerr99, I found what the issue was. Apparently I had an extra partition on the sdcard. After removing it and running the install script again everything booted up and i'm now using the ROM! It's awesome I have Nougat on this old Galaxy S. Without Gapps it's been running really stable and very responsive..

However, at this point, I've tried opengapps pico and TKgapps pico and neither work. The script runs and says update completed, but it's too fast. When I boot to the ROM no gapps were installed. Is there another gapps you would recommend trying?
[Samsung Galaxy S (4G Model)] xc-racer99:
Odd, I thought my install script removed the extra partition.

Anyways, it sounds as if there's some issue with recovery. You could try replacing the ramdisk-recovery.img in the ROM zip you downloaded with the one from https://www.androidfilehost.com/?fid=457095661767105384. Then reboot to recovery and flash your gapps package again.

Doesn't work....

I'll try to do some more testing with gapps and from stock with 1 or 2 partitions when I get a chance.
[Samsung Galaxy S (4G Model)] graycow9:
I figured out a sure fire way to boot 7.0, I'm running it as I respond with XDA app right now. But to keep it short if possible, I just fix permissions then factory wipe before I run the zip- do this while on CWM right after you heimdall to BML.

So to recap:

1- Flash to stock via heimdall

2- Fix permissions + factory wipe

3- Flash 7.0 zip

4- TWRP should boot- so flash ROM once more - wipe caches

5- Reboot and chew some nougat :)

Will follow up with a log next time I try to get the 7.1 rolling. ?

Oh! And when I add my email (hotmail) I get a bad handshake everytime. Do I need gapps to sync my contacts? O.o
[Samsung Galaxy S (4G Model)] xc-racer99:
Yeah, I get a bad handshake as well. Only happens with hotmail/oulook accounts, my gmail and my other email work just fine.

I figured out what was causing the issues with install from BML - on TWRP boot, it wasn't setting up the sdcard properly. I've now fixed it so that it should work regardless (in the next build, obviously).
[Samsung Galaxy S (4G Model)] Domunus:
Gave this a try and still no luck.

Update **

It actually killed the recovery. Recovery just keeps crashing and rebooting when trying to get in to it. Tried it from the a clean install and same results. Will wait for your next build. Thanks for putting time in to this!
[Samsung Galaxy S (4G Model)] graycow9:
Odd, it lets me add my gmail but only syncs my emails- no option for contacts still. I ought to keep a vcf from my other device jic.

The performance is even better than M and it doesn't have the weird battery glitch anymore ?? (I think the new partition layout helped a lot.)

Another thing I noticed, sometimes my SIM won't register or gives me a no signal indicator. I can't get root still either[emoji14]still poking around. Looking forward to the next build ?

Edit: Another bug I noticed is the inability to save files through the browser or Tumblr app for example.

(By the way, just wanted to add, I hope I'm still being more help than a nag or something. I aim to be helpful. So I look for things that seem astray. Heh)
[Samsung Galaxy S (4G Model)] xc-racer99:
I've never used the contact sync.

With SIM not registering, it's because Google introduced a bug and the workaround the bug causes the SIM to occasionally not work. One of the problems with legacy devices I guess.

With the files not saving, manually grant the storage permission in Settings->Apps - it doesn't seem to automatically update for most apps.

With root, sounds like I should modify the SuperSU install zip as it's easier to use (but not open-source). For the PHH Superuser, you need

1) The Magisk-7-SGS.zip from my thread.

2) The phh-superuser-r259.zip from the Magisk root thread (link in OP)

3) The PHH Superuser app from the Play Store or FDroid

Even then, it only works for certain apps as it doesn't mount anything to /system/xbin/su which is what some apps look for

Edit: And I have no issues if you keep posting here with the problems you find, it's good to know.
[Samsung Galaxy S (4G Model)] asmalldharma:
bootloop :(

just tried to flash this 7.1 rom from your omnirom 6.0. Seemed to flash ok as described. couldn't get pico opengapps to flash but ignored it. Now it's stuck in a bootloop and I can't get into recovery using hardware buttons. Any guidance as to how I should proceed? As a relative novice, can I push a new recovery through ADB and try again?
[Samsung Galaxy S (4G Model)] xc-racer99:
Well, it depends on where you are bootlooping. If you're stuck at either of the first two splash screens, then you're out of luck with ADB as it isn't available yet. If you're bootlooping but getting to the bootanimation, then you can. To do so, run

$ adb root
$ adb shell mkdir /data/ramdisk
$ adb shell mount /dev/block/mtdblock5 /data/ramdisk
$ adb push ramdisk-recovery.img /data/ramdisk
$ adb reboot recovery

where ramdisk-recovery.img is from the AOSP 7.0 zip.

If you're stuck at the first or second splash screens, then you need Odin or Heimdall. With heimdall, you can do

$ heimdall flash --KERNEL boot.img

where the boot.img is the one from Omni 6.0, the one from 7.x won't work on its own as the recovery is not stored in it. You can use Odin to go back to stock.

I haven't tried gapps so I guess I should sometime and see what the issue with them is.
[Samsung Galaxy S (4G Model)] asmalldharma:
Gets to the second splash screen. I'll give that a shot when i have some free time. I'm really looking forward to getting this working as I'm amused by the idea of my oldest android phone running the newest OS before my other two. :D

Update: couldn't get it to work with my cheap laptop. Kept throwing up the libusb 12 error. Then when i finally gave up and pulled the battery, I noticed it was starting to bulge a little. I think I'm out for a while. I'm hoping i can come back to this soon.
[Samsung Galaxy S (4G Model)] echow2001:
When I try to flash it stops early on saying "this package is for galazys4gmtd devices: this is a SGH-T959V" I am on your MM rom which I flashed after flashing to stock GB CWM kernel. My SDCard is 1gb fat32 and 7gb ext4(approx) Do I need a new bootloader that has a different device name or do I just change the update script to force it to install. Thanks.
[Samsung Galaxy S (4G Model)] xc-racer99:
Yeah, just modify the updater-script. Was this the 7.1 build? I think there were some conflicts with the patch that allows different device names to work. If you install from the 7.0 build it does work...

I should upload a new build sometime for both 7.1 and 7.0. 7.1 seems (at least to me) to crash more frequently. The main thing stopping me is slow internet...
[Samsung Galaxy S (4G Model)] echow2001:
I modified the update script and now it exits with error 6. Same config as before, I will try your 7.0 build tomorrow. Thanks for all your great work, I am just messing with this phone for fun, not important at all. Its amazing to see a device this old still being able to do all this.
[Samsung Galaxy S (4G Model)] graycow9:
I agree, I figured out a complicated process to get 7.1 to boot- and even when I did it was slower. The 7.0 even appears to have high graphics turned on (colorful status bars in apps etc.) and is smoother. O.o I also didn't manage to get my data to work in any way on 7.1 :P
[Samsung Galaxy S (4G Model)] xc-racer99:
New 7.0 Build Uploaded!

Ok, it's been so long since my last 7.0 build that I don't recall what's changed. The most important things are that install from BML should in theory work now and the recovery is fully working. OpenGapps (smallest size only) has been confirmed working. Other things are new security patches in the kernel, video recording should work, and some minor changes to RIL.

No new 7.1 build as it just doesn't work quite as well IMO with all the graphics crashes.
[Samsung Galaxy S (4G Model)] robonxt:
There's something wrong with the recovery .img that is in the folder, every time I flash it, the phone gets bootloop and it never gets to the android logo. Also when I try flashing the 7.1 .zip file, it also gets stuck in a bootloop. I have reverted to stock and reflashed 6 and then 7.1. Strangely 7.0 works just fine. Is there a mistake that I am making?
[Samsung Galaxy S (4G Model)] xc-racer99:
How are you trying to flash the ramdisk-recovery.img? It should not be flashed in the typical sense, but should be copied to ramdisk-recovery ie in recovery run the adb commands

adb shell mount /ramdisk-recovery
adb push ramdisk-recovery.img /ramdisk-recovery

Odd that 7.1 doesn't work, maybe the build I uploaded was a bit of a bad apple as multiple people have reported issues with it. I know it's more of a test build than anything else. I'll put a warning in the OP.
[Samsung Galaxy S (4G Model)] graycow9:
7.0 new build here :) BEAUTIFUL. No new issues here so far!

Tip: When you reboot the ROM often letting it settle will allow data to load.
[Samsung Galaxy S (4G Model)] Domunus:
The new 7.0 build is working great! Reflashed with it and installed Opengapps 7.0 pico and it installed. Slight lag with the gapps, but still the smoothest ROM run on this thing so far. Will see how it performs over the next several days. Great job and thanks again.
[Samsung Galaxy S (4G Model)] xc-racer99:
New 7.1 Build Uploaded!

Release Notes for 2016-11-11

Big thing here is that I've stopped the PVR (aka graphics) crashes that so far had plagued 7.1 by using the Galaxy Nexus's graphics blobs. Unfortunately, that breaks hw video decoding (encoding still works). Highly recommended to only install this one overtop of the 7.0 build as it won't overwrite the recovery unless you're coming from a non-7.x MTD rom. Installing from BML probably won't work properly. You shouldn't need to make any modifications to the updater-script to get it to flash.
[Samsung Galaxy S (4G Model)] kripget:
My t959v was on omni 6.0, but suddenly the home button stopped working so i decided to flash aosp 7.0 then gapps pico 7.0 then magisk.zip. flashed successfully but i dont have root and my phone's really slow, can't boot to recovery or download mode since i guess my phone doesn't have root privileges. How can i work around this? And my network signal occasionally stops working. Help me please. Thanks in advance!
[Samsung Galaxy S (4G Model)] xc-racer99:
Hmm, the home button not working is surprising - I'd have guessed more of a hardware issue than a software issue (but a software issue is possible).

In order to get root, you need to flash the Magisk-v7-SGS.zip from this thread, the Superuser-r259.zip (or whatever it actually is) from the Magisk root thread, and then install Phh's Superuser app (complex, I know).

However, root shouldn't be necessary to reboot to download or recovery mode. If you have ADB setup (there are many tutorials on this, both on XDA and elsewhere), then you can do "adb reboot recovery". Unfortunately, "adb reboot download" is broken. However, you should still be able to get into download mode with some of the methods from http://xdaforums.com/wiki/Samsung_Galaxy_S/SGH-T959V/Download_Mode - I've managed to get into download mode when I've accidently wiped everything...

With the network signal stopping to work, what is the baseband version (go to Settings, About Phone) on your phone? If it's T959PTLKH2, then I've managed to get the T959P modem.bin onto your phone. Flash one from http://xdaforums.com/showthread.php?t=1192436 Otherwise, can you be more specific by what you mean by "stops working" - does an error message come up, calls drop, or just show no service?

Thanks and good luck.
[Samsung Galaxy S (4G Model)] kripget:
Thanks for the solution that might work on my phone, I'll try it snd let you know the outcome. For the network signal, suddenly no network appears on my stat bar

---------- Post added at 10:54 AM ---------- Previous post was at 10:38 AM ----------

Baseband version btw is T959VUVKJ6

---------- Post added at 10:59 AM ---------- Previous post was at 10:54 AM ----------

Do you suggest flashing back to stock rom via odin to fix problem with network signal? Will it work? Thanks btw! I was able to boot to download mode with the link you posted. I've seen that before though, i just forgot. I'm so forgetful.

---------- Post added at 11:01 AM ---------- Previous post was at 10:59 AM ----------

What can i do with my phone being so laggy? Is there a script that i can flash or a trick i can input via terminal emulator?

---------- Post added at 11:02 AM ---------- Previous post was at 11:01 AM ----------

Oh haven't told you yet! Good job on aosp 7.0! It's really nice that i can upgrade this very old phone of mine
[Samsung Galaxy S (4G Model)] xc-racer99:
Ok, thanks for the info. That baseband info is the one it should be. I suspect that the network signal issue is related to the ROM (I messed with a bunch of RIL code) and not your phone so a reset to stock should fix it. You can then install whatever ROM you want but this one will likely still not be working correctly. You could try flashing https://www.androidfilehost.com/?fid=529152257862677557 as a potential fix, don't know if it will do anything:fingers-crossed: - it does add a few fixes that the last build didn't have.

With the lag, I suspect it's gapps related. I've tested this on and off with gapps and, even with only one or two apps installed, the installation with gapps is much slower than without. I find the lag quite tolerable without gapps (and this is my main phone). I can't think of any "magic bullet" to make gapps not use as much RAM as they do (~30MB on average which is 7% of our total RAM)
[Samsung Galaxy S (4G Model)] kripget:
Thanks so much gor your efforts to enhance the capabilities of this phone but i guess it's already at it's limits so I'll just stick to the stock rom or lower os versions to make it work properly... Thank a lot!
[Samsung Galaxy S (4G Model)] xc-racer99:
New 7.1 Build Uploaded!

Alright, it's been a bit. Here's a new build

Changelog for 2016-12-19

December security patches

goes back to the older graphics drivers so hardware recording works but has a kernel patch to prevent crashes

Tweaked the graphics drivers options so it seems a little bit faster

Tweaked the RIL a little bit for better stability

Other things I've forgotten about, see github for details

I use this is a daily driver and haven't noticed any bugs save that my Outlook/Hotmail email doesn't work, but YMMV.

Edit: Download link pulled/renamed - the kernel I included with it isn't the best and has numerous slowdowns. It will still work but will be laggy. I'll try to upload a new build later today.

Edit2: 2016-12-19-V2 is now uploaded. Changelog: Kernel without slowdowns....
[Samsung Galaxy S (4G Model)] cpkelley94:
Wow, I cannot believe that this phone is still being developed after all these years. I'll dust off my old SGS4G when I get home and throw this on. Amazing, thanks.
[Samsung Galaxy S (4G Model)] sllyname:
Hi I have flashed a t959p with your omni 6.0.1 rom and then because it seemed to not connect to the telus network, I flashed a CM11 rom from another thread. It has replace the baseband with T959VUVKJ6.

Do you know which modem blob is correct for the telus version? All of the ones from the modem collection seem to have only the T959V string in them. I have just loaded your new build of 12-19, I kind of think the omni build was faster.

Thanks for the effort on this, mark
[Samsung Galaxy S (4G Model)] xc-racer99:
Wow, another T959P user! :)

There is only one modem (that I know of) that will give you access to the 850Mhz band that Telus uses. If you download the 7.1 zip, the "modem.bin.telusgalaxys4gmtd" inside of it is the correct one - the version string should be T959PTLKH2. To flash it, replace the modem.bin inside one of the T959V's zip with this one. Alternatively, remove the file /radio/modem.bin and flash my 7.1 zip. Or, if you have adb setup, just run:

adb push modem.bin.telusgalaxys4gmtd /radio/modem.bin

and then reboot your phone.

It may also be possible to use the ones from http://xdaforums.com/showthread.php?t=1869159 (designed for the Infuse 4G) as they can use ours but I haven't tested. They would likely have access to the correct bands as it supports the same as the T959P.
[Samsung Galaxy S (4G Model)] robonxt:
Thanks for the new update! I still use this phone as a testing bed for apps and stuff.
[Samsung Galaxy S (4G Model)] xc-racer99:
New Build Uploaded!

Changelog for 2017-1-19

selinux to enforcing - this may break the T959V's GPS - if it does, let me know and send me a dmesg and I'll fix it

Update to the interactive governor - should have less slowdowns if using the default governor

Slightly better RIL reliability (I think)

Better low memory killing - we now don't run out of memory as often

Hardware decoding re-enabled

Slightly less intensive background services
[Samsung Galaxy S (4G Model)] slaithe:
HI, I'm running TWRP v2.6.3.0 and I see no option to create/manage/delete multiple partitions on my SD card.

Attempts to flash with 7.1 ROM meet only with repeated failure.

Thank you.
[Samsung Galaxy S (4G Model)] xc-racer99:
Can you please post the output of the attempted flash, both what appears on screen as well as /sdcard/aries_mtd.log? I'm afraid I haven't tested any older versions of TWRP and don't want to have to dig up a build.

It will fail the first time you try to flash it if you have multiple partitions - flash again (without rebooting) it should theoretically work (and will wipe your SD card in its entirety).
[Samsung Galaxy S (4G Model)] slaithe:
I flashed back to unofficial Cyogenmod 11, for now. Is there a way I can update my TWRP version? I don't see my exact model (SGH-T959V) on the TWRP website.

Maybe after updating TWRP the flash would work fine.

The closest match I find is the Fascinate.

https://twrp.me/devices/samsungefascinate.html
[Samsung Galaxy S (4G Model)] xc-racer99:
For the first-gen Galaxy S devices (such as the T959V), the recovery is bundled inside the kernel, so the only way is to update ROM/kernel.

The TWRP/CWM version shouldn't matter, in theory.
[Samsung Galaxy S (4G Model)] slaithe:
I'm cool with that. Got any kernal recommendations? Just use TWRP to install it, right?