Build Custom Android Rom Yourself

#!/

Uzman üye
9 Mar 2016
1,323
2
TEM
Build Custom Android Rom Yourself

0.1 Preparations & Warnings​


*You need to setup any linux distribution but i highly recommends the Ubuntu.

*You need to have almost +400 GİBs of disk storage.


*You need to have limitless internet connection

*We will use the LineageOS rom's sources so if your device isnt has this rom; then you need to search in another sources.

*There are a few terms of these sources;
Device Tree is defines the device's preconfigured system informations.
Vendor Tree is defines the device's brand camera and like this informations.
Kernel Tree is defines the device's abilities like cpu infos, power management and many...
Common Tree is for a little device for defining general infos.

*These works are have potentially damage effect, please use these works via taking backups and cautions.

*Your Android device's boot loader must be unlocked and TWRP custom recovery must be installed, if not; you can search the YourDevice'sBrand unlock bootloader in Google and for TWRP; please install it via "Official TWRP App" in Play Store . I recommends to do this process from your device's official website. Unlocking boot loader lock is will abolish the your Android device's warranty.

*I and TurkHackTeam aren't responsible for any bricked devices and lost datas, please do these process with your caution

1.0 Downloading The Sources

Now lets start firstly to download the your desired custom rom's sources.

Go to your desired rom's GitHub page and you will see a link called "manifest". All rom developers are shares their rom's build instructions into this link. i will look for Aosp Extended rom:

RQvTGo.png


After click that manifest link; a ReadMe page is welcomes to you. You can see all the build requirements and the building process for unsupported (unofficial) devices.

As you can see in the How To Build page; you need to enter some commands in your computer's Linux terminal. Our first command is will be repo init. This command will download the your desired rom's source code. Be aware of on top left branch (android version).

If you want to build Android Ten, then;

5K4ynD.png


click this and select 10

55vCM.png


And do what says that your desired branch like our process (android version like Nougat etc)

Now open terminal and run these commands:

Kod:
mkdir ~/bin

Kod:
PATH=~/bin:$PATH

Kod:
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

Kod:
chmod a+x ~/bin/repo

Kod:
apt-get install bison build-essential curl ccache flex lib32ncurses5-dev lib32z1-dev libesd0-dev libncurses5-dev libsdl1.2-dev libxml2 libxml2-utils lzop pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev git-core make phablet-tools gperf openjdk-8-jdk -y

Now enter these commands in your /home folder:

Kod:
mkdir YourDesiredRom

Kod:
cd YourDesiredRom

And run these commands:

Kod:
repo init --depth=1 -u git://github.com/AospExtended/manifest.git -b 11.x
(this -b 11.x so branch equals 11.x meaning to android Eleven)

Kod:
repo sync -c -j$(nproc --all) --force-sync --no-clone-bundle --no-tags

Now lets start with download your device's preconfigurated sources. By saying sources; you need to get all device sources in GitHub. These sources are includes; Device tree, Kernel tree, Vendor tree and for a little device a Common tree.


Lets find these sources in LineageOS rom sources via GitHub. We are looking for LineageOS rom's sources because LineageOS is have most of device support. First go to this GitHub's LineageOS site:

https://github.com/LineageOS

and search for the Trees in:

5ENjn.md.png


For check your Device Tree, write device_YourDevice'sBrand_YourDevice'sCodename.

The basic rule is android_device_brand_codename for example "android_device_google_redfin" so this will search for Google's redfin codenamed Pixel 5 phone.

If you find Device tree, then lets clone it.

for example:

Kod:
git clone https://github.com/LineageOS/android_device_google_redfin -b MatchingTheDownloadedRom'sBranch device/google/redfin


For kernel tree, write in the search bar like Device tree just like kernel_Brand_Codename

Now download Kernel Tree:

Kod:
git clone https://github.com/LineageOS/android_kernel_google_redbull -b MatchingTheDownloadedRom'sBranch kernel/google/redbull

or change in search bar the codename to msm chipset (e.g msm8953)


(this command is for redbull codenamed device)


Now lets download the Vendor tree, its like other trees so search for vendor_Brand_Codename. If you cant find the Trees, then you can search in generally GitHub like this:

hFmBOZ.png


Kod:
git clone url -b branch vendor/Brand/Codename

as you can see to that paths; the all of these are matters the url link so
https://github.com/TheMuppets/proprietary_vendor_samsung this must download in vendor/samsung dir so "_" (underscore) equals to "/" (directory) path.

For understand if you must download the also Common Tree, just go to your downloaded the Device tree and check the rom.dependencies file. Open it and if you can see the Common word, then you must download this also.

2.0 Matching The Trees To Both Of Rom and Downloaded Sources

Now lets match our device's source to our desired so downloaded rom source.

Kod:
cd device/Brand/Codename

and you should see these files:

RomName.dependencies
RomName_codename.mk
vendorsetup.sh
AndroidProducts.mk

firstly change the rom.dependencies file to your desired rom's rom.dependencies. You can learn this by going to:

AvDgto.png


As you can see, we looked for Xiaomi's Kenzo codenamed device tree:

SBdjdC.png



Change the RomName.dependencies to aosp.dependencies.

Change the RomName_codename to aosp_codename

Enter the AndroidProducts.mk and change the RomName to aosp like this:

C2BojX.png


Enter the vendorsetup.sh and add:

add_lunch_combo aosp_codename-userdebug

(Note: this is not for upper than Android Oreo, for upper versions; please look for commit changes in GitHub)

Enter the RomName_codename file and change the:

Kod:
$(call inherit-product, vendor/cm/config/common_full_phone.mk)

to:

Kod:
$(call inherit-product, vendor/aosp/common.mk)

and:

Kod:
PRODUCT_NAME := RomName_Codename
(like aosp_kenzo)

like this commit:

9PMtOf.png


(link: https://github.com/AospExtended/dev...f5a67f4e6b6f60f1a709fd6023887f2cd814f24466aef , https://github.com/AospExtended/device_xiaomi_kenzo/commits/nougat )

2.1 Building The Rom


Now go to root directory of rom source and run these commands especially referencing your desired rom's manifest page on GitHub:

Kod:
source build/envsetup.sh

Kod:
lunch[code]

select the your device's codename.

[code]m aex -j$(nproc --all) | tee log.txt

If you arent got any errors, then the build process will start and it can takes 7,8 hours so it depends the your computer's system.

3.0 Flashing The Built Rom

After build is done, you must see a finish output like this:

5lByc.md.png


Go to this rule and copy into your Android device.

Please copy your important datas like photos to your computer due to any data loss.

Now go to your TWRP Recovery and press you microSD card and navigate to backup -> select all and select storage to microSD and swipe to backup due to any potentially bootloop (brick) errors.

After backup, press wipe -> system, data, dalvik cache, cache and swipe

(this will remove all of the your datas like pictures, files etc)

Navigate to install -> select rom zip and swipe to flash and after installinh done, press reboot system.

Please wait almost 10 mins and if device isnt open so stucking at boot animation or device brand logo; then go to your TWRP recovery and press restore -> MicroSD -> Select backupped folder and press restore.

This process will restore your lastly backupped all system, so it will fix your rom's issue. For fix it; you can join any Android Rom Developers groups in Telegram and discussion about your issue.



 
Son düzenleme:
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.