Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Introduce Termux support..! (#2)
Browse files Browse the repository at this point in the history
* Termux support 2

* Update README.md
  • Loading branch information
ravindu644 authored Feb 18, 2024
1 parent 2b2c968 commit 7e53fd3
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 42 deletions.
70 changes: 35 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
## Kitchen (Boot image unpacker and repacker)
![Preview IMG](https://github.com/ravindu644/Kitchen/assets/126038496/61fc39dd-5fe6-4fb5-8c06-0b6a6b2c937b)
**Description:** This script can unpack, repack, and sign the boot images of Android without breaking Android Verified Boot (AVB).

**Requirements:** Linux Environment (PC)

---

### Usage :
**01.** Clone this Repository.

**02.** Navigate to Repo's directory and put your boot.img there.

**03.** To Unpack the boot image, use this command :

```
./kitchen unpack boot.img
```

- Replace boot.img with your boot image's name.
- Make edits to the unpacked boot image in the "workspace" folder. <br>

> **❗Notes:** You can only use the **OEM boot image** which is provided by your manufacturer inside your firmware package. Else, the script will throw an error while signing the modified boot image.
**04.** To Repack the boot image, use this command :

```
./kitchen repack
```

---

- Contributions are Welcome.
- Join my [Telegram](https://t.me/SamsungTweaks) for more Android tips.
- Credits : [Magisk](https://github.com/topjohnwu/Magisk) for magiskboot binary.
## Kitchen (Boot image unpacker and repacker)
![Preview IMG](https://github.com/ravindu644/Kitchen/assets/126038496/61fc39dd-5fe6-4fb5-8c06-0b6a6b2c937b)
**Description:** This script can unpack, repack, and sign the boot images of Android without breaking Android Verified Boot (AVB).

**Requirements:** Linux Environment (PC or Termux)

---

### Usage :
**01.** Clone this Repository.

**02.** Navigate to Repo's directory and put your boot.img there.

**03.** To Unpack the boot image, use this command :

```
./kitchen unpack boot.img
```

- Replace boot.img with your boot image's name.
- Make edits to the unpacked boot image in the "workspace" folder. <br>

> **❗Notes:** You can only use the **OEM boot image** which is provided by your manufacturer inside your firmware package. Else, the script will throw an error while signing the modified boot image.
**04.** To Repack the boot image, use this command :

```
./kitchen repack
```

---

- Contributions are Welcome.
- Join my [Telegram](https://t.me/SamsungTweaks) for more Android tips.
- Credits : [Magisk](https://github.com/topjohnwu/Magisk) for magiskboot binary.
Binary file added bin/magiskboot_android
Binary file not shown.
File renamed without changes.
23 changes: 16 additions & 7 deletions kitchen
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@
DIR=$(pwd)
CMD=$1
BOOTIMG=$2
MAGISKBOOT=$DIR/bin/magiskboot

check_termux() {
if [ -n "$PREFIX" ] && [ "$PREFIX" != "/" ]; then
MAGISKBOOT=$DIR/bin/magiskboot_android
else
MAGISKBOOT=$DIR/bin/magiskboot_linux
fi
}
check_termux

AVBTOOL=$DIR/bin/avbtool

chmod +x $DIR/bin/*
Expand All @@ -29,11 +38,11 @@ requirements(){
if [ ! -f "$DIR/res/.req" ]; then
echo -e "${RED}[+] Installing Requirements...${RESET}\n"
if command -v pkg &> /dev/null; then
pkg update -y > /dev/null 2>&1
echo -e "\n${GREEN}[i] OpenSSL${RESET}\n" ; pkg install openssl -y
pkg update -y
echo -e "\n${GREEN}[i] OpenSSL${RESET}\n" ; pkg install openssl openssl-tool -y
echo -e "\n${GREEN}[i] Python${RESET}\n" ; pkg install python -y
elif command -v apt &> /dev/null; then
sudo apt update -y > /dev/null 2>&1
sudo apt update -y
echo -e "\n${GREEN}[i] OpenSSL${RESET}\n" ; sudo apt install openssl -y
echo -e "\n${GREEN}[i] Python${RESET}\n" ; sudo apt install python3 python-is-python3 -y
else
Expand All @@ -55,7 +64,7 @@ key(){
fi
if [ ! -f "$DIR/res/key/sign.pem" ]; then
echo -e "${BOLD_YELLOW}[+] Generating a signing key...${RESET}\n"
openssl genrsa -f4 -out "$DIR/res/key/sign.pem" 4096 > /dev/null 2>&1
openssl genrsa -f4 -out "$DIR/res/key/sign.pem" 4096
fi
}

Expand Down Expand Up @@ -84,8 +93,8 @@ checks(){

clean(){
rm -rf "$DIR/workspace"
rm "$DIR/res/.tmp" > /dev/null 2>&1
rm "$DIR/res/.tmp1" > /dev/null 2>&1
rm "$DIR/res/.tmp"
rm "$DIR/res/.tmp1"
}

unpack(){
Expand Down

0 comments on commit 7e53fd3

Please sign in to comment.