Initial push

This commit is contained in:
PizzaG 2026-07-24 16:32:02 -05:00
commit a01d3e7cc2
1993 changed files with 106354 additions and 0 deletions

View file

@ -0,0 +1,14 @@
#!/bin/bash
# Remove Prior Log
rm -rf Linux_log.txt >/dev/null 2>&1
# Go Into A-Team Folder
cd A-Team
# Start Log & Run Installer Scrupt
echo ""
script -c ./LINUX.sh -f ../Linux_log.txt
# Exit After Completion
exit

View file

@ -0,0 +1,14 @@
@echo off
IF EXIST Windows_log.txt (
del Windows_log.txt
)
%~d0
cd %~dp0\A-Team
echo:
cmd /c .\WINDOWS.bat 2>&1 | tee ../Windows_log.txt 2>&1

View file

@ -0,0 +1,92 @@
#!/bin/bash
# Variables
INSTALLER_VERSION="0.01"
APP_NAME="A-Team Custom Rom Installer - Version: $INSTALLER_VERSION"
# Print App Name To Terminal
echo -ne "\033]0;$APP_NAME\007"
# Main Menu
echo ""
echo " 2019-Present A-Team Digital Solutions"
echo "=========================================="
echo "------------------------------------------"
echo "- -"
echo "- A-Team -"
echo "- Digital Solutions -"
echo "- -"
echo "- PROUDLY PRESENTS.... -"
echo "- -"
echo "------------------------------------------"
echo "========== A-Team Rom Flasher ============"
echo "------------------------------------------"
echo "- -"
echo "- Built By: PizzaG -"
echo "- Installer Version: $INSTALLER_VERSION -"
echo "- -"
echo "------------------------------------------"
echo "- -"
echo "* Put Device In Fastboot/Bootloader Mode *"
echo "- -"
echo "------------------------------------------"
echo "=========================================="
echo ""
echo ""
echo "PRESS ENTER TO CONTINUE"
read
clear
# Set Slot
fastboot set_active a
clear
# Active Slot
echo ""
echo "========= Your Current Slot ========"
echo "- -"
echo "------------------------------------"
fastboot getvar current-slot
echo "------------------------------------"
echo "- -"
echo "------------------------------------"
echo "===================================="
echo ""
echo ""
echo "PRESS ENTER TO CONTINUE"
read
clear
# Flash Vbmeta
echo ""
echo "Flashing Vbmeta..."; echo ""; fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img; echo ""; echo ""
# Flash Vbmeta_System
echo "Flashing Vbmeta_System..."; echo ""; fastboot flash --disable-verity --disable-verification vbmeta_system vbmeta_system.img; echo ""; echo ""
# Format Data & Metadata
echo "Formatting Data & Metadata..."; sleep 7; echo ""; fastboot -w; echo ""; echo ""
# Reboot Device
fastboot reboot fastboot; echo ""; echo ""
# Flash Product
echo "Flashing Dummy Product For GSI..."; echo ""; fastboot flash product_a dummy-product.img; echo ""; echo ""
# Flash System_Ext
echo "Flashing Dummy System_Ext For GSI..."; echo ""; fastboot flash system_ext_a dummy-system_ext.img; echo ""; echo ""
# Flash System
echo "Flashing A-Team Moto GSI System Image..."; echo ""; fastboot flash system_a system.img; echo ""; echo ""
# Reboot Device
fastboot reboot; echo ""; echo ""; sleep 3;
echo "=== THANK YOU ===== PLEASE ENJOY ==="
echo "------------------------------------"
echo "======= PRESS ENTER TO EXIT ========"
read

View file

