File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed
Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change 2121 args=" $args --setenv LD_PRELOAD $BASE /libinject.so"
2222fi
2323
24- if [ -d " $LITELOADER " ]; then # 支持 LiteLoaderQQNT
24+ if [ -d " $LITELOADER " ]; then
2525 echo " Loading LiteLoaderQQNT..."
2626
27+ # 挂载 LiteLoaderQQNT 目录
2728 mkdir -p " $LITELOADER "
2829 args=" $args --bind $LITELOADER $LITELOADER "
2930
30- entry=" $BASE /resources/app/app_launcher/index.js"
31+ # 挂载 package.json
32+ fake_package=$( mktemp)
33+ package_json=" $BASE /resources/app/package.json"
34+ sed -e ' s/index.js/loader_index.js/g' -e ' s/application.asar/./g' " $package_json " > " $fake_package "
35+ args=" $args --ro-bind $fake_package $package_json "
36+
37+ # 挂载入口 js
38+ overlay_dir=" $BASE /resources/app/app_launcher"
39+ args=" $args --tmpfs $overlay_dir "
40+ for file in " $overlay_dir " /* ; do
41+ args=" $args --bind $file $file "
42+ done
3143 fake_entry=$( mktemp)
32-
33- echo " require('$LITELOADER ');" >> " $fake_entry "
34- cat " $entry " >> " $fake_entry "
35-
36- args=" $args --bind $LITELOADER /application $BASE /resources/app/application" # 挂载一个可写的 tmpfs
37- args=" $args --bind $fake_entry $entry " # 挂载假入口
44+ echo " require('$LITELOADER ');" > " $fake_entry "
45+ args=" $args --ro-bind $fake_entry $BASE /resources/app/app_launcher/loader_index.js"
3846fi
3947
40- args=" $args --chdir $HOME $BASE /main" # 启动主程序
48+ args=" $args --chdir $HOME $BASE /main"
4149
4250# shellcheck disable=SC2086
4351exec bwrap $args
You can’t perform that action at this time.
0 commit comments