• If you are experiencing issues logging in, we moved to a new and more secure software and older account passwords were not able to be migrated. We recommend trying to reset your password, then contacting us if there are issues.
  • Nearly done! Migration cleanup is mostly done. There are a small number of issues left that we continue to work on, but all the heavy lifting is done. We still would love to hear feedback over at this thread and also check out the new XDA app! Thanks and we hope you enjoy the new forums, and thanks for your support of XDA <3

[ROM+GUIDE][SM-G955x][AQH3] CeX - Flashable Repackaged Stock [29/08/17]

Status
Not open for further replies.

nicholaschum

Substratum Development Leader / Inactive Recognize
Feb 3, 2011
6,079
13,832
0
University of Toronto
plus.google.com


Definition
Let me first define what I mean by Creator's Experience. This ROM is just as good as your stock ROM on KNOX 0x0. I am in no way taking credit for any of the development in this ROM, I'm just repackaging the stock Samsung ROM in Samsung's experience how they created it. But if you flashed stock ROM you may get a ton of KNOX warnings so selling the device or giving your device to someone else would make it more complicated and frustrating due to nagging popups that you have to disable by first setting up the device. I wanted to create something that you can restore your device to when you get bored of a custom ROM, or you just want to use the latest stock firmware again.

This ROM will never contain any tweaks or system addons, it is barebones stock with no KNOX and stubs so people can use it as a rescue/reference firmware.

Purpose
Being the owner of the Korean Samsung Galaxy S8+ 128GB/6GB (SM-G955N), there are only so many stock firmwares available from Updato or Sammobile. All listed firmwares contain all the CSCs located in the /system partition, and the CSC file toggles between them. This means that regardless of what CSC you flash on the device, you will activate all the applications that were disabled by the CSC (KT mobile apps should be disabled on the SKT CSC, and vice versa). So flashing a Canadian CSC will still have every single South Korean carrier bloat on your device, which sucks.

This is a strange situation with 955N users, where ALL THE BLOAT is stored in /system/priv-app, while the csc is just one small file that controls which applications are active/inactive on the device.



Process
So, what does this mean? I wanted the stock international 955F ROM on my device, really badly. But Odin refused to flash it due to a secure write/invalid magic string error. I have tried everything from modifying the PIT tables in the ROMs to flashing custom ROMs. As much as custom ROMs are great, I wanted something I could fall back to when sh*t hits the fan, as well as something that fit the stock lifestyle...since I would really have loved to keep KNOX 0x0 if the Korean firmware was not as bloated as I thought it would be.

So for those who were searching for the stock ROM that was created with stock in mind, I have repackaged the 955F stock using the kitchen by @SuperR., with removed KNOX + KNOX apps (Secure Folder, KNOX Settings 1 & 2, Samsung Pay, Samsung Pass, etc.), removed stub apps (Microsoft apps folder) and removed CSC (I will elaborate more below).

As it takes me from 3-6 minutes to download stock firmware, I will be keeping this up to date for people who will need a rescue zip.

Reproduction
The reason why I'm keeping this as clean as possible is because it functions the same way as the Odin package. The AP will be the ROM zip, while you have to flash your own custom kernel, and flash the CSC package by @Tkkg1994. Finally, to top everything off, Magisk will be flashed.

A flowchart of this process (clean flash) is listed below:
  1. Flash CeX stock (this ROM)
  2. Flash the CSC using the CSC utility tool by @Tkkg1994: https://forum.xda-developers.com/galaxy-s8+/development/utility-flashable-csc-selection-v1-0-0-t3605264
  3. Flash the kernel, I highly recommend @jesec's Jesse Kernel: https://forum.xda-developers.com/galaxy-s8/samsung-galaxy-s8--s8-cross-device-development/kernel-jesse-s-kernel-galaxy-s8-exynos-t3603521
  4. Flash Magisk v12+: https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

A flowchart of this process (dirty flash) is listed below [dirty flash is supported on CeX, as long as you follow these steps]:
  1. Use TWRP and wipe /system
  2. Flash CeX stock (this ROM)
  3. Flash the CSC using the CSC utility tool by @Tkkg1994: https://forum.xda-developers.com/galaxy-s8+/development/utility-flashable-csc-selection-v1-0-0-t3605264
  4. Flash the kernel, I highly recommend @jesec's Jesse Kernel: https://forum.xda-developers.com/galaxy-s8/samsung-galaxy-s8--s8-cross-device-development/kernel-jesse-s-kernel-galaxy-s8-exynos-t3603521
  5. Flash Magisk v12+: https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

