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

245
Final_Zip/Devices/Fogo/LINUX.sh Executable file
View file

@ -0,0 +1,245 @@
#!/bin/bash
# Variables
INSTALLER_VERSION="0.17"
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
# Recovery Menu
menu_recovery() {
echo -e "\n========= Recovery Selection ========"
echo "-------------------------------------"
echo "1 => OrangeFox -"
echo "2 => TWRP -"
echo "3 => Rom Built Recovery -"
echo "-------------------------------------"
echo "Select Your Option & PRESS ENTER -"
echo "-------------------------------------"
read recovery
case $recovery in
# Option 1- OFRP
1) clear; OFRP=TRUE; RECOVERY=OrangeFox;;
# Option 2 - TWRP
2) clear; TWRP=TRUE; RECOVERY=TWRP;;
# Option 3 - Rom Recovery
3) clear; ROM_RECOVERY=TRUE;;
*)echo "Invalid Option. Please Select 1, 2 or 3"; sleep 5; clear; menu_recovery;;
esac
}
############################
# Root Menu
menu_root() {
echo -e "\n=========== Root Selection =========="
echo "-------------------------------------"
echo "1 => KernelSU -"
echo "2 => Magisk -"
echo "3 => No Root -"
echo "-------------------------------------"
echo "Select Your Option & PRESS ENTER -"
echo "-------------------------------------"
read root
case $root in
# Option 1- KernelSU
1) clear; ROOT=KSU;;
# Option 2 - Magisk
2) clear; ROOT=MAGISK;;
# Option 3 - No Root
3) clear; ROOT=NONE;;
*)echo "Invalid Option. Please Select 1, 2 or 3"; sleep 5; clear; menu_root;;
esac
}
############################
# Encryption Menu
menu_encryption() {
echo -e "\n======== Encryption Selection ======="
echo "-------------------------------------"
echo "1 => Keep Encryption -"
echo "2 => Disable Encryption -"
echo "-------------------------------------"
echo "Select Your Option & PRESS ENTER -"
echo "-------------------------------------"
read crypto
case $crypto in
# Option 1 - Keep Encryption
1) clear; echo ""; echo "Recovery Selected => $RECOVERY"; echo ""; echo "Root Option Selected => $ROOT"; echo ""; echo "Encryption => Enabled"; echo ""; sleep 7;;
# Option 2 - Disable Encryption
2) clear; echo ""; echo "Recovery Selected => $RECOVERY"; echo ""; echo "Root Option Selected => $ROOT"; echo ""; echo "Encryption => Disabled"; echo ""; CRYPTO=FALSE; sleep 7;;
*)echo "Invalid Option. Please Select 1 or 2"; sleep 5; clear; menu_encryption;;
esac
}
############################
menu_recovery
menu_root
menu_encryption
# Flash Recovery Choice
if [[ $OFRP == TRUE ]]
then
# Flash OrangeFox
echo "Flashing OrangeFox Recovery..."
echo ""
fastboot flash recovery OFRP.img
echo ""
echo ""
elif [[ $TWRP == TRUE ]]
then
# Flash OrangeFox
echo "Flashing TWRP Recovery..."
echo ""
fastboot flash recovery TWRP.img
echo ""
echo ""
elif [[ $ROM_RECOVERY == TRUE ]]
then
# Flash Rom Built Recovery
echo "Flashing Rom Built Recovery..."
echo ""
fastboot flash recovery recovery.img
echo ""
echo ""
fi
# Flash Dtbo
echo "Flashing Dtbo..."; echo ""; fastboot flash dtbo dtbo.img; echo ""; echo ""
# Flash Vbmeta
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 ""
# Flash Empty Super
echo "Flashing Empty Super..."; echo ""; fastboot wipe-super super_empty.img; echo ""; echo ""
# Flash Vendor_Boot
echo "Flashing Vendor_Boot..."; echo ""; fastboot flash vendor_boot vendor_boot.img; echo ""; echo ""
# Flash Boot
echo "Flashing Boot..."; echo ""; fastboot flash boot boot.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 Root Choice
if [[ $ROOT == KSU ]]
then
# Flash KernelSU
echo "Flashing KernelSU Root..."
echo ""
fastboot flash boot KSU.img
elif [[ $ROOT == MAGISK ]]
then
# Flash Magisk
echo "Flashing Magisk Root..."
echo ""
fastboot flash boot Magisk.img
elif [[ $ROOT == NONE ]]
then
# Flash No Root
echo "Not Rooting Device..."
echo ""
fastboot flash boot boot.img
fi
# Flash Product
echo ""; echo ""; echo "Flashing Product..."; echo ""; fastboot flash product_a product.img; echo ""; echo ""
# Flash System
echo "Flashing System..."; echo ""; fastboot flash system_a system.img; echo ""; echo ""
# Flash System_Ext
echo "Flashing System_Ext..."; echo ""; fastboot flash system_ext_a system_ext.img; echo ""; echo ""
# Flash Vendor Encryption Choice
if [[ $CRYPTO == FALSE ]]
then
# Flash Disabled Encryption
echo "Flashing Encryption Disabled Vendor..."
echo ""
fastboot flash vendor_a NoEncrypt-vendor.img
echo ""
echo ""
else
# Flash Enabled Encryption
echo "Flashing Encryption Enabled Vendor..."
echo ""
fastboot flash vendor_a vendor.img
echo ""
echo ""
fi
# Flash Vendor_Dlkm
echo "Flashing Vendor_Dlkm..."; echo ""; fastboot flash vendor_dlkm_a vendor_dlkm.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

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,277 @@
@echo off
REM Set Variables
set "INSTALLER_VERSION=0.18"
set "APP_NAME=A-Team Custom Rom Installer - Version: %INSTALLER_VERSION%"
REM Print App Name To Terminal
title %APP_NAME%
REM Main Menu
echo:
echo: 2019-Present A-Team Digital Solutions
echo:
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
set /p input=
call :ClearScreen
REM Set Slot
fastboot set_active a
call :ClearScreen
REM Show Active Slot
echo:
echo ========= Your Current Slot ========
echo - -
echo ------------------------------------
fastboot getvar current-slot
echo ------------------------------------
echo - -
echo ------------------------------------
echo ====================================
echo:
echo:
echo PRESS ENTER TO CONTINUE
set /p input=
call :ClearScreen
REM Recovery Menu
echo:
echo ========= Recovery Selection ========
echo -------------------------------------
echo 1 ^=^> OrangeFox -
echo 2 ^=^> TWRP -
echo 3 ^=^> Rom Built Recovery -
echo -------------------------------------
echo Select Your Option ^& PRESS ENTER -
echo -------------------------------------
set /p recovery=
REM Process Recovery Choice
if "%recovery%"=="1" (
call :ClearScreen
set "OFRP=TRUE"
set "RECOVERY=OrangeFox"
)
if "%recovery%"=="2" (
call :ClearScreen
set "TWRP=TRUE"
set "RECOVERY=TWRP"
)
if "%recovery%"=="3" (
call :ClearScreen
set "ROM_RECOVERY=TRUE"
set "RECOVERY=Rom_Built_Recovery"
)
REM Root Menu
echo:
echo =========== Root Selection ==========
echo -------------------------------------
echo 1 ^=^> KernelSU -
echo 2 ^=^> Magisk -
echo 3 ^=^> No Root -
echo -------------------------------------
echo Select Your Option ^& PRESS ENTER -
echo -------------------------------------
set /p root=
REM Process Root Choice
if "%root%"=="1" (
call :ClearScreen
set "ROOT=KSU"
)
if "%root%"=="2" (
call :ClearScreen
set "ROOT=MAGISK"
)
if "%root%"=="3" (
call :ClearScreen
set "ROOT=NONE"
)
REM Encryption Menu
echo:
echo ======== Encryption Selection =======
echo -------------------------------------
echo 1 ^=^> Keep Encryption -
echo 2 ^=^> Disable Encryption -
echo -------------------------------------
echo Select Your Option ^& PRESS ENTER -
echo -------------------------------------
set /p crypto=
REM Process Encryption choice
if "%crypto%"=="1" (
call :ClearScreen
echo:
echo Recovery Selected => "%RECOVERY%"
echo:
echo:
echo Root Option Selected => "%ROOT%"
echo:
echo:
echo Encryption => Enabled
echo:
echo:
ping 127.0.0.1 -n 7 -w 1000 > nul
)
if "%crypto%"=="2" (
call :ClearScreen
echo:
echo Recovery Selected => "%RECOVERY%"
echo:
echo:
echo Root Option Selected => "%ROOT%"
echo:
echo:
echo Encryption => Disabled
echo:
echo:
set "CRYPTO=FALSE"
ping 127.0.0.1 -n 7 -w 1000 > nul
)
if "%OFRP%" == "TRUE" (
echo Flashing OrangeFox Recovery...
echo:
fastboot flash recovery OFRP.img
echo:
echo:
)
if "%TWRP%" == "TRUE" (
echo Flashing TWRP Recovery...
echo:
fastboot flash recovery TWRP.img
echo:
echo:
)
if "%ROM_RECOVERY%" == "TRUE" (
echo Flashing Rom Built Recovery...
echo:
fastboot flash recovery recovery.img
echo:
echo:
)
REM Flash Dtbo
echo Flashing Dtbo... && echo: && fastboot flash dtbo dtbo.img && echo: && echo:
REM Flash Vbmeta
echo Flashing Vbmeta... && echo: && fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img && echo: && echo:
REM Flash Vbmeta_System
echo Flashing Vbmeta_System... && echo: && fastboot flash --disable-verity --disable-verification vbmeta_system vbmeta_system.img && echo: && echo:
REM Flash Empty Super
echo Flashing Empty Super... && echo: && fastboot wipe-super super_empty.img && echo: && echo:
REM Flash Vendor_Boot
echo Flashing Vendor_Boot... && echo: && fastboot flash vendor_boot vendor_boot.img && echo: && echo:
REM Flash Boot
echo Flashing Boot... && echo: && fastboot flash boot boot.img && echo: && echo:
REM Format Data & Metadata
echo Formatting Data ^& Metadata... && ping 127.0.0.1 -n 7 -w 1000 > nul && echo: && fastboot -w && echo: && echo:
REM Reboot Device To FastbootD
fastboot reboot fastboot && echo: && echo:
if "%ROOT%" == "KSU" (
echo Flashing KernelSU Root...
echo:
fastboot flash boot KSU.img
echo:
echo:
)
if "%ROOT%" == "MAGISK" (
echo Flashing Magisk Root...
echo:
fastboot flash boot Magisk.img
echo:
echo:
)
if "%ROOT%" == "NONE" (
echo Not Rooting Device...
echo:
fastboot flash boot boot.img
echo:
echo:
)
REM Flash Product
echo Flashing Product... && echo: && fastboot flash product_a product.img && echo: && echo:
REM Flash System
echo Flashing System... && echo: && fastboot flash system_a system.img && echo: && echo:
REM Flash System_Ext
echo Flashing System_Ext... && echo: && fastboot flash system_ext_a system_ext.img && echo: && echo:
REM Flash Vendor Encryption Choice
if "%CRYPTO%"=="FALSE" (
echo Flashing Encryption Disabled Vendor...
echo:
fastboot flash vendor_a NoEncrypt-vendor.img
echo:
echo:
) else (
echo Flashing Encryption Enabled Vendor...
echo:
fastboot flash vendor_a vendor.img
echo:
echo:
)
REM Flash Vendor_Dlkm
echo Flashing Vendor_Dlkm... && echo: && fastboot flash vendor_dlkm_a vendor_dlkm.img && echo: && echo:
REM Reboot Device
fastboot reboot && echo: && echo: && ping 127.0.0.1 -n 3 -w 1000 > nul && echo: && echo:
echo === THANK YOU ===== PLEASE ENJOY ===
echo ------------------------------------
echo ======= PRESS ENTER TO EXIT ========
set /p input=
:ClearScreen
REM This function clears the screen
echo.
for /L %%i in (1,1,50) do echo.
goto :eof

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"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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

