• We are moving to xdaforums.com!

    Posts made between now and when the migration is complete will not be carried over.
    You will be automatically redirected once the migration is complete.

How To Guide [GUIDE] [T220/T225] Flash a GSI on the A7 Lite (without TWRP)

Search This thread

abg95a

Member
Jun 13, 2022
5
12
Hi everyone, this is a short guide on how to flash a GSI on the A7 Lite (without TWRP).

Its a nice little tablet for the price but it doesn't have a very powerful SOC and for me the One UI is barely usable on this device. The launcher and the whole system UI feel extremely laggy, but apps generally run fine.

I tried phhusson's custom Android 12 GSI and the device was almost resurrected. Much much less UI lag and the battery life is the same as stock ROM. The only thing i found not working is MTP but i don't need it.

Since i saw a couple users here asking about GSIs i decided to make a very simple guide.

As always do this at your own risk. You may brick your device. You will void your warranty.

Follow the guide only if you know what your are doing. Read each step carefully and avoid copy pasting stuff randomly.

I won't go deep into details as i believe you should have some basic knowledge if you decide to do this.

The procedure sould work for both T220 and T225 (i tested it on a T220).

I did this on Windows using WSL for some of the steps.

Sources


Thanks to @kkoo and @Brepro1 for the useful info

- https://forum.xda-developers.com/t/...sing-odin-without-twrp-phh-lineageos.4114435/
- https://forum.xda-developers.com/t/...r-img-and-flashing-our-modifications.4196625/

Requirements​


- Unlocked bootloader

If you haven't done this already follow the steps in parts 1-2 from:


- Latest official ROM

I used T220XXU1AVE1 for EUX region


- Download your preferred GSI

I used AOSP 12.1 v414 with gapps from phhusson


- Clean vbmeta.img from Google


Tools​


- lz4


- simg2img


- lpunpack and lpmake


- tar-md5-script-tool

Use the attached tar-md5-script-tool.zip

Steps​


1. Extract official ROM files (BL, AP, CP, CSC)

2. Extract AP .tar.md5

3. Decompress the extracted super.img.lz4

Code:
lz4 -d super.img.lz4 super.img

4. Convert the sparse super.img

Code:
simg2img super.img super.ext4.img

5. Unpack super.ext4.img

Code:
lpunpack super.ext4.img

I got 4 partitions in my image (should be the same for all T220/T225 ROMs):

- odm.img
- product.img
- system.img
- vendor.img

6. Replace system.img with your GSI (rename it to system.img)

7. Get the size of all partitions and the size of the original super.ext4.img (not the sparse super.img)

Code:
stat -c '%n %s' IMG_FILE.img

8. Repack super.img

Code:
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

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.

Read lpmake docs for a more detailed expalation of the args used above:


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

Code:
lz4 -B6 --content-size vbmeta.img vbmeta.img.lz4

11. Extract tar-md5-script-tool.zip

12. Put all the *.img.lz4 files extracted from AP .tar.gz in tar-md5-script-tool dir

13. 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) and the clean compressed vbmeta.img.lz4

14. Run batch.bat in tar-md5-script-tool dir

You will find the new AP .tar.md5 in the temp-folder subdir

15. Flash your custom AP .tar.md5 with Odin along with BL, CP, CSC from original ROM

16. Reboot into recovery and do a factory reset

17. Done
 

Attachments

  • tar-md5-script-tool.zip
    5.2 MB · Views: 970
Last edited:

abg95a

Member
Jun 13, 2022
5
12
Can you share screenshot as I think treble projects are only stable on SD chipset.

System lang is italian but should be easy to understand.

I found only a couple bugs so far in phhusson's GSI:
- in the launcher dragging apps from drawer to homescreen doesn't always work (just use another launcher)
- crashed once while searching in settings app

I use the tablet only for media consumption and some retrogaming, so there are probably other bugs i haven't noticed.

This is a generic guide, it won't include a "known issues" section since it largely depends on what GSI you choose.

I haven't tested this on the LTE version so i can't say for sure if mobile network works or not.

Unfortunately i don't have the time to make a custom ROM, test it and keep it updated here on the forum but maybe if there is enough interest someone will do it.

