SlimRoms Nougat on the Samsung Galaxy S4!

c774d6876b42e5a01b482e16834b62e5
To God be the glory, my Slim7 Nougat project finally works!

This is a very slimmed down version of Android Nougat, almost a “vanilla” experience with a few tasteful perks! By design, this ROM comes without root for those who wish to have a “pure” version without the entanglements that come with root, but it can also be easily rooted by using chainfire’s SuperSU (see below). In it’s default form, it is perfect for those banking apps, workplaces, and games that require you to have a phone without root. No need for tricks or hacks, all while having the latest and greatest Android on your Samsung Galaxy S4.

If you do decide to use root, then you will be pleasently surprised to know that Substratum and layering works with this ROM. While not every part gets updated, for the most part it functions quite well in my initial testing.

**** This is an UNOFFICIAL ROM. Install at your own risk! ****

Main Features:

-Merged with android-7.1.1_r13
-SlimDim, now with 100% more dimming
-SlimAction, Splits screen action
-SlimRecents, an alternative recents
-Notification log (longpress statusbar header)
-Kill app from notification (long pres app notification)
-Substratum support (if rooted)
-OmniSwitcher built in so the kill function works with or without root.

Be sure to grab it from my Homemade roms page, or jump on XDA here:
https://forum.xda-developers.com/galaxy-s4-tmobile/development/rom-slimroms-n-t3540474

You will also need SuperSU if you want it rooted.
SuperSU:
https://download.chainfire.eu/1001/S%E2%80%A6perSU-v2.78-20
OR
http://www.mediafire.com/file/xzqu7dgmk7ob5e7/UPDATE-SuperSU-v2.78-20160905010000.zip

And you can download my kernel from the Homemade Kernel page, or grab it off of XDA:
https://forum.xda-developers.com/galaxy-s4-tmobile/development/kernel-nougat-kernels-t3492592

!!!FIRST BOOT TAKES LONGER THAN 5 EARTH MINUTES TO COMPLETE!!!
!!!IF YOU FLASH SUPERSU, IT WILL REBOOT SEVERAL TIMES DURING INSTALL, THAT IS OKAY!!!

Installation instructions:

-Download ROM, and if desired, SuperSU, AKLU kernel, and gapps, and put them on your phone’s external storage.
-Reboot into recovery mode – TWRP (I personally installed this using 3.0.2-0).
-Backup what you had. (Just to be safe.)
-Wipe. (I personally wipe everything prior to flashing new roms, but at least do the basic wipe.)
-Install Rom.
-Install Gapps. – Optional
–> OPTIONAL – If you want to install SuperSU, let the ROM boot up once first, then go back to TWRP and flash SuperSU zip. If it is stuck in a boot loop continually (it boot loops 1 to 4 times normally) then go back to TWRP and wipe cache and try again.
-Reboot to system and enjoy!

-OPTIONAL – After first boot, then go back to recovery and install the AKLU kernel.

Here are some pictures:

Linux – keep it simple.

A special camera app for the Samsung Galaxy S4!

Recently I was fortunate enough to compile a working version of AOKP Nougat for the Samsung Galaxy S4 JFLTETMO/JFLTEXX phones (Praise God!). For the most part, it seems to work great. The only big issue is a problem with the camera.

It’s not that the camera doesn’t work. In fact it still takes wonderful pictures. What doesn’t work, however, is creating a video recording. Actually, it causes the camera app to crash just attempting to select video mode from the app. I tried several different apps, and they all produce the same results. So, I decided to do something about it.

I tried looking over the crash logs, and it just didn’t make enough sense for me to make changes to the device trees for the camera. But, I didn’t want to give up. Instead, I decided to make a custom camera app that would overcome these difficulties. By God’s grace, I was successful!

It is still a work in progress, but it works well enough for now. The actual command to open the camera and take a video just isn’t working, so I made a workaround. Instead, the camera app simply displays the camera on a surface view, and I leveraged root (su) permission to record that surface view to a file: /sdcard/Pictures/video.mp4. After the recording is complete, there is a command to rename the file the current time in milliseconds, so the user doesn’t have to worry about overwriting their just recorded video by making another recording.