245
Final_Zip/Devices/Genevn/LINUX.sh Executable file
View file

@ -0,0 +1,245 @@
#!/bin/bash
# Variables
INSTALLER_VERSION="0.17"
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
# Recovery Menu
menu_recovery() {
echo -e "\n========= Recovery Selection ========"
echo "-------------------------------------"
echo "1 => OrangeFox -"
echo "2 => TWRP -"
echo "3 => Rom Built Recovery -"
echo "-------------------------------------"
echo "Select Your Option & PRESS ENTER -"
echo "-------------------------------------"
read recovery
case $recovery in
# Option 1- OFRP
1) clear; OFRP=TRUE; RECOVERY=OrangeFox;;
# Option 2 - TWRP
2) clear; TWRP=TRUE; RECOVERY=TWRP;;
# Option 3 - Rom Recovery
3) clear; ROM_RECOVERY=TRUE;;
*)echo "Invalid Option. Please Select 1, 2 or 3"; sleep 5; clear; menu_recovery;;
esac
}
############################
# Root Menu
menu_root() {
echo -e "\n=========== Root Selection =========="
echo "-------------------------------------"
echo "1 => KernelSU -"
echo "2 => Magisk -"
echo "3 => No Root -"
echo "-------------------------------------"
echo "Select Your Option & PRESS ENTER -"
echo "-------------------------------------"
read root
case $root in
# Option 1- KernelSU
1) clear; ROOT=KSU;;
# Option 2 - Magisk
2) clear; ROOT=MAGISK;;
# Option 3 - No Root
3) clear; ROOT=NONE;;
*)echo "Invalid Option. Please Select 1, 2 or 3"; sleep 5; clear; menu_root;;
esac
}
############################
# Encryption Menu
menu_encryption() {
echo -e "\n======== Encryption Selection ======="
echo "-------------------------------------"
echo "1 => Keep Encryption -"
echo "2 => Disable Encryption -"
echo "-------------------------------------"
echo "Select Your Option & PRESS ENTER -"
echo "-------------------------------------"
read crypto
case $crypto in
# Option 1 - Keep Encryption
1) clear; echo ""; echo "Recovery Selected => $RECOVERY"; echo ""; echo "Root Option Selected => $ROOT"; echo ""; echo "Encryption => Enabled"; echo ""; sleep 7;;
# Option 2 - Disable Encryption
2) clear; echo ""; echo "Recovery Selected => $RECOVERY"; echo ""; echo "Root Option Selected => $ROOT"; echo ""; echo "Encryption => Disabled"; echo ""; CRYPTO=FALSE; sleep 7;;
*)echo "Invalid Option. Please Select 1 or 2"; sleep 5; clear; menu_encryption;;
esac
}
############################
menu_recovery
menu_root
menu_encryption
# Flash Recovery Choice
if [[ $OFRP == TRUE ]]
then
# Flash OrangeFox
echo "Flashing OrangeFox Recovery..."
echo ""
fastboot flash recovery OFRP.img
echo ""
echo ""
elif [[ $TWRP == TRUE ]]
then
# Flash OrangeFox
echo "Flashing TWRP Recovery..."
echo ""
fastboot flash recovery TWRP.img
echo ""
echo ""
elif [[ $ROM_RECOVERY == TRUE ]]
then
# Flash Rom Built Recovery
echo "Flashing Rom Built Recovery..."
echo ""
fastboot flash recovery recovery.img
echo ""
echo ""
fi
# Flash Dtbo
echo "Flashing Dtbo..."; echo ""; fastboot flash dtbo dtbo.img; echo ""; echo ""
# Flash Vbmeta
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 ""
# Flash Empty Super
echo "Flashing Empty Super..."; echo ""; fastboot wipe-super super_empty.img; echo ""; echo ""
# Flash Vendor_Boot
echo "Flashing Vendor_Boot..."; echo ""; fastboot flash vendor_boot vendor_boot.img; echo ""; echo ""
# Flash Boot
echo "Flashing Boot..."; echo ""; fastboot flash boot boot.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 Root Choice
if [[ $ROOT == KSU ]]
then
# Flash KernelSU
echo "Flashing KernelSU Root..."
echo ""
fastboot flash boot KSU.img
elif [[ $ROOT == MAGISK ]]
then
# Flash Magisk
echo "Flashing Magisk Root..."
echo ""
fastboot flash boot Magisk.img
elif [[ $ROOT == NONE ]]
then
# Flash No Root
echo "Not Rooting Device..."
echo ""
fastboot flash boot boot.img
fi
# Flash Product
echo ""; echo ""; echo "Flashing Product..."; echo ""; fastboot flash product_a product.img; echo ""; echo ""
# Flash System
echo "Flashing System..."; echo ""; fastboot flash system_a system.img; echo ""; echo ""
# Flash System_Ext
echo "Flashing System_Ext..."; echo ""; fastboot flash system_ext_a system_ext.img; echo ""; echo ""
# Flash Vendor Encryption Choice
if [[ $CRYPTO == FALSE ]]
then
# Flash Disabled Encryption
echo "Flashing Encryption Disabled Vendor..."
echo ""
fastboot flash vendor_a NoEncrypt-vendor.img
echo ""
echo ""
else
# Flash Enabled Encryption
echo "Flashing Encryption Enabled Vendor..."
echo ""
fastboot flash vendor_a vendor.img
echo ""
echo ""
fi
# Flash Vendor_Dlkm
echo "Flashing Vendor_Dlkm..."; echo ""; fastboot flash vendor_dlkm_a vendor_dlkm.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

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,277 @@
@echo off
REM Set Variables
set "INSTALLER_VERSION=0.18"
set "APP_NAME=A-Team Custom Rom Installer - Version: %INSTALLER_VERSION%"
REM Print App Name To Terminal
title %APP_NAME%
REM Main Menu
echo:
echo: 2019-Present A-Team Digital Solutions
echo:
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
set /p input=
call :ClearScreen
REM Set Slot
fastboot set_active a
call :ClearScreen
REM Show Active Slot
echo:
echo ========= Your Current Slot ========
echo - -
echo ------------------------------------
fastboot getvar current-slot
echo ------------------------------------
echo - -
echo ------------------------------------
echo ====================================
echo:
echo:
echo PRESS ENTER TO CONTINUE
set /p input=
call :ClearScreen
REM Recovery Menu
echo:
echo ========= Recovery Selection ========
echo -------------------------------------
echo 1 ^=^> OrangeFox -
echo 2 ^=^> TWRP -
echo 3 ^=^> Rom Built Recovery -
echo -------------------------------------
echo Select Your Option ^& PRESS ENTER -
echo -------------------------------------
set /p recovery=
REM Process Recovery Choice
if "%recovery%"=="1" (
call :ClearScreen
set "OFRP=TRUE"
set "RECOVERY=OrangeFox"
)
if "%recovery%"=="2" (
call :ClearScreen
set "TWRP=TRUE"
set "RECOVERY=TWRP"
)
if "%recovery%"=="3" (
call :ClearScreen
set "ROM_RECOVERY=TRUE"
set "RECOVERY=Rom_Built_Recovery"
)
REM Root Menu
echo:
echo =========== Root Selection ==========
echo -------------------------------------
echo 1 ^=^> KernelSU -
echo 2 ^=^> Magisk -
echo 3 ^=^> No Root -
echo -------------------------------------
echo Select Your Option ^& PRESS ENTER -
echo -------------------------------------
set /p root=
REM Process Root Choice
if "%root%"=="1" (
call :ClearScreen
set "ROOT=KSU"
)
if "%root%"=="2" (
call :ClearScreen
set "ROOT=MAGISK"
)
if "%root%"=="3" (
call :ClearScreen
set "ROOT=NONE"
)
REM Encryption Menu
echo:
echo ======== Encryption Selection =======
echo -------------------------------------
echo 1 ^=^> Keep Encryption -
echo 2 ^=^> Disable Encryption -
echo -------------------------------------
echo Select Your Option ^& PRESS ENTER -
echo -------------------------------------
set /p crypto=
REM Process Encryption choice
if "%crypto%"=="1" (
call :ClearScreen
echo:
echo Recovery Selected => "%RECOVERY%"
echo:
echo:
echo Root Option Selected => "%ROOT%"
echo:
echo:
echo Encryption => Enabled
echo:
echo:
ping 127.0.0.1 -n 7 -w 1000 > nul
)
if "%crypto%"=="2" (
call :ClearScreen
echo:
echo Recovery Selected => "%RECOVERY%"
echo:
echo:
echo Root Option Selected => "%ROOT%"
echo:
echo:
echo Encryption => Disabled
echo:
echo:
set "CRYPTO=FALSE"
ping 127.0.0.1 -n 7 -w 1000 > nul
)
if "%OFRP%" == "TRUE" (
echo Flashing OrangeFox Recovery...
echo:
fastboot flash recovery OFRP.img
echo:
echo:
)
if "%TWRP%" == "TRUE" (
echo Flashing TWRP Recovery...
echo:
fastboot flash recovery TWRP.img
echo:
echo:
)
if "%ROM_RECOVERY%" == "TRUE" (
echo Flashing Rom Built Recovery...
echo:
fastboot flash recovery recovery.img
echo:
echo:
)
REM Flash Dtbo
echo Flashing Dtbo... && echo: && fastboot flash dtbo dtbo.img && echo: && echo:
REM Flash Vbmeta
echo Flashing Vbmeta... && echo: && fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img && echo: && echo:
REM Flash Vbmeta_System
echo Flashing Vbmeta_System... && echo: && fastboot flash --disable-verity --disable-verification vbmeta_system vbmeta_system.img && echo: && echo:
REM Flash Empty Super
echo Flashing Empty Super... && echo: && fastboot wipe-super super_empty.img && echo: && echo:
REM Flash Vendor_Boot
echo Flashing Vendor_Boot... && echo: && fastboot flash vendor_boot vendor_boot.img && echo: && echo:
REM Flash Boot
echo Flashing Boot... && echo: && fastboot flash boot boot.img && echo: && echo:
REM Format Data & Metadata
echo Formatting Data ^& Metadata... && ping 127.0.0.1 -n 7 -w 1000 > nul && echo: && fastboot -w && echo: && echo:
REM Reboot Device To FastbootD
fastboot reboot fastboot && echo: && echo:
if "%ROOT%" == "KSU" (
echo Flashing KernelSU Root...
echo:
fastboot flash boot KSU.img
echo:
echo:
)
if "%ROOT%" == "MAGISK" (
echo Flashing Magisk Root...
echo:
fastboot flash boot Magisk.img
echo:
echo:
)
if "%ROOT%" == "NONE" (
echo Not Rooting Device...
echo:
fastboot flash boot boot.img
echo:
echo:
)
REM Flash Product
echo Flashing Product... && echo: && fastboot flash product_a product.img && echo: && echo:
REM Flash System
echo Flashing System... && echo: && fastboot flash system_a system.img && echo: && echo:
REM Flash System_Ext
echo Flashing System_Ext... && echo: && fastboot flash system_ext_a system_ext.img && echo: && echo:
REM Flash Vendor Encryption Choice
if "%CRYPTO%"=="FALSE" (
echo Flashing Encryption Disabled Vendor...
echo:
fastboot flash vendor_a NoEncrypt-vendor.img
echo:
echo:
) else (
echo Flashing Encryption Enabled Vendor...
echo:
fastboot flash vendor_a vendor.img
echo:
echo:
)
REM Flash Vendor_Dlkm
echo Flashing Vendor_Dlkm... && echo: && fastboot flash vendor_dlkm_a vendor_dlkm.img && echo: && echo:
REM Reboot Device
fastboot reboot && echo: && echo: && ping 127.0.0.1 -n 3 -w 1000 > nul && echo: && echo:
echo === THANK YOU ===== PLEASE ENJOY ===
echo ------------------------------------
echo ======= PRESS ENTER TO EXIT ========
set /p input=
:ClearScreen
REM This function clears the screen
echo.
for /L %%i in (1,1,50) do echo.
goto :eof

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"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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.

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

