[ROM][AOSP] S4 Google Edition [SafeStrap]

Search This thread

jmsq

Senior Member
Jan 19, 2012
58
135
Sunnyvale
Hi all,

After discovering the terrible mistake I made buying an AT&T S4 with a non-unlockable bootloader, I looked for any way to run an AOSP/GPE rom on this phone with Safestrap. It looks like I've finally gotten it into a decent state for my personal use so I thought I'd share.

The ROM is based on [AOSP] Official 4.4.3 - S4 Google Edition - Final-R2.0 and nearly all of the credit goes to them for making a GPE rom that actually boots with our kernel. The only changes I've made are ripping out the kernel for safestrap, installing a wrapper script for the sdcard binary, and some post_boot init script additions to properly load the WiFi module. For wifi to work, you need your stock kernel's modules installed after the ROM, specifically dhd.ko, to /system/lib/modules.

If you'd like to enable Nexus-style software buttons and disable the hardware capacitive buttons, see this thread for instructions: http://xdaforums.com/showthread.php?t=2032117. You can disable the capacitive button lights with GravityBox.

Warning:
Do NOT take OTA updates with this rom. Doing so could break the rom, or in the worst case trip Knox, which would void your warranty. I'll do my best to update the rom to the latest version as soon as possible.

What works:
Internal/external storage
WiFi (may not come up every boot, a soft reboot usually fixes)
USB debugging
USB internet tethering
Paid apps from Play Store (see workaround below)
Chrome (see workaround below)
Google Earth (remove from /system/app and reinstall from Play store)
IPv6 APN (for compatible carriers such as T-Mobile)
Almost everything else

