Extract init_boot/boot image #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Extract init_boot/boot image | |
on: | |
workflow_dispatch: | |
inputs: | |
fileurl: | |
description: 'link of full OxygenOS/ColorOS file' | |
required: true | |
type: string | |
env: | |
GH_TOKEN: ${{ github.token }} | |
jobs: | |
extracting-boot: | |
runs-on: ubuntu-latest | |
outputs: | |
id: ota-link | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@main | |
- name: Set up Environment | |
run: | | |
sudo apt-get update && sudo apt upgrade -y | |
sudo apt-get install -y axel | |
- name: Downloading otadump | |
run: wget -O otadump https://github.com/crazystylus/otadump/releases/download/0.1.2/otadump-0.1.2-x86_64-unknown-linux-gnu.tar.gz && tar xvf otadump && rm LICENSE README.md | |
- name: Downloading OTA | |
run: wget -q --show-progress -O ota.zip "${{ github.event.inputs.fileurl }}" | |
- name: Extracting zip | |
run: unzip ota.zip | |
- name: Setting up Release name | |
run: | | |
echo "REL_NAME=$(grep "version_name=" META-INF/com/android/metadata | sed 's/^[^=]*=//')" >> $GITHUB_ENV | |
echo "############## $(echo ${{env.REL_NAME}}) ##############" | |
- name: Dumping boot and init_boot | |
run: | | |
./otadump payload.bin --partitions boot,init_boot | |
cp extracted*/boot.img extracted*/init_boot.img $GITHUB_WORKSPACE | |
sha1sum boot.img > boot.img.sha1sum | |
sha1sum init_boot.img > init_boot.img.sha1sum | |
rm -rf extracted*/ | |
./otadump payload.bin --partitions abl,aop,aop_config,bluetooth,cpucp,devcfg,dsp,engineering_cdt,featenabler,hyp,imagefv,keymaster,modem,oplus_sec,oplusstanvbk,qupfw,shrm,splash,tz,uefi,uefisecapp,xbl,xbl_config,xbl_ramdump | |
mkdir firmware | |
cp -r extracted*/* firmware | |
wget -O firmware/install_images.bat https://gist.githubusercontent.com/inferno0230/128507cea45202db46176b616492bf77/raw/41b47f1d207ca7c53d6c21e7e4f38077dd7bbc3c/install_images.bat | |
wget -O firmware/install_images.sh https://gist.githubusercontent.com/inferno0230/a6e2a6a9abb0e9a5159c78a7936d8c72/raw/9e15305fbd8f249278981a76cc46072a317ae3ea/OP12R_firmware.sh | |
zip -r fastboot_firmware.zip firmware | |
rm -rf extracted*/ | |
- name: Creating release | |
run: | | |
gh release create $REL_NAME --title $(echo $REL_NAME) --notes "" boot.img init_boot.img boot.img.sha1sum init_boot.img.sha1sum fastboot_firmware.zip |