[Android Software Development] AndroidSword:
Hey guys, now, coming back to the guide, I want to tell you that the sole purpose of modifying/developing a custom ROM is to remove the amazing loads of BLOAT, that Samsung has to offer us. If you downloaded the firmware, that I told you about in the first post, you must have noted the huge size of the official firmware (In my case, it was around 1.9 GB!!). On the other hand, if you see around, most of the ROMS are much less in size than the official firmware. So, let me make an equation, that you can remember for life long, till you are developing a ROM :p

CUSTOM ROM = OFFICIAL FIRMWARE - BLOAT​

LETS LEARN ABOUT BLOAT

So keeping this mind, the first thing you should do, while developing a ROM, is to remove this BLOAT. Now, BLOAT, you can consider it to be extra apps that you see on your device, which you NEVER-EVER use, and they just sit there on your device, taking up all the space that you need and using up your battery by keeping their background services active all the time. So, let's first recognize, what is this BLOAT.

You can consider all the Microsoft Apps (Word, Excel, PowerPoint, Skype etc etc), at least, they were a Bloat for our NOTE 5 device. Don't get me wrong, they are amazing applications, but on PC. I never used them on my Device. Furthermore, you can consider a few of Google apps as BLOAT as well. For example. Play Music, you are already getting a music app from Samsung, so why keep two? Like this, many of Samsung apps like Samsung Pay (which you probably can't use as you rooted your device) and many others. Hope you got the idea.

Now, since you recognized the BLOAT, the next step would be to know, where is this. Now, I told you above that the BLOAT is essentially the apps in the ROM. So, from Post #1, you must be knowing that apps are located in "system/app" and system/priv-app. But remember one thing, ALL THE APPS ARE NOT BLOAT. You can head to this directory and look for various folders (These folders contains the apk files for the apps, as I told you earlier), but DON'T delete anything now.

Now you know what is BLOAT and where it is, now you need to understand, how to remove this BLOAT. So, there are two ways to do this, and in actual ROM Development, I am sure, you will use both the methods.

So here are the two methods:-

1)Using a kitchen

2)Using File Explorer

Using a File Explorer is as simple as going to "system/app" (or "system/priv-app") and deleting the respective folder, but,

YOU SHOULD KNOW WHAT YOU ARE DOING... YOU SHOULD NEVER DELETE AN APK, UNLESS YOU KNOW IT IS NOT REQUIRED BY THE ANDROID SYSTEM TO RUN

REMOVING BLOAT USING KITCHEN

I consider this to be the safest method and you would also know it, just stick with me and follow the steps...

Step 1:-

Launch ASSAYYED Kitchen and look for the option "DEBLOATING THE ROM". So, in order to select it, you know what to do, Press "11" and enter.

So now, explanation time.

Now, in ASSAYYED, there is a method by which the kitchen "DEBLOATS" apps from your ROM. It does it by knowing the EXACT NAME OF THE APK stored in a TEXT FILE. These text files are located in "TOOLS/txt_files"(in your kitchen directory)

I would like you to open "kushan_debloat_list" in this directory (that is "TOOLS/txt_files"). Once you open this file, you will see a huge load to names of files with an extension ".apk". So, a kitchen uses this type of files with apk names, then it searches the full ROM for the apks and delete those whose names match with those in the list. So I hope you got the idea. The kitchen has some pre-loaded debloat list, which we can use for now. However, you can create your own ones, or download a "SAFE" debloat list for your specific device, and use that. Just put, your own text file in "TOOLS/txt_files", and you will be good to go, now lets move to Step 2.

Step2:-

Okay so, now we need to select out Debloat Txt file from the list. So, we will SELECT "CHOOSE_LIST" from ASSAYYED Menu.

Step 3:-

Now you will see the list of available Debloat List (PRE-LOADED ONES). For now, select "ASSAYYED KITCHEN LIST". Now, sit back and relax, until the Kitchen DEBLOATS the ROM.

Step 4:-

Once complete, Press Enter. and now navigate to your WORK Folder. In this, you should see a new folder namely "BLOAT". Now, I told you a lie earlier (Sorry for that:p). The kitchen doesnt delete the apks. It just separates the BLOAT from your ROM.

Once you open this BLOAT folder, you should see some subfolders, and you can easily guess what they contain.

Now, in order to make your ROM smaller in size, you need to remove this BLOAT folder. I would recommend moving this folder to a new directory for now, instead of fully deleting it.

Okay, so now your ROM is DEBLOATED!!

CONGRATULATIONS!!