In progress:
WiFi Tethering (see: http://xdaforums.com/showpost.php?p=54878857&postcount=662)

What doesn't work:
USB MTP (due to kernel differences)

AT&T Install Instructions:
http://xdaforums.com/showthread.php?p=53758259

Verizon Install Instructions:
http://xdaforums.com/galaxy-s4-verizon/general/how-to-install-aosp-s4-google-edition-t2817708

Download:
4.4.3: https://drive.google.com/file/d/0ByCYkZozShp_bXFTdnpYSmxyZHM
4.4.3: https://www.dropbox.com/s/v59aak1j3fz1z35/gpe_443_safestrap.zip?dl=0 (Mirror)

Update:
4.4.4: https://drive.google.com/file/d/0ByCYkZozShp_bE02ZlJRQkgxTWM (requires 4.4.3)
4.4.4: https://www.dropbox.com/s/z57whcu44ypcx93/gpe_444_update.zip?dl=0 (Mirror)

Lollipop/5.0:
The 5.0.0 OTA for the real S4 GPE came out today, so I tried adapting it like the 4.4.4 update. Unfortunately and not surprisingly, it failed to boot. This probably means we need to wait for AT&T's 5.0 TW update to get a compatible kernel to make 5.0 GPE work :(

FAQ:
WiFi isn't working: Do a soft reset with the GravityBox Power Menu or the Xposed Installer.

USB Transfer not working: Use Airdroid, FTPServer, or adb push/pull.

Paid apps won't install: See workaround below.

Chrome force closes on new tab: See workaround below.

Paid Apps & Chrome Workaround:
Install SELinux Mode Changer and set SELinux to permissive.
 
Last edited:

netomel

Senior Member
Jun 19, 2012
709
160
East Elmhurst
Hi all,

After discovering the terrible mistake I made buying an AT&T S4 with a non-unlockable bootloader, I looked for any way to run an AOSP/GPE rom on this phone with Safestrap. It looks like I've finally gotten it into a decent state for my personal use so I thought I'd share.

The ROM is based on [AOSP] Official 4.4.2 - S4 Google Edition - Final-R1.2 and nearly all of the credit goes to them for making a GPE rom that actually boots with our kernel. The only changes I've made are ripping out the kernel for safestrap, installing a wrapper script for the sdcard binary, and some post_boot init script additions to properly load the WiFi module.

What works:
Internal/external storage
WiFi
Almost everything else

What doesn't work:
Chrome
USB MTP (debugging does work though)
Some apps fail to install from the Play store

I apologize that this is in the wrong category but I don't post often so I can't post to the dev section.

Download:
https://drive.google.com/file/d/0ByCYkZozShp_cXA2dW1naGtsR2s

You know more than I do. Is it really AOSP because devs here say it's imposible to flash any rom besides TW based roms on our phones due to the boot loader issue.

Sent from my SAMSUNG-SGH-I337 using XDA Premium 4 mobile app
 

DeadlySin9

Senior Member
Sep 2, 2012
1,475
703
Google Pixel 8 Pro
You know more than I do. Is it really AOSP because devs here say it's imposible to flash any rom besides TW based roms on our phones due to the boot loader issue.

Sent from my SAMSUNG-SGH-I337 using XDA Premium 4 mobile app

It's been known that GPE ROMs will boot on our stock kernel. It just never entirely worked right, with no Wi-Fi and USB and other issues. While on MF3 you could boot one, on MK2 you couldn't run 4.3 GPE however, and certain 4.4.2 GPE has "worked" with those issues. This is because they are built with a kernel close to stock. So basically, GPE's are an exception but require extra development that nobody really wanted to take on until now apparently.

Sent from my SGH-I337 running Light ROM
 
  • Like
Reactions: xXshur1kenXx

Thr33-F0ur

Senior Member
Oct 28, 2012
121
36
Baton Rouge
Boots us fine. Working well so far.
 

Attachments

  • Screenshot_2014-05-30-11-46-02.jpg
    Screenshot_2014-05-30-11-46-02.jpg
    71.1 KB · Views: 4,286
  • Screenshot_2014-05-30-11-45-32.jpg
    Screenshot_2014-05-30-11-45-32.jpg
    107.5 KB · Views: 4,142
  • Screenshot_2014-05-30-11-42-18.jpg
    Screenshot_2014-05-30-11-42-18.jpg
    154 KB · Views: 4,175
  • Screenshot_2014-05-30-11-41-42.jpg
    Screenshot_2014-05-30-11-41-42.jpg
    100.7 KB · Views: 4,162

Rhymey

Senior Member
Apr 20, 2014
136
25
Does this already have root, or should I flash SuperSU while I'm flashing this? Any issues with dirty flashing or should I do a nandroid backup and wipe?

Also, for anyone having WiFi issues, probably try flashing this: NC1 wifi modules. No idea on any fixes for MTP, which is unfortunate as I use MTP a lot
 

Thr33-F0ur

Senior Member
Oct 28, 2012
121
36
Baton Rouge
Does this already have root, or should I flash SuperSU while I'm flashing this? Any issues with dirty flashing or should I do a nandroid backup and wipe?

Also, for anyone having WiFi issues, probably try flashing this: NC1 wifi modules. No idea on any fixes for MTP, which is unfortunate as I use MTP a lot

You have to flash SuperSU. I haven't tried a dirty flash since I was coming from 4.3.
 

Rhymey

Senior Member
Apr 20, 2014
136
25
Posting to confirm that dirty flashing gives two errors - android.process.media FC and android.*.acore FC. Everything else seemed to work except for those. Flashed, but went back to PurifieD until stuff gets fixed up, primarily MTP. Good work so far though. I'd like to note I always had to flash the NC1 modules I posted earlier.
 
I've tested this and am very impressed..besides Eclipse this is the closest thing to ASOP experience S4 SS users will experience. Chrome doesn't work and there are a few other minor bugs,but those are small issues. Hopefully this will open up more development for ASOP and SS.

Great work! This should be added to the AT&T MK2 and NB1 thread
 

Rhymey

Senior Member
Apr 20, 2014
136
25
I've tested this and am very impressed..besides Eclipse this is the closest thing to ASOP experience S4 SS users will experience. Chrome doesn't work and there are a few other minor bugs,but those are small issues. Hopefully this will open up more development for ASOP and SS.

Great work! This should be added to the AT&T MK2 and NB1 thread

What other minor bugs, or is it just stuff in the OP? I'm going to [attempt] to bring this to a functional bugless version, so knowing what you found would be helpful
 

Asadullah

Senior Member
Aug 24, 2010
1,033
351
casselberry
What other minor bugs, or is it just stuff in the OP? I'm going to [attempt] to bring this to a functional bugless version, so knowing what you found would be helpful

I'm on cricket (at&t phone though) and the apns close the first one or two reboots but eventually work. I never got wifi to work but am going to try the nc1 modules out and see how they work. I noticed that the stock browser isn't in the rom? I'm not sure but I think it's only paid apps that aren't downloading. Gonna reflash shortly and find out.
 

Rhymey

Senior Member
Apr 20, 2014
136
25
I'm on cricket (at&t phone though) and the apns close the first one or two reboots but eventually work. I never got wifi to work but am going to try the nc1 modules out and see how they work. I noticed that the stock browser isn't in the rom? I'm not sure but I think it's only paid apps that aren't downloading. Gonna reflash shortly and find out.

Did you flash a cricket APN after? If not I'd assume that's why it was closing. I also read in the original ROM post if you're experiencing data drops to try flashing the 4.3 modem instead of the 4.4 one. Gonna have to test it out.
 

Asadullah

Senior Member
Aug 24, 2010
1,033
351
casselberry
Did you flash a cricket APN after? If not I'd assume that's why it was closing. I also read in the original ROM post if you're experiencing data drops to try flashing the 4.3 modem instead of the 4.4 one. Gonna have to test it out.

I just reflashed I was able to get the apn settings to work it was just having to reboot before hand. I'll give the 4.3 modem a shot a little later to see if that helps
On another note
I came from nb1 bootloader, rom etc flashing the nc1 modules didn't work for me (as expected but no link to nb1 modules).
Also if anyone wants to install the stock browser just delete browser proxy.apk and chrome from /system/app and push the aosp browser to /system/app give it read/write/execute permissions and reboot you'll be good to go.


EDIT:

I have wifi working just by copying dhd.ko and scsi_wait_scan.ko from /system/lib/modules from a stock nb1 rom to my sdcard and then copy them back to /system/lib/modules of the aosp rom
Google play definitely doesn't download paid apps. I think there may be a build.prop fix for this gonna see if I can find

also here is aio wireless apn settings
Code:
Name: Internet
APN: ndo
Proxy: Not Set
Port: Not Set
Username: Not Set
Password: Not Set
Server: Not Set
MMSC: http://mmsc.aiowireless.net
MMS Proxy: proxy.aiowireless.net
MMS Port: 80
MCC: 310
MNC: 150
Authentication type: Not Set
APN type: default,mms,fota,hipri,supl
 
Last edited:
  • Like
Reactions: adeptustech

issam1979

Senior Member
Jun 10, 2007
80
20
Detroit
vibration?

I flashed the ROM and I'm from nb1 too but on reboot the phone just vibrates every 2 seconds for a long time with a black screen and never boots to android, it's doing it while I'm writing this, what's going on? I can still access SS.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 64
    Hi all,

    After discovering the terrible mistake I made buying an AT&T S4 with a non-unlockable bootloader, I looked for any way to run an AOSP/GPE rom on this phone with Safestrap. It looks like I've finally gotten it into a decent state for my personal use so I thought I'd share.

    The ROM is based on [AOSP] Official 4.4.3 - S4 Google Edition - Final-R2.0 and nearly all of the credit goes to them for making a GPE rom that actually boots with our kernel. The only changes I've made are ripping out the kernel for safestrap, installing a wrapper script for the sdcard binary, and some post_boot init script additions to properly load the WiFi module. For wifi to work, you need your stock kernel's modules installed after the ROM, specifically dhd.ko, to /system/lib/modules.

    If you'd like to enable Nexus-style software buttons and disable the hardware capacitive buttons, see this thread for instructions: http://xdaforums.com/showthread.php?t=2032117. You can disable the capacitive button lights with GravityBox.

    Warning:
    Do NOT take OTA updates with this rom. Doing so could break the rom, or in the worst case trip Knox, which would void your warranty. I'll do my best to update the rom to the latest version as soon as possible.

    What works:
    Internal/external storage
    WiFi (may not come up every boot, a soft reboot usually fixes)
    USB debugging
    USB internet tethering
    Paid apps from Play Store (see workaround below)
    Chrome (see workaround below)
    Google Earth (remove from /system/app and reinstall from Play store)
    IPv6 APN (for compatible carriers such as T-Mobile)
    Almost everything else

    In progress:
    WiFi Tethering (see: http://xdaforums.com/showpost.php?p=54878857&postcount=662)

    What doesn't work:
    USB MTP (due to kernel differences)

    AT&T Install Instructions:
    http://xdaforums.com/showthread.php?p=53758259

    Verizon Install Instructions:
    http://xdaforums.com/galaxy-s4-verizon/general/how-to-install-aosp-s4-google-edition-t2817708

    Download:
    4.4.3: https://drive.google.com/file/d/0ByCYkZozShp_bXFTdnpYSmxyZHM
    4.4.3: https://www.dropbox.com/s/v59aak1j3fz1z35/gpe_443_safestrap.zip?dl=0 (Mirror)

    Update:
    4.4.4: https://drive.google.com/file/d/0ByCYkZozShp_bE02ZlJRQkgxTWM (requires 4.4.3)
    4.4.4: https://www.dropbox.com/s/z57whcu44ypcx93/gpe_444_update.zip?dl=0 (Mirror)

    Lollipop/5.0:
    The 5.0.0 OTA for the real S4 GPE came out today, so I tried adapting it like the 4.4.4 update. Unfortunately and not surprisingly, it failed to boot. This probably means we need to wait for AT&T's 5.0 TW update to get a compatible kernel to make 5.0 GPE work :(

    FAQ:
    WiFi isn't working: Do a soft reset with the GravityBox Power Menu or the Xposed Installer.

    USB Transfer not working: Use Airdroid, FTPServer, or adb push/pull.

    Paid apps won't install: See workaround below.

    Chrome force closes on new tab: See workaround below.

    Paid Apps & Chrome Workaround:
    Install SELinux Mode Changer and set SELinux to permissive.
    12
    The 'multi-step to normal' boot process is probably ok. The thing that I prefer not to live with (too much pain) is not having USB file xfer. That's a deal breaker for me, and there is no talk of anyone trying to fix this since the rom came out 6 weeks ago.

    You can get around the multi-boot process by turning off wifi or putting the phone into airplane mode before shutting down or rebooting.

    AOSP/GPE roms (like this one) and TW roms use a completely different device exposed by the kernel for usb transfer. This would be a quick fix if we could replace the kernel, but we can't. My attempts at getting samsung binaries to be a shim or symlinking kernel devices hasn't panned out.

    So this is the end of the road then? No one interested in trying to fix any of the issues/bugs/broken things and make this a clean load? Everyone here seems content with the pain.

    The remaining issues are not showstoppers for me personally. I've tried fixing them, but these last few issues are tricky to fix. Yes the issues are annoying, but it's better than using TW. There's only so much you can do with a locked kernel not designed for GPE.

    You're missing the point. In most other ROMS, there may be a 'Known Issues:' list on day-one, but the devs or others dig into the list over time to get the list to zero. Not happening here, no squeak (from any one other than me apparently), so no oil... everyone may be happy to just keep using the patches, I'm just saying it's unusual for an XDA rom.

    This is not most other ROMs. This is using a rom on a kernel that it wasn't meant to be used with, it's mostly a hack job. If you want a quick fix, get a phone with an unlocked bootloader, or use a touchwiz rom that the kernel was designed for. You're also welcome to take a look at the rom yourself and see if you can fix the remaining issues.
    11
    Last night I made some progress on wifi tethering. I now know the commands to make it work, but I haven't figured out an easy way to implement the fix for everyone yet.

    1. Toggle Wifi off.

    2.
    Code:
    # rmmod dhd; insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcmdhd_apsta.bin nvram_path=/system/etc/wifi/nvram_net.txt"

    3. Toggle Wifi AP on; it should now be broadcasting properly.

    4. When done, toggle Wifi AP off.

    5.
    Code:
    # rmmod dhd; insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcmdhd_sta.bin nvram_path=/system/etc/wifi/nvram_net.txt"

    6. Toggle Wifi on.
    7
    I don't know when the samsung gpe lollipop release will ship. As soon as the official gpe s4 build shows up from Samsung, then I'll look into making it work with safestrap.
    6
    Last night I made some progress on wifi tethering. I now know the commands to make it work, but I haven't figured out an easy way to implement the fix for everyone yet.

    1. Toggle Wifi off.

    2.
    Code:
    # rmmod dhd; insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcmdhd_apsta.bin nvram_path=/system/etc/wifi/nvram_net.txt"

    3. Toggle Wifi AP on; it should now be broadcasting properly.

    4. When done, toggle Wifi AP off.

    5.
    Code:
    # rmmod dhd; insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcmdhd_sta.bin nvram_path=/system/etc/wifi/nvram_net.txt"

    6. Toggle Wifi on.

    Thanks, confirmed working on my phone and it will be useful. I created a one line file for each command and pushed them to /system/bin for ease, but I don't know how you'd get it to run when AP is toggled.

    This is the same way I would toggle hotspot on and off when we had to downgrade to mk2 on vzw s4. An easy way to implement this for people would be to create a new toggle that calls that intent action. Or using/editing an apk to do this. Although deadlysin's method of having the files in system/bin shouldn't be tough for people to do.

    Another idea is it to create a conditional if then statement based script to determine when to turn off/on WiFi AP etc. I just wrote a rough idea of this in the form of a script. You can probably expand on this to accomplish what you are wanting to do.

    #!/system/bin/sh

    if [ ! -z "$(cat /proc/modules | grep 'dhd*')" ]; then
    echo "WiFi/AP already on"
    else
    insmod /system/lib/modules/dhd.ko
    fi

    Or I guess maybe in this particular case

    #!/system/bin/sh

    if [ ! -z "$(cat /proc/modules | grep 'dhd*')" ]; then
    echo "WiFi/AP already on"
    else
    insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcmdhd_sta.bin nvram_path=/system/etc/wifi/nvram_net.txt"
    fi