DuoTimeFaker

English | 中文说明


🇨🇳 中文说明

项目概述

DuoTimeFaker 是一个针对多邻国(Duolingo)Android 客户端的轻量级 Xposed 模块。主要用于解决在中国大陆等非支持区域使用多邻国 AI 语音/视频通话(如 Lily 通话)时受限的问题。

主要功能

  1. 应用内时区伪装:
    • 在应用进程内将时区相关 API 拦截并返回 Asia/Tokyo(东京时区)。
    • 手机系统保持原有北京时间不变,不影响系统闹钟、日历与第三方应用。
  2. 连接质量判定放宽:
    • 拦截客户端网络质量评估类(ConnectionQuality),避免因国际公网偶发抖动(RTT > 500ms)触发看门狗(VCWatchdog)导致通话意外中断。
    • 改善对讲机(Push-To-Talk, PTT)模式下的异步语音交互稳定性。
  3. 低侵入性与便携性:
    • 支持通过 LSPatch 进行免 Root 修补使用,亦可在已 Root 设备上的 LSPosed 中直接启用。
    • 无需后台常驻后台辅助进程。

实现原理

  • 时区拦截: 多邻国通话信令在建立连接时会检查设备时区。模块在进程初始化时 Hook 以下接口:
    • java.util.TimeZone.getDefault()
    • java.time.ZoneId.systemDefault()
    • android.icu.util.TimeZone.getDefault()
    • java.lang.System.getProperty("user.timezone")
    • 多邻国内部时钟接口 defpackage.luh.f()
  • 看门狗调优: 多邻国客户端 video-call-lib 会根据 Ping/Pong 延迟将网络状态划分为 GREAT (<=100ms)、GOOD (<=250ms)、FAIR (<=500ms) 与 POOR (>500ms)。模块将 ConnectionQuality 构造参数中的 POOR 状态调整为 GOOD,降低看门狗在网络抖动时掐断会话的频率。

使用前提与限制

  1. 网络连通性: 多邻国通话信令服务器与 WebRTC 节点部署在海外 CDN(如 CloudFront)。在部分地区或网络环境下,直连可能因国际链路丢包而无法建连;若遇到无法连接的情况,仍需配合网络代理工具进行分流。
  2. 语音识别引擎: 对讲机模式下的录音转写依赖 Android 系统的语音识别服务,建议设备安装 Google 语音服务(Google Speech Services)并下载英语离线语言包。

安装方法

方式一:免 Root 设备(使用 LSPatch)

  1. 在设备上安装 LSPatch;
  2. 安装本模块提供的 DuoTimeFaker.apk;
  3. 在 LSPatch 中配置多邻国,将 DuoTimeFaker 勾选为加载模块;
  4. 启动多邻国即可。

方式二:已 Root 设备(使用 LSPosed)

  1. 安装并在 LSPosed 管理器中激活 DuoTimeFaker;
  2. 将作用域勾选为 多邻国 (com.duolingo);
  3. 强制停止并重新打开多邻国。

🌐 English

Overview

DuoTimeFaker is a lightweight Xposed module designed for the Duolingo Android application. It addresses regional restrictions on Duolingo's AI-powered video and voice calling features (such as Lily Call) when running in unsupported timezones.

Features

  1. In-App Timezone Spoofing:
    • Redirects timezone queries within the target application process to Asia/Tokyo.
    • Leaves device-wide system time and timezone settings untouched.
  2. Connection Watchdog Relaxation:
    • Intercepts client-side connection quality evaluations (ConnectionQuality) to mitigate premature disconnections caused by transient network jitter (RTT > 500ms).
    • Improves stability during Push-To-Talk (PTT) audio interactions.
  3. Lightweight & Portable:
    • Fully compatible with non-root patching via LSPatch, as well as root-based LSPosed environments.
    • Requires no persistent background services or helper daemons.

Technical Details

  • Timezone Interception: Duolingo verifies the client device timezone during session negotiation. The module hooks the following entries upon process initialization:
    • java.util.TimeZone.getDefault()
    • java.time.ZoneId.systemDefault()
    • android.icu.util.TimeZone.getDefault()
    • java.lang.System.getProperty("user.timezone")
    • Internal time provider defpackage.luh.f()
  • Watchdog Tuning: Duolingo's video-call-lib categorizes ping round-trip times into GREAT (<=100ms), GOOD (<=250ms), FAIR (<=500ms), and POOR (>500ms). The module remaps POOR states to GOOD during object instantiation, preventing the client-side watchdog from triggering session aborts under moderate latency.

Prerequisites & Limitations

  1. Network Connectivity: Duolingo's voice and signaling endpoints reside on overseas CDN infrastructure. Depending on the local ISP, direct access may experience packet loss or high latency. If connection fails, a routing proxy may still be required.
  2. Speech Recognition: Audio transcription in Push-To-Talk mode relies on the Android system's SpeechRecognizer. It is recommended to have Google Speech Services installed with the English offline speech pack enabled.

Installation

Non-Root (via LSPatch)

  1. Install LSPatch;
  2. Install DuoTimeFaker.apk;
  3. Configure the patched Duolingo application in LSPatch and enable the DuoTimeFaker module;
  4. Launch Duolingo.

Root (via LSPosed)

  1. Install and enable DuoTimeFaker in LSPosed;
  2. Set the module scope to Duolingo (com.duolingo);
  3. Force stop and restart Duolingo.

License & Disclaimer

This repository is published for technical research and educational purposes only. Duolingo is a registered trademark of Duolingo, Inc.

Releases