Skip to content

MTK Rom Dumper

MTK Rom Dumper #49

Workflow file for this run

name: MTK Rom Dumper
on:
workflow_dispatch:
inputs:
DOWNLOAD_URL:
description: 'DOWNLOAD_URL'
required: true
default: 'https://mva2.androidfilehost.com/dl/QZOc_Pt3uqoT1PhQUDUC_A/1690810658/4279422670115710164/%5BHovatek%5D_Tecno_KG5J_%28KG5j-H6126ABC-RGo-OP-220929V405%29.zip.zip'
DEVICE_NAME:
description: 'DEVICE_NAME'
required: true
default: 'TECNO SPARK 8C KG5j'
ROM_TYPE:
description: 'ROM_TYPE'
required: true
default: 'STOCK ROM'
FILES_TYPE:
description: 'FILES_TYPE'
required: true
default: 'ALL ROM FILES'
DIR_NAME:
description: 'DIR_NAME'
required: true
default: 'rom'
ARCHIVE_NAME:
description: 'ARCHIVE_NAME'
required: true
default: 'archive.zip'
jobs:
build:
if: github.event.repository.owner.id == github.event.sender.id
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
# You might want to Checkout your repo first, but not mandatory
- name: Check Out
uses: actions/checkout@v3
- name: Prepare the environment
run: |
sudo apt install git aria2 wget tar simg2img python3 -y
# Add a step to download the archive that contains the files you want to publish
- name: Download Archive
run: |
# Makes a dir according to the input from the user and downloads the rom
mkdir ${{ github.event.inputs.DIR_NAME }}
cd ${{ github.event.inputs.DIR_NAME }}
wget -O ${{ github.event.inputs.ARCHIVE_NAME }} ${{ github.event.inputs.DOWNLOAD_URL }}
- name: Extract and Cleanup
run: |
#unzips the archive
cd ${{ github.event.inputs.DIR_NAME }}
unzip -jo ${{ github.event.inputs.ARCHIVE_NAME }} -d .
wget http://newandroidbook.com/tools/imjtool.tgz && tar xzvf imjtool.tgz
simg2img super.img super.ext.img
./imjtool.ELF64 super.ext.img extract
ls -lh *
mv extracted/*.img .
xz -z system_a.img
xz -z system_ext_a.img
xz -z product_a.img
xz -z vendor_a.img
rm super.ext.img
rm super.img
rm ${{ github.event.inputs.ARCHIVE_NAME }}
- name: Upload to Release
uses: softprops/action-gh-release@v1
with:
files: |
${{ github.event.inputs.DIR_NAME }}/*
name: ${{ github.event.inputs.DEVICE_NAME }}-${{ github.run_id }}
tag_name: ${{ github.run_id }}
body: |
Type: ${{ github.event.inputs.FILES_TYPE }}
Device: ${{ github.event.inputs.DEVICE_NAME }}
Target: ${{ github.event.inputs.ROM_TYPE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}