Development [RECOVERY][UNOFFICIAL][EXPERIMENTAL][ALPHA] TWRP for Galaxy A22 5G SM-A226B

Search This thread

Platypus Enthusiast

Senior Member
Apr 6, 2021
83
20
Has anyone successfully started viper4? If any will you teach me
Turn on Legacy mode in the V4A app. I was very lucky to find this XDA thread which helped me a lot with my Galaxy S4 (RIP, you will be missed) and my current A22 5G.

Navigate to /data/adb/modules/ViPER4AndroidFX (in root) and open post-fs-data.sh. Enter a new line and paste:

magiskpolicy --live 'allow audioserver audioserver_tmpfs file { read write execute }' magiskpolicy --live 'allow audioserver system_file file { execmod }' magiskpolicy --live 'allow mediaserver mediaserver_tmpfs file { read write execute }' magiskpolicy --live 'allow mediaserver system_file file { execmod }' magiskpolicy --live 'allow audioserver unlabeled file { read write execute open getattr }' magiskpolicy --live 'allow hal_audio_default hal_audio_default process { execmem }' magiskpolicy --live 'allow hal_audio_default hal_audio_default_tmpfs file { execute }' magiskpolicy --live 'allow hal_audio_default audio_data_file dir { search }' magiskpolicy --live 'allow app app_data_file file { execute_no_trans }' magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio_tmpfs file { execute }' magiskpolicy --live 'allow mtk_hal_audio sysfs_dt_firmware_android file { read }' magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio process { execmem }' magiskpolicy --live 'allow vendor_default_prop vendor_default_prop file { read }' magiskpolicy --live 'allow mtk_hal_audio metadata_file dir { search }' magiskpolicy --live 'allow mtk_hal_audio debugfs_ion dir { search }'

then save the file, and reboot. Should work now.
 

Platypus Enthusiast

Senior Member
Apr 6, 2021
83
20
Anyone else getting:
E: Unable to unlock /dev/block/mmcblk0p[number] for flashing: (null).

Not sure if it's normal or not because I also get something similar in the Magisk logs.
 

a0963655966

Member
May 25, 2022
19
1
Turn on Legacy mode in the V4A app. I was very lucky to find this XDA thread which helped me a lot with my Galaxy S4 (RIP, you will be missed) and my current A22 5G.

Navigate to /data/adb/modules/ViPER4AndroidFX (in root) and open post-fs-data.sh. Enter a new line and paste:

magiskpolicy --live 'allow audioserver audioserver_tmpfs file { read write execute }' magiskpolicy --live 'allow audioserver system_file file { execmod }' magiskpolicy --live 'allow mediaserver mediaserver_tmpfs file { read write execute }' magiskpolicy --live 'allow mediaserver system_file file { execmod }' magiskpolicy --live 'allow audioserver unlabeled file { read write execute open getattr }' magiskpolicy --live 'allow hal_audio_default hal_audio_default process { execmem }' magiskpolicy --live 'allow hal_audio_default hal_audio_default_tmpfs file { execute }' magiskpolicy --live 'allow hal_audio_default audio_data_file dir { search }' magiskpolicy --live 'allow app app_data_file file { execute_no_trans }' magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio_tmpfs file { execute }' magiskpolicy --live 'allow mtk_hal_audio sysfs_dt_firmware_android file { read }' magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio process { execmem }' magiskpolicy --live 'allow vendor_default_prop vendor_default_prop file { read }' magiskpolicy --live 'allow mtk_hal_audio metadata_file dir { search }' magiskpolicy --live 'allow mtk_hal_audio debugfs_ion dir { search }'

then save the file, and reboot. Should work now.
lucky,succeed
 

atom2662

Member
Jun 13, 2022
12
0
Hi, I successfully got the twrp installed, but when i try to flash a gsi, my command prompt simply displays <waiting for any device>, any help???
 

atom2662

Member
Jun 13, 2022
12
0
Forget that, anyway when i try to flash a gsi which partition should i flash it to? "boot" partition doesn't work
 

atom2662

