Skip to content

Instantly share code, notes, and snippets.

@cxyzzz
Last active March 14, 2020 07:47
Show Gist options
  • Select an option

  • Save cxyzzz/e4f2315dc29b89fd5d7d569c2b4f3ee9 to your computer and use it in GitHub Desktop.

Select an option

Save cxyzzz/e4f2315dc29b89fd5d7d569c2b4f3ee9 to your computer and use it in GitHub Desktop.
去除 QQ 自定义字体、礼物特效;修改 MIUI 浏览器搜索引擎;去除 X5、TBS 内核
#!/system/bin/env bash
set -xe
chattr_i(){
rm -r $1
touch $1
chown $3 $1
chmod $2 $1
chattr +i $1
}
unchattr_i(){
chattr -i $1
chmod $2 $1
}
X5(){
X5=( $(find /data/data -name app_tbs) )
for var in ${X5[@]}
do
if [ -s $var ]
then
chattr_i $var 0 root:root
echo -e "\e[0;31m $var OK !!! \e[0m "
else
echo -e "\e[0;36m $var already killed !!! \e[0m "
fi
done
}
UC(){
UC=( $(find /data/data -name libwebviewuc.so) )
for var in ${UC[@]}
do
if [ -s $var ]
then
chattr_i $var 0 root:root
echo -e "\e[0;31m $var OK !!! \e[0m "
else
echo -e "\e[0;36m $var already killed !!! \e[0m "
fi
done
}
MiBrowser(){
DATA=/data/data/com.android.browser/files/data
DIRS=(topcontentv6n yellowpagev6n suggest list kw2 homepagecards customheadcontent banners)
for dir in ${DIRS[@]}
do
if [ -s $DATA/$dir ]
then
chattr_i $DATA/$dir 0444 u0_a278:u0_a278
echo -e "\e[0;31m Ban $dir OK !!! \e[0m "
else
echo -e "\e[0;36m $dir already baned !!! \e[0m "
fi
done
echo -e "\e[0;31m 移除去广告白名单"
file="$DATA/adblock/miui_whitelist.json"
unchattr_i $file 0777
:>$file
chattr_i $file 0444 u0_a293:u0_a293
echo -e "\e[0;31m 开始更改搜索引擎"
file="$DATA/searchengine/searchengine-zh-rCN-e97fa7092ad2e7c0d34cba612b4eb66d/searchengine.json"
unchattr_i $file 0777
cat>$file<<EOF
{
"specifiedCount":0,
"unSpecifiedCount":0,
"ehash":"0146593001203c66efafcaa93fb4dbed",
"changeEngine":2,
"data":{
"1":{
"title_zh_CN":"秘迹搜",
"title_zh_TW":"秘迹搜",
"title_en_US":"baidu",
"label":"mijisou",
"keyword":"mijisou.com",
"favicon_uri":"",
"search_uri":"https:\/\/m.mijisou.com\/?q={searchTerms}",
"encoding":"UTF-8",
"suggest_uri":"http:\/\/suggestion.baidu.com\/su?p=3&wd={searchTerms}",
"extra":"v6",
"show_suggest_app":0,
"ic_search_engine":"http:\/\/t2.market.mi-img.com\/download\/Browser\/0567aa49cbabd453834a3d1dd46b7c54454ec55ef",
"ic_search_logo":"",
"miui_search_logo":"http:\/\/file.market.xiaomi.com\/download\/Browser\/1305f832-e9e5-4205-8964-c794b6bbbb3c",
"ic_search_engine_v7":"https:\/\/cdn.leakzero.com\/mijisou\/themes\/entropage\/img\/favicon.png?staticVersion=1559562262",
"ic_search_engine_white":"http:\/\/f4.market.mi-img.com\/download\/Browser\/01828647800094c1a0762e2a32d4d8e0f7b74dbbc"
},
"2":{
"title_zh_CN":"多吉搜索",
"title_zh_TW":"多吉搜索",
"title_en_US":"dogedoge",
"label":"dogedoge",
"keyword":"dogedoge.com",
"favicon_uri":"",
"search_uri":"https:\/\/dogedoge.com\/results?q={searchTerms}",
"encoding":"UTF-8",
"suggest_uri":"http:\/\/suggestion.baidu.com\/su?p=3&wd={searchTerms}",
"extra":"v6",
"show_suggest_app":0,
"ic_search_engine":"http:\/\/t2.market.mi-img.com\/download\/Browser\/0567aa49cbabd453834a3d1dd46b7c54454ec55ef",
"ic_search_logo":"",
"miui_search_logo":"http:\/\/file.market.xiaomi.com\/download\/Browser\/1305f832-e9e5-4205-8964-c794b6bbbb3c",
"ic_search_engine_v7":"https:\/\/www.dogedoge.com\/assets\/doge_ico.png",
"ic_search_engine_white":"http:\/\/f4.market.mi-img.com\/download\/Browser\/01828647800094c1a0762e2a32d4d8e0f7b74dbbc"
},
"3":{
"title_zh_CN":"SandBox Google",
"title_zh_TW":"SandBox Google",
"title_en_US":"SandBox Google",
"label":"SandBox Google",
"keyword":"Google.com",
"favicon_uri":"",
"search_uri":"https:\/\/zjcqoo.github.io\/-----https:\/\/www.google.com\/search?q={searchTerms}",
"encoding":"UTF-8",
"suggest_uri":"http:\/\/suggestion.baidu.com\/su?p=3&wd={searchTerms}",
"extra":"v6",
"show_suggest_app":0,
"ic_search_engine":"http:\/\/t2.market.mi-img.com\/download\/Browser\/0567aa49cbabd453834a3d1dd46b7c54454ec55ef",
"ic_search_logo":"",
"miui_search_logo":"http:\/\/file.market.xiaomi.com\/download\/Browser\/1305f832-e9e5-4205-8964-c794b6bbbb3c",
"ic_search_engine_v7":"https:\/\/www.google.com\/images\/branding\/product\/1x\/gsa_android_144dp.png",
"ic_search_engine_white":"http:\/\/f4.market.mi-img.com\/download\/Browser\/01828647800094c1a0762e2a32d4d8e0f7b74dbbc"
},
"4":{
"title_zh_CN":"头条搜索",
"title_zh_TW":"头条搜索",
"title_en_US":"toutiao",
"label":"toutiao",
"keyword":"toutiao.com",
"favicon_uri":"",
"search_uri":"https:\/\/m.toutiao.com\/search\/?keyword={searchTerms}",
"encoding":"UTF-8",
"suggest_uri":"http:\/\/suggestion.baidu.com\/su?p=3&wd={searchTerms}",
"extra":"v6",
"show_suggest_app":0,
"ic_search_engine":"http:\/\/t2.market.mi-img.com\/download\/Browser\/0567aa49cbabd453834a3d1dd46b7c54454ec55ef",
"ic_search_logo":"",
"miui_search_logo":"http:\/\/file.market.xiaomi.com\/download\/Browser\/1305f832-e9e5-4205-8964-c794b6bbbb3c",
"ic_search_engine_v7":"https:\/\/m.toutiao.com\/favicon.ico",
"ic_search_engine_white":"http:\/\/f4.market.mi-img.com\/download\/Browser\/01828647800094c1a0762e2a32d4d8e0f7b74dbbc"
},
"303_897":{
"title_zh_CN":"夸克",
"title_zh_TW":"夸克",
"title_en_US":"quark",
"label":"夸克",
"keyword":"sm.cn",
"favicon_uri":"",
"search_uri":"http:\/\/quark.sm.cn\/search?q={searchTerms}",
"encoding":"UTF-8",
"suggest_uri":"http:\/\/suggestion.baidu.com\/su?p=3&wd={searchTerms}",
"extra":"v6",
"show_suggest_app":0,
"ic_search_engine":"http:\/\/f2.market.mi-img.com\/download\/Browser\/5c6ea0a7-b1a8-4210-831d-44f7e50ef02c",
"ic_search_logo":"",
"miui_search_logo":"http:\/\/f4.market.mi-img.com\/download\/Browser\/19821ec0-dc9c-4237-8026-dd7a430548f7",
"ic_search_engine_v7":"http:\/\/f5.market.mi-img.com\/download\/Browser\/049995ae9ac321619b1f3e39699c746b12c4135ed",
"ic_search_engine_white":"http:\/\/f5.market.mi-img.com\/download\/Browser\/0c8285778a0b94c17f762b2a33d4dcebfb040b286"
},
"303_898":{
"title_zh_CN":"百度",
"title_zh_TW":"百度",
"title_en_US":"baidu",
"label":"baidu",
"keyword":"baidu.com",
"favicon_uri":"",
"search_uri":"http:\/\/m.baidu.com\/s?from=1002253t&word={searchTerms}",
"encoding":"UTF-8",
"suggest_uri":"http:\/\/suggestion.baidu.com\/su?p=3&wd={searchTerms}",
"extra":"v6",
"show_suggest_app":0
}
},
"default_search_engine":{
"name":"1",
"isRecommended":true
},
"search_engines":["303_897","1","2","4","3"]
}
EOF
echo -e "\e[0;31m 更改成功!"
chmod 0444 $DATA/searchengine/searchengine-zh-rCN-f198d1a8f090029f8154d90f3f5398ec/searchengine.json
chattr +i $DATA/searchengine/searchengine-zh-rCN-f198d1a8f090029f8154d90f3f5398ec/searchengine.json
}
QQ(){
DATA=/data/data/com.tencent.mobileqq/files
SD=/data/media/0/Android/data/com.tencent.mobileqq/Tencent/MobileQQ/
if [ -s $DATA/recommemd_emotion_file__02283361094 ]
then
echo -e "\e[0;31m 去除表情包推荐"
chattr_i $DATA/recommemd_emotion_file__02283361094 444 root:root
chattr_i $DATA/recommendEmotion.json 444 root:root
else
echo -e "\e[0;36m 表情包推荐已经去除!!! \e[0m "
fi
if [ -s $SD/.font_info ]
then
echo -e "\e[0;31m 去除字体特效"
chattr_i $SD/.font_info 444 root:root
chattr_i $SD/.font_effect 444 root:root
else
echo -e "\e[0;36m 字体特效已经去除!!! \e[0m "
fi
if [ -s $SD/.gift ]
then
echo -e "\e[0;31m 去除礼物特效"
chattr_i $SD/.gift 444 root:root
else
echo -e "\e[0;36m 礼物特效已经去除!!! \e[0m "
fi
if [ -s $SD/.pendant ]
then
echo -e "\e[0;31m 去除头像特效"
chattr_i $SD/.gift 444 root:root
else
echo -e "\e[0;36m 头像特效已经去除!!! \e[0m "
fi
}
case $1 in
X5) X5
;;
UC) UC
;;
MiBrowser) MiBrowser
;;
QQ) QQ
;;
*)
echo -e "\e[0;31m $0 {X5|UC|MiBrowser|QQ}"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment