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
Related
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 :|
Hi,
Because I could not find a reliable rooting mechanism I soldered a serial FTDI UB232, and I gain shell access.
The serial works ok as long I am in u-boot prompt.
Texas Instruments X-Loader 1.41 (Apr 12 2012 - 12:06:17)
OMAP4460: 1.2 GHz capable SOM
**** DDR SDRAM PATTERN TEST ****
DDR SDRAM DATA BUS TEST..... [PASSED]
DDR SDRAM ADDRESS BUS TEST..... [PASSED]
Starting OS Bootloader from EMMC ...
U-Boot 1.1.4 (Nov 9 2012 - 20:33:58)
Load address: 0x80e80000
DRAM: 1024 MB
Flash: 0 kB
Using default environment
printenv
bootargs=console=ttyO2,115200n8 [email protected] [email protected] init=/init vram=48M omapfb.vram=0:32M androidboot.console=ttyO2
bootcmd=booti mmc1
bootdelay=1
baudrate=115200
ipaddr=128.247.77.90
serverip=128.247.77.158
netmask=255.255.254.0
bootfile="uImage"
ethact=KS8851SNL
Environment size: 285/131068 bytes
As soon android boots when everything is settled down, the tty input is totally ignored, though the shell
prints all the os messages. There is no prompt. ?!?
[ 33.844390] wlan0: moving STA 00:90:a9:a5:51:a1 to state 3
[ 58.387908] omap_cpu_thermal_manager:sensor 66200 avg sensor 59795 pcb 0, delta 18897 hot spot 85097
[ 58.397766] omap_monitor_zone:hot spot temp 85097
[ 58.887908] omap_cpu_thermal_manager:sensor 63800 avg sensor 59795 pcb 0, delta 17742 hot spot 81542
[ 58.897827] omap_safe_zone:hot spot temp 81542
no prompt
Any idea how to outcome and enable the shell tty input.
Here are the pictures of the serial soldering and the serial to usb adapter.
(The pictures are mine, from the stack-over-flow post)
{
"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"
}
The ftdi
I found and android for OMAP blaze (GB and a kernel from https://e2e.ti.com/support/omap/f/849/t/310839),
After having all cowboys engineering from Texas headaches I finally end up with:
boot.img cache.img fastboot mkbootimg MLO_es2.1_gp MLO_es2.2_emu ramdisk.img ramdisk-recovery.img recovery.img system.img u-boot.bin userdata.img zImage files.
I tried first a non destructive flash, trying to flash the system, (then boot, kernel, recovery / all of them encountering same error)
Linux console:
sudo fastboot flash system system.img
[sudo] password for mpang:
< waiting for device >
sending 'system' (110304 KB)...
OKAY [ 42.127s]
writing 'system'...
FAILED (remote failure)
finished. total time: 42.137s
marquis tablet serial output, as shown in previous post
OMAP44XX TAB # fastboot
I2C read: I/O error
I2C read: I/O error
Device Serial Number: 5C28000200000001
Fastboot entered...
Starting download of 112951340 bytes
................................................................................... many dots
downloading of 112951340 bytes finished
writing to partition 'system'
Wrong Image... Failed to program
How did we get here fastboot.c 993 ?
Anyone ?, Thank you
So, I managed to wipe my filesystem when trying to root (going by the board that happens way too often I noticed).
I posted about it here https://forum.xda-developers.com/showpost.php?p=80579913&postcount=295 first.
But despite the quick and nice suggestions it still won't work.
Going by https://forum.xda-developers.com/showthread.php?t=3984875 I also tried to flash boot.img for Fastboot.
Yes, it's the right model ( GM21BA ) for Europe/Global 12gb/256
From make_f2fs.exe I get the following:
PS C:\temp> .\make_f2fs.exe [SERIAL]
F2FS-tools: mkfs.f2fs Ver: 1.9.0 (2017-11-13)
Info: Disable heap-based policy
Info: Debug level = 0
Info: Label =
Info: Trim is enabled
Error: Failed to get device size!
Click to expand...
Click to collapse
Which has me thinking the filesystem is gone.
And then I erased and formated boot twice, and am still left with RAW fs.
PS C:\temp> fastboot format:ext4 boot
Warning: boot type is raw, but ext4 was requested for formating.
Creating filesystem with parameters:
Size: 100663296
Block size: 4096
Blocks per group: 32768
Inodes per group: 6144
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 24576
Block groups: 1
Reserved block group size: 7
Created filesystem with 11/6144 inodes and 1422/24576 blocks
target reported max download size of 805306368 bytes
sending 'boot' (5688 KB)...
OKAY [ 0.021s]
writing 'boot'...
OKAY [ 0.107s]
finished. total time: 0.130s
Click to expand...
Click to collapse
And then I tried F2FS with Fastboot Format:
PS C:\temp> fastboot format:f2fs boot
Warning: boot type is raw, but f2fs was requested for formating.
Formatting is not supported for filesystem with type 'f2fs'.
Click to expand...
Click to collapse
So, as I'm writing this I'm reading up on make_f2fs to have it format a new 'boot' for me to flash unto.
Well, at least I have fastboot even if I can't seem to manage flashing anything, so it could be lot worse...
User MSM tool to restore to factory default. It will ease everything, but you will have a working phone. Follow the directions on the thread located here.
For future reference, I'll write how I did manage to fix this:
I had tried using MSM earlier, but couldn't get the qualcom-drivers installed (as mentioned in the thread linked).
So, I tried having the tool already active (and certificates installed) as I pressed both volume up & down and plugged in the phone.
Now a port reacted and I could (with great excitment and haste) press install:
{
"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"
}
As expected it's back to stock.
ADDONS/PLUGINS for Dynamic Installer
SUPPORT: TELEGRAM CHANNEL - TELEGRAM GROUP
ABOUT THIS:
These are some addons that dont included by default in the Dynamic Installer cuz they arent necessary in generic installations / mods but they could be useful
ALL ADDONS:
-----------------------------------
ImageMagick (Best Tool to manipulate images)
{
"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"
}
Unzip the downloaded Addon
Add magick and magick_ files in ur META-INF/addons of the Dynamic Installer
Then to import it add this in the first lines (Recommended) of your updater-script or customize.sh
Bash:
#Look carefully, "a dot" "space" "File to import"
. "$addons/magick"
Enjoy ur new command "magick"
DOWNLOAD
-----------------------------------
ffmpeg (Best Tool to manipulate all multimedia content vídeos/audio/....)
Unzip the downloaded Addon
Add ffmpeg and ffmpeg_ files in ur META-INF/addons of the Dynamic Installer
Then to import it add this in the first lines (Recommended) of your updater-script or customize.sh
Bash:
#Look carefully, "a dot" "space" "File to import"
. "$addons/ffmpeg"
Enjoy ur new command "ffmpeg"
DOWNLOAD
-----------------------------------
Omc Decoder ( JAR to decode Samsung .XMLs)
For JARs that have been converted to .DEX there is a native run_jar action (It only works when the device is booted or in some devices from custom Recovery when the setdefault apex_mount is enabled in the updater-script).
Download omc-decoder.jar
Add omc-decoder.jar in ur META-INF/addons
Then to run it use this example line ur updater-script or customize.sh
Bash:
run_jar "$addons/omc-decoder.jar" -d -i "cscfeature.xml" -o "decoded-cscfeature.xml"
#Btw you can use this format line too
run_jar_addon "omc-decoder.jar" -d -i "cscfeature.xml" -o "decoded-cscfeature.xml"
DOWNLOAD
-----------------------------------
DX (JAR to convert JAVA CODE / JARs into .DEX for Android)
For JARs that have been converted to .DEX there is a native run_jar action (It only works when the device is booted or in some devices from custom Recovery when the setdefault apex_mount is enabled in the updater-script).
Download dx.jar
Add dx.jar in ur META-INF/addons
Then to run it use this example line ur updater-script or customize.sh
Bash:
run_jar "$addons/dx.jar" --dex --output=result.dex "UNDEXED JAR FILE"
#Btw you can use this format line too
run_jar_addon "dx.jar" --dex --output=result.dex "UNDEXED JAR FILE"
DOWNLOAD
-----------------------------------
boot_patch (Allows unpacking and packing the boot.img of most Android devices)
Unzip the downloaded Addon
Add boot_patch.sh and boot_patch files in ur META-INF/addons of the Dynamic Installer
Then to import it add this in the first lines (Recommended) of your updater-script or customize.sh
Bash:
#Look carefully, "a dot" "space" "File to import"
. "$addons/boot_patch.sh"
DOWNLOAD
USAGE:
GENERAL NOTE: All these functions support processing an additional compression in the kernel or ramdisk, for example, you can include a ramdisk that additionally compressed as .XZ and these functions will have no problem to decompressing/processing it (Supports: gzip zopfli xz lzma bzip2 lz4 lz4_legacy lz4_lg).
unpack_boot "IMG/Partition to extract" "Output folder" <1>
You can unpack an existing IMG or you can use directly the partition that containing it.
NOTE: The third argument is optional, if you add "1" it will not unpack the ramdisk (Useful if you are not going to edit any internal contents of the ramdisk)
Bash:
#Unpack some existing IMG
unpack_boot "$TMP/boot.img" "$TMP/first_boot"
#Unpack from some Partition
unpack_boot $(find_block boot) "$TMP/second_boot"
#Unpack without unpacking the Ramdisk
unpack_boot $(find_block boot) "$TMP/second_boot" 1
repack_boot "Folder to build" "Output File/Partition" <recovery>
Rebuild the IMG unpacked by unpack_boot, the result can be saved in any path or you can send it to the partition directly (automatically repack_boot will evaluate what to do)
NOTE: The third argument is optional, if you add "recovery" it will use AVB1 signing (only if needed) for recovery images.
Bash:
#Repack some unpacked IMG
repack_boot "$TMP/first_boot" "$TMP/result.img"
#Repack and send it to some Partition
repack_boot "$TMP/second_boot" $(find_block boot)
#Repack some unpacked Recovery image
repack_boot "$TMP/second_boot" $(find_block recovery) recovery
Additionally you can know if in the process the resulting IMG lost Magisk, if it is the case, the repack_boot will return the error code "2", so:
Bash:
repack_boot "$TMP/first_boot" $(find_block boot)
result=$?
if [ $result == 0]; then
ui_print "No error and Magisk ensured"
elif [ $result == 1]; then
ui_print "Some fatal problem! and no changes were made"
elif [ $result == 2]; then
ui_print "No error but Magisk is not present"
fi
update_ramdisk "New ramdisk" "IMG/Partition to edit"
You can automatically update the ramdisk of an existing IMG or you can use directly the partition that containing it.
NOTE: The update_ramdisk will return the direct results of the repack_boot (You can save the error code to know if the IMG lost Magisk)
Bash:
#Update the Ramdisk in some existing IMG
update_ramdisk "$TMP/new_ramdisk.cpio" "$TMP/boot.img"
#Update the Ramdisk in some Partition
update_ramdisk "$TMP/new_ramdisk.cpio" $(find_block boot)
update_kernel "New kernel" "IMG/Partition to edit"
You can automatically update the kernel of an existing IMG or you can use directly the partition that containing it.
NOTE: The update_kernel will return the direct results of the repack_boot (You can save the error code to know if the IMG lost Magisk)
Bash:
#Update the Kernel in some existing IMG
update_kernel "$TMP/new_kernel" "$TMP/boot.img"
#Update the Ramdisk in some Partition
update_kernel "$TMP/new_kernel" $(find_block boot)
patch_cmdline "New prop" "New prop" "..."
You can patch multiple properties (props) of the cmdline of an IMG unpacked by unpack_boot, the only condition is to be in that path ( cd "path")
NOTE: The patch_cmdline automatically replaces or adds props (If you patch the same prop twice, it wont repeat)
Bash:
cd "$TMP/first_boot"
patch_cmdline androidboot.selinux=permissive
remove_cmdline "prop to remove" "prop to remove" "..."
You can remove multiple properties (props) of the cmdline of an IMG unpacked by unpack_boot, the only condition is to be in that path ( cd "path")
Bash:
cd "$TMP/first_boot"
remove_cmdline skip_override
flash_image "IMG to install" "Partition/Output file"
It is the default IMG installer of the boot_patch plugin utilities, it can automatically evaluate what to do in different cases
Bash:
flash_image "$TMP/boot.img" $(find_block boot)
-----------------------------------
No More for the moment
CREDITS TO:
Me @BlassGO (Developer of Dynamic Installer)
fei-ke (Developer of Omc Decoder)
ayaromenok (Developer of Static ImageMagick)
Khang-NT (Developer of Static ffmpeg)
@topjohnwu (For his amazing tools / methods for editing boot.img for Magisk)
@osm0sis (For giving more enhance the edition of boot.img with new methods in his AnyKernel project)
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)