@ -0,0 +1,583 @@
#!/sbin/sh
#
# Copyright (C) 2019-Present A-Team Digital Solutions
#
# ---------------------------------------------------------#
# A-Team Android Custom Installer (c) PizzaG #
# ---------------------------------------------------------#
# For more information and discussion, contact me at: #
# https://t.me/A_Team_Digital_Solutions #
#----------------------------------------------------------#
# Static Variables
OUTFD=$2
ZIP=$3
export INSTALLER="/data/tmp/A-Team_Installer"
KEYCHECK="$INSTALLER/A-Team/keycheck"
SLOT=`getprop ro.boot.slot_suffix`
# Permissions
umask 022
# Print Function
ui_print() {
echo -n -e "ui_print $1\n" > /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" > /proc/self/fd/$OUTFD
}
# Volume Key Function
customkey() {
# Calling First Time Detects Previous Input. Calling Second Time Will Do What We Want
$KEYCHECK
$KEYCHECK
SEL=$?
if [ "$1" == "UP" ]; then
UP=$SEL
elif [ "$1" == "DOWN" ]; then
DOWN=$SEL
elif [ $SEL -eq $UP ]; then
return 0
elif [ $SEL -eq $DOWN ]; then
return 1
else
ui_print " Vol Key Not Detected!"
abort " Use Name Change Method In TWRP"
fi
}
##### THE PARTY STARTS HERE ########
# Initial Cleanup
rm -rf $INSTALLER 2>/dev/null
mkdir -p $INSTALLER
# Extract Files
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Extracting Installation Files..."
ui_print " "
ui_print " "
cd $INSTALLER
unzip -o "$ZIP"
chmod 777 $KEYCHECK
ui_print " "
ui_print " "
ui_print " #########################################"
ui_print " # #"
ui_print " # A-Team Custom Installer #"
ui_print " # #"
ui_print " #########################################"
ui_print " # #"
ui_print " # v0.01 (c) PizzaG 1-8-2022 #"
ui_print " # v0.02 (c) PizzaG 3-1-2023 #"
ui_print " # v0.03 (c) PizzaG 3-8-2023 #"
ui_print " # v0.04 (c) PizzaG 3-14-2023 #"
ui_print " # v0.05 (c) PizzaG 11-19-2023 #"
ui_print " # v0.06 (c) PizzaG 11-29-2023 #"
ui_print " # v0.07 (c) PizzaG 12-10-2023 #"
ui_print " # v0.08 (c) PizzaG 12-22-2023 #"
ui_print " # v0.09 (c) PizzaG 2-25-2024 #"
ui_print " # v0.10 (c) PizzaG 5-10-2024 #"
ui_print " # v0.11 (c) PizzaG 5-15-2024 #"
ui_print " # v0.12 (c) PizzaG 5-16-2024 #"
ui_print " # v0.13 (c) PizzaG 5-30-2024 #"
ui_print " # v0.14 (c) PizzaG 6-4-2024 #"
ui_print " # #"
ui_print " #########################################"
ui_print " "
ui_print " "
ui_print " "
sleep 3
# Program Volume Keys
FUNCTION=customkey
ui_print " "
ui_print " - Vol Key Programming -"
ui_print " Press Vol Down..."
$FUNCTION "UP"
ui_print " Press Vol Up..."
$FUNCTION "DOWN"
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Current Flashing Slot = Slot$SLOT "
ui_print " "
ui_print " "
ui_print " "
ui_print " "
# Recovery 1
ui_print "###########################"
ui_print "# #"
ui_print "# Recovery Selection #"
ui_print "# #"
ui_print "###########################"
ui_print "# #"
ui_print "# -Available Recoveries- #"
ui_print "# #"
ui_print "# OrangeFox #"
ui_print "# PitchBlack #"
ui_print "# SkyHawk #"
ui_print "# TWRP #"
ui_print "# Rom Built Recovery #"
ui_print "# #"
ui_print "###########################"
ui_print "Would You Like OrangeFox ?"
ui_print " Vol UP = YES "
ui_print " Vol DN = NO "
if ! $FUNCTION ; then
clear
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "OrangeFox Custom Recovery Selected..."
export OFRP=TRUE
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Installer Will Continue In 3 Seconds...."
sleep 3
else
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "OrangeFox Not Selected, Moving On To Next Recovery..."
ui_print " "
ui_print " "
ui_print " "
ui_print " "
# Recovery 2
ui_print "###########################"
ui_print "# #"
ui_print "# Recovery Selection #"
ui_print "# #"
ui_print "###########################"
ui_print "# #"
ui_print "# -Available Recoveries- #"
ui_print "# #"
ui_print "# PitchBlack #"
ui_print "# SkyHawk #"
ui_print "# TWRP #"
ui_print "# Rom Built Recovery #"
ui_print "# #"
ui_print "###########################"
ui_print "Would You Like PitchBlack ?"
ui_print " Vol UP = YES "
ui_print " Vol DN = NO "
if ! $FUNCTION ; then
clear
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "PitchBlack Custom Recovery Selected..."
export PBRP=TRUE
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Installer Will Continue In 3 Seconds...."
sleep 3
else
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "PitchBlack Not Selected, Moving On To Next Recovery..."
ui_print " "
ui_print " "
ui_print " "
ui_print " "
# Recovery 3
ui_print "###########################"
ui_print "# #"
ui_print "# Recovery Selection #"
ui_print "# #"
ui_print "###########################"
ui_print "# #"
ui_print "# -Available Recoveries- #"
ui_print "# #"
ui_print "# SkyHawk #"
ui_print "# TWRP #"
ui_print "# Rom Built Recovery #"
ui_print "# #"
ui_print "###########################"
ui_print "Would You Like SkyHawk ?"
ui_print " Vol UP = YES "
ui_print " Vol DN = NO "
if ! $FUNCTION ; then
clear
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "SkyHawk Custom Recovery Selected..."
export SHRP=TRUE
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Installer Will Continue In 3 Seconds...."
sleep 3
else
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "SkyHawk Not Selected, Moving On To Next Recovery..."
ui_print " "
ui_print " "
ui_print " "
ui_print " "
# Recovery 4
ui_print "###########################"
ui_print "# #"
ui_print "# Recovery Selection #"
ui_print "# #"
ui_print "###########################"
ui_print "# #"
ui_print "# -Available Recoveries- #"
ui_print "# #"
ui_print "# TWRP #"
ui_print "# Rom Built Recovery #"
ui_print "# #"
ui_print "###########################"
ui_print "Would You Like TWRP ?"
ui_print " Vol UP = YES "
ui_print " Vol DN = NO "
if ! $FUNCTION ; then
clear
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "TWRP Custom Recovery Selected..."
export TWRP=TRUE
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Installer Will Continue In 3 Seconds...."
sleep 3
else
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "No Custom Recovery Has Been Chosen, Flashing Rom Built Recovery...🤔"
ui_print " "
ui_print " "
ui_print " "
ui_print " "
sleep 3
ui_print "Installer Will Continue In 3 Seconds...."
sleep 3
# Flash Rom Recovery
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/recovery.img of=/dev/block/by-name/recovery$SLOT
fi
fi
fi
fi
ui_print " "
ui_print " "
ui_print " "
ui_print " "
# Root 1
ui_print "###########################"
ui_print "# #"
ui_print "# Root Selection #"
ui_print "# #"
ui_print "###########################"
ui_print "# #"
ui_print "# -Available Root- #"
ui_print "# #"
ui_print "# KernelSU #"
ui_print "# Magisk #"
ui_print "# No Root #"
ui_print "# #"
ui_print "###########################"
ui_print "Would You Like KernelSU ?"
ui_print " Vol UP = YES "
ui_print " Vol DN = NO "
if ! $FUNCTION ; then
clear
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "KernelSU Root Selected..."
export KSU=TRUE
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Installer Will Continue In 3 Seconds...."
sleep 3
else
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "KernelSU Root Not Selected, Moving On To Next Root Option..."
ui_print " "
ui_print " "
ui_print " "
ui_print " "
# Root 1
ui_print "###########################"
ui_print "# #"
ui_print "# Root Selection #"
ui_print "# #"
ui_print "###########################"
ui_print "# #"
ui_print "# -Available Root- #"
ui_print "# #"
ui_print "# Magisk #"
ui_print "# No Root #"
ui_print "# #"
ui_print "###########################"
ui_print "Would You Like Magisk ?"
ui_print " Vol UP = YES "
ui_print " Vol DN = NO "
if ! $FUNCTION ; then
clear
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Magisk Root Selected..."
export MAGISK=TRUE
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Installer Will Continue In 3 Seconds...."
sleep 3
else
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "No Root Option Selected, Device Won't Be Rooted 🤔,"
ui_print "Flashing UnRooted Boot Image..."
ui_print " "
ui_print " "
ui_print " "
ui_print " "
sleep 3
ui_print "Installer Will Continue In 3 Seconds...."
sleep 3
# Flash Rom Recovery
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/boot.img of=/dev/block/by-name/boot$SLOT
fi
fi
ui_print " "
ui_print " "
ui_print " "
ui_print " "
# Option 3- Encryption
ui_print "###########################"
ui_print "# #"
ui_print "# Encryption Selection #"
ui_print "# #"
ui_print "###########################"
ui_print "# #"
ui_print "# -Available Options- #"
ui_print "# #"
ui_print "# Disable Encryption #"
ui_print "# Enable Encryption #"
ui_print "# #"
ui_print "###########################"
ui_print "Disable Device Encryption ?"
ui_print " Vol UP = YES "
ui_print " Vol DN = NO "
if ! $FUNCTION ; then
clear
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Disable Device Encryption Selected..."
export CRYPTO=FALSE
ui_print " "
ui_print " "
ui_print " "
ui_print " "
sleep 3
ui_print "Installer Will Continue In 3 Seconds...."
sleep 3
else
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Disable Encryption Skipped..."
ui_print " "
ui_print " "
ui_print " "
ui_print " "
sleep 3
ui_print "Installer Will Continue In 3 Seconds...."
sleep 3
fi
ui_print " "
ui_print " "
ui_print " "
ui_print " "
# Recovery Flashing
if [[ $OFRP == TRUE ]]
then
# Flash OrangeFox
ui_print "Flashing OrangeFox..."
ui_print " "
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/OFRP.img of=/dev/block/by-name/recovery$SLOT
fi
if [[ $PBRP == TRUE ]]
then
# Flash PBRP
ui_print "Flashing PitchBlack..."
ui_print " "
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/PBRP.img of=/dev/block/by-name/recovery$SLOT
fi
if [[ $SHRP == TRUE ]]
then
# Flash SHRP
ui_print "Flashing SkyHawk..."
ui_print " "
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/SHRP.img of=/dev/block/by-name/recovery$SLOT
fi
if [[ $TWRP == TRUE ]]
then
# Flash TWRP
ui_print "Flashing TWRP..."
ui_print " "
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/TWRP.img of=/dev/block/by-name/recovery$SLOT
fi
# Root Flashing
if [[ $KSU == TRUE ]]
then
# Flash KernelSU
ui_print "Flashing KernelSU Root..."
ui_print " "
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/KSU.img of=/dev/block/by-name/boot$SLOT
fi
if [[ $MAGISK == TRUE ]]
then
# Flash Magisk
ui_print "Flashing Magisk Root..."
ui_print " "
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/Magisk.img of=/dev/block/by-name/boot$SLOT
fi
# Dtbo
ui_print "Flashing Dtbo..."
ui_print " "
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/dtbo.img of=/dev/block/by-name/dtbo$SLOT
# Super
SLOT=`getprop ro.boot.slot_suffix`
umount /dev/block/mapper/product$SLOT
umount /dev/block/mapper/system_ext$SLOT
umount /dev/block/mapper/vendor$SLOT
umount /dev/block/mapper/system$SLOT
umount /dev/block/mapper/vendor_dlkm$SLOT
# Vbmeta
ui_print "Flashing Vbmeta..."
ui_print " "
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/vbmeta.img of=/dev/block/by-name/vbmeta$SLOT
# Vbmeta_System
ui_print "Flashing Vbmeta_System..."
ui_print " "
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/vbmeta_system.img of=/dev/block/by-name/vbmeta_system$SLOT
# Vendor_Boot
ui_print "Flashing Vendor_Boot..."
ui_print " "
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/vendor_boot.img of=/dev/block/by-name/vendor_boot$SLOT
# Encryption
if [[ $CRYPTO == FALSE ]]
then
ui_print " "
ui_print " "
ui_print " "
ui_print "Rebuilding Super With Disabled Encryption..."
ui_print " "
cp -r $INSTALLER/A-Team/systemrw_1.32-NoEncrypt /data/tmp/systemrw_1.32
chmod +x /data/tmp/systemrw_1.32/systemrw.sh
# Run RW Script
size=0
sh -c /data/tmp/systemrw_1.32/systemrw.sh '$size'
else
# Rebuild Super RW & Auto Disable Encrypt
ui_print " "
ui_print " "
ui_print " "
ui_print "Rebuilding Super With Enabled Encryption..."
ui_print " "
cp -r $INSTALLER/A-Team/systemrw_1.32-Encrypt /data/tmp/systemrw_1.32
chmod +x /data/tmp/systemrw_1.32/systemrw.sh
# Run RW Script
size=0
sh -c /data/tmp/systemrw_1.32/systemrw.sh '$size'
fi
# Cleanup
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Cleaning Up..."
rm -rf /data/*
sleep 3
# Finalization
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Installation Complete"
ui_print " "
ui_print " "
ui_print " "
sleep 3
ui_print "Installer Will Exit & Device Will Reboot In 15 Seconds..."
ui_print " "
ui_print " "
ui_print " "
sleep 3
ui_print "=)=) PLEASE ENJOY THIS RELEASE =)=)"
sleep 15
reboot

View file

@ -0,0 +1 @@
#dummy file

View file

@ -0,0 +1,104 @@
@echo off
title A-Team Custom Rom Installer - Version: 0.01
set INSTALLER_VERSION=0.01
:: Main Menu
echo.
echo 2019-Present A-Team Digital Solutions
echo ==========================================
echo ------------------------------------------
echo - -
echo - A-Team -
echo - Digital Solutions -
echo - -
echo - PROUDLY PRESENTS.... -
echo - -
echo ------------------------------------------
echo ========== A-Team Rom Flasher ===========
echo ------------------------------------------
echo - -
echo - Built By: PizzaG -
echo - Installer Version: %INSTALLER_VERSION% -
echo - -
echo ------------------------------------------
echo - -
echo * Put Device In Fastboot/Bootloader Mode *
echo - -
echo ------------------------------------------
echo ==========================================
echo.
echo.
echo PRESS ENTER TO CONTINUE
pause >nul
cls
:: Set Slot
fastboot set_active a
cls
:: Active Slot
echo.
echo ========= Your Current Slot ========
echo - -
echo ------------------------------------
fastboot getvar current-slot
echo ------------------------------------
echo - -
echo ------------------------------------
echo ====================================
echo.
echo.
echo PRESS ENTER TO CONTINUE
pause >nul
cls
:: Flash Vbmeta
echo.
echo Flashing Vbmeta...
fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img
echo.
:: Flash Vbmeta_System
echo Flashing Vbmeta_System...
fastboot flash --disable-verity --disable-verification vbmeta_system vbmeta_system.img
echo.
:: Format Data & Metadata
echo Formatting Data & Metadata...
timeout /t 7 /nobreak >nul
fastboot -w
echo.
:: Reboot Device to Fastbootd
fastboot reboot fastboot
echo.
:: Flash Product
echo Flashing Dummy Product For GSI...
fastboot flash product_a dummy-product.img
echo.
:: Flash System_Ext
echo Flashing Dummy System_Ext For GSI...
fastboot flash system_ext_a dummy-system_ext.img
echo.
:: Flash System
echo Flashing A-Team Moto GSI System Image...
fastboot flash system_a system.img
echo.
:: Reboot Device
fastboot reboot
timeout /t 3 /nobreak >nul
echo.
echo === THANK YOU ===== PLEASE ENJOY ===
echo ------------------------------------
echo ======= PRESS ENTER TO EXIT ========
pause >nul
exit

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
--metadata-size 65536 --super-name super --sparse --metadata-slots 2 --device super:6786383872 --group main:6782189568 --partition product_a:none:1725361099:default --image product_a=/data/tmp/systemrw_1.32/img/product_a.img --partition system_a:none:1725361099:default --image system_a=/data/tmp/systemrw_1.32/img/system_a.img --partition system_ext_a:none:1725361099:default --image system_ext_a=/data/tmp/systemrw_1.32/img/system_ext_a.img --partition vendor_a:none:1073741824:default --image vendor_a=/data/tmp/systemrw_1.32/img/vendor_a.img --partition vendor_dlkm_a:none:52428800:default --image vendor_dlkm_a=/data/tmp/systemrw_1.32/img/vendor_dlkm_a.img --output /data/tmp/systemrw_1.32/img/super_fixed.bin

View file

@ -0,0 +1,410 @@
#!/system/bin/sh
app="systemrw"
version="1.32"
LOC="/data/tmp/"$app"_"$version
logDir="$LOC/log";pDumpDir="$LOC/nosuper";sDumpDir="$LOC/img"
printf " ---------------------------------------------------\n"
printf "| SystemRW v%s Automated Script By: Lebigmac |\n" $version
printf "| Modified By: PizzaG |\n"
printf "| A-Team Version: 0.07 |\n"
printf "| Version Date: 6-4-2024 |\n"
printf " ---------------------------------------------------\n\n"
echoUsage(){
printf "\nRun this WITH super partition:\n$0 size=20 (in MB)\n\nRun this WITHOUT super partition:\n$0\n\nOptional arguments WITH super partition:\n$0 in=./img/super_original.bin out=./img/super_fixed.img size=20 (in MB)\n\n"
exit 1
}
if [[ ! -z $@ ]]; then
for arg in "$@"; do
case $arg in
"rw="*)
if [ ! -z "${arg#*=}" ]; then
part=${arg#*=}
printf "$app: Custom Partition Detected: %s\n" $part
printf "\n$app: Initiating R/W Procedure For Custom Partition: %s\n" $part
exit 1
else
echoUsage
fi
;;
"in="*)
if [ ! -z "${arg#*=}" ]; then
inputValue=${arg#*=}
printf "$app: Custom Input Detected: %s\n" $inputValue
else
echoUsage
fi
;;
"out="*)
if [ ! -z "${arg#*=}" ]; then
outputValue=${arg#*=}
printf "$app: Custom Output Detected: %s\n" $outputValue
else
echoUsage
fi
;;
"size="*)
if [ ! -z "${arg#*=}" ]; then
sizeValue=${arg#*=}
printf "$app: Custom Size Detected: %s MB\n" $sizeValue
else
echoUsage
fi
;;
*)
echoUsage
;;
esac
done
fi
getCurrentSize(){
currentSize=$(wc -c < $1)
currentSizeMB=$(echo $currentSize | awk '{print int($1 / 1024 / 1024)}')
currentSizeBlocks=$(echo $currentSize | awk '{print int($1 / 512)}')
if [ -z "$2" ]; then
printf "$app: Current size of $fiName in bytes: $currentSize\n"
printf "$app: Current size of $fiName in MB: $currentSizeMB\n"
printf "$app: Current size of $fiName in 512-byte sectors: $currentSizeBlocks\n\n"
fi
}
shrink2Min(){
printf "$app: Shrinking Size Of $fiName Back To Minimum Size...\n"
if ( ! ./tools/resize2fs -f -M $1 ); then
printf "$app: There Was A Problem Shrinking $fiName. Please Try Again.\n\n"
exit 1
fi
}
increaseSize(){
printf "$app: Increasing Filesystem Size Of $fiName...\n"
if ( ! ./tools/resize2fs -f $1 $2"s" ); then
printf "$app: There Was A Problem Resizing $fiName. Please Try Again.\n\n"
exit 1
fi
}
addCustomSize(){
getCurrentSize $1 1
customSize=$(echo $currentSize $sizeValue | awk '{print $1 + ($2 * 1024 * 1024)}')
customSizeMB=$(echo $customSize | awk '{print int($1 / 1024 / 1024)}')
customSizeBlocks=$(echo $customSize | awk '{print int($1 / 512)}')
printf "$app: Custom size of $fiName in bytes: $customSize\n"
printf "$app: Custom size of $fiName in MB: $customSizeMB\n"
printf "$app: Custom size of $fiName in 512-byte sectors: $customSizeBlocks\n\n"
increaseSize $1 $customSizeBlocks
}
unshareBlocks(){
printf "$app: 'shared_blocks feature' Detected @ %s\n\n" $fiName
newSizeBlocks=$(echo $currentSize | awk '{print ($1 * 1.25) / 512}')
increaseSize $1 $newSizeBlocks
printf "$app: Removing 'shared_blocks feature' Of %s...\n" $fiName
if ( ! e2fsck -y -E unshare_blocks $1 > /dev/null ); then
printf "$app: There Was A Problem Removing The Read-Only Lock Of %s. Ignoring\n\n" $fiName
else
printf "$app: Read-Only Lock Of %s Successfully Removed\n\n" $fiName
fi
}
makeRW(){
fiName=${1//*\/}
getCurrentSize $1
features=`tune2fs -l $1 2>/dev/null | grep "feat"`
if [ ! -z "${features:20}" ]; then
if [[ "${features:20}" == *"shared_blocks"* ]]; then unshareBlocks $1; else printf "$app: NO 'shared_blocks feature' Detected @ %s\n\n" $fiName; fi
shrink2Min $1
if [[ "$sizeValue" > 0 ]]; then
addCustomSize $1
fi
fi
printf "=================================================\n\n"
}
flash(){
printf "$app: Flashing $1 to $2\n$app: Don't Interrupt This Process Or You Risk Bricking! Please Wait...\n"
if ( ! ./tools/simg2img $1 $2 ); then
printf "\n$app: There Was A Problem Flashing Image To Partition. Please Try Again\n\n"
exit 1
else
printf "\n$app: Successfully Flashed %s to %s\n" $1 $2
fi
printf "\n=================================================\n\n"
}
success(){
printf "$app: Congratulations! You Should Now Have R/W Capability\n"
cleanUp "$sDumpDir/*.img"
exit 0
}
countGroups(){
for i in `tac $lpdumpPath | grep -F -m 3 "Name:" -B 1 | awk '!/^-/ {n=$(NF-1); getline; print n "|" $NF}'`; do
grpSize=${i//|*}
grpName=${i//*|}
if [[ "$grpName" == "default" ]]; then
break
fi
if [[ "$grpName" != *"cow"* && "$grpSize" != 0 ]]; then echo -n "--group $grpName:$grpSize ">>$myArgsPath; fi #else cow=1
done
}
isRecovery(){
if [ -z "$notwrp" ]; then
return 0
else
return 1
fi
}
makeSuper(){
if [ -z "$outputValue" ]; then
superFixedPath=$sDumpDir"/super_fixed.bin"
else
superFixedPath=$outputValue
fi
myArgsPath="$logDir/myargs.txt"
slotCount=$(grep -F -m 1 "slot" $lpdumpPath | awk '{print $NF}')
echo -n "--metadata-size 65536 --super-name super --sparse --metadata-slots $slotCount ">$myArgsPath
superSize=$(grep -F -m 1 "Size:" $lpdumpPath | awk '{print $2}')
echo -n "--device super:$superSize ">>$myArgsPath
countGroups
imgCount=$(ls $sDumpDir | grep -c ".img" | awk '{print $1 * 2}')
for o in `grep -E -m $imgCount "Name:|Group:" $lpdumpPath | awk '{ n = $NF ; getline ; print n "|" $NF }'`; do
imgName=${o//|*}
groupName=${o//*|}
fName="$sDumpDir/$imgName.img"
if [[ "$imgName" == *"system"* || "$imgName" == *"product"* || "$imgName" == *"vendor"* ]]; then makeRW $fName; fi
getCurrentSize $fName 1
if [[ "$currentSize" > 0 && "$groupName" != *"cow"* ]]; then
echo -n "--partition $imgName:none:$currentSize:$groupName ">>$myArgsPath
echo -n "--image $imgName=$fName ">>$myArgsPath
fi
done
echo -n "--output $superFixedPath">>$myArgsPath
printf "$app: Joining All Extracted Images Back Into One Single Super Image...\n$app: Please Wait & Ignore The Invalid Sparse Warnings...\n\n"
myArgs=$(cat "$logDir/myargs.txt")
cp -r $INSTALLER/A-Team/myargs.txt $logDir/myargs.txt
if ( ./tools/lpmake $myArgs 2>&1 ); then
printf "\n$app: Successfully Created Patched Super Image @\n$app: %s\n\n" `realpath $superFixedPath`
if ( isRecovery ); then flash $superFixedPath $superPath; fi
success
else
ret=$?
dmesg > $logDir/dmesg.txt
printf "\n$app: Error! Failed To Create super_fixed.img File. Error Code: %s\n\n" $ret
exit 1
fi
}
lpUnpack(){
printf "$app: Unpacking Embedded Partitions From %s\n" $sDumpTarget
cleanUp "$sDumpDir/*.img"
if ( ./tools/lpunpack --slot=$currentSlot $sDumpTarget $sDumpDir ); then
if ( ! ls -1 $sDumpDir/*.img>/dev/null ); then
printf "$app: Unable To Locate Extracted Partitions. Please Try Again.\n\n"
exit 1
else
printf "$app: Nested Partitions Were Successfully Extracted From Super\n\n"
#e2fsck -fy /data/local/tmp/systemrw_1.32/img/system_a.img
SLOT=`getprop ro.boot.slot_suffix`
cp -r $INSTALLER/A-Team/product.img /data/tmp/systemrw_1.32/img/product$SLOT.img
cp -r $INSTALLER/A-Team/system.img /data/tmp/systemrw_1.32/img/system$SLOT.img
cp -r $INSTALLER/A-Team/system_ext.img /data/tmp/systemrw_1.32/img/system_ext$SLOT.img
cp -r $INSTALLER/A-Team/vendor.img /data/tmp/systemrw_1.32/img/vendor$SLOT.img
cp -r $INSTALLER/A-Team/vendor_dlkm.img /data/tmp/systemrw_1.32/img/vendor_dlkm$SLOT.img
makeSuper
fi
else
printf "$app: Please Make Sure The Super File Exists & Try Again.\n\n"
exit 1
fi
}
dumpFile(){
if (( $1 == 0 )); then
cleanUp "$pDumpDir/*.img"
for x in `ls -Alg /dev/block/by-name | awk '{print $(NF-2)"|"$NF}'`; do
if [[ "$x" == *"system"* || "$x" == *"product"* || "$x" == *"vendor"* ]]; then
pName=${x//|*}
pPath=${x//*|}
pTarget="$pDumpDir/$pName.img"
pTargetSparse="$pDumpDir/$pName_sparse.img"
printf "$app: Partition Detected -> %s @ %s\n" $pName $pPath
if [[ "`tune2fs -l $pPath | grep "feat"`" == *"shared_blocks"* ]]; then
printf "$app: Dumping %s to: %s\n" $pName $pTarget
if ( dd if=$pPath of=$pTarget 2>&1 ); then
printf "$app: Successfully Dumped %s\n\n" $pName
makeRW $pTarget
if ( isRecovery ); then
if ( ./tools/img2simg $pTarget $pTargetSparse ); then
flash $pTargetSparse $pPath
rm -f $pTargetSparse
fi
fi
ok=1
else
printf "$app: There Was A Problem Dumping The Partition...\n\n"
exit 1
fi
else
printf "$app: NO 'shared_blocks feature' Detected @ %s. Ignoring\n" $pName;
fi
fi
done
if [ ! -z $ok ]; then success; else printf "$app: There Was A Problem Removing Read-Only Restriction Of Your Device. Aborting...\n\n"; exit 1; fi
else
if [ -z "$inputValue" ]; then
printf "$app: Dumping Super Partition To: %s\n" $sDumpTarget
printf "$app: Please Wait Patiently...\n\n"
if ( dd if=$superPath of=$sDumpTarget 2>&1 ); then
printf "\n$app: Successfully Dumped Super Partition To: %s\n" $sDumpTarget
else
printf "$app: Error: Failed To Dump File To: %s\n\n" $sDumpTarget
exit 1
fi
fi
fi
}
isSuper(){
if [ -z "$superPath" ]; then
[ -z "$1" ] && printf "$app: Unable To Locate Super Partition On Device.\n"
return 1
else
[ -z "$1" ] && printf "$app: Your Super Partition Is Located At: %s\n" $superPath
return 0
fi
}
getCurrentSlot(){
currentSlot=`getprop ro.boot.slot_suffix`
if [[ -z "$currentSlot" || "$currentSlot" == "_a" ]]; then
currentSlot=0
elif [ "$currentSlot" == "_b" ]; then
currentSlot=1
fi
if ( isSuper 1 ); then printf "$app: Current Slot Is: %s\n" $currentSlot; fi
}
getDeviceName(){
manufacturer=`getprop ro.product.manufacturer`
if ( isRecovery ); then
product=`getprop ro.product.model`
else
product=`getprop ro.product.marketname`
#product=`getprop ro.product.vendor.marketname`
fi
printf "$app: Current Device: $manufacturer $product\n"
}
setGlobalVars(){
superPath=`ls -l /dev/block/by-name/super 2>/dev/null | awk '{print $NF}'`
if [ -z "$inputValue" ]; then
sDumpTarget=$sDumpDir"/super_original.bin"
else
sDumpTarget=$inputValue
fi
}
isMounted(){
if [[ "`cat /proc/mounts`" == *"$1"* ]]; then
return 0
else
return 1
fi
}
checkRW(){
if ( isSuper ); then
if ( isRecovery ); then
for i in /dev/block/dm-*; do
vol=`tune2fs -l $i 2>/dev/null | grep "volume" | awk '{print $NF}'`
if [[ "$vol" == "/" || "$vol" == "product" || "$vol" == "vendor" ]]; then
if ( isMounted $i ); then
result=`mount -o rw,remount $i 2>&1`; if [[ "$result" == *"read-only" ]]; then printf "$app: %s Is read-only\n" $i; else if [[ "$result" != *"I/O error" ]]; then printf "$app: %s Is Already R/W Capable. Ignoring\n" $i; fi; fi
else
if ( mkdir -p /mnt/dir ); then
if ( mount -t ext4 -o rw $i /mnt/dir ); then printf "$app: %s Is Already R/W Capable. Ignoring\n" $i; umount /mnt/dir; fi
fi
fi
fi
done
else
for i in / /product /vendor; do result=`mount -o rw,remount $i 2>&1`; if [[ "$result" == *"read-only" ]]; then printf "$app: %s Is read-only\n" $i; else if [[ "$result" != *"I/O error" ]]; then printf "$app: %s Is Already R/W Capable. Ignoring\n" $i; fi; fi; done
fi
else
for i in /system /product /vendor; do result=`mount -o rw,remount $i 2>&1`; if [[ "$result" == *"read-only" ]]; then printf "$app: %s Is read-only\n" $i; else if [[ "$result" != *"I/O error" ]]; then printf "$app: %s Is Already R/W Capable. Ignoring\n" $i; fi; fi; done
fi
}
sdkCheck(){
sdkVersion=`getprop ro.build.version.sdk`
if (( $sdkVersion < 29 )); then
printf "$app: Please Install Android 10 Or Newer & Try Again\n\n"; exit 1
elif (( $sdkVersion == 29 )); then
android=10
elif (( $sdkVersion == 30 )); then
android=11
elif (( $sdkVersion == 31 )); then
android=12
elif (( $sdkVersion == 32 )); then
android=12.1
elif (( $sdkVersion == 33 )); then
android=13
elif (( $sdkVersion == 34 )); then
android=14
else
printf "$app: Your Android Version Is Not Supported Yet. Aborting...\n\n"; exit 1
fi
printf "$app: Current Android Version: %s\n" $android
}
checkDeviceState(){
if [ `whoami` != "root" ]; then printf "$app: No Root Detected. Please Try Again As Root. Aborting..\n\n"; exit 1; fi
if ( which twrp>/dev/null ); then printf "$app: Device Is In Custom Recovery Mode\n"; else printf "$app: Device Is In Android Mode\n"; notwrp=1; fi
getDeviceName
setenforce 0; printf "$app: Current SELinux Status: %s\n" `getenforce`
getCurrentSlot
checkRW
if [ "$PWD" != "$LOC" ]; then
cd $LOC
if [ "$PWD" != "$LOC" ]; then
printf "$app: Please Make Sure %s Exists & Try Again\n\n" $LOC
exit 1
fi
fi
printf "$app: Adjusting Permissions...\n"
chmod -R 777 $LOC # for i in ./tools/*; do chmod +x $i; done
printf "$app: Attempting To Disable DM-Verity & Verification...\n"
./tools/avbctl --force disable-verification
./tools/avbctl --force disable-verity
}
mainProc(){
printf "$app: Initiating Procedure...\n\n"
setGlobalVars
checkDeviceState
if ( ! isSuper 1 ); then
dumpFile 0
else
lpdumpPath="$logDir/lpdump.txt"
./tools/lpdump --slot=$currentSlot > $lpdumpPath
dumpFile 1
lpUnpack
fi
}
cleanUp(){
for file in $1; do
rm -f $file
done
}
mkdir -p $logDir $pDumpDir $sDumpDir
mainProc | tee "$logDir/mylog.txt"

View file

@ -0,0 +1,410 @@
#!/system/bin/sh
app="systemrw"
version="1.32"
LOC="/data/tmp/"$app"_"$version
logDir="$LOC/log";pDumpDir="$LOC/nosuper";sDumpDir="$LOC/img"
printf " ---------------------------------------------------\n"
printf "| SystemRW v%s Automated Script By: Lebigmac |\n" $version
printf "| Modified By: PizzaG |\n"
printf "| A-Team Version: 0.07 |\n"
printf "| Version Date: 6-4-2024 |\n"
printf " ---------------------------------------------------\n\n"
echoUsage(){
printf "\nRun this WITH super partition:\n$0 size=20 (in MB)\n\nRun this WITHOUT super partition:\n$0\n\nOptional arguments WITH super partition:\n$0 in=./img/super_original.bin out=./img/super_fixed.img size=20 (in MB)\n\n"
exit 1
}
if [[ ! -z $@ ]]; then
for arg in "$@"; do
case $arg in
"rw="*)
if [ ! -z "${arg#*=}" ]; then
part=${arg#*=}
printf "$app: Custom Partition Detected: %s\n" $part
printf "\n$app: Initiating R/W Procedure For Custom Partition: %s\n" $part
exit 1
else
echoUsage
fi
;;
"in="*)
if [ ! -z "${arg#*=}" ]; then
inputValue=${arg#*=}
printf "$app: Custom Input Detected: %s\n" $inputValue
else
echoUsage
fi
;;
"out="*)
if [ ! -z "${arg#*=}" ]; then
outputValue=${arg#*=}
printf "$app: Custom Output Detected: %s\n" $outputValue
else
echoUsage
fi
;;
"size="*)
if [ ! -z "${arg#*=}" ]; then
sizeValue=${arg#*=}
printf "$app: Custom Size Detected: %s MB\n" $sizeValue
else
echoUsage
fi
;;
*)
echoUsage
;;
esac
done
fi
getCurrentSize(){
currentSize=$(wc -c < $1)
currentSizeMB=$(echo $currentSize | awk '{print int($1 / 1024 / 1024)}')
currentSizeBlocks=$(echo $currentSize | awk '{print int($1 / 512)}')
if [ -z "$2" ]; then
printf "$app: Current size of $fiName in bytes: $currentSize\n"
printf "$app: Current size of $fiName in MB: $currentSizeMB\n"
printf "$app: Current size of $fiName in 512-byte sectors: $currentSizeBlocks\n\n"
fi
}
shrink2Min(){
printf "$app: Shrinking Size Of $fiName Back To Minimum Size...\n"
if ( ! ./tools/resize2fs -f -M $1 ); then
printf "$app: There Was A Problem Shrinking $fiName. Please Try Again.\n\n"
exit 1
fi
}
increaseSize(){
printf "$app: Increasing Filesystem Size Of $fiName...\n"
if ( ! ./tools/resize2fs -f $1 $2"s" ); then
printf "$app: There Was A Problem Resizing $fiName. Please Try Again.\n\n"
exit 1
fi
}
addCustomSize(){
getCurrentSize $1 1
customSize=$(echo $currentSize $sizeValue | awk '{print $1 + ($2 * 1024 * 1024)}')
customSizeMB=$(echo $customSize | awk '{print int($1 / 1024 / 1024)}')
customSizeBlocks=$(echo $customSize | awk '{print int($1 / 512)}')
printf "$app: Custom size of $fiName in bytes: $customSize\n"
printf "$app: Custom size of $fiName in MB: $customSizeMB\n"
printf "$app: Custom size of $fiName in 512-byte sectors: $customSizeBlocks\n\n"
increaseSize $1 $customSizeBlocks
}
unshareBlocks(){
printf "$app: 'shared_blocks feature' Detected @ %s\n\n" $fiName
newSizeBlocks=$(echo $currentSize | awk '{print ($1 * 1.25) / 512}')
increaseSize $1 $newSizeBlocks
printf "$app: Removing 'shared_blocks feature' Of %s...\n" $fiName
if ( ! e2fsck -y -E unshare_blocks $1 > /dev/null ); then
printf "$app: There Was A Problem Removing The Read-Only Lock Of %s. Ignoring\n\n" $fiName
else
printf "$app: Read-Only Lock Of %s Successfully Removed\n\n" $fiName
fi
}
makeRW(){
fiName=${1//*\/}
getCurrentSize $1
features=`tune2fs -l $1 2>/dev/null | grep "feat"`
if [ ! -z "${features:20}" ]; then
if [[ "${features:20}" == *"shared_blocks"* ]]; then unshareBlocks $1; else printf "$app: NO 'shared_blocks feature' Detected @ %s\n\n" $fiName; fi
shrink2Min $1
if [[ "$sizeValue" > 0 ]]; then
addCustomSize $1
fi
fi
printf "=================================================\n\n"
}
flash(){
printf "$app: Flashing $1 to $2\n$app: Don't Interrupt This Process Or You Risk Bricking! Please Wait...\n"
if ( ! ./tools/simg2img $1 $2 ); then
printf "\n$app: There Was A Problem Flashing Image To Partition. Please Try Again\n\n"
exit 1
else
printf "\n$app: Successfully Flashed %s to %s\n" $1 $2
fi
printf "\n=================================================\n\n"
}
success(){
printf "$app: Congratulations! You Should Now Have R/W Capability\n"
cleanUp "$sDumpDir/*.img"
exit 0
}
countGroups(){
for i in `tac $lpdumpPath | grep -F -m 3 "Name:" -B 1 | awk '!/^-/ {n=$(NF-1); getline; print n "|" $NF}'`; do
grpSize=${i//|*}
grpName=${i//*|}
if [[ "$grpName" == "default" ]]; then
break
fi
if [[ "$grpName" != *"cow"* && "$grpSize" != 0 ]]; then echo -n "--group $grpName:$grpSize ">>$myArgsPath; fi #else cow=1
done
}
isRecovery(){
if [ -z "$notwrp" ]; then
return 0
else
return 1
fi
}
makeSuper(){
if [ -z "$outputValue" ]; then
superFixedPath=$sDumpDir"/super_fixed.bin"
else
superFixedPath=$outputValue
fi
myArgsPath="$logDir/myargs.txt"
slotCount=$(grep -F -m 1 "slot" $lpdumpPath | awk '{print $NF}')
echo -n "--metadata-size 65536 --super-name super --sparse --metadata-slots $slotCount ">$myArgsPath
superSize=$(grep -F -m 1 "Size:" $lpdumpPath | awk '{print $2}')
echo -n "--device super:$superSize ">>$myArgsPath
countGroups
imgCount=$(ls $sDumpDir | grep -c ".img" | awk '{print $1 * 2}')
for o in `grep -E -m $imgCount "Name:|Group:" $lpdumpPath | awk '{ n = $NF ; getline ; print n "|" $NF }'`; do
imgName=${o//|*}
groupName=${o//*|}
fName="$sDumpDir/$imgName.img"
if [[ "$imgName" == *"system"* || "$imgName" == *"product"* || "$imgName" == *"vendor"* ]]; then makeRW $fName; fi
getCurrentSize $fName 1
if [[ "$currentSize" > 0 && "$groupName" != *"cow"* ]]; then
echo -n "--partition $imgName:none:$currentSize:$groupName ">>$myArgsPath
echo -n "--image $imgName=$fName ">>$myArgsPath
fi
done
echo -n "--output $superFixedPath">>$myArgsPath
printf "$app: Joining All Extracted Images Back Into One Single Super Image...\n$app: Please Wait & Ignore The Invalid Sparse Warnings...\n\n"
myArgs=$(cat "$logDir/myargs.txt")
cp -r $INSTALLER/A-Team/myargs.txt $logDir/myargs.txt
if ( ./tools/lpmake $myArgs 2>&1 ); then
printf "\n$app: Successfully Created Patched Super Image @\n$app: %s\n\n" `realpath $superFixedPath`
if ( isRecovery ); then flash $superFixedPath $superPath; fi
success
else
ret=$?
dmesg > $logDir/dmesg.txt
printf "\n$app: Error! Failed To Create super_fixed.img File. Error Code: %s\n\n" $ret
exit 1
fi
}
lpUnpack(){
printf "$app: Unpacking Embedded Partitions From %s\n" $sDumpTarget
cleanUp "$sDumpDir/*.img"
if ( ./tools/lpunpack --slot=$currentSlot $sDumpTarget $sDumpDir ); then
if ( ! ls -1 $sDumpDir/*.img>/dev/null ); then
printf "$app: Unable To Locate Extracted Partitions. Please Try Again.\n\n"
exit 1
else
printf "$app: Nested Partitions Were Successfully Extracted From Super\n\n"
#e2fsck -fy /data/local/tmp/systemrw_1.32/img/system_a.img
SLOT=`getprop ro.boot.slot_suffix`
cp -r $INSTALLER/A-Team/product.img /data/tmp/systemrw_1.32/img/product$SLOT.img
cp -r $INSTALLER/A-Team/system.img /data/tmp/systemrw_1.32/img/system$SLOT.img
cp -r $INSTALLER/A-Team/system_ext.img /data/tmp/systemrw_1.32/img/system_ext$SLOT.img
cp -r $INSTALLER/A-Team/NoEncrypt-vendor.img /data/tmp/systemrw_1.32/img/vendor$SLOT.img
cp -r $INSTALLER/A-Team/vendor_dlkm.img /data/tmp/systemrw_1.32/img/vendor_dlkm$SLOT.img
makeSuper
fi
else
printf "$app: Please Make Sure The Super File Exists & Try Again.\n\n"
exit 1
fi
}
dumpFile(){
if (( $1 == 0 )); then
cleanUp "$pDumpDir/*.img"
for x in `ls -Alg /dev/block/by-name | awk '{print $(NF-2)"|"$NF}'`; do
if [[ "$x" == *"system"* || "$x" == *"product"* || "$x" == *"vendor"* ]]; then
pName=${x//|*}
pPath=${x//*|}
pTarget="$pDumpDir/$pName.img"
pTargetSparse="$pDumpDir/$pName_sparse.img"
printf "$app: Partition Detected -> %s @ %s\n" $pName $pPath
if [[ "`tune2fs -l $pPath | grep "feat"`" == *"shared_blocks"* ]]; then
printf "$app: Dumping %s to: %s\n" $pName $pTarget
if ( dd if=$pPath of=$pTarget 2>&1 ); then
printf "$app: Successfully Dumped %s\n\n" $pName
makeRW $pTarget
if ( isRecovery ); then
if ( ./tools/img2simg $pTarget $pTargetSparse ); then
flash $pTargetSparse $pPath
rm -f $pTargetSparse
fi
fi
ok=1
else
printf "$app: There Was A Problem Dumping The Partition...\n\n"
exit 1
fi
else
printf "$app: NO 'shared_blocks feature' Detected @ %s. Ignoring\n" $pName;
fi
fi
done
if [ ! -z $ok ]; then success; else printf "$app: There Was A Problem Removing Read-Only Restriction Of Your Device. Aborting...\n\n"; exit 1; fi
else
if [ -z "$inputValue" ]; then
printf "$app: Dumping Super Partition To: %s\n" $sDumpTarget
printf "$app: Please Wait Patiently...\n\n"
if ( dd if=$superPath of=$sDumpTarget 2>&1 ); then
printf "\n$app: Successfully Dumped Super Partition To: %s\n" $sDumpTarget
else
printf "$app: Error: Failed To Dump File To: %s\n\n" $sDumpTarget
exit 1
fi
fi
fi
}
isSuper(){
if [ -z "$superPath" ]; then
[ -z "$1" ] && printf "$app: Unable To Locate Super Partition On Device.\n"
return 1
else
[ -z "$1" ] && printf "$app: Your Super Partition Is Located At: %s\n" $superPath
return 0
fi
}
getCurrentSlot(){
currentSlot=`getprop ro.boot.slot_suffix`
if [[ -z "$currentSlot" || "$currentSlot" == "_a" ]]; then
currentSlot=0
elif [ "$currentSlot" == "_b" ]; then
currentSlot=1
fi
if ( isSuper 1 ); then printf "$app: Current Slot Is: %s\n" $currentSlot; fi
}
getDeviceName(){
manufacturer=`getprop ro.product.manufacturer`
if ( isRecovery ); then
product=`getprop ro.product.model`
else
product=`getprop ro.product.marketname`
#product=`getprop ro.product.vendor.marketname`
fi
printf "$app: Current Device: $manufacturer $product\n"
}
setGlobalVars(){
superPath=`ls -l /dev/block/by-name/super 2>/dev/null | awk '{print $NF}'`
if [ -z "$inputValue" ]; then
sDumpTarget=$sDumpDir"/super_original.bin"
else
sDumpTarget=$inputValue
fi
}
isMounted(){
if [[ "`cat /proc/mounts`" == *"$1"* ]]; then
return 0
else
return 1
fi
}
checkRW(){
if ( isSuper ); then
if ( isRecovery ); then
for i in /dev/block/dm-*; do
vol=`tune2fs -l $i 2>/dev/null | grep "volume" | awk '{print $NF}'`
if [[ "$vol" == "/" || "$vol" == "product" || "$vol" == "vendor" ]]; then
if ( isMounted $i ); then
result=`mount -o rw,remount $i 2>&1`; if [[ "$result" == *"read-only" ]]; then printf "$app: %s Is read-only\n" $i; else if [[ "$result" != *"I/O error" ]]; then printf "$app: %s Is Already R/W Capable. Ignoring\n" $i; fi; fi
else
if ( mkdir -p /mnt/dir ); then
if ( mount -t ext4 -o rw $i /mnt/dir ); then printf "$app: %s Is Already R/W Capable. Ignoring\n" $i; umount /mnt/dir; fi
fi
fi
fi
done
else
for i in / /product /vendor; do result=`mount -o rw,remount $i 2>&1`; if [[ "$result" == *"read-only" ]]; then printf "$app: %s Is read-only\n" $i; else if [[ "$result" != *"I/O error" ]]; then printf "$app: %s Is Already R/W Capable. Ignoring\n" $i; fi; fi; done
fi
else
for i in /system /product /vendor; do result=`mount -o rw,remount $i 2>&1`; if [[ "$result" == *"read-only" ]]; then printf "$app: %s Is read-only\n" $i; else if [[ "$result" != *"I/O error" ]]; then printf "$app: %s Is Already R/W Capable. Ignoring\n" $i; fi; fi; done
fi
}
sdkCheck(){
sdkVersion=`getprop ro.build.version.sdk`
if (( $sdkVersion < 29 )); then
printf "$app: Please Install Android 10 Or Newer & Try Again\n\n"; exit 1
elif (( $sdkVersion == 29 )); then
android=10
elif (( $sdkVersion == 30 )); then
android=11
elif (( $sdkVersion == 31 )); then
android=12
elif (( $sdkVersion == 32 )); then
android=12.1
elif (( $sdkVersion == 33 )); then
android=13
elif (( $sdkVersion == 34 )); then
android=14
else
printf "$app: Your Android Version Is Not Supported Yet. Aborting...\n\n"; exit 1
fi
printf "$app: Current Android Version: %s\n" $android
}
checkDeviceState(){
if [ `whoami` != "root" ]; then printf "$app: No Root Detected. Please Try Again As Root. Aborting..\n\n"; exit 1; fi
if ( which twrp>/dev/null ); then printf "$app: Device Is In Custom Recovery Mode\n"; else printf "$app: Device Is In Android Mode\n"; notwrp=1; fi
getDeviceName
setenforce 0; printf "$app: Current SELinux Status: %s\n" `getenforce`
getCurrentSlot
checkRW
if [ "$PWD" != "$LOC" ]; then
cd $LOC
if [ "$PWD" != "$LOC" ]; then
printf "$app: Please Make Sure %s Exists & Try Again\n\n" $LOC
exit 1
fi
fi
printf "$app: Adjusting Permissions...\n"
chmod -R 777 $LOC # for i in ./tools/*; do chmod +x $i; done
printf "$app: Attempting To Disable DM-Verity & Verification...\n"
./tools/avbctl --force disable-verification
./tools/avbctl --force disable-verity
}
mainProc(){
printf "$app: Initiating Procedure...\n\n"
setGlobalVars
checkDeviceState
if ( ! isSuper 1 ); then
dumpFile 0
else
lpdumpPath="$logDir/lpdump.txt"
./tools/lpdump --slot=$currentSlot > $lpdumpPath
dumpFile 1
lpUnpack
fi
}
cleanUp(){
for file in $1; do
rm -f $file
done
}
mkdir -p $logDir $pDumpDir $sDumpDir
mainProc | tee "$logDir/mylog.txt"

Binary file not shown.

Binary file not shown.