Anomalies
At the current stage, this is just the stock Samsung firmware. So any bugs found in the official bugs list of the current firmware revision would be present in this ROM. See the second bracketed codename in the title of this thread.

Do you use Netflix or Amazon Prime Video?
With their Widevine DRM Module, it bypasses anything Magisk Hide has to offer.
Using TWRP, remove /system/lib/liboemcrypto.so, then reboot to system.
If you ever want to restore stock, this is the AQEB binary: https://www.androidfilehost.com/?fid=961840155545569722

Screenshots
There really doesn't need to be any screenshots, unless you have never turned on your phone on stock ROM before...but here, I'll show you Settings.



SafetyNet?
This is a simple phenomenon solved by having both a custom kernel with KNOX 0x0 simulation, like Jesse's kernel, and Magisk v12 installed with Magisk Hide enabled. It is confirmed that CeX respects SafetyNet.



Programmatically Displayed Debloated Applications/Services/Libraries
Code:
system/app/Facebook_stub*
system/app/MSSkype_stub*
system/app/SecureFolderSetupPage*
system/priv-app/OneDrive_Samsung_v2*
system/priv-app/SecureFolder*
system/priv-app/SamsungPass_1.1*
system/priv-app/Excel_SamsungStub*
system/priv-app/PowerPoint_SamsungStub*
system/priv-app/Word_SamsungStub*
system/container*

system/app/BBCAgent*
system/app/Bridge*
system/app/ContainerAgent*
system/app/ContainerEventsRelayManager*
system/app/kioskdefault*
system/app/KLMSAgent*
system/app/Knox*
system/app/KNOX*
system/app/MyKNOX*
system/app/RCPComponents*
system/app/SecurityLogAgent*
system/app/SwitchKnoxI*
system/app/UniversalMDMClient*
system/container*
system/etc/secure_storage/com.sec.knox*
system/preloadedkiosk*
system/preloadedmdm*
system/preloadedsso*
system/priv-app/KLMSAgent*
Download Links
AndroidFileHost Folder (Autopushed builds): https://www.androidfilehost.com/?w=files&flid=185563
AQH3 builds (August):
FullRebaseOptions from last build:
https://www.androidfilehost.com/?fid=745425885120758691

Normal build:
https://www.androidfilehost.com/?fid=817550096634795846

AQF7 build (June): https://www.androidfilehost.com/?fid=673368273298964156
AQEB build (May): https://www.androidfilehost.com/?fid=817550096634773510

Credits & Thanks
  • @SuperR. for his kitchen
  • @jesec for him helping out when I was frustrated something isn't working, and pretty much his experience with his 955N
  • @fahadali2315 for refreshing my memory of messing with a Samsung device
  • Anyone I missed, just hit me up in private!

XDA:DevDB Information
CeX, ROM for the Samsung Galaxy S8+

Contributors
nicholaschum, fahadali2315
ROM OS Version: 7.x Nougat

Version Information
Status: Stable
Current Stable Version: AQH3
Stable Release Date: 2017-05-31

Created 2017-06-01
Last Updated 2017-08-29
 
Last edited:

nicholaschum

Substratum Development Leader / Inactive Recognize
Feb 3, 2011
6,079
13,832
0
University of Toronto
plus.google.com
Building with SuperR Kitchen for your own stock region ROM

If you're interested in creating your own flashable ZIP based on a ROM, I will be listing the full instructions on how to get your own stock ROM up and running.

I will be building the latest XXU builds as soon as they drop.

Please do not PM me, instead, post in the thread for people to learn.

Prerequisites:
- Your device MUST be of the Exynos variant, with an available TWRP on the device. If you have a Qualcomm device, close this window now!
- You must have a Linux environment. I know @SuperR.'s kitchen works on Windows using Cygwin, but as an AOSP developer, I work with Linux to build stuff!
- Sudo account
- Collect and utilize as much wits as you can!
- I will be doing all of this from the command line using SSH, no GUI for this!

1) Download the latest SuperR kitchen here: https://forum.xda-developers.com/ap...chen-superr-s-kitchen-v1-1-50-v2-1-6-t3597434

