[RECOVERY] TWRP 3.5.2 | Unihertz Jelly 2

Search This thread

karoooo

Member
Aug 10, 2021
11
3
Hi, Jelly2_JP has been updated to android 11.
So I tried to build TWRP for android 11.
However, my PC was too poor and the PC went down during the build.
(This is the PC which I built TWRP for android 10.)
Is the option -j used incorrectly?

My build operation
$ cd ~/twrp11
$ repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-11
fatal: couldn't find remote ref refs/heads/twrp-11

$ repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-11
$ repo sync --force-sync
$ cp -r ~/twrp10/device/Unihertz ~/twrp11/device
$ vi device/Unihertz/Jelly2_JP/omni_Jelly2_JP.mk
$(call inherit-product, vendor/twrp/config/common.mk)
#$(call inherit-product, vendor/omni/config/common.mk)
#$(call inherit-product, vendor/omni/config/gsm.mk)

$ export ALLOW_MISSING_DEPENDENCIES=true
$ . build/envsetup.sh
$ lunch omni_Jelly2_JP-eng
$ mka -j 1 recoveryimage
************************************************************
You are building on a machine with 7.38GB of RAM

The minimum required amount of free memory is around 16GB,
and even with that, some configurations may not work.

If you run into segfaults or other errors, try reducing your
-j value.
************************************************************
 

karoooo

Member
Aug 10, 2021
11
3
I found "How to build AOSP with 8GB of RAM".
I tried the build again and it was completed successfully!

$ sudo apt install zram-config
$ export _JAVA_OPTIONS="-Xmx4g"
$ mka -j1 recoveryimage
#### build completed successfully ####

I wrote recovery.img to my Jelly2_JP and tried to boot it.

$ fastboot flash --disable-verification --disable-verity vbmeta vbmeta.img
$ fastboot flash --disable-verification --disable-verity vbmeta_system vbmeta.img
$ fastboot flash --disable-verification --disable-verity vbmeta_vendor vbmeta.img
$ fastboot flash recovery recovery.img
$ fastboot reboot recovery

However, the orange state screen was displayed twice and was booted by the system instead of the recovery.
I tried to boot recovery again.

$ adb reboot recovery

It was booted by the official recovery.
I think that the recovery partition has been overwritten during the boot process.
 
  • Like
Reactions: linolino

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    How to install:

    Unlock bootloader:
    1. Boot your device into the official OS.
    2. Go to Settings > About phone, tap the "build number" several times to enable developer settings.
    3. Go to Settings > System > Developer Settings, enable OEM unlocking and ADB debugging.
    4. Connect your phone to your PC and open a terminal or a command line window.
    5. Run adb reboot bootloader on your PC (there is no way to enter bootloader directly, only possible through adb).
    6. Once your device has finished booting run fastboot flashing unlock and comfirm unlock on device (THIS WILL WIPE ALL DATA!).
    7. Run fastboot reboot to reboot your device and now you should see an unlocked warning during boot screen.
    Disable AVB:
    1. Download vbmeta.img from the latest release page of your device.
    2. Connect your phone to your PC and open a terminal or a command line window.
    3. Run adb reboot bootloader on your PC to put your device in bootloader mode.
    4. Once your device has finished booting run fastboot flash --disable-verification --disable-verity vbmeta vbmeta.img
    5. Then run fastboot flash --disable-verification --disable-verity vbmeta_system vbmeta.img
    6. Also run fastboot flash --disable-verification --disable-verity vbmeta_vendor vbmeta.img
    Flash recovery image:
    1. Connect your phone to your PC and open a terminal or a command line window.
    2. Run adb reboot bootloader on your PC to put your device in bootloader mode.
    3. Once your device has finished booting run fastboot erase recovery. For some reason, image may be not actually flashed, even if fastboot reported success (at least over the stock recovery image), so in order make sure that the custom image is always flashed it's better to always erase the partition before flashing. After the erasing run fastboot flash recovery recovery.img
    4. Run fastboot reboot and after the screen goes dark press volume up until you see the TWRP logo. Also you can type fastboot reboot recovery to boot to recovery mode immediately.
    Please note that booting in stock ROM will bring stock recovery back.

    This recovery image is built using binaries from non-european (TEE) version of Jelly 2. Theoretically it should work on european (EEA). If it won't - contact me, I'll prepare an image based on EEA binaries.

    Source code https://github.com/Meetoul/twrp_device_Unihertz_Jelly2
    1
    Thanks!
    This fantastic!
    its work on EEA!
    1
    I cannot seem to mount system as R/W with GSI image from https://github.com/phhusson/treble_experimentations/releases from within TWRP. I guess that's a more general problem, though :(

    Any ideas?
    Dave you tried the latest release a suggested by Meetoul?

    1
    Thanks for this!
    I flashed this TWRP, then installed AOSP 11, v313 of this GSI: https://github.com/phhusson/treble_experimentations/releases/tag/v313
    Things seem good, except:
    • the battery seems to drain a little quickly
    • no IR blaster (ZaZa remote does not recognize it)
    • TWRP cannot decrypt the phone's contents, so I cannot flash gapps.
    Is TWRP not able to decrypt because I'm using Android 11 and the TWRP was built for 10?
    Actually, data decryption on MTK SoCs is very painful thing. I'm still waiting for stable release of Android 11 from Unihertz, but they are in no hurry...

    I know that beta 11 available. Unfortunately, I was not able to update using the official way. The bootloader was locked and the moment of updating, but probably the reason is that it was unlocked before (it possible to relock bootloader using SP Flash Tool). But I manager to fetch zip update package and install it via TWRP :) After that I even managed to make package for SP Flash Tool based on this package, so I can to flash pure FW without updating and have locked bootloader!

    UPD. I see that Unihertz have published Android 11 SW package for SP Flash Tool on their Google Drive! Soon I will try to make recovery based on this package.
    1
    @Meetoul
    Thank you for your response.
    Yes, yes, yes!
    I want to know your technique.
    Best Regards.
    Since Unihertz has released Android 11, I think that there is no sense to work on patching the old kernel.

    Btw, now I'm working on TWRP based on Android 11 binaries from the latest FW, but no luck so far, it seems that kernel doesn't even start to boot...