MTK Rom Dumper #51
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: MTK Rom Dumper | |
on: | |
workflow_dispatch: | |
inputs: | |
DOWNLOAD_URL: | |
description: 'DOWNLOAD_URL' | |
required: true | |
default: '' | |
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 | |
cp extract.sh ${{ github.event.inputs.DIR_NAME }} | |
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 }} |