by doing this (press enter after each line in this code block):
Code:
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install
git config --global credential.helper cache
cd ~/
git clone https://bitbucket.org/superr/superrs-kitchen.git
cd superrs-kitchen
./superr
The first time running the kitchen, you may need to install dependencies. It should automatically install all dependencies for you, but if it keeps asking you to install the same dependencies, you should install them using
Code:
sudo apt-get packageName
.


After all dependencies are installed, press 1 to create a new project, and name it whatever you want. In this example I will name it STOCK.


Press Q once the project is created (quits SuperR kitchen)


2) Download your Samsung stock firmware. There are two main sites nowadays to get Samsung stock firmwares from, including Updato and Sammobile.

Updato: http://updato.com/firmware-archive-select-model?q=SM-G955F&rpp=15&order=date&dir=desc&exact=1
Sammobile: https://www.sammobile.com/firmwares/galaxy-s8/SM-G955F/

You will need to get the firmware on your Linux box, or from Updato, right click Download (the orange button) and click Copy Link.

If you are planning to download from the SSH box, do:
Code:
cd ~/superr-kitchen/superr_STOCK && wget link_of_updato
3) Your firmware file is now ready to be loaded up into the kitchen. So do:
Code:
./superr
Then click 4 to extract for a new ROM, then click "y"


4) When it asks you whether you want to include cache.img, it doesn't really matter if you do or don't. Click "y" and include it in the ROM.



5) It will then ask you to type a name for your output ZIP



6) If it asks you where to locate the partition info from, pick the entry that is recommended, which takes the partition from system.img and recovery.img (Detect by-name from boot/recovery images (recommended))

So simply click 1.


7) Finally, we must set the perm type/archive type of your images. Click 1 for set_metadata (KitKat+)

NOTE: I have tried using Sparse dat for Korean 955N image - which working at a cost of all Google apps crashing/not responding, but doing so on the 955F ZIP will completely break and cause it to get stuck in TWRP trying to flash. set_metadata is the most stable.


8) You can now fiddle with the ROM! It is highly recommended to replace the stock kernel with @jesec's kernel, but make sure you extract his other folders from his ZIP into your working directory (~/superr-kitchen/superr_STOCK/system/*) or you won't boot! You can either opt for this, or just flash the kernel ZIP to retain support from Jesse (this is what I picked for CeX).

Key configurations (the options I picked for CeX):
->7) Boot/Recovery Tools

- Unpack boot.img
- Type 5 and disable forceencrypt
- Type 1 and pack boot.img


->8) ROM Tools Menu
- Asserts Menu (if you're trying to do 955N ROM)
- Add/Remove Device (dream2lte) <- change from dream2lteks or any other model, since TWRP only recognizes dream2lte.


->6) Debloat Menu
- Custom Debloat
- ~/superr-kitchen/tools/root/bloat_custom must be edited to contain these entries (nano ~/superr-kitchen/tools/root/bloat_custom to edit the file):
Code:
system/app/Facebook_stub*
system/app/MSSkype_stub*
system/app/SecureFolderSetupPage*
system/priv-app/OneDrive_Samsung_v2*
system/priv-app/SecureFolder*
system/priv-app/SamsungPass_1.1*
system/priv-app/Excel_SamsungStub*
system/priv-app/PowerPoint_SamsungStub*
system/priv-app/Word_SamsungStub*
system/container*
- Remove Samsung Knox


9) You can make external edits by placing files in ~/superr-kitchen/superr_STOCK/system, or do whatever you want with the APKs

10) Let's start building!

If you left the window, all you have to do is do:
Code:
./superr
8
7
1


This will get you to the ROM zip building screen.

If the kitchen asks if you would like to convert the updater-script to an updater-binary, do it. Now give it some time to build. Usually my computer takes 2-3 minutes.

11) Finally, you can decide whether you want to sign the ZIP or not. Personally, I do not sign my ZIPs.


If you decide to skip signing, you're done! Just type "n" on your keyboard and click "q" to quit the kitchen. Your new ZIP is located in ~/superr-kitchen/superr_STOCK/STOCK_BASED_ROM.zip

