Building aopp

From Android Open Pwn Project
Jump to: navigation, search

Downloading the Source

Refer to “Downloading and Building Requirements” before proceeding:

    https://source.android.com/source/requirements.html

Refer to “Downloading the Source” before proceeding:

    https://source.android.com/source/downloading.html

1. Create a directory for the build system to live in and cd into that directory:

    $ mkdir <WORKING_DIR>
    $ cd <WORKING_DIR>

2. Initialize a local repository using this source tree, use the command:

    $ repo init -u [email protected]:aopp/android_platform.git -b px-0.1

3. Sync the repository, use:

    $ repo sync


Building

Devices are referred to by codename (e.g. hammerhead). Make sure to use this when substituting <device-codename> in the following instruction set.

Refer to “Building the System” before proceeding:

    https://source.android.com/source/building.html

1. To initialize the build environment, use the following command:

    $ . build/envsetup.sh

2. Prepare the build environment (download device-tree and dependencies) for your specific device:

    $ breakfast <device-codename>

3. Connect the device running a working AOPP/AOSP ROM to the host machine via USB.

4. Make sure it is booted into system and confirm the device is recognized by the host machine: (a device should be listed when the command returns)

    $ adb devices

5. Enter the device directory:

    $ cd <WORKING_DIR>/device/<vendor>/<device-codename>/

6. Extract the proprietary binaries from your device:

    $ ./extract-files.sh

7. Return to the root of the build system:

    $ croot

8. Start a build run for your device:

    $ brunch <device-name>

9. Once complete, the ROM zip can be found in the out/ directory:

    $ cd /out/target/product/<device-codename>

The flashable ROM zip (product of the build run) will be located in the out/ directory as: aopp-0.1-<build-date>-UNOFFICIAL-<device-codename>.zip

Flashing


1. Connect the device to the host machine via USB cable.

2. Power off the device and boot into the Bootloader:

    Press and hold the Power & Volume-Down buttons

3. Confirm the device is recognized by the host machine: (a device should be listed when the command returns)

    $ fastboot devices

4. Unlock the device:

    $ fastboot oem unlock

5. Once unlocked, flash the Recovery image:

    $ fastboot flash recovery <name-of-recovery-image>.img

6. Once the Recovery image has been flashed, boot into Recovery from the Bootloader:

    Use the Volume-Down/Up buttons to cycle through the Bootloader options and then the Power button to select

If prompted, swipe “Swipe to Allow Modifications”.

7. Once in Recovery, wipe the device:

    Tap Wipe > Advanced Wipe > tap: Dalvik/ART cache, System, Cache, Data > swipe “Swipe to Wipe”

Once wiped, do NOT boot into System (You don't have one; you just wiped it). Tap the Home button to return to the Recovery home screen.

8. Confirm again the device is recognized by the host machine: (a device should be listed when the command returns)

    $ adb devices

9. From the host machine, push the AOPP ROM zip to the device sdcard:

    $ adb push <name-of-rom-zip>.zip /sdcard/

10. On device, tap Install and then select the AOPP ROM zip from /sdcard.

    Swipe “Swipe to Confirm Flash”

11. Download SuperSU from Chainfire here:

    https://download.chainfire.eu/969/SuperSU/UPDATE-SuperSU-v2.76-20160630161323.zip 

12. Push the SuperSU zip to /sdcard/:

    $ adb push <SuperSU-zip-name>.zip /sdcard/

13. Once installed, tap “Reboot System”

Hack the Gibson...and remember...hugs are worth more than handshakes