I hope other users will try to flash a GSI and share their experience here so we can gather some info on working/broken stuff, especially on the LTE model since i can't test that.
 

Attachments

  • Screenshot_20220613-204223.png
    Screenshot_20220613-204223.png
    105.1 KB · Views: 758
  • Screenshot_20220613-204538~2.png
    Screenshot_20220613-204538~2.png
    76.3 KB · Views: 762
  • Like
Reactions: dreas74

ReubenMCSM

Member
Nov 23, 2015
23
7
TM
Hello,

I'm sorry but what am I missing here?

I'm a little fustrated cause after hours and hours of headaches I got to the second to last step which involves tar-md5-script-tool

I simply put all the .img.lz4 files from AP and replace super & vbmeta files which the ones that I converted and try to run the batch.bat as instructed.

However nothing happens and this is what the program spits out.

On the tar tool xda forum it says that it convers .img files, not .img.lz4 . Are we supposed to extract all the .img files from inside the .lz4 files?

I appreciate the guide but there are a lot of missing details I had to fill in and figure out myself, like the fact that from step 4 to step 8 you need to use WSL or a Linux distro (using simg2img for Windows messes things up so please use the one from otatools inside a linux bash)
Also for people that are not familiar with linux you need to type "./" in front of directed commands ( in this case ./simg2img ./lpunpack ./lpmake)

I'm not a developer or a programmer, maybe you wrote this guide for people more inclined to that, but for me this was pretty hard.

GSI.png
 
  • Like
Reactions: aieromon

DanneSwe

Member
Feb 20, 2014
32
10
Sundsvall
Noob here, but I'm running the "simg2img super.img super.ext4.img" and nothing happens for 5 min and when I'm aborting I'm getting a "Error reading sparse file header".

Any suggestions?
 

ReubenMCSM

Member
Nov 23, 2015
23
7
TM
Noob here, but I'm running the "simg2img super.img super.ext4.img" and nothing happens for 5 min and when I'm aborting I'm getting a "Error reading sparse file header".

Any suggestions?
Are you using the Windows version of simg2img? If yes, use the one from otatools inside Windows Subsystem for Linux
 

abg95a

Member
Jun 13, 2022
5
12
Are you using the Windows version of simg2img? If yes, use the one from otatools inside Windows Subsystem for Linux

I can confirm simg2img doesn't seem to work on Windows, i used WSL.

@ReubenMCSM i will update the guide with more details in the future but i don't have much time right now.

For you specific issue, try to use the attached tar-md5-script-tool.
 

Attachments

  • tar-md5-script-tool.zip
    5.2 MB · Views: 151

DanneSwe

Member
Feb 20, 2014
32
10
Sundsvall
Great thanks! :)

What's the process with tar-md5-script-tool? Just moving the super.img to the folder and running the batch.bat didn't work the output file in the temp folder is 11 kb. Tried to change super.img to super.tar but no change.
 
Last edited:

abg95a

Member
Jun 13, 2022
5
12
It looks like the batch.bat script from the tar md5 tool linked in the guide is a bit different from the one i used. I will update the guide.

Try again with the version i attached in the post above.

- Extract the AP tar md5 from official rom

1655849454936.png


- Copy all .img.lz4 files in the tar-md5-script-tool folder

1655849559324.png


- Replace super.img.lz4 and vbmeta.img.lz4 (step 13)

- Launch batch.bat, output should look like this

1655849763722.png


- You will find AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5 in temp-folder

1655849894703.png


1655849905212.png
 

ReubenMCSM

Member
Nov 23, 2015
23
7
TM
It finally worked! I redid everything and also moved my folder to drive C instead of drive D, maybe this made the difference
 
  • Like
Reactions: DanneSwe

DanneSwe

Member
Feb 20, 2014
32
10
Sundsvall
It finally worked! I redid everything and also moved my folder to drive C instead of drive D, maybe this made the difference
What GSI did you pick and could you upload the files you flashed? :)

I got simg2img to work by using
.\simg2img -i super.img -o super.ext4.img

packed img filename: super.img
output img filename: super.ext4.img
Wrote "super.ext4.img"
 
Last edited:

ramz.pa

