[Android] Aadi:
Modding Files And Stuff

Step 3:- Modding Files And Folders To Make Your Device Supportable.​

First up is to compile a build of ClockworkMod.

Building ClockworkMod:-

1. Open Terminal

2. Type these commands one by one in Terminal

. build/envsetup.sh
lunch (it should show you list of devices select your device with their serial number select your device by typing the serial number)
make clean
make -j4 recoveryimage

If you didn't receive an error you are ready to compile TWRP for your device.

If you do receive and error reply to the post I will help you.

Modifying Files And Folder:-

The original Dees_Troy's build folder isn't gonna work as your device resolution doesn't support it. So I have patched the build folder with some extra libs added to prelink map and patched recovery folder with gui changes for smooth compilation.

If you are going to clone execute these commands in terminal. (Thanks to cybojenix for this so that there will no manual copying).

cd source
rm -rf build/
rm -rf bootable/recovery/
git clone git://github.com/chainhacker/TWRP_Build -b 2.3 build
git clone git://github.com/chainhacker/TWRP_Recovery -b 2.3 bootable/recovery

If you are going to download directly use the following link make sure you are downloading 2.3 branch and extract it.

Here is the link for the patched build folder------>TWRP_Build

Here is the link for the patched recovery folder------>TWRP_Recovery

After you have done downloading from the above two files.

Replace the contents of source/build folder with the patched one.

Similarly replace the contents of source/bootable/recovery folder with the patched one.

I have 240x320 resolution already in the patched ones but if your device is not 240x320 and also not supported by TWRP download a theme made by other members which has your device's resolution or create a theme. I didn't create the theme though I resized the images and made changes in ui.xml. If you are interested in theming follow the official TWRP theming guide in their website.

If you did find a theme or created it rename the theme folder to your device resolution folder for e.g. If your device resolution is 320x240 you would rename the folder as 320x240.

Copy the theme folder into source/bootable/recovery/gui/devices.

That's it finished the basic requirements next up is configuring BoardConfig.mk.

Editing BoardConfig.mk:-

1. Navigate to source/device/your_vendor/your_device.

2. Find BoardConfig.mk and open it in a text editor.

3. Come to the last and add these line

#twrp
DEVICE_RESOLUTION:= [I]your_device_resolution[/I] (e.g If your resolution is 240x320 type it)
RECOVERY_GRAPHICS_USE_LINELENGTH := true

2. Save it and close it.

Yay you have finished everything only thing left out is compiling :D which is carried out in the next post.

Psssst.......

After you have compiled your first successful build here are few other things that you could add to BoardConfig.mk

RECOVERY_SDCARD_ON_DATA := true -- this enables proper handling of /data/media on devices that have this folder for storage (most Honeycomb and devices that originally shipped with ICS like Galaxy Nexus)
BOARD_HAS_NO_REAL_SDCARD := true -- disables things like sdcard partitioning
TW_INCLUDE_DUMLOCK := true -- includes HTC Dumlock for devices that need it
TARGET_RECOVERY_GUI := true -- uses gui format instead of ui.xml
TARGET_RECOVERY_PIXEL_FORMAT := "RGB_565" -- to change the colour
TARGET_USE_CUSTOM_LUN_FILE_PATH :=/sys/devices/platform/usb_mass_storage/lun0/file
TW_CUSTOM_POWER_BUTTON := 107 -- to get a power button on the home screen of recovery
TW_EXTERNAL_STORAGE_PATH := "/sdcard" -- default external storage path
TW_EXTERNAL_STORAGE_MOUNT_POINT := "sdcard" -- default external mount point
TW_FLASH_FROM_STORAGE := true -- enables you to flash zips form the sdcard (You don't neeed o add this it is activated by default)
TW_HAS_DOWNLOAD_MODE := false -- to enable download or more precisely enabling usb mass storage
TW_HAS_NO_RECOVERY_PARTITION := true -- do this only if you device has no partion to recovery
TW_INCLUDE_CRYPTO := false
TW_INCLUDE_JB_CRYPTO := false
TW_NEVER_UNMOUNT_SYSTEM := true -- always keeps the system mounted
TW_NO_BATT_PERCENT := false -- shows battery percentage
TW_NO_REBOOT_BOOTLOADER := true --- disables rebooting into bootloader
TW_NO_USB_STORAGE := false -- disabled usb storage
TW_SDEXT_NO_EXT4 := false