Member
Jun 13, 2022
12
0
1656523220546.png
I am not sure what to do at this point
 

atom2662

Member
Jun 13, 2022
12
0
TWRP told me that there is no OS installed on the system

many thanks for your patience too
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Does vb meta disabled workin on android 12?
    Just a guess, but probably.
  • 5
    unnamed.png


    It took me sometime, but I can now share with you a TWRP with basic functionality. You of course flash at your own risk. I am not responsible for lost warranty, lost data or any other damage to your device.



    This Build of TWRP is based on:​

    Working:​

    • flash of zips
    • fastbootd
    • flashing of GSI images (via fastbootd)
    • MTP

    Not working:​

    • Probably a lot of stuff ...

    What you need:​

    • Unlocked bootloader.
    • Odin3 v3.13.1
    • android platform-tools and device driver.
      • adb and fastboot
    • Magisk or GSI depending on what you want to do.
    • Patience, the device can be very tricky to get to download mode.

    How to flash:​

    Be advised that this build is a work in progress and is not ready as a daily driver. Only flash if you know what you are doing.
    1. First read all points below, without doing anything. Warning, you will lose all your data!
    2. Download the recovery.tar from here.
    3. You start off in Odin, put recovery.tar in AP slot and the vbmeta_disabled_R.tar in the USERDATA slot, uncheck auto-reboot.
    4. After the flash is completed hold down power + volume down, instantly after device goes Black screen press and hold power + vol up to boot to TWRP
      1. if you didn't get to TWRP, you have to flash again.
    5. In TWRP, go to Advanced → terminal.
    6. Type multidisabler two times.
    7. Now go to Wipe → Format Data (not wipe) → and type yes.
    8. You can boot to system now.

    Hot to install Magisk:​

    Method 1, Micro-SDCard​

    1. Download Magisk from here, rename the file from .apk to .zip
    2. Save the file to a Mico-SDCard
    3. Reboot the phone to TWRP.
    4. Go to Install → Select Storage → Micro-SDCard. In the file system, choose Magisk-vXX.X.zip and swipe to confirm flash.
    5. You can now Reboot to System

    Method 2, sideload​

    1. Download Magisk onto your PC from here, rename the file from .apk to .zip.
    2. Reboot the Phone into TWRP. Go to Advanced → ADB Sideload → Swipe to start Sideload.
    3. On your PC, type in a Terminal adb sideload Magisk-v24.3.zip
    4. You can now Reboot to System. adb reboot system

    How to install GSI:​

    1. Go to Wipe → Format Data (not wipe) → and type yes.
    2. Now reboot to fastboot.
    3. Connect the phone to your pc and startup a terminal of your choice.
    4. In the terminal type fastboot flash system name-of-your-gsi-iamge.img (it has to be a .img file, extract .img.xz files do not just rename them).
    5. You should now be good to go and can reboot to system.

    Thanks and credits to:
    5

    Changelog​

    v1.02.2-alpha

    • added drivers for himax touch screens.

    v1.02.1-alpha

    • added drivers for novatek touch screens.

    v1.01.2-alpha

    • added patch with improved multidisabler

    v1.01.1-alpha

    • update multidisabler

    v1.01.0-alpha

    • fix permission for mkbootimg

    v1.00.0-alpha

    • Initial Release
    2

    How to get TWRP log files:​

    recovery.log
    adb pull /tmp/recovery.log
    OR
    Advanced -> Copy Log -> Swipe to copy log to default storage

    dmesg
    adb shell dmesg > dmesg.log
    OR
    Advanced -> Copy Log -> check "Include kernel log" -> Swipe to copy log to default storage

    logcat
    adb logcat -d > logcat.txt
    OR
    Advanced -> Copy Log -> check "Include Logcat" -> Swipe to copy log to default storage
    2
    There is new release candidate which include the drivers for himax touchscreens. If you still have no touch input in twrp, try out this release v1.02.2-alpha-rc. Let me know if it works for you.

    EDIT: Confirmed working.
    1
    Does vb meta disabled workin on android 12?
    Just a guess, but probably.