Member
Jun 17, 2017
17
1
Samsung Galaxy S9
OnePlus 6
The lpunpack and lpmake step isnt working for me ive been at this for days, no luck.
Can someone please help me out by uploading custom AP .tar.md5(file with GSI, the modded one) along with BL, CP, CSC from original ROM to google drive?
thanks!
 
  • Like
Reactions: DanneSwe

Pleasance

Member
Dec 31, 2021
8
0
Can someone help me with the T225 LTE model by compiling the AP please? Because for some reason the tar-md5-script tool isnt working for me
Thanks.
 

xpdragon

Senior Member
Successfully flashed GSI with magisk on my T220 following the OP's procedure. MTP is not working as the OP said. However, I can use my flash drive so I don't really miss MTP.

I chose "system-squeak-arm64-ab-vndklite-gapps-secure.img.xz" for GSI. "Treble Info" app can tell you what image would be compatible with your device.

If you want to use a different launcher like Nova instead of the default one, change the "Smallest width" setting from 600 to 598 in Developer options to hide the annoying taskbar.

AOSP-Mods and "Project Themer - Android 12+" work fine for me.

Here is my build for my device SM-T220 (SM-T220_EUX_T220XXU1AVE1):

GSI: system-squeak-arm64-ab-vndklite-gapps-secure.img.xz
Custom AP: https://www.filehosting.org/file/details/7045394/AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5
Custom AP with Magisk patch: https://www.filehosting.org/file/details/7045714/magisk_patched-25101_cauJQ.tar

You can extract BL and Home_CSC from SM-T220_EUX_T220XXU1AVE1.

Screenshot_20220624-113012.pngScreenshot_20220624-113035.pngScreenshot_20220624-113131.pngScreenshot_20220624-113205.png

Notes: My device is actually SM-T220 XAR, but I have been updating it with SM-T220 EUX firmware versions without any issue.
 
Last edited:

xpdragon

Senior Member
Can someone help me with the T225 LTE model by compiling the AP please? Because for some reason the tar-md5-script tool isnt working for me
Thanks.
Here is the custom AP based on the following. Since I don't have SM-T225 device, can't verify it. However, I compiled the AP the same way I did for my SM-T220.
- SM-T225_EUX_T225XXU1AUJ1
- GSI: system-squeak-arm64-ab-vndklite-gapps-secure.img.xz

https://www.filehosting.org/file/details/7046296/AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5
 

Pleasance

Member
Dec 31, 2021
8
0
Here is the custom AP based on the following. Since I don't have SM-T225 device, can't verify it. However, I compiled the AP the same way I did for my SM-T220.
- SM-T225_EUX_T225XXU1AUJ1
- GSI: system-squeak-arm64-ab-vndklite-gapps-secure.img.xz

https://www.filehosting.org/file/details/7046296/AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5

Thank you so much for compiling the AP for me bro but when i try to flash it with odin i get this error
<ID:0/004> Firmware update start..
<ID:0/004> SingleDownload.
<ID:0/004> preloader.img.lz4
<ID:0/004> FAIL!


For your information the current OS build on my tablet is INS with the baseband version of T225XXU1AVB2 and security patch of 1 Feb 2022 hope this helps you.
 

xpdragon

Senior Member
Thank you so much for compiling the AP for me bro but when i try to flash it with odin i get this error
<ID:0/004> Firmware update start..
<ID:0/004> SingleDownload.
<ID:0/004> preloader.img.lz4
<ID:0/004> FAIL!


For your information the current OS build on my tablet is INS with the baseband version of T225XXU1AVB2 and security patch of 1 Feb 2022 hope this helps you.
Here is GSI build for SM-T225_INS_T225XXU1AVB2
https://www.filehosting.org/file/details/7129248/GSI-12_SM-T225_INS_T225XXU1AVB2.zip
 
  • Like
