mirror of
https://github.com/msojocs/wechat-web-devtools-linux.git
synced 2025-07-22 00:00:04 +08:00
17 lines
902 B
Bash
Executable File
17 lines
902 B
Bash
Executable File
#!/bin/bash
|
|
# 此脚本用于使修改 core.wxvpkg 内的代码及时生效
|
|
set -e
|
|
root_dir=$(cd `dirname $0`/.. && pwd -P)
|
|
find_result="$root_dir/package.nw/core.wxvpkg.ext/19c6ae7eff08f795d1f2124f7b0248ad.js"
|
|
return_exp_wcc=$(cat $find_result | grep -P 'return [a-z]+\("wcc"\)' -o) # return ?("wcc")
|
|
echo "return exp: $return_exp_wcc"
|
|
return_exp_wcc_replace="${return_exp_wcc//wcc/wcc.bin}" # return ?("wcc.bin")
|
|
echo "replace exp1: $return_exp_wcc_replace"
|
|
return_exp_wcc_replace="${return_exp_wcc//return /${return_exp_wcc_replace},}" # return ?("wcc.bin")
|
|
echo "replace exp2: $return_exp_wcc_replace"
|
|
|
|
return_exp_wcsc=$(cat $find_result | grep -P 'return [a-z]+\("wcsc"\)' -o) # return ?("wcc")
|
|
return_exp_wcsc_replace="${return_exp_wcc_replace//wcc/wcsc}"
|
|
|
|
sed -i "s#$return_exp_wcc#$return_exp_wcc_replace#g" "$find_result"
|
|
sed -i "s#$return_exp_wcsc#$return_exp_wcsc_replace#g" "$find_result" |