There is a camera picture button, which allows you to take a picture. The picture is taken via the normal camera method, since that portion works correctly. To take a video, you can click on the 1m/3m icon to choose 1 minute or 3 minutes of video recording, then hit the record button. Once you press record, the icons disappear and only the camera view is displayed, as the surface view is being recorded.

There are currently two main problems:

  1. There is no way currently to stop the recording. You simply have to “wait it out”. After the 1 or 3 minutes that you chose are up, the icons re-appear and a pop-up informs you that it is done. If you exit the app at this time, your home screen will be recorded instead until the time expires.
  2. There is currently no audio. I am fairly new at Android app making, and this is a huge learning curve for me, so I have not gotten the audio figured out yet.

You can check it out on my Github if you would like to view the source, you are welcome to use or abuse the source code in any way that helps you with your own projects as well. The app is build-able in Android Studio.

https://github.com/alaskalinuxuser/S4camera_app

And, if you want to download the app, it is also located on that Github page.

Linux – keep it simple.

Adding a hotplug alternative or option to a kernel

Today was a pretty fun day. By God’s grace, I was able to add intelli_plug, a hotplug alternative made by Faux123, to my JFLTE kernel! Adding a hotplug was a lot easier than I thought it would be, and only required one trimming of the code by Faux123 to make it work on my kernel.

Some of you may wonder, well, what IS a hotplug? A hotplug is a controller that chooses how many of your cpu cores are going to be used at once. I know that sounds a lot like a governor, but a governor governs at what frequency the core(s) are used, and a hotplugger allows you to turn off cores that do not need to be utilized right now. This saves you battery life, and also helps to keep your phone or computer cool.

So, here’s what I did to make it work.

First, I added the intelli_plug.c file, which I found here:
https://github.com/antaril/AGK-OMNI/commit/635fd311f456ca5ae4690180556014b1ffd3ef79
I would recommend that you use mine however, as I had to ammend 2 lines to make it work with the JFLTE kernel.

Then, I added the appropriate lines to kconfig:

[CODE]
config INTELLI_PLUG
bool “Enable intelli-plug cpu hotplug driver”
default y
help
Generic Intelli-plug cpu hotplug driver for ARM SOCs WJH 20161222
[/CODE]
and Makefile:

[CODE]
obj-$(CONFIG_INTELLI_PLUG) += intelli_plug.o
[/CODE]
in the arch/arm/mach-msm folder.

Then I recompiled it. Note that I set the default option to “y”, so I didn’t need to add intelli_plug to my arch/arm/config/files, it simply is added by default to any kernel I build with that tree. On first run, there was an error on this line:

unsigned int avg_nr_run = avg_nr_running();

and This line:

if (avg_nr_run <= (nr_threshold << (FSHIFT – nr_fshift)))

but avg_nr_running() did not exist elsewhere in the kernel, so I commented these out with the double forward slash “//”. Normally, I would think it needs that, but in this case it still works okay. Upon rebuilding, it whent smoothly, and seems to work great!

Linux – keep it simple.

AOKP N 7.1.1 for the JFLTETMO and JFLTEXX

To God be the glory, my AOKP Nougat project finally works!

If you are interested in a *mostly* working AOKP 7.1.1 rom for the JFLTETMO or JFLTEXX, head over to XDA or look under my Homemade Roms page for a download link!

http://forum.xda-developers.com/galaxy-s4-tmobile/development/rom-aokp-n-t3519280

**** This is an UNOFFICIAL ROM. Install at your own risk! ****

 

!!!FIRST BOOT TAKES ABOUT 5 EARTH MINUTES TO COMPLETE!!!

Installation instructions:
-Download ROM and gapps, and put them on your phone or external storage.
-Reboot into recovery mode – TWRP (I personally installed this using 3.0.2-0).
-Backup what you had. (Just to be safe.)
-Wipe. (I personally wipe everything prior to flashing new roms, but at least do the basic wipe.)
-Install Rom.
-Install Gapps. – Optional
-Reboot to system and enjoy!

