[Android Software/Hacking General [Developers Only]] yshalsager:
Part 1: How to build DualBootPatcher from source?

When you deeply exploring DualBootPatcher repository you'll find all information and guides you need but for some people instructions isn't clear enough, so let me explain it here :D

- You'll need linux, whichever distribution you use. but i'm sure building works on [Debian-Ubuntu-Fedora-Arch] and all its derivations.

A) Prerequisites:

- You'll need these packages whatever version you want to build:

Android NDK

Currently NDK r15 is required to build, you can get it here

Download, Extract and rename it to "android-ndk"

wget https://dl.google.com/android/repository/android-ndk-r15-linux-x86_64.zip && unzip android-ndk-r15-linux-x86_64.zip && mv android-ndk-r15 android-ndk

And then export android ndk:

echo "export ANDROID_NDK=$(pwd)/android-ndk" >> ~/.bashrc
echo "export ANDROID_NDK_HOME=$(pwd)/android-ndk" >> ~/.bashrc

cmake

DBP needs cmake 3.7.2 or higher. you need to download it here

Downloading & Extract command:

wget https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz && tar xzf cmake-3.7.2.tar.gz

extract to folder and run the following commands in cmake folder

sed -i 's|cmake_options="-DCMAKE_BOOTSTRAP=1"|cmake_options="-DCMAKE_BOOTSTRAP=1 -DCMAKE_USE_OPENSSL=ON"|' bootstrap
./bootstrap
make
sudo make install

OpenSSL

i'm successfully build using openssl-1.1.0c, download here and extract.

wget https://www.openssl.org/source/openssl-1.1.0c.tar.gz && tar xzf openssl-1.1.0c.tar.gz

open openssl-1.1.0c folder and install it

./config shared --prefix=/usr/local/ssl --openssldir=/usr/local/ssl
make
sudo make install
echo 'PATH=${PATH}:/usr/local/ssl' >> ~/.bashrc

gtest

Install on Ubuntu / Debian:

sudo apt-get install libgtest-dev

On Fedora:

sudo dnf install gtest-devel

On Archlinux:

sudo pacman -S gtest

yaml-cpp

Install on Ubuntu / Debian using

sudo apt-get install libyaml-cpp-dev

On Fedora

sudo dnf install yaml-cpp-devel

On Archlinux:

sudo pacman -S yaml-cpp

Other General packages that must be installed: [Skip this if you have android build environment :good: ]

Ubuntu / Debian:

sudo apt-get install ccache libboost-dev libssl-dev openssl python-minimal build-essential libfontconfig1 findutils git make libprocps-dev unzip zip gcc-multilib g++-multilib lib32ncurses5-dev transifex-client gnupg mesa-common-dev libglu1-mesa-dev

Fedora:

sudo dnf install ccache findutils gcc-c++ git make procps-ng unzip zip gnupg ncurses-compat-libs transifex-client openssl-devel

Archlinux:

sudo pacman -S ccache boost openssl lib32-openssl findutils git make procps-ng unzip zip gnupg gcc-multilib ncurses

sudo pacaur -S transifex-client ncurses5-compat-libs lib32-ncurseslib32-ncurses5-compat-libs

- For building android app you need:

Android SDK

You need to install SDK using android studio ( build-tools 25.0.3, platforms android-25, platform-tools and tools )

or install from terminal:

mkdir -p android-sdk && cd android-sdk
wget -q https://dl.google.com/android/repository/platform-tools_r25.0.3-linux.zip && unzip -qq platform-tools_r25.0.3-linux.zip
wget -q https://dl.google.com/android/repository/build-tools_r25.0.3-linux.zip && unzip -qq build-tools_r25.0.3-linux.zip
wget -q https://dl.google.com/android/repository/tools_r25.2.3-linux.zip && unzip -qq tools_r25.2.3-linux.zip

Then Export it:

echo "export ANDROID_HOME=$(pwd)" >> ~/.bashrc
echo "export PATH=${PATH}:${ANDROID_HOME}/tools" >> ~/.bashrc

JDK 1.8

Ubuntu / Debian:

sudo apt-get install openjdk-8-jdk openjdk-8-jdk-headless

Fedora:

sudo dnf install java-1.8.0-openjdk-devel java-1.8.0-openjdk-headless

Archlinux:

sudo pacman -S jdk8-openjdk

Other packages:

Ubuntu / Debian:

sudo apt-get install lib32stdc++-6-dev

Fedora:

sudo dnf install glibc.i686 libstdc++.i686

Archlinux:

sudo pacman -S glibc libstdc++5 lib32-libstdc++5

- And for linux version you need:

qt5

it must be 5.3 or higher

Ubuntu / Debian:

sudo apt-get install qttools5-dev-tools libqt5core5a

Fedora:

sudo dnf install qt5-qtbase-devel

Archlinux:

sudo pacman -S qt5-base

Other packages:

Ubuntu / Debian:

sudo apt-get install libarchive-dev liblz4-tool liblzma-dev lz4-dev zlib1g-dev lib32z-dev

Fedora:

sudo dnf install libarchive-devel lz4-devel xz-devel

Archlinux:

sudo pacman -S libarchive lz4 xz lib32-xz lzip

- Some final touches:

Enable cache:

echo "export USE_CCACHE=1" >> ~/.bashrc

Reload bash environment:

source ~/.bashrc

- Cloning the source:

git clone --recursive https://github.com/chenxiaolong/DualBootPatcher.git

B) Building Android APP:

- Open DualBootPatcher folder and make new folder "build" and open it.

mkdir build && cd build/

- Now Build the app:

cmake .. -DMBP_BUILD_TARGET=android -DMBP_BUILD_TYPE=debug
make
cpack -G TXZ
make apk

And you'll find built apk in DualBootPatcher/Android_GUI/build/outputs/apk/Android_GUI-debug.apk

C) Building Utilities Zip:

Utilities Zip is AROMA based zip which enable you to switch ROMs form twrp or wipe ROM when something went wrong.

- In build folder run these commands:

make android-system_armeabi-v7a
make -C data/devices
./utilities/create.sh

you'll find built utilities.zip in DualBootPatcher/build/utilities/DualBootUtilities-9.2.0.zip

D) Building Linux App:

- In build folder run these commands:

cmake .. -DMBP_BUILD_TARGET=desktop -DMBP_PORTABLE=ON
make
cpack -G TXZ

or to pack it to zip file:

cpack -G ZIP

Special Thanks:

[MENTION=7489364]oF2pks[/MENTION] For helping me setup build environment on arch

[MENTION=6887229]Ahmed Hady[/MENTION] & [MENTION=7133498]androidlover5842[/MENTION] Without their helps i won't be here :D