Skip to content

Commit 541fe62

Browse files
committed
Fix some bugs
1 parent 7928c21 commit 541fe62

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

common/functions.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,40 +34,40 @@ apn_place_choose() {
3434
run_addons
3535
addons_enable=true
3636
addons_example
37-
if $VKSEL; then
38-
REPLACEALL=true
39-
return 0
40-
else
41-
REPLACEALL=false
42-
fi
4337
sp
4438
ui_print "- Do you want to replace apns_conf.xml in all directories? (This may cause some unknown issues)"
4539
ui_print " 您是否想替换所有目录的 apns_conf.xml?(这可能会造成某些未知的问题)"
4640
ui_print "- Vol+ = true"
4741
ui_print " 音量+ = 是"
4842
ui_print "- Vol- = false"
4943
ui_print " 音量- = 否"
44+
if $VKSEL; then
45+
REPLACEALL=true
46+
return 0
47+
else
48+
REPLACEALL=false
49+
fi
5050
sp
5151
ui_print "- Please select the directory you want to replace"
5252
ui_print " 请选择您想要替换的目录"
53-
bak=$IFS
53+
_bak=$IFS
5454
IFS=$'\n'
55-
for i in $(echo "$q"); do
55+
for i in $q; do
5656
sp
5757
ui_print "- Vol+ = $i"
5858
ui_print " 音量+ = $i"
5959
ui_print "- Vol- = Other directory"
6060
ui_print " 音量- = 其他目录"
6161
if $VKSEL; then
62-
APNCONFDIR="$MODPATH/${i%/*}"
62+
APNCONFDIR="$MODPATH""${i%/*}"
6363
return 0
6464
else
6565
sp
6666
ui_print "- Please continue your selection"
6767
ui_print " 请继续您的选择"
6868
fi
6969
done
70-
IFS=$bak
70+
IFS=$_bak
7171
if [ -z $APNCONFDIR ]; then
7272
sp
7373
ui_print "- The module has an internal error, the installation failed."
@@ -293,11 +293,11 @@ fi
293293
# Debug
294294
if $DEBUG; then
295295
ui_print "- Debug mode"
296-
ui_print " Debug mode is now enabled by default"
296+
ui_print "* Debug mode is now enabled by default"
297297
ui_print " Debug 模式现设为默认开启"
298-
ui_print " Module install log will include debug info"
298+
ui_print "* Module install log will include debug info"
299299
ui_print " 模块安装日志将包含 debug 信息"
300-
ui_print " If you need it, be sure to save it after module install"
300+
ui_print "* If you need it, be sure to save it after module install"
301301
ui_print " 如果你需要日志,请在模块安装后保存它"
302302
set -x
303303
fi
@@ -370,7 +370,7 @@ ui_print "- Installing"
370370

371371
[ -f "$MODPATH/common/install.sh" ] && . $MODPATH/common/install.sh
372372

373-
ui_print " Installing for $ARCH SDK $API device..."
373+
ui_print " Installing for $ARCH SDK $API device..."
374374
# Remove comments from files and place them, add blank line to end if not already present
375375
for i in $(find $MODPATH -type f -name "*.sh" -o -name "*.prop" -o -name "*.rule"); do
376376
[ -f $i ] && {

common/install.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1+
_bak=$IFS
2+
IFS=$'\n'
3+
14
if [ "$REPLACEALL" = "true" ]; then
2-
for i in "$(echo "$q" | awk '{printf "%s",$1}'| sed 's/ //g')"; do
3-
APNCONFDIR="$MODPATH/${i%/*}"
5+
for i in $q; do
6+
APNCONFDIR="$MODPATH""${i%/*}"
47
if [[ ! -d "$APNCONFDIR" ]]; then
58
mkdir -p "$APNCONFDIR"
69
cp "$MODPATH"/APN/apns-conf.xml "$APNCONFDIR"
710
fi
811
done
9-
rm -f "$MODPATH"/APN/apns-conf.xml
1012
elif [ -n "$APNCONFDIR" ]; then
1113
mkdir -p "$APNCONFDIR"
1214
cp "$MODPATH"/APN/apns-conf.xml "$APNCONFDIR"
13-
rm -f "$MODPATH"/APN/apns-conf.xml
1415
fi
1516

17+
IFS=$_bak
18+
1619
if [ "$UNINSTALLCARRIERSETTINGS" = "true" ]; then
1720
mkdir -p "$MODPATH"/system/product/priv-app/CarrierSettings
1821
touch "$MODPATH"/system/product/priv-app/CarrierSettings/.replace

module.prop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
id=fixchinacarrier
22
name=FixChinaCarrier
3-
version=v5.3.0-beta.3
4-
versionCode=20210523
3+
version=v5.3.0-beta.4
4+
versionCode=20210524
55
author=Qingxu & RiwiHow
66
description=A Magisk module to solve the APN problem of the slow speed of China carrier in some ROMs.

0 commit comments

Comments
 (0)