Reactions: Abish and Vish4L

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    Hi everyone, this is a short guide on how to flash a GSI on the A7 Lite (without TWRP).

    Its a nice little tablet for the price but it doesn't have a very powerful SOC and for me the One UI is barely usable on this device. The launcher and the whole system UI feel extremely laggy, but apps generally run fine.

    I tried phhusson's custom Android 12 GSI and the device was almost resurrected. Much much less UI lag and the battery life is the same as stock ROM. The only thing i found not working is MTP but i don't need it.

    Since i saw a couple users here asking about GSIs i decided to make a very simple guide.

    As always do this at your own risk. You may brick your device. You will void your warranty.

    Follow the guide only if you know what your are doing. Read each step carefully and avoid copy pasting stuff randomly.

    I won't go deep into details as i believe you should have some basic knowledge if you decide to do this.

    The procedure sould work for both T220 and T225 (i tested it on a T220).

    I did this on Windows using WSL for some of the steps.

    Sources


    Thanks to @kkoo and @Brepro1 for the useful info

    - https://forum.xda-developers.com/t/...sing-odin-without-twrp-phh-lineageos.4114435/
    - https://forum.xda-developers.com/t/...r-img-and-flashing-our-modifications.4196625/

    Requirements​


    - Unlocked bootloader

    If you haven't done this already follow the steps in parts 1-2 from:


    - Latest official ROM

    I used T220XXU1AVE1 for EUX region


    - Download your preferred GSI

    I used AOSP 12.1 v414 with gapps from phhusson


    - Clean vbmeta.img from Google


    Tools​


    - lz4


    - simg2img


    - lpunpack and lpmake


    - tar-md5-script-tool

    Use the attached tar-md5-script-tool.zip

    Steps​


    1. Extract official ROM files (BL, AP, CP, CSC)

    2. Extract AP .tar.md5

    3. Decompress the extracted super.img.lz4

    Code:
    lz4 -d super.img.lz4 super.img

    4. Convert the sparse super.img

    Code:
    simg2img super.img super.ext4.img

    5. Unpack super.ext4.img

    Code:
    lpunpack super.ext4.img

    I got 4 partitions in my image (should be the same for all T220/T225 ROMs):

    - odm.img
    - product.img
    - system.img
    - vendor.img

    6. Replace system.img with your GSI (rename it to system.img)

    7. Get the size of all partitions and the size of the original super.ext4.img (not the sparse super.img)

    Code:
    stat -c '%n %s' IMG_FILE.img

    8. Repack super.img

    Code:
    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

    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.

    Read lpmake docs for a more detailed expalation of the args used above:


    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

    Code:
    lz4 -B6 --content-size vbmeta.img vbmeta.img.lz4

    11. Extract tar-md5-script-tool.zip

    12. Put all the *.img.lz4 files extracted from AP .tar.gz in tar-md5-script-tool dir

    13. 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) and the clean compressed vbmeta.img.lz4

    14. Run batch.bat in tar-md5-script-tool dir

    You will find the new AP .tar.md5 in the temp-folder subdir

    15. Flash your custom AP .tar.md5 with Odin along with BL, CP, CSC from original ROM

    16. Reboot into recovery and do a factory reset

    17. Done
    2
    Can we boot lineage-19.1 GSI (nogapps, no magisk ) on tab 7 lite ?
    if yes, please compile for test Thank you.
    Device: SM-T225 Regeion: THL
    Happy testing :)

    GSI: lineage-19.1-20220613-UNOFFICIAL-arm64_bvS-vndklite.img

    https://www.filehosting.org/file/details/8249475/GSI-Lineage-19.1_SM-T225_THL_T225XXU1AVB2.zip
    2
    Are there so many tutorials about SM-T22x here, from history till now from nothing (hard way) to very easy method why don't read and upgrade your skill from it.
    never mind ! i just install fastbootd and a custom gsi from Tutorials ! THX A LOT @tom.android
    2
    i flashed this rom but after the factory reset on the recovery, the tablet freezes on the animated logo cherish os.
    maybe the problem is the base firmware ? i used the T220XXS1BVJ2 base firmware Android 12
    No, your base is not the problem. That particular version of A12 CherishOS uses PHH v415 which has issues booting for our devices. Only PHH v414 or v416 GSIs like this one boot for us (it works for VJ2 firmware, tested it myself). Sadly I don't see any other developer releasing an A12 v416 based GSI like the one I linked to so yes, that's what we have for now until the newer A13 GSIs pick up the v416 patches hopefully.