Accessories CustomAP 2022 - Samsung Galaxy Tab A7 Lite

The only way to get away from the official firmware.​Changes Degoogle (LeOS-TD.2.0 ) A13 GSI Home Launcher For SM-T225
Flash GSI with Odin Only (no fastboot(D) or TWRP needed)
1.Unlocked BootLoader. 2.-T22X with Stock ROM pre-installed. 3.Odin 4.Linux Sub-system wins10,11 5.https://github.com/ChromiumOS-Guy/SuperPatcherGSI :Autmated Script to Patch a Super.img with a GSI in python 3. "SuperPatcherGSI-x64.AppImage"...
forum.xda-developers.com
FastbootD
☆☆☆ Tips and Tricks For [ LOS TD Unofficial GSI ] latest 2023-03-24
microG
OneUi 5.1 , The Last Update Android Version For Tab A7 Lite / The best way to process GSIs /LineageOS 20 "Light" v.22-03-2023 works
PDA / AP version T225XXU2CWB3 CSC T225OXM2CWB3 version MODEM / CP T225XXU2CWB3 version https://www.sammyfans.com/2023/03/22/one-ui-5-1-features-looks-on-galaxy-tablets/ T225XXU2CWB3 (Can't downgrade) Download FastbootD here Full GSIs...
forum.xda-developers.com
FastbootD
AOSP GSI A13
for this device A/B Partition ( Dynamic partition) Based on Stock Android 11,12 ,13​
Enable Linux Subsystem and Install Ubuntu in Windows 10,11
(WSL2 For modify GSI system image)
->A generic method of patching any Android super images
->Creating CustomAP framework file for Odin flashing tool.​
->Using Android 11 Fastboot Mode For install GSIs.
(Required TWRP , Fastboot Driver for Win)
see...Attachments for download.
✓ Tricks for Selecting Your GSIs
Test GSIs with VegaBobo/DSU First
IF it works well
Uses Native CustomAP installation.
(DSU v2 Not supported Stock A12 But works with Stock A13 )
Much much more comfortable and safe
No Computer needed.
No TWRP No Fastboot
​Tutorial Step by Step ( Select Link below)
Part 1: Create CustomAP framework file For GSI Flashing with Odin.
Part 2: Modified sub-partition of super.img
Part 3: Advanced CustomAP (for changing Read Only to Read/write System)
Read only 2 Read/Write Partition.
Special Part VegaBobo DSU
Part 4: CustomAP for Sam Mobile (Draft)
Part 5: FastbootD (New way to replace CustomAP)
https://forum.xda-developers.com/t/...laces-customap-report-back-will-help.4537083/
Attachments Download for TWRP (Stock A11 only --no touch supported)
​

