/huawei_oled_hijack_ng

Advanced on-screen menu for Huawei E5785 (and probably others) portable LTE routers

Primary LanguageObjective-CGNU Lesser General Public License v3.0LGPL-3.0

Huawei OLED hijacking library

This library adds advanced menu to the OLED display of Huawei E5785 portable LTE router.
This is achieved by hijacking certain library calls in the "oled" executable file.

The menu can be activated with long menu key press.

Menu 1 Signal 1 Signal 2 USSD Sms 1 Sms 2 Menu 2 SSH ADBD VPN Snake Matrix

How does it work

This library hijacks register_notify_handler(), lcd_refresh_screen() and lcd_control_operate().

register_notify_handler() registers it's own proxy handler which intercepts key press events. If it detects long menu key press, it switches to the "secret menu" mode. In this mode the lcd_refresh_screen outputs the custom lcd buffer and input events are going to the our handlers. Also the brightness of the display is controlled by us by hijacking lcd_control_operate().

Very simple, yet effective.

Differences between huawei_oled_hijack_ng and huawei_oled_hijack

This project was inspired by the amazing huawei_oled_hijack project.

The key difference is that instead of patching sprintf function to change the internal buffers and insert new items to the menu generated by oled library, this project draws the menu from scratch. This gives these advantages:

  • Support of 32768 colors instead of 2 colors
  • Support for making custom interfaces. No more wasting space in the top and bottom
  • The redisigned architecture, that based on timers. The absense of blocking calls
  • Better portability. No more need for hardcode addresses of global variables for every oled build.

Contributions are welcome.