mirror of
https://github.com/openwrt-xiaomi/xmir-patcher.git
synced 2026-09-22 22:57:55 +03:00
Initial commit
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,55 @@
|
||||
if [ `ls /tmp/base.*.lmo |wc -l` -eq 0 ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ "$(mount| grep '/usr/lib/lua/luci')" != "" ]; then
|
||||
sh /tmp/lang_uninstall.sh
|
||||
fi
|
||||
|
||||
# delete old patch
|
||||
rm -f /etc/rc.lang
|
||||
|
||||
# global firmware may contain a file "base.en.lmo"
|
||||
[ -f /usr/lib/lua/luci/i18n/base.en.lmo ] && rm -f /tmp/base.en.lmo
|
||||
|
||||
mv -f /tmp/base.*.lmo /etc/
|
||||
mv -f /tmp/lang_patch.sh /etc/
|
||||
chmod +x /etc/lang_patch.sh
|
||||
|
||||
FILE_FOR_EDIT=/etc/init.d/boot
|
||||
NEW_CMD="\[ -f \/etc\/lang_patch.sh \] && sh \/etc\/lang_patch.sh"
|
||||
FILE_PATCHED=1
|
||||
HAVE_PATCH=$(grep 'lang_patch.sh' $FILE_FOR_EDIT)
|
||||
if [ -z "$HAVE_PATCH" ]; then
|
||||
FILE_PATCHED=0
|
||||
UCI_CFG=$(grep 'apply_uci_config' $FILE_FOR_EDIT)
|
||||
if [ -n "$UCI_CFG" ]; then
|
||||
sed -i "/apply_uci_config$/i$NEW_CMD" $FILE_FOR_EDIT
|
||||
FILE_PATCHED=2
|
||||
fi
|
||||
UCI_DEF=$(grep 'uci_apply_defaults' $FILE_FOR_EDIT)
|
||||
if [ -n "$UCI_DEF" -a $FILE_PATCHED == 0 ]; then
|
||||
sed -i "/uci_apply_defaults$/i$NEW_CMD" $FILE_FOR_EDIT
|
||||
FILE_PATCHED=3
|
||||
fi
|
||||
fi
|
||||
|
||||
# run patch
|
||||
sh /etc/lang_patch.sh
|
||||
|
||||
# delete lang
|
||||
uci -q delete luci.languages.ru
|
||||
uci -q delete luci.languages.en
|
||||
|
||||
# add lang
|
||||
uci set luci.languages.ru=Русский
|
||||
uci set luci.languages.en=English
|
||||
|
||||
# set main lang
|
||||
uci set luci.main.lang=en
|
||||
|
||||
# commit luci settings
|
||||
uci commit luci
|
||||
|
||||
# reload luci
|
||||
luci-reload & rm -f /tmp/luci-indexcache & luci-reload
|
||||
@@ -0,0 +1,22 @@
|
||||
if [ `ls /etc/base.*.lmo |wc -l` -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/_usr_lib_lua_luci
|
||||
cp -rf /usr/lib/lua/luci/* /tmp/_usr_lib_lua_luci/
|
||||
mount --bind /tmp/_usr_lib_lua_luci /usr/lib/lua/luci
|
||||
|
||||
cp /etc/base.*.lmo /usr/lib/lua/luci/i18n
|
||||
|
||||
# save original file
|
||||
cp -f /usr/share/xiaoqiang/xiaoqiang_version /etc/xiaoqiang_version
|
||||
|
||||
mkdir -p /tmp/_usr_share_xiaoqiang
|
||||
cp -rf /usr/share/xiaoqiang/* /tmp/_usr_share_xiaoqiang/
|
||||
mount --bind /tmp/_usr_share_xiaoqiang /usr/share/xiaoqiang
|
||||
|
||||
# unlock WEB lang menu
|
||||
sed -i 's/ and features\["system"\]\["i18n"\] == "1" //' /usr/lib/lua/luci/view/web/inc/sysinfo.htm
|
||||
|
||||
# unlock change luci.main.lang
|
||||
sed -i "s/option CHANNEL 'stable'/option CHANNEL 'release'/g" /usr/share/xiaoqiang/xiaoqiang_version
|
||||
@@ -0,0 +1,15 @@
|
||||
if [ "$(mount| grep '/usr/lib/lua/luci')" != "" ]; then
|
||||
umount -l /usr/lib/lua/luci
|
||||
fi
|
||||
rm -rf /tmp/_usr_lib_lua_luci
|
||||
|
||||
if [ "$(mount| grep '/usr/share/xiaoqiang')" != "" ]; then
|
||||
umount -l /usr/share/xiaoqiang
|
||||
fi
|
||||
rm -rf /tmp/_usr_share_xiaoqiang
|
||||
|
||||
rm -f /etc/rc.lang
|
||||
rm -f /etc/lang_patch.sh
|
||||
rm -f /etc/base.*.lmo
|
||||
|
||||
luci-reload & rm -f /tmp/luci-indexcache & luci-reload
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
# enable UART
|
||||
nvram set bootdelay=5; nvram set uart_en=1; nvram commit
|
||||
|
||||
# change password for root
|
||||
echo -e "root\nroot" | (passwd root)
|
||||
|
||||
if [ -f /etc/init.d/dropbear ]; then
|
||||
# unlock autostart dropbear
|
||||
sed -i 's/"$flg_ssh" != "1" -o "$channel" = "release"/-n ""/g' /etc/init.d/dropbear
|
||||
if [ -f /usr/sbin/dropbear ]; then
|
||||
# restart dropbear
|
||||
/etc/init.d/dropbear stop
|
||||
/etc/init.d/dropbear start
|
||||
fi
|
||||
fi
|
||||
|
||||
cd /tmp
|
||||
rm -f busybox_tiny
|
||||
cat busybox_01 busybox_02 > busybox_tiny
|
||||
chmod +x busybox_tiny
|
||||
|
||||
# start telnet
|
||||
./busybox_tiny telnetd
|
||||
|
||||
# start ftp
|
||||
ln -s busybox_tiny ftpd
|
||||
./busybox_tiny tcpsvd -vE 0.0.0.0 21 ./ftpd -Sw / >> /tmp/msg_ftpd 2>&1 &
|
||||
|
||||
#kill -9 `pgrep taskmonitor`
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0"?>
|
||||
<root>
|
||||
<class type="1">
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
<item url="http://dl.ijinshan.com/safe/speedtest/FDFD1EF75569104A8DB823E08D06C21C.dat"/>
|
||||
</class>
|
||||
<class type="2">
|
||||
<item url="http://{router_ip_address} -q -O /dev/null; {command}; exit; wget http://{router_ip_address} "/>
|
||||
</class>
|
||||
<class type="3">
|
||||
<item uploadurl="http://www.taobao.com/"/>
|
||||
<item uploadurl="http://www.so.com/"/>
|
||||
<item uploadurl="http://www.qq.com/"/>
|
||||
<item uploadurl="http://www.sohu.com/"/>
|
||||
<item uploadurl="http://www.tudou.com/"/>
|
||||
<item uploadurl="http://www.360doc.com/"/>
|
||||
<item uploadurl="http://www.kankan.com/"/>
|
||||
<item uploadurl="http://www.speedtest.cn/"/>
|
||||
</class>
|
||||
</root>
|
||||
Reference in New Issue
Block a user