Now, you can BUILD the ROM for flashing, like I taught you in Post #1 and flash it, you will see many apps will be removed from your app drawer, once the ROM is booted. So, now ENJOY YOUR DEBLOATED ROM

So, you have learned about Debloating your ROM, now let me tell you somethings about ODEXED AND DEODEXED ROMS

ODEXED VS DEODEXED

Well, it is essentially the apps that are ODEXED or DEODEXED and not the ROM in general.

Let's first learn about what is an ODEXED app. Well, ODEXED apps, basically are pre-optimized apps, they don't need to be optimized on every reboot, or after wiping cache or even after clean ROM install. Pre-optimized apps are also more stable as they won't get any chance of error while optimizing. When you pre-optimize an app, it's optimization details stored in a separate folder called "odex". So system accesses that and knows how an app works before opening the app or while booting the ROM. Therefore, on a fresh install, it is always noted that ODEXED ROMS boot a lot faster than DEODEXED ROMS.

On the other hand, DEODEXED apps are not pre-optimized. Once you deodex an app, the information stored in the odex folder is removed and the system has to optimize an app every time the ROM boots. This is the reason why a DEODEXED ROM boots slower in comparison with an ODEXED ROM.

But hey, that doesn't mean that ODEXED ROMS are better than DEODEXED ROMS. If you want a whole lot of MODS in your ROM, it is must that you DEODEX it. without DEODEXING an app, you cant make much modifications, and if you did, it will result in Force Closes and a whole lot of errors. I always prefer to DEODEX my ROMS. Inface, both my ROMS (N-FUEL-V4 and N-FUEL-XL1) are DEODEXED. The choice is upto you, whether you want faster boot-up times and all that speed or you want amazing MODS in your ROM.

So, I hope, you got to know a bit about ODEXED and DEODEXED ROMS. One thing, I would like to tell you is that the firmware, you downloaded, will always be ODEXED, as Samsung always keeps their firmware ODEXED for faster boot-up times and stability. So, we need to DEODEX it (if you want to have a DEODEXED Rom)

If you want to know more about ODEXED and DEODEXED, you can click here and read from this amazing guide:good: Now let me tell you, how to DEODEX a ROM

DEODEXING THE ROM USING KITCHEN

Step 1:- Launch ASSAYYED kitchen and search for "DEODEXING PROJECT". Then go ahead and select it.

Step 2:- Select Yes, if it asks for confirmation. Now sit back and relax, and let the kitchen do its work.

Pretty simple eh ;) So you have DEODEXED your ROM. Now, for this last section of this post, I will tell you about DEKNOXING the ROM, which is essential to do, and you will know why in the next section.

LEARNING ABOUT KNOX

The newer Samsung firmwares (maybe after 5.1.1) come with a secured BOOTLOADER. Basically, if we root our device or try to tamper with the official firmware, there is a Knox warranty which gets void. And once it gets void, there is no way (at least that's what people say) to get it back.

This KNOX warranty ensures that your device is running official firmware with no modifications. Therefore, once you root your device, KNOX warranty gets voided and as a result, you pretty much can't use official firmware on your device and if you did, the system will show high battery usage or other such effects. You can learn more about this from here.

Now since you know the adverse affects of Knox, it is better to remove it from your ROM.

DEKNOXING A ROM

Step 1:-

Launch ASSAYYED kitchen and select "DEKNOXING THE ROM". Let it do its work and Press Enter when completed.

But hey, that's not enough. We need to follow some additional steps to fully DEKNOX the ROM.

Step 2:-

Navigate to "system/app" inside the "WORK" folder, look for any folder containing the word "Knox" and delete them.

Step 3:-

Now navigate to "system/lib", and search for "libknox" and delete the files that show up (around 5 or 6 files should be there)

Remember to delete the above file from "lib" and NOT from "lib64"

Step 4:-

Open the build.prop file. (It is in system folder inside WORK)

Step 5:-

In the build.prop file, search for "ro.config.knox". This value should be equal to something (in my case it was v30). Change this something to 0, so that the full line becomes "ro.config.knox=0".

Step 6:-

Now search for "ro.config.tima". This value should be equal to 1. Change it to 0, so that the full line becomes "ro.config.tima=0".

So that's it, you finally have DEBLOATED, DEODEXED AND DEKNOXED ROM!!

You can now go ahead and BUILD THE ROM FOR FLASHING. Then once the ROM boots, enjoy your hardwork ;):o

Now, this is it... We have fully completed the first part of the GUIDE.... that is, CREATING A VERY BASIC ROM USING KITCHEN. In the next POST, we will continue to the next part of the guide... so till then, Stay Tuned:)