-OPTIONAL – After first boot, then go back to recovery and install the AKLU kernel.

What works:
So far everything that I have tried works, such as
- Camera for pictures only!
- Phone calls/receiving
- Data 2g/3g/LTE
- Bluetooth* - Music and File transfer.
- WiFi
- PTP
- GPS
- Multi-Window, just long press the "recents" button.
etc....

What doesn't:
- Video recording with the camera doesn't work, pictures work, but not video.
- MTP sometimes works, but is finicky, but PTP is also an option and works every time.
- Bluetooth works, but sometimes the Bluetooth share app crashes.
- Browser works, but sometimes doesn't display typing letters until you press enter/search. (I recommend you download a different browser.)
- Choosing to reboot the phone sometimes takes a loooong time. It may be better to Power off and then start the phone, which is faster for some reason.
-Let me know in the forums if you find other issues so I can work on fixing them.

 

 

Here are some screenshots:

Linux – keep it simple.

CONGRATS YOU EARNED A STINKEYE FROM CID!

Well, this certainly is an original code error if I ever saw one.

[CODE]prebuilts/cmsdk/api/6.txt:745: error 8: Removed public class cyanogenmod.platform.R.color
prebuilts/cmsdk/api/6.txt:749: error 8: Removed public class cyanogenmod.platform.R.dimen
prebuilts/cmsdk/api/6.txt:765: error 8: Removed public class cyanogenmod.platform.R.layout

******************************
You have tried to change the API from what has been previously approved.

STOP.
Read this:
https://github.com/CyanogenMod/cm_platform_sdk/wiki/Creating-an-API-for-the-SDK#updating–verifying-the-api

To make these errors go away, you have two choices:
1) You can add “@hide” javadoc comments to the methods, etc. listed in the
errors above.

2) You can update current.txt (locally) by executing the following command:
make update-cm-api

^^^^^^^^^^^^^^^^^^
CONGRATS YOU EARNED A STINKEYE FROM CID!
[/CODE]

It even comes with it’s very own ASCII art, which I did not post here. The above implies that I need to make some changes to my api files. Option #2 sounded really easy, so I gave it a try, here was the output:

[CODE]
$ make update-cm-api
…..edited for space…….
nes/compile/build_aokp7/out/target/common/docs/cm-api-stubs
35 warnings
[100% 5/5] build update-cm-public-api
Copying cm_current.txt
Copying cm_removed.txt

#### make completed successfully (02:47 (mm:ss)) ####
[/CODE]

However, it didn’t solve the problem. Then I tried option #1 by editing the build_aokp7/prebuilts/cmsdk/api/6.txt file. I simply added @hide to the beginning of lines that were flagged, in this case, lines 745, 749, and 769. Once that was done, I stopped getting the stinkeye error. Hopefully that will be useful for you to know as well.

Linux – keep it simple.

Neverallow failures occurred

What does that even mean? Let’s take a look at the code:

[CODE]
libsepol.report_failure: neverallow on line 574 of system/sepolicy/system_server.te (or line 18452 of policy.conf) violated by allow system_server system_server:process { execmem };
libsepol.report_failure: neverallow on line 544 of system/sepolicy/domain.te (or line 9255 of policy.conf) violated by allow mediaserver shell_data_file:dir { search };
libsepol.report_failure: neverallow on line 459 of system/sepolicy/domain.te (or line 9170 of policy.conf) violated by allow mm-qcamerad system_file:file { execmod };
libsepol.report_failure: neverallow on line 459 of system/sepolicy/domain.te (or line 9170 of policy.conf) violated by allow mediaserver system_file:file { execmod };
libsepol.report_failure: neverallow on line 459 of system/sepolicy/domain.te (or line 9170 of policy.conf) violated by allow system_server system_file:file { execmod };
libsepol.report_failure: neverallow on line 433 of system/sepolicy/domain.te (or line 9159 of policy.conf) violated by allow mm-qcamerad system_file:file { execmod };
libsepol.report_failure: neverallow on line 433 of system/sepolicy/domain.te (or line 9159 of policy.conf) violated by allow mediaserver system_file:file { execmod };
libsepol.report_failure: neverallow on line 433 of system/sepolicy/domain.te (or line 9159 of policy.conf) violated by allow system_server system_file:file { execmod };
libsepol.check_assertions: 8 neverallow failures occurred
Error while expanding policy
[/CODE]

