AlienWolfX / UZ801-USB_MODEM

A repository of information about the 4G LTE USB stick with board version FY_UZ801_3.2.
MIT License
29 stars 4 forks source link

UZ801 Analysis

License

Table of Contents - [Introduction](#introduction) - [Initial](#initial) - [Firmware Dump and Restore](#firmware-dump-and-restore) - [Getting Root](#getting-root) - [View Device Display](#view-device-display) - [Modifying Web UI](#modifying-web-ui) - [Installing OpenWrt](#installing-openwrt) - [Installing Debian (6.7)](#installing-debian-based-on-67-msm8916-mainline) - [Installing Debian (5.15)](#installing-debian-based-on-515-msm8916-mainline) - [Troubleshooting](rsc/troubleshooting.md) - [Recovery](#recovery) - [References](#references) - [License](#license)

Introduction

A couple of months ago, I purchased this 4G LTE USB dongle from Shopee for around 300+ PHP. Out of curiosity, I searched the internet to see if there was a way to modify the horrible web UI of the device. Here are some images of the device along with the board and its chips.

front back
board1 board2
front back
board1 board2
front

The heart of the dongle is an MSM8916, running a stripped-down version of Android 4.4.4 KitKat. Interestingly, the setup restricts the use of the additional two CPU cores, likely to prevent the device from overheating.

The web UI is so poorly designed that you can bypass it entirely by simply changing the URL and calling main.html to access the main page.

WTF?

Device Specs

Supported Bands (According to mmcli):

| Band Type | Band Number | Frequency (MHz) | |-----------|-------------|-----------------| | UTRAN | 1 | 2100 | | UTRAN | 8 | 900 | | EUTRAN | 1 | 2100 | | EUTRAN | 3 | 1800 | | EUTRAN | 5 | 850 | | EUTRAN | 7 | 2600 | | EUTRAN | 8 | 900 | | EUTRAN | 20 | 800 | | EUTRAN | 38 | 2600 TDD | | EUTRAN | 40 | 2300 TDD | | EUTRAN | 41 | 2500 TDD |

CPUINFO

``` bash processor : 0 model name : ARMv7 Processor rev 0 (v7l) BogoMIPS : 38.40 Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 0 processor : 1 model name : ARMv7 Processor rev 0 (v7l) BogoMIPS : 38.40 Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 0 Hardware : Qualcomm Technologies, Inc MSM8916 Revision : 0000 Serial : 0000000000000000 Processor : ARMv7 Processor rev 0 (v7l) ```

MEMINFO

``` bash MemTotal: 397824 kB MemFree: 53692 kB Buffers: 1720 kB Cached: 68792 kB SwapCached: 3156 kB Active: 92836 kB Inactive: 106204 kB Active(anon): 62516 kB Inactive(anon): 67424 kB Active(file): 30320 kB Inactive(file): 38780 kB Unevictable: 1136 kB Mlocked: 0 kB SwapTotal: 196604 kB SwapFree: 180944 kB Dirty: 28 kB Writeback: 0 kB AnonPages: 126840 kB Mapped: 36980 kB Shmem: 276 kB Slab: 31164 kB SReclaimable: 9572 kB SUnreclaim: 21592 kB KernelStack: 5040 kB PageTables: 5428 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 395516 kB Committed_AS: 4596648 kB VmallocTotal: 499712 kB VmallocUsed: 49008 kB VmallocChunk: 309276 kB ```

Initial

[!WARNING] I just want to clarify that I'm not responsible if something goes wrong and the device gets bricked. Please proceed at your own risk and make sure to back up your data before attempting any modifications

[!CAUTION] Using Miko tools for firmware dumping, whether via xml or full emmc block, often results in a corrupted dump (based on my testing). Therefore, I advise you to take multiple dumps, not just with Miko tools, but also with EDL.

[!IMPORTANT]
Before doing anything to your USB dongle, you must first enable ADB (if it's not already enabled) by accessing this URL: http://192.168.100.1/usbdebug.html.

You need to have:

If you are using Windows, you must install the following:

On Windows, If you intend to use edl you might encounter this error: NotImplementedError: Operation not supported or unimplemented on this platform. One way to fix this is by uninstalling the QDLoader 9008 Driver and replacing it with Zadig WinUSB⁽¹⁾.

Firmware Dump and Restore

To enable EDL mode on your device, execute the following command:

adb reboot edl

Alternatively, for a more hands-on approach, you can short the D+ and GND on the USB or the 2 pads on the board before connecting it to your computer. Once the device is in EDL mode, execute the following commands to create a full backup:

python3 edl rf {your_filename}.bin

To restore simply run:

python3 edl wf {your_filename}.bin

for individual backup:

python3 edl rl {your_foldername} --genxml

You can then use tools such as PowerISO to view the different partitions of the dump.

Getting Root

[!IMPORTANT]
Some devices have root access out of the box. Before proceeding, kindly check if yours does.

To gain root access, you need to install SuperSU on the USB dongle. Ensure you have the following files:

After obtaining the necessary files, open a new terminal and execute the following commands:

adb push SR5-SuperSU-v2.82-SR5-20171001224502.zip /sdcard

adb reboot bootloader

fastboot boot twrp-3.1.1-0-seed.img

The device may take some time to restart adb. Please be patient. Once adb is up and running again, proceed with the following commands:

adb shell

twrp install /sdcard/SR5-SuperSU-v2.82-SR5-20171001224502.zip

reboot

View Device Display

We can use adbcontrol to see what's going on with the device.

[!TIP] You need to modify the config.properties file accordingly
adbCommand = {LOCATION_OF_ADB_EXE} localImageFilePath = {LOCATION_ON_YOUR_HOST_MACHINE}

By default a screen timeout which results to a black screen when no activity is present, to bypass this we need to run:

adb shell settings put system screen_off_timeout 2147483647

adb shell input keyevent 26

Steps:

extract adbcontrol.zip

cd adbcontrol

java -jar adbcontrol.jar

Modifying Web UI

First and foremost, we need to identify the correct APK file. Some versions of this dongle come with Jetty2m.apk and MifiService.apk. In my case, the MifiService.apk was located in /system/priv-app/MifiService.apk. I then pulled the APK using the command adb pull /system/priv-app/MifiService.apk

Fetch test-keys:

git clone https://android.googlesource.com/platform/build
cd build/target/product/security/
openssl pkcs8 -inform DER -nocrypt -in platform.pk8 -out platform.pem
openssl pkcs12 -export -in platform.x509.pem -inkey platform.pem -out platform.p12 -password pass:android -name testkey
keytool -importkeystore -deststorepass android -destkeystore platform.keystore -srckeystore platform.p12 -srcstoretype PKCS12 -srcstorepass android
mv platform.keystore {YOUR_WORK_DIR}

Decompile apk:

java -jar apktool.jar d {APP_NAME}.apk -o {APP_NAME}

You can then start to customization under the assets folder

[!TIP]
Don't forget to change the versionCode and versionName in the apktool.yml

Recompile apk(If asked for a passphrase type android):

java -jar apktool.jar b -o unsigned.apk {APP_NAME}

Zipalign:

zipalign -v 4 unsigned.apk aligned.apk
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ./platform.keystore  aligned.apk testkey

Install apk:

adb install -r aligned.apk

Installing OpenWrt

[!IMPORTANT] Current OpenWRT firmware use the mcfg_sw.mbn located under MODEM_PR\MCFG\CONFIGS\MCFG_SW\GENERIC\COMMON\DEFAULT\DEFAULT. I haven't tested it if it works across different regions, If you can't get signal with yours kindly refer to Changing Region

  1. Download openwrt-UZ801.tar.xz from releases
  2. Extract the compressed file with tar xf openwrt-UZ801.tar.xz.
  3. cd OpenWRT-UZ801.
  4. For Linux, run ./flash.sh; for Windows, run ./flash.bat.
  5. If all goes well you can now see a constant blinking red and blue light.

Installing Debian (Based on 6.7 msm8916 mainline)

  1. Download the file using: wget https://download.wvthoog.nl/openstick-uz801-v3.0.zip.
  2. Extract the zip file.
  3. Execute adb reboot-bootloader
  4. For Linux, run ./flash.sh; for Windows, run ./flash.bat.
  5. Wait for the script to execute.
  6. If all goes well All basic functions should now work. Configure the device for your chosen use case.

For more information visit Wim van 't Hoog blog

Installing Debian (Based on 5.15 msm8916 mainline)

[!NOTE] To be updated

Recovery

In case you bricked your device and cannot access EDL, just short the pins below and follow the restore guide.

alt text

IMEI Recovery

Incase you lost your IMEI you can fix it using modem_at AT+WRIMEI={YOUR_IMEI}

References

This project references the following resources:

These resources have been instrumental in the creation of this project.

License

This repository is open-sourced software licensed under the MIT license.

Copyright AlienWolfX 2024