Part 2​Modified sub-partition of super.img​Step by Step​CREATE CustomAP for Odin Flashing with Patching Dynamic Partitions.​​*** Uses GSIs with (Vndk)Lite Variant only.(No Slim)​
*** the continue part of Step by Step CREATE CustomAP framework file for GSI Flashing with Odin.
(Required Win10, 11 with wsl2 or Ubuntu or VirtualBox)​
(Our scope)​What are we doing now ?​1) unpacking super.raw with imjtool. ( super.img.lz4 -->super.img-->super.raw)
2) resizing system.img (in order to insert our modifications to the rom)
3) mounting system.img (Read/Write System)
4) do our modifications
5) umounting system
6) shrink edited system.img to the minimal size
7) generating new super.img
8) Create customAP file ( for flashing it to our device with odin.)
( Essencial tools)​Extract Sub-Partition inside super.img.lz4 tool​## Download Samsung framework file. (Stock Firmware)
## Extract "super.img.lz4" from (AP framework file) with (unzip FILE.zip) command. or uses utility from win 10
## Decompress "super.img" from "super.img.lz4" with LZ4 command
## sparse format ""super.raw" from "super.img" with simg2img command
## Use imjtool to extract the partitions of super.raw. Notice that partitions in a super image are split into several groups.
(The exact grouping varies across devices/OS versions, so one should always use imjtool to check first.)
Code:
wget http://newandroidbook.com/tools/imjtool.tgz && tar xzvf imjtool.tgz
{
"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"
}
imjtool v2.0 beta1
*You may also use the official lpunpack for extraction but it can’t display the group schema.
Code:
./imjtool.ELF64 super.raw extract
output:
MMapped: 0x7f5f4a89d000, imgMeta 0x7f5f4a89e000
liblp dynamic partition (super.img) - Blocksize 0x1000, 2 slots
LP MD Header @0x3000, version 10.0, with 4 logical partitions on block device of 5812 GB, at partition super, first sector: 0x800
Partitions @0x3080 in 2 groups:
Group 0: default
Group 1: main
Name: system (read-only, Linux Ext2/3/4/? Filesystem Image, @0x100000 spanning 1 extents of 3 GB) - extracted
Name: product (read-only, Linux Ext2/3/4/? Filesystem Image, @0xe6700000 spanning 1 extents of 1 GB) - extracted
Name: vendor (read-only, Linux Ext2/3/4/? Filesystem Image, @0x12d500000 spanning 1 extents of 685 MB) - extracted
Name: odm (read-only, Linux Ext2/3/4/? Filesystem Image, @0x158300000 spanning 1 extents of 4 MB) - extracted
Note: Notice file size of "system.img" =3GB
Download Samsung Firmware tool​Install Bifort
Releases · zacharee/SamloaderKotlin
Contribute to zacharee/SamloaderKotlin development by creating an account on GitHub.
github.com
Download "Bifrost_Linux.zip"
Extract to home
change directory to
Code:
cd Bifrost/bin
give execute permission
Code:
chmod +x Bifrost
Run apps
Code:
./Bifrost
CSC Samsung code https://technastic.com/csc-home-csc-samsung-odin/
​Repack Partition Tools​Download otatools
otatools.zip
drive.google.com
Extract to home
Give its execute permission or 0755
Code:
cd otatools/bin
Code:
chmod +x lpmake
Interact with the internal partition’s file systems tools​## Available in common Linux distributions
Extract lz4 archirve: lz4
Usage :
lz4 [arg] [input] [output]
input : a filename
with no FILE, or when FILE is - or stdin, read standard input
Arguments :
-1 : Fast compression (default)
-9 : High compression
-d : decompression (default for .lz4 extension)
-z : force compression
-D FILE: use FILE as dictionary
-f : overwrite output without prompting
-k : preserve source files(s) (default)
--rm : remove source file(s) after successful de/compression
-h/-H : display help/long help and exit
Sparse Format
simg2img​Usage: simg2img <sparse_image_files> <raw_image_file>
fallocate, resize2fs, dumpe2fs, e2fsck​
(Inaction Steps, "system.img" modification)​1.) Format of File​Let’s say we want to modify system.img. (May be from any GSI )
Firstly, check the file format.
Code:
sudo file system.img
Ex.Output
system.img: Linux rev 1.0 ext2 filesystem data, UUID=6a979985-101a-4fa4-bd87-f3ff81ebaaba (extents) (large files) (huge files)
Although it shows ext2, but it’s in fact an ext4 image.
​2.) Resizing < system.img>​
All imges have been shrunk to their minimum sizes. In other words, there’s zero space left in the partition of which the image file holds. As we would like to add more files to it, we need to firstly enlarge the file to create some space, then expand the file system accordingly.
# Enlarge the file to 2G. (It can be any size)
# allocates more space for system.img 2GB
Code:
sudo fallocate -l 2G system.img
Code:
ls -lah system.img
Ex.Output
---------- 1 fortuner6898 fortuner6898 2.0G Oct 12 13:18 system.img
# Resize the filesystem
this command increases the file system size of the partion to ....xG
Try
Code:
resize2fs system.img 2G
resize2fs 1.46.5 (30-Dec-2021)
resize2fs: New size smaller than minimum (871879)
*Note not fit
TRY
Code:
sudo resize2fs system.img 3G
Ex.Output
resize2fs 1.45.5 (07-Jan-2020)
resize2fs: New size smaller than minimum (890902)
*Note not fit
FINAL TRY
Code:
resize2fs system.img 4G
resize2fs 1.46.5 (30-Dec-2021)
Resizing the filesystem on system.img to 1048576 (4k) blocks.
The filesystem on system.img is now 1048576 (4k) blocks long.
*Note this time OK
​3.) Mounting & Problems.​
create mount point directory
Code:
mkdir system
Code:
sudo mount -t ext4 -o loop system.img system
Ex.Output Error!!
Code:
mount: system: mount failed: Operation not permitted.
3.1) Problem 1. came from no loop command.​*** ERROR MUST BE FIXED​ if you used (wsl1) linux from win 10 "mount" command, changes it to wsl2.​
Resource: Windows Subsystem for Linux.
Loop devices · Issue #4980 · microsoft/WSL
Please implement loop devices. They are SO useful.
github.com
>>>Howto Fix Ubuntu loop device command---> Open Spoiler
Spoiler: For Win10 -Ubuntu Sub-system
Checking..
Ubuntu terminal
Code:
cd /dev
Code:
ls -l | grep -v tty
output
total 0
drwxr-xr-x 1 root root 4096 Oct 13 07:38 block
crw-rw-rw- 1 root root 120, 0 Oct 13 07:38 dxg
lrwxrwxrwx 1 root root 13 Oct 13 07:38 fd -> /proc/self/fd
crw-r--r-- 1 root root 1, 11 Oct 13 07:38 kmsg
crw-rw-rw- 1 root root 10, 50 Oct 13 07:38 lxss
crw-rw-rw- 1 root root 1, 3 Oct 13 07:38 null
drwxr-xr-x 1 root root 0 Oct 13 07:38 pts
crw-rw-rw- 1 root root 1, 8 Oct 13 07:38 random
lrwxrwxrwx 1 root root 8 Oct 13 07:38 shm -> /run/shm
lrwxrwxrwx 1 root root 15 Oct 13 07:38 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Oct 13 07:38 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Oct 13 07:38 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root root 1, 9 Oct 13 07:38 urandom
crw-rw-rw- 1 root root 1, 5 Oct 13 07:38 zero
>>> not founded loop command ( not wsl2)​​Howto update
1.open windows10 update
setting-->windows update--->Advanced option = open receive update
2. open windows system--->command promp-->Administrator mode
cmd>
Code:
wsl --update
output
Checking for updates...
No updates are available.
Kernel version: 5.10.102.1 <----wsl2
check which Ubuntu version has installed.
CMD>.
C:\Windows\System32>
Code:
wsl --list --verbose
NAME STATE VERSION
Ubuntu-20.04 Stopped 1
convert to WSL2
cmd>
Code:
wsl --set-version Ubuntu-20.04 2
output
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
The operation completed successfully.
=================================
TEST LOOP with WSL2
[email protected]:/dev$ ls -l | grep -v tty
total 0
crw-r--r-- 1 root root 10, 235 Oct 14 15:49 autofs
drwxr-xr-x 2 root root 40 Oct 14 15:49 block
drwxr-xr-x 2 root root 80 Oct 14 15:49 bsg
crw------- 1 root root 10, 234 Oct 14 15:49 btrfs-control
drwxr-xr-x 3 root root 60 Oct 14 15:49 bus
crw------- 1 root root 5, 1 Oct 14 15:49 console
crw------- 1 root root 10, 62 Oct 14 15:49 cpu_dma_latency
crw------- 1 root root 10, 203 Oct 14 15:49 cuse
lrwxrwxrwx 1 root root 13 Oct 14 15:49 fd -> /proc/self/fd
crw-rw-rw- 1 root root 1, 7 Oct 14 15:49 full
crw-rw-rw- 1 root root 10, 229 Oct 14 15:49 fuse
crw-r--r-- 1 root root 1, 11 Oct 14 15:49 kmsg
crw------- 1 root root 10, 237 Oct 14 15:49 loop-control
brw------- 1 root root 7, 0 Oct 14 15:49 loop0
brw------- 1 root root 7, 1 Oct 14 15:49 loop1
brw------- 1 root root 7, 2 Oct 14 15:49 loop2
brw------- 1 root root 7, 3 Oct 14 15:49 loop3
brw------- 1 root root 7, 4 Oct 14 15:49 loop4
brw------- 1 root root 7, 5 Oct 14 15:49 loop5
brw------- 1 root root 7, 6 Oct 14 15:49 loop6
brw------- 1 root root 7, 7 Oct 14 15:49 loop7
drwxr-xr-x 2 root root 60 Oct 14 15:49 mapper
crw------- 1 root root 1, 1 Oct 14 15:49 mem
drwxr-xr-x 2 root root 60 Oct 14 15:49 net
crw-rw-rw- 1 root root 1, 3 Oct 14 15:49 null
crw------- 1 root root 10, 144 Oct 14 15:49 nvram
crw------- 1 root root 108, 0 Oct 14 15:49 ppp
crw-rw-rw- 1 root root 5, 2 Oct 14 16:56 ptmx
drwxr-xr-x 2 root root 0 Oct 14 15:49 pts
brw------- 1 root root 1, 0 Oct 14 15:49 ram0
brw------- 1 root root 1, 1 Oct 14 15:49 ram1
brw------- 1 root root 1, 10 Oct 14 15:49 ram10
brw------- 1 root root 1, 11 Oct 14 15:49 ram11
brw------- 1 root root 1, 12 Oct 14 15:49 ram12
brw------- 1 root root 1, 13 Oct 14 15:49 ram13
brw------- 1 root root 1, 14 Oct 14 15:49 ram14
brw------- 1 root root 1, 15 Oct 14 15:49 ram15
brw------- 1 root root 1, 2 Oct 14 15:49 ram2
brw------- 1 root root 1, 3 Oct 14 15:49 ram3
brw------- 1 root root 1, 4 Oct 14 15:49 ram4
brw------- 1 root root 1, 5 Oct 14 15:49 ram5
brw------- 1 root root 1, 6 Oct 14 15:49 ram6
brw------- 1 root root 1, 7 Oct 14 15:49 ram7
brw------- 1 root root 1, 8 Oct 14 15:49 ram8
brw------- 1 root root 1, 9 Oct 14 15:49 ram9
crw-rw-rw- 1 root root 1, 8 Oct 14 15:49 random
crw------- 1 root root 251, 0 Oct 14 15:49 rtc0
brw------- 1 root root 8, 0 Oct 14 15:49 sda
brw------- 1 root root 8, 16 Oct 14 15:49 sdb
crw------- 1 root root 21, 0 Oct 14 15:49 sg0
crw------- 1 root root 21, 1 Oct 14 15:49 sg1
lrwxrwxrwx 1 root root 8 Oct 14 15:49 shm -> /run/shm
lrwxrwxrwx 1 root root 15 Oct 14 15:49 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Oct 14 15:49 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Oct 14 15:49 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root root 1, 9 Oct 14 15:49 urandom
crw------- 1 root root 7, 0 Oct 14 15:49 vcs
crw------- 1 root root 7, 1 Oct 14 15:49 vcs1
crw------- 1 root root 7, 128 Oct 14 15:49 vcsa
crw------- 1 root root 7, 129 Oct 14 15:49 vcsa1
crw------- 1 root root 7, 64 Oct 14 15:49 vcsu
crw------- 1 root root 7, 65 Oct 14 15:49 vcsu1
drwxr-xr-x 2 root root 60 Oct 14 15:49 vfio
crw------- 1 root root 10, 238 Oct 14 15:49 vhost-net
crw------- 1 root root 10, 63 Oct 14 15:49 vsock
crw-rw-rw- 1 root root 1, 5 Oct 14 15:49 zero
[email protected]:/dev$
It's only for linux subsystem installed after this command is set. " wsl --set-default-version 2"​Then after run
wsl --set-default-version 2
install new Ubuntu
or
Uninstall old Ubuntu and then install new one.
if run command Not success
wsl --set-version Ubuntu-20.04 2
Exam
C:\WINDOWS\system32>wsl --set-default-version 2
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
The operation completed successfully.
​3.2.) Problem 2: came from SHARED_BLOCKS ​
It turned out that system imgage in Android 10+ is formated with EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS, found by @topjohnwu.
In other words, it’s read-only.
We can run dumpe2fs and check “Filesystem features” to confirm that the image has shared_blocks turned on.
Code:
sudo dumpe2fs system.img
Ex.Output
dumpe2fs 1.45.5 (07-Jan-2020)
dumpe2fs: Permission denied while trying to open system.img
Couldn't find valid filesystem superblock.
​## Solution:
Luckily shared_blocks is merely a restriction at the file level. We can simply run e2fsck to remove it.
Code:
sudo e2fsck -E unshare_blocks system.img
​Ex.Output
e2fsck 1.45.5 (07-Jan-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/: ***** FILE SYSTEM WAS MODIFIED *****
/: 7953/8064 files (0.5% non-contiguous), 890901/898552 blocks
​# # Check that the shared_block feature is gone.
Code:
sudo dumpe2fs system.img
Ex.Out
Spoiler: Click to Show
dumpe2fs 1.45.5 (07-Jan-2020)
Filesystem volume name: /
Last mounted on: /
Filesystem UUID: 6a979985-101a-4fa4-bd87-f3ff81ebaaba
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: ext_attr dir_index filetype extent sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 8064
Block count: 898552
Reserved block count: 0
Overhead blocks: 576
Free blocks: 7651
Free inodes: 111
First block: 0
Block size: 4096
Fragment size: 4096
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 288
Inode blocks per group: 18
Filesystem created: Mon Oct 10 13:22:09 2022
Last mount time: n/a
Last write time: Wed Oct 12 13:36:28 2022
Mount count: 0
Maximum mount count: -1
Last checked: Wed Oct 12 13:36:28 2022
Check interval: 0 (<none>)
Lifetime writes: 3501 MB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 32
Desired extra isize: 32
Default directory hash: half_md4
Directory Hash Seed: 06b89061-20ea-4d29-bcfe-6f40b0b487d3
​Group 0: (Blocks 0-32767) csum 0xe0d5
Primary superblock at 0, Group descriptors at 1-1
Block bitmap at 2 (+2)
Inode bitmap at 3 (+3)
Inode table at 4-21 (+4)
0 free blocks, 0 free inodes, 103 directories
Free blocks:
Free inodes:
Group 1: (Blocks 32768-65535) csum 0xa982
Backup superblock at 32768, Group descriptors at 32769-32769
Block bitmap at 32770 (+2)
Inode bitmap at 32771 (+3)
Inode table at 32772-32789 (+4)
0 free blocks, 0 free inodes, 1 directories
Free blocks:
Free inodes:
Group 2: (Blocks 65536-98303) csum 0xfcd7
Block bitmap at 65536 (+0)
Inode bitmap at 65537 (+1)
Inode table at 65538-65555 (+2)
0 free blocks, 0 free inodes, 16 directories
Free blocks:
Free inodes:
Group 3: (Blocks 98304-131071) csum 0x3fe9
Backup superblock at 98304, Group descriptors at 98305-98305
Block bitmap at 98306 (+2)
Inode bitmap at 98307 (+3)
Inode table at 98308-98325 (+4)
0 free blocks, 0 free inodes, 9 directories
Free blocks:
Free inodes:
Group 4: (Blocks 131072-163839) csum 0xc769
Block bitmap at 131072 (+0)
Inode bitmap at 131073 (+1)
Inode table at 131074-131091 (+2)
0 free blocks, 0 free inodes, 9 directories
Free blocks:
Free inodes:
Group 5: (Blocks 163840-196607) csum 0xd240
Backup superblock at 163840, Group descriptors at 163841-163841
Block bitmap at 163842 (+2)
Inode bitmap at 163843 (+3)
Inode table at 163844-163861 (+4)
0 free blocks, 0 free inodes, 6 directories
Free blocks:
Free inodes:
Group 6: (Blocks 196608-229375) csum 0x5407
Block bitmap at 196608 (+0)
Inode bitmap at 196609 (+1)
Inode table at 196610-196627 (+2)
0 free blocks, 0 free inodes, 4 directories
Free blocks:
Free inodes:
Group 7: (Blocks 229376-262143) csum 0x4b24
Backup superblock at 229376, Group descriptors at 229377-229377
Block bitmap at 229378 (+2)
Inode bitmap at 229379 (+3)
Inode table at 229380-229397 (+4)
0 free blocks, 0 free inodes, 1 directories
Free blocks:
Free inodes:
Group 8: (Blocks 262144-294911) csum 0x482c
Block bitmap at 262144 (+0)
Inode bitmap at 262145 (+1)
Inode table at 262146-262163 (+2)
0 free blocks, 0 free inodes, 3 directories
Free blocks:
Free inodes:
Group 9: (Blocks 294912-327679) csum 0x9009
Backup superblock at 294912, Group descriptors at 294913-294913
Block bitmap at 294914 (+2)
Inode bitmap at 294915 (+3)
Inode table at 294916-294933 (+4)
0 free blocks, 0 free inodes, 1 directories
Free blocks:
Free inodes:
Group 10: (Blocks 327680-360447) csum 0x56cf
Block bitmap at 327680 (+0)
Inode bitmap at 327681 (+1)
Inode table at 327682-327699 (+2)
0 free blocks, 0 free inodes, 131 directories
Free blocks:
Free inodes:
Group 11: (Blocks 360448-393215) csum 0xd354
Block bitmap at 360448 (+0)
Inode bitmap at 360449 (+1)
Inode table at 360450-360467 (+2)
0 free blocks, 0 free inodes, 41 directories
Free blocks:
Free inodes:
Group 12: (Blocks 393216-425983) csum 0xcdd1
Block bitmap at 393216 (+0)
Inode bitmap at 393217 (+1)
Inode table at 393218-393235 (+2)
0 free blocks, 0 free inodes, 58 directories
Free blocks:
Free inodes:
Group 13: (Blocks 425984-458751) csum 0x68ab
Block bitmap at 425984 (+0)
Inode bitmap at 425985 (+1)
Inode table at 425986-426003 (+2)
0 free blocks, 0 free inodes, 112 directories
Free blocks:
Free inodes:
Group 14: (Blocks 458752-491519) csum 0xbd9d
Block bitmap at 458752 (+0)
Inode bitmap at 458753 (+1)
Inode table at 458754-458771 (+2)
0 free blocks, 0 free inodes, 20 directories
Free blocks:
Free inodes:
Group 15: (Blocks 491520-524287) csum 0xc1ff
Block bitmap at 491520 (+0)
Inode bitmap at 491521 (+1)
Inode table at 491522-491539 (+2)
0 free blocks, 0 free inodes, 71 directories
Free blocks:
Free inodes:
Group 16: (Blocks 524288-557055) csum 0xfc8e
Block bitmap at 524288 (+0)
Inode bitmap at 524289 (+1)
Inode table at 524290-524307 (+2)
0 free blocks, 0 free inodes, 61 directories
Free blocks:
Free inodes:
Group 17: (Blocks 557056-589823) csum 0xc2ae
Block bitmap at 557056 (+0)
Inode bitmap at 557057 (+1)
Inode table at 557058-557075 (+2)
0 free blocks, 0 free inodes, 44 directories
Free blocks:
Free inodes:
Group 18: (Blocks 589824-622591) csum 0x5ad5
Block bitmap at 589824 (+0)
Inode bitmap at 589825 (+1)
Inode table at 589826-589843 (+2)
0 free blocks, 0 free inodes, 5 directories
Free blocks:
Free inodes:
Group 19: (Blocks 622592-655359) csum 0x73e2
Block bitmap at 622592 (+0)
Inode bitmap at 622593 (+1)
Inode table at 622594-622611 (+2)
0 free blocks, 0 free inodes, 3 directories
Free blocks:
Free inodes:
Group 20: (Blocks 655360-688127) csum 0x7973
Block bitmap at 655360 (+0)
Inode bitmap at 655361 (+1)
Inode table at 655362-655379 (+2)
0 free blocks, 0 free inodes, 4 directories
Free blocks:
Free inodes:
Group 21: (Blocks 688128-720895) csum 0x5642
Block bitmap at 688128 (+0)
Inode bitmap at 688129 (+1)
Inode table at 688130-688147 (+2)
0 free blocks, 0 free inodes, 4 directories
Free blocks:
Free inodes:
Group 22: (Blocks 720896-753663) csum 0x2117
Block bitmap at 720896 (+0)
Inode bitmap at 720897 (+1)
Inode table at 720898-720915 (+2)
0 free blocks, 0 free inodes, 2 directories
Free blocks:
Free inodes:
Group 23: (Blocks 753664-786431) csum 0x0e26
Block bitmap at 753664 (+0)
Inode bitmap at 753665 (+1)
Inode table at 753666-753683 (+2)
0 free blocks, 0 free inodes, 2 directories
Free blocks:
Free inodes:
Group 24: (Blocks 786432-819199) csum 0xff3f
Block bitmap at 786432 (+0)
Inode bitmap at 786433 (+1)
Inode table at 786434-786451 (+2)
0 free blocks, 0 free inodes, 7 directories
Free blocks:
Free inodes:
Group 25: (Blocks 819200-851967) csum 0x2b16
Backup superblock at 819200, Group descriptors at 819201-819201
Block bitmap at 819202 (+2)
Inode bitmap at 819203 (+3)
Inode table at 819204-819221 (+4)
0 free blocks, 0 free inodes, 9 directories
Free blocks:
Free inodes:
Group 26: (Blocks 851968-884735) csum 0xe01c
Block bitmap at 851968 (+0)
Inode bitmap at 851969 (+1)
Inode table at 851970-851987 (+2)
0 free blocks, 0 free inodes, 70 directories
Free blocks:
Free inodes:
Group 27: (Blocks 884736-898551) csum 0x7365
Backup superblock at 884736, Group descriptors at 884737-884737
Block bitmap at 884738 (+2)
Inode bitmap at 884739 (+3)
Inode table at 884740-884757 (+4)
7651 free blocks, 111 free inodes, 7 directories, 111 unused inodes
Free blocks: 890901-898551
Free inodes: 7954-8064
​4.) Now we can mount the partition and do whatever modifications we like.
create folder mount point
Code:
mkdir system
Code:
sudo mount -t ext4 -o loop system.img system
Code:
ls system
Ex.Output
at system folder , manipulate everything from system.img with loop.
​4.1) How to modify system​in order to make changes you should use superuser:
you can use the file explorer with superuser permission by typing;
Code:
sudo nautilus
​when finished your modify task.
Code:
sudo umount system
​5.) Prepare for repacking ​
Once finished, we can start to prepare the image for repacking. The idea is simple: we firstly check and fix the errors in the file system (there’ll always be some, probably due to bugs in the previous tools), then shrink the image file back to its minimum size.
​
Code:
sudo e2fsck -yf system.img
Ex.Output
e2fsck 1.46.5 (30-Dec-2021)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/: ***** FILE SYSTEM WAS MODIFIED *****
/: 7575/7776 files (0.6% non-contiguous), 871878/880082 blocks
​# # Shrink the file system to minimum
Code:
ls -lah system.img
output
-rw-rw-r-- 1 tom tom 4.0G ต.ค. 13 14:51 system.img
​
Code:
sudo resize2fs -M system.img
output
resize2fs 1.46.5 (30-Dec-2021)
Resizing the filesystem on system.img to 871894 (4k) blocks.
The filesystem on system.img is now 871894 (4k) blocks long.
Code:
ls -lah system.img
output
-rw-rw-r-- 1 tom tom 3.4G ต.ค. 13 14:54 system.img
​6.) Prepare formular file-size of LPMAKE​
6.1) # Get the size of all images.​
Before we repack, we need to know the sizes of all images in bytes.
Code:
stat -c '%n %s' *.img
Output:
1.) Group main 4 imgs​
odm.img 4349952
product.img 1188118528
vendor.img 718503936
Sum of the group-main​
(fixed size) = 1,910,972,416 ​ + ​(variable size) = system.img size​ ( 3571277824 <------ This is variable size.)
TOTAL = 5482250240
2.) super.raw (fixed size)= 6094323712​
​6.2.) Generating new super.img​
The same as Part 1 Command.
Our last quest is to craft a lengthy lpmake command to build the new super.img. Essentially that translates to three things:
-Define the groups
-Define which partition goes into which group
-Assign image files that correspond to each partition
​Most information can be obtained from the previous imjtool.
Some of the flags to take note of are:
--metadata-slots: same as imjtool’s output
--metadata-size: The maximum size that partition metadata may consume. A partition entry uses 64 bytes and an extent entry uses 16 bytes. I think 65536 should work in most cases.
--group: format of <name>:<size>. The size should be the sum of all sub-partitions under the group
--partition: format of <name>:<attributes>:<size>[:group], attrs must be ’none’ or ‘readonly’.
--image: for each partition, specify a corresponding image file
Once done, you should now have the new super image.
​[explanation: Not copy and paste]
Prepared command "LPMAKE" Parameter.
sudo ./otatools/bin/lpmake --metadata-size 65536 \
--super-name super \
--metadata-slots 2 \
--device super:ORIGINAL_SUPER_IMG_SIZE \
--group main:SUM_OF_ALL_PARTITIONS_SIZES \
--partition odm:readonly:ODM_PARTITION_SIZE:main \
--image odm=./odm.img \
--partition product:readonly: PRODUCT_PARTITION_SIZE:main \
--image product=./product.img \
--partition system:readonly:SYSTEM_PARTITION_SIZE:main \
--image system=./system.img \
--partition vendor:readonly:VENDOR_PARTITION_SIZE:main \
--image vendor=./vendor.img \
--sparse \
--output ./super_new.img
--‐-‐-------------------------
New command
Code:
sudo ./otatools/bin/lpmake --metadata-size 65536 \
--super-name super \
--metadata-slots 2 \
--device super:6094323712 \
--group main:5482250240 \
--partition odm:readonly:4349952:main \
--image odm=./odm.img \
--partition product:readonly:1188118528:main \
--image product=./product.img \
--partition vendor:readonly:718503936:main \
--image vendor=./vendor.img \
--partition system:readonly:3864137728:main \
--image system=./system.img \
--sparse \
--output ./super_new.img
( continue doing along with Part1 )
...
...
...
7.) Flashing by Odin
Resource:​✓Patching Dynamic Partitions in Android Super Image​https://blog.senyuuri.info/posts/2022-04-27-patching-android-super-images/
✓Microsoft/WSL/Loop Device
Loop devices · Issue #4980 · microsoft/WSL
Please implement loop devices. They are SO useful.
github.com
✓How to install Ubuntu sub-system with WSL2 ?​
Loop devices · Issue #4980 · microsoft/WSL
Please implement loop devices. They are SO useful.
github.com

