How to unpack, repack, split, mkboot edit boot.img - Android Software/Hacking General [Developers Only]

Hello, I wanna share on this forum about How to unpack, repack, split, mkboot boot.img
{
"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"
}
First, u need a file names Bootimgutils that u can download here.
After u done, u extract the file into a directory that u wanna and give it name (Like, Bootimgutils for the example)
.
Then, U grab boot.img file (U can grab it directly on onepack ROM. U can find boot.img on Code, if u use fullpack ROM)
*Don't forget to check the file permissions as executeable programs. Right-click, properties. Click on permissions tab
Go to terminal (Linux) or Cygwin (Windows)
Type these commands :
Code:
cd Bootimgutils
./split_bootimg.pl boot.img
mkdir ramdisk
cd ramdisk
gzip -dc ../boot.img-ramdisk.gz | cpio -i
cd ..
O.K. Up to ya to edit boot.img.
And, don't forget!
If u have done to change files.
U need to repack it anymore.
For that, u can type :
Code:
./repack_bootimg.pl boot.img-kernel ramdisk bootnew.img
or u can replace it.
U just need to change a command to be like this :
Code:
./repack_bootimg.pl boot.img-kernel ramdisk boot.img
*If u have backup of an original boot.img
CMIIW
^_^

Yeah... Good start mas bro....

huryiw said:
Yeah... Good start mas bro....
Click to expand...
Click to collapse
OK ^_^
hehehe

Can someone make this to extract CyanogenMOD's boot.img or suggest something for this ?

neobuddy89 said:
Can someone make this to extract CyanogenMOD's boot.img or suggest something for this ?
Click to expand...
Click to collapse
boot.img of CM? Sure these commands can be used by everyone for every boot.img

Hello, and thanks for that tutorial, I was wondering for a long time how to extract a boot.img file
But I just have a question: how is it possible to extract another sort of .img file ? Actually, the Alpha ICS firmware from Sony Ericsson includes a system.img file, and for curiosity I'd lile to extract it. Of course I tried the same method by changing "boot.img" by "system.img" in the commands and that didn't work.

help
I'm following these instruction but my boot.img wont boot, even if i don't touch it, just unpack/repack... doesn't work
split:
Code:
./split_bootimg.pl boot.img
Page size: 2048 (0x00000800)
Kernel size: 5046640 (0x004d0170)
Ramdisk size: 180818 (0x0002c252)
Second size: 0 (0x00000000)
Board name:
Command line: console=ttyHSL0,115200,n8 androidboot.hardware=hws7300u vmalloc=578M kgsl.ptcount=16
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
unpack ramdisk:
Code:
mkdir ramdisk
cd ramdisk/
gzip -dc ../boot.img-ramdisk.gz | cpio -i
760 blocks
then repack, modifying base and cmdline according to my device in repack_bootimg.pl
--cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=hws7300u vmalloc=578M kgsl.ptcount=16' --base 0x40200000
Code:
./repack_bootimg.pl boot.img-kernel ramdisk boot.img
760 blocks
repacked boot image written at ramdisk-repack.img
flashed via fastboot, reboot... hang :|
any hint?
EDIT: nevermind... seems that /proc/config.gz is not the right place to find the base address, my base address is 0x40300000 :|

Related

[GUIDE]To Unpack/Repack livesuit flashable images

