[GUIDE] HOW TO BUILD ANDROID FROM SOURCE [2020 Edition]
Breadcrumb
vsoma
Senior Member
[NOOB-FRIENDLY] HOW TO BUILD ANDROID FROM SOURCE CODE [2020 EDITION]
Introduction
Hi, my name is Varun, during the times I was building I faced some trouble building, and I thought it would be helpful if I put together a guide that covers every aspect of building. Many roms fundamentally differ so this is a generic guide, but when it comes to modifying device specific files you are going to have to refer to your rom developer or your device tree maintainer.
I see a lot of lead devs referring to older guides on xda, and felt like there should be a good reference thats more recent.
I have heavily depended upon Nathan Chance’s Guide which can be found HERE. I feel like this may be a little intimidating for new builders hence this thread. I will slowly upload screenshots here as I find time. But for now this is what I have. You can find my guide HERE. If there are any changes to be made in this thread then it also needs to be changed on gh, so please do comment or make a pr and fix what is requested.
Table of Contents
1) Getting started
2) Prerequisites
3) Understanding the DOC
4) Preparing Linux environment
5) Getting the source
6) Getting device specific files
7) Building
Understanding This Doc
PREPARING LINUX ENVIRONMENT FOR BUILDING
• Now the you have finished setting up, a special environment is required for building.
• Preparing the environment is as easy as double clicking .exe in Windows or .dmg in MacOS
thanks to developer Akhil N.
• We need to clone his scripts (installer) from his GitHub
NOTE:
A script is a file which contains multiple commands that run sequentially when executed
• This should copy the scripts to directory /home/username/scripts
• Cd into the directory called setup
• Find the file that corresponds to our Linux build. Since we are using Ubuntu it will be android_build_env.sh
For other Distros refer to the readme that has also been cloned
• Setup GitHub using on screen instructions
• Congratulations you set up your computer for building
• Go back the previous dir that you were originally on (/home/username)
GETTING THE SOURCE
• This is probably one of the worst steps, you have to wait a while
• GCloud users will be able to download source in 15 minutes
• Other users may have to wait longer (depends on internet connection speed)
• Make a directory for your ROM
NOTE:
this will make folder in directory home/username/romname
• Cd in and initiate repository, this basically tells your computer where to download source files from.
The repository initiation command can be found on the GitHub page under “manifest” then scroll down to
repo initialisation and copy command
• It should look like
NOTE:
1) Linux users can paste into terminal using Ctrl + Shift + V
2) Linux users can copy from terminal using Ctrl + Shift + C
3) GCloud users can paste into window using Ctrl + V
4) GCloud users can copy from window simply by highlighting
5) GCloud users using ssh from terminal can just follow terminal commands
• Once repo is initialised, you can begin download using
GETTING DEVICE SPECIFIC FILES
• As most of you know the kernel acts as the translator between the OS and your actual hardware
• The files mentioned above are android version specific and will only work with that android
version
• The developer for your device aka dt maintainer will have these files on their GitHub and its
usually linked at the end of the op of other rom threads in the source code section
• You have to make sure that the rom version you downloaded matches up
• If the device tree is for an older version then wait until your dev. releases the latest trees, if no
developer is working on your device then it is possible to modify the tree to work with newer
version of android but it may take some effort.
• In case your tree doesnt match with the rom version that you have downloaded, the easiest and best option is
to scrap everything and download the source version that your tree is designed for
• To scrap everything, use
• To modify the init command to download an older version you need to pick out the branch you
need (the branch is basically the version the newer version is added to a new branch)
• Change the init command after -b to include desired branch. For example
repo init -b ten to repo init -b seven
• To get the device specific files, we need to fork them to your GitHub.
Find the stuff (kernel vendor device tree hardware) and fork them
NOTE:
Forking basically copies them to your GitHub
• At this point we need to know if we need to modify the device tree as some ROMs don’t require
you to modify it (CrDroid)(LOS)
• Some roms require only partial modifications, this is rom specific so I wont be going too much into detail
• If modification is required follow these steps , otherwise skip to the end of this section
• After forking we need to modify the files we will do this from the browser for ease of
understanding
•There are three files that need modification and they are located your device tree
• Some tree developers may split your device tree into two parts if there is more than one phone
running the same SOC, so keep an eye out for that. (devices that have the same soc are like the op3/op3t and the op7/op7p)
• The files that we need to modify are under your «device codename» device tree, not «device SOC-common» device tree.
• For example; we need to go to «device_samsung_crownlte» tree not «device_samsung_universal9810-common»
• In here the three files that need modification are
1) Android Products.mk
2) lineage.dependencies
3) lineage_»device codename».mk (example:lineage_crownlte.mk)
• First open AndriodProducts.mk Here replace wherever you see lineage with name of ROM in lowercase only.
• Second, open lineage dependencies.mk and rename file to «romname».dependencies (ecample: aim.dependencies)
• Third, open lineage_»codename».mk and rename to «romname»_»codename».mk and replace
lineage with «romname in the code. (Remember,use lowercase)
NOTE:
If you are building an older version of android make sure you branch out the right branch for your trees
People who do not need to modify can join us here
• Now that all your files are in your GitHub, we need to download them
• There are two easy ways
1) Fast and easy Room Service
2) Slow and boring manual cloning
• Room Service
1) cd into .repo from romsource
Источник
[Android][Guide]Hacking And Bypassing Android Password/Pattern/Face/PI
Breadcrumb
piraterex
Senior Member
Requirements:
The Device Needs To Have Usb Debugging Enabled
In Case Usb Debugging Isn’t Enabled And You Have Recovery,you Can Run The Same Instructions From Recovery
For Some Methods Root Is Not Required (Though It Will Be Better If Device Is Rooted)
If None Of This Methods Works For You — Unfortunally You Probably Must Full Wipe Your Device
Solution For Everyone With Recovery (Cwm, Twrp, Xrec,Etc. ) Installed:
1. Download this zip Pattern Password Disable (Download from attachments) on to your sdcard (using your PC, as you cant get into your phone, right )
2. Insert the sdcard into your phone
3. Reboot into recovery mode
4. Flash the zip
5. Reboot
6. Done!
Note : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.
METHOD 2
Solution For Everyone Without Recovery Installed — ADB :
What You Need:
=>A computer running a Linux distro or Windows+Cygwin
=>USB cable to connect your phone to the PC
=>Adb installed
How to install adb:
1. Open Terminal
2. Type:
Hit [Enter]
3. Follow the instructions until everything is installed.
INSTRUCTIONS:
1. Connect you (turned on) Phone to the Computer via USB.
2. Open a terminal window.
3. Type:
4. Done. Now You Just Have To Reboot.
Note : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.
METHOD 3
Solution For Everyone Before Lock Accident :
SMS Bypass — Download Link — Install It On Your Device (Download from attachments)
This App Allows You To Remotely Bypass Your Phone’s Screen Lock By Sending A SMS.
It Removes Your Gesture Pattern Or Password After Receiving A Preset Keyword Along With A Secret Code Via SMS.
SMS Bypass App Requires Root.
INSTRUCTIONS:
1.First, make sure you give permanent root access to the app.
2.Change the secret code to your preferred choice. The default password is : 1234
3.To reset your screen lock, send the following message from another phone:
Note 1 : There is a space between your secret code and reset. Also the secret code is case sensitive.
Note 2 : There is an option available to change the preset keyword. Default is : reset — Your phone will restart and your lock screen will be reset.
Note 3 : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.
METHOD 4
Solution For Everyone Via Adb — SQL Command :
INSTRUCTIONS:
=>Type This Commands Separated In Your Terminal (CMD Prompt) :
=>Now You Just Have To Reboot.
Note : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.
METHOD 5
Solution For Everyone Via Adb — File Removal :
INSTRUCTIONS:
=>Type This Command In Your Terminal (CMD Prompt) :
Note : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.
METHOD 6
Solution For Everyone With USB Debugging Enabled :
Primary Step for all method:
- Download & Extract to anywhere — Bypass Security Hack (Download from attachments)
- Open SQLite Database Browser 2.0.exe in SQLite Database Browser.
- Run pull settings.db.cmd inside By-pass security Hacks folder to pull out the setting file out of your phone.
- Drag settings.db and drop to SQLite Database Browser 2.0.exe program.
- Navigate to Browse data tab, At table there, click to list down the selection & selete secure
Instruction To Remove Pattern Lock:
- Now, find lock_pattern_autolock, Delete Record
- Close & save database
- Run push settings.db.cmd and reboot your phone
Instruction To Remove PIN Lock:
- Now, Find Or Create lockscreen.password_type, double-click & change it’s value to 65536, Apply changes!
- Now, find lock_pattern_autolock, Delete Record, If doesn’t exist, Ignore
- Close & save database
- Run push settings.db.cmd and reboot your phone
Instruction To Remove Password Lock:
- Now, find lockscreen.password_salt, Delete Record
- Now, find lockscreen.password_type, Delete Record
- Close & save database
- Run push settings.db.cmd and reboot your phone
Note : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.
METHOD 7
Solution For Everyone With Recovery Installed :
1.Download and Copy Aroma File manager.zip (Download from attachments or http://forum.xda-developers.com/showthread.php?t=1646108) to your memory card.
2. Open your recovery (press volume Down + Power button or it can be different according to the phones. Generally the phones who have press able button on the middle they have to press all three buttons. Google for you pattern there are lots)
3. There’ll b an option in recovery called “mount”. Go in that option and then mount all the cache and everything it is there.
4. Then select “update” and select “apply update from SD/external” and select aroma file manger.zip file that you downloaded using above QR code above.
5. After Flashing or updating, the aroma file manger will open. Use volume keys for up/down and power button 2 select like you use to get into recovery.
6. In aroma File manager , Go to menu , which is located in bottom strip and then select Settings.
7. Go to bottom n select “mount all partition in startup ” then exit from aroma file manger.
8. Now after exit , re-update that aroma file again and it will open again.
9. Go to data >> and then System.
Then find ‘gesture.key’ (for pattern lock) and ’password.key’ (for password lock) then long touch on gesture.key or password.key and sum option will be prompted , choose delete and delete that file and restart.
Note : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.
Источник
[Guide]Complete Android ROM development and essential tutorials
Breadcrumb
neroyoung
Senior Member
Hi,
If you willing to learn to build custom ROM then you should have following things
- Basic Knowledge about handling Command Promt
- Basic Windows software knowledge
- PC with all tools properly installed
- And a mobile with bootloader unlocked
This tutorial is for «Windows OS (Windows 7 x64 in my case)» And Android 2.3+ OS (2.3.4 GingerBread in my case).
But Dxda Kitchen also supports Ubuntu/Linux and also can support Ice cream sandwich
In this whole post you will learn How To —
- Make custom ROM — Done
- Unpack .ftf packages — Done
- Use Cygwin — Done
- Setup Android Kitchen — Done
- Edit .apk files — Done
- Edit .jar files — Done
- Edit .9.png files — Done
- Rooting System — Done
- Writing scripts
- Making flashable zips — Done
- Porting apk software
- A2SD Techs — Dropped ( Outdated now )
- Editing build.prop — Done
- Editing init.d tweaks
- Information of every customizable file
- Making Hosts
- apn configs
- editing boot.img
- converting png to rle or vice versa
- Writing updater-script
- Making Aroma Installer
- How to set default Settings after ROM installations
- more and more things to arrive
Tools Required : (Update them manually and report me dead links please)
Download the tools as per your need.Link is given in the name itself below.
- Flashtool — For Flashing stock ROM if anything goes wrong (Download link in the installation tab of website)
- apktoolDirect Download- for editing apk files and jar files (you can use APK manager but apktool is simpler)
- CywignDirect Download- Linus Terminal For Windows
- ROM Kitchen (ROM Development Tool)Direct Download- For Cooking custom ROM + boot.img related tools — to edit boot.img files (Its inside the ROM Kitchen Files, Please update this Kitchen to latest version its out dated now,for this use inbuilt updater of kitchen)
- Official Link to kitchen dxda Kitchen — Official Thread and Github sourcePlease refer FAQ on official thread for Kitchen related problems
- ftf-extractorDirect Download- It will extract system files from the ftf package which you will use to make your ROM
- fastbootDirect Download- For flashing kernel to your device
- DoomLords Easy Root Kit v4Direct Download- To Root Stock/Custom ROM
- Demo META-INF FolderDirect Download- For Making Flashable zip files
- DroidExplorer — For advance tools regarding real time phone memory handling through windows.
- Flashable Zip DemoDirect Download- For those who want to just apply some stuffs through CWM
- Customized build.prop demo — Download Build.prop
- Post #9 download link — All In One Tweaker By Nero Young
Special Thanks to —
dsixda for his awesome kitchen Please Hit Thanks button for him
DooMLoRD for providing root files
Please kindly remind me if i have forgotten to write your name in thanks section, i have collected all things from many many sources and with modification.
Источник