Part 1​​:Step by Step: ​Create CustomAP framework file For ​GSI Flashing with Odin.​by tom.android
Modified from @abg95a
Flash a GSI on the A7 Lite (without TWRP)​Update for add loop device in WSL2​ ( **will slow-down Win10 )​[ not recommend if you don't want to modified your system.img ]
>> Check WSL version.​Open CMD with Administrator
C:\Windows\System32>
Code:
wsl --list --verbose
NAME STATE VERSION
Ubuntu-20.04 Stopped 1
----> you are on wsl1
>>> Howto update it to WSL2 if you have installed Ubuntu ?​
C:\Windows\System32>
Code:
wsl --set-version Ubuntu-20.04 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion complete.
test after converted .
C:\Windows\System32>
Code:
wsl --list --verbose
NAME STATE VERSION
Ubuntu-20.04 Stopped 2
----> Now you are on wsl2
====End Update WSL1 with WSL2 ====​
✓ LINUX Installation​Ubuntu Subsystem 20.04.5 LTS​
OPEN microsoft store , Select Ubuntu version and click install.
After
Find Where to Stored installation Files.
here: (open windows show hidden file)
FOR WSL1
\Users\username\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04LTS_\LocalState
For WSL2 >>>you can access to home directory from windows (Windows 10 build 18342) like this :
\\wsl$
## make a shotcut to desktop (for easy copy and paste , sharing files between WIN and LINUX)
Resources: https://askubuntu.com/questions/759...t-directory-in-windows-subsystem-for-linux-an
====================================
New fresh install with WSL2 >​Ubuntu 20.04.5 LTS​>> How?​Before:
Check win10 with WSL1 or not
C:\Windows\System32>wsl --list --verbose
NAME STATE VERSION
Ubuntu-20.04 Stopped 1
----> you are on wsl1
Howto update to be "WSL2"
1.open windows10 update
setting--windows update---Advanced option = open receive update
After Download Update from Microsoft.
2. open windows system---command promp--Administrator mode
cmd> wsl --update
output
Checking for updates...
No updates are available.
Kernel version: 5.10.102.1 <----wsl2
3. RUN in CMD
Code:
wsl --set-default-version 2
Then install Ubuntu.
Test: loop device.
Open Ubnutu terminal
Code:
cd /dev
Code:
ls -l | grep -v tty
Spoiler: OUTPUT
[email protected]:~$ cd /dev
[email protected]:/dev$ ls -l | grep -v tty
total 0
crw-r--r-- 1 root root 10, 235 Oct 14 15:49 autofs
drwxr-xr-x 2 root root 40 Oct 14 15:49 block
drwxr-xr-x 2 root root 80 Oct 14 15:49 bsg
crw------- 1 root root 10, 234 Oct 14 15:49 btrfs-control
drwxr-xr-x 3 root root 60 Oct 14 15:49 bus
crw------- 1 root root 5, 1 Oct 14 15:49 console
crw------- 1 root root 10, 62 Oct 14 15:49 cpu_dma_latency
crw------- 1 root root 10, 203 Oct 14 15:49 cuse
lrwxrwxrwx 1 root root 13 Oct 14 15:49 fd -> /proc/self/fd
crw-rw-rw- 1 root root 1, 7 Oct 14 15:49 full
crw-rw-rw- 1 root root 10, 229 Oct 14 15:49 fuse
crw-r--r-- 1 root root 1, 11 Oct 14 15:49 kmsg
crw------- 1 root root 10, 237 Oct 14 15:49 loop-control
brw------- 1 root root 7, 0 Oct 14 15:49 loop0
brw------- 1 root root 7, 1 Oct 14 15:49 loop1
brw------- 1 root root 7, 2 Oct 14 15:49 loop2
brw------- 1 root root 7, 3 Oct 14 15:49 loop3
brw------- 1 root root 7, 4 Oct 14 15:49 loop4
brw------- 1 root root 7, 5 Oct 14 15:49 loop5
brw------- 1 root root 7, 6 Oct 14 15:49 loop6
brw------- 1 root root 7, 7 Oct 14 15:49 loop7
drwxr-xr-x 2 root root 60 Oct 14 15:49 mapper
crw------- 1 root root 1, 1 Oct 14 15:49 mem
drwxr-xr-x 2 root root 60 Oct 14 15:49 net
crw-rw-rw- 1 root root 1, 3 Oct 14 15:49 null
crw------- 1 root root 10, 144 Oct 14 15:49 nvram
crw------- 1 root root 108, 0 Oct 14 15:49 ppp
crw-rw-rw- 1 root root 5, 2 Oct 14 16:56 ptmx
drwxr-xr-x 2 root root 0 Oct 14 15:49 pts
brw------- 1 root root 1, 0 Oct 14 15:49 ram0
brw------- 1 root root 1, 1 Oct 14 15:49 ram1
brw------- 1 root root 1, 10 Oct 14 15:49 ram10
brw------- 1 root root 1, 11 Oct 14 15:49 ram11
brw------- 1 root root 1, 12 Oct 14 15:49 ram12
brw------- 1 root root 1, 13 Oct 14 15:49 ram13
brw------- 1 root root 1, 14 Oct 14 15:49 ram14
brw------- 1 root root 1, 15 Oct 14 15:49 ram15
brw------- 1 root root 1, 2 Oct 14 15:49 ram2
brw------- 1 root root 1, 3 Oct 14 15:49 ram3
brw------- 1 root root 1, 4 Oct 14 15:49 ram4
brw------- 1 root root 1, 5 Oct 14 15:49 ram5
brw------- 1 root root 1, 6 Oct 14 15:49 ram6
brw------- 1 root root 1, 7 Oct 14 15:49 ram7
brw------- 1 root root 1, 8 Oct 14 15:49 ram8
brw------- 1 root root 1, 9 Oct 14 15:49 ram9
crw-rw-rw- 1 root root 1, 8 Oct 14 15:49 random
crw------- 1 root root 251, 0 Oct 14 15:49 rtc0
brw------- 1 root root 8, 0 Oct 14 15:49 sda
brw------- 1 root root 8, 16 Oct 14 15:49 sdb
crw------- 1 root root 21, 0 Oct 14 15:49 sg0
crw------- 1 root root 21, 1 Oct 14 15:49 sg1
lrwxrwxrwx 1 root root 8 Oct 14 15:49 shm -> /run/shm
lrwxrwxrwx 1 root root 15 Oct 14 15:49 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Oct 14 15:49 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Oct 14 15:49 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root root 1, 9 Oct 14 15:49 urandom
crw------- 1 root root 7, 0 Oct 14 15:49 vcs
crw------- 1 root root 7, 1 Oct 14 15:49 vcs1
crw------- 1 root root 7, 128 Oct 14 15:49 vcsa
crw------- 1 root root 7, 129 Oct 14 15:49 vcsa1
crw------- 1 root root 7, 64 Oct 14 15:49 vcsu
crw------- 1 root root 7, 65 Oct 14 15:49 vcsu1
drwxr-xr-x 2 root root 60 Oct 14 15:49 vfio
crw------- 1 root root 10, 238 Oct 14 15:49 vhost-net
crw------- 1 root root 10, 63 Oct 14 15:49 vsock
crw-rw-rw- 1 root root 1, 5 Oct 14 15:49 zero
[email protected]:/dev$
(you will saw loop command.)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>​
GET START​>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>​✓ Get " super.img" from inside Stock AP File​by Extract (super.img.lz4) file by Windows or Linux.​For Windows​Download lz4 for win and extract into C:\AnyName
from https://github.com/lz4/lz4/releases
1) extract "super.img.lz4" from Stock AP Firmware file with 7zip, into lz4 folder.<AnyName>
2) go into folder lz4_win64_v1_9_4 and run CMD
Spoiler: pic
Code:
lz4 -d super.img.lz4 super.img
copy output " super.img" to uses with Ubuntu at /home/username/
>>>>>>>>>>>>≥>>>>>>>>>>>>>>>>>>>>>>
For Linux:​✓ launch Ubuntu terminal( console) from Start menu
2.1) Option We can uses LZ4 from linux, process same as (Step 1-2 for wins)
Ubuntu
you can install LZ4 from Ubuntu Console with
Code:
sudo apt update
sudo apt-get -y install lz4
or
sudo apt install liblz4-tool
note
lz4 [option] input output
lz4 -d (d= decompress)
lz4 -dc ( c=concatenate )
2.2) Option Extract "super.img.lz4" from Stock AP framework file.
and paste it to /home/username/
2.3)
Code:
sudo lz4 -d super.img.lz4 super.img
Spoiler: pic
2.4)COMPARE with using "lz4" between Ubuntu and Windows
​CONCLUSION of Beginning step.​WE CAN GETS " SUPER.IMG" FROM TWO WAYS , WINDOWS OR LINUX.
( windows from step 1-2 ) or. ( Linux from step 2.1 -2.3)
***We will use 'super.img' to begin our modification.​​✓ unpacking super.img​3.) Turn sparse format To RAW​Ubuntu
**First of all the super.img file might be in sparse format so we need to make it raw image. By Using "SIMG2IMG"
Code:
sudo apt-get update
sudo apt-get install simg2img
Spoiler: Backward
I'm
ok
Code:
sudo apt-get install img2simg
After install execute this command.
Code:
sudo simg2img super.img super.raw
Spoiler: pic
✓Extract subpartition out from "SUPER.RAW"​4) Tool for extract partition. ( very important tool for show "group schema" which used to specific parameter option for lpmake.)
4.1) Download imjtool
http://newandroidbook.com/tools/imjtool.tgz
or download from attach file belows this tutorial (imjtool.zip)
4.2) extract "imjtool" from archive imjtool.tgz to /home/username/
*note for short i renamed it to 'imjtool'
4.3) then give it permission with command
Code:
chmod +x imjtool
5) Extract sub partition within our "SUPER.RAW"
By execute this command
Code:
./imjtool super.raw extract
It will extract sub-partitions (4 img files ) in the folder "/home/user/extracted"
- system.img
- vendor.img
- product.img
- odm.img
Spoiler: show group schema
✓ Modify Stock "system.img" by Changes with GSI-"system.img"​6) Choose your favorite GSI. ( Recommend PHH Treble- GSI )
Download from :-
https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list
6.1) Extract Downloaded archive & Replace "system.img" with your GSI img
(rename it to system.img over-written the old file.)
Spoiler: change stock system.img with GSI system.img
6.2 )
Move all img files (6.1)
from /home/username/extracted folder into /home/username/
7.) Get each partitions file size.
we can do it by:
Code:
stat -c '%n %s' IMG_FILE.img
:- do it for all partitions files.
7.1
Code:
stat -c '%n %s' system.img
Exam output---system.img 308 951 4496
7.2
Code:
stat -c '%n %s' vendor.img
Exam ouputt----vendor.img 718 503 936
7.3
Code:
stat -c '%n %s' product.img
Exam output----product.img 118 811 8528
7.4
Code:
stat -c '%n %s' odm.img
Exam output----odm.img 434 9952
7.5 ***size of the "original super.raw"
Code:
stat -c '%n %s' super.raw
Exam output----super.raw 609 432 3712
Spoiler: pic
✓ Repacked modified sub-partition back​8) Repacked new super.img.
8.1 fill in "img partition size" formular (parameter) to your prepared command below
explanation:
Spoiler: Calculate Sum of all partition size 4
explanation:
Prepared command "LPMAKE" parameter
sudo ./otatools/bin/lpmake --metadata-size 65536 \
--super-name super \
--metadata-slots 2 \
--device super:ORIGINAL_SUPER_IMG_SIZE \
--group main:SUM_OF_ALL_PARTITIONS_SIZES \
--partition odm:readonly:ODM_PARTITION_SIZE:main \
--image odm=./odm.img \
--partition product:readonlyRODUCT_PARTITION_SIZE:main \
--image product=./product.img \
--partition system:readonly:SYSTEM_PARTITION_SIZE:main \
--image system=./system.img \
--partition vendor:readonly:VENDOR_PARTITION_SIZE:main \
--image vendor=./vendor.img \
--sparse \
--output ./super_new.img
Note:
Replace
ORIGINAL_SUPER_IMG_SIZE,
SUM_OF_ALL_PARTITIONS_SIZES
ODM_PARTITION_SIZE,
PRODUCT_PARTITION_SIZE,
SYSTEM_PARTITION_SIZE,
VENDOR_PARTITION_SIZE
with the values you obtained in step 7.
====================
8.2
Download & extract : OTATOOLS to /home/username/
here:
Google Drive - Virus scan warning
drive.google.com
**We only want to use "lpmake" from its.
*** If you have a problem when used command " sudo ./otatools/bin/lpmake --metadata-size 65536 \ bra bra bra
Error message: Command not found.
Do this...
Code:
chmod +x otatools/bin/lpmake
or
Code:
chmod -R +x otatools
> exit terminal and Login Back again
Spoiler: pic
8.3) execute prepared formular (8.1) with this command
Note: Numeric are my Example only.
1. Fix partition size ( odm + product + vendor )
434 9952 + 118 811 8528 + 718 503 936 = 1,910,972,416 + (new system.img )= Sum of all 4 partition.
2. Fix All partition ( super.raw) = 609 432 3712
***DO NOT COPY!!***
explanation:
Code:
sudo ./otatools/bin/lpmake --metadata-size 65536 \
--super-name super \
--metadata-slots 2 \
--device super:6094323712 \
--group main:5000486912\
--partition odm:readonly:4349952:main \
--image odm=./odm.img \
--partition product:readonly:1188118528:main \
--image product=./product.img \
--partition system:readonly:3864137728:main \
--image system=./system.img \
--partition vendor:readonly:718503936:main \
--image vendor=./vendor.img \
--sparse \
--output ./super_new.img
Spoiler: OUTPUT
OUTPUT SHOW:-
lpmake I 09-11 03:32:54 36 36 builder.cpp:1012] [liblp]Partition odm will resize from 0 bytes to 4349952 bytes
lpmake I 09-11 03:32:54 36 36 builder.cpp:1012] [liblp]Partition product will resize from 0 bytes to 1188118528 bytes
lpmake I 09-11 03:32:54 36 36 builder.cpp:1012] [liblp]Partition system will resize from 0 bytes to 3864137728 bytes
lpmake I 09-11 03:32:54 36 36 builder.cpp:1012] [liblp]Partition vendor will resize from 0 bytes to 718503936 bytes
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
**lpmake expand partition success. Resize from 0 bytes to 9999999 bytes
**ignored Invalid sparse file format at header magic
✓Compress repacked modified new super.img​
9) Compress the repacked super_new.img
Code:
lz4 -B6 --content-size super_new.img super_new.img.lz4
10). Compress the clean vmbeta.img
Download Clean vbmeta.img from Google
https://dl.google.com/developers/android/qt/images/gsi/vbmeta.img
Code:
lz4 -B6 --content-size vbmeta.img vbmeta.img.lz4
Win10
(From Attachment download.)
11). Down& Extract "tar-md5-script-tool.zip" to C;\
11.1 extract all *.img.lz4 files (from AP Stock) to. C:/ tar-md5-script-tool folder
12) Replace
super.img.lz4 and
vbmeta.img.lz4
|
in tar-md5-script-tool dir
|
with your repacked and compressed
super_new.img.lz4 (rename it to super.img.lz4)--->output from step 9
and the clean compressed
vbmeta.img.lz4. ------> output from step 10
Spoiler: pic
13) Run Win Batch File For Packing Custom AP file (tar.md5) for Odin
Run batch.bat in tar-md5-script-tool folder
[You will find the " AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5"
in the temp-folder subdir]
***Don't Rename​
14) Final Flashing with ODin
...14.1) Device must installed Stock Firmware. (No root)
* No bad critical conditions happened when you are on STOCK ROM.
... 14.2) OEM Unlock [Developer options] must gray out but
. enable on position.
... 14.3) KG State Must be "Checking state" status.
( if kg state = Broken ) = you must have goto flash Pure stock firmware
again and this time uses ONLY "CSC" factory reset
. *NO used Home_CSC
After finished odin fashing must connected internet, check "kg status"
again )
...14.4) Flashing all files at once, don't ignored any slot.( AP+BL+CP+CSC)
except USERDATA
(Odin will shrink non-slot data size automatically)
...14.5) After Device reboot
(1st) show android robot - remove old system
(2nd) Due to new vbmeta.img has changed from stock , tab will reboot to
Recovery menu , you must select its factory reset menu manually.
...14.6) Click Magisk icon app to update
" Upgrade to full Magisk to finish the setup. Download and install"OK
- Magisk app will not reboot but update itself. But if you open app
again it will asked to reboot for addition upgrade.
>AP SLOT : AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5
>BL Slot : BL Stock.md5
>CP SLOT: CP Stock.md5
>CSC Slot: CSC Stock.md5 ------> (Don't uses HOME_CSC)
>USERDATA Slot: magisk_boot_vbmeta_patch.tar
✓ How to create Magisk patch for boot.img + vbmeta.img
extract (vbmeta.img.lz4 + boot.img.lz4) from your AP Stock
create compress one file xxx .tar with 7zip
move (vbmeta.img.lz4 + boot.img.lz4).tar (xxx.tar) to tab a7 lite
install magisk.apk on you tab a7 lite
patch the tar file. (with magisk manager)
result magisk-patch file at Tab a7 :-Download folder.
Recommend: Default R/W GSI " by Nazim"​My Examples
https://forum.xda-developers.com/t/...-lite-gsi-installation.4503647/#post-87550627
If you can't booted "VNDK Lite" variant but want to uses mount Read/Write .
Part3 -Create CustomAP Tutorial.
[Close].Advanced-CustomAP
》Step by Step Tutorial for changes mount Read Only To Read/Write.《 Example in tutorial: (install PixelExperience_Plus Android 13 , Can install on A12 but not works) Slim has no Recorder (voice), Pixel Wallpapers, Pixel Live Wallpapers, Drive...
forum.xda-developers.com

Draft​Part 4​CustomAP For Mobile​From A/B Partition TO AB Partition Device​For Low spec Computer.
1. Must install 2 Ubuntu subsystem , one with WSL1 , the other with WSL2
2. Edit Sub-partition used WSL2 Ubuntu and exit terminal then copy output file to WSL1 Another Ubuntu >> finish making CustomAP with its.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>​what this group schema have told you?​>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Begin​
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
USE " IMJTOOL" with A/B partition device.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Code:
./imjtool super.raw extract
MMapped: 0x7fa605fa0000, imgMeta 0x7fa605fa1000
liblp dynamic partition (super.img) - Blocksize 0x1000, 2 slots
LP MD Header @0x3000, version 10.0, with 4 logical partitions on block device of 5812 GB, at partition super, first sector: 0x800
Partitions @0x3080 in 2 groups:
Group 0: default
Group 1: main
Name: system (read-only, Linux Ext2/3/4/? Filesystem Image, @0x100000 spanning 1 extents of 3 GB) - extracted
Name: product (read-only, Linux Ext2/3/4/? Filesystem Image, @0xe6700000 spanning 1 extents of 1 GB) - extracted
Name: vendor (read-only, Linux Ext2/3/4/? Filesystem Image, @0x12d500000 spanning 1 extents of 685 MB) - extracted
Name: odm (read-only, Linux Ext2/3/4/? Filesystem Image, @0x158300000 spanning 1 extents of 4 MB) - extracted
>>>>>>>>>>>
sudo ./otatools/bin/lpmake --metadata-size 65536 \
--super-name super \
--metadata-slots 2 \
--device super:6094323712 \
--group main:5535145984\
--partition odm:readonly:4349952:main \
--image odm=./odm.img \
--partition system:readonly:3624173568:main \
--image system=./system.img \
--partition vendor:readonly:718503936:main \
--image vendor=./vendor.img \
--partition product:readonly:1188118528:main \
--image product=./product.img \
--sparse \
--output ./super_new.img
>>>>>>>>>>
Code:
stat -c '%n %s' *.img
Code:
stat -c '%n %s' *.raw
odm.img 4349952
product.img 1188118528
vendor.img 718503936
super.raw 6094323712
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
CustomAP​For Samsung Mobile​>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>​ USE " LPUNPACK" with AB partition device.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Code:
./imjtool.ELF64 super.img extract
liblp dynamic partition (super.img) - Blocksize 0x1000, 3 slots
LP MD Header @0x3000, version 10.2, with 14 logical partitions on block device of 3584 GB, at partition super, first sector: 0x800
Partitions @0x3100 in 5 groups:
Group 0: default
Group 1: google_system_dynamic_partitions_a
Name: product_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x100000 spanning 1 extents and 290 MB) - extracted
Name: system_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x12400000 spanning 1 extents and 943 MB) - extracted
Name: system_ext_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x4ec00000 spanning 1 extents and 513 MB) - extracted
Group 2: google_system_dynamic_partitions_b
Name: product_b (read-only, empty) - extracted
Name: system_b (read-only, Linux Ext2/3/4/? Filesystem Image, @0x4d400000 spanning 1 extents and 23 MB) - extracted
Name: system_ext_b (read-only, empty) - extracted
Group 3: google_vendor_dynamic_partitions_a
Name: odm_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x6ee00000 spanning 1 extents and 772 KB) - extracted
Name: vendor_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x6ef00000 spanning 1 extents and 310 MB) - extracted
Name: vendor_dlkm_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x82600000 spanning 1 extents and 340 KB) - extracted
Name: odm_dlkm_a (read-only, Linux Ext2/3/4/? Filesystem Image, @0x82700000 spanning 1 extents and 340 KB) - extracted
Group 4: google_vendor_dynamic_partitions_b
Name: odm_b (read-only, empty) - extracted
Name: vendor_b (read-only, empty) - extracted
>>>>>>>>>>
# Get the size of all images
Code:
stat -c '%n %s' *.img
odm_a.img 790528
odm_b.img 0
odm_dlkm_a.img 348160
odm_dlkm_b.img 0
product_a.img 304930816
product_b.img 0
super.img 7516192768
system_a.img 1018732544
system_b.img 24203264
system_ext_a.img 537972736
system_ext_b.img 0
vendor_a.img 325787648
vendor_b.img 0
vendor_dlkm_a.img 348160
vendor_dlkm_b.img 0
>>>>>>>>>>
Code:
./bin/lpmake --metadata-size 65536\
--device-size=4294967296\
--metadata-slots=3\
--group=google_system_dynamic_partitions_a:2222931968\
--partition=odm_a:none:700416:google_system_dynamic_partitions_a\
--partition=product_a:none:266579968:google_system_dynamic_partitions_a\
--partition=system_a:none:1363767296:google_system_dynamic_partitions_a\
--partition=system_ext_a:none:359391232:google_system_dynamic_partitions_a\
--partition=vendor_a:none:232493056:google_system_dynamic_partitions_a\
--image=odm_a=./odm_a.img\
--image=product_a=./product_a.img\
--image=system_a=./system_a.img\
--image=system_ext_a=./system_ext_a.img\
--image=vendor_a=./vendor_a.img\
--group=google_system_dynamic_partitions_b:24563712\
--partition=odm_b:none:0:google_system_dynamic_partitions_b\
--partition=product_b:none:0:google_system_dynamic_partitions_b\
--partition=system_b:none:24563712:google_system_dynamic_partitions_b\
--partition=system_ext_b:none:0:google_system_dynamic_partitions_b\
--partition=vendor_b:none:0:google_system_dynamic_partitions_b\
--image=odm_b=./odm_b.img\
--image=product_b=./product_b.img\
--image=system_b=./system_b.img\
--image=system_ext_b=./system_ext_b.img\
--image=vendor_b=./vendor_b.img\
--sparse \
--output ./super.new.img
>>>>>>>>>>>>
Most information can be obtained from the previous imjtool. Some of the flags to take note of are:
--metadata-slots: same as imjtool’s output
--device-size: for most phones, 4GB should be enough (4*1024^3 = 4294967296 bytes). It’s okay to leave some extras
--group: format of <name>:<size>. The size should be the sum of all sub-partitions under the group
--partition: format of <name>:<attributes>:<size>[:group], attrs must be ’none’ or ‘readonly’.
--image: for each partition, specify a corresponding image file
Code:
stat -c '%n %s' *.img
odm_a.img 790528
odm_b.img 0
odm_dlkm_a.img 348160
odm_dlkm_b.img 0
product_a.img 304930816
product_b.img 0
super.img 7516192768
system_a.img 1018732544
system_b.img 24203264
system_ext_a.img 537972736
system_ext_b.img 0
vendor_a.img 325787648
vendor_b.img 0
vendor_dlkm_a.img 348160
vendor_dlkm_b.img 0
Code:
./bin/lpmake --metadata-size 65536\
--device-size=4294967296\
--metadata-slots=3\
--group=google_system_dynamic_partitions_a:2222931968\
--partition=odm_a:none:700416:google_system_dynamic_partitions_a\
--partition=product_a:none:266579968:google_system_dynamic_partitions_a\
--partition=system_a:none:1363767296:google_system_dynamic_partitions_a\
--partition=system_ext_a:none:359391232:google_system_dynamic_partitions_a\
--partition=vendor_a:none:232493056:google_system_dynamic_partitions_a\
--image=odm_a=./odm_a.img\
--image=product_a=./product_a.img\
--image=system_a=./system_a.img\
--image=system_ext_a=./system_ext_a.img\
--image=vendor_a=./vendor_a.img\
--group=google_system_dynamic_partitions_b:24563712\
--partition=odm_b:none:0:google_system_dynamic_partitions_b\
--partition=product_b:none:0:google_system_dynamic_partitions_b\
--partition=system_b:none:24563712:google_system_dynamic_partitions_b\
--partition=system_ext_b:none:0:google_system_dynamic_partitions_b\
--partition=vendor_b:none:0:google_system_dynamic_partitions_b\
--image=odm_b=./odm_b.img\
--image=product_b=./product_b.img\
--image=system_b=./system_b.img\
--image=system_ext_b=./system_ext_b.img\
--image=vendor_b=./vendor_b.img\
--sparse \
--output ./super.new.img

