apt-get download + dpkg-deb -x + user namespace chroot,
把缺失數由 12 降到 0,並讓 FTNN 真正跑到登入畫面 UI 建構階段,零 FATAL。
apt-get download <pkg> 只下載 .deb,再 dpkg-deb -x 解到自建 sysroot/。全程不需 sudo。xvfb 解壓,再以 unshare -Ur --map-root-user 取得 user namespace 內的假 root,用 chroot 執行。dlopen(RTLD_NOW) 復現器,解析下一個缺失庫名,自動查包、下載、解壓,循環至零缺失。freopen("/dev/null","w",stderr),我寫 LD_PRELOAD 把該路徑改寫成真實檔案,才拿到下方全部輸出。| 階段 | rc / 現象 | 阻礙 | 處理 |
|---|---|---|---|
| 起點(過去多回合) | rc=0 靜默 | dlopen 缺 libnss3 等 12 庫 | 下載補齊 |
| 補庫後 | rc=134 | Qt 平台插件只有 xcb,無 X display | 建 Xvfb |
| Xvfb 起動 | rc=133 SIGTRAP | crashpad Check failed: fd >= 0 /dev/urandom 不存在 | LD_PRELOAD 重定向 |
| 本回合最終 | 零 FATAL,登入 UI 建構 | — | ✅ 到達 |
[12824:12824:20261121,061606.786797:FATAL rand_util.cc:41] Check failed: fd >= 0. open /dev/urandom: No such file or directory (2)
crashpad 初始化需要 /dev/urandom。chroot 內缺該節點,而 mknod 在無特權下被拒、mount --rbind /dev 亦被拒。
解法是 LD_PRELOAD 把 open("/dev/urandom") 重定向到預先準備的位元組檔——不碰內核、不需特權。
以下是修好 /dev/urandom 後、程式自行輸出的 UI 元件請求。這些全部是登入頁專屬資源:
Error get:img_login_cover_bg_normal.png is undef! (file:FUiResProvider.cpp[200]) QLayout: Attempting to add QLayout "" to CFTMobileLoginPageView "", which already has a layout Error get:img_login_logo_normal_ftnn.svg is undef! (file:FUiResProvider.cpp[215]) Error get:icon_login_qrcode_24_normal.svg is undef! (file:FUiResProvider.cpp[215])
另有 QEventLoop ... Entering × 3,代表 Qt 事件循環已進入,UI 正在建構。
Error get:ComboBox/arrow_size_normal is undef! (file:FUiResProvider.cpp[248]) Error value:No such FIS config key: ComboBox/arrow_size_normal (file:FFisStructsDefine.cpp[13]) Error getConfigString:FIS Config Key [ ComboBox/simple_text_arrow_spacing ] not found! (file:FFisConfigLoader.cpp[43]) Error get:ComboBox/simple_text_arrow_spacing is undef! (file:FUiResProvider.cpp[248]) Error value:No such FIS config key: ComboBox/simple_text_arrow_spacing (file:FFisStructsDefine.cpp[13]) Info setTheme:theme is 1 (file:FThemesManager.cpp[35]) exec (this: QEventLoop(0x7ffddceb99a0) ): Entering with parameter: QFlags() Error get:ct_text_h1 is undef! (file:FUiResProvider.cpp[166]) Error get:img_login_logo_normal_ftnn.svg is undef! (file:FUiResProvider.cpp[215]) Error get:ct_icon_reverse_airstar is undef! (file:FUiResProvider.cpp[166]) Error getConfigString:FIS Config Key [ ComboBox/arrow_down_icon_normal ] not found! (file:FFisConfigLoader.cpp[43]) Error get:ComboBox/arrow_down_icon_normal is undef! (file:FUiResProvider.cpp[248]) Error get:icon_eye_off_12.svg is undef! (file:FUiResProvider.cpp[215]) Error get:ct_bg_tertiary is undef! (file:FUiResProvider.cpp[166]) Error get:ck_grayblue100 is undef! (file:FUiResProvider.cpp[166]) Error get:icon_phone_16.svg is undef! (file:FUiResProvider.cpp[215]) Error get:icon_tips_12.svg is undef! (file:FUiResProvider.cpp[215]) Error get:icon_keyboard_f_16.svg is undef! (file:FUiResProvider.cpp[215]) Error get:icon_tips_12.svg is undef! (file:FUiResProvider.cpp[215]) Error get:icon_set_16.svg is undef! (file:FUiResProvider.cpp[215]) Error get:icon_login_qrcode_24_normal.svg is undef! (file:FUiResProvider.cpp[215]) Error get:icon_close_16.svg is undef! (file:FUiResProvider.cpp[215])
FUiResProvider.cpp 資源未定義(svg/主題),可能與資源包未完整解壓有關。# 1. 無 root 取庫 cd syslibs && apt-get download <pkg> && dpkg-deb -x <pkg>.deb sysroot/ # 2. 起 Xvfb(userns 假 root) unshare -Ur --map-root-user chroot sysroot /usr/bin/Xvfb :99 -screen 0 1600x1000x24 -noreset # 3. 跑 app(combo.so 解除自我靜音;randspy.so 補 /dev/urandom) LD_PRELOAD=/opt/FTNN/combo.so:/opt/FTNN/randspy.so DISPLAY=:99 chroot sysroot /opt/FTNN/FTNN
自動剝依賴腳本的核心迴圈:
while :; do line=$(chroot sysroot /opt/FTNN/dtest /opt/FTNN/libMainApp.so 2>&1 | head -1) case "$line" in *"dlopen OK"*) break;; esac miss=$(echo "$line" | sed -E 's/.*: (lib[^:]+\.so[^:]*): .*//') base=$(echo "$miss" | sed -E 's/^lib//; s/\.so.*//') apt-get download "lib$base" && dpkg-deb -x "lib$base"*.deb sysroot/ done