[RECOVERY] TWRP 3.5.2 | Unihertz Jelly 2 - Android General

How to install:
Unlock bootloader:
Boot your device into the official OS.
Go to Settings > About phone, tap the "build number" several times to enable developer settings.
Go to Settings > System > Developer Settings, enable OEM unlocking and ADB debugging.
Connect your phone to your PC and open a terminal or a command line window.
Run adb reboot bootloader on your PC (there is no way to enter bootloader directly, only possible through adb).
Once your device has finished booting run fastboot flashing unlock and comfirm unlock on device (THIS WILL WIPE ALL DATA!).
Run fastboot reboot to reboot your device and now you should see an unlocked warning during boot screen.
Disable AVB:
Download vbmeta.img from the latest release page of your device.
Connect your phone to your PC and open a terminal or a command line window.
Run adb reboot bootloader on your PC to put your device in bootloader mode.
Once your device has finished booting run fastboot flash --disable-verification --disable-verity vbmeta vbmeta.img
Then run fastboot flash --disable-verification --disable-verity vbmeta_system vbmeta.img
Also run fastboot flash --disable-verification --disable-verity vbmeta_vendor vbmeta.img
Flash recovery image:
Connect your phone to your PC and open a terminal or a command line window.
Run adb reboot bootloader on your PC to put your device in bootloader mode.
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
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

Thanks!
This fantastic!
its work on EEA!

Meetoul said:
Source code https://github.com/Meetoul/twrp_device_Unihertz_Jelly2
Click to expand...
Click to collapse
I just received my Jelly 2. It was on 2020 and I went straight through your files. Your TWRP does not respond on my European Jelly 2. Meaning, the touch screen does not respond. But I connected an USB trackball and switched in between adb sideloads. So I finally got it working.
For some reason during reboot TWRP warns me that there is no OS installed. But LoS 18.1 (yours) booted fine. Also flashed opengapps 2707 nano.
After a reboot (phone is still restoring apps) there is a "serial console is enabled" message "performance is impacted, check bootloader". Any instructions on how to get rid of that?.

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?

kkazakov13 said:
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?
Click to expand...
Click to collapse
Dave you tried the latest release a suggested by Meetoul?
[ROM] [UNOFFICIAL] Lineage OS 17.1 | Unihertz Jelly 2
https://drive.google.com/drive/u/0/folders/1VSmj_-a1PYNzFWtUfbsDGWg4uIh-Tgkd This ROM 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 ROW...
forum.xda-developers.com
Release Fix gt1151qm touch in recovery · Meetoul/twrp_device_Unihertz_Jelly2_TEE
Recovery image based on new kernel image with patches for both gt1x and gt1151qm touch panel drivers.
github.com

Great Job!
I have Jelly2_JP.
I tried your recovery.img for Jelly2_TEE.
It can boot my Jelly2_JP, and it can enable adb shell, but it looped the splash screen.
But I execute following command in adb shell, twrp starts gui("Keep System Read only?" screen)
Jelly2_TEE:/ # mount -o ro /dev/block/mapper/system /
Touchscreen works fine.
Next, I tried to build twrp for Jelly2_JP using your device tree.
But it has same problem. (It looped the splash screen until I mount system partition.)
Do you have any advice?
Attachments
recovery_tee.log is pulled file from /tmp/recovery.log in your twrp for Jelly2_TEE. Line 1119 is after I mount system partition by adb shell.
recovery_jp.log is pulled file from /tmp/recovery.log in my twrp for Jelly2_JP. Line 1356 is after I mount system partition by adb shell.
My build instructions
$ cd ~/twrp
$ repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-10.0
$ vi .repo/local_manifests/roomservice.xml
$ repo sync --force-sync
$ cd device/Unihertz
$ cp -r Jelly2_TEE Jelly2_JP
$ cd Jelly2_JP
$ mv omni_Jelly2_TEE.mk omni_Jelly2_JP.mk
$ grep -l Jelly2_TEE * | xargs sed -i 's/Jelly2_TEE/Jelly2_JP/g'
$ grep -l g55v71c2k_dfl_tee * | xargs sed -i 's/g55v71c2k_dfl_tee/g55v71c2k_dfl_jp_felica/g'
$ ./extract-files.sh ~/stock_jp/extracted
$ unpack_bootimg --boot_img ~/stock_jp/recovery.img --out ~/stock_jp/recovery
$ cp ~/stock_jp/recovery/kernel prebuilt/Image.gz
$ cp ~/stock_jp/recovery/dtb prebuilt/dtb/mt6771.dtb
$ cp ~/stock_jp/recovery/recovery_dtbo prebuilt/dtbo.img
$ cd ~/twrp
$ source build/envsetup.sh
$ lunch omni_Jelly2_JP-eng
$ mka recoveryimage
$ ls out/target/product/Jelly2_JP/recovery/root/vendor
bin etc
$ cp -r vendor/Unihertz/Jelly2_JP/proprietary/reovery/root/vendor out/target/product/Jelly2_JP/recovery/root
$ mka recoveryimage

file upload again.
Sorry, I can't upload Attach files.
I clicked "Attach files" button and choose file.
I clicked "Save" button, but file link did not inserted.
I uploaded recovery.log to github.

How to get vbmeta.img

Three knife said:
How to get vbmeta.img
Click to expand...
Click to collapse
Direct Link
Google Drive: Sign-in
Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).
drive.google.com
See Also
Jelly 2 firmware made available by Unihertz
A post to let people interested in small Android phones know that the firmware of the Jelly 2 has been made available by Unihertz. Would be great if a LineageOS version of this could be made...
forum.xda-developers.com
Or
[HOWTO] Flash a blank vbmeta
Hey guys, As some of you know samsung made had a bunch of different changes since the release of Android 10. It took me a week to figure it out but it was really simple. I had to do two things: Repatch the the magisk boot image with Preserve AVB...
forum.xda-developers.com