264
Final_Zip/Devices/Milanf/LINUX.sh Executable file
View file

@ -0,0 +1,264 @@
#!/bin/bash
# Variables
INSTALLER_VERSION="0.17"
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
# Recovery Menu
menu_recovery() {
echo -e "\n========= Recovery Selection ========"
echo "-------------------------------------"
echo "1 => OrangeFox -"
echo "2 => TWRP -"
echo "3 => Rom Built Recovery -"
echo "-------------------------------------"
echo "Select Your Option & PRESS ENTER -"
echo "-------------------------------------"
read recovery
case $recovery in
# Option 1- OFRP
1) clear; OFRP=TRUE; RECOVERY=OrangeFox;;
# Option 2 - TWRP
2) clear; TWRP=TRUE; RECOVERY=TWRP;;
# Option 3 - Rom Recovery
3) clear; ROM_RECOVERY=TRUE;;
*)echo "Invalid Option. Please Select 1, 2, 3, 4 or 5"; sleep 5; clear; menu_recovery;;
esac
}
############################
# Root Menu
menu_root() {
echo -e "\n=========== Root Selection =========="
echo "-------------------------------------"
echo "1 => KernelSU -"
echo "2 => Magisk -"
echo "3 => No Root -"
echo "-------------------------------------"
echo "Select Your Option & PRESS ENTER -"
echo "-------------------------------------"
read root
case $root in
# Option 1- KernelSU
1) clear; ROOT=KSU;;
# Option 2 - Magisk
2) clear; ROOT=MAGISK;;
# Option 3 - No Root
3) clear; ROOT=NONE;;
*)echo "Invalid Option. Please Select 1, 2 or 3"; sleep 5; clear; menu_root;;
esac
}
############################
# Encryption Menu
menu_encryption() {
echo -e "\n======== Encryption Selection ======="
echo "-------------------------------------"
echo "1 => Keep Encryption -"
echo "2 => Disable Encryption -"
echo "-------------------------------------"
echo "Select Your Option & PRESS ENTER -"
echo "-------------------------------------"
read crypto
case $crypto in
# Option 1 - Keep Encryption
1) clear; echo ""; echo "Recovery Selected => $RECOVERY"; echo ""; echo "Root Option Selected => $ROOT"; echo ""; echo "Encryption => Enabled"; echo ""; sleep 7;;
# Option 2 - Disable Encryption
2) clear; echo ""; echo "Recovery Selected => $RECOVERY"; echo ""; echo "Root Option Selected => $ROOT"; echo ""; echo "Encryption => Disabled"; echo ""; CRYPTO=FALSE; sleep 7;;
*)echo "Invalid Option. Please Select 1 or 2"; sleep 5; clear; menu_encryption;;
esac
}
############################
menu_recovery
menu_root
menu_encryption
# Flash Dtbo
echo "Flashing Dtbo..."; echo ""; fastboot flash dtbo dtbo.img; echo ""; echo ""
# Flash Vbmeta
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 ""
# Flash Empty Super
echo "Flashing Empty Super..."; echo ""; fastboot wipe-super super_empty.img; echo ""; echo ""
# Flash Vendor_Boot
echo "Flashing Vendor_Boot..."; echo ""; fastboot flash vendor_boot vendor_boot.img; echo ""; echo ""
# Flash Boot
echo "Flashing Boot..."; echo ""; fastboot flash boot boot.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 Root / Recovery Choice
if [[ $ROOT == KSU ]]
then
# Flash KernelSU OFRP
if [[ $OFRP == TRUE ]]
then
echo "Flashing KernelSU Root & OrangeFox Recovery..."
echo ""
fastboot flash boot KSU-OFRP.img
fi
# Flash KernelSU TWRP
if [[ $TWRP == TRUE ]]
then
echo "Flashing KernelSU Root & TWRP Recovery..."
echo ""
fastboot flash boot KSU-TWRP.img
fi
# Flash KernelSU Rom Built Recovery
if [[ $ROM_RECOVERY == TRUE ]]
then
echo "Flashing KernelSU Root & Rom Built Recovery..."
echo ""
fastboot flash boot KSU.img
fi
elif [[ $ROOT == MAGISK ]]
then
# Flash Magisk OFRP
if [[ $OFRP == TRUE ]]
then
echo "Flashing Magisk Root & OrangeFox Recovery..."
echo ""
fastboot flash boot Magisk-OFRP.img
fi
# Flash Magisk TWRP
if [[ $TWRP == TRUE ]]
then
echo "Flashing Magisk Root & TWRP Recovery..."
echo ""
fastboot flash boot Magisk-TWRP.img
fi
# Flash Magisk Rom Built Recovery
if [[ $ROM_RECOVERY == TRUE ]]
then
echo "Flashing Magisk Root & Rom Built Recovery..."
echo ""
fastboot flash boot Magisk.img
fi
elif [[ $ROOT == NONE ]]
then
# Flash Unrooted OFRP
if [[ $OFRP == TRUE ]]
then
echo "Flashing Unrooted Boot Image & OrangeFox Recovery..."
echo ""
fastboot flash boot Boot-OFRP.img
fi
# Flash Unrooted TWRP
if [[ $TWRP == TRUE ]]
then
echo "Flashing Unrooted Boot Image & TWRP Recovery..."
echo ""
fastboot flash boot Boot-TWRP.img
fi
# Flash Magisk Rom Built Recovery
if [[ $ROM_RECOVERY == TRUE ]]
then
echo "Flashing Unrooted Boot Image & Rom Built Recovery..."
echo ""
fastboot flash boot boot.img
fi
fi
# Flash Product
echo ""; echo ""; echo "Flashing Product..."; echo ""; fastboot flash product_a product.img; echo ""; echo ""
# Flash System
echo "Flashing System..."; echo ""; fastboot flash system_a system.img; echo ""; echo ""
# Flash System_Ext
echo "Flashing System_Ext..."; echo ""; fastboot flash system_ext_a system_ext.img; echo ""; echo ""
# Flash Vendor Encryption Choice
if [[ $CRYPTO == FALSE ]]
then
# Flash Disabled Encryption
echo "Flashing Encryption Disabled Vendor..."
echo ""
fastboot flash vendor_a NoEncrypt-vendor.img
echo ""
echo ""
else
# Flash Enabled Encryption
echo "Flashing Encryption Enabled Vendor..."
echo ""
fastboot flash vendor_a vendor.img
echo ""
echo ""
fi
# 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,521 @@
#!/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 " # v0.15 (c) PizzaG 6-22-2024 #"
ui_print " # v0.16 (c) PizzaG 9-16-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 "# 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 "# 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 "Rom Built Recovery Selected..."
export ROM_RECOVERY=TRUE
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Installer Will Continue In 3 Seconds...."
sleep 3
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 ROOT=KSU
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 ROOT=MAGISK
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..."
export ROOT=NONE
ui_print " "
ui_print " "
ui_print " "
ui_print " "
ui_print "Installer Will Continue In 3 Seconds...."
sleep 3
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 " "
# Flash Root / Recovery Choice
if [[ $ROOT == KSU ]]
then
# Flash KernelSU OFRP
if [[ $OFRP == TRUE ]]
then
echo "Flashing KernelSU Root & OrangeFox Recovery..."
echo ""
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/KSU-OFRP.img of=/dev/block/by-name/boot$SLOT
fi
# Flash KernelSU TWRP
if [[ $TWRP == TRUE ]]
then
echo "Flashing KernelSU Root & TWRP Recovery..."
echo ""
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/KSU-TWRP.img of=/dev/block/by-name/boot$SLOT
fi
# Flash KernelSU Rom Built Recovery
if [[ $ROM_RECOVERY == TRUE ]]
then
echo "Flashing KernelSU Root & Rom Built Recovery..."
echo ""
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/KSU.img of=/dev/block/by-name/boot$SLOT
fi
elif [[ $ROOT == MAGISK ]]
then
# Flash Magisk OFRP
if [[ $OFRP == TRUE ]]
then
echo "Flashing Magisk Root & OrangeFox Recovery..."
echo ""
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/Magisk-OFRP.img of=/dev/block/by-name/boot$SLOT
fi
# Flash Magisk TWRP
if [[ $TWRP == TRUE ]]
then
echo "Flashing Magisk Root & TWRP Recovery..."
echo ""
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/Magisk-TWRP.img of=/dev/block/by-name/boot$SLOT
fi
# Flash Magisk Rom Built Recovery
if [[ $ROM_RECOVERY == TRUE ]]
then
echo "Flashing Magisk Root & Rom Built Recovery..."
echo ""
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/Magisk.img of=/dev/block/by-name/boot$SLOT
fi
elif [[ $ROOT == NONE ]]
then
# Flash Unrooted OFRP
if [[ $OFRP == TRUE ]]
then
echo "Flashing Unrooted Boot Image & OrangeFox Recovery..."
echo ""
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/Boot-OFRP.img of=/dev/block/by-name/boot$SLOT
fi
# Flash Unrooted TWRP
if [[ $TWRP == TRUE ]]
then
echo "Flashing Unrooted Boot Image & TWRP Recovery..."
echo ""
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/Boot-TWRP.img of=/dev/block/by-name/boot$SLOT
fi
# Flash Magisk Rom Built Recovery
if [[ $ROM_RECOVERY == TRUE ]]
then
echo "Flashing Unrooted Boot Image & Rom Built Recovery..."
echo ""
SLOT=`getprop ro.boot.slot_suffix`
dd if=$INSTALLER/A-Team/boot.img of=/dev/block/by-name/boot$SLOT
fi
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
# 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

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,275 @@
@echo off
REM Set Variables
set "INSTALLER_VERSION=0.17"
set "APP_NAME=A-Team Custom Rom Installer - Version: %INSTALLER_VERSION%"
REM Print App Name To Terminal
title %APP_NAME%
REM Main Menu
echo:
echo: 2019-Present A-Team Digital Solutions
echo:
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
set /p input=
REM Set Slot
call :ClearScreen
fastboot set_active a
call :ClearScreen
REM Show Active Slot
echo:
echo ========= Your Current Slot ========
echo - -
echo ------------------------------------
fastboot getvar current-slot
echo ------------------------------------
echo - -
echo ------------------------------------
echo ====================================
echo:
echo:
echo PRESS ENTER TO CONTINUE
set /p input=
call :ClearScreen
REM Recovery Menu
echo:
echo ========= Recovery Selection ========
echo -------------------------------------
echo 1 ^=^> OrangeFox -
echo 2 ^=^> TWRP -
echo 3 ^=^> Rom Built Recovery -
echo -------------------------------------
echo Select Your Option ^& PRESS ENTER -
echo -------------------------------------
set /p recovery=
REM Process Recovery Choice
if "%recovery%"=="1" (
call :ClearScreen
set "OFRP=TRUE"
set "RECOVERY=OrangeFox"
)
if "%recovery%"=="2" (
call :ClearScreen
set "TWRP=TRUE"
set "RECOVERY=TWRP"
)
if "%recovery%"=="3" (
call :ClearScreen
set "ROM_RECOVERY=TRUE"
set "RECOVERY=Rom_Built_Recovery"
)
REM Root Menu
echo:
echo =========== Root Selection ==========
echo -------------------------------------
echo 1 ^=^> KernelSU -
echo 2 ^=^> Magisk -
echo 3 ^=^> No Root -
echo -------------------------------------
echo Select Your Option ^& PRESS ENTER -
echo -------------------------------------
set /p root=
REM Process Root Choice
if "%root%"=="1" (
call :ClearScreen
set "ROOT=KSU"
)
if "%root%"=="2" (
call :ClearScreen
set "ROOT=MAGISK"
)
if "%root%"=="3" (
call :ClearScreen
set "ROOT=NONE"
)
REM Encryption Menu
echo:
echo ======== Encryption Selection =======
echo -------------------------------------
echo 1 ^=^> Keep Encryption -
echo 2 ^=^> Disable Encryption -
echo -------------------------------------
echo Select Your Option ^& PRESS ENTER -
echo -------------------------------------
set /p crypto=
REM Process Encryption choice
if "%crypto%"=="1" (
call :ClearScreen
echo:
echo Recovery Selected => %RECOVERY%
echo:
echo:
echo Root Option Selected => %ROOT%
echo:
echo:
echo Encryption => Enabled
echo:
echo:
ping 127.0.0.1 -n 7 -w 1000 > nul
)
if "%crypto%"=="2" (
call :ClearScreen
echo:
echo Recovery Selected => %RECOVERY%
echo:
echo:
echo Root Option Selected => %ROOT%
echo:
echo:
echo Encryption => Disabled
echo:
echo:
set "CRYPTO=FALSE"
ping 127.0.0.1 -n 7 -w 1000 > nul
)
REM Flash Dtbo
echo Flashing Dtbo... && echo: && fastboot flash dtbo dtbo.img && echo: && echo:
REM Flash Vbmeta
echo Flashing Vbmeta... && echo: && fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img && echo: && echo:
REM Flash Vbmeta_System
echo Flashing Vbmeta_System... && echo: && fastboot flash --disable-verity --disable-verification vbmeta_system vbmeta_system.img && echo: && echo:
REM Flash Empty Super
echo Flashing Empty Super... && echo: && fastboot wipe-super super_empty.img && echo: && echo:
REM Flash Vendor_Boot
echo Flashing Vendor_Boot... && echo: && fastboot flash vendor_boot vendor_boot.img && echo: && echo:
REM Flash Boot
echo Flashing Boot... && echo: && fastboot flash boot boot.img && echo: && echo:
REM Format Data & Metadata
echo Formatting Data ^& Metadata... && ping 127.0.0.1 -n 7 -w 1000 > nul && echo: && fastboot -w && echo: && echo:
REM Reboot Device To FastbootD
fastboot reboot fastboot && echo: && echo:
REM Flash Root / Recovery Choice
if "%ROOT%"=="KSU" (
if "%RECOVERY%"=="OrangeFox" (
echo Flashing KernelSU Root ^& OrangeFox Recovery...
echo:
fastboot flash boot KSU-OFRP.img
) else if "%RECOVERY%"=="TWRP" (
echo Flashing KernelSU Root ^& TWRP Recovery...
echo:
fastboot flash boot KSU-TWRP.img
) else if "%RECOVERY%"=="Rom_Built_Recovery" (
echo Flashing KernelSU Root ^& Rom Built Recovery...
echo:
fastboot flash boot KSU.img
)
)
if "%ROOT%"=="MAGISK" (
if "%RECOVERY%"=="OrangeFox" (
echo Flashing Magisk Root ^& OrangeFox Recovery...
echo:
fastboot flash boot Magisk-OFRP.img
) else if "%RECOVERY%"=="TWRP" (
echo Flashing Magisk Root ^& TWRP Recovery...
echo:
fastboot flash boot Magisk-TWRP.img
) else if "%RECOVERY%"=="Rom_Built_Recovery" (
echo Flashing Magisk Root ^& Rom Built Recovery...
echo:
fastboot flash boot Magisk.img
)
)
if "%ROOT%"=="NONE" (
if "%RECOVERY%"=="OrangeFox" (
echo Flashing Unrooted Boot Image ^& OrangeFox Recovery...
echo:
fastboot flash boot Boot-OFRP.img
) else if "%RECOVERY%"=="TWRP" (
echo Flashing Unrooted Boot Image ^& TWRP Recovery...
echo:
fastboot flash boot Boot-TWRP.img
) else if "%RECOVERY%"=="Rom_Built_Recovery" (
echo Flashing Unrooted Boot Image ^& Rom Built Recovery...
echo:
fastboot flash boot boot.img
)
)
REM Flash Product
echo: && echo: && echo Flashing Product... && echo: && fastboot flash product_a product.img && echo: && echo:
REM Flash System
echo Flashing System... && echo: && fastboot flash system_a system.img && echo: && echo:
REM Flash System_Ext
echo Flashing System_Ext... && echo: && fastboot flash system_ext_a system_ext.img && echo: && echo:
REM Flash Vendor Encryption Choice
if "%CRYPTO%"=="FALSE" (
echo Flashing Encryption Disabled Vendor...
echo:
fastboot flash vendor_a NoEncrypt-vendor.img
echo:
echo:
) else (
echo Flashing Encryption Enabled Vendor...
echo:
fastboot flash vendor_a vendor.img
echo:
echo:
)
REM Reboot Device
fastboot reboot && echo: && echo: && ping 127.0.0.1 -n 3 -w 1000 > nul && echo: && echo:
echo === THANK YOU ===== PLEASE ENJOY ===
echo ------------------------------------
echo ======= PRESS ENTER TO EXIT ========
set /p input=
:ClearScreen
REM This function clears the screen
echo.
for /L %%i in (1,1,50) do echo.
goto :eof

View file

@ -0,0 +1 @@
--metadata-size 65536 --super-name super --sparse --metadata-slots 2 --device super:9831448576 --group main:9827254272 --partition product_a:none:2500314624:default --image product_a=/data/tmp/systemrw_1.32/img/product_a.img --partition system_a:none:2500314624:default --image system_a=/data/tmp/systemrw_1.32/img/system_a.img --partition system_ext_a:none:2500314624:default --image system_ext_a=/data/tmp/systemrw_1.32/img/system_ext_a.img --partition vendor_a:none:975491072:default --image vendor_a=/data/tmp/systemrw_1.32/img/vendor_a.img --output /data/tmp/systemrw_1.32/img/super_fixed.bin

View file

@ -0,0 +1,409 @@
#!/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
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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,409 @@
#!/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
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"

Some files were not shown because too many files have changed in this diff Show more