You can either move this to your h5ai server, like I do at http://download.projektsubstratum.com/, or you could use transfer.sh here:
Code:
curl --upload-file ./STOCK_BASED_ROM.zip https://transfer.sh/STOCK_BASED_ROM.zip
You could also move it to AndroidFileHost using FTP, if you have a developer account.

This may take a while for the upload to complete, but once it is done, you are ready to flash the four ZIPs:
  1. The ROM
  2. A custom kernel
  3. The CSC utility flasher
  4. Magisk (for SafetyNet)

12) Congratulations, you're done!
 
Last edited:

nicholaschum

Substratum Development Leader / Inactive Recognize
Feb 3, 2011
6,079
13,832
0
University of Toronto
plus.google.com
Pulling your own CSC files

So you tried to extract the CSC file (cache.img) from the CP tar for Odin but no luck flashing...but you really wanted an up to date version..

Prerequisites:
- Your device MUST be of the Exynos variant, with an available TWRP on the device. If you have a Qualcomm device, close this window now!
- You must have a Linux environment for simg2img
- Sudo account
- Collect and utilize as much wits as you can!
- I will be doing all of this from the command line using SSH, no GUI for this!

1) Download simg2img to your Linux box and build the project

Code:
cd ~/
git clone https://github.com/anestisb/android-simg2img
cd android-simg2img
make
2) After simg2img has been compiled, we will have to use it.

Place your cache.img.ext4, yanked out of the CP.tar.md5 file (renamed to CP.tar) in the same directory of the git cloned repo

If you need a command to extract the .tar file, run:
Code:
tar xf CP.tar
3) Convert the image

Code:
./simg2img cache.img.ext4 cache.raw.img
4) Mount the image

Code:
sudo mkdir /media/csc
sudo mount -t ext4 -o loop cache.raw.img /media/csc
cd /media/csc
5) Copy the prepared flashable CSC zip out of the image

Code:
cp sec_csc.zip ~/
6) Flash the ZIP

7) Boot into the system. If you flashed a multi-CSC, you may need to configure it to be specific to your country.
This will require root, so get yourself into adb shell, then (credits to @jesec):


Code:
adb shell
su
am start com.sec.android.Preconfig/.Preconfig
A window will pop up giving you all the options selectable in your MultiCSC. Clicking and installing any of them will wipe your device, so watch out!

 
Last edited:

davjak

Senior Member
Mar 24, 2011
150
63
0
Melbourne
@nicholaschum
Can I ask possibly a dumb question
Is flashing CSC required?
I mean what happens if you don't flash CSC.
I am currently in AU on Vodafone CSC. I would change it to XSA but if I decided not to or forgot to do it. Would the CSC activate based on what is currently set as my CSC there or is this required so the rom can then load the apps based on location?
 

nicholaschum

Substratum Development Leader / Inactive Recognize
Feb 3, 2011
6,079
13,832
0
University of Toronto
plus.google.com
@nicholaschum
Can I ask possibly a dumb question
Is flashing CSC required?
I mean what happens if you don't flash CSC.
I am currently in AU on Vodafone CSC. I would change it to XSA but if I decided not to or forgot to do it. Would the CSC activate based on what is currently set as my CSC there or is this required so the rom can then load the apps based on location?
The CSC is required or else Samsung stock ROMs will not know how to configure your phone. This also I closed LTE-A capabilities, wifi calling and VoLTE functionality. Since this ROM does not contain any CSC you could flash the DBT CSC from the flashing utility which is the default CSC on most ROMs that is Germany debranded.
 
  • Like
Reactions: davjak

d.cortez

Elite Member
Dec 30, 2005
3,338
596
103
north texas
@nicholaschum - thanks for sharing this ROM. i'm using as a daily driver for my "work device" in combination with the ATT CSC flashed via TK's CSC package. if/when Substratum is available for TW based S8 ROMs, can i assume your ROM will support it? thanks for taking time to read/respond to my question.
 

fahadali2315

Elite Member
Sep 18, 2013
3,158
6,304
0
Nottingham
@nicholaschum - thanks for sharing this ROM. i'm using as a daily driver for my "work device" in combination with the ATT CSC flashed via TK's CSC package. if/when Substratum is available for TW based S8 ROMs, can i assume your ROM will support it? thanks for taking time to read/respond to my question.
Yes. That is the whole point behind it , keeping it stockish with subs support when it arrives.
 
  • Like
Reactions: d.cortez
Status
Not open for further replies.