Install official AOSP GSI using Odin - Samsung Galaxy S9 Questions & Answers

Hi,
I have the latest stock ROM (G960FXXSFFUB3) on my Galaxy S9 (SM-G960F, Exynos) and my goal is to install official AOSP Android 11 GSI using Odin. I pretty much succeed, but I got bootloop as a result. Can you please help me to resolve this problem?
Steps to reproduce:
1. OEM Unlock [source, by @georgeburduli ]
1.1. Connect your phone to the Internet
1.2. Navigate to "Settings" -> "General management" -> "Date and time"
1.3. Disable "Automatic date and time"
1.4. Click on "Set time"
1.5. Select any date from the previous month
1.6. Navigate to "About phone" -> "Software update"
1.7. Disable "Auto download over Wi-Fi"
1.8. Click on "Download and install"
1.9. Navigate to "About phone" -> "Software information"
1.7. Tap on "Build number" 7 times to activate "Developer options"
1.8. Navigate to "Settings" -> "Developer options"
1.9. Disable "Auto update system"
1.10. Enable "OEM Unlock". If there are no "OEM Unlock" option in "Developer options", then try to repeat steps 1.1 - 1.10.
2. Prepare building tools [source, by @kkoo ]
2.1. Install 7zip
2.2. Create a new folder "tools"
2.3. Create a new folder "tools\bin"
2.4. Download the following files
- coreutils-8.26-2.tar.xz
- cygwin-3.2.0-0.1.tar.xz
- libattr1-2.4.48-2.tar.xz
- libgcc1-9.3.0-2.tar.xz
- libiconv2-1.16-2.tar.xz
- libintl8-0.19.8.1-2.tar.xz
- tar-1.33-1.tar.xz
2.5. Using 7zip open each *.tar.xz file and extract the following files and place them inside "tools\bin":
- cygattr-1.dll
- cyggcc_s-seh-1.dll
- cygiconv-2.dll
- cygintl-8.dll
- cygwin1.dll
- ls.exe
- md5sum.exe
- mv.exe
- tar.exe
2.6. Create file "tools\batch.bat"
Spoiler: tools\batch.bat
Code:
@echo ---------------mkh.mourad batch script
rem Setup ENV
SETLOCAL ENABLEDELAYEDEXPANSION
rem // Delete Previous Folder
RMDIR /S /Q temp-folder
MKDIR temp-folder
call set curentDir="%cd%%"
FOR /f "delims=" %%G in ('DIR /S /A:-D /B *.lz4') do (
call cd %%~dpG
call !curentDir!\BIN\tar --create --format=gnu -b20 --quoting-style=escape --owner=0 --group=0 --totals --mode=644 -f %%~nG.tar %%~nxG
xcopy %%~nxG !curentDir!\temp-folder\
)
cd !curentDir!
rem Build the TAR File
cd temp-folder
call !curentDir!\BIN\ls *.lz4 > temp-file.txt
call !curentDir!\BIN\tar --create --format=gnu -b20 --quoting-style=escape --owner=0 --group=0 --totals --mode=644 -f AP_TAR_MD5_CUSTOM_FILE_ODIN.tar -T temp-file.txt
del /Q temp-file.txt
cd !curentDir!
rem Create the MD5 Final File:
FOR /f "delims=" %%G in ('DIR /S /A:-D /B *.tar') do (
call cd %%~dpG
call !curentDir!\BIN\md5sum -t %%~nxG >> %%~nxG
call !curentDir!\BIN\mv %%~nxG %%~nxG.md5
)
cd !curentDir!
rem Cleaning Files
FOR /f "delims=" %%G in ('DIR /S /A:-D /B *.lz4 *.md5 ^| FINDSTR /v /i "\AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5$"') do del /Q "%%G"
3. Build the AP file to use with Odin [source, by @kkoo ]
3.1. Download lz4_win64_v*_*_*.zip
3.2. Using 7zip extract lz4_win64_v*_*_*.zip to "lz4_win64_v1_9_3"
3.3. Download vbmeta.img
3.4. Place vbmeta.img into "lz4_win64_v1_9_3/bin" and run the following command:
Code:
lz4.exe -B6 --content-size vbmeta.img vbmeta.img.lz4
3.5. Download the latest aosp_arm64_ab ROM and using 7zip extract system.img, vendor.img and cache.img into "lz4_win64_v1_9_3/bin"
3.6. Run the following command:
Code:
lz4.exe -B6 --content-size system.img system.img.lz4
lz4.exe -B6 --content-size vendor.img vendor.img.lz4
lz4.exe -B6 --content-size cache.img cache.img.lz4
3.7. Download your phone latest Official Stock ROM (I got my using Samsung Smart Switch)
3.8. Extract the downloaded file (you'll have the BL, AP, CP, CSC, HOME_CSC .tar.md5 files)
3.9. Using 7zip extract the following files from AP_*.tar.md5 into the "tools" folder from step 2.2:
- boot.img.lz4
- dqmdbg.img.lz4
- recovery.img.lz4
- userdata.img.lz4
- vendor.img.lz4
3.10. Move vbmeta.img.lz4, system.img.lz4 and cache.img.lz4 from the "lz4_win64_v1_9_3/bin/" into the "tools" folder
3.11. Double click on the "tools/batch.bat" file
3.12. Once it finishes go to the "tools/temp-folder". Inside you will find the AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5
4. Flash the ROM
3.1. Install SAMSUNG_USB_Driver_for_Mobile_Phones.exe
3.2. Download Odin3-v3.14.1.zip
3.3. Extract the downloaded file
3.4. Run Odin3 v3.14.1.exe
3.5. Flash the BL, CP, HOME_CSC from your Stock ROM and AP (using AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5)
Result: Bootloop
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

I heard that many users have issue get GSI running in their S9. Endless Bootloops.
Don't users could fix it flashing stock firmware.
Others by doing a factory reset.
Others by flashing TWRP recovery:
[RECOVERY][OFFICIAL] TWRP for Galaxy S9 (Exynos)
Thread moved to https://forum.xda-developers.com/galaxy-s9/samsung-galaxy-s9--s9-cross-device-development/twrp-exynos-t3763464.
forum.xda-developers.com
Hope that your can find a way to get your device up and running again.

I got an s9 too, but it got stuck into a bootloop but I can't access anything and it won't allow me to completely power on the the device. It took to Samsung service centers and they get an error called "binary corrupted" the device was already setup with twrp but by the time it got in the loop a thief who had snatched it was trying to flash it after I locked it with my "Samsung find my device"

Related

[Kitchen] Ghost Kitchen v2 [MODYFIED FOR KITKAT] (Samsung Galaxy S4) [GT-I9505]

Ghost Kitchen v2
Compatible with Windows(Cygwin) / Mac OS X / Linux
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Ghost Kitchen Based on dsixda's Android Kitchen and was only modyfied by me and thehacker911 for the new Android 4.4,X ROM's (My extras are only for Galaxy S4 and i don't support any other Devices!!!
So please don't ask if i support any other Device, the answer is NO, cause i don't have enough time to support any other Devices.
This Kitchen is only for Galaxy S4 KitKat ROMs modyfied !!!
Features:
Code:
[FONT="Comic Sans MS"][SIZE="3"][COLOR="Black"]
1. Set up working folder from ROM
2. Zipalign all *.apk files to optimize RAM usage
3. Change name of ROM
4. Show working folder information
5. Add Root Permissions
6. Add BusyBox
7 Remove Knox
8 Create Base (Ghost Extra Mod by [URL="http://forum.xda-developers.com/member.php?u=5068852"]thehacker911[/URL])
GHOST Advanced Options
11 - Deodex files in your ROM
12 - Tools for boot image (unpack/re-pack/etc.)
13 - Sign APK or ZIP file(s)
14 - Add etc/init.d scripts support (old - use only for kernel)
15 - Add etc/init.d support (newest Method)
99. Build ROM from working folder
0. Exit
GHOST Base Menu
1 - Unpack system.ext4.img
2 - Unpack cache.ext4.img
3 - Unpack hidden.ext4.img
4 - Unpack data.ext4.img
99. Build ROM from working folder
0. Exit
[/COLOR][/SIZE][/FONT]
All Credits / Questions and answers can be found
Here
A Big Thanks to:
dsixda
thehacker911
Download
​
How to Use​​​
Open Cygwin or Terminal
write
cd ghost
./ghost
Ghost Menu opens and you can begin to make your ROM ​
​
Please move this thread to developers only forum
Sorry for that my Friend but i have this Thread created in Original I9505, cause my modyfications are only for I9505
any Moderator please move this thread to developers only forum
All fine thank you
really nice, thank you for your work!
No
What No ??
Kitchen Works Great if you say no, don't use it
Let's try it
I put the ghost folder where the kitchen folder is. I type cd ghost and it says:
-bash: cd: ghost: No such file or directory
I type cd kitchen and I am in there... confused a little where the ghost folder goes to be found... thanks in advance...
[email protected]:~/Ghost_Kitchen_v2/ghost$ ./ghost
bash: ./ghost: Permission denied
how to fix this?
bobfrantic said:
I put the ghost folder where the kitchen folder is. I type cd ghost and it says:
-bash: cd: ghost: No such file or directory
I type cd kitchen and I am in there... confused a little where the ghost folder goes to be found... thanks in advance...
Click to expand...
Click to collapse
First help here Bob, after you changed device. You download program then you have a main folder where inside there's a folder named ghost. Cd to main folder=>cd to ghost folder and write ./ghost to start kitchen, if you get "permission denied" write chmod a+x ghost then again ./ghost
kentandrei said:
[email protected]:~/Ghost_Kitchen_v2/ghost$ ./ghost
bash: ./ghost: Permission denied
how to fix this?
Click to expand...
Click to collapse
Read my answer above this quote
Inviato dal mio GT-I9505
Give the kitchen folder 0777 rights
Gesendet von meinem One mit Tapatalk
AntaresOne said:
First help here Bob, after you changed device. You download program then you have a main folder where inside there's a folder named ghost. Cd to main folder=>cd to ghost folder and write ./ghost to start kitchen, if you get "permission denied" write chmod a+x ghost then again ./ghost
Read my answer above this quote
Inviato dal mio GT-I9505
Click to expand...
Click to collapse
thanks i will try your solution sir later after work.
thehacker911 said:
Give the kitchen folder 0777 rights
Gesendet von meinem One mit Tapatalk
Click to expand...
Click to collapse
how to do that sir?
EDIT: the first quote answered already my question for you sir, sorry for the noob question
btw sir how to solve this?
Enter option: 8
./ghost: line 124: scripts/ghost/menu_base: Permission denied
i choose to create a base and that comes out.
go into the folder scripts/ghost/menu_base and give all the files 0777 rights
Ghost44 said:
go into the folder scripts/ghost/menu_base and give all the files 0777 rights
Click to expand...
Click to collapse
i did what you've said sir but
[email protected]:~/Ghost_Kitchen_v2/ghost/scripts$ chmod a+x menu_base
chmod: cannot access ‘menu_base’: No such file or director
EDIT: above post is already solve.
EDIT2:
Proceed (y/n)? (default: y): y
Creating folder /home/kyang/Ghost_Kitchen_v2/ghost/system.ext4_101814_203716 ...
---> Place system.ext4.img into the folder mentioned above <--
Press Enter to continue
NON-YAFFS/NON-TAR FILE FORMAT DETECTED
Mounting system.ext4.img to loopback device and then extracting files ...
mkdir: cannot create directory ‘../tmp’: File exists
Error: Unable to mount system.ext4.img
Error: /home/kyang/Ghost_Kitchen_v2/ghost/system.ext4_101814_203716 is empty!
Press Enter to continue
i extract the I9505VJUGNI2_I9505ZTOGNI2_I9505VJUGNI2_HOME.tar.md5 and replace the system.img.ext4 to system.ext4.img and that error came out. how to extract the system.img.ext4 originally from the I9505VJUGNI2_I9505ZTOGNI2_I9505VJUGNI2_HOME.tar.md5?
AntaresOne said:
First help here Bob, after you changed device. You download program then you have a main folder where inside there's a folder named ghost. Cd to main folder=>cd to ghost folder and write ./ghost to start kitchen, if you get "permission denied" write chmod a+x ghost then again ./ghost
Inviato dal mio GT-I9505
Click to expand...
Click to collapse
I don't get permission denied, I get this error: -bash: cd: ghost: No such file or directory. Do I have to setup cgywin all over again for ghost?
bobfrantic said:
I don't get permission denied, I get this error: -bash: cd: ghost: No such file or directory. Do I have to setup cgywin all over again for ghost?
Click to expand...
Click to collapse
No Bob, I wrote that thing about permission denied just in case. You don't have to setup again: after you download kitchen rar file extract it and rename the folder in "ghost". Paste this folder in cygwin folder->home->YOURNAME and start up cygwin
@ kentandrei
go into this folder scripts/ghost/menu_base/base_tool
open sgs2toext4.jar and drop the system.img.ext4 into the sgs2toext4.jar
then rename the converted img file to system.ext4
Got it working yay but when I was setting up a work folder I got this error:
-------------------------------------
Available ROMs:
(1) I9505XXUGNG8_I9505OXXGNG2_XSK.zip
Enter selection number (default=1, cancel=0, r=refresh):
Selected I9505XXUGNG8_I9505OXXGNG2_XSK.zip
The new working folder will be named WORKING_101914_184151
Change the name (y/n)? (default: n):
Creating working folder WORKING_101914_184151 ...
Extracting ROM from ZIP file ...
Error: No system folder found!
Press Enter to continue
-----------------------------------------
Shouldn't it be creating the system folder when creating the working folder?

[DISCOVERY] Looking for info to try to support recovery on International honor 5X

If you're in the USA, TWRP and root are available for you here - but only if you have the KIW-L24 model:
[TWRP] for KIW-L24 USA (kiwi)
^^ That recovery is not recommended or tested for any version other than KIW-L24 as of February 10, 2016.
So here's the situation:
We may be able to support other versions for international users
We make no promises
We are providing a tool and instructions for you to give us the information we need about your version
We make no promises
You MUST give the information exactly as we request
No personal information is being gathered - none
We've made it as easy as possible, you don't have to be an expert
We may have to come back and ask you for more information
We make no promises
But we are willing to try if you want to help
Instructions:
Download the attached zip file and unzip it on your phone - ES File Explorer or equivalent is fine
Run the script: find-honor.sh
Copy the contents of /sdcard/found-honor.txt to http://hastebin.com
Post the link to your hastebin here in the thread
DO NOT post the output here - we're not going to manage to that - only post your hastebin.com link, ok
You may run the script however you like:
adb shell or Terminal Emulator
or just use SH Script Runner (instructions on that will come later in the thread)
Shell/terminal instructions:
cd to the folder where you unzipped the script
Execute the following command:
source find-honor.txt
How to upload:
Go to the found-honor.txt file in your file browser
/sdcard, /storage/emulated/0 and Internal Storage all mean the same thing on your phone
Open, select all, copy
Paste and save to hastebin.com
Pictures follow, in my example I use the built-in Files app
Go to the internal storage, tap on find-honor.txt
OK to open Just Once with HTMLViewer
Long press any word to get menu on bottom
Select all, then copy
Goto http://hastebin.com and paste
Find the disk image in the upper right corner to save
Post the link
Your output will look similar to http://hastebin.com/norufikubu.avrasm
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
SH Script Runner Instructions:
Load the file as shown in the pictures
Run it with the little run button next to the name in the top bar
Post results to hastebin using instructions above
DOWNLOAD SCRIPT HERE:
View attachment find-honor.sh.zip
If you're curious to see the how the information is being gathered:
Code:
#!/system/bin/sh
#
# Find honor 5X properties for recovery exploration
# EarlyMon 2016/02/08
TARG=/sdcard/found-honor.txt
getprop | grep -i ro.build.product > $TARG
echo "" >> $TARG
grep -i msm /system/build.prop >> $TARG
echo "" >> $TARG
cat /proc/meminfo | grep -i memtotal >> $TARG
echo "" >> $TARG
cat /proc/partitions >> $TARG
echo "" >> $TARG
cd /sys/dev/block
for i in 179:*
do
cat $i/uevent | grep NAME >> $TARG
echo "" >> $TARG
done
cd - > /dev/null
df >> $TARG 2> /dev/null
echo "" >> $TARG
cat /proc/self/mountinfo >> $TARG
echo "" >> $TARG
cat /system/build.prop >> $TARG
echo ""
echo "Copy the contents of"
echo ""
echo "$TARG"
echo ""
echo "to hastebin.com"
echo ""
echo "Post the hastebin.com link in the thread."
Remember -
ONLY POST YOUR DATA LINK, LIKE THIS:
http://hastebin.com/norufikubu.avrasm
You can see from my sample link that nothing personal is being gathered.
Happy to help
Hope this helps:
/eqokatoboh.md
If this is against the rules, then delete it.
Have a nice day
Widos
WidosFTW said:
Hope this helps:
/eqokatoboh.md
If this is against the rules, then delete it.
Have a nice day
Widos
Click to expand...
Click to collapse
http://hastebin.com/eqokatoboh.md
That works, thanks.
That's a 2/16 KIW-L21
Run Script with SH Script Runner
hastebin. com / ujotesawow.md
Im a new user so i cant post links
racing2410 said:
Run Script with SH Script Runner
hastebin. com / ujotesawow.md
Im a new user so i cant post links
Click to expand...
Click to collapse
Welcome to the forums.
http://hastebin.com/ujotesawow.md
Another 2/16 KIW-L21 - thanks!
@WidosFTW or @racing2410
Per suggestions from the team (shm and Ncypt3d) after reviewing your data, we've decided to update the script because we don't want to take the chance relying on the honor website specs.
Please refer to the following picture from the app CPU-X in the Play Store:
The top of yours ought to be similar and say MSM 8939 HUAWEI KIW-L21 (where mine says L23).
If there is any doubt, please erase the old find-honor.sh on your phone, get the new copy from the OP, and repeat the process for us.
Many thanks!
ok lets see
hastebin /ereyaronoh.avrasm
Done it @EarlyMon
/oqiqemojer.avrasm
http://hastebin.com/ereyaronoh.avrasm
http://hastebin.com/oqiqemojer.avrasm
Perfect, just what we expected, thanks!
I'm on the US version but still appreciate that you're working on our international brothers and sisters 5xs. So I must say....this sounds "very promising "! Sorry I couldn't help it.
WidosFTW said:
Done it @EarlyMon
/oqiqemojer.avrasm
Click to expand...
Click to collapse
racing2410 said:
ok lets see
hastebin /ereyaronoh.avrasm
Click to expand...
Click to collapse
From what i can tell from the info provided the L24 twrp recovery should work on L21.
Here is the official L24 twrp:
https://dl.twrp.me/kiwi/twrp-3.0.0-0-kiwi.img.html
Stock L21 recovery encase it does not work:
https://www.androidfilehost.com/?fid=24411628330025737
If there is a error please put as much info as you can get and pictures if possible. Also attach a recovery.log so we can double check everything is working.
ok i will try to flash the recovery after work. first i have to unlock my bootloader :angel:
deadman96385 said:
From what i can tell from the info provided the L24 twrp recovery should work on the L21.
If there is a error please put as much info as you can get and pictures if possible. Also attach a recovery.log so we can double check everything is working.
Click to expand...
Click to collapse
The installation works fine and it also starts the twrp but you cant use it properly because you get the touchscreen error, which was already described in the US Thread. I dont know where the recovery.log is so I cant post it here. I somehow managed to install root but I would consider this unusable.
Edit:
Found the log, it is in the attachments.
Can confirm. Installing TWRP was fine, but it can't be used (touchscreen does not recognize input)
LordKelsier said:
Can confirm. Installing TWRP was fine, but it can't be used (touchscreen does not recognize input)
Click to expand...
Click to collapse
You mentioned that you were able to use the debloat method on your KIW-L21.
Did something change on the touchscreen usability or can you elaborate for the benefit of us and others?
EarlyMon said:
You mentioned that you were able to use the debloat method on your KIW-L21.
Did something change on the touchscreen usability or can you elaborate for the benefit of us and others?
Click to expand...
Click to collapse
Someone in the main thread posted that you have to tap the screen extremely fast and that the issue is most likely a bug in the TWRP software (not waiting long enough for user input or something). It worked this way but is extremely luck based. Like I had to try and flash the zip file 10 times before I was able to slide the slider while not having the archive validation checkbox checked.
Selecting the "install" button and the archive itself also took a few minutes. Basically you'll have to hammer your screen at 5 touches per second or something for it recognize
Same with me it took me about an hour to get it working.
We've been discussing the touchscreen among ourselves and your feedback may help - thanks!
Sent from my KIW-L24 using XDA Free mobile app
Do you still need ppl to run the script for the L21?

[LINUX][GUIDE] ROM Payload Image Dump

ROM PAYLOAD IMAGE DUMPER GUIDE - LINUX EDITION​
From Full OTA ROMs​
For those that don't have a windows machine for dumping the Image Files from the FULL ROM payload.bin files, this tutorial will show you how to do it on most Linux machines using a Ubuntu based OS.
*This method does not yet work on incremental updates -use Full ROMs Only!
1) Right-Click on each link below and 'Save-As' to the same directory as the 'ROM.ZIP' file you want extracted
https://raw.githubusercontent.com/cyxx/extract_android_ota_payload/master/extract_android_ota_payload.py<---All Credit Goes To Gregory cyxx from GitHub
https://raw.githubusercontent.com/cyxx/extract_android_ota_payload/master/update_metadata_pb2.py<---All Credit Goes To Gregory cyxx from GitHub
2) Open a Linux terminal session and install the 2 required files with the commands below:
Code:
sudo apt-get install python
sudo apt-get install python-protobuf
3) Change the terminal directory to the same directory as your 'ROM.zip' file that also contains your python files and enter the command:
COMMAND FORMAT: sudo python extract_android_ota_payload.py ROM.zip OUTPUTDIRECTORY
EXAMPLE:
Code:
sudo python extract_android_ota_payload.py OnePlus8ProOxygen_15.X.13_OTA_0130_all_2010200209_ 597442495fcc435a.zip /home/administrator/Downloads/
If successful, you will see the payload.bin extracted from the ZIP file and all ROM Images created right after in the output directory chosen.
Output Example:
Code:
[email protected]:~/Downloads$ sudo python extract_android_ota_payload.py OnePlus8ProOxygen_15.X.13_OTA_0130_all_2010200209_ 597442495fcc435a.zip /home/administrator/Downloads/
Extracting 'payload.bin' from OTA file...
Extracting 'abl.img'
Extracting 'boot.img'
Extracting 'dtbo.img'
Extracting 'logo.img'
Extracting 'odm.img'
Extracting 'product.img'
Extracting 'recovery.img'
Extracting 'system.img'
Extracting 'system_ext.img'
Extracting 'vbmeta.img'
Extracting 'vbmeta_system.img'
Extracting 'vendor.img'
Extracting 'aop.img'
Extracting 'bluetooth.img'
Extracting 'cmnlib64.img'
Extracting 'cmnlib.img'
Extracting 'devcfg.img'
Extracting 'dsp.img'
Extracting 'featenabler.img'
Extracting 'hyp.img'
Extracting 'imagefv.img'
Extracting 'keymaster.img'
Extracting 'modem.img'
Extracting 'multiimgoem.img'
Extracting 'qupfw.img'
Extracting 'storsec.img'
Extracting 'tz.img'
Extracting 'uefisecapp.img'
Extracting 'xbl_config.img'
Extracting 'xbl.img'
Extracting 'mdm_oem_stanvbk.img'
Extracting 'spunvm.img'
You now have the boot.img for creating a rooted boot.img using Magisk or you need to re-flash any of the factory partitions from Fasboot mode
./
Thank you!!!!
Great to see for Linux! kudos
Nice. :good:
Now we have dumpers for Win/Mac/Linux! Great!
Error in Ubuntu 20.04
Code:
Traceback (most recent call last):
File "extract_android_ota_payload.py", line 13, in <module>
import update_metadata_pb2
File "/mnt/d/Downloads/Phone/update_metadata_pb2.py", line 7, in <module>
from google.protobuf import descriptor as _descriptor
ModuleNotFoundError: No module named 'google'
kevp75 said:
Error in Ubuntu 20.04
Code:
Traceback (most recent call last):
File "extract_android_ota_payload.py", line 13, in <module>
import update_metadata_pb2
File "/mnt/d/Downloads/Phone/update_metadata_pb2.py", line 7, in <module>
from google.protobuf import descriptor as _descriptor
ModuleNotFoundError: No module named 'google'
Click to expand...
Click to collapse
To fix this issue on Ubuntu 20.04, run the following
Code:
sudo pip3 install --upgrade protobuf
Dispenses a lot of gibberish.
Code:
[email protected]:/media/russell/Windows/Users/Russell/Downloads/Android/Pixel$ sudo python extract_android_ota_payload.py lineage-17.1-20210327-nightly-bonito-signed.zip /media/russell/Windows/Users/Russell/Downloads/Android/Pixel
Traceback (most recent call last):
File "extract_android_ota_payload.py", line 13, in <module>
import update_metadata_pb2
File "/media/russell/Windows/Users/Russell/Downloads/Android/Pixel/update_metadata_pb2.py", line 23, in <module>
rminor_version\x18\x0c \x01(\r:\x01\x30\x12;\n\npartitions\x18\r \x03(\x0b\x32\'.chromeos_update_engine.PartitionUpdate\x12\x15\n\rmax_timestamp\x18\x0e \x01(\x03\x12T\n\x1a\x64ynamic_partition_metadata\x18\x0f \x01(\x0b\x32\x30.chromeos_update_engine.DynamicPartitionMetadataB\x02H\x03')
TypeError: __new__() got an unexpected keyword argument 'serialized_options'
But this tutorial worked:
Extract Android OTA Payload.bin File using Payload Dumper Tool
Learn how to dump and extract Android OTA Payload.bin file to get the boot.img (for rooting with Magisk), vendor.img, and other other partition images.
www.thecustomdroid.com
Thank you so much!
Hello,
I get this error when trying to process the extraction:
~/Desktop$ sudo python extract_android_ota_payload.py OnePlus8TOxygen_15.O.30_OTA_0300_all_2112211344_d865f7d8ac014f65 /home/Desktop/OnePlus8T
Traceback (most recent call last):
File "extract_android_ota_payload.py", line 144, in <module>
main(filename, output_dir)
File "extract_android_ota_payload.py", line 112, in main
payload_file = open(filename, 'rb')
IOError: [Errno 21] Is a directory: 'OnePlus8TOxygen_15.O.30_OTA_0300_all_2112211344_d865f7d8ac014f65'
Any help would be appreciated.
BIG EDIT: I'm an idiot. I didn't declare .zip at the end of the file name because I also have a directory the exact same name as the file. It worked.
hey bro, it do extract .img files , and works with hydragon11/oxygen11 , but when I tried to do so on android 12 ( Oxygen OS12 for global, and color os for china mainland models ) , it ( the system.img ) was neither raw nor spilit. but seems a apex_payload.img. I could not extract ant files as my zip tool tell me it's crc error. what u recommened me do next step.
Markpeng0315 said:
hey bro, it do extract .img files , and works with hydragon11/oxygen11 , but when I tried to do so on android 12 ( Oxygen OS12 for global, and color os for china mainland models ) , it ( the system.img ) was neither raw nor spilit. but seems a apex_payload.img. I could not extract ant files as my zip tool tell me it's crc error. what u recommened me do next step.
Click to expand...
Click to collapse
安卓12 apex解包? - ColorOS - 一加手机社区官方论坛 - 手机版
on hydragon os fourm, i built the apex extract tool,you needn‘t build full aosp now.
I spent 4 hrs losing brain cells trying to find out how to extract the boot.img from the phone without twrp to no avail. This was a lifesaver thank you.
Hello, thanks for this tool. I am getting this error and I could use some help understanding it.
[email protected]:~/Desktop/pixper$ sudo python extract_android_ota_payload.py PixelExperience_bonito-12.1-20220414-1502-OFFICIAL.zip .
[sudo] password for a:
Traceback (most recent call last):
File "extract_android_ota_payload.py", line 13, in <module>
import update_metadata_pb2
File "/home/a/Desktop/pixper/update_metadata_pb2.py", line 23, in <module>
rminor_version\x18\x0c \x01(\r:\x01\x30\x12;\n\npartitions\x18\r \x03(\x0b\x32\'.chromeos_update_engine.PartitionUpdate\x12\x15\n\rmax_timestamp\x18\x0e \x01(\x03\x12T\n\x1a\x64ynamic_partition_metadata\x18\x0f \x01(\x0b\x32\x30.chromeos_update_engine.DynamicPartitionMetadataB\x02H\x03')
TypeError: __new__() got an unexpected keyword argument 'serialized_options'
[email protected]:~/Desktop/pixper$
Here is the contents of the folder
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
thanks it works in wsl2 !
Get following error:
sudo python extract_android_ota_payload.py OnePlusN10Oxygen_14.E30_OTA_0300_all_2106231157_09dc03f.zip
File "extract_android_ota_payload.py", line 1689
e: update_metadata.proto
^
SyntaxError: invalid syntax
I spent a few hours battling various python errors, some of which appeared in previous posts in this thread, and some of which didn't. The following generic fact/advice might help others with similar problems:
As (perhaps essential, perhaps irrelevant) background, I note that I don't really know python, and that I'm using arch linux. Note: arch linux natively uses pacman and not apt-get etc to install/uninstall/manage packages.
The root cause of the various "import" and "name" and "unknown location" and other python errors seems to me to be the following:
1. There might be some conflict between what happens when you install/uninstall/manage python modules using pacman vs. pip. To be specific, I don't know if a command such as
sudo pip install protobuf
does the same thing as
sudo pacman -S python-protobuf
2. In the end, python seems to me to be very bad at synchronizing different versions of different modules. In the end, what WORKED -- that is, what caused me to get ZERO errors and to extract all the .bin files as advertised, was that i made CERTAIN that protobuf was UNINSTALLED:
sudo pacman -R python-protobuf
sudo pip uninstall protobuf
(note, in my case, the pacman command sort of failed, because of the myriad dependencies on protobuf, but the pip command succeeded, because it gave me the choice to remove ALL dependencies).
And then I had to be certain to install an OLD version of protobuf:
sudo pip install protobuf==3.6
Once I did this, the commands at the start of this thread worked perfectly.
I want to replace an APK from the ROM I use and I want to unpack the payload.bin (done), mount the product partition (done), replace the APK (done) then repack the payload.bin with the updated image/s.
It's possible to do it?
Thanks
ssurell said:
Dispenses a lot of gibberish.
Code:
[email protected]:/media/russell/Windows/Users/Russell/Downloads/Android/Pixel$ sudo python extract_android_ota_payload.py lineage-17.1-20210327-nightly-bonito-signed.zip /media/russell/Windows/Users/Russell/Downloads/Android/Pixel
Traceback (most recent call last):
File "extract_android_ota_payload.py", line 13, in <module>
import update_metadata_pb2
File "/media/russell/Windows/Users/Russell/Downloads/Android/Pixel/update_metadata_pb2.py", line 23, in <module>
rminor_version\x18\x0c \x01(\r:\x01\x30\x12;\n\npartitions\x18\r \x03(\x0b\x32\'.chromeos_update_engine.PartitionUpdate\x12\x15\n\rmax_timestamp\x18\x0e \x01(\x03\x12T\n\x1a\x64ynamic_partition_metadata\x18\x0f \x01(\x0b\x32\x30.chromeos_update_engine.DynamicPartitionMetadataB\x02H\x03')
TypeError: __new__() got an unexpected keyword argument 'serialized_options'
But this tutorial worked:
Extract Android OTA Payload.bin File using Payload Dumper Tool
Learn how to dump and extract Android OTA Payload.bin file to get the boot.img (for rooting with Magisk), vendor.img, and other other partition images.
www.thecustomdroid.com
Click to expand...
Click to collapse
Old thread I know, but just wanted to record what finally worked for me:
my system had 'python' and 'python3'. Replacing 'python' with 'python3' in the original command-line entry fixed everything.

Repacked boot.img is half the size of stock boot.img

Hi everyone,
I'm having trouble generating a boot.img using Android Image Kitchen to be the same size as the stock boot.img that I first unpacked! The stock boot.img is 69.1MB and if I unpack that and immediately repack it reduces to 39.1MB.
Specs
Samsung S20 Ultra 5G (G988B)
Android 10
PDA: G988BXXU4BTH5 (August 2020)
What I've Done So Far
I've compiled a custom kernel using source straight from Samsung's open source repo. For testing purposes I have made no changes and simply compiled with the relevant toolchains.
To take my compiled kernel and package it up into a boot.img I can flash with Odin, I have followed this guide how-to-unpack-and-edit-android-boot-img using osm0sis' Android Image Kitchen tools (AIK)
I have done the following:
Download custom firmware (PDA: G988BXXU4BTH5) and extract boot.img from AP archive
Unpack boot.img using AIK
Bash:
unpackbootimg -i ./boot.img
Construct arguments for mkbootimg based on above step's output
Run mkbootimg with arguments:
Bash:
#!/bin/bash
set -e
set -x
./bin/linux/x86_64/mkbootimg \
--kernel ./boot.img-kernel \
--ramdisk ./boot.img-ramdisk.gz \
--dtb ./boot.img-dtb \
--cmdline "$(cat ./boot.img-cmdline)" \
--base "$(cat ./boot.img-base)" \
--kernel_offset "$(cat ./boot.img-kernel_offset)" \
--ramdisk_offset "$(cat ./boot.img-ramdisk_offset)" \
--tags_offset "$(cat ./boot.img-tags_offset)" \
--dtb_offset "$(cat ./boot.img-dtb_offset)" \
--os_version "$(cat ./boot.img-os_version)" \
--os_patch_level "$(cat ./boot.img-os_patch_level)" \
--board "$(cat ./boot.img-board)" \
--pagesize "$(cat ./boot.img-pagesize)" \
--header_version "$(cat ./boot.img-header_version)" \
--hashtype "$(cat ./boot.img-hashtype)" \
--output ./new-boot.img \
For some reason the resulting boot.img file is 39.1MB whereas the stock boot.img is 69.1MB
To confirm it wasn't my custom kernel, I simply unpacked the stock boot.img and then repacked the extracted files. The output is again 39.1MB. This leads me to believe that AIK is either not extracting all the required files from the stock boot.img or is not packing all the required files into the generated boot.img
I came across this post in which someone successfully built a Samsung S21 boot.img, without size issues, using a fork of AIK however all projects I've used to generate boot.img give me the exact same size inconsistency.
I tried seeing what would happen if I flashed the 39.1MB boot.img on anyway and after succesfully flashing, I got a boot error:
ODIN MODE (DT Load Fail)!
[DTH] dt table header check Fail: FDT_ERR_BADMAGIC
[UFDT] DTB LOAD FAIL
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Does this suggest AIK is not packaging the dtb file correctly? Given boot.img-dtb is only 340.1KB, it must be missing more than just this.
I seem to be at an impasse and would be deeply appreciative if the smart people on XDA could lend some advice!
Thank you!
Update #1:
I was able to flash 39.1MB boot.img (with both stock and custom kernel) on and avoiding above DTB Load Fail by:
1. Ensuring name/dir structure is boot.img inside boot.img.tar
2. Using stock dtb file
It then bootloops until I am presented with recovery and error:
From this post it seems like repacking changes hash leading to 'integrity_failed' error above.
Update #2:
I managed to successfully load generated boot.img with custom kernel. I had to disable Android Verified Boot by flashing vbmeta_disabled.tar in the UserData tab in ODIN. This disables integrity checking in the bootloader sequence when the ROM bootloader passes control to the kernel in boot.img
I hope this helps others!
i have the same problem
I created custom kernel as I couldn't provide selinux permissions,but now i have error [DTH] dt table header check Fail: DFT_ERR_BADMAGIC
[UFDT] DTB LOAD FAIL.
-- phone properties --
Samsung Note 20 (exnos990)
Can you please help me? ^^
Please read the Forum Rules before posting.
Questions belong in the Questions and Answers section.
15. Keep threads / posts on-topic
Whilst a minor amount of off-topic posting may be overlooked, the general rule is that your posts / threads must be relevant to the Forum / thread in which you are posting.
General Forums - For news and announcements relating to your device.
Q&A Help & Troubleshooting Forums - For all question / request threads and posts. If there is no Q&A Help & Troubleshooting forum, use the General Forum of the relevant device
Accessories Forum - For posts related to accessories relevant to the device
Development Forums (ones with the word development in the title) - For Developers to post release threads e.g. ROMs and Kernels including modifications to kernels, bootloaders, ROMs, etc., as well as R&D development discussion threads designed with an end goal
Themes and Apps Forums - For the posting of Themes and / or Apps as well as announcements & discussions including modifications made to Themes and Apps.
Click to expand...
Click to collapse
Thread moved.

How to unlock bootloader of vivo MTK devices?

Unlocking bootloader on vivo MTK devices
This thread is intended for vivo MTK devices only. However you might have seen some of the threads for unlocking vivo bootloader but it might not work for you. So let's begin our tutorial
!! WARNING !!
THIS STEP WILL ERASE YOUR USERDATA, SO MAKE SURE YOU HAVE BACKED UP ALL YOUR DATA BEFORE EXECUTING THIS​Requirements:
This is needed to make it work!
1. MTK Driver
2. Python (latest)
3. UsbDK
4. MTKClient
5. Zip extractor like 7zip
Set up all the requirements:
1. Install Python
1.1. Open Python that you have download​1.2. Tick a box called "add to PATH"​1.3. Install​2. Install UsbDK
2.1. Make sure you have downloaded UsbDk according to your architecture​2.2. Double click the installation file and install​3. Install MediaTek Drivers
3.1. Download zip that I attach on this thread​3.2. Use your zip extractor app and extract the zip​3.3. After extract, you will see 3 files inside, choose "cdc-acm.inf" and right click​3.4. Select "Install drivers" and follow all instructions​4. Setup MTKClient
4.1. They're many version releases on the github, download the source code zip from the latest version​4.2. Use your extractor app and extract it into a folder​4.3. Go into that folder and open command prompt from there​4.4. Simply type "pip3 install -r requirements.txt" on the cmd and enter. Wait for it to finish​4.5. Close the cmd​
Steps to unlock:
1. Go to mtkclient folder and open cmd from the folder
2. Type "python3 mtk da seccfg unlock"
3. Prepare your phone, make sure it's turn off
4. Connect your phone to PC with volume combination, hold both volume button and connect
5. Hold it until you heard usb connection sound and release it
6. Wait until it succeed
7. If successful, disconnect your device and turn it on
8. You will see a message saying "Orange state bla bla", ignore it
9. If it keeps rebooting, just wait for it to enter recovery and it will ask you to factory reset your device
10. Factory reset it and you're done!
You've finally unlocked your vivo bootloader
Tested devices:
1. vivo Y20 2021/Y12s (PD2036F)
2. vivo Y17/Y15/Y12 (PD1901)
3. vivo Y1s (PD2014F)
4. vivo Y91C (MTK)(PD1818HF)
However vivo have patched the BROM mode(something like download mode on mtk) on the latest update. But I have solution for that issue!
NeonzGamingYT said:
However vivo have patched the BROM mode(something like download mode on mtk) on the latest update. But I have solution for that issue!
Click to expand...
Click to collapse
way
NeonzGamingYT said:
However vivo have patched the BROM mode(something like download mode on mtk) on the latest update. But I have solution for that issue!
Click to expand...
Click to collapse
Seems like you don't?
so i was trying to use mtk client with your command. i'm not sure why my windows don't recognize python3 as installed and redirected me to microsoft store, so i used just python command which should ran python 3.11.2 on my pc. But when i did that it didn't really let me do that saying that "da" flag not found
Code:
mtk client\mtkclient-1.52>python mtk da seccfg unlock
usage: mtk [-h]
{printgpt,gpt,r,rl,rf,rs,ro,w,wf,wl,wo,e,es,footer,reset,dumpbrom,dumppreloader,payload,crash,brute,gettargetconfig,peek,stage,plstage,xflash}
...
mtk: error: argument cmd: invalid choice: 'da' (choose from 'printgpt', 'gpt', 'r', 'rl', 'rf', 'rs', 'ro', 'w', 'wf', 'wl', 'wo', 'e', 'es', 'footer', 'reset', 'dumpbrom', 'dumppreloader', 'payload', 'crash', 'brute', 'gettargetconfig', 'peek', 'stage', 'plstage', 'xflash')
MTK Flash/Exploit Client V1.52 (c) B.Kerler 2018-2021
Also i'm trying to make it work with vivo v25e which uses Mediatek MT8781 Helio G99 (6nm) (if you can believe description)
if i run adb toolkit it shows me this info for my phone
Code:
Device: V2201
Model: V2201
Brand: vivo
Android: 13
Firmware: TP1A.220624.014
Security Patch: 2023-02-01
also this is behaviour for my phone on the 4ths step
4. Connect your phone to PC with volume combination, hold both volume button and connect
Click to expand...
Click to collapse
at first it shows first line in device manager then second and then disappears at all, is this normal behaviour?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Is there any chances for me to unlock bootloader or i should just give up for now? Also i'm very sorry if i miss something obvious.
twq_bought_a_shit_phone said:
so i was trying to use mtk client with your command. i'm not sure why my windows don't recognize python3 as installed and redirected me to microsoft store, so i used just python command which should ran python 3.11.2 on my pc. But when i did that it didn't really let me do that saying that "da" flag not found
Code:
mtk client\mtkclient-1.52>python mtk da seccfg unlock
usage: mtk [-h]
{printgpt,gpt,r,rl,rf,rs,ro,w,wf,wl,wo,e,es,footer,reset,dumpbrom,dumppreloader,payload,crash,brute,gettargetconfig,peek,stage,plstage,xflash}
...
mtk: error: argument cmd: invalid choice: 'da' (choose from 'printgpt', 'gpt', 'r', 'rl', 'rf', 'rs', 'ro', 'w', 'wf', 'wl', 'wo', 'e', 'es', 'footer', 'reset', 'dumpbrom', 'dumppreloader', 'payload', 'crash', 'brute', 'gettargetconfig', 'peek', 'stage', 'plstage', 'xflash')
MTK Flash/Exploit Client V1.52 (c) B.Kerler 2018-2021
Click to expand...
Click to collapse
i got the same error
First i think if you got vivo device is most likely patched. If not what version of mtk exploit is it using
I see you're using security patch dated 2023-02-01 which most likely won't work
ko_hi said:
First i think if you got vivo device is most likely patched. If not what version of mtk exploit is it using
I see you're using security patch dated 2023-02-01 which most likely won't work
Click to expand...
Click to collapse
honestly i was trying to lock the bootloader just so i won't touch these stuff and my phone is not even vivo it's oppo a5s

Categories

Resources