[Galaxy 3 Android Development] Dharam_Maniar:
4) ROM Basics, Tutorials

​

STOCK ROM

A stock ROM is the version of the phone's operating system that comes with your phone when you buy it.

Samsung letter code

AW-Hungary AZ-France BD-Cyprus, Greece BY-Greece CB-Poland CE-Benelux CP-Denmark, Finland, Norway, Sweden DB-Vietnam DC-Thailand DD-India DT-Australia DX-Indonesia, Malaysia, Philippines, Singapore, Vietnam DZ-Malaysia, Singapore JA-South Africa JC-Algeria, Morocco, Nigeria, South Africa, Tunisia JP-Arabic JR-Arabic JV-Algeria, Egypt, Iran, Iraq, Kuwait, Morocco, Nigeria, Oman, Pakistan, Saudi Arabia,South Africa, Syria, Tunisia, Turkey JW-West Africa JX-Algeria, Egypt, Iran, Iraq, Kuwait, Morocco, Nigeria, Oman, Pakistan, Saudi Arabia,South Africa, Syria, Tunisia, Turkey KA-Turkey ME-France MK-Serbia MS-France, Germany, Italy, Netherlands, Portugal, Spain, Turkey, UK MT-Switserland MY-Italy NH-Latvia PO-France PU-Russia UB-Brazil XA-Austria, France, Germany, Italy, Netherlands, Switzerland, United Kingdom XB-Denmark, Norway, Sweden XC-Portugal, Spain XD-Croatia, Czech, Hungary, Slovakia XE-Bulgaria, Estonia, Kazakhstan, Latvia, Lithuania, Russia, Ukraine XF-Bulgaria, Croatia, Romania XP-UK, France, Italy, Spain, Netherlands, Poland, Portuguese, Turkey XX-Austria, Belgium, France, Germany, Hungary, Italy, Spain, United Kingdom XW-Austria, Belgium, France, Germany, Hungary, Italy, Spain, United Kingdom ZC-China, Hong Kong ZH-Hong Kong ZS-China, Hong Kong ZT-Taiwan

Custom ROM

A custom ROM is a fully standalone version of the OS, including the kernel (which makes everything run), apps, services, etc - everything you need to operate the device, except it's customized by someone in some way.

So what does the "customized" part mean? Since Android is open source, developers are free to take stock ROMs, modify them, strip them of garbage, optimize them, add things, and pretty much do whatever their imagination and skills allow.

Flashing

Flashing Process is basically, installing a new ROM/Kernel, Stock/Custom, via Odin.

Odin is a software used to flash ROM's to the phone in the Download Mode.

Odin used for Galaxy 3 is v4.252.

Steps to follow:

1) Install Samsung Kies

2) Connect phone to PC and let it detect and install drivers automatically.

3) Download Odin with ops file from here.

4) Extract them to some folder.

5) Run Odin as Administrator.

​

6) Odin will now open.

​

7) Put phone in download mode. (Vol Down + HOME + POWER)

8) Connect Phone to PC via USB and wait till Odin shows detected.

​

9) Select One Package.

​

10) Select .ops file and .tar file for flashing.

​

11) Press Start button.

12) Wait till the message box on odin shows the following message and phone reboots.

​

13) You have now successfully flashed new ROM / Kernel.

Rooting

Rooting is a process that allows users of cellphones and other devices running the Android operating system to attain privileged control (known as "root access") within Android's Linux subsystem, similar to jailbreaking on Apple devices running the iOS operating system, overcoming limitations that the carriers and manufacturers put on such phones.

Most retail devices running the Android operating system must be rooted in order to install custom versions of the Android system such as CyanogenMod. This is because in the stock configuration (unrooted), user-installed applications do not have direct access to the flash memory chip on the device and, thus, are not able to replace or modify the operating system itself. Rooting is also necessary for certain applications and widgets that require additional system and hardware rights such as for rebooting the phone, certain backup utilities, and other access to other hardware such as status LEDs. Rooting is also needed to disable or remove manufacturer-installed applications such as City ID. Rooting the phone typically also includes installing an application called Superuser that supervises which applications are granted root rights.

Steps to follow:

1) Download SuperOneClick - Download

2) Run SuperOneClick

3) Press on Root

4) It will show "Waiting for device"

5) Put your phone in USB Debugging Mode.

6) Connect to PC via USB Cable.

7) Press Yes, for the subsequent messages that follow

8) Done

Deodexing

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.

Steps to follow:

1) Download xUltimate - Download

2) Run Main.exe

3) Press N to continue

4) Press Y to continue

5) You should get a complete menu

6) Connect phone to PC in USB Debugging Mode

7) Run Option 1

8) Run Option 2

9) Run Option 3

10) Run Option 4

11) You Will now have deodexed apps and framework files in done_app and done_frame folders.

12) Copy these folders where you have your adb setup.

13) Run the following Code

adb -d shell "mount -o remount,rw /dev/block/stl6 /system"
adb -d shell "stop"
adb -d shell "rm /system/app/*.apk"
adb -d shell "rm /system/app/*.odex"
adb -d shell "rm /system/framework/*.jar"
adb -d shell "rm /system/framework/*.odex"
adb -d push done_app /system/app/
adb -d push done_frame /system/framework/
adb reboot

14) Your phone should reboot successfully, and you now have a deodexed ROM.

Clean ROM

The following list of files you can delete to clean ROM

1) BuddiesNow

2) Dlna

3) DualClock

4) FlashSVGPlayer

5) HTMLViewer

6) InfoAlarm

7) InputEventApp

8) Layar-samsung

9) Maps

10) MobileTrackerEngineTwo

11) MobileTrackerUI

12) Protips

13) SamsungApps

14) SamsungWidget_CalendarClock

15) SamsungWidget_FeedAndUpdate

16) SamsungWidget_ProgramMonitor

17) SamsungWidget_StockClock

18) Street

19) UNAService

20) UnifiedInbox

21) VoiceRecorder

22) wipereceiver

23) WriteandGo