Change Security Patch Level in GSI to match boot image SPL - Treble-Enabled Device Questions and Answers

Some device launched before P might not boot GSI due to Security Patch Level (SPL) mismatch. This explain the steps to change SPL in GSI so it will match SPL in boot image.
Step 1. Check the SPL and version in device (before flash GSI):
For example, this device has SPL=2018-09-05 and OS version=9.
Code:
$ adb shell getprop ro.build.version.release
9
$ adb shell getprop ro.build.version.security_patch
2018-09-05
Step 2. Check and modify GSI SPL using script change_security_patch_ver.sh in AOSP test/framework/harnesses/host_controller/gsi/change_security_patch_ver.sh. This script need to be run in linux.
Check SPL
Code:
$ test/framework/harnesses/host_controller/gsi/change_security_patch_ver.sh [input-image]
Modify the SPL in GSI:
Code:
$ test/framework/harnesses/host_controller/gsi/change_security_patch_ver.sh [input-image] [output-patched-image] [new-SPL] -v [new-os-version]
Example: Check the SPL in GSI:
Code:
$ test/framework/harnesses/host_controller/gsi/change_security_patch_ver.sh system.img
2018-08-05
Example: Modify the SPL in GSI to match boot image:
Code:
$ test/framework/harnesses/host_controller/gsi/change_security_patch_ver.sh system.img system-2018-09-05.img 2018-09-05 -v 9

What scripts are these? In system? Need a little more detail on the code here.

Related

Windows RUU tool update process

Dear all,
When looking at the recent HTC Hero update firmware released from HTC i was curious to why they had included adb.exe and fastboot.exe in the upgrade program, so I started looking into this. Basicly I made replacement tools for adb.exe and fastboot.exe that simulated the behavior of a phone to be on the safe side.
From this session I learned two things. First of all we can upgrade the rom.zip via both OSX, Linux and Windoze. Secondly there is a special boot mode called oem-78 which enabled RUU bootloader mode.
Some other notes also is that my bootloader was delivered with factory hboot version 1.76.0007, but even with this bootloader while in RUU mode the bootloader does not seem to check signature when trying to boot cm-hero-recovery.img. It crashes on boot tought, but this seems to be another way in for booting unsigned images...
Another interesting note is that my device was factory programmed with firmware 2.73.751.4, while the upgrade released yesterday is 2.73.405.5.
This is the resulting log from what the ARUWizard is actually doing.
I did not investigate futher after fastboot flash zip rom.zip, so there might be more needed to do after this, so proceed with caution if you want to try this.
Code:
# Get list of attached devices
$ adb devices
# Check battery power for detected device.
$ adb -s <SN> shell cat /sys/class/power_supply/battery/capacity
# Get current firmware version.
$ adb -s <SN> shell getprop ro.build.description
# Reboot into bootloader with RUU mode enabled.
$ adb -s <SN> shell reboot oem-78
# Check if device is is disconnected from usermode
$ adb devices
# If not present any more, check via fastboot
$ fastboot devices
# If detected, check if in RUU mode
$ fastboot -s <SN> getvar boot-mode
# If mode returns RUU, start the upgrade by erasing cache
$ fastboot -s <SN> erase cache
# Upload rom.zip file and flash
$ fastboot -s <SN> flash zip rom.zip
Best regards,
Exion
Diator said:
I am in Taiwan, i bought the Hero 1 week ago and the default firmware is 2.73.751.4
Click to expand...
Click to collapse
Same here. I bought mine a few days ago in Taiwan. This is the new version where they ship 1 extra microSD that is 8GB class 6 (as well as the old 2GB card). The handset itself is standard HTC Hero white, but the firmware is Chunghwa telecom branded.
I have attached my build.prop file which should give most info regarding this firmware for those interested.
Best regards,
Exion

How to flash my custom Android binary from AOSP source code?

Hello, I'm working on a project with Pixel XL so, I'm trying to build Android source code and flash its output on my Pixel XL.
But there are some problems during flashing the img files.
This is my history how I have done so far.
1. Downloaded Android source code from AOSP home page and built it successfully. My build commands are:
Code:
$ source build/envsetup.sh
$ lunch aosp_arm64-eng
$ make -j8
and the output is:
Code:
[email protected]:~/AOSP/out/target/product/generic_arm64$ ls
android-info.txt build_fingerprint.txt cache.img current_build_config.mk dex_bootjars installed-files.json module-info.json obj_arm ramdisk.img root system userdata.img
boot.img cache clean_steps.mk data
2. I tried to flash the img files onto the device:
Code:
$ fastboot flash system system.img
$ fastboot flash boot boot.img
$ fastboot flash cache cache.img
However, it seems that Pixel XL does not have cache partition so that the last command failed.
3. After I executed above commands, I rebooted the device and it trapped in boot loop:
warning for bootloader unlock -> Google logo -> warning for bootloader unlock -> ...(repeat) -> enter recovery mode and stay in the mode for a while(about 5 min) -> warning for bootloader unlock -> ...(repeat)
What did I do in wrong way? I just built Android source for eng binary because I need root privilege.
And How can I build and flash Android source code for eng binary?
Please give me any small clue to resolve it.
Thanks!

[CLOSE] Project Treble For F8132