I found the crash point in Jelly2_JP.
The crash point is CHECK() on line 772 of twrp/hardware/interfaces/keymaster/4.0/support/Keymaster.cpp.
C++:
CHECK(error == ErrorCode::OK)
<< "Failed to get HMAC parameters from " << *keymaster << " error " << error;
CHECK() is defined on line 495 of twrp/system/core/base/include/android-base/logging.h
C++:
#define CHECK(x) \
LIKELY((x)) || ABORT_AFTER_LOG_FATAL_EXPR(false) || \
::android::base::LogMessage(__FILE__, __LINE__, ::android::base::DEFAULT, \
::android::base::FATAL, _LOG_TAG_INTERNAL, -1) \
.stream() \
<< "Check failed: " #x << " "
I thought /system/bin/recovery was crashing due to a bug.
But it is not a bug.
/system/bin/recovery is programmed to abort if CHECK() fails.
Next, I compared the results of CHECK().
1. using your recovery.img for Jelly2_TEE.
Code:
$ adb shell
Jelly2_TEE:/ # uname -a
Linux localhost 4.14.141+ #15 SMP PREEMPT Wed May 19 11:04:10 CST 2021 aarch64
Jelly2_TEE:/ # mount -o ro /dev/block/mapper/vendor /vendor
Jelly2_TEE:/ # md5sum /vendor/lib64/libkeymaster4.so
17f162aedb3a9584e51d7f732ebbac7f /vendor/lib64/libkeymaster4.so
Jelly2_TEE:/ # umount /vendor
Jelly2_TEE:/ # md5sum /vendor/lib64/libkeymaster4.so
22ede18944c5f47daf04d699a72717b2 /vendor/lib64/libkeymaster4.so
Jelly2_TEE:/ # logcat -v brief -d -s /system/bin/recovery
E//system/bin/recovery( 324): Failed to get IAshmemDeviceService.
W//system/bin/recovery( 324): [libfs_mgr]Warning: unknown flag: resize
W//system/bin/recovery( 324): [libfs_mgr]Warning: unknown flag: resize
I//system/bin/recovery( 324): [libfs_mgr]Created logical partition product on device /dev/block/dm-0
I//system/bin/recovery( 324): [libfs_mgr]Created logical partition system on device /dev/block/dm-1
I//system/bin/recovery( 324): [libfs_mgr]Created logical partition vendor on device /dev/block/dm-2
W//system/bin/recovery( 324): DM_DEV_STATUS failed for system_image: No such device or address
W//system/bin/recovery( 324): DM_DEV_STATUS failed for vendor_image: No such device or address
W//system/bin/recovery( 324): DM_DEV_STATUS failed for product_image: No such device or address
I//system/bin/recovery( 324): fscrypt_initialize_systemwide_keys
I//system/bin/recovery( 324): List of Keymaster HALs found:
I//system/bin/recovery( 324): Keymaster HAL #1: HardwareKeymasterDevice from TrustKernel SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default
F//system/bin/recovery( 324): Keymaster.cpp:150] Check failed: error == ErrorCode::OK Failed to get HMAC parameters from HardwareKeymasterDevice from TrustKernel SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default error SECURE_HW_COMMUNICATION_FAILED
2. using my recovery.img for Jelly2_JP.
This is built with Jelly2_JP's kernel and /vendor/*.
Code:
$ adb shell
Jelly2_JP:/ # uname -a
Linux localhost 4.14.141+ #5 SMP PREEMPT Wed May 19 12:15:37 CST 2021 aarch64
Jelly2_JP:/ # mount -o ro /dev/block/mapper/vendor /vendor
Jelly2_JP:/ # md5sum /vendor/lib64/libkeymaster4.so
17f162aedb3a9584e51d7f732ebbac7f /vendor/lib64/libkeymaster4.so
Jelly2_JP:/ # umount /vendor
Jelly2_JP:/ # md5sum /vendor/lib64/libkeymaster4.so
17f162aedb3a9584e51d7f732ebbac7f /vendor/lib64/libkeymaster4.so
Jelly2_JP:/ # logcat -v brief -d -s /system/bin/recovery
E//system/bin/recovery( 327): Failed to get IAshmemDeviceService.
W//system/bin/recovery( 327): [libfs_mgr]Warning: unknown flag: resize
W//system/bin/recovery( 327): [libfs_mgr]Warning: unknown flag: resize
I//system/bin/recovery( 327): [libfs_mgr]Created logical partition product on device /dev/block/dm-0
I//system/bin/recovery( 327): [libfs_mgr]Created logical partition system on device /dev/block/dm-1
I//system/bin/recovery( 327): [libfs_mgr]Created logical partition vendor on device /dev/block/dm-2
W//system/bin/recovery( 327): DM_DEV_STATUS failed for system_image: No such device or address
W//system/bin/recovery( 327): DM_DEV_STATUS failed for vendor_image: No such device or address
W//system/bin/recovery( 327): DM_DEV_STATUS failed for product_image: No such device or address
I//system/bin/recovery( 327): fscrypt_initialize_systemwide_keys
I//system/bin/recovery( 327): List of Keymaster HALs found:
I//system/bin/recovery( 327): Keymaster HAL #1: HardwareKeymasterDevice from TrustKernel SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default
F//system/bin/recovery( 327): Keymaster.cpp:150] Check failed: error == ErrorCode::OK Failed to get HMAC parameters from HardwareKeymasterDevice from TrustKernel SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default error SECURE_HW_COMMUNICATION_FAILED
They are same Error code SECURE_HW_COMMUNICATION_FAILED.
Unfortunately, my recovery.img wasn't improved from your recovery.img when used with Jelly2_JP.

I'm sorry for the continuous posting.
I solved the decryption by modifying omni_Jelly2_JP.mk as follows.
Code:
PRODUCT_NAME := omni_Jelly2_JP
PRODUCT_DEVICE := Jelly2_JP
PRODUCT_MODEL := Jelly2_JP
PRODUCT_BOARD := g55v71c2k_dfl_jp_felica
BUILD_FINGERPRINT := "Unihertz/Jelly2_JP/Jelly2_JP:10/QP1A.190711.020/root.20210422.092852:user/release-keys"
PRODUCT_BUILD_PROP_OVERRIDES += \
TARGET_DEVICE=Jelly2_JP \
PRODUCT_NAME=Jelly2_JP \
PRIVATE_BUILD_DESC="Jelly2-user 10 QP1A.190711.020 root.20210422.092852 release-keys"
My mistake was that I only replaced "Jelly2_TEE" with "Jelly2_JP".
I had to replace "Jelly2" with "Jelly2_JP".
Anyway, now I can display the decryption screen.
Next, I tried HOW-TO-PATCH.md.
However, the touch screen does not respond on the patched kernel.
Code:
$ head -n 1 symbl_tee.txt
ffffff81dd680800 T do_undefinstr
$ grep get_boot_mode symbl_tee.txt
ffffff81ddda5b30 T get_boot_mode
$ zcat twrp/device/Unihertz/Jelly2_TEE/prebuilt/Image.gz > Image
$ aarch64-linux-android-objdump -D -b binary -m aarch64 --adjust-vma=0xffffff81dd680000 --start-address=0xffffff81ddda5b30 Image| head
ffffff81ddda5b30: d0009cc8 adrp x8, 0xffffff81df13f000
ffffff81ddda5b34: b947ad09 ldr w9, [x8,#1964]
ffffff81ddda5b38: 7100093f cmp w9, #0x2
I think you are using a different technique to enable the touch screen, because "cmp w9, #0x2" is not patched to "cmp w9, #0x0".
Please teach me your technique after you are not busy with work.

谢谢你,我用的是中国的没有Google Play的版本,按照你的步骤成功了,不过在安装完recovery.img之后,内部存储有可能无法写入,需要在recovery里删除data分区,然后就可以了

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?

@karoooo
Sorry for not responding to you, for some reason email notifications from XDA were stopped. Please tell me if you still need patched kernel, I will try to patch it explain you the technique.

zxczxc4 said:
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?
Click to expand...
Click to collapse
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.

@Meetoul
Thank you for your response.
Yes, yes, yes!
I want to know your technique.
Best Regards.

HI.
Summary: FRONT CAMERA not working after Bootloader Unlock
I am using Jelly2_JP (on latest Android 10) and I was wondering,
has anyone has experinced the Front Camera not working after Bootloader Unlock, and possibly the three " --disable-verification --disable-verity" commands?
The stock camera app won't recognize the front camera (not front/back switch button where there should be one), and other apps cant use the front camera either.
I can confirm that the front camera worked before unlocking the bootloader.
Reflashing stock image using SP Flash Tool and relocking Bootlader did not fix the issue.
Is anyone else experiencing the same issue?

karoooo said:
@Meetoul
Thank you for your response.
Yes, yes, yes!
I want to know your technique.
Best Regards.
Click to expand...
Click to collapse
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...

@Meetoul
I wanted to learn your technique so that I could work on my own when Android 11 was released.
If Android 11 is formidable, prioritize working with Android 11.
Unfortunately, Android 11 for Jelly2_JP has not been released yet.
@kendzhi
I unlocked the bootloader with Jelly2_JP, but the front camera is still working.

@karoooo
Thank you for the reply!
May I ask, was your Jelly2_JP shipped before the latest Andorid 10 update (2021051912_g55v71c2k_dfl_jp_felica), meaning did your phone come with the previous Firmware (2020101915_g55v71c2k_dfl_jp_felica)?
I have two Jelly2_JP from Japan which came preshipped with the latest andorid Andorid 10 update (there was no need for OTA update). And in both phones, upon executing "fastboot flashing unlock" (without disableling AVB & without Rooting), the the front camera stopped working (not recognized by the system).
I even went into the Debug/Diagnostic? mode that was in Chinese (Booting by Vol down + Connecting to PC via USB), and peformed a hardware test for the Front Camera and the test froze the phone.
So I'm suspecting that Jelly2_JP that was shipped to Japan with the latest Firmware has some issues with Bootloader Unlocking breaking the Front Cam...

Related

SM-G361F - Pre-rooted rom development

Hello,
I'm not able to build (repackage) correctly system.img for SM-G361F, output is always rejected by both Odin (10.3.7) and Heimdall
I'm trying to repackage (pre-root) system.img taken from "G361FXXU1APA2_G361FOXX1APA1_G361FXXU1APA2_HOME.tar.md5" (taken from ETL factory image named ETL-G361FXXU1APA2-20160202095551.zip )
Step-by-step:
1) tar xvf G361FXXU1APA2_G361FOXX1APA1_G361FXXU1APA2_HOME.tar.md5 system.img
2) simg2img system.img system.img.raw
3) mount system.img.raw /mnt
4) made changes
5a) make_ext4fs -s -g 32768 -b 4096 -T -1 -S file_contexts -f -l 1843M system.repack.img /mnt/
5b) mkuserimg.sh -s /mnt system.repack.img ext4 system 1843M file_contexts
6) tar --owner 0 --group 0 --numeric-owner -H ustar -c system.img > G361F_SYSTEM.tar
7a) Load either system.img through Heimdall (PIT file downloaded through Heimdall is here: http://forum.xda-developers.com/showpost.php?p=65779994&postcount=146 )
7b) Load G361F_SYSTEM.tar in Odin v3.10.7 in AP tab and flash it
On ODIN/Download screen I can see that
1) FRP LOCK: OFF
2) KNOX: 0x0
3) System status: official
4) RP SWREV: S1, L1, M1
Notes
1) I have checked the box "OEM Unlock" in Developers settings to enabled
2) "file_contexts" is taken from booted up device through ADB (adb pull /file_contexts)
3) I've tried repackage the image without making any changes
4) When I compare original and repackaged images ("ls -lsaR" outputs), it seems like owner:group permissions are not persisted
5) I've tried both simg2img/make_ext4fs/mkuserimg.sh from CM12.1 repository (up to date today) and from https://github.com/ASdev/android_img_repack_tools (branch android-5.1.1)
6) I'm not sure about size 1843M, however flashing fails in the same manner when I go with 1536M and 2048M and anything between those two
7) Heimdall fails at about 6% of flashing single (sparse system.img) file with error "Failed to unpack received packet"
OSS Kernel for SM-G361F is here: https://github.com/smarek/G361F-Kernel
OSS Platform for SM-G361F is here: https://github.com/smarek/G361F-Platform
Questions are:
1) Is there anything special to be aware of when building for Samsung devices?
2) Did I miss or misunderstood any step in system.img repackaging process?

