Debloating/Deknoxing a Stock ROM and creating one - Galaxy S6 General
I assume that you already have TWRP setup on your phone so I will not go through that process here.
Android version and Phone model
My tests are based off the latest stock ROM of the Canadian SM-G920W8 SIM unlocked model. The latest supported version of Android for the Samsung Galaxy S6 is Nougat version 7.0. Versions higher than that have serious camera issues, and yes, I tried MANY ROMs. Activating API2, trying other camera apps. They all sum up to be pretty much all the same with their different sets of problems. This is why I chose the latest v7.0 stock ROM. I have not fell on any v7.1.1 ROMs and v7.1.2 have camera issues too. So, I took the latest that does not come with camera issues.
Hardware key combinations to remember
Urgent/Bootloop shutdown and reboot: Volume DOWN + Home + Power
Enter TWRP: Volume UP + Home + Power
Assayyed Kitchen: XDA Thread
This tool is the best and easiest one I have found for Windows. I just do not use the debloat and deknox options as I do it myself with a personal webserver in PHP I wrote for myself. Assayyed Kitchen uses 3 main folders for working. PLACE, WORK and READY.
PLACE: You put there a zipped ROM or any Stock files in there. Assayyed will do all the unzipping for you.
WORK: Once Assayyed has done it's magic, you should see your needed files there where "system" is the most important one we will focus on here.
READY: That's where your final zip file is created for you to copy on your phone and install.
You do not need to use the PLACE folder if you already have a full uncompressed "system" folder. Simply copy and paste the "system" folder inside the WORK folder and use Assayyed skipping the #1 step of creating a project.
I will answer these questions:
Which files do I need to delete to remove KNOX, also known as deknox the rom?
Which files and apps can I safely remove to boot my phone with a clean Android system also known as debloat?
Now, debloating is still in a work in progress on my side because I have a very ambitious debloating project, like many. The aim of this debloation is to:
Remove all Google apps,framework and libs
Remove all useless Samsung apps that do not interfere with proper working equipement.
Remove all other additional apps
All I want is to keep the barebones of a functionning Android system while maintaining some needed functionalities such as a photo gallery, calendar and the camera.
Many ROM creators have their very own definition of DEBLOAT. They not only debloat the ROM but REBLOAT them with their own personal bloatwares INCLUDING magisk and sql lite and other hacks and apps for advanced configs. The goal of my ROM is to be able to install ON MY OWN Magisk, Open GApps and other stuff if I want AND not limited to versions that are included in the ROM. ROMs with Magisk, for example, use Magisk version uploaded at the time but Magisk evolves with time and newer version become available. So I hated to have all that stuff to take care about. It's the very basic stock rom debloated with nothing more than what stock offered. No kernels, no additional software, just a pure debloated and deknoxed ROM.
Here are the lists of what I have successfully debloated with a successfull boot for now. Note that I did not add the ".apk" because those files are usually inside their respective folders BUT, should you have no folders inside the app or priv-app folder, then simply add ".apk" at the end of the name. Other thing to mention, the root directory is "system". SInce my server works with the "system" folder directly, I did not add the "system/" at the beginning of every line. The complete lists are files and folders contained inside the "system" folder. Note that some files have no extentions too and should not be mistaken for folders.
Remove KNOX or comonly said DEKNOX
// ====
// Knox
// ====
app/KNOXStub
app/KNOXStore
app/KnoxAttestationAgent
app/KNOXAgent
app/KLMSAgent
app/ContainerAgent
app/ContainerEventsRelayManager
app/KnoxFolderContainer2
app/KnoxRemoteContentsProvider
app/KnoxAppsUpdateAgent
app/KnoxFolderContainer
app/KnoxSetupWizardClient
app/KnoxSwitcher
app/MyKNOXSetupWizard
app/KnoxMigrationAgent
app/KnoxSetupWizardStub
app/SamsungDLPService
app/BBCAgent
app/SecurityLogAgent
priv-app/MyKNOXSetupWizard
priv-app/KLMSAgent
priv-app/SPDClient
priv-app/SKMSAgent
container
tima_measurement_info
framework/knoxsdk.jar
framework/knoxvpnuidtag.jar
etc/secure_storage/com.sec.knox.store
etc/secure_storage/com.sec.knox.store!dex
// ==========================================================
// Phone will FAIL to boot if the following files are deleted
// ==========================================================
//etc/permissions/knoxsdk_edm.xml
//etc/permissions/knoxsdk_mdm.xml
//lib/libknox_encryption.so
//lib/libknox_km.so
//lib/libknox_legacy_ode_km.so
//lib/libknox_migration.so
//lib/libknoxvpnfdsender.so
//lib64/libknox_encryption.so
//lib64/libknox_km.so
//lib64/libknox_legacy_ode_km.so
//lib64/libknox_migration.so
//lib64/libknoxvpnfdsender.so
//framework/arm64/boot-knoxsdk.art
//framework/arm64/boot-knoxsdk.oat
//framework/arm64/boot-knoxvpnuidtag.art
//framework/arm64/boot-knoxvpnuidtag.oat
//framework/arm/boot-knoxsdk.art
//framework/arm/boot-knoxsdk.oat
//framework/arm/boot-knoxvpnuidtag.art
//framework/arm/boot-knoxvpnuidtag.oat
Incomplete but functional Samsung apps safe to remove
// =======
// Samsung
// =======
app/SamsungSans
app/VirtualTour_N_OS
app/VideoTrimmer_Dream
app/VideoEditorLite_Dream_N
app/VideoCollage_Grace_N
app/SlowMotion_Dream_N
app/EasterEgg
app/EasyOneHand3
app/GameOptimizer
app/WallpaperBackup
app/Weather2017_SE
app/WeatherWidget2017_SE
app/SmartRemote_zero
app/SmartSwitchAgent
app/SmartcardService
app/SecFactoryPhoneTest
app/SecurityProviderSEC
app/STalkback
app/OneNote_Compact_Samsung
app/GearManagerStub
app/SecMemo3
app/AllshareFileShare
app/AllshareMediaShare
app/SBrowser_5.0
app/SPrintSpooler7
app/CloudGateway2017
priv-app/GalaxyAppsWidget_Phone
priv-app/SamsungPayStub
priv-app/SamsungBilling
priv-app/GalaxyApps_3xh
priv-app/GalaxyCare
priv-app/GalaxyThemes
priv-app/PowerPoint_SamsungStub
priv-app/SamsungAccount_Dream
priv-app/SamsungCloud
priv-app/HealthService
priv-app/LegacySmartManagerProvider
priv-app/SamsungPass_1.1
priv-app/VoiceNote_5.0
priv-app/Word_SamsungStub
priv-app/ThemeCenter
priv-app/SecLiveWallpapersPicker
priv-app/SHealth5
priv-app/SmartManager_v5
priv-app/SmartManager_v5_DeviceSecurity
priv-app/EasyLauncher2_Zero
priv-app/SVoicePLM
priv-app/SmartcardManager
priv-app/SVoiceLang_EnglishPack_US_1.0
priv-app/SVoiceLang_FrenchPack_1.0
priv-app/SamsungMagnifier3
priv-app/SecEmail_N
priv-app/SecureFolderStub
priv-app/EasySetup
priv-app/GameHome
priv-app/GameTools
priv-app/OneDrive_Samsung_v2
etc/sysconfig/samsungaccount.xml
etc/sysconfig/samsungauthframework.xml
etc/sysconfig/samsungemail.xml
etc/sysconfig/samsungfidouafasm.xml
etc/sysconfig/samsungfidouafclient.xml
etc/sysconfig/samsungpushservice.xml
framework/gamemanager.jar
// ================================================
// Phone will have an EmergencyModeService has stopped
// if only the Launcher is removed and bootloop if the other
// 2 are removed so might as well keep them all.
// ================================================
// app/EmergencyLauncher
// app/EmergencyModeService
// priv-app/EmergencyInfo
Audio files debloat
These are extra Audio files that are not necessary for the phone to boot and like most people, you will probably customize your own ringtones. I kept a few basic ringtons and sounds so the phone can have something to work with on startup, but these files, to me are extras and unecessary.
media\audio\ringtones\A_Rustling_in_the_Trees.ogg
media\audio\ringtones\Basic_Bell.ogg
media\audio\ringtones\Basic_Tone.ogg
media\audio\ringtones\Beep_Once.ogg
media\audio\ringtones\Beginning.ogg
media\audio\ringtones\Bunny_Hopping.ogg
media\audio\ringtones\Chimes.ogg
media\audio\ringtones\Crossing_a_River.ogg
media\audio\ringtones\Dance_Party.ogg
media\audio\ringtones\Day_by_Day.ogg
media\audio\ringtones\Drifting_Downstream.ogg
media\audio\ringtones\Ecliptic.ogg
media\audio\ringtones\First_Light.ogg
media\audio\ringtones\Fresh_Morning.ogg
media\audio\ringtones\Mystic_Tone.ogg
media\audio\ringtones\Ocean_Voyage.ogg
media\audio\ringtones\One_Step_Forward.ogg
media\audio\ringtones\Prelude.ogg
media\audio\ringtones\Scampering_Tone.ogg
media\audio\ringtones\Somewhere.ogg
media\audio\ringtones\Ticktac.ogg
media\audio\ringtones\Warm_Greetings.ogg
media\audio\notifications\Beep_Once.ogg
media\audio\notifications\Good_Time.ogg
media\audio\notifications\Run.ogg
media\audio\notifications\S_Harmonics.ogg
media\audio\notifications\S_Opener.ogg
media\audio\notifications\S_Temple_Bell.ogg
media\audio\notifications\Sweet_Favour.ogg
media\audio\notifications\Whisper.ogg
media\audio\notifications\Hello.ogg
media\audio\notifications\Peanut.ogg
media\audio\notifications\S_Bubbles.ogg
media\audio\notifications\S_Charming_Bell.ogg
media\audio\notifications\S_Dew_drops.ogg
media\audio\notifications\S_Knock.ogg
media\audio\notifications\S_Tickety_Tock.ogg
WIP - Revove all Google framework and apps
I went through the entire apk, framework and lib folders from a full Open GApps zip file and tried to remove all of what it installs and I get a Bootloop, So working on trying to figure out what causes this.
I found some answers at these links concerning files that makes the phone fail to boot and other usefull information.
Project-Deep-Clean
Remove all Google apps from an android phone
Other lists to come soon when I am able to get my phone to boot with my removed apps...
In the mean time...
ROOTED phones: Removing unwanted apps WITHOUT using TWRP
So, I came upon a few things for the brave amongst you who wish to debloat their phones with root access but without using scripts in TWRP. Here is what you need to know.
Paths at the root of the phone, NOT sdcard...ROOT
/data/user/0 : This is where your installed apps are BUT they are saved under their package name and not their APK names. If you delete anything in this folder, you need to reboot after you are done cleaning in here.
/system/app : These apps re-install on phone reboot if not present
/system/priv-app : Same as above, these apps re-install on reboot if not present
File browser with ROOT access
I use Total Commander which can be downloaded from the Google Play Store. Once you open it, you need to enable root access by going into the app's settings using the "Configure..." option in it's menu. The scroll down to the bottom and check the box "Root functions everywhere". If you installed Magisk, the root permissions granting popup should appear for you to grant forever. Now, you can explore the entirety of your phone to delete those pesky apps.
Great guide! I've been meaning to get into making my own ROMs, particularly now that development for the S6 has all but stopped.
However, when I unpacked Assayyed my AV scanner Immunet (which uses CISCO's AV database) pinged up that there were 4 instances of "Andr.Dropper.Slocker::apk.agent.talos". These were in Superuser.apk, CLASSIC.zip, ASSAYYED.exe and FAST.zip.
Now, maybe this trojan is part of how the software operates - I could certainly see that as a possibility with things related to MicroG - but really a tool meant to remove things from a ROM, a tool you run in Windows oustide of Android, shouldn't be adding stuff like that back in.
TWeaKoR said:
Great guide! I've been meaning to get into making my own ROMs, particularly now that development for the S6 has all but stopped.
However, when I unpacked Assayyed my AV scanner Immunet (which uses CISCO's AV database) pinged up that there were 4 instances of "Andr.Dropper.Slocker::apk.agent.talos". These were in Superuser.apk, CLASSIC.zip, ASSAYYED.exe and FAST.zip.
Now, maybe this trojan is part of how the software operates - I could certainly see that as a possibility with things related to MicroG - but really a tool meant to remove things from a ROM, a tool you run in Windows oustide of Android, shouldn't be adding stuff like that back in.
Click to expand...
Click to collapse
Finding a WINDOWS tool to create a ROM is already not easy. On my side, I have not had any issues in running Assayyed. But I agree that the devs should AT LEAST try to make their apps AV detection free or at least warn people as to why they've incorporated those codes inside their app. BUT, that left asside, all the scripts used to do the work are available and one can simply make their own scripts or bat files and never use Assayyed as they simply launch commands from their scripts. Thank you for this information though!!!
Related
[Q] making system apks Into regular installable apks.
I was wondering how to make a system apk such as idk the browser into a regular installable apk so that someone with no knowledge of pushing apks can install it along side their apk.
Generally system apps are just normal apps, only installed on a system partition. If you pull a system apk from a device, then you should be able to install it normally on any other device. There are exceptions from this rule: You can't install an app if you have it installed already. Many system apps are installed on most devices by default and this is the reason, why you can't install e.g. Browser.apk pulled from other device - most probably you have it installed already. There are 2 solutions: you could remove system app before installation of new one or just replace it - but this isn't what you want. To create normal, installable apk you would have to modify its package name as I did with Google Maps. Some system apps use system internals, private APIs or privileges, some additional libraries, etc. For example Settings.apk changes internal settings of OS - you can't do that in normal apk. You can't easily move/install such apps, they're integrated with system.
thanks for this long great reply. So lets say I pulled my dialer apk changed the package name, could I install it on a friends phone NOT on the system partition ? I'm trying to pull the dialer apk from gingerbread and port it into a normal apk using apk tool, but once and changed the package name and all that and compile it I go to install it on my phone but it says that it could not open it as an apk file. Any ideas?
Newklearx3 said: thanks for this long great reply. So lets say I pulled my dialer apk changed the package name, could I install it on a friends phone NOT on the system partition ? Click to expand... Click to collapse I think not. Note that Phone.apk is only one app that can dial, you can't add such feature to your own app, so most probably it uses private APIs to do that. It's integrated-with-system one. Same for Settings.apk and PackageManager.apk, but you should be able to pull Browser.apk, Launcher.apk, MMS.apk, Gmail.apk, Talk.apk, etc., change their package name and install on another device. Ahh, there is one more group: SenseUI, Motoblur, etc. apps, which use additional framework resources: images, colors, texts. They won't work on a device lacking this framework, but it should be possible to make these apps framework-independent by copying all dependencies to app itself. Not that easy, but possible
Brut.all said: I think not. Note that Phone.apk is only one app that can dial, you can't add such feature to your own app, so most probably it uses private APIs to do that. It's integrated-with-system one. Same for Settings.apk and PackageManager.apk, but you should be able to pull Browser.apk, Launcher.apk, MMS.apk, Gmail.apk, Talk.apk, etc., change their package name and install on another device. Ahh, there is one more group: SenseUI, Motoblur, etc. apps, which use additional framework resources: images, colors, texts. They won't work on a device lacking this framework, but it should be possible to make these apps framework-independent by copying all dependents to app itself. Not that easy, but possible Click to expand... Click to collapse Dude, you're amazing! So how would I go about porting the gingerbread dialer to workable installable apk? I might be doing something wrong but I pulled the launcher and changed the package name and still the same error Okay, i guess I'm not. I copied the apk ( unmodded ) from the rom zip and placed it on my SD card to install it and the same error, so there must be something wrong. figured out it was the sdk version, got it to show up but wont install now.
im also interested in porting specific development apk, lets say.. CM Settings into a non Cyanogen. Tried that once by pulling CM*.apk and push it to other non Cyanogen but got cant be installed message.. any hints on this?
phoezies said: im also interested in porting specific development apk, lets say.. CM Settings into a non Cyanogen. Tried that once by pulling CM*.apk and push it to other non Cyanogen but got cant be installed message.. any hints on this? Click to expand... Click to collapse Use logcat as a start to see dependencies XDA App
Difference Between ODEXED and DEODEXED Files
WHAT IS AN ODEX FILE? In Android file system, applications come in packages with the extension .apk. These application packages, or APKs contain certain .odex files whose supposed function is to save space. These ‘odex’ files are actually collections of parts of an application that are optimized before booting. Doing so speeds up the boot process, as it preloads part of an application. On the other hand, it also makes hacking those applications difficult because a part of the coding has already been extracted to another location before execution. THEN COMES DEODEX Deodexing is basically repackaging of these APKs in a certain way, such that they are reassembled into classes.dex files. By doing that, all pieces of an application package are put together back in one place, thus eliminating the worry of a modified APK conflicting with some separate odexed parts. In summary, Deodexed ROMs (or APKs) have all their application packages put back together in one place, allowing for easy modification such as theming. Since no pieces of code are coming from any external location, custom ROMs or APKs are always deodexed to ensure integrity. HOW THIS WORKS For the more geeky amongst us, Android OS uses a Java-based virtual machine for running applications, called the Dalvik Virtual Machine. A deodexed, or .dex file contains the cache used by this virtual machine (referred to as Dalvik-cache) for a program, and it is stored inside the APK. An .odex file, on the other hand, is an optimized version of this same .dex file that is stored next to the APK as opposed to inside it. Android applies this technique by default to all the system applications. Now, when an Android-based system is booting, the davlik cache for the Davlik VM is built using these .odex files, allowing the OS to learn in advance what applications will be loaded, and thus speeds up the booting process. By deodexing these APKs, a developer actually puts the .odex files back inside their respective APK packages. Since all code is now contained within the APK itself, it becomes possible to modify any application package without conflicting with the operating system’s execution environment. ADVANTAGES & DISADVANTAGES The advantage of deodexing is in modification possibilities. This is most widely used in custom ROMs and themes. A developer building a custom ROM would almost always choose to deodex the ROM package first, since that would not only allow him to modify various APKs, but also leave room for post-install theming. On the other hand, since the .odex files were supposed to quickly build the dalvik cache, removing them would mean longer initial boot times. However, this is true only for the first ever boot after deodexing, since the cache would still get built over time as applications are used. Longer boot times may only be seen again if the dalvik cache is wiped for some reason. For a casual user, the main implication is in theming possibilities. Themes for android come in APKs too, and if you want to modify any of those, you should always choose a dedoexed custom ROM. Source From www.addictivetips.com
This looks to be a copy and paste from the description here. If you are not the original author its usually a wise idea to acknowledge the original author/source.
And optimized dex files (odex files) may also depended on the framework classes interfaces. This means that you may end up with bootloops or FCs if you change the interface of framework files. The odex files have therefore been given a signature that all files must match. Deodexed apks can on the other hand be used on several roms as they may only be depended on the resources in the framework-res.apk file. So you can have an odexed framework with deodexed apks! But if you want to change the interfaces in the Framework then it is easier to deodex all instead of re-odex all. Sent from my GT-N7000 using xda premium
Thanks for it! For me more clear now.
I need to verify this, So on an ODEXED STOCK ROM, Can I make changes like editings png's inside System APK files, Decompile and compile framework-res.apk, Make changes to the framework-res.apk to enable crt screen effect ... ?
Clears another thing up for me...
Thank you for your post.
Sorry guys for posting a stupid question, but i'm not clear on one point. I have the htc one S [s3]. How can I understand if /system/framework/framework-res.apk (and/or) framework-htc-res.apk are already deodexed? (in a practical manner) I mean...since is an apk and I'm not seeing any framework-res.odex are they already deodexed? Can I straightly modify it? Thx in advance!
Hi... Cant cant i something? So what is better of them? Sent from my GT-N7000 using xda premium
Emothic_Reagan said: Hi... Cant cant i something? So what is better of them? Sent from my GT-N7000 using xda premium Click to expand... Click to collapse Is not that one is better than the other. They have different characteristiocs. Odexed are smaller and faster while deodexed are easily customizable but needs more space. Guys I still need somebody to answer my question...plz...anybody?
Building first ROM for G900V
Good day, all! I've been working on [my first] ROM for Verizon S5 and everything seems to be going great! I've cleaned out as much Samsung/Verizon/Google trash as I can, applied some tweaks to build.prop, changed some default apps to (IMHO) better replacements, and anything that is left (functions correctly) has been moved to /data/app so they can be Uninstalled fully (not just Turned Off). Just a few quick questions: 1) How can I "bake-in" app data? I have replaced the normal, crap launcher with Holo Launcher and cannot seem to get correct permissions when the ROM is installed thru SS. I believe the issue is permissions for /data/data/ get screwed up or not set correctly. I have looked and looked and tried to determine the correct permissions, but still no joy. I've tried to fix /data/data permissions in the updater-script, but it seems like each subfolder/file has different permissions making me think I'll have to go thru them one-by-one. I have a work-around in place using a OneTimeInit script that does work, but it seems like that's not really the best approach? 2) Kind of ties into question number 1, I patched the framework-res.apk in to allow WiFiHotspot, but without being able to install the system settings data properly, there is not a "Quick Shortcut". Again, I've resolved the problem using the OneTimeInit to update Sqlite DBs after the system is up. 3) How do I de-odex the stock ROM? Using Android Kitchen doesn't seem to do it right. It works mostly but I still seem to get various FCs. I tend to believe that some things just cannot (should not) be De-Odex'd? I've also discontinued Zip-Aligning because it sometimes produces errors on my ROM. Is it not advised to use Android Kitchen to do these tasks or is there some trick to getting it to work just right? Bonus Question) I was going to share my ROM on XDA but it says I'm not allowed to post in Development. I assume because of my low post count. Any way I can get an over-ride or should I just make a few more posts and then do it? Thanks again guys! I appreciate all the help as always! Jake
jake5253 said: Good day, all! I've been working on [my first] ROM for Verizon S5 and everything seems to be going great! I've cleaned out as much Samsung/Verizon/Google trash as I can, applied some tweaks to build.prop, changed some default apps to (IMHO) better replacements, and anything that is left (functions correctly) has been moved to /data/app so they can be Uninstalled fully (not just Turned Off). Just a few quick questions: 1) How can I "bake-in" app data? I have replaced the normal, crap launcher with Holo Launcher and cannot seem to get correct permissions when the ROM is installed thru SS. I believe the issue is permissions for /data/data/ get screwed up or not set correctly. I have looked and looked and tried to determine the correct permissions, but still no joy. I've tried to fix /data/data permissions in the updater-script, but it seems like each subfolder/file has different permissions making me think I'll have to go thru them one-by-one. I have a work-around in place using a OneTimeInit script that does work, but it seems like that's not really the best approach? 2) Kind of ties into question number 1, I patched the framework-res.apk in to allow WiFiHotspot, but without being able to install the system settings data properly, there is not a "Quick Shortcut". Again, I've resolved the problem using the OneTimeInit to update Sqlite DBs after the system is up. 3) How do I de-odex the stock ROM? Using Android Kitchen doesn't seem to do it right. It works mostly but I still seem to get various FCs. I tend to believe that some things just cannot (should not) be De-Odex'd? I've also discontinued Zip-Aligning because it sometimes produces errors on my ROM. Is it not advised to use Android Kitchen to do these tasks or is there some trick to getting it to work just right? Bonus Question) I was going to share my ROM on XDA but it says I'm not allowed to post in Development. I assume because of my low post count. Any way I can get an over-ride or should I just make a few more posts and then do it? Thanks again guys! I appreciate all the help as always! Jake Click to expand... Click to collapse 1: All I had to do was place apk in /system/app or /system/priv-app and thats it. Make sure when you add your apks you dont unzip the archive. basically use kitchen and build your base rom then simply open the archive and make your edits. I also used the updater script from beans base build and only edited the ui print.. Messing with the updater script i wouldnt recommend as it could be causing some of your issues. 2: If using beans base theres no reason for you to edit anything as the hotspot is already baked in.. you must have borked it.. If you are not using beans base then maybe you should copy his files for the native hotspot as its already done properly. I wouldnt mess with framework or settings apks unless you know what your doing. Id work on gettin the fcs n other issues sorted first as you might b doin too much too fast.. work on learning how to make your apks work first before making edits to framework n settings apks. 3: The kitchen is best to deodex and zipalign.. also these two things should not cause fcs or errors if done properly. zipalign should help more than anything.. i just like workin with deodex bcuz its easier and only one set of files instead of .apk and .odex for just bout everything.. Again, if you are not using beans bases id recommend to do so.. his bases are already deodexed have hotspot zipaligned read/write to ext sd etc.. so you wouldnt have to do all from scratch and have so many issues.. Sent from my SM-G900V using XDA Premium HD app
elliwigy said: 1: All I had to do was place apk in /system/app or /system/priv-app and thats it. Make sure when you add your apks you dont unzip the archive. basically use kitchen and build your base rom then simply open the archive and make your edits. I also used the updater script from beans base build and only edited the ui print.. Messing with the updater script i wouldnt recommend as it could be causing some of your issues. 2: If using beans base theres no reason for you to edit anything as the hotspot is already baked in.. you must have borked it.. If you are not using beans base then maybe you should copy his files for the native hotspot as its already done properly. I wouldnt mess with framework or settings apks unless you know what your doing. Id work on gettin the fcs n other issues sorted first as you might b doin too much too fast.. work on learning how to make your apks work first before making edits to framework n settings apks. 3: The kitchen is best to deodex and zipalign.. also these two things should not cause fcs or errors if done properly. zipalign should help more than anything.. i just like workin with deodex bcuz its easier and only one set of files instead of .apk and .odex for just bout everything.. Again, if you are not using beans bases id recommend to do so.. his bases are already deodexed have hotspot zipaligned read/write to ext sd etc.. so you wouldnt have to do all from scratch and have so many issues.. Sent from my SM-G900V using XDA Premium HD app Click to expand... Click to collapse Thank you for the response! It seems perhaps I didn't quite make clear what I've done versus what I'm trying to accomplish. Firstly, I wouldn't go so far as to say I'm "having so many issues". Everything in my ROM is in perfectly fine working order. I just have these few quirks that I would like to address both so I can learn, and to make this and future projects better. While I appreciate the recommendation to use bean's base, I have taken a look at his and there seems to be nothing in his which copies data into /data/data/com.whatever.package (or at least there's nothing in his zip in the /data/data folder -- not sure if his ROM has the toggle activated?) I have the Apps working correctly in my ROM -- they just go in /data/apps, /system/app or /system/priv-app, respectively. What I need, is to get /data/data/com.whatever.package/ copied With Correct Permissions when the ROM is installed; I do not want a second zip to update things after install, especially for a toggle and a couple shortcuts, seems silly. For instance, when you boot your phone up with the default [stock] samsung launcher, it has a list of default apps and widgets on the first screen you see such as phone, messages, a clock widget, etc, etc. Since I've replaced the stock launcher with Holo Launcher HD and some other default apps have also been replaced, there's very few shortcuts on the main launcher screen. ** Holo Launcher does have a list of default apps it adds to your main page, but many of those have been removed in my rom. The solution I've come up with basically waits for the system to boot up to the point that Holo Launcher actually creates the default (mostly blank) /data/data/com.mobint.hololauncher.hd/databases/launcher.db and then my script uses sqlite3 to update the DBs with a list of different shortcuts -- ones to apps that actually exist. The Hotspot Toggle is the same way as above.. Hotspot works fine in my rom if you go through settings! I just cannot add the notification panel pull-down toggle to /data/data/com.android.providers.settings/database/settings.db until after the system boots up at least ONE time, and then update the DB to include WiFiHotspot in notification_panel_active_app_list and notification_panel_active_app_list_for_reset As for the zipalign and deodexing, I will have to try those again now that I have a fairly stable rom. ****EDIT**** I think I figured it out. I can just use busybox to kill the systemui after I update the databases during the first boot. I also figured out how I can add the SetupWizard without it locking up on activation. Thanks anyways, guys. Look for my rom, coming soon! =P
Please add support for more languages I found a mod for Motorola latest 4.4 please port it Sent from my SM-G900T using XDA Free mobile app
Tweak theme without computer
I don't spend lots of time at the computer, so I like to find ways to do as much as possible on the phone. One thing I've found is that every theme I try has at least one element I wish I could change, as much as I like it overall. I don't know enough to make my own theme, but I found a way to change elements of the theme without using a computer. I'm sure this is not news to many of you, but I figured there might be other non-experts like me out there who might appreciate it. 1. Download Apktool apk file below, install it, open it, {it will automatically update on the first use for some reason}, go to settings and check 'device has root', {leave other settings alone}, then close the app, reopen and grant su access. 2. Make a directory in storage somewhere called 'apktool', {or something}, and copy the following to it: /system/framework/framework-res.apk, /system/framework/SemcGenericUxpRes/SemcGenericUxpRes.apk, and whatever themes you want to mix and match. 3. Open apktool app, navigate to apktool directory, and import the framework files by tapping on each one and selecting 'import as framework'. When done, you can then tap on the theme apk files and select 'decompile all', and they will be decompiled into folders called {appname}-src. Go into the folders with a root explorer and change what you want, then go back to apktool, and tap on the folder you want and choose 'recompile'. When recompile is done you end up with an apk called '{appname}-src.apk'. Tap on that and choose 'sign'. When done you will get an apk called '{appname}-src-sign.apk, which you can install normally. -Notes, questions- - I'm currently using Z1c stock .236 deodexed rom. This app should work on other phones, roms, versions, etc, but I can't say for sure. What I know is that there are at least 5 versions of the app out there, {Google search for 'apktool 4.4' or '5.2', etc}, and it seems like each one works better on certain versions of Android. There are also configurable settings. If you have a different phone or rom, etc, you just have to mess around with it. - This app should work as normal apktool for modding systemUI and framework, but I can't get it to recompile on LP, but only on Kk. Decompile works fine, but on recompile it complains about lacking resources. I don't know what file it wants. If someone can figure it out that would be great. -If you don't know what files to change, all I can say is that I didn't either. Start with the obvious stuff, like navbar keys, and see how brave you get. Just make sure your file names are changed, since every app doesn't use the same names for the same files. As long as you work with copied files you have nothing to lose. If something is wrong with your modifications, then it won't recompile correctly, and you'll just get an error message, so you can't really install something that's going to mess up your phone. - This also works for changing appearance of other apps, not just themes. See my recent posts in the Naked Browser thread for examples. However, sometimes it won't be able to decompile an app, and there's probably nothing you can do. I think the way apktool works is based on how the app was created. If something is not compatible, it just won't work. - You don't have to decompile just to pull files out of an apk, but you do need an app that can do it. I use Rom Toolbox Pro. There may be free ones, {maybe Mixplorer}. I think you can just change the extension to zip and extract normally. However, some files and folders are not the same zipped in the apk as they are when decompiled. File link - https://drive.google.com/file/d/0B5E7sFT1phjoS003R0tkM21qUlk/view?usp=docslist_api
Nice tutorial bro :good:
Thank you very much! Sent from my D5503 using XDA Free mobile app
Since sharing themes with others' work is not kosher, (http://forum.xda-developers.com/crossdevice-dev/sony/share-frankentheme-t3282360), I figured I'd add a little more here for anyone's personal use. In general, here's what I've found with these themes: - Within each apk there is an 'assets' folder, which contains zip files. Each zip file mods a certain aspect of the ui. For example, there will be one for settings, which contains the little pictures next to each settings option, (personalization, with the little rainbow, etc). You can experiment with simply swapping these around with different themes. However, if you want to add a settings zip, for example, to a theme base that does not already have a settings zip in it, you have to mod the main android manifest file in the top level of the apk. If you want to see how it needs to be modded, look at one that has it already. It's pretty obvious, since it's the same entry for each zip, but with the corresponding zip name. You can also extract these zips and replace files in them and rezip. Keep in mind, though, that there are some things that aren't that simple and just won't work. - There are some things that are coded in, and can't be changed, (as far as I can figure out), like accent color. It seems like accent color just comes with the 'android' zip, and there's nothing you can do about it. As a workaround, you can find an 'android' zip with a color you like, and change out the other files from the zip you wish you could change the accent on. Again, sometimes it just won't work and you won't know why. - Some themes don't follow this pattern at all. I haven't learned much about them yet. Screenshots show examples I've used...
[guide]how to build/modify roms for samsung devices [7.0/6.0.1/maybe more]
Firstly, by no means, I am a great developer or an expert. I have been developing ROMS for Samsung Galaxy Note 5 lately. I was also a noob before making all this. But by reading various guides on XDA, learning from many many great developers/contributors on our Note 5 Forums and talking with various friends which I made on XDA, I know quite a bit about ROMS and MODDING in general. So, here I would like to share all which I have learnt so far, and will be updating this guide regularly. WARNING!I am not all responsible for what you do to your device, whether you blow it up, or you got late to reach your office, coz alarm never sounded, or your girl friend dumps you for not picking her phone(boy friend never do that).. Neither me nor XDA is responsible for that. CREDITS My brother, my teacher, my great friend, @andyaguilar94, who was the first I contacted ever via a PM and he was so kind to teach me stuffs and helped me learn whatever I have learnt today.... Thanks a lot bro... @CrsMthw and @Androidwizzard, for always helping me solving my issues with the ROM and being so so so and so humble to listen to all my crap and being a constant support to me... @karan2012, @pelpa87, @Ather, @diegonnec for being my great friends, helping me out in various things, pointing out my silly mistakes and being there for me anytime I needed them... @ASSAYYED and @zxz0O0 for their Awesome tools (Kitchen and SamFirm) If I forgot to mention anyone, I would love to add them to this list... PRE-REQUISITES BEFORE GOING FURTHER TWRP or any other Recovery installed on a rooted Samsung device NotePad++ WinRAR or 7-ZIP A Good knowledge of Windows Explorer A Samsung Device to test on A bit of patience and a lot of time Before beginning, I would like to tell you guys that this is not a guide to PORT some other device's ROM to your own device. This is just a guide to modify your own device's latest firmware available and making your own ROMS... Secondly, this should work on most Samsung Devices and most of the Android versions including Marshmallow (6.0.1) and Nougat (7.0) and could work on other versions as well CONTENTS OF THE GUIDE Okay, now coming back to guide, this guide will be divided in 5 sections:- Creating a very basic ROM using Kitchen Adding Basic Mods to the ROM (using CSC and Kitchen) Learning about updater-script syntax and adding external features to the ROM Learning about adding AROMA and about aroma-config syntax Last but not the least, some tips and tricks to make your ROM even awesome CREATING A VERY BASIC ROM USING KITCHEN Okay so, there are two ways of developing a ROM:- 1)Without a kitchen 2)With a kitchen (RECOMMENDED) I will cover the method using a kitchen as it is much more efficient and time saving. Futhermore, Without a kitchen method only works for already available flashable ROMS, whereas a kitchen allows making a ROM directly from the firmware zip file. INSTALLING AND KNOWING ABOUT ASSAYYED KITCHEN Okay so, kitchens are basically designed to make the life of ROM Developers a lot simplers. All the functions that a kitchen offers, can actually be accomplished using File Explorer as well. But, it would require whole lot of efforts and time. So, therefore, most of the devs out there, use one of many amazing kitchens available. For this guide, we will be using ASSAYYED KITCHEN (I know, that its development is stopped, but it has a great lot of features that are available in an easy to understand way...) So, first things first, lets download and install ASSAYYED KITCHEN Step 1:- Download the ASSAYYED KITCHEN from this official thread, by clicking here. Step 2:- Once downloaded, then copy the 7zip file to whichever directory you want to install this kitchen on your PC. Step 3:- Then extract the zip file using 7zip of WinRAR. Step 4:- If you didnt change the name of the zip file, you should see a folder named "ASSAYYED_KITCHEN_V1.82_STABLE", once extraction is completed. Step 5:- Inside this folder, you should see a folder named "TOOLS" and an exe file named "ASSAYYED". Run this exe file. Once it is loaded, you should see a black screen with a prethora of options. Step 6:- Now go back to the ASSAYYED Directory, where you had the "TOOLS" and this exe file, and you will be surprised to see three new folders:- "PLACE", "READY" and "WORK". Okay so, we are done setting up the kitchen, now before we begin our actual ROM Development/Modification, let me explain you what are these folders and what do they do. "PLACE" folder contains the base ROM zip files or your firmware zip files. This folder essentially contains the base ROM/FIRMWARE, that you are going to work upon. You will need to put the firmware zip (which I will tell you where to get) in this folder. This firmware will act as the base, on which you will make modifications and make your own ROM "READY" folder will contain your ROM zip files. This essentially has your ROM zips that you will make and flash on your device "WORK" folder contains the ROM files. As the name suggests, this folder is the one, we will be working on. This contains the entire ROM files (which I will explain later) "TOOLS" folder is nothing we have to worry about for now. It essentially contains some important files and applications we might need. As you must have seen, the kitchen has various options, and I can't explain all of them in one go, so I will explain them as we proceed through the guide. So, finally we are done with the kitchen and stuffs, now lets download the firmware for your latest device. Well, let me share with you, how I download firmware files... Firstly, download SamFirm Tool, by clicking here and selecting the latest zip from Post #1. Again, this is a depreciated tool, but it is important for downloading firmwares at high speed, because otherwise, if you download it from any website, they might charge you, or make the zip file available at slower speeds. Secondly, head to this website, and in the dropdown menu, select your device and check (dont download) for the latest firmware available for your Model Number and note the "Model" and "Region". USING SAMFIRMTOOL TO DOWNLOAD FIRMWARE Step 1:- Once downloaded, extract the SamFirm_v0.3.1.zip file (I told you to download above) in your desired directory. Step 2:- In the extracted folder (which should be "SamFirm_v0.3.1"), you should see a few files, but dont touch any of them, just launch the "SamFirm.exe". Step 3:- A new window will open and in that window, you should see two columns namely, "Firmware Info" and "Download". Step 4:- Put the "Model" and "Region" (which I told you to make a note of) in their respective sections inside "Firmware Info". Tick on "Auto"(If it is unchecked) Step 5:- Click on "Check Update". After this, it will process about the latest firmware and will eventually fill the details in the "Download" column. Step 6:- After this, you know the obvious step, click on "Download". Now sit back and relax, till the firmware is downloaded Step 7:- Once the firmware is downloaded, you should click on "Decrypt". Step 8:- After this, get to the "SamFirm_v0.3.1" directory (which contained the "SamFirm.exe"), and you should see a zip file. Step 9:- Copy and paste this zip file in "PLACE" folder of ASSAYYED kitchen (that we talked about earlier). Now finally, we have our firmware and kitchen in place, Now lets begin ROM DEVELOPMENT CREATING YOUR OWN VERY FIRST BOOTABLE ROM Step 1:- Launch "ASSAYYED.exe" from your kitchen directory. Step 2:- As you can see, from various options, we need to begin with the very first option that is, "START CREATING PROJECT". In ASSAYYED, we select options, by typing the number next to the option we want, and pressing Enter. So, for example, we need to select "START CREATING PROJECT", we know the number corresponding to it is "1", so we press 1 and then ENTER. Step 3:- After this, it basically asks Where to Get the Firmware, now, we know it is in "PLACE" folder and we see that the corresponding to "PLACE_FOLDER" is default. Now, I would like you to remember that specifically for this guide, wherever you see the word "default" in the kitchen, you just need to press Enter keeping it blank. So, I hope you got this. Step 4:- Now the kitchen will search in the "PLACE" folder for the necessary zip. Select the required firmware by pressing the number corresponding to it and then enter. For example, for your very first project, it will be "1", then enter. Step 5:- Now type the NAME of your Project. You can keep it anything or even leave it blank by pressing enter. Now sit back, relax, take a break and let the kitchen do its work. Step 6:- Once Extraction is complete, you should see something like "PRESS ENTER TO CONTINUE". So Press Enter and now minimise the kitchen and head to the "WORK" Folder. Now, explanation time , once you open the "WORK" folder, you should be greeted with 2 folders and a file. First would be a "META-INF" folder. This is the directory which TWRP or any other recovery looks for when you intend to flash anything. This folder is a MUST, without which no matter how good a ROM is, you will never be able to flash it using a recovery... Next would be a "system" folder. This is the directory which contains the main ROM, this will be the folder where we will be making small edits in various files to get various mods. Essentially, you can consider this folder as the full ROM itself. Lastly, there would a file by the name of "boot" or "boot.img". This file is essentially the stock kernel of your ROM. This is also an essential part of your ROM zip and you must tamper with this file unless you know what you are doing Now navigate inside the system folder. Here you will see loads of subfolders. Let me explain you about the contents of "system" folder: "app" folder, as the name suggests, contains various apps and services which will run on your ROM. If you navigate to this app folder, you will see another a huge list of subfolders. These subfolders contains apks for the apps. "cameradata" folder contains various files which are essential for the camera to work. "csc" folder is a folder which would be gem for modders. Most of the mods that you want in the ROM could be just be added with a single line, by modifying a file or two in this folder. "fonts" contains the various fonts which will be used in the ROM. "framework" folder is a very essential part of the ROM. It includes various jars and a few apks which are very essential for a ROM to function well. "lib" folder contains various lib files for the ROM. And one thing to keep in mind would be to NEVER tamper with "lib64" folder, because, if you do so, your ROM might never boot, however "lib" folder can be modified to some extent like deknoxing (which I will tell you about in future posts) "media" folder contains audio files including ringtones, notification tones, alarm tones and other System sounds "priv-app" folder contains another set of "privilaged apps". Privilaged, because, they require some special permissions to work "build.prop" is the most important file in your ROM. Without this file, your ROM will NEVER-EVER boot. Step 7:- Lets first start by changing your ROM NAME. Inside the system folder, head to build.prop file and open it with NotePad++. (A tip, we usually refer adresses instead of putting them in words like I just did, so from now on, I will say, for example, head to system/build.prop) Step 8:- Find this "ro.build.display.id" in build.prop (It should be in first few lines). Then after "=", there will be a string of alpha-numeric characters. For eg, in my case, it is "N920CXXU3CQD1". You might be having something different depending on your device. You can change this string to anything you want, for example in my N-FUEL Rom, I have put it as "N-FUEL-XL1-N920CXXU3CQD1". Hope, you got the idea. Step 9:- Now its time to flash your ROM. But hey, before flashing, you need a ROM zip, right. So head to the ASSAYYED kitchen and Look for "BUILD ROM FOR FLASHING"(Hint:- It is the 7th option). So as you know, we will type "7", then press Enter. Step 10:- Now since, we want a zip, and the number corresponding to a "ZIP" is "3". So type 3 and then enter. After this, it will ask you to review updater-script (I will tell you about updater-script and its syntax later in the guide), for now, leave it "N0", that is "default" (You know what to do when you see default). After this, it might ask you to zipalign apks. You can select this as "YES". Step 11:- Then, you should always keep the compress level to "5"(which is "default", as you can see). Then you will see that it is making the zip file. Then it will ask you to name your ROM zip. Once done Step 12:- Once completed, it will ask you to sign the zip, it is optional, however, I never signed my ROM zips though. Step 13:- Okay so, finally!! You have gone through the tough journey and are now on the verge of testing your own ROM. So, go ahead and go to the "READY" directory. You will see your very first build there. Step 14:- Now go ahead and put this zip in your Internal Storage and go to your recovery. First backup your current ROM or data. Then wipe system, cache, dalvik and data from your Recovery and finally FLASH YOUR ROM!!! In the next post, I will be talking about Odexed and Deodexed ROMS, Debloating stuffs and few other things... so stay tuned
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 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). 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 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
ADDING BASIC MODS TO THE ROM Okay so now, let me tell you how to make your ROM, a lot more interesting and enjoyable to use. Now, the next main purpose of building a custom ROM is to add what is not there in the STOCK ROM, and that is MODS. You can add huge loads of MODS, which are already present in STOCK ROM but are disabled by Samsung. Many mods, for example, adding DATA USAGE in Notification Panel or disabling SMS TO MMS CONVERSION are as simple as adding a single line in a file, however, other MODS, like enabling VIRTUAL LOCK BUTTON in Status Bar requires few and very easy modding after decompiling apks, on the other hand, coloring stuffs in the SystemUI, requires some good modding skills and experience in decompiling stuffs. Now, in this section, we will be discussing on adding basic mods, that is single line MODS, that I talked about earlier. So, first lets go through the easy stuffs, that is adding mods to build.prop. ADDING MODS TO BUILD.PROP Adding MODS to build.prop is actually very easy, and kitchen does all the stuffs. So follow the steps below and you will be good to go Step1:- Launch "ASSAYYED KITCHEN" and search for "ADDING BUILD.PROP TWEAKS" and select it. Step 2:- On asking for confirmation, just select "YES". Step 3:-Now, wait for a short time and once done Press ENTER, and now your ROM is much more smooth and fast. You can head to your build.prop (its in WORK/system) and look for those mods. Now these are some amazing mods, you can play with some values (but be sure of what you are doing) So, you've learnt on adding build.prop mods to your ROM. However, we are not limited to this, there are many other MODS to help you enable several things. Go ahead and read on XDA, and you will be surprised to know how many things, you can get by just changing some values or adding some lines in build.prop. Not only from XDA, but from other ROMS (but give appropriate credits to respect the efforts of the developer, who found it) Now comes the tough (well not tough but overwhelming) part of this guide, that is adding CSC Mods. WHAT IS CSC? The Customer Service Code (CSC) plays an important role in the operation of your Samsung mobile device. The CSC code ensures that your mobile device complies with the standards for your country, and your cell phone operator. Therefore, if we can change/add a few lines in our CSC code, we can actually get features which Samsung disables due to the standards for your country. Hope you get it. Now the main task is to find those lines, through which we can enable these features. So, we first locate , where to add/modify these lines. Now, navigate to your "WORK/system/csc". Here you will see many files and folders(maybe). Now, it is in this folder, that we make changes and mainly in the "others.xml" file. Now, open this file WITH NOTEPAD++ and you should see a lot of lines of codes which includes some value between <CscFeature...> </CscFeature...> or something like this. HOW TO ADD CSC MODS So by now, you know that what is CSC, and where to we add CSC Mods. Now lets learn how to add these MODS. Well, remember a main rule here and that is COPY AND PASTE. We basically copy a few lines from some other country's others.xml (for your particular device) to your own others.xml. Well, you can also copy these lines from some other Developer's work, but it is "MANDATORY" to give appropriate credits to the respective developer. Here, I am listing some (not all xD) of the CSC MODS/lines that I used in my ROM:- ENABLE CAMERA SHUTTER SOUND TOGGLE IN CAMERA SETTINGS:- Code: <CscFeature_Camera_ShutterSoundMenu>TRUE</CscFeature_Camera_ShutterSoundMenu> ENABLE REALTIME NETWORK SPEED TOGGLE IN SETTINGS:- Code: <CscFeature_Setting_SupportRealTimeNetworkSpeed>TRUE</CscFeature_Setting_SupportRealTimeNetworkSpeed> ENABLE NATIVE CALL RECORDING:- Code: <CscFeature_VoiceCall_ConfigRecording>RecordingAllowed</CscFeature_VoiceCall_ConfigRecording> DISABLE SMS TO MMS CONVERSION:- Code: <CscFeature_Message_DisableConvertingEffectBetweenSMSMMS>TRUE</CscFeature_Message_DisableConvertingEffectBetweenSMSMMS> <CscFeature_Message_DisableSmsToMmsConversionByTextInput>TRUE</CscFeature_Message_DisableSmsToMmsConversionByTextInput> ENABLE WHITE PAGES (YOU NEED THE REQUIRED APK WITH THIS LINE):- Code: <CscFeature_Common_ConfigSvcProviderForUnknownNumber>whitepages,whitepages,whitepages</CscFeature_Common_ConfigSvcProviderForUnknownNumber> ENABLE THE NFC ICON IN STATUSBAR:- Code: <CscFeature_NFC_StatusBarIconType>DEFAULT</CscFeature_NFC_StatusBarIconType> ENABLE DATA USAGE IN NOTIFICATION PANEL:- Code: <CscFeature_SystemUI_SupportDataUsageViewOnQuickPanel>TRUE</CscFeature_SystemUI_SupportDataUsageViewOnQuickPanel> Here, I have mentioned a few of many CSC Mods available for your devices. It is important to note that the above given codes are just to give you an idea. However, it is not necessary that all of the above codes will work with all of the Samsung Devices out there. If your device supports it then it will enable these MODS and if it does not then there will be no effect on the ROM. This is the beauty of CSC Mods, that if they are not compatible with your device, it will not affect your ROM/device in anyway. So, keep on adding MODS by reading, learning, copying and then pasting xD from other places. Now after this, in the next section, we will discuss about updater-script and its syntax which will help you add various zip files directly to your ROM, so stay tuned for next upcoming posts, as they will be one of the most interesting parts of this guide
LEARNING ABOUT UPDATER-SCRIPT SYNTAX AND ADDING EXTERNAL FEATURES TO THE ROM Now comes the most interesting part of making ROMS (at least, according to me), and that is updater-script. Now, I would like you to navigate to "WORK/META-INF/com/google/android" and there you should see two files, namely, "updater-script" and "update-binary". Now, I will explain you first, What is updater-script, what is its essence and how is it so beneficial and interesting in ROM Development. LEARNING ALL ABOUT UPDATER-SCRIPT (PART 1) So, first of all, what the heck is this updater-script. It is basically the file, which instructs TWRP (or any other recovery) what to do with the zip (your ROM or any other flashable zip). Without this, you cant flash anything on your device (well, this is a lie). But, in flashing ROM, this is very important. So, now lets learn about the updater-script syntax Well, before this, I need to tell you something and that is, how a recovery actually flashes a zip file (This is what I assumed). So basically, when we flash a file, the recovery looks for update-binary inside "META-INF/com/google/android" in the zip file. This update-binary, then tells the recovery, whether the zip has to be installed with a STANDALONE INSTALLER or AROMA INSTALLER. If the recovery founds out that the zip has to be installed by a standalone installer, it then goes to the updater-script, which HAS to be in the same directory as update-binary and says, Hey dude, can you tell me, what I have to do with this zip file. Hence, the updater-script basically instructs the recovery about what to do with the zip. So, having know about updater-script and its essence, lets now discuss about the syntax or the language in which we can write the updater-script. NOTE:- THIS IS NOT AN UPDATER-SCRIPT GUIDE, SO I WILL ONLY LET YOU KNOW OF THE IMPORTANT KEYWORDS OR OTHER SUCH STUFFS REGARDING ROM DEVELOPMENT. HOWEVER, THIS IS WHAT I HAVE LEARNT AND SO FAR, IT IS MORE THAN ENOUGH. MOREOVER, IT IS ESSENTIAL, THAT YOU PAY FULL ATTENTION TO THE UPCOMING SECTION. LASTLY, IT WILL BE GOOD, IF YOU HAVE SOME PROGRAMMING BACKGROUND, BUT IF YOU ARE NOT, I WILL TRY TO BE AS SIMPLE AND STRAIGHTFORWARD AS POSSIBLE LEARNING ABOUT UPDATER-SCRIPT SYNTAX So, for this, first open the updater-script with Notepad++, and you will be astonished to see a huge loads of lines. You would be like, what the heck does this mean. I am gonna explain you most (if not all) of the stuffs here. 1) ui_print(""); So, we first begin with ui_print. So, what this does is that, anything you put inside the double quotes (" "), it will print it out directly into the installer screen. (For my programming dudes if you learned about C or C++, it is like cout<<" ") Now, lets me explain this better with an example, here is a piece of code and its output Code: ui_print("Hello, I am learning about ROM Building/Modification"); And its output in the recovery: Code: Hello, I am learning about ROM Building/Modification Hope you got the idea, now let's go to next one. 2) run_program("/sbin/busybox","mount","/system"); This is basically a modified command. The original command (run_program()) is used to run many in-built programs available in Recovery. You will explore many versions of this command as you head forward in ROM Development. Now, what this specific command does is that, it mounts the "system" partition of the device. Now, a few of you may ask, why do we require mounting. Basically, without mounting a particular partition, we cannot modify (Add files or remove them) the partition altogether. So, I hope that now you understand, why mounting is so important. In ROM building, we usually need to mount system, data, cache, and dalvik. So, you will always see the following set of code in the beginning of any updater-script of a ROM. Code: run_program("/sbin/busybox","mount","/system"); run_program("/sbin/busybox","mount","/data"); run_program("/sbin/busybox","mount","/cache"); run_program("/sbin/busybox","mount","/preload"); 3) delete("/file_path"); As the name suggests, it deletes a file located on your device. You need to specify the exact file directory in double quotes inside the parenthesis. For example:- Code: delete("/system/priv-app/SystemUI/SystemUI.apk"); Code: The above line (when running in a recovery) will delete the SystemUI.apk 4) delete_recursive("/directory); As the name suggests, this command deletes a directory or even format a partition. It differs from the delete(); command in its working. delete_recursive() deletes a directory while delete() command deletes a file. (Too many deletes in a line) For example:- Code: delete_recursive("/system/priv-app/SystemUI"); Code: Note that in the above command, the Recovery will delete the SystemUI folder as well its contents. Another use of this command is in formatting the partitions. As you know, flashing a ROM basically means, we need to extract the contents of the system folder in your zip file to the system partition of your device. So, whenever we flash a new ROM, it is always advised to wipe cache, dalvik and system. Code: delete_recursive("/system"); delete_recursive("/cache"); delete_recursive("/data/dalvik-cache"); Code: The above code will firmat the necessary partitions 4) package_extract_dir("zip_directory","/directory_on_phone"); This is a very simple and an important command. What it, essentially does is that, it extracts a folder in your zip file to another folder on your device. Let me explain you, with an example:- Code: package_extract_dir("system","/system"); {Notice in the [B]/[/B] sign in the second parameter, and this is absent in the first parameter} Code: What the above command essentially does is that it extracts the [B]system[/B] folder in your ROM zip to the [B]system[/B] directory of your device. Let's understand this with a few more examples:- Code: package_extract_dir("system/app","/system/app"); Code: The above command will extract the app folder in the system inside your ROM zip to the app folder in the system directory of your device. Code: package_extract_dir("MODS/SystemUI","/system/app/SystemUI"); Code: Do it urself Code: package_extract_dir("MODS/SecSettings2","/system/priv-app/SecSettings2"); Code: Do it urself 5) symlink("file_name1", "file_name2"); This is a piece of code, which you will never be needing! But I am explaining this here, because, a big amount of updater-script. So, we won't go, into much detail of this command, just an overview. Now, this command basically creates a symbolic link between two files. A symbolic link is where a file has one main name, but there is one extra entry in the filename table that refers any accesses back to the main name. Code: symlink("/system/lib/libQjpeg.so", "/system/priv-app/SelectiveFocusViewer/lib/arm/libQjpeg.so"); Code: This command created a symbolic link between [B]"/system/lib/libQjpeg.so"[/B] and [B]"/system/priv-app/SelectiveFocusViewer/lib/arm/libQjpeg.so"[/B] 6) set_perm(uid, gid, permissions, "file_name_with_adress"); This is quite a useful command, as it helps giving necessary permissions to various files in android. Now, basically, permissions are required for a particular file, which might require some special privilege, in order for it to complete an action. For example, Android cannot allow any file on the system to format the device, formatting can only take place if a file has necessary permissions from Android itself. So, I hope, you got the point why are permissions so important in Android. Now let's understand the syntax of the above command, which will help give permissions to various Android Files Code: set_perm(uid, gid, permissions, "file_name_with_adress"); Now, this statement itself has many parameters as you can see. Now, I will limit myself to only explain you the things, which is necessary for ROM development. Now the "UID" and "GID" are UserID and GroupID. (They are a little tough to explain and beyond the domain of this guide, so I will just give a brief description). They are essentially an important part of Android Permissions, and they are usually integers. Don't worry, we will look in the following example about how this works. Secondly, permissions are like rw-r-r or rwx-rw-rw. Now, if you have been using Linux for a while, you know what these means. Lets understand this, by taking rwx-rw-rw as an example:- Now the first section, i.e., "rwx" is the permission set given to the "Owner" of the file, the second section i.e., "rw" is the permission set given to the "Group", and the third section, "rw" is the permission given to "Global". They might seem a bit overwhelming, but bear with me, these have very little role, as far as, ROM development goes. Now coming back to the command, the permission, there is used in an Integer form. Now, I am putting out a link here, if you want to know, how these permissions are converted to integers... (https://unix.stackexchange.com/a/39712). Essentially, you will only need two permissions, 0644 and 0755. Out of these, 0644 will always be given to an apk, while 0755 will always be given to a folder. (0644 -> rw-r-r and 0755 -> rwx-rx-rx) Code: set_perm(0, 0, 0777, "/tmp/wipe.sh"); Code: Now, the above command essentially gives the permission [B]"rwx-rwx-rwx"[/B] to the file "/tmp/wipe.sh". 7) set_perm_recursive(UID, GID, perm_directory, perm_files, "directory_name"); Now, this is very similar to set_perm(), but the only difference is that this gives permission to an entire directory and its contents. Let's look at an example... Code: set_perm_recursive(1000, 1000, 0775, 0644, "/system/framework"); Code: This command gives "/system/framework" directory 0775 permissions and all its contents, 0644 permissions. (0775 -> rwx-rwx-rx). So guys, in this post, I have tried to cover most of the essential Edify Scripting command, you will ever need in your ROM Development journey. I will be talking about a few more commands after we talk about aroma-config in the next post. I am posting out a link, which will help you find more such commands:- https://forum.xda-developers.com/wiki/Edify_script_language. Now, we are done with Updater Script commands (Part 1). In the upcoming post, we will talk about Aroma-Config and after that, we will look at Updater Script Commands (Part 2). So stay tuned and see you guys in the next post.
one more
last one
actually one more
Great aman!!! It looks very nice!! Tonight ill be reading it!!!
congratulations....great thread...keep it high
You don't have to thanks to me bro, I'm really happy to see you over here, teaching to the rest Congratulations bro, a lot, you will be great
Great thread man !! congrats
This is the true meaning of: Sharing is Caring [emoji106] [emoji122] Sent from my SM-N920C using Tapatalk
Wonderful .. amazing discribtion .. you made all of us developers :good::good::good:
Thanks everyone for reading the guide and giving the feedbacks. I just updated the guide. Now, it includes Deknoxing, Debloating and Deodexing a ROM, and also some good information about each of them. So you can now move further in your ROM
Great work @AndroidSword all the best for future progress on this thread :good:
tnx very good guide simple and clear keep up good work
Awesome! greatly appreciated for making this guide. Im gonna dive into the deep now
hi in ASSAYYED_KITCHEN_V1.82_STABLE when remove bloat the kitchen just make a folder in WORK\BLOAT not change the name of app waiting for part2 tnx
Eveything I've been doing for months manually with Rom Raider, Step Flashing, Etc. all here, its a f*&%&ing miracle. Hvaent flashed te rom yet but it's doing what I did. Knox removal could be a little more involved but I already know where all that crap is. If this gets my SE into Perm mode I'm gonna dance a jig, Thanks for the tutorial. And thanks to the Devs for the awesome crazy work put into this beautiful machine. When I edit the build.prop with c++ note do I save it as a "properties" file? I'm assuming cause mine was fudged from accidentally making it a .txt using reg notepad a few weeks back. Dunno how my ROM was working but there's 4-5 other encrypted style build.prop files in there. I'll post example. "build.propwjO0d4" it's written in alien lingo like alot of the sec files are. I'm assuming I only need one I'm thinking copypasta my og buildprop info into one of these and renaming?
Guys, next section of the guide is there in Post#3, so go ahead and do MODS to your ROM as per your requirements