Project Treble For F8132
Based on Sony Open Devices​if you mess up re-partitioning your device, you will end up with a HARD BRICK. Nobody can help you then.
NOTICE: This method is only available for F8132!!!​The required documents:
V1.2: MEGA With:SW_binaries_for_Xperia_Android_9.0.6.3_r1_v2_tone_beta.zip
V1.0:MEGAWith: SW_binaries_for_Xperia_Android_9.0.6.3_r1_v1_tone_beta.zip
First: Flash the twrp I built which supports a Vendor Partition
Code:
fastboot flash recovery < DIR of recovery.img >
Second: Boot to recovery, USB connected to the computer. adb tools run these commands:
Code:
adb shell
sgdisk /dev/block/mmcblk0 --delete 54
sgdisk /dev/block/mmcblk0 --new=54:2408448:105168896
sgdisk /dev/block/mmcblk0 --delete 55
sgdisk /dev/block/mmcblk0 --new=55:105168897:106815487
sgdisk /dev/block/mmcblk0 --new=56:106815488:122134527
sgdisk /dev/block/mmcblk0 --change-name=54:userdata
sgdisk /dev/block/mmcblk0 --change-name=55:vendor
sgdisk /dev/block/mmcblk0 --change-name=56:system
This is based on the partition table of F8132.
Third: Reboot into recovery,format the vendor and userdata partition in EXT4.
Then flash the treble-v1.0-auto.zip.
This progress will flash the boot and vendor partition.
If you encounter errors, you can unzip the treble-v1.0.zip, flash boot.img and vendor.img
Code:
fastboot flash boot < DIR of boot.img>
fastboot flash vendor < DIR of vendor.img>
Fourth: flash the SW_binaries provided by sony.
For V1.0 I rename it OEM_P.zip, in fact it's SW_binaries_for_Xperia_Android_9.0.6.3_r1_v1_tone_beta.zip
You can download it from Sony official website.
Code:
fastboot flash oem < DIR of OEM_P.img >
Fifth: Flash a GSI compatible System image and boot!
Update and known BUG:
V1.2:
Updates:
1.SIM cards Fix.
Bugs:
1. Fingerprint is broken.
V1.0:
1. The SIM cards don't work.
2. Fingerprint is broken.
Sources Code
XDA:DevDB Information
Treble, ROM for the Sony Xperia X Performance
Contributors
Sjll
Email
ROM OS Version: 9.x Pie
ROM Kernel: Linux 4.x
Version Information
Status: Testing
Created 2018-10-15
Last Updated 2018-10-15
Just to be clear, if you mess up re-partitioning your device, you will end up with a HARD BRICK. Nobody can help you then.
You've been warned.
Otherwise, nice work sjll!
local__hero said:
Just to be clear, if you mess up re-partitioning your device, you will end up with a HARD BRICK. Nobody can help you then.
You've been warned.
Otherwise, nice work sjll!
Click to expand...
Click to collapse
Thanks for your advice!

Pre Rooted PATCHED_BOOT.IMG (10.0.4) for Magisk Root

Original tutorial located at https://forum.xda-developers.com/oneplus-7t/how-to/guide-how-to-root-oneplus-7t-twrp-t3979307
Hello all. Just providing this file for convenience. All credit goes to original author of the guides. This file is a pre-rooted, magisk patched boot.img for firmware version 10.0.4. Use this boot.img for flashing/booting if you are on version 10.0.4 and want to have root using magisk.
!!!I AM NOT RESPONSIBLE FOR ANY DAMAGE DONE TO YOUR DEVICE. USE COMMON SINCE AND YOU WILL BE OK!!​
STEP 1 - Put phone into fastboot mode
Code:
adb reboot fastboot
STEP 2 - Boot the patched boot.img. Download here
Code:
fastboot boot patched_boot_10.0.4.img
STEP 3 - Backup current boot.img. Open an adb shell and find which block device contains your boot partition and then using dd, make a copy of it.
Open ADB Shell
Code:
adb shell
then
Code:
su
Find boot partition
Code:
ls -lah /dev/block/bootdevice/by-name | grep -i boot
You will see something like this as output:
boot_a -> /dev/block/sde11
boot_b -> /dev/block/sde38
Make copy of boot partition(s)
Code:
dd if=/dev/sde11 of=/sdcard/boot_backup.img
DO THIS FOR BOTH BOOT PARTITIONS, LABEL ACCORDINGLY. JUST IN CASE!
Backup boot.img file(s) to PC
FROM YOUR PC, OPEN COMMAND PROMPT AND DO FOR BOTH IMAGES.
Code:
adb pull /sdcard/boot_backup.img
STEP 4 - Install magisk manager
Get magisk manager APK from here. Download the app-release.apk and install on phone.
Code:
adb install app-release.apk
STEP 5 - Open magisk manager and select Install -> Direct Install.
After you have completed the above steps, if everything worked correctly, and you followed the steps with common sense, everything should be good to go.
The download link is not working. Do you still have a patched 10.0.4 boot image?

[GUIDE]How to build unruu from source on Debian GNU/Linux based distributions

This program is for unpacking rom.zip from RUU on Unix-like operating systems
All commands below are to be executed from the terminal NOT as root
1)
Code:
sudo apt install m4 git unshield libunshield-dev dh-autoreconf
2)
Code:
git clone https://github.com/kmdm/unruu.git
3)
Code:
cd unruu
4)
Code:
./autogen.sh
5)
Code:
./configure
6)
Code:
make
7)
Code:
sudo make install
To use this utility is very simple: unruu /path/to/ruu/ruu.exe
For example: unruu /home/alex/RUU_Express.exe

Categories

Resources