Part 3
Advanced CustomAP
Step by Step for changes mount Read Only To Read/Write.
*** the continue part of Step by Step CREATE CustomAP framework file for GSI Flashing with Odin.
​1.) Back to Stock Firmware.
It's still a good idea to flash stock firmware every now and then, because critical system components get updated and fixed, like the bootloader etc.
2.) If you used Stock A12, creates CustomAP (target GSI) and flash with Odin (include patched-Magisk of boot.img.lz4 and vbmeta.img.lz4)
BL slot: Stock BL
AP slot: CustomAP
CP slot: Stock CP
CSC Slot: Stock CSC
UserData slot: boot+vbmeta patched by Magisk.tar
After 1'st boot( Finished Flashing)
2.1 setup magisk v.24.3
(download additional some part) if not you can't uses magisk. And Reboot.
3.) If you used Stock A11
3.1 Stock A11 + TWRP
Flash GSI with TWRP' S Fastboot (with root)
* Your Computer must installed " Bootloader Driver " before. If not you
can't uses "Fastboot command"
Code:
Set of fastboot command.
adb reboot fastboot
>>>tab will auto reboot to "TWRP fastoot mode" (ignored black screen)
fastboot devices
>>>Output screen will show your tab S/n
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot erase system
fastboot flash system yourGSI.img
>>> ignored invalid spare 'system'...at header magic
>>> divided PE system image file into parts suitable for write to dynamic tab
>>> system partition.
fastboot -w
>>>This will also erase your internal storage.
fastboot reboot recovery
>>>>>>Booting to TWRP
from TWRP menu
wipe --->format data --->yes
reboot fastboot
fastboot flash boot boot.img
>>> boot.img was patched by magisk
fastboot reboot
3.2 Stock A11 + non TWRP 》 Back to (2)
4.) NOW Your tablet was running by GSI firmware.
4.1 Computer
download platform-tools and extract to C:\
4.2 Tablet
install Root File Manager. (Such as MiXplorer)
4.3 Connect your tablet with Computer
4.4 Use root file manager copy "systemrw_1.32" folder
from downloaded Archive to "/data/local/tmp"
4.5 Open CMD as Administrator and Run in folder
" C:/platform-tools"
Code:
adb shell
su
* check magisk supersu permission--given to Shell program or not
cd /data/local/tmp/systemrw_1.32
chmod +x ./systemrw.sh
./systemrw.sh size=15
[LIST]
[*]size=x *ONLY RECOMMENDED IF YOU'VE GOT SUPER PARTITION*
With this parameter you can specify the extra free space (in megabytes) that will be added to each partition. There is a limit as to how much extra free space you can add per partition. Check your lpdump.txt to find out the exact maximum extra size.
If omitted, default extra size is 0 (shrink to minimum)
[/LIST]
or for fix no
or
./systemrw.sh out=/mnt/media_rw/8644-7453/patch/super_fixed.bin size=200
**changes 8644-7453 with your
Output: Fail but got system.img
Spoiler: Output
Code:
Read only
--------------------------------------------------
| SystemRW v1.32 automated script by lebigmac |
| @xda ©2021 Big thank you to @Kolibass @Brepro1 |
|@munjeni @AndyYan @gabrielfrias @YOisuPU @bynarie |
| without your help this would not be possible! |
--------------------------------------------------
systemrw: Custom output detected: /mnt/media_rw/8644-7453/patch/super_fixed.bin
systemrw: Custom size detected: 15 MB
systemrw: Initiating procedure...
systemrw: Device is in Android mode. Ignoring
systemrw: Current device: samsung
systemrw: Current Android version: 14
systemrw: Current SELinux status: Enforcing
systemrw: Current slot is: 0
systemrw: Your super partition is located at: /dev/block/mmcblk0p45
systemrw: / is read-only
systemrw: /product is already R/W capable. Ignoring
systemrw: /vendor is already R/W capable. Ignoring
systemrw: Adjusting permissions...
systemrw: Attempting to disable dm-verity and verification...
verification is already disabled.
verity is already disabled.
systemrw: Dumping super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Please wait patiently...
11902976+0 records in
11902976+0 records out
6094323712 bytes (5.6 G) copied, 132.285471 s, 44 M/s
systemrw: Successfully dumped super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Unpacking embedded partitions from /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Nested partitions were successfully extracted from super
systemrw: Current size of system.img in bytes: 3090964480
systemrw: Current size of system.img in MB: 2947
systemrw: Current size of system.img in 512-byte sectors: 6037040
systemrw: 'shared_blocks feature' detected @ system.img
systemrw: Increasing filesystem size of system.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 943287 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 943287 (4k) blocks long.
systemrw: Removing 'shared_blocks feature' of system.img...
e2fsck 1.46.2 (28-Feb-2021)
systemrw: Read-only lock of system.img successfully removed
systemrw: Shrinking size of system.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 887293 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 887293 (4k) blocks long.
systemrw: Custom size of system.img in bytes: 3650080768
systemrw: Custom size of system.img in MB: 3480
systemrw: Custom size of system.img in 512-byte sectors: 7129064
systemrw: Increasing filesystem size of system.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 891133 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 891133 (4k) blocks long.
=================================================
systemrw: Current size of vendor.img in bytes: 641204224
systemrw: Current size of vendor.img in MB: 611
systemrw: Current size of vendor.img in 512-byte sectors: 1252352
systemrw: NO 'shared_blocks feature' detected @ vendor.img
systemrw: Shrinking size of vendor.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 151299 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 151299 (4k) blocks long.
systemrw: Custom size of vendor.img in bytes: 635449344
systemrw: Custom size of vendor.img in MB: 606
systemrw: Custom size of vendor.img in 512-byte sectors: 1241112
systemrw: Increasing filesystem size of vendor.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 155139 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 155139 (4k) blocks long.
=================================================
systemrw: Current size of product.img in bytes: 1091608576
systemrw: Current size of product.img in MB: 1041
systemrw: Current size of product.img in 512-byte sectors: 2132048
systemrw: NO 'shared_blocks feature' detected @ product.img
systemrw: Shrinking size of product.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product.img to 262240 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/product.img is now 262240 (4k) blocks long.
=================================================
systemrw: Joining all extracted images back into one single super image...
systemrw: Please wait and ignore the invalid sparse warnings...
Not enough space on device for partition product with size 1089863680
systemrw: Error! failed to create super_fixed.img file. Error code: 70
gta7lite:/data/local/tmp/systemrw_1.32 #
ignored " Error! failed to create super_fixed.img file. Error code: 70"
4.6 Final copy "/data/local/tmp/systemrw_1.32/img/system.img"
for making new CustomAP Or Flashing with Fastboot.
Note:​Note:1. if you want to fix not enough space Solved with changing size from 15 to 200
But I want only "new system.img" which removed shared_blocks.
Note:2. Examples.
[Close].Advanced-CustomAP
》Step by Step Tutorial for changes mount Read Only To Read/Write.《 Example in tutorial: (install PixelExperience_Plus Android 13 , Can install on A12 but not works) Slim has no Recorder (voice), Pixel Wallpapers, Pixel Live Wallpapers, Drive...
forum.xda-developers.com
Note:3 Fix: Not enough space on device for partition. xxxxx
C:\platform-tools>adb shell
gta7lite:/ $ su
gta7lite:/ # cd /data/local/tmp/systemrw_1.32
gta7lite:/data/local/tmp/systemrw_1.32 # chmod +x ./systemrw.sh
gta7lite:/data/local/tmp/systemrw_1.32 # ./systemrw.sh size=200
Spoiler: Output
--------------------------------------------------
| SystemRW v1.32 automated script by lebigmac |
| @xda ©2021 Big thank you to @Kolibass @Brepro1 |
|@munjeni @AndyYan @gabrielfrias @YOisuPU @bynarie |
| without your help this would not be possible! |
--------------------------------------------------
systemrw: Custom size detected: 200 MB
systemrw: Initiating procedure...
systemrw: Device is in Android mode. Ignoring
systemrw: Current device: samsung
systemrw: Current Android version: 14
systemrw: Current SELinux status: Enforcing
systemrw: Current slot is: 0
systemrw: Your super partition is located at: /dev/block/mmcblk0p45
systemrw: / is already R/W capable. Ignoring
systemrw: /product is already R/W capable. Ignoring
systemrw: /vendor is already R/W capable. Ignoring
systemrw: Adjusting permissions...
systemrw: Attempting to disable dm-verity and verification...
verification is already disabled.
Successfully disabled verity. Reboot the device for changes to take effect.
systemrw: Dumping super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Please wait patiently...
11902976+0 records in
11902976+0 records out
6094323712 bytes (5.6 G) copied, 129.945285 s, 45 M/s
systemrw: Successfully dumped super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Unpacking embedded partitions from /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Nested partitions were successfully extracted from super
systemrw: Current size of system.img in bytes: 2926604288
systemrw: Current size of system.img in MB: 2791
systemrw: Current size of system.img in 512-byte sectors: 5716024
systemrw: NO 'shared_blocks feature' detected @ system.img
systemrw: Shrinking size of system.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 714445 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 714445 (4k) blocks long.
systemrw: Custom size of system.img in bytes: 3136081920
systemrw: Custom size of system.img in MB: 2990
systemrw: Custom size of system.img in 512-byte sectors: 6125160
systemrw: Increasing filesystem size of system.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 765645 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 765645 (4k) blocks long.
=================================================
systemrw: Current size of vendor.img in bytes: 641204224
systemrw: Current size of vendor.img in MB: 611
systemrw: Current size of vendor.img in 512-byte sectors: 1252352
systemrw: NO 'shared_blocks feature' detected @ vendor.img
systemrw: Shrinking size of vendor.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 151307 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 151307 (4k) blocks long.
systemrw: Custom size of vendor.img in bytes: 829468672
systemrw: Custom size of vendor.img in MB: 791
systemrw: Custom size of vendor.img in 512-byte sectors: 1620056
systemrw: Increasing filesystem size of vendor.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 202507 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 202507 (4k) blocks long.
=================================================
systemrw: Current size of product.img in bytes: 1091608576
systemrw: Current size of product.img in MB: 1041
systemrw: Current size of product.img in 512-byte sectors: 2132048
systemrw: NO 'shared_blocks feature' detected @ product.img
systemrw: Shrinking size of product.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product.img to 262240 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/product.img is now 262240 (4k) blocks long.
systemrw: Custom size of product.img in bytes: 1283850240
systemrw: Custom size of product.img in MB: 1224
systemrw: Custom size of product.img in 512-byte sectors: 2507520
systemrw: Increasing filesystem size of product.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product.img to 313440 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/product.img is now 313440 (4k) blocks long.
=================================================
systemrw: Joining all extracted images back into one single super image...
systemrw: Please wait and ignore the invalid sparse warnings...
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
systemrw: Successfully created patched super image @
systemrw: /data/local/tmp/systemrw_1.32/img/super_fixed.bin
systemrw: Congratulations! Your image(s) should now have R/W capability
systemrw: Please reboot into bootloader and flash the file(s) manually
gta7lite:/data/local/tmp/systemrw_1.32 #
✓ Final we got "/data/local/tmp/systemrw_1.32/img/super_fixed.bin and super_original.bin
✓ Change super_fixed.bin to super_new.img
> fastboot flash super super_new.img ( new r/w GSI overwritten read only)
CustomAP
9) Compress the repacked super_new.img
Code:
lz4 -B6 --content-size super_new.img super_new.img.lz4
Then. Read Part1 tutorial.
If you want only system.img
> sudo simg2img super_new.img super.raw
> ./imjtool super.raw extract
Resources:​
1. https://forum.xda-developers.com/t/...-superrw-featuring-makerw-read-write.4247311/
2.
TWRP FOR Android 11 Device SM-T22x​No touch supported.
Used only (TWRP 's Fastboot)Mode.
​
Spoiler: Detail
》》FIRST TIME INSTALLATION
Howto install TWRP For SM-T22x
# Patch Samsung AP Firmware via Magisk v24.0 ( patched entire AP file)
1. Install Magisk.apk on your device SM-T22x with select no update checking, and transferred AP_xxx.tar.md5 from computer to your tab.
2. Patch Samsung AP Firmware via Magisk Manager.
( Once done, the newly created magisk_patched.tar file will be present under the
Downloads folder on your device.)
3. you may now transfer this patched TAR file to the folder on your PC where other extracted firmware files (AP, BL, CP, CSC, and HOME_CSC) are present.
4. FLASH it with ODin as usual by used magisk_patched.tar file at AP slot .
5. REBOOT SYSTEM Quick SETUP < NO NEED INTERNET>
6. Power Off and press Volum up +Volumn down + USB for boot into Download mode
7. FLASH TWRP.tar from https://github.com/DevZillion/android_device_samsung_gta7lite/releases at "AP slot"
But this time set Odin option NO Auto- REBOOT, yes do it yourself with key press ( power + volumn up).
## if you can't use keypress but reboot to the system , you can use cmd " adb reboot recovery "
When had access to twrp menu
Go to Advanced > Terminal and type "multidisabler" (without quotes", then data wipe.
Now reboot into system, after completing first setup of the device reboot into TWRP again to see if you can see the contents of your Internal Storage, you should, if yes you have successfully disabled Samsung encryption of internal storage.
NOTE: If you wish to install TWRP without rooting, there are numerous pitfalls to consider. For example, a stock device is protected by Android Verified Boot. This is implemented as a vbmeta partition that contains cryptographic digests for verifying the integrity of boot.img, recovery.img and other partitions/images. Flashing TWRP without first flashing a vbmeta image with verity disabled will render your device unable to boot.
Note:4
very important bootloader driver for fastboot of the twrp.
Android Bootloader Interface Drivers are needed for your PC to identify the device connected in Fastboot Mode and hence execute the desired Fastboot Commands.
Automatic MediaTek USB VCOM Drivers: MTK_Driver_Auto_Installer_EXE_v5.1632.00
Download:
https://androidfilehost.com/?fid=14943124697586345377
If not works.
How to Install Fastboot Drivers in Windows 11
In this comprehensive tutorial, we will show you the detailed steps to install the Fastboot Drivers onto your Windows 11 PC
www.droidwin.com
Download: https://androidfilehost.com/?fid=7161016148664850715

tom.android said:
Reserved3. RCCOMMEND NEW GSI
Miku UI Snowland 0.70 PHH GSI v415 AOSP-base , For Gamer.
Support exFat , Hotspot , Bluetooth, Nearby share
Download :https://github.com/xiaoleGun/treble_build_miku/releases
Click to expand...
Click to collapse
It's hard to play games at night without rom livedisplay

you should try this :https://pan.xiaolegun.cn/GSI/Phh-Treble/exTHmUI/Android-12-Dev

Xxxx

tom.android said:
View attachment 5669853
Click to expand...
Click to collapse
But it's still a good gaming rom

Xxxx

tom.android said:
Screen flashing. Can't used anymore.
Same as v415 new version here. But all bug fixed.
View attachment 5669951
Click to expand...
Click to collapse
Thanks for letting me know that rom doesn't work

Ok in the end I just disabled samsung's encryption and full touch for Twrp

I don't quite understand I just flashed twrp from odin
it's not as messy as you say and it still works

Can I use adb to backup data on this rom and restore it on another rom?

Xxxx

tom.android said:
No use TWRP backup only
Click to expand...
Click to collapse
Twrp has not backed up yet

Xxxxxx

Xxxx

Xxxx

Xxxx

Related

[U] [GB+JB] Repartitioning guide

Thanks to @munjeni for tipping me off in the right direction and to @judas1977 + @Tesla-MADAL93 for having done this on the Ace 2 I come from ~~
Everything else in this post applies to Gingerbread, scroll down to the 5th message for a more clear guide centered around a 4.1.2 ROM.
This is my annotated diary about the last 2 hours, I'm sorry if the story feels a little bit Dadaist but I don't want to encourage people who don't feel ready to try it, so please read all of it first and if anything is unclear ask instead of doing!!
I installed Busybox 1.22.1 (iirc) and replaced the default shell with bash (install Bash-X from market, copy /S/xbin/bash over /S/bin/sh, remove app if you like to). All of this was done with Gingerbread .188 and CWM 5.5.0.4 from Supercharged kernel.
Original partition table, with names added:
[email protected]:~$ adb shell
Code:
sh-4.2# fdisk -u -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7944 MB, 7944011776 bytes
4 heads, 16 sectors/track, 242432 cylinders, total 15515648 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 2047 1023+ 0 Empty #### TA ("Trim Area") IMEI, BL UNLOCK, SIMLOCK ETC -- DO NOT TOUCH
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 2304 3327 512 f0 Linux/PA-RISC boot #### SBL? Mem-init? Power management? PARAM?
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 2048 2303 128 f0 Linux/PA-RISC boot #### unknown, as above
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 3328 15269887 7633280 5 Extended #### GROUPS ALL FOLLOWING PARTITIONS FOR THEM TO FIT INTO THE 4-PARTS MBR SCHEME
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 4096 20479 8192 4a Unknown #### another of the 4 unclear partitions
/dev/block/mmcblk0p6 20480 26623 3072 83 Linux #### MODEMFS (Samsung's "EFS") RADIO CALIBRATION
/dev/block/mmcblk0p7 26624 36863 5120 70 Unknown #### no idea either
/dev/block/mmcblk0p8 36864 53247 8192 83 Linux #### IDD (apparently related to usage stats reporting)
/dev/block/mmcblk0p9 53248 86015 16384 48 Unknown #### KERNEL
/dev/block/mmcblk0p10 118784 2215935 1048576 83 Linux #### SYSTEM
/dev/block/mmcblk0p11 2727936 6922239 2097152 83 Linux #### DATAFS
/dev/block/mmcblk0p12 2215936 2727935 256000 83 Linux #### CACHEFS
/dev/block/mmcblk0p13 86016 118783 16384 48 Unknown #### FOTAKERNEL?
/dev/block/mmcblk0p14 6922240 15269887 4173824 c Win95 FAT32 (LBA) #### SDCARD/EMMC/UMS
Partition table entries are not in disk order
so let's rearrange this list for easier thinking & reading
Code:
/dev/block/mmcblk0p1 1 2047 1023+ TA
/dev/block/mmcblk0p3 2048 2303 128 ?
/dev/block/mmcblk0p2 2304 3327 512 ?
/dev/block/mmcblk0p5 4096 20479 8192 ?
/dev/block/mmcblk0p6 20480 26623 3072 MODEMFS
/dev/block/mmcblk0p7 26624 36863 5120 ?
/dev/block/mmcblk0p8 36864 53247 8192 IDD
/dev/block/mmcblk0p9 53248 86015 16384 KERNEL
/dev/block/mmcblk0p13 86016 118783 16384 FOTAKERNEL?
/dev/block/mmcblk0p10 118784 2215935 1048576 SYSTEM
/dev/block/mmcblk0p12 2215936 2727935 256000 CACHEFS
/dev/block/mmcblk0p11 2727936 6922239 2097152 DATAFS
/dev/block/mmcblk0p14 6922240 15269887 4173824 SDCARD
great, the important (for us) stuff is contiguous so we can delete those partitions and recreate them
(if fdisk works like parted we must do that in numerical order, so system>data>cache>ums)
we must delete and recreate partition 13 with the same sizes
OTOH fdisk lets us experiment without saving in real time (!!!) but let's do this in recovery mode
Let's research the sizes we want first -- I find Link2SD's graphical df the best way to do this (see photo 1)
so 540 MB for /system should be enough (I have 454M used, account a safety margin as I integrate updates + FS overhead + 1000 vs 1024 units)
4,14 MB used on /cache... 7,8 MB should be more than enough (same size I used on my Ace 2 which had about 5 MB used there)
this large size is for dalvik cache on ROMs that store it there (vm.dalvik.dexopt-data-only=0 and vm.dalvik.dexopt-cache-only=1 or something)
494 MB on /data, but I'd probably want to change apps and stuff... let's try with 1,25 GB
but if we remove /system we'll have to reflash the rom from a zip, which I'd need to make...
let's leave that partition alone for this first time
reboot now
Click to expand...
Click to collapse
Launching fdisk:
#### SONY
#### SONY (red green blue lightbar)
#### + button
#### CWM-based recovery v5.5.0.4
[email protected]:~$ adb shell
- exec '/system/bin/sh' failed: No such file or directory (2) -
#### No shell in ramdisk? Very lame...
#### [Mounts and storage]
#### [Mount /system, unmount everything else]
[email protected]:~$ adb shell
sh-4.2# fdisk -u /dev/block/mmcblk0
Command (m for help):
What I did in fdisk:
u #### change units to sectors
d #### delete
14
d
13
d
12
d
11
c #### disable cylinder rounding
n #### new
l #### logical partition
First sector (3334-15269887, default 3334): 2215936
Sector 2215936 is already allocated #### Apparently this version of fdisk makes you waste a sector...
First sector (2215937-15269887, default 2215937): Using default value 2215937
Last sector or +size or +sizeM or +sizeK (2215937-15269887, default 15269887): +1600M
#### CACHEFS:
n
l
First sector (3334-15269887, default 3334): 5340938
Sector 5340938 is already allocated
First sector (5340939-15269887, default 5340939): Using default value 5340939
Last sector or +size or +sizeM or +sizeK (5340939-15269887, default 15269887): +8M
#### FOTAKERNEL
n
l
First sector (3334-15269887, default 3334): 86016
Sector 86016 is already allocated
First sector (86017-15269887, default 86017): Using default value 86017
Last sector or +size or +sizeM or +sizeK (86017-118783, default 118783): Using default value 118783
t
Partition number (1-14): 13
Hex code (type L to list codes): 48
Changed system type of partition 13 to 48 (Unknown)
#### USB STORAGE
n
l
First sector (3334-15269887, default 3334): 5356564
Sector 5356564 is already allocated
First sector (5356566-15269887, default 5356566): Using default value 5356566
Last sector or +size or +sizeM or +sizeK (5356566-15269887, default 15269887): Using default value 15269887
c
Partition number (1-14): 14
Hex code (type L to list codes): c
Changed system type of partition 14 to c (W95 FAT32 LBA)
w
The partition table has been altered.
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy
sh-4.2# reboot
Now enter CWM again and factory reset -- you'll get an error as it can't delete /sdcard/.android_secure as it's unformatted
(and for that matter this CWM can't format /sdcard either...)
No problem apart from skipped heartbeats, boot into Android and format it from the settings! (see photo 2)
Well, the last screenshot speaks for itself... but I'll repeat, don't try this at home! (Have a friend try it so you'll have someone to blame if it gets bricked)
Very interesting... It causes problems?
Inviato dal mio ST25i utilizzando Tapatalk
ale467 said:
Very interesting... It causes problems?
Click to expand...
Click to collapse
Unlike my example, you must have over 50M free on /cache (at least in Gingerbread) or cheat by bind-mounting it somewhere else... or give up on directly installing stuff from the market
I tried bind mounting /cache to /data/local/tmp/cache but Google Play is still broken, so I guess you'll want a 57M partition there...
Also, you can always return to stock layout by flashing a full ROM in green light download mode, then wiping /sdcard from settings
I'm going to update this for 4.1, it's even somewhat easier and more predictable
----------------
1: think of the rough partition sizes
Code:
system (350M)
data (1,5G)
cache (280M) ## keep in mind whether ROM uses this for dalvik-cache and at least in 2.x Google Play downloads there
sdcard (remaining space)
2: make sure you have some files ready
→ROM in recovery zip format
→Backup of everything you want
→Kernel with fdisk in ramdisk
→ADB known working in recovery and normal mode
→Fixed busybox (http://forum.xda-developers.com/attachment.php?attachmentid=1057725&d=1336884034)
3: enter recovery and dump partition table (adb shell, fdisk /dev/block/mmcblk0, p)
Unlike my previous experiment, I'll calculate sizes in cylinders -- harder but fdisk appears to work better that way
Code:
Disk /dev/block/mmcblk0: 7944 MB, 7944011776 bytes
4 heads, 16 sectors/track, 242432 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
[...]
/dev/block/mmcblk0p10 1857 34624 1048576 83 Linux #SYSTEM
/dev/block/mmcblk0p11 42625 108160 2097152 83 Linux #DATAFS
/dev/block/mmcblk0p12 34625 42624 256000 83 Linux #CACHEFS
/dev/block/mmcblk0p13 1345 1856 16384 48 Unknown #FOTAKERNEL, move this on another line if it helps you think better but put it back there after calculations
/dev/block/mmcblk0p14 108161 238592 4173824 c Win95 FAT32 #UMS
so our work area starts at cylinder 1857 and ends at 238592!
4: calculate partition sizes (I'll only list start & end cylinders for clarity)
Code:
/dev/block/mmcblk0p10 1857 12538 << 1857 + (350000000÷32768)
/dev/block/mmcblk0p11 12538+1 >> 12539 58315 << 12539+(1500000000÷32768)
/dev/block/mmcblk0p12 58315+1 >> 58316 66861 << 58316 +(280000000÷32768)
/dev/block/mmcblk0p13 1345 1856
/dev/block/mmcblk0p14 66861+1 >> 66862 238592
5: remove partitions (d, 14, d, 13, ..., 10)
6: create partitions (n, l, 1857, 12538, repeat for next row)
7: retype partitions (t, 13, 48, t, 14, c)
8: save changes (w, reboot) - enter recovery again, you should get 5 "E: Can't {mount|open} /cache/[...]" lines
9: go to mounts and storage and run all 4 formats, sdcard will probably fail -- if it doesn't skip to step 13
10: install fixed busybox (adb push '/home/riki/Desktop/busybox' /cache/)
11: enter adb shell, make it executable (chmod +x /cache/busybox)
12: format media partition (/cache/busybox mkfs.vfat /dev/block/mmcblk0p14)
13: quit shell, mount /sdcard in CWM
14: adb push your ROM to /sdcard, install it and reboot!
This is so interesting, I've being doing this on a Samsung Galaxy SCL to fix it as its internal storage and /data partition were totally corrupted. I used parted instead of fdisk to repartition the external SD and edit then kernel's RAM disk to make it mount /data in one of the new partitions. Because of this that I've been doing lately, I'm thinking of using fdisk in my Xperia U too to have more available space in internal SD, that would be great, as I use dual boot feature.
I think I'll do this when I'm be fed up of Jelly Bean being the main ROM and KitKat just the secondary one.
By the way, I think it can be possible to leave enough free space before mmcblk0p14 to create my secondary ROM's partitions there (mmcblk0p15 for /system, mmcblk0p16 for /data and mmcblk0p17 for /cache) instead of creating system.ext4, data.ext4 and cache.ext4 inside my internal SD and mounting them in loop devices... What do you think? Could I brick my phone doing that? I've asked here too just in case.
The only thing I'd have to do is to format my mmcblk0p15 using mke2fs to set the same UUID as in mmcblk0p10 just if my secondary ROM doesn't boot (but I think this wouldn't be necessary):
Code:
mke2fs -T ext4 -O has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize -U [COLOR="Silver"][mmcblk0p10's UUID][/COLOR] -I 256 /dev/block/mmcblk0p15
You've explained this how-to so well, @Ryccardo! Thanks for this tutorial.
Many, many thanks to you, sir!
Thanks to you i was able to increase data partition on my P (similar partition scheme to U).
Other tutorials weren't so useful than yours and i was searching quite a lot. Thank you, live in wealth!

Dump stock rom & build flashable image

For those who wants to know and learn how:
Requirements.
Preparation.
Collecting Information.
Dumping.
Build Up Flashable Image.
Click to expand...
Click to collapse
​
CREDITS
I do not want to take any credit for this as it is not my work, I just have forked it from http://www.freaktab.com.
You can check the original post here
I just have simplified it.
Requirements
Requirements :​
USB Drivers Of your device installed
ADB ( Android Debugging Bridge)
romdump_v82b.zip (Android ROM dumper by Sebastian404)
Micro-USB-cable
microSD-card OR USB-Stick
Newer busybox
Click to expand...
Click to collapse
Code:
[B]* If you don't want to work with microSD-card OR USB-Stick you can use:
ADB push <from-PC-file> <to-android-file>
ADB pull <from-android-file> <to-PC-file>
(don't forget the pathes)
[/B]
Preparations
Preparations​
Setup android
Settings -> [DEVICE] USB -> Enable Connect to PC
Settings -> [PERSONAL] Security -> Enable Unknown Sources
Settings -> [SYSTEM] Developer options -> Enable USB debugging
Click to expand...
Click to collapse
Install USB-Driver
Conect Your device With computer
open device manager
right click on not recognized device
click update driver.
Click to expand...
Click to collapse
Format SD Card
copy romdump form romdump_v82b.zip to the microSD-card
make directory "rompump.out" and "dd.out"
Remove it "secure" from PC
put it into your device
Click to expand...
Click to collapse
Collecting Information
1. Starting shell via ADB
Browse to the folder where adb files are places
E.G. I have My adb files in adb folder in C: drive
Code:
cd\
cd adb
Code:
C:\adb>
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
0123456789ABCDEF device
C:\adb>adb shell
Code:
[email protected]:/ #
=> this seems to be the ideal, because it's root (SU), if you don't have the # you have to try to type su
Confirm the correct user:
[email protected]:/ # id
Code:
uid=0(root) gid=0(root)
OR
[email protected]:/ # echo $USER
Code:
root
You can find your microSD-card under the directory "/mnt"
[email protected]:/ # cd /mnt
[email protected]:/mnt # ls
Code:
asec
external_sd
obb
sdcard
secure
shell
usb_storage
[email protected]:/mnt # cd external_sd
[email protected]:/mnt/external_sd # ls
Code:
LOST.DIR
dd.out
romdump
romdump.out
for the correct busybox release
[email protected]: # cat /proc/cpuinfo
Code:
Processor : ARMv7 Processor rev 0 (v7l)
:
After you have via PC download the newer busybox (I give it the name "busybox-armv7l_1.21.1") and put it to your microSD-card, then you have to copy it to your device
[email protected]:/ # cp /mnt/external_sd/busybox-armv7l_1.21.1 /data/busybox-armv7l_1.21.1
Destination MUST BE "/data/", otherwise it isn't executable...
[email protected]: # cat /proc/mtd
Code:
dev: size erasesize name
mtd0: 00400000 00004000 "misc"
mtd1: 01000000 00004000 "kernel"
mtd2: 01000000 00004000 "boot"
mtd3: 01000000 00004000 "recovery"
mtd4: 18000000 00004000 "backup"
mtd5: 08000000 00004000 "cache"
mtd6: 80000000 00004000 "userdata"
mtd7: 00400000 00004000 "kpanic"
mtd8: 20000000 00004000 "system"
mtd9: 113400000 00004000 "user"
[email protected]: # cat /proc/partitions
Code:
major minor #blocks name
31 0 4096 mtdblock0
31 1 16384 mtdblock1
31 2 16384 mtdblock2
31 3 16384 mtdblock3
31 4 393216 mtdblock4
31 5 131072 mtdblock5
31 6 2097152 mtdblock6
31 7 4096 mtdblock7
31 8 524288 mtdblock8
31 9 4509696 mtdblock9
179 0 3941376 mmcblk0
179 1 3941344 mmcblk0p1
[email protected]:/ # ls -al /dev/block
Code:
brw------- root root 7, 0 2013-10-27 15:39 loop0
brw------- root root 7, 1 2013-10-27 15:39 loop1
brw------- root root 7, 2 2013-10-27 15:39 loop2
brw------- root root 7, 3 2013-10-27 15:39 loop3
brw------- root root 7, 4 2013-10-27 15:39 loop4
brw------- root root 7, 5 2013-10-27 15:39 loop5
brw------- root root 7, 6 2013-10-27 15:39 loop6
brw------- root root 7, 7 2013-10-27 15:39 loop7
brw------- root root 179, 0 2013-10-27 16:29 mmcblk0
brw------- root root 179, 1 2013-10-27 16:29 mmcblk0p1
drwxr-xr-x root root 2013-10-27 15:39 mtd
brw------- root root 31, 0 2013-10-27 15:39 mtdblock0
brw------- root root 31, 1 2013-10-27 15:39 mtdblock1
brw------- root root 31, 2 2013-10-27 15:39 mtdblock2
brw------- root root 31, 3 2013-10-27 15:39 mtdblock3
brw------- root root 31, 4 2013-10-27 15:39 mtdblock4
brw------- root root 31, 5 2013-10-27 15:39 mtdblock5
brw------- root root 31, 6 2013-10-27 15:39 mtdblock6
brw------- root root 31, 7 2013-10-27 15:39 mtdblock7
brw------- root root 31, 8 2013-10-27 15:39 mtdblock8
brw------- root root 31, 9 2013-10-27 15:39 mtdblock9
drwxr-xr-x root root 2013-10-27 15:39 platform
drwx------ root root 2013-10-27 15:39 vold
[email protected]:/ # ls -al /dev/block/mtd/by-name
Code:
lrwxrwxrwx root root 2013-10-27 15:39 backup -> /dev/block/mtdblock4
lrwxrwxrwx root root 2013-10-27 15:39 boot -> /dev/block/mtdblock2
lrwxrwxrwx root root 2013-10-27 15:39 cache -> /dev/block/mtdblock5
lrwxrwxrwx root root 2013-10-27 15:39 kernel -> /dev/block/mtdblock1
lrwxrwxrwx root root 2013-10-27 15:39 kpanic -> /dev/block/mtdblock7
lrwxrwxrwx root root 2013-10-27 15:39 misc -> /dev/block/mtdblock0
lrwxrwxrwx root root 2013-10-27 15:39 recovery -> /dev/block/mtdblock3
lrwxrwxrwx root root 2013-10-27 15:39 system -> /dev/block/mtdblock8
lrwxrwxrwx root root 2013-10-27 15:39 user -> /dev/block/mtdblock9
lrwxrwxrwx root root 2013-10-27 15:39 userdata -> /dev/block/mtdblock6
[email protected]:/dev # /data/busybox-armv7l_1.21.1 blkid
Code:
/dev/block/mmcblk0p1: UUID="04A7-463C"
/dev/block/vold/31:9: UUID="8269-1ED1"
/dev/block/vold/179:1: UUID="04A7-463C"
/dev/block/mtdblock9: UUID="8269-1ED1"
/dev/block/mtdblock8: LABEL="system" UUID="06bc9880-9e07-4dec-ae8d-1e59a1b88921"
/dev/block/mtdblock6: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b"
/dev/block/mtdblock5: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b"
DUMPING
Dumping ROM​
Dumping (at adb shell)
1.) via dd:
dd if=/dev/block/mtdblock0 of=/mnt/external_sd/dd.out/misc.img
Code:
8192+0 records in
8192+0 records out
4194304 bytes transferred in 0.677 secs (6195426 bytes/sec)
dd if=/dev/block/mtdblock1 of=/mnt/external_sd/dd.out/kernel.img
Code:
32768+0 records in
32768+0 records out
16777216 bytes transferred in 1.734 secs (9675441 bytes/sec)
dd if=/dev/block/mtdblock2 of=/mnt/external_sd/dd.out/boot.img
Code:
32768+0 records in
32768+0 records out
16777216 bytes transferred in 2.665 secs (6295390 bytes/sec)
dd if=/dev/block/mtdblock3 of=/mnt/external_sd/dd.out/recovery.img
Code:
32768+0 records in
32768+0 records out
16777216 bytes transferred in 1.340 secs (12520310 bytes/sec)
dd if=/dev/block/mtdblock4 of=/mnt/external_sd/dd.out/backup.img
Code:
786432+0 records in
786432+0 records out
402653184 bytes transferred in 69.198 secs (5818855 bytes/sec)
dd if=/dev/block/mtdblock8 of=/mnt/external_sd/dd.out/system.img
Code:
1048576+0 records in
1048576+0 records out
536870912 bytes transferred in 57.050 secs (9410533 bytes/sec)
/data/busybox-armv7l_1.21.1 ls -ltr /mnt/external_sd/dd.out/
Code:
-rwxrwxr-x 1 1000 1015 4194304 Oct 27 21:09 misc.img
-rwxrwxr-x 1 1000 1015 16777216 Oct 27 21:12 kernel.img
-rwxrwxr-x 1 1000 1015 16777216 Oct 27 21:14 boot.img
-rwxrwxr-x 1 1000 1015 16777216 Oct 27 21:15 recovery.img
-rwxrwxr-x 1 1000 1015 402653184 Oct 27 21:17 backup.img
-rwxrwxr-x 1 1000 1015 536870912 Oct 27 21:27 system.img
?not really need?
Code:
dd if=/dev/block/mtdblock5 of=/mnt/external_sd/dd.out/cache.img
dd if=/dev/block/mtdblock6 of=/mnt/external_sd/dd.out/userdata.img
dd if=/dev/block/mtdblock7 of=/mnt/external_sd/dd.out/kpanic.img
dd if=/dev/block/mtdblock9 of=/mnt/external_sd/dd.out/user.img
2.) via "romdump":
cp /mnt/external_sd/romdump /data/romdump
/data/romdump
Code:
Android ROM dumper v0.82b
(c)2011 Sebastian404
Device : rk31sdk-eng 4.2.2 JDQ39 eng.linking.20130709.184313 test-keys
Creating required files... done.
Opening mtd table... done.
Dumping kernel config... sh: cat: /proc/config.gz: No such file or directory
done.
Dumping boot partition... done.
Dumping recovery partition... done.
Dumping system partition... done.
Creating Checksums... done.
Cleaning up... done.
All done.
ls -al /sdcard/romdump
Code:
-rwxrwxr-x system sdcard_rw 16777216 2013-10-27 22:46 boot.img
-rwxrwxr-x system sdcard_rw 275 2013-10-27 22:48 checksum.md5
-rwxrwxr-x system sdcard_rw 0 2013-10-27 22:46 config.gz
-rwxrwxr-x system sdcard_rw 16777216 2013-10-27 22:46 recovery.img
-rwxrwxr-x system sdcard_rw 1507 2013-10-27 22:46 system.info.gz
-rwxrwxr-x system sdcard_rw 373034496 2013-10-27 22:48 system.tar
cp /sdcard/romdump/boot.img /mnt/external_sd/romdump.out/boot.img
cp /sdcard/romdump/checksum.md5 /mnt/external_sd/romdump.out/checksum.md5
cp /sdcard/romdump/config.gz /mnt/external_sd/romdump.out/config.gz
cp /sdcard/romdump/recovery.img /mnt/external_sd/romdump.out/recovery.img
cp /sdcard/romdump/system.info.gz /mnt/external_sd/romdump.out/system.info.gz
cp /sdcard/romdump/system.tar /mnt/external_sd/romdump.out/system.tar
ls -al /mnt/external_sd/romdump.out
Code:
-rwxrwxr-x system sdcard_rw 16777216 2013-10-27 23:15 boot.img
-rwxrwxr-x system sdcard_rw 275 2013-10-27 23:15 checksum.md5
-rwxrwxr-x system sdcard_rw 0 2013-10-27 23:15 config.gz
-rwxrwxr-x system sdcard_rw 16777216 2013-10-27 23:15 recovery.img
-rwxrwxr-x system sdcard_rw 1507 2013-10-27 23:15 system.info.gz
-rwxrwxr-x system sdcard_rw 373034496 2013-10-27 23:16 system.tar
Build Up Flashable Image
Build Up Flashable Image​
WinHex or any other Hex-Editor who can work with large files
Rk29xx ImageTools V2.1 by wendal (I download it here at 4. (it's without "su" and "Superuser.apk"))
(Alternatively you can use RK3xxx Firmware Tools by SergioPoverony)
First check the "dd.out/backup.img" with a HexEditor to determine whether there is information in it (first 4 characters "RKAF") or only zeros (HEX "FF") what means it is empty...
If there is this information in it, you will perhaps* have the complete ROM in it, which will include the loader and parameter files and you can use "wendal tools" to extract it...
1. Put the "backup.img" into the wendal tools directory and rename it to "wendal.img"
2. Start the "Runme.bat",
2a. Select 1 + return
2b. then any key
2c. and then you have to wait.
Code:
D:\RK3066_IMG_Mod_Tool>lua rk29xx_rom_tools_tnt.lua
RK29xx Image Pack/Unpack Tools
Blog http://wendal.net
Project: https://github.com/wendal/teclast_tools
feedback: [email protected]
Pls input: 1-Unpack 2-Pack 3-Exit
1
Pls copy Image file into this folder,and rename to wendal.img
Notify any errors!
Drücken Sie eine beliebige Taste . . .
Reading file header...
File header: RKFWf
Read loader's offset
Read loader's len
Read update.img's offset
Read update.img's len
Output Loader
offset(0x66) len(0x2F8AE)
Output updata.img
offset(0x2F914) len(0x1973A804)
Unpack updata.img to Temp folder
Check file... OK
------- UNPACK ------
package-file 0x00000800 0x00000241
RK3188Loader(L)_V1.20.bin 0x00001000 0x0002F96E
parameter 0x00031000 0x00000266
Image/misc.img 0x00031800 0x0000C000
Image/kernel.img 0x0003D800 0x00846034
Image/boot.img 0x00884000 0x000FE6F1
Image/recovery.img 0x00982800 0x00B18000
Image/system.img 0x0149A800 0x16E09800
backupimage/backup.img 0x182A4000 0x01495004
update-script 0x19739800 0x000003A5
recover-script 0x1973A000 0x0000010A
Unpack firmware OK!
------ OK ------
Unpack -- All Done
Pls input: 1-Unpack 2-Pack 3-Exit
Amazing work,you should add your name at TWRP which you compiled.
Well,hats off bro.
Steps for MMC based devices
Thanks for the info. Don't know why it hadn't occur to me to use dd for taking the image.
This works great for MTD based devices but does nothing for MMC based devices.
Never fear, I found the answer in an old post from lavero.burgos on repartitioning a Nook tablet.
Turns out if you use the parted from the CM team you can acquire the partition information you need.
Here is a shorthand of the previous instructions as they apply to MMC devices:
Req:
USB Drivers for your device
ADB installed and in your path
Appropriately sized USB cable for your device
microSD card
GNU parted
a rooted device
Prep:
make directory "firmware-img" on SD Card
make directory "tools" on SD Card
copy parted to tools directory on SD Card
Remove SD Card safely from PC
put SD Card into rooted device
Collect Info:
Run the commands below (one per line)
adb shell
su (if not already root user)
cp /mnt/<sd card mount point>/tools/parted /system/bin
cat /proc/partitions
parted /dev/block/mmcblk0
print
make note of the partition number and name for the partitions you wish to dump​
quit
Dumping ROM:
Run dd as defined below each partition you wan to dump, the <partition path> will be /dev/block/mmcblk0p<partition number>.
dd if=<partition path> of=/mnt/<sd card mount point>/firmware-img/<partition name>.img
---------- Post added at 02:36 PM ---------- Previous post was at 02:21 PM ----------
I hope this helps. I'm by no means an expert on this type of thing, so if you have additions or corrections, plz feel free. I've been watching learning and gathering, now I have a chance to give back.
I've gotten this to work on Nook tablet, Atrix HD and gonna test it on my Xoom in the next few days.
I dont know much about the MMC based devices .. As I onLy Have used Mediatek devices so far, btw thanx for the information
When I tried to do cat proc/mtd I got this error
Code:
1|[email protected]:/ # cat /proc/mtd
cat /proc/mtd
sh: cat: /proc/mtd: No such file or directory
1|[email protected]:/ #
i have a question please help me if you can
i didnt find the cat /proc/mtd is working because the mtd is not found in proc so after search i used proc/mount with link
i got the system file only but i didn't got the recovery or boot
i need another way to get it to build CWM
my device is totally new and support for it at all because it is BCM 21663 broadom
i have dual core Arm 7
512 ram
8g storage
1024*600
2 sim 3g tablet
any other CWM may works? or firmware refer to this specs??
ANY EXPERT THERE???
Thank you very much for the post, it was very helpful! It's a good complement to this post:
http://forum.xda-developers.com/showthread.php?t=2450045
modify download directory
Hi. I have a problem with my lenovo A526, whenever I want to download, it says "modify thedownload directory of the ". How can I do that? Can someone help me please? Thank you.
Ruscelle23 said:
Hi. I have a problem with my lenovo A526, whenever I want to download, it says "modify thedownload directory of the ". How can I do that? Can someone help me please? Thank you.
Click to expand...
Click to collapse
Try Using any other browser like opera or UC and choose custom directory before downloading a file. Ruscelle23
hssrgh said:
i have a question please help me if you can
i didnt find the cat /proc/mtd is working because the mtd is not found in proc so after search i used proc/mount with link
i got the system file only but i didn't got the recovery or boot
i need another way to get it to build CWM
my device is totally new and support for it at all because it is BCM 21663 broadom
i have dual core Arm 7
512 ram
8g storage
1024*600
2 sim 3g tablet
any other CWM may works? or firmware refer to this specs??
ANY EXPERT THERE???
Click to expand...
Click to collapse
Use cat /proc/emmc
The original link for romdump doesn't work, so here is an alternative one.
romdump_v82b.zip | by bhiga for Generic Device/Other
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
androidfilehost.com
codenation said:
The original link for romdump doesn't work, so here is an alternative one.
romdump_v82b.zip | by bhiga for Generic Device/Other
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
androidfilehost.com
Click to expand...
Click to collapse
Thanks a lot for that.

Can't edit cache.img file using simg2img and img2simg

I tried on both windows and ubuntu.
First I try to flash the original cache.img
Code:
heimdall flash --CACHE cache.img
Works, no errors and everything goes fine. Now when I do...
Code:
>file cache.img
cache.img: Android sparse image, version: 1.0, Total of 16384 4096-byte output blocks in 14 input chunks.
>simg2img cache.img cache.raw
>img2simg cache.raw cache2.img
>file cache2.img
cache2.img: Android sparse image, version: 1.0, Total of 16384 4096-byte output blocks in 74 input chunks.
Without changing (or even mounting) the raw file at all! I just converted it to raw and back.
Then I tried to flash the new file again, fails. And as you can see they are obviously very different, even though I did absolutely no changes!
I verified the block size, the default one (4096) is the correct one.
Also, the original cache.img is 49.4 MB, the cache2.img file is 39.6 MB
The output when trying to flash the new cache.img file:
Code:
Uploading CACHE
100%
ERROR: Failed to confirm end of file transfer sequence!
ERROR: CACHE upload failed!
It should be the same file, but isn't. What am I doing wrong?
Edit:
Instead of using img2simg, I used mkuserimg.sh which created a file that's NEARLY identical to my original file:
Code:
>sudo ./mkuserimg.sh -s ./cache ./cache2.img ext4 cache 64M
in mkuserimg.sh PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
make_ext4fs -s -l 64M -a cache ./cache2.img ./cache
Creating filesystem with parameters:
Size: 67108864
Block size: 4096
Blocks per group: 32768
Inodes per group: 4096
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 16384
Block groups: 1
Reserved block group size: 7
Created filesystem with 15/4096 inodes and 12062/16384 blocks
>file *.img
cache2.img: Android sparse image, version: 1.0, Total of 16384 4096-byte output blocks in 14 input chunks.
cache.img: Android sparse image, version: 1.0, Total of 16384 4096-byte output blocks in 14 input chunks.
>ls -l *.img
-rw-r--r-- 1 root root 49406148 Aug 20 13:19 cache2.img
-rwxrw-rw- 1 ae ae 49406208 May 19 09:24 cache.img
As you see they slightly differ now, but flashing still fails. Adding --verbose to heimdall adds this:
Code:
ERROR: Failed to unpack received packet.
Edit 2:
I'm using a Samsung device (Galaxy S7)
Fixed it in the end using manually compiled and modified binaries of the sim2img and img2sim. The original source is obtained from
github .com/ASdev/android_img_repack_tools/tree/android-6.0.1
and then apply this patch
gist. github .com/jedld/4f388496bda03b349f5744f367749a67
(had to add spaces because i'm a new user, but wanted to put this here in case someone else has this problem)
then build it, and it flashes now properly. (using simg2img and img2simg)

Need help with image repack. Make_ext4fs image doesnt load on device.

Hi all!
I have a tablet device Digma CITI 7507 4g, and have a task to put custom application to firmware to "priv-apps'.
So, what have i done:
1. Taken stock FW from manufacturer site.
2. Inside archive i found .pac file, i unpack that file with Spreatrum ResearchDownload tool
3. After unpack i found several files including some img's, and system.img too.
4. So, file system.img already in raw format and i can mount in to the folder
5. I copied all the content of a mounted folder to the system_new folder, and appended here my apk.
6. After that i packed system_new folder to the system_new.img with the make_ext4fs tool
7. Flashing firmware with new system_new.img through Spreatrum ResearchDownload tool
8. After that device is stuck on first screen with "Powered by Android" that'all ((((
9. Re-flashing with stock image becomes device alive
Info about image files:
file system.img (stock)
system.img: Linux rev 1.0 ext4 filesystem data, UUID=da594c53-9beb-f85c-85c5-cedf76546f7a, volume name "system" (extents) (large files)
file system_new.img (custom)
system_new.img: Linux rev 1.0 ext4 filesystem data, UUID=da594c53-9beb-f85c-85c5-cedf76546f7a, volume name "system" (extents) (large files)
dumpe2fs system.img (Stock)
dumpe2fs 1.42.13 (17-May-2015)
Filesystem volume name: system
Last mounted on: ...
Filesystem UUID: da594c53-9beb-f85c-85c5-cedf76546f7a
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode filetype extent sparse_super large_file uninit_bg
Filesystem flags: unsigned_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Remount read-only
Filesystem OS type: Linux
Inode count: 129280
Block count: 516604
Reserved block count: 0
Free blocks: 17026
Free inodes: 126892
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 127
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8080
Inode blocks per group: 505
Last mount time: Tue Jul 3 12:25:29 2018
Last write time: Tue Jul 3 17:23:26 2018
Mount count: 8
Maximum mount count: -1
Last checked: Thu Jan 1 05:00:00 1970
Check interval: 0 (<none>)
Lifetime writes: 30 MB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: tea
Journal backup: inode blocks
Journal features: (none)
Journal size: 31M
Journal length: 8071
Journal sequence: 0x00000018
Journal start: 0
Click to expand...
Click to collapse
dumpe2fs system_new.img (Custom)
dumpe2fs 1.42.13 (17-May-2015)
Filesystem volume name: system
Last mounted on: <not available>
Filesystem UUID: da594c53-9beb-f85c-85c5-cedf76546f7a
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode filetype extent sparse_super large_file uninit_bg
Filesystem flags: unsigned_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Remount read-only
Filesystem OS type: Linux
Inode count: 131376
Block count: 524800
Reserved block count: 0
Free blocks: 24913
Free inodes: 128988
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 135
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 7728
Inode blocks per group: 483
Last mount time: n/a
Last write time: Thu Jan 1 05:00:00 1970
Mount count: 0
Maximum mount count: -1
Last checked: Thu Jan 1 05:00:00 1970
Check interval: 0 (<none>)
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: tea
Journal backup: inode blocks
Journal features: (none)
Journal size: 32M
Journal length: 8200
Journal sequence: 0x00000001
Journal start: 0
Click to expand...
Click to collapse
I need to build correct system image with which device could boot or may be i can put my apk in another place? Please, any help will be nice!
me too.
my problem also is it.
I don't know who can help me
---------- Post added at 04:30 PM ---------- Previous post was at 04:29 PM ----------
If you have answer.I hope you can share with me

[Solved] Unable to mount '/data' partition, unable to re-encrypt system | LCD replaced after phone flooding.

// Update (Original problem described in the bottom of the post)
So I have actually tried a lot of different things, in the end I wiped the encrypted storage and everything else using TWRP however I have another bizarre problem - whatever ROM I flash it doesn't boot, there is only black screen.
Trying to repair the '/data' filesystem or change it from ext4 to ext2 and back in TWRP gives an error:
Code:
Failed to mount '/data' (Operation not supported on transport endpoint)
Unable to mount storage
Trying to 'Repair or Change File System' in TWRP for 'Internal storage' gives an error (maybe because its really '/data/media' folder? - https://twrp.me/faq/datamedia.html):
Code:
Invalid partition selection
Code:
'/data' (partition) = 'userdata' in parted = whole internal storage
'/data/media' (folder, virtual parittion?) = sdcard = user files in internal storage
It looks like after every system boot, filesystem change or repair, '/data' (internal storage?) gets unmounted and can't be mounted back. I used 'parted' and `adb shell` to recreate `/data` partition manually (called `userdata` in parittion table) but it didn't help:
Code:
adb push parted /
chmod 755 parted
adb shell
cd /dev
/parted block/mmcblk0
unit b
p
rm 50
mkpart primary 5570568192 62537055743
name 50 userdata
mke2fs -t ext4 /dev/block/mmcblk0p50
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3481600 inodes, 13907833 blocks
695391 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
425 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
My partition table looks like this, I don't know what to make of it:
Code:
Number Start End Size File system Name Flags
1 67.1MB 155MB 88.1MB fat16 modem
2 201MB 201MB 1024B fsc
3 201MB 201MB 8192B ssd
4 201MB 202MB 524kB sbl1
5 202MB 202MB 524kB sbl1bak
6 202MB 203MB 524kB rpm
7 203MB 203MB 524kB rpmbak
8 203MB 206MB 2097kB tz
9 206MB 208MB 2097kB tzbak
10 208MB 208MB 262kB devcfg
11 208MB 208MB 262kB devcfgbak
12 208MB 225MB 16.8MB ext4 dsp
13 225MB 227MB 1573kB modemst1
14 227MB 228MB 1573kB modemst2
15 268MB 268MB 32.8kB DDR
16 268MB 270MB 1573kB fsg
17 270MB 270MB 16.4kB sec
18 336MB 347MB 11.5MB splash
19 403MB 404MB 1049kB aboot
20 404MB 405MB 1049kB abootbak
21 405MB 472MB 67.1MB boot
22 472MB 539MB 67.1MB recovery
23 539MB 540MB 1049kB devinfo
24 540MB 3761MB 3221MB ext2 system
25 3825MB 4094MB 268MB ext4 cache
26 4094MB 4127MB 33.6MB ext4 persist
27 4127MB 4128MB 1049kB misc
28 4128MB 4129MB 524kB keystore
29 4129MB 4129MB 32.8kB config
30 4129MB 4397MB 268MB oem
31 4429MB 4429MB 32.8kB limits
32 4496MB 4497MB 524kB mota
33 4497MB 4498MB 1049kB dip
34 4498MB 4531MB 33.6MB mdtp
35 4531MB 4532MB 524kB syscfg
36 4532MB 4536MB 4194kB mcfg
37 4563MB 4564MB 131kB lksecapp
38 4564MB 4564MB 131kB lksecappbak
39 4564MB 4564MB 262kB cmnlib
40 4564MB 4564MB 262kB cmnlibbak
41 4564MB 4564MB 262kB cmnlib64
42 4564MB 4565MB 262kB cmnlib64bak
43 4565MB 4565MB 262kB keymaster
44 4565MB 4565MB 262kB keymasterbak
45 4631MB 4631MB 262kB apdp
46 4631MB 4631MB 262kB msadp
47 4631MB 4631MB 8192B dpo
48 4631MB 4698MB 67.1MB logdump
49 4698MB 5571MB 872MB ext2 cust
50 5571MB 62.5GB 57.0GB ext4 userdata
I am confused because it should be more than enough.
Summary: I can flash ROMs and other things, they install without errors but to do that I have to first use TWRP's 'Format Data' each time and Reboot to Recovery. After that '/data' can be mounted properly in TWRP. Every time I try to do anything with the partition under TWRP it "dismounts" and can't be mounted back, if I try to boot the installed ROM (clean, any) instead, I end up with a Black Screen which rebooted to recovery again prevents '/data' from being mounted (until another 'Format Data').
I have also tried older versions of TWRP (to no avail) and newest OrangeFox recovery (touch doesn't work, presumably due to the original problem).
// ORIGINAL PROBLEM
I really need your help guys, will be grateful for any assistance.
My `XIaomi Redmi 5 Plus` was accidentally flooded. I disassembled it completely, checked the parts, soaked and cleaned with 99% isopropyl alcohol, then waited for it to dry completely.
I have also replaced screen into this: https://allegro.pl/oferta/wyswietlacz-ekran-lcd-ramka-xiaomi-redmi-5-plus-8501826695?snapshot=MjAyMi0wMS0yMVQwMjoxNjo1Ny40NDRaO2J1eWVyOzUyNDA1ZTkzODY3MTkzYTRlYTVlOGZkYjM3OGIwZDJjOTQ0NGI4MmZiM2Y1MmQ4MGMzYjZlNGU4ODdkNzA1MjU=
I have `lineage-15.1-20180526-UNOFFICIAL-vince` ROM installed since 2018: https://forum.xda-developers.com/t/...al-lineageos-15-1-updated-26-05-2018.3780298/ (I am not sure if this is the correct version, I can provide the file if necessary)
Also TWRP and Magisk
My Android is encrypted and incompatible with TWRP decryption since day one (its a bug apparently).
Everything works except touch on Android (pre-boot auth screen), to my astonishment touch works under TWRP), I also have adb access.
Dirty and clean flashing different ROMs and kernels didn't fix the issue.
For future reference I fixed this issue with Black Screen by flashing the newest MIUI firmware (not ROM), it appears that firmware partition had to be corrupted or my firmware was too old.
Here is the file: https://xiaomifirmwareupdater.com/miui/vince/stable/V11.0.2.0.OEGMIXM/
As for the issue with inability to mount storage ('/data') partition:
- As stated earlier it doesn't work in any version of TWRP at the moment
- I tried OrangeFox Recovery - touch not working.
- I tried Pitch Black Recovery and it mounts correctly: https://pitchblackrecovery.com/vince/
You see even if I was able to correctly boot my ROM I still had to mount '/data' because it turned out that trying to encrypt back my phone I was experiencing the issue described here: https://forum.xda-developers.com/t/encrypting-just-reboots-the-phone.3405513/, caused by "Orig filesystem overlaps crypto footer region. Cannot encrypt in place." error.
It needs 16 kb of free space so I had to use 'resize2fs' which didn't work in TWRP with the parittion being unmountable.
`Pitch Black` (PERP) uses slightly newer 'resize2fs' (and entire suite including it) version (TWRP: resize2fs 1.42.9 (28-Dec-2013), PERP: resize2fs 1.43.3 (04-Sep-2016)), so I imagine this is what allowed me to move forward.
Installing `Pitch Black` has also fixed a long standing issue with broken encoding in 'adb shell' btw.
I backed everything up and tried to use the tool above:
Code:
vince:/ # resize2fs /dev/block/mmcblk0p50 57G
resize2fs 1.43.3 (04-Sep-2016)
The containing partition (or device) is only 13907833 (4k) blocks.
You requested a new size of 14942208 blocks.
Now I had more info:
Code:
4 k (kb) = 4 * 1024 b = 4096 b
partition has: 13907833 blocks = 4096 b * 13907833 = 56966483968 b
we need 16 kb of free space: 16 * 1024 b = 16384 b
new size is: 56966483968 b - 16384 b = 56966467584 b
in blocks: 56966467584 b / 4096 b = 13907829 blocks
Resizing threw:
Code:
resize2fs 1.43.3 (04-Sep-2016)
Please run 'e2fsck -f /dev/block/mmcblk0p50' first.
So I ran:
Code:
1|vince:/ # e2fsck -f /dev/block/mmcblk0p50
e2fsck 1.43.3 (04-Sep-2016)
Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found. Fix<y>? y
yes
Inode 1368088 was part of the orphaned inode list. FIXED.
Inode 2121750 was part of the orphaned inode list. FIXED.
Inode 2121751 was part of the orphaned inode list. FIXED.
Inode 2121754 was part of the orphaned inode list. FIXED.
Inode 2121755 was part of the orphaned inode list. FIXED.
Inode 2121756 was part of the orphaned inode list. FIXED.
Inode 2121757 was part of the orphaned inode list. FIXED.
Inode 2121768 was part of the orphaned inode list. FIXED.
Inode 2121769 was part of the orphaned inode list. FIXED.
Inode 2121802 was part of the orphaned inode list. FIXED.
Inode 2121803 was part of the orphaned inode list. FIXED.
Inode 2121828 was part of the orphaned inode list. FIXED.
Inode 2121829 was part of the orphaned inode list. FIXED.
Inode 2121889 was part of the orphaned inode list. FIXED.
Inode 2121890 was part of the orphaned inode list. FIXED.
Inode 2121892 was part of the orphaned inode list. FIXED.
Inode 2121940 was part of the orphaned inode list. FIXED.
Inode 2121941 was part of the orphaned inode list. FIXED.
Inode 2121943 was part of the orphaned inode list. FIXED.
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p50: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p50: 20071/3481600 files (2.9% non-contiguous), 2729092/13907833 blocks
After that the resize was successful:
Code:
1|vince:/ # resize2fs /dev/block/mmcblk0p50 13907829
resize2fs 1.43.3 (04-Sep-2016)
Resizing the filesystem on /dev/block/mmcblk0p50 to 13907829 (4k) blocks.
The filesystem on /dev/block/mmcblk0p50 is now 13907829 (4k) blocks long.
After that the encryption was successful, so 16 kb is all you need indeed (for the record I probably caused this issue by manually recreating '/data' parittion from the terminal).
Next was the problem with battery life decreased by 75% (it entirely discharged in 8 hours).
At first I used aggressive profiles and Naptime on top of it (I measure iwith Accubattery). Slow charging over USB was actually draining the battery instead of replenishing it.
It turns out that there must be a Bug in crDroid 7.13 (Android 11) because as soon as I disabled (ironically) battery management for all apps and battery saver (even with Naptime enabled) it dropped drastically.
Code:
Settings > Battery > Manage Apps Automatically > Off
Now I found out that speaker doesn't work...
..and the battery is still being drained way too fast.

Categories

Resources