While browsing XDA i didn't find anything for unpacking Livesuite images so i created this THREAD.
Things you need
Allwiner kitchen
Stock Firmware
Linux image tool
Ubuntu 64 bit
Click to expand...
Click to collapse
Lets start
Step 1
Extracting and building the stock image (Windows)
Extract a10_flash_kitchen_v1.zip and look inside the directory, you'll see packer_gb and packer_ics. packer_ics is for Android ICS, so that is the one you will be using.
{
"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"
}
Open packer_ics and you will notice a bunch of directories and a couple of .bat scripts. We will spend a lot of time in these directories.
Extract the stock firmware you downloaded earlier, and copy the .img file into this directory. Rename the file to original.img.
Run the extract_image.bat script, and a command window will pop up while it is extracting.
The command window will output like the following, it will display Press any key to continue . . . when it is complete. Press a key to close the window.
Once the command window is closed, open the _extract directory and all of the extracted files will be there. The three following files are the ones we are interested in: RFSFAT16_BOOT_00000000000.fex (the boot partition), RFSFAT16_RECOVERY_0000000.fex (the recovery partition), RFSFAT16_SYSTEM_000000000.fex (the system partition, ext4 sparse).
NOTE and WARNING Some systems may also have a RFSFAT16_BOOTLOADER_00000.fex, which may also be required for your device to boot properly. There are some vague instructions @ this TechKnow forums post. I (the reader) will attempt to clarify and modify this page with the updated additional instructions for these devices to aid in making these instructions more universal for anyone using LiveSuit.
Click to expand...
Click to collapse
Step 2
Extracting, modifying and building partitions (Linux)
Copy your Extracted files to ubuntu
Rename the files as follows:
RFSFAT16_BOOT_00000000000.fex -> boot.img
RFSFAT16_RECOVERY_0000000.fex -> recovery.img
RFSFAT16_SYSTEM_000000000.fex -> system.fex
Click to expand...
Click to collapse
Copy the tools.tar.gz archive you downloaded earlier into the same directory.
To extract the tools, right click on the file and click Extract here.
This will extract the tools into a tools subdirectory.
Type terminal to show the terminal application. Hit enter and the terminal will appear.
Boot partition
Code:
$ cd "custom image"
$ tools/split_bootimg.pl boot.img
$ ls
Now extract the ramdisk file into a ramdisk subdirectory.
Code:
$ mkdir ramdisk
$ cd ramdisk
$ gunzip -c ../boot.img-ramdisk.gz | cpio -i
$ ls
You are now able to modify the files as needed.
Once you have finished modifying the file, we will rebuild the image. Run the following commands.
Code:
$ cd ..
$ tools/mkbootfs ramdisk | gzip > ramdisk-new.gz
$ tools/mkbootimg --base 0x40000000 --kernel boot.img-kernel --ramdisk ramdisk-new.gz --cmdline 'console=ttyS0,115200 rw init=/init loglevel=8' -o new-boot.img
$ ls
Recovery partition
his follows the same process as the boot partition. Execute the following commands to extract the image:
Code:
$ tools/split_bootimg.pl recovery.img
$ rm -rf ramdisk
$ mkdir ramdisk
$ cd ramdisk
$ gunzip -c ../recovery.img-ramdisk.gz | cpio -i
$ ls
rebuild the image with the following commands:
Code:
$ cd ..
$ tools/mkbootfs ramdisk | gzip > ramdisk-new.gz
$ tools/mkbootimg --base 0x40000000 --kernel recovery.img-kernel --ramdisk ramdisk-new.gz --cmdline 'console=ttyS0,115200 rw init=/init loglevel=8' -o new-recovery.img
$ ls
System partition
The process for the system partition is different, because it is not bootable and because it is ext4 sparse, so it cannot be mounted straight away. Execute the following commands to convert and mount the image:
Code:
$ tools/simg2img system.fex system.img
$ mkdir system
$ sudo mount -o loop system.img system
$ cd system
$ ls
Once you are done, execute the following commands to rebuild the system image:
Code:
$ cd ../tools
$ sudo ./mkuserimg.sh -s ../system ../new-system.fex ext4 ../tmp 300M
$ cd ..
$ sudo umount system
$ ls
Now switch back to the file browser and you will see many new files in your directory. The three files that you are interested in are new-boot.img, new-recovery.img, new-system.fex
Copy these to your Windows drive to the directory a10_flash_kitchen_v2/packer_ics/_input
Click to expand...
Click to collapse
Step 3
Building the new image (Windows)
Once the files are copied, jump back to Windows and rename the files as following:
new-boot.img -> root.fex
new-recovery.img -> recovery.fex
new-system.fex -> system.fex
Click to expand...
Click to collapse
http://i.imgur.com/klTA5.png/img]
Now we need to make some modifications to the image config file. Navigate to the files directory and you should see image.cfg.
[img]http://i.imgur.com/Wg6Ov.png/img]
Open this file using your text editor that supports Unix line endings. Using Notepad will break this file. Locate the two lines that reference OEM and VOEM as is highlighted below.
[img]http://i.imgur.com/YxczH.png
Comment these lines by adding a semicolon ( to the start of each line. Do not make any other modifications. Save the file once you have made the change.
http://i.imgur.com/urMMN.png/img]
Go back to the packer_ics root directory and find the create_image.bat script. It will open a console while it is creating the new image.
[img]http://i.imgur.com/X2O6l.png
Once the process is complete, you will see Press any key to continue . . . and you will have a new image called output.img.
AND JUST FLASH IT AND YOU ARE DONE
Click to expand...
Click to collapse
Credits
miniandwiki
To ME
To Everyone who helped me creating this one
do i have to use 64bit liux?? i only have a 32 bit computer?? thnx
Permission denied
Hey....
I installed Ubuntu on an external disk. But even logged at su (also tried sudo su) I dont have the permission to perform with the Linux-tool. When I click at the roo-folder, it is already set to rw permission for root.
What am I doing wrong?
Links are broken, can you kindly update them.
Links are broken Pls Upload to another host

Must-know Command Line (Terminal) hacks for Developers

Using various command lines tools of Linux can make working very easy for developers. Here are a few tricks than can really help out.
{
"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"
}
1. grep
I cannot emphasize on this tool more, this utility is your one stop destination for searching anything. Want to look for all .so files in a folder? Type in
Code:
ls | grep .so
Or maybe a '.so' (library) file that starts with 'mtk' (e.g. mtkOmxVenc.so)
Code:
ls | grep mtk*.so
Or what if a '.so' (library) file that has 'Omx' somewhere in the name
Code:
ls | grep *Omx*.so
Awesome! Now that pole like character is simply called "the pipe" it pipes the output to another program, in this case grep. Now grep -s case-sensitive. To make it case insensitive, just use the -i flag with it. Now try looking for all .mp3 files in a folder!
What if you were in a folder with 1000s of files and were looking for a file with the text 'I love XDA Developers' in it? Pretty simple. Make sure your current directory is where you want to search, and type in
Code:
grep -R 'I love XDA Developers'
Great! You are becoming a command line genius! Now let's try some real world stuff. Say you want a rough idea on how many libraries or executables are somehow linked to 'libmediaservice.so'. It can be necessary when you get dlopen errors. Can you guess how to get an approximate result? Try to do it before looking any furter. Got it? 3... 2... 1... and the answer is
Code:
grep -R libmediaservice.so
Now was that too hard? Of course not!
2. head and tail
Quickly view the first few or last few lines of a text file with head or tail subsequently.
Code:
head logfile.log
Code:
tail logfile.log
3. sed
sed, short for stream editor can do tonnes of things, for now let's focus on searching and replacing. Say, we need to replace the text 'libxda.so' by 'libxdadev.so' in all the files within this current directory. We would simply command,
Code:
ls -1 | xargs sed -i 's/libxda.so/libxdadev.so/g'
(The -1 flag makes sure that ls ouputs in just ONE row, there is a better way to do this with find, we'll check that later)
4. find
This is the hypercharged version of grep; as the name implies, you can find stuff with it. For example, say you want to find all the folders under the current folder recursively.
Code:
find . -type d
[tip: . (dot) refers to the current folder]
you want to find all the files under the current folder recursively.
Code:
find . -type f
That was easy, but not too much useful. Let's try something more. Okay, here's a fun thing to do, we want to find empty files in the current folder whose name starts with 'xda', has executable permissions and is owned by 'tuxboy'.
Code:
find . -type f -name xda* -empty -executable -user tuxboy
Whoa! That was big! This baby is capable of doing so much more. Here are a few more options, self explanatory.
Code:
-empty
-fstype TYPE
-group NAME
-name PATTERN -newer FILE
-nouser
-nogroup
-path PATTERN
-perm [+-]MODE
-regex PATTERN
-readable -writable -executable
-wholename PATTERN
-size N[bcwkMG]
-type [bcdpflsD]
-user NAME
5. wc
This is the mother of all counters. You can count bytes, characters or lines in files with this tool. Want to know how many characters are there in a file?
Code:
wc -m filename.txt
Or, how many words are there in a file?
Code:
wc -w filename.txt
Or, how many lines are there in a file?
Code:
wc -l filename.txt
Or, the length of the longest line in a file?
Code:
wc -L filename.txt
Cool eh?
6. man and --help/-help/-h
Every command usually comes with some documentation. Say you want to get a short documentation on how to use the 'ls' command, at least one of the following commands should give you answers.
Code:
ls --help
Code:
ls -h
Code:
ls -help
If you want comprehensive documentation. Man is there for you!
Code:
man ls
Hope this will help you. If you have learned something new, hit Thanks!
This is beautiful, thank you :angel:.

[SCRIPT] TWRP device tree generator

Create a TWRP-compatible device tree only from an Android recovery image (or a boot image if the device uses non-dynamic partitions A/B) of your device's stock ROM.
It has been confirmed that this script supports images built starting from Android 4.4 up to Android 12
Installation
Bash:
pip3 install twrpdtgen
The module is supported on Python 3.6 and above.
Linux only: Be sure to have cpio installed in your system (Install cpio using sudo apt install cpio or sudo pacman -S cpio based on what package manager you're using)
Bash:
$ python3 -m twrpdtgen -h
TWRP device tree generator
usage: python3 -m twrpdtgen [-h] [-o OUTPUT] [-k] [--no-git] [--huawei] [--recovery_kernel RECOVERY_KERNEL] [--recovery_ramdisk RECOVERY_RAMDISK]
[--recovery_vendor RECOVERY_VENDOR] [-v]
[recovery_image]
positional arguments:
recovery_image path to a recovery image (or boot image if the device is A/B)
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
custom output folder
-k, --keep-aik keep AIK after the generation
--no-git don't create a git repo after the generation
--huawei Huawei mode (split kernel, ramdisk and vendor)
--recovery_kernel RECOVERY_KERNEL
path to a recovery_kernel file (huawei mode only)
--recovery_ramdisk RECOVERY_RAMDISK
path to a recovery_ramdisk file (huawei mode only)
--recovery_vendor RECOVERY_VENDOR
path to a recovery_vendor file (huawei mode only)
-v, --verbose enable debugging logging
When an image is provided, if everything goes well, there will be a device tree at
Bash:
output/manufacturer/codename
You can find the script source code here: https://github.com/SebaUbuntu/TWRP-device-tree-generator
reserved
Deleted
Noiceee
Hi, trying to use this but I get error Arch not supported on my poco f2 pro. Any idea?
Amazing work, this tool useful for create basic configuration for recovery:good:
Nice work!
but the descriptions says samsung odin tar support.
script accepts only .img files.
Hello Everyone and @SebaUbuntu. How do you think we can extract and make appended DTBs? Most new devices do not make use of a DT.img anymore. Even though the script doesn't support this, I want to do it by hand manually using a recovery.img But how?
---------- Post added at 08:43 AM ---------- Previous post was at 08:41 AM ----------
itzik16 said:
Nice work!
but the descriptions says samsung odin tar support.
script accepts only .img files.
Click to expand...
Click to collapse
do not worry, just rename the .tar.md5 to .tar and extract the recovery image from inside it to use in the script. Easy
NullCode said:
Hello Everyone and @SebaUbuntu. How do you think we can extract and make appended DTBs? Most new devices do not make use of a DT.img anymore. Even though the script doesn't support this, I want to do it by hand manually using a recovery.img But how?
---------- Post added at 08:43 AM ---------- Previous post was at 08:41 AM ----------
do not worry, just rename the .tar.md5 to .tar and extract the recovery image from inside it to use in the script. Easy
Click to expand...
Click to collapse
TWRP supports dt.img, there's no need to append it
Hey there, @SebaUbuntu, I tried to use your latest script as python. I see you use AIK to unpack recovery.img. But it cant unpack my recovery.img and says my image is in unsupported format. But my recovery.img isn't corrupted. And if I clone AIK myself w/o the script, It does unpack my recovery.img successfully. So what is the problem?
Royna said:
Hey there, @SebaUbuntu, I tried to use your latest script as python. I see you use AIK to unpack recovery.img. But it cant unpack my recovery.img and says my image is in unsupported format. But my recovery.img isn't corrupted. And if I clone AIK myself w/o the script, It does unpack my recovery.img successfully. So what is the problem?
Click to expand...
Click to collapse
I think you should remove the generator and clone it again. Because with my recovery images it works perfectly [or remove the aik folder from where it is in the tree gen with your own one]
---------- Post added at 03:40 AM ---------- Previous post was at 03:35 AM ----------
SebaUbuntu said:
TWRP supports dt.img, there's no need to append it
Click to expand...
Click to collapse
thanks a lot for clearing it up!
@SebaUbuntu, is this script not supported in macOS Big Sur (The lastest beta ver.)? Installed the python module using the guide on your Github wiki. Run
Code:
python -m twrpdtgen /Users/roynatech/Desktop/recovery.img
with the terminal pointing at the root of cloned script.
Output:
Code:
TWRP device tree generator
Python Edition
Version 1.0.0
Cloning AIK...
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/roynatech/Downloads/TWRP-device-tree-generator/twrpdtgen/__main__.py", line 6, in <module>
main()
File "/Users/roynatech/Downloads/TWRP-device-tree-generator/twrpdtgen/twrp_dt_gen.py", line 53, in main
aik_ramdisk_path, aik_images_path = aik.extract_recovery(recovery_image)
File "/Users/roynatech/Downloads/TWRP-device-tree-generator/twrpdtgen/aik_manager.py", line 59, in extract_recovery
copyfile(recovery_image, new_recovery_image)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/shutil.py", line 261, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/roynatech/Downloads/TWRP-device-tree-generator/extract/recovery.img'
What's wrong here?
I also had the same error, can anyone help me? I'm using Windows 10 and trying to create my Nokia device tree!
{
"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"
}
hey i am trying this out but i got this error
Error: Please clone the script with Git instead of downloading it as a zip
i cloned the repo but it still says this
[INFO] Cloning AIK...
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/data/data/com.termux/files/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/twrpdtgen/__main__.py", line 28, in <module>
dt = generate_device_tree(args.recovery_image, args.output, no_git=args.no_git, keep_aik=args.keep_aik)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/twrpdtgen/twrp_dt_gen.py", line 30, in generate_device_tree
aik.extract(recovery_image)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/twrpdtgen/utils/aik_manager.py", line 64, in extract
self.get_image_infos()
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/twrpdtgen/utils/aik_manager.py", line 79, in get_image_infos
self.base_address = self.read_recovery_file(self.get_extracted_info("base"))
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/twrpdtgen/utils/aik_manager.py", line 108, in read_recovery_file
return file.read_text().splitlines()[0]
File "/data/data/com.termux/files/usr/lib/python3.9/pathlib.py", line 1255, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
File "/data/data/com.termux/files/usr/lib/python3.9/pathlib.py", line 1241, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/data/data/com.termux/files/usr/lib/python3.9/pathlib.py", line 1109, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/data/data/com.termux/files/usr/tmp/tmpkxqc0gaz/split_img/recovery.img-base'
Can anyone explain the situation here?
Hi. Can anyone give me the steps to get this running in Minimal ADB on windows? Or do I have to use linux? Treat me like a 5 year old. I'm trying to learn. Haven't been able to figure out how to use this on Kali Linux.
braveone1 said:
[INFO] Cloning AIK...
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/data/data/com.termux/files/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/twrpdtgen/__main__.py", line 28, in <module>
dt = generate_device_tree(args.recovery_image, args.output, no_git=args.no_git, keep_aik=args.keep_aik)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/twrpdtgen/twrp_dt_gen.py", line 30, in generate_device_tree
aik.extract(recovery_image)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/twrpdtgen/utils/aik_manager.py", line 64, in extract
self.get_image_infos()
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/twrpdtgen/utils/aik_manager.py", line 79, in get_image_infos
self.base_address = self.read_recovery_file(self.get_extracted_info("base"))
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/twrpdtgen/utils/aik_manager.py", line 108, in read_recovery_file
return file.read_text().splitlines()[0]
File "/data/data/com.termux/files/usr/lib/python3.9/pathlib.py", line 1255, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
File "/data/data/com.termux/files/usr/lib/python3.9/pathlib.py", line 1241, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/data/data/com.termux/files/usr/lib/python3.9/pathlib.py", line 1109, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/data/data/com.termux/files/usr/tmp/tmpkxqc0gaz/split_img/recovery.img-base'
Can anyone explain the situation here?
Click to expand...
Click to collapse
Similar problem here.
Code:
TWRP device tree generator
Version 1.2.6
[INFO] Cloning AIK...
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/marty/.local/lib/python3.8/site-packages/twrpdtgen/__main__.py", line 52, in <module>
dt = DeviceTree(args.output, recovery_image=args.recovery_image,
File "/home/marty/.local/lib/python3.8/site-packages/twrpdtgen/device_tree.py", line 49, in __init__
aik.extract(recovery_image)
File "/home/marty/.local/lib/python3.8/site-packages/twrpdtgen/utils/aik_manager.py", line 79, in extract
raise RuntimeError(f"AIK extraction failed, return code {returncode}")
RuntimeError: AIK extraction failed, return code 1
Normally the image presented in case of Samsung device should be bootimage right, instead of recoveryimage?
how to update twrpdtgen?
I got:
Code:
[WARNING] Platform prop not found! Defaulting to "default"
How can I do a " Platform prop"?

[TOOL] Syndical - an alternative to well-known SamLoader

Syndical
This is an alternative to SamLoader - cleaner code, easier to understand and tamper with.
Written purely in C#. SamLoader was, of course, the base of Syndical, but impemented differently.
Current progress can be viewed here: Trello board.
Source code and releases: GitHub.
Why I should use Syndical?
1) It looks a lot better than any other firmware downloaders
2) Download & Decrypt is a lot faster, as it won't download the entire file and then only decrypt it.
3) Because I'll steal your liver
Warning
Resume mode might work not as expected.
Also Samsung ships only two last firmware versions, Fetch is proof.
Screenshots
{
"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"
}
How to use
Arguments
Code:
-m, --mode Required. Which mode I should use
-v, --firmware-version Firmware version
-i, --input File to decrypt
-o, --output Filename for decrypted/downloaded file
-M, --model Required. Device model
-r, --region Required. Device region
-f, --factory Download factory firmware (Binary Nature)
-h, --disable-hash-check Disables hash check in Download mode
-r, --disable-resume Disables resume in Download mode
--help Display this help screen.
--version Display version information.
Modes
Code:
Download Download firmware
Decrypt Decrypt firmware
Fetch Fetch latest firmware
DownloadDecrypt Download and decrypt firmware simultaneously
Examples
Code:
./Syndical.Application -m Download -v A207FXXU2CUI2/A207FOXM2CUI2/A207FXXU2CUI2/A207FXXU2CUI2 -M SM-A207F -r SER -f
./Syndical.Application -m Decrypt -v A207FXXU2CUI2/A207FOXM2CUI2/A207FXXU2CUI2/A207FXXU2CUI2 -M SM-A207F -r SER -f
./Syndical.Application -m DownloadDecrypt -v A207FXXU2CUI2/A207FOXM2CUI2/A207FXXU2CUI2/A207FXXU2CUI2 -M SM-A207F -r SER -f
./Syndical.Application -m Fetch -M SM-A207F -r SER
Credits
TheAirBlow for Syndical itself .
nlscc for SamLoader.
Licence
Mozilla Public License Version 2.0
Interesting. Does it have a GUI?
Slaggy said:
Interesting. Does it have a GUI?
Click to expand...
Click to collapse
It doesn't, and probably it never would get one. Maybe I'll make an Avalonia GUI for Thor Suite (I have plans to make a software bundle: flash tool, firmware downloader, PIT Viewer/Editor, etc.), but I want to make the flash tool and etc. to be written in C++ (it would be faster, I can make my own driver, working with libusb is easier, etc.), but I'm very bad at it, so I need someone with relatively good knowledge to help me. Until I find someone, all Samsung Loki projects would be abandoned (Thor and Syndical)

[ERROR] Unpack/Repack ROM SM-G930S (Samsung S7)

I downloaded the ROM from the link below:
[up_vnROM.net]_G930SKSU3ETJ1_G930SSKC3ETJ1_SKC_8.0.zip
drive.google.com
I use this project to unpack/repack on Ubuntu:
GitHub - anestisb/android-simg2img: Tool to convert Android sparse images to raw images
Tool to convert Android sparse images to raw images - GitHub - anestisb/android-simg2img: Tool to convert Android sparse images to raw images
github.com
I execute these commands:
lz4 system.img.lz4 system.img
[email protected]:~$ ./android-simg2img/simg2img system.img system.raw.img
[email protected]:~$ ./android-simg2img/img2simg system.raw.img system.new.img
Click to expand...
Click to collapse
Result file system.img loaded success, but file system.new.img received FAIL result when using Odin.
I noticed something unusual when comparing 2 files:
1. Check file info:
[email protected]:~$ file system*
system.img: Android sparse image, version: 1.0, Total of 1075200 4096-byte output blocks in 5625 input chunks.
system.new.img: Android sparse image, version: 1.0, Total of 1075200 4096-byte output blocks in 3469 input chunks.
system.raw.img: Linux rev 1.0 ext4 filesystem data, UUID=57f8f4bc-abf4-655f-bf67-946fc0f9f25b (extents)
Click to expand...
Click to collapse
2. Check simg_dump.py:
[email protected]:~$ ./android-simg2img/simg_dump.py system.img
simg_dump.py: system.img: The file header size was expected to be 28, but is 32.
[email protected]:~$ ./android-simg2img/simg_dump.py system.new.img
system.new.img: Total of 1075200 4096-byte output blocks in 3469 input chunks.
Click to expand...
Click to collapse
3. Open with 7z:
- File system.img
{
"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"
}
- File system.new.img
I used many tools: ext2simg, make_ext4fs to repack but it doesn't work. Looking forward to help.
quangnguyen7616 said:
I downloaded the ROM from the link below:
[up_vnROM.net]_G930SKSU3ETJ1_G930SSKC3ETJ1_SKC_8.0.zip
drive.google.com
I use this project to unpack/repack on Ubuntu:
GitHub - anestisb/android-simg2img: Tool to convert Android sparse images to raw images
Tool to convert Android sparse images to raw images - GitHub - anestisb/android-simg2img: Tool to convert Android sparse images to raw images
github.com
I execute these commands:
lz4 system.img.lz4 system.img
Result file system.img loaded success, but file system.new.img received FAIL result when using Odin.
I noticed something unusual when comparing 2 files:
1. Check file info:
2. Check simg_dump.py:
3. Open with 7z:
- File system.img
View attachment 5811597
- File system.new.img
View attachment 5811599
I used many tools: ext2simg, make_ext4fs to repack but it doesn't work. Looking forward to help.
Click to expand...
Click to collapse
you have too name the system_new.img the same name as stock one was and add back the .ext4 on the end you may also have to turn it back into a sparse image for odin to flash it successfully

Categories

Resources