Fetching TWG10 Factory imgs+Introduction of Android Device Drivers

Notice : , First of all ,you are responsible for any damages on your tablet and I do not accept any responsibility for that , by reading and doing these procedures , you have already accepted its responsibility by yourself only , secondly this knowledge for Dev people much more ! , of course its written such way that newbies can understand too .
Click to expand...
Click to collapse
Before starting about fetching Stock ROM of TWG10 , maybe you ask ,what is TWG10 ? which Tablet is it ? ,so you can know and Find it from here : Introduction of Datamini TWG10 .
So , we pay attention some introduction and requirements in some steps then considering to the main .
Using of Ubuntu has far better features and advantage respect to Windows to fetch the Stock ROM of any Android devices , So we use Ubuntu too.
First Step is to Install ADB and Fastboot for Ubuntu from here using Terminal of Ubuntu.
Second step is to root your device , Rooting will be released so many privileges that make us to fetch the Stock ROM of any Android Devices .
One of the common and famous way of rooting Android devices is booting TWRP recovery from fastboot and Flashing SuperSu, but when there is no TWRP recovery for your device , you can port and compile it for your device : Porting TWRP From Source .
But always there is a final and better way to root your device which is so easy too -> UNIVERSAL GUIDE for Rooting Any Android Device Manually ! which has worked and been tested on Intel Atom based processor devices .
<<Fetching Factory Imgs>> :
After installing the SU ,now we can access to Android partition scheme of TWG10 , just connect your device through its cable to your PC (Ubuntu) , hoping you have already made USB debugging on in Developer options , just open a new terminal and write
Code:
adb devices
, you should see Baytrail000... in the last line , now command in the terminal ,
Code:
adb shell
and then when it starts , you will see your phone code name ,[email protected]_phone_32:/$ ,it means now you can get controlled fully of your tablet , just type
Code:
su
and press Enter , the information of Android partition scheme is located in /dev/block/platform/dw_mmc/by-name such that , the dw_mmc for TWG10 is 808060F14:00 let's use
Code:
ls -l /dev/block/platform/808060F14:00/by-name
to find locations of , boot.img , system.img, recovery.img and so on(Factory imgs) you will see such below photo : ( you can save this info in your internal storage ,
Code:
ls -la /dev/block/platform/808060F14:00/by-name > sdcard/your selective name.txt
)
also by commanding cat /proc/partition in terminal , you find some info about your tablet partition too
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
As you see ,you can find location of each img file in your device for example : boot.img is in /dev/block/mmcblk0p5 now its time to fetch them using
Code:
dd if=Directory of source of=Directory of Destination
for example :
Code:
dd if=/dev/block/mmcblk0p5 of=/sdcard/boot.img
sdcard is absolute location of your Internal storage :/storage/emulated/legancy.(Notice : NEVER TOUCH basic_data_partition , its data of your windows OS , NEVER TOUCH ESP , its location of your UEFI bios insyde software , NEVER TOUCH Microsoft_reserve_partition , the only img files that you need to dd is boot.img. fastboot.img (bootloader) , system.img, recovery.img ,config.img ,factory.img, these two contains vendor.img and radio.img related connectivity and WIFI)
after fetching all imgs of stock ROM (Factory imgs) of TWG10 , its the time to pull them to your PC .
Just type exit and enter , write in the terminal ,
Code:
adb pull /sdcard/"img File" /" your selective Directory in your PC"
for example :
Code:
adb pull /sdcard/boot.img /home/amir/twg10_imgs
.
Do not worry , if you cant fetch all factory images , you can download them from here :Factory imgs of TWG10
But the important question is : why we need those factory imgs ? because when the Android OS gets damaged and its not booted up or in boot looping condition, we can survive it in below instruction :
Reviving TWG10 Android OS by Flashing Factory imgs via Fastboot:
open a new terminal in the directory which those factory images are there and placed and then write in the terminal :
Code:
adb reboot -bootloader
(we will boot to fastboot)
after restarting :
Code:
sudo fastboot devices
now we need to unlock bootloader for flashing
Code:
sudo fastboot oem unlock
sudo fastboot flashing unlock
sudo fastboot reboot bootloader
after restarting to bootloader ,you should press volume up to enter to fastboot
now its the time for erasing necessary partition, as we saw , ls -l /dev/block/platform/808060F14:00/by-name , shows the portions by name for example /dev/block/mmcblk0p5 is called boot .
so we use this code sudo fastboot erase 'partition by name'
Code:
sudo fastboot erase boot
sudo fastboot erase cache
sudo fastboot erase recovery
sudo fastboot erase date (userdata)
sudo fastboot erase system
now flashing 'partition by name'
sudo fastboot flash 'partition by name' 'img file association'
Code:
sudo fastboot flash boot boot.img
sudo fastboot flash fastboot fastboot.img (flashing bootloader)
sudo fastboot reboot bootloader (reboot to fastboot)
sudo fastboot flash recovery recovery.img
sudo fastboot flash system system.img
sudo fastboot flash config config.img (this is radio.img)
sudo fastboot flash factory factory.img (this is vendor.img)
sudo fastboot reboot
Congratulation ! your stock Android revived !
you can also download and install any Android X86 on your TWG10 , you can make bootable flash memory using Rufus but its important to say , you should use GPT Partition scheme for UEFI in partition scheme and target system type , another important notice is : when your bootable flash memory gets ready , you should open your flash memory and go to /boot/grub and open grub.cfg by gedit and modify it , after root=/dev/ram0 you should "space" and type nomodeset vga=5785 for live , debug and installation and then save , otherwise it wont be booted into TWG10!.
By pressing ESC before going to any OS ,you can select the bootable flash memory in boot manager and enter to boot menu of android X86 , if you did not modify the grub.cfg , you can press E in boot menu of Android X86 installation and modify it ( type and add nomodeset vga=5785 after root=/dev/ram0) and press F10 , but because of the orientation of tablet is in horizontal , maybe its difficult to modify , so its better to modify it before booting the flash memory and its better to install Android X86 on a SD card or another flash memory , because 32 GB is not enough for 3 OSs!
Another notice is you should pay attention to above partition scheme in the time of Android X86 installation.
but when you booted up the Android X86 , nothing works , touch , rotation ,sound and ......
this is because of no one of Android Drivers is installed for TWG10 , so we pay attention to ->
<<Introduction of Android Device Drivers >>
lets your TWG10 is connected to your PC.
Android Device Drivers (modules) are C program in fact , they are kind of modules which will be added to kernel of Android OS and they load and unload in the time of demand , these C program files after compiling ,they convert to the files with extension .ko , these .ko Files are located in /lib/modules .
these ko files are taking care of Device functionality (how they perform and operate) and files of hardware devices( such HDMI , hard disk , sound , touchscreen , WIFI...) are located in /dev
you can see the files of hardware devices using these codes in a terminal :
Code:
adb shell
ls -l /dev/i2c-1
you will see
Code:
crw------- root root 89, 1 2017-11-11 01:02 i2c-1
if the first letter is C its character device , 89 is major number using for identify the driver (which module or .ko file is used for this device file) , after 89 , there is a ',' and then 1 its a minor number which is used to distinguish between devices with same driver ,
for example if we write
Code:
adb shell
ls -l /dev/i2c-2
you will see
Code:
crw------- root root 89, 2 2017-11-11 01:02 i2c-2
i2c-2 used same driver file (major number is same) but another device file (minor number different)
we have two type devices , block devices and character devices.
block devices have a buffer for a request so they can have best response , block devices takes input and gives output only , but character devices can takes so many inputs and give so many outputs .
to see blocks and character devices on your TWG10 , you can use below codes :
Code:
adb shell
cat proc/devices
to create a device file ,using this code :
open a terminal :
Code:
mknod dev/'device name' 'major number' 'minor number'
for example :
Code:
adb shell
mknod dev/i2c 89 3
In fact modules (device drivers ) and devices file (hardware) are connect to each other by major number .
You can pull modules which are control the functionality of devices (hardware) in your PC from the stock Android using ADB and Ubuntu Terminal :
just open a new Terminal , type :
Code:
adb devices
adb pull /lib/modules 'A directory in your PC"
now if you want to see these .ko files are about which Device Driver , just open a terminal in the directory that .ko files are type :
Code:
modinfo 'name of the ko file'
for example
Code:
modinfo 8723bs.ko
We can also see Device Drivers which are activated by using lsmod or cat /proc/modules :
open a new terminal and type :
Code:
adb shell
lsmode or cat/proc/modules
For adding a driver or module to the kernel ,
open a terminal in the directory of .ko file where you pulled them into your PC
Code:
adb push 'directory of modules(drivers) in the PC' /lib/modules
adb shell
modprobe 'the pushed file name'
for example :
Code:
adb push /home/amir/twg10_imgs/drivers /lib/modules
adb shell
modprobe 8723bs
also with insmod command , we can add a driver to the kernel , but its dependencies command , we should add other related driver(module) too.
for example
Code:
adb shell
insmod ./8723bs.ko
the story still has not be started , it will be continued !
amirhtc said:
Before starting about fetching Stock ROM of TWG10 , maybe you ask ,what is TWG10 ? which Tablet is it ? ,so you can know and Find it from here : Introduction of Datamini TWG10 .
So , we pay attention some introduction and requirements in some steps then considering to the main .
Using of Ubuntu has far better features and advantage respect to Windows to fetch the Stock ROM of any Android devices , So we use Ubuntu too.
First Step is to Install ADB and Fastboot for Ubuntu from here using Terminal of Ubuntu.
Second step is to root your device , Rooting will be released so many privileges that make us to fetch the Stock ROM of any Android Devices .
One of the common and famous way of rooting Android devices is booting TWRP recovery from fastboot and Flashing SuperSu, but when there is no TWRP recovery for your device , you can port and compile it for your device : Porting TWRP From Source .
But always there is a final and better way to root your device which is so easy too -> UNIVERSAL GUIDE for Rooting Any Android Device Manually ! which has worked and been tested on Intel Atom based processor devices .
<<Fetching Factory Imgs>> :
After installing the SU ,now we can access to Android partition scheme of TWG10 , just connect your device through its cable to your PC (Ubuntu) , hoping you have already made USB debugging on in Developer options , just open a new terminal and write
Code:
adb devices
, you should see Baytrail000... in the last line , now command in the terminal ,
Code:
adb shell
and then when it starts , you will see your phone code name ,[email protected]_phone_32:/$ ,it means now you can get controlled fully of your tablet , just type
Code:
su
and press Enter , the information of Android partition scheme is located in /dev/block/platform/dw_mmc/by-name such that , the dw_mmc for TWG10 is 808060F14:00 let's use
Code:
ls -l /dev/block/platform/808060F14:00/by-name
to find locations of , boot.img , system.img, recovery.img and so on(Factory imgs) you will see such below photo : ( you can save this info in your internal storage ,
Code:
ls -la /dev/block/platform/808060F14:00/by-name > sdcard/your selective name.txt
)
also by commanding cat /proc/partition in terminal , you find some info about your tablet partition too
As you see ,you can find location of each img file in your device for example : boot.img is in /dev/block/mmcblk0p5 now its time to fetch them using
Code:
dd if=Directory of source of=Directory of Destination
for example :
Code:
dd if=/dev/block/mmcblk0p5 of=/sdcard/boot.img
sdcard is absolute location of your Internal storage :/storage/emulated/legancy.(Notice : NEVER TOUCH basic_data_partition , its data of your windows OS , NEVER TOUCH ESP , its location of your UEFI bios insyde software , NEVER TOUCH Microsoft_reserve_partition , the only img files that you need to dd is boot.img. fastboot.img (bootloader) , system.img, recovery.img ,config.img ,factory.img, these two contains vendor.img and radio.img related connectivity and WIFI)
after fetching all imgs of stock ROM (Factory imgs) of TWG10 , its the time to pull them to your PC .
Just type exit and enter , write in the terminal ,
Code:
adb pull /sdcard/"img File" /" your selective Directory in your PC"
for example :
Code:
adb pull /sdcard/boot.img /home/amir/twg10_imgs
.
Do not worry , if you cant fetch all factory images , you can download them from here :Factory imgs of TWG10
But the important question is : why we need those factory imgs ? because when the Android OS gets damaged and its not booted up or in boot looping condition, we can survive it in below instruction :
Reviving TWG10 Android OS by Flashing Factory imgs via Fastboot:
open a new terminal in the directory which those factory images are there and placed and then write in the terminal :
Code:
adb reboot -bootloader
(we will boot to fastboot)
after restarting :
Code:
sudo fastboot devices
now we need to unlock bootloader for flashing
Code:
sudo fastboot oem unlock
sudo fastboot flashing unlock
sudo fastboot reboot bootloader
after restarting to bootloader ,you should press volume up to enter to fastboot
now its the time for erasing necessary partition, as we saw , ls -l /dev/block/platform/808060F14:00/by-name , shows the portions by name for example /dev/block/mmcblk0p5 is called boot .
so we use this code sudo fastboot erase 'partition by name'
Code:
sudo fastboot erase boot
sudo fastboot erase cache
sudo fastboot erase recovery
sudo fastboot erase date (userdata)
sudo fastboot erase system
now flashing 'partition by name'
sudo fastboot flash 'partition by name' 'img file association'
Code:
sudo fastboot flash boot boot.img
sudo fastboot flash fastboot fastboot.img (flashing bootloader)
sudo fastboot reboot bootloader (reboot to fastboot)
sudo fastboot flash recovery recovery.img
sudo fastboot flash system system.img
sudo fastboot flash config config.img (this is radio.img)
sudo fastboot flash factory factory.img (this is vendor.img)
sudo fastboot reboot
Congratulation ! your stock Android revived !
you can also download and install any Android X86 on your TWG10 , you can make bootable flash memory using Rufus but its important to say , you should use GPT Partition scheme for UEFI in partition scheme and target system type , another important notice is : when your bootable flash memory gets ready , you should open your flash memory and go to /boot/grub and open grub.cfg by gedit and modify it , after root=/dev/ram0 you should "space" and type nomodeset vga=5785 for live , debug and installation and then save , otherwise it wont be booted into TWG10!.
By pressing ESC before going to any OS ,you can select the bootable flash memory in boot manager and enter to boot menu of android X86 , if you did not modify the grub.cfg , you can press E in boot menu of Android X86 installation and modify it ( type and add nomodeset vga=5785 after root=/dev/ram0) and press F10 , but because of the orientation of tablet is in horizontal , maybe its difficult to modify , so its better to modify it before booting the flash memory and its better to install Android X86 on a SD card or another flash memory , because 32 GB is not enough for 3 OSs!
Another notice is you should pay attention to above partition scheme in the time of Android X86 installation.
but when you booted up the Android X86 , nothing works , touch , rotation ,sound and ......
this is because of no one of Android Drivers is installed for TWG10 , so we pay attention to ->
<<Introduction of Android Device Drivers >>
lets your TWG10 is connected to your PC.
Android Device Drivers (modules) are C program in fact , they are kind of modules which will be added to kernel of Android OS and they load and unload in the time of demand , these C program files after compiling ,they convert to the files with extension .ko , these .ko Files are located in /lib/modules .
these ko files are taking care of Device functionality (how they perform and operate) and files of hardware devices( such HDMI , hard disk , sound , touchscreen , WIFI...) are located in /dev
you can see the files of hardware devices using these codes in a terminal :
Code:
adb shell
ls -l /dev/i2c-1
you will see
Code:
crw------- root root 89, 1 2017-11-11 01:02 i2c-1
if the first letter is C its character device , 89 is major number using for identify the driver (which module or .ko file is used for this device file) , after 89 , there is a ',' and then 1 its a minor number which is used to distinguish between devices with same driver ,
for example if we write
Code:
adb shell
ls -l /dev/i2c-2
you will see
Code:
crw------- root root 89, 2 2017-11-11 01:02 i2c-2
i2c-2 used same driver file (major number is same) but another device file (minor number different)
we have two type devices , block devices and character devices.
block devices have a buffer for a request so they can have best response , block devices takes input and gives output only , but character devices can takes so many inputs and give so many outputs .
to see blocks and character devices on your TWG10 , you can use below codes :
Code:
adb shell
cat proc/devices
to create a device file ,using this code :
open a terminal :
Code:
mknod dev/'device name' 'major number' 'minor number'
for example :
Code:
adb shell
mknod dev/i2c 89 3
In fact modules (device drivers ) and devices file (hardware) are connect to each other by major number .
You can pull modules which are control the functionality of devices (hardware) in your PC from the stock Android using ADB and Ubuntu Terminal :
just open a new Terminal , type :
Code:
adb devices
adb pull /lib/modules 'A directory in your PC"
now if you want to see these .ko files are about which Device Driver , just open a terminal in the directory that .ko files are type :
Code:
modinfo 'name of the ko file'
for example
Code:
modinfo 8723bs.ko
We can also see Device Drivers which are activated by using lsmod or cat /proc/modules :
open a new terminal and type :
Code:
adb shell
lsmode or cat/proc/modules
For adding a driver or module to the kernel ,
open a terminal in the directory of .ko file where you pulled them into your PC
Code:
adb push 'directory of modules(drivers) in the PC' /lib/modules
adb shell
modprobe 'the pushed file name'
for example :
Code:
adb push /home/amir/twg10_imgs/drivers /lib/modules
adb shell
modprobe 8723bs
also with insmod command , we can add a driver to the kernel , but its dependencies command , we should add other related driver(module) too.
for example
Code:
adb shell
insmod ./8723bs.ko
the story still has not be started , it will be continued !
Click to expand...
Click to collapse
Is it possible to get a copy of your files?
Upload factory image
If you can, kindly please upload the factory images again
If possible in google drive
Atleat it won't get deleted
amirhtc said:
Before starting about fetching Stock ROM of TWG10 , maybe you ask ,what is TWG10 ? which Tablet is it ? ,so you can know and Find it from here : Introduction of Datamini TWG10 .
So , we pay attention some introduction and requirements in some steps then considering to the main .
Using of Ubuntu has far better features and advantage respect to Windows to fetch the Stock ROM of any Android devices , So we use Ubuntu too.
First Step is to Install ADB and Fastboot for Ubuntu from here using Terminal of Ubuntu.
Second step is to root your device , Rooting will be released so many privileges that make us to fetch the Stock ROM of any Android Devices .
One of the common and famous way of rooting Android devices is booting TWRP recovery from fastboot and Flashing SuperSu, but when there is no TWRP recovery for your device , you can port and compile it for your device : Porting TWRP From Source .
But always there is a final and better way to root your device which is so easy too -> UNIVERSAL GUIDE for Rooting Any Android Device Manually ! which has worked and been tested on Intel Atom based processor devices .
<<Fetching Factory Imgs>> :
After installing the SU ,now we can access to Android partition scheme of TWG10 , just connect your device through its cable to your PC (Ubuntu) , hoping you have already made USB debugging on in Developer options , just open a new terminal and write
Code:
adb devices
, you should see Baytrail000... in the last line , now command in the terminal ,
Code:
adb shell
and then when it starts , you will see your phone code name ,[email protected]_phone_32:/$ ,it means now you can get controlled fully of your tablet , just type
Code:
su
and press Enter , the information of Android partition scheme is located in /dev/block/platform/dw_mmc/by-name such that , the dw_mmc for TWG10 is 808060F14:00 let's use
Code:
ls -l /dev/block/platform/808060F14:00/by-name
to find locations of , boot.img , system.img, recovery.img and so on(Factory imgs) you will see such below photo : ( you can save this info in your internal storage ,
Code:
ls -la /dev/block/platform/808060F14:00/by-name > sdcard/your selective name.txt
)
also by commanding cat /proc/partition in terminal , you find some info about your tablet partition too
As you see ,you can find location of each img file in your device for example : boot.img is in /dev/block/mmcblk0p5 now its time to fetch them using
Code:
dd if=Directory of source of=Directory of Destination
for example :
Code:
dd if=/dev/block/mmcblk0p5 of=/sdcard/boot.img
sdcard is absolute location of your Internal storage :/storage/emulated/legancy.(Notice : NEVER TOUCH basic_data_partition , its data of your windows OS , NEVER TOUCH ESP , its location of your UEFI bios insyde software , NEVER TOUCH Microsoft_reserve_partition , the only img files that you need to dd is boot.img. fastboot.img (bootloader) , system.img, recovery.img ,config.img ,factory.img, these two contains vendor.img and radio.img related connectivity and WIFI)
after fetching all imgs of stock ROM (Factory imgs) of TWG10 , its the time to pull them to your PC .
Just type exit and enter , write in the terminal ,
Code:
adb pull /sdcard/"img File" /" your selective Directory in your PC"
for example :
Code:
adb pull /sdcard/boot.img /home/amir/twg10_imgs
.
Do not worry , if you cant fetch all factory images , you can download them from here :Factory imgs of TWG10
But the important question is : why we need those factory imgs ? because when the Android OS gets damaged and its not booted up or in boot looping condition, we can survive it in below instruction :
Reviving TWG10 Android OS by Flashing Factory imgs via Fastboot:
open a new terminal in the directory which those factory images are there and placed and then write in the terminal :
Code:
adb reboot -bootloader
(we will boot to fastboot)
after restarting :
Code:
sudo fastboot devices
now we need to unlock bootloader for flashing
Code:
sudo fastboot oem unlock
sudo fastboot flashing unlock
sudo fastboot reboot bootloader
after restarting to bootloader ,you should press volume up to enter to fastboot
now its the time for erasing necessary partition, as we saw , ls -l /dev/block/platform/808060F14:00/by-name , shows the portions by name for example /dev/block/mmcblk0p5 is called boot .
​so we use this code sudo fastboot erase 'partition by name'
Code:
sudo fastboot erase boot
sudo fastboot erase cache
sudo fastboot erase recovery
sudo fastboot erase date (userdata)
sudo fastboot erase system
now flashing 'partition by name'
sudo fastboot flash 'partition by name' 'img file association'
Code:
sudo fastboot flash boot boot.img
sudo fastboot flash fastboot fastboot.img (flashing bootloader)
sudo fastboot reboot bootloader (reboot to fastboot)
sudo fastboot flash recovery recovery.img
sudo fastboot flash system system.img
sudo fastboot flash config config.img (this is radio.img)
sudo fastboot flash factory factory.img (this is vendor.img)
sudo fastboot reboot
Congratulation ! your stock Android revived !
you can also download and install any Android X86 on your TWG10 , you can make bootable flash memory using Rufus but its important to say , you should use GPT Partition scheme for UEFI in partition scheme and target system type , another important notice is : when your bootable flash memory gets ready , you should open your flash memory and go to /boot/grub and open grub.cfg by gedit and modify it , after root=/dev/ram0 you should "space" and type nomodeset vga=5785 for live , debug and installation and then save , otherwise it wont be booted into TWG10!.
By pressing ESC before going to any OS ,you can select the bootable flash memory in boot manager and enter to boot menu of android X86 , if you did not modify the grub.cfg , you can press E in boot menu of Android X86 installation and modify it ( type and add nomodeset vga=5785 after root=/dev/ram0) and press F10 , but because of the orientation of tablet is in horizontal , maybe its difficult to modify , so its better to modify it before booting the flash memory and its better to install Android X86 on a SD card or another flash memory , because 32 GB is not enough for 3 OSs!
Another notice is you should pay attention to above partition scheme in the time of Android X86 installation.
​but when you booted up the Android X86 , nothing works , touch , rotation ,sound and ......
this is because of no one of Android Drivers is installed for TWG10 , so we pay attention to ->
<<Introduction of Android Device Drivers >>
lets your TWG10 is connected to your PC.
Android Device Drivers (modules) are C program in fact , they are kind of modules which will be added to kernel of Android OS and they load and unload in the time of demand , these C program files after compiling ,they convert to the files with extension .ko , these .ko Files are located in /lib/modules .
these ko files are taking care of Device functionality (how they perform and operate) and files of hardware devices( such HDMI , hard disk , sound , touchscreen , WIFI...) are located in /dev
you can see the files of hardware devices using these codes in a terminal :
Code:
adb shell
ls -l /dev/i2c-1
you will see
Code:
crw------- root root 89, 1 2017-11-11 01:02 i2c-1
if the first letter is C its character device , 89 is major number using for identify the driver (which module or .ko file is used for this device file) , after 89 , there is a ',' and then 1 its a minor number which is used to distinguish between devices with same driver ,
for example if we write
Code:
adb shell
ls -l /dev/i2c-2
you will see
Code:
crw------- root root 89, 2 2017-11-11 01:02 i2c-2
i2c-2 used same driver file (major number is same) but another device file (minor number different)
we have two type devices , block devices and character devices.
block devices have a buffer for a request so they can have best response , block devices takes input and gives output only , but character devices can takes so many inputs and give so many outputs .
to see blocks and character devices on your TWG10 , you can use below codes :
Code:
adb shell
cat proc/devices
to create a device file ,using this code :
open a terminal :
Code:
mknod dev/'device name' 'major number' 'minor number'
for example :
Code:
adb shell
mknod dev/i2c 89 3
In fact modules (device drivers ) and devices file (hardware) are connect to each other by major number .
You can pull modules which are control the functionality of devices (hardware) in your PC from the stock Android using ADB and Ubuntu Terminal :
just open a new Terminal , type :
Code:
adb devices
adb pull /lib/modules 'A directory in your PC"
​now if you want to see these .ko files are about which Device Driver , just open a terminal in the directory that .ko files are type :
Code:
modinfo 'name of the ko file'
for example
Code:
modinfo 8723bs.ko
​We can also see Device Drivers which are activated by using lsmod or cat /proc/modules :
open a new terminal and type :
Code:
adb shell
lsmode or cat/proc/modules
For adding a driver or module to the kernel ,
open a terminal in the directory of .ko file where you pulled them into your PC
Code:
adb push 'directory of modules(drivers) in the PC' /lib/modules
adb shell
modprobe 'the pushed file name'
for example :
Code:
adb push /home/amir/twg10_imgs/drivers /lib/modules
adb shell
modprobe 8723bs
also with insmod command , we can add a driver to the kernel , but its dependencies command , we should add other related driver(module) too.
for example
Code:
adb shell
insmod ./8723bs.ko
the story still has not be started , it will be continued !
Click to expand...
Click to collapse
please upload the factory images again

