Zhihe series LTE dongles (generic-zhihe)

Contributors

 * notfound405

How to enter flash mode
Note: only applies to stock Android system.

UFI-001C and many more with xinxun brand
By default, we get only  permission with. However, you don't have to install SuperSU or Magisk for temporary root access. The following instruction is much easier for temporary root access(need to redo after reboot):

UZ801 V3.0
adb interface is not enabled by default. To enable adb access and root permission, plug this device into your PC and use browser to access this URL: http://192.168.100.1/usb_debug.html, and then reboot your device(replug it). You'll find an adb device and get root permission with adb shell. See the section below if your device bricks.

UZ801 V3.0


Note: voltage: 1.8V

UFI103S, UFI001C(B), UFI003 etc.
They are clearly labeled on the board, the only button is the EDL button.

Note: voltage: 3.3V

Preparation
It is recommended to backup the eMMC before flashing. Refer to EDL. The original Android image contains too old firmware to boot mainline kernel, use firmwares from Dragon Board 410c as replacement. Also, you may need qhypstub as well as lk1st (lk2nd is not recommended since vendor aboot firmwares vary and have different strange quirks which causes a lot of trouble). For qhypstub and lk1st: Sadly, with the modifications above, it's impossible to boot original Android system anymore if you do not restore the original firmwares back. Say goodbye to the stock Android system, and do what you think necessary before proceeding, like modifying IMEI, switching SIM card slot and so on, since it's difficult to perform the tasks in postmarketOS.

Installation
See Qualcomm_Snapdragon_410/412_(MSM8916).

partition usage strategy
There are several strategies to make full use of the limited eMMC storage. They are listed below, feel free to add more.

Some common recommendations

 * 1) use btrfs for rootfs
 * 2) reduce the size of /boot partition to 128 MB or even smaller (64MB should be enough to hold the contents, but a slightly larger size is recommended)
 * 1) reduce the size of /boot partition to 128 MB or even smaller (64MB should be enough to hold the contents, but a slightly larger size is recommended)

Examples
Note: persist partition sits between system and userdata, and unfortunally WCNSS nv items file is stored in it, which need to be loaded during runtime for functionality of WCN36xx(WiFi). You have to backup and relocate persist partition before deleting it, or if you like, extract WCNSS_qcom_nv_items.bin and place it at /lib/firmware.
 * 1) Flash the rootfs and /boot to system partition (not recommended)
 * The volume of system partiton is too low to hold a rootfs. It works, but the free space is very low, making it painful to use.
 * 1) Flash the rootfs and /boot to userdata partition (the easiest)
 * This one is the easiest, and the volume of userdata partition should be sufficient for common uses. The drawback is that a large amount of storage space is not used.
 * 1) split /boot and rootfs, and flash them to different partitions.
 * The operation is a bit complex, but you can make use of 2 different partitions, which reduces space wasting. It is recommended to flash /boot partition to cache partition and flash rootfs to system or userdata.
 * Drawback: not officially supported.
 * Note: you may mount the other partition (usually system or userdata, if you flash /boot to cache partition) to, e.g. /var/lib/docker with /etc/fstab and localmount, so that every large partitions can be used.
 * 1) repartition
 * There are two major choices, one is to replace the entire partition table and use your custom one, the other is to do minor modification with gptfdisk, leaving most partitions untouched.
 * 1) replace the entire partition table
 * You can do it with (s)gdisk in linux,  in fastboot or edl tool in Qualcomm EDL mode.
 * No technical support here. It's dangerous and may brick your device, think twice before proceeding and be prepared to recovery your device in Qualcomm EDL mode.
 * 1) gptfdisk
 * This method is much safer than the previous one and probably will at least let the device boot to fastboot mode if you did something wrong. Generally, the easiest solution would be combining system and userdata together. You can do it with gdisk, sgdisk or any tools you like. Just delete all partitions after system and extend system to maximum.
 * No technical support here. It's dangerous and may brick your device, think twice before proceeding and be prepared to recovery your device in Qualcomm EDL mode.
 * 1) gptfdisk
 * This method is much safer than the previous one and probably will at least let the device boot to fastboot mode if you did something wrong. Generally, the easiest solution would be combining system and userdata together. You can do it with gdisk, sgdisk or any tools you like. Just delete all partitions after system and extend system to maximum.