From the error output, I can only discern that these should never be allowed to happen in a sepolicy configuration. So, to make ammends with the compiler, I edited build_aokp7/device/samsung/jf-common/sepolicy/system_server.te, build_aokp7/device/samsung/jf-common/sepolicy/mm-qcamerad.te, and build_aokp7/device/samsung/jf-common/sepolicy/media_server.te, simply removing the sepolicy rule that was causing the issue, namely

[CODE]system_file:file { execmod };[/CODE]

It is worth noting that they do appear twice in the list of errors, but only once in the file itself. Hopefully that will help me as I compile AOKP 7.0 for the jfltetmo Samsung Galaxy S4, T-Mobile edition.

Linux – keep it simple.

 

When Jack turns into a Ninja.

Well, Jack doesn’t actually turn into a Ninja. Actually Jack gets beat up by one. On my computer at least.

I’ve used Jack for a while now, when compiling Marshmallow roms. However, Jack keeps having problems while I am building Nougat roms. In fact, Jack seems to sit down and cry every time “Ninja” shows up. I keep getting a “out of memory” error for the Jack server.

Being somewhat used to Jack, I tried setting arguments by exporting them into the environment variables, as I mentioned in a previous post, but that wasn’t helping. So, I went to https://source.android.com/source/jack.html and read up about Jack. Unfortunately, none of the things that they recommend there are working.

Then I really read that link. Near the top of the page, it says:

“For instructions on using Jack in Android 7.0 (N) and later, see the Jack server documentation. For Android 6.0 (M), use the instructions in this section.”

Ahh, now I see the error of my ways. After going to the new Jack documentation ( https://android.googlesource.com/platform/prebuilts/sdk/+/master/tools/README-jack-server.md ) I found this lovely tidbit:

“If you experience Jack compilations failing on Out of memory error.:

You can improve the situation by reducing the number of jack simultaneous compilations by editing your $HOME/.jack-server/config.properties and changing jack.server.max-service to a lower value and then restarting the server.
If this is not enough, you may change the arguments used to start the server jvm and force a greater maximum Java heap size (“-Xmx”):

Stop the server using jack-admin stop-server, then:
If you start the server manually:
JACK_SERVER_VM_ARGUMENTS=”-Xmx2g -Dfile.encoding=UTF-8 -XX:+TieredCompilation” jack-admin start-server
If you use the jack server in the android tree then
export ANDROID_JACK_VM_ARGS=”-Xmx2g -Dfile.encoding=UTF-8 -XX:+TieredCompilation”
and restart your build command.”

So, now I can get Jack to join the Ninja party.

Linux – keep it simple.

Resurrection Remix 5.7.4 for the JFLTETMO

In my continuing quest to provide more roms and kernels for the Samsung Galaxy S4, T-Mobile variant, God has graciously blessed, allowing me to complete the latest addition of Resurrection Remix 5.7.4! Below you can see a link for the Rom and Kernel.

Resurrection Remix 5.7.4 JFLTETMO only.

http://www.mediafire.com/file/l5z861s1z0l46xy/ResurrectionRemix-M-v5.7.4-20161004-jfltetmo.zip

AKLU-mm-jf-ResurrectionRemix5.7.4 kernel!
A kernel specifically built for RR 5.7.4! Can be flashed to any jf variant phone. Good for JFLTETMO, JFLTEXX, and possibly others!
Download: http://www.mediafire.com/file/9cl559str0hlsih/rr574_aklu_kernel.zip

Features:
-Lionheart and many other governors
-CPU overclocked to 1998MHz
-GPU overclocked to 487Mhz
-GPU/CPU voltage control
-Fast charge
-Psudo file system encryption support
-Fauxsound 2.1