How To Guide Guide to TWRP building

TWRP for a12s
=============
1. Setup
--------
sudo apt update
sudo apt upgrade
sudo apt-get install git-all
sudo apt install python-is-python3
git config --global user.email "your email"
git config --global user.name "your name"
2. swapfile
-----------
sudo swapoff -a
sudo dd if=/dev/zero of=/swapfile bs=1G count=8
sudo mkswap /swapfile
sudo swapon /swapfile
free -m
3. repo
-------
mkdir -p ~/.bin
PATH="${HOME}/.bin:${PATH}"
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
chmod a+rx ~/.bin/repo
Basic Device Tree
==================
mkdir TWRP
cd TWRP
git init
git clone https://github.com/twrpdtgen/twrpdtgen
pip3 install twrpdtgen
sudo apt install cpio
copy stock recovery.img to ~/TWRP/twrpdtgen
cd twrpdtgen
python3 -m twrpdtgen recovery.img
rename ~/TWRP/twrpdtgen/output/samsung/a12s/omni_a12s.mk to twrp_a12s.mk
delete vendorsetup.sh
Add this to recovery.fstab
# Removable storage
/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=storage;wipeingui;removable
/usb-otg auto /dev/block/sda1 /dev/block/sda flags=display="USB-OTG";storage;wipeingui;removable
Make a copy of recovery.fstab and rename to twrp.flags
Move both files recovery.fstab and twrp.flags to recovery/root/system/etc
(create these folders)
open twrp_a12s.mk and
1. delete the 3 lines below # Inherit from those products, Most specific first.
replace those 3 lines with this
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
2. delete $(call inherit-product, vendor/omni/config/gsm.mk)
3. change omni to twrp (2 places)
open AndroidProducts.mk
change omni to twrp (4 spots)
Optional: add extra items to BoardConfig.mk
cd ~
sudo apt install git aria2 -y
git clone https://gitlab.com/OrangeFox/misc/scripts
cd scripts
sudo bash setup/android_build_env.sh
sudo bash setup/install_android_sdk.sh
• Make a directory called ~/a12s-twrp
cd ~/a12s-twrp
repo init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-11
repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j1
copy ~/TWRP/twrpdtgen/output/samsung to /a12s-twrp/device
Building
========
. build/envsetup.sh
lunch twrp_a12s-eng
mka recoveryimage
Recovery.img at out/target/product/a12s/recovery.img
Screenshots
physwizz twrp updated
For a127f u5 u6 u7
And a127m u5
Android 11 & 12
Bugs:
None reported
Installation
Next post
Code
physwizz - Repositories
physwizz has 172 repositories available. Follow their code on GitHub.
github.com
@physwizz
Installing Custom Recoveries
A. Preparation.
1. Download firmware for your device
2. Extract ap file using Zarchiver
3. Patch the ap file with a magisk which will patch both boot.img and vbmeta.img
For Exynos 850 android 11 use a21s patched magisk.
For Exynos 850 android 12 and most other devices use delta magisk
4. Unlock OEM in developer options
5. Attach phone to pc and reboot to download mode
6. flash patched ap file.
7. Download recovery.img or download twrp.tar and extract recovery.img using Zarchiver.
B.Installation
Method 1.
1. Connect to pc and boot into stock recovery
2. Factory reset
3. Reboot into download mode.
4. flash twrp.tar into the ap slot
5. reboot to recovery.
6. Advanced, terminal.
7. Type multidisabler (twice).
Or flash samsung multidisabler zip
Or, for older phones flash dmverity zip
8. Reboot to recovery
Backup boot, data, super and dtbo
9. Reboot to system
Method 2.
If you have already installed recovery and decrypted.
1. Boot to recovery.
2. Install recovery.img
3. Choose recovery partition
4. Reboot to recovery
Backup boot, data, super and dtbo
(For Pitch-black just install the zip)
Method 3.
1. Install TWRP app
2. Install TWRP
3. Choose file to flash.(don't select device)
4. Select recovery.img.
5. Reboot to recovery.
6. (You may need to change data partition to ext4 first if format ruins your system)
7. Reboot to recovery.
8. Wipe, format data, type YES.
9. Advanced, terminal.
10.Type multidisabler (twice).
Or flash samsung multidisabler zip
Or, for older phones flash dmverity zip
11.Reboot to recovery
12. Flash Magisk for root(only for method 3)
13. Backup boot, data, super and dtbo
C. Recovery Problems
Most recovery issues can be solved by attending to the following issues.
1. Did you root using the full ap file patched Magisk .
(This contains the patched boot.img and vbmeta.img)
Exynos 850 users must use the special a217 magisk?
2. Did you then go all the way through the setup process?
3. Did you download the recovery to match your baseband?
See https://t.me/a127f_res/54 for Exynos 850 recoveries
4. Did you hold down power and volume up after Odin says pass?
5. Did you format data, not just wipe?
6. Did you type multidisabler twice?
7. Did you reboot to recovery by choosing reboot from the menu and then choosing recovery?
8. To avoid touch issues go to settings and untick "allow time out"
D.To restore Stock Recovery
1. Attach phone to pc and reboot to download mode
2. flash patched ap file.
3. reboot
@physwizz
Updated version with mtp
Final version now available
physwizz said:
TWRP for a12s
=============
git config --global user.email "your email"
git config --global user.name "your name"
Basic Device Tree
==================
mkdir TWRP
cd TWRP
git init
git clone https://github.com/twrpdtgen/twrpdtgen
pip3 install twrpdtgen
sudo apt install cpio
copy stock recovery.img to ~/TWRP/twrpdtgen
cd twrpdtgen
python3 -m twrpdtgen recovery.img
rename ~/TWRP/twrpdtgen/output/samsung/a12s/omni_a12s.mk to twrp_a12s.mk
delete vendorsetup.sh
Add this to recovery.fstab
# Removable storage
/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=storage;wipeingui;removable
/usb-otg auto /dev/block/sda1 /dev/block/sda flags=display="USB-OTG";storage;wipeingui;removable
Make a copy of recovery.fstab and rename to twrp.flags
Move both files recovery.fstab and twrp.flags to recovery/root/system/etc
(create these folders)
open twrp_a12s.mk and
1. delete the 3 lines below # Inherit from those products, Most specific first.
replace those 3 lines with this
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
2. delete $(call inherit-product, vendor/omni/config/gsm.mk)
3. change omni to twrp (2 places)
open AndroidProducts.mk
change omni to twrp (4 spots)
Optional: add extra items to BoardConfig.mk
cd ~
sudo apt install git aria2 -y
git clone https://gitlab.com/OrangeFox/misc/scripts
cd scripts
sudo bash setup/android_build_env.sh
sudo bash setup/install_android_sdk.sh
• Make a directory called ~/a12s-twrp
cd ~/a12s-twrp
repo init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-11
repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j1
copy ~/TWRP/twrpdtgen/output/samsung to /a12s-twrp/device
Building
========
. build/envsetup.sh
lunch twrp_a12s-eng
mka recoveryimage
Recovery.img at out/target/product/a12s/recovery.img
Click to expand...
Click to collapse
dude im stuck at mka recoveryimage part its stuck at 96% while im creating it says there a error while creating how to solve it?? btw my phone is not samsung its oppo and its says error exit code 130 how to solve this??
Anonymous V said:
dude im stuck at mka recoveryimage part its stuck at 96% while im creating it says there a error while creating how to solve it?? btw my phone is not samsung its oppo and its says error exit code 130 how to solve this??
Click to expand...
Click to collapse
Make sure you have 8gb ram
physwizz said:
Make sure you have 8gb ram
Click to expand...
Click to collapse
Yeah i have 8gb ram but why its happening?
Anonymous V said:
Yeah i have 8gb ram but why its happening?
Click to expand...
Click to collapse
Logs?
physwizz said:
Logs?
Click to expand...
Click to collapse
ohh sorry i cant provide logs anymore sir because i reset my linux and i lost everything i tried to build again but now im getting the error in sycing the repo i dont know why
for m127F?
pando345 said:
for m127F?
Click to expand...
Click to collapse
Huh?
When I enter "repo init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-11"
I get this error
/usr/bin/env: ‘python’: No such file or directory
¡¿Kathyyy1212?! said:
When I enter "repo init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-11"
I get this error
/usr/bin/env: ‘python’: No such file or directory
Click to expand...
Click to collapse
sudo apt install python-is-python3
Check post 1 for more
physwizz said:
sudo apt install python-is-python3
Check post 1 for more
Click to expand...
Click to collapse
Thank you all working
¡¿Kathyyy1212?! said:
Thank you all working
Click to expand...
Click to collapse
Congratulations
Does anyone knows something about this error
Edne12803 said:
Does anyone knows something about this error
Click to expand...
Click to collapse
What error?
physwizz said:
What error?
Click to expand...
Click to collapse
this one... install twrp in Galaxy M12 but it starts over and over again

Definitive Guide for Windows 10 ARM installation

Hi.
You have heard of Renegade Project, for installation of Windows 10/11 ARM64 on Snapdragon 845 devices. There are many issues with the drivers, which result in Qualcomm Crash Dump or Blue screen. After multiple trials and errors, I finally figured the definitive guide for installation of Windows 10 ARM64 on OnePlus 6. This d guide does not requires installation of any drivers as all the drivers and MS Office for ARM, are preinstalled. It is a bootable recovery image of my own working build.
Although initial setup needs to be done and this will render the android system unbootable:
1. Copy parted to root of sdcard/storage of the phone
2. Boot the latest twrp recovery:
Code:
adb shell
cp /sdcard/parted /sbin/ && chmod 755 /sbin/parted
umount /data && umount /sdcard
parted /dev/block/sda
Remove all partitions Note: Android will be removed
Code:
rm 17
rm 16
rm 15
rm 14
Make necessary partitions (128GB model)
Code:
mkpart esp fat32 6559MB 7000MB
mkpart win ntfs 7000MB 120GB
mkpart pe fat32 120GB 121GB
mkpart userdata ext4 121GB 125GB
set 14 esp on
quit
Reboot to twrp and format the partitions
Code:
adb shell
mkfs.fat -F32 -s1 /dev/block/by-name/pe
mkfs.fat -F32 -s1 /dev/block/by-name/esp
mkfs.ntfs -f /dev/block/by-name/win
mke2fs -t ext4 /dev/block/by-name/userdata
Reboot to twrp and copy pe folder to adb folder:
Code:
adb push pe /sdcard/pe/
adb shell
mount /dev/block/by-name/pe /mnt
cp -r /sdcard/pe/* /mnt
Now flash the UEFI boot image for Oneplus 6 from bootloader
Code:
fastboot flash boot boot.img
Copy Backupimage.win (which was downloaded) and DISM++ to a pendrive, wait for PE image to boot. Connect usb keyborad, mouse and pendrive via USB-C Hub.
In command prompt, enter following commands:
Code:
diskpart
select disk 0
list part
select part 14
assign letter=Y
exit
Now open Dism++ARM64.exe and click on REcovery tab ---> System Restore
Browse and select backupimage.wim from pendrive, and select destination (C:\) and check "Add Boot".
Now wait patiently as i may take some time.
After Restore is finished, enter following commands in Command Prompt:
Code:
bcdedit /store Y:\efi\microsoft\boot\bcd /set {Default} testsigning on
bcdedit /store Y:\efi\microsoft\boot\bcd /set {Default} nointegritychecks on
bcdedit /store Y:\efi\microsoft\boot\bcd /set {Default} recoveryenabled no
shutdown -s -t 0
Remove all USB devices/Hub and let the phone boot.
Enjoy.
Everything except Camera, is working.
Acknowledgements:
1. TWRP
2. Renegade Project
3. Microsoft
4. Oneplus
Download Links: Mediafire Link

[SOLVED] GSI on BV 4900 Pro: "Cannot load Android system. Your data may be corrupt. "

tl;dr: I followed the procedure to flash Android's Generic System Image (gsi_gms_arm64-exp-TP1A.220624.014-8819323-8a77fef1) on my Blackview BV 4900 Pro, but I am stuck in a bootloop that ends with "Cannot load Android system. Your data may be corrupt."
In details:
Prep​I made sure that my phone could support GSI​
$adb shell getprop ro.treble.enabled
true
$adb shell cat /system/etc/ld.config.29.txt | grep -A 20 "\[vendor\]"
…
namespace.default.isolated = true
…
$adb shell getprop ro.product.cpu.abi
arm64-v8a
Additional Checks​
Bootloader is unlocked.
Device was launched with Android 9 or higher (it was launched with Android 10)
Android 13 GSIs was downloaded (build Build: TP1A.220624.014) was downloaded from https://developer.android.com/topic/generic-system-image/releases and checksum for ARM64+GMS was confirmed to be 8a77fef1842da4a4cff68e36802f779d65e52ae0cfce024a33901d5dc48d47d0.
The phone has Android Verified Boot (AVB):
$adb shell getprop ro.boot.veritymode
enforcing
Flashing​
I followed the official tutorial for flashing GSIs but changed a couple of things (I may have the order wrong, but I essentially did, once I was in fastboot mode
fastboot flashing unlock # To unlock bootloader
fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img # Disable secure boot
fastboot reboot fastboot # Restart in fastbootd
fastboot delete-logical-partition product # I didn't have enough space for Resizing 'system' (I had FAILED (remote: 'Not enough space to resize partition'))
fastboot erase system
fastboot format:ext4 system # because when I tried to flash system.img the first time, I had "Invalid sparse file format at header magic"
fastboot flash system system.img
fastboot format:ext4 userdata
fastboot erase userdata
fastboot format:ext4 metadata
fastboot erase metadata
fastboot erase cache
But when I restart, I am always prompted with
Android Recovery
Blackview /BV4900Pro_US/BV4900Pro10/…
user/release-keys
Use volume up/down and power
Can't load Android system. Your data
may be corrupt. If you continue to get
this message, you may need to perform a
factory data reset and erase all user
data stored on this device
-------------------------
Try again
Factory data reset
-------------------------
Supported API:3
I have tried to reset factory data and to reboot, but I always have the same message…
$ adb --version
Android Debug Bridge version 1.0.41
Version 33.0.3-8952118
I just realized / remembered that this phone uses super.img instead of system.img, maybe I need to repack the system.img into a super.img, following this procedure?
tl;dr: Yes, repacking the system.img into a super.img and then flashing it was key to success.
I have essentially followed what I have described here: https://forum.xda-developers.com/t/...n-blackview-bv-4900-pro.4453955/post-87029001
Except that the three images I used were the original vendor.img, the original product.img, and
aosp_arm64-exp-TP1A.220624.014-8819323-996da050/system.img (available at
Generic System Images (GSIs) | Platform | Android Developers
developer.android.com
)
I used the command
python3 lpmakesimple.py lpbinary/binary/lpmake ./super_20220510.img 4294967296 system=system.img,vendor=./vendor.img,product=./product.img
(4294967296 being picked semi-randomly: it's a multiple of the block size (65536), less than the size of the super partition but more than the size of the three images combined + some more).
That's it: I flashed that super_20220510.img using fastboot flash super super_20220510.img and it was all good!

Categories

Resources