This is just a draft. Still Working-In-Progress. Many bugs!

another PC run nginx Then we have mirror: 10.100.100.34/$arch/$repo

    server {
        listen       [::]:80;
        listen       80;
        #server_name  localhost;
    root /var/www/html;
        index  index.html index.htm;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location /aarch64 {
        proxy_pass https://mirror.tuna.tsinghua.edu.cn/archlinuxarm/aarch64;
        }
......

android chroot:

prepare root.

mount -t proc /proc proc/
mount -o bind /sys sys/
mount -o bind /dev dev/
# Maybe we should bind every mountpoint manually. Write a script, or copy from debian-arm blog. 
chroot /path/to/.../root/

inside: /bin/bash

export PATH=/usr/bin
export LD_LIBRARY_PATH=/usr/lib

# we should run `pacman-key --init` and `pacman-key --populate archlinuxarm`. But I failed. 
vi /etc/pacman.conf # Set Siglevel to Never

# I don't know why DNS is still not working. Modify mirrorlist to use our repo. 
rm /etc/resolv.conf
echo 10.100.100.1 > /etc/resolv.conf

fake sudo

a Script to allow normal user to launch root shell, after providing a KEY file.

In android, I don't want to root my phone, but still needs root access.

So I installed this script, instead of SuperSU.

runas.cc

#include <rlib/sys/unix_handy.hpp>
#include <rlib/opt.hpp>

int main(int argc, char **argv) {
    rlib::opt_parser args(argc, argv);
    auto keyFile = args.getValueArg("-k", false, "");

    setuid(geteuid());
    setgid(getegid());

    rlib::execs("/bin/bash", std::vector<std::string>{"runas.impl.sh", keyFile});
}

runas.impl.sh

#!/bin/bash
# Usage: 1. Generate your key file, and keep it secret. Get its SHA256 and write it down at `answer`.
#        2. Compile runas.cc, Then run the following commands as root:
#               chmod +s ./runas
#        3. Try `./runas -k ./key` as normal user.
#
# File Permissions:
# 
# -rwsr-sr-x 1 root    root    82K Apr 18 19:29 runas*
# -rw-r--r-- 1 recolic recolic 320 Apr 18 19:29 runas.cc
# ---------- 1 root    root    733 Apr 18 19:35 runas.impl.sh*


[ "$1" = "" ] && key_file_name="./key" || key_file_name="$1"
echo "Verifying '$key_file_name'..."

#### Verify key file
checksum=$(sha256sum "$key_file_name" | sed 's/ .*$//g')
answer='07ecd901c90ee7a72efdc0d7e7b47c2b8d02b5a9cfcbb9ae4f0f31561d01af04'

if [ "$checksum" = "$answer" ]; then
    bash
else
    echo 'Verification failed.'
    exit 2
fi

exit $?

android qq聊天记录导出大致流程

tested on android 6 tencent qq

  1. 设法将/data/data/com.tencent.*/databases目录拷贝出来,我假设你了解如何做到这一点。

  2. 运行以下命令。我假设你了解如何安装/使用sqlite,我假设你了解linux基本知识。

$ sqlite3 872222222-IndexQQMsg.db
sqlite> .output /home/recolic/extraDisk/tmp/tmp.out
sqlite> select * from IndexContent_content ;
sqlite> .quit

拿到输出的文件,跑下面的这个qqmsg_decoder.py就可以了。如果你需要filter等自定义功能,我假设你了解如何使用python。

注意到这个聊天记录似乎有丢失,总觉得少了点什么。感谢补充。

qqmsg_decoder.py

#!/usr/bin/env python3
# $ sqlite3 872222222-IndexQQMsg.db
# sqlite> .output /home/recolic/extraDisk/tmp/tmp.out
# sqlite> select * from IndexContent_content ;
# sqlite> .quit

import sys
import base64
import datetime

############## User defined
def _filter(line):
    #return '111222333' in line
    #return '257112220' in line
    return True
##############

def decode_qtimestamp(s):
#    print('debug', s, file=sys.stderr)
    if s == '':
        return 0
    ts = base64.b64decode(s)[4:8]
    return sum([int(ts[i])*(256**(3-i)) for i in range(4)])

def timestamp_to_str(int_ts):
    return datetime.datetime.fromtimestamp(int_ts).strftime('%Y-%m-%d %H:%M:%S')

with open(sys.argv[1]) as f: 
    cont = f.read()

for line in cont.split('\n'):
    if line == '':
        continue
    ar = line.split('|')
    timestamp = timestamp_to_str(decode_qtimestamp(ar[-1]))
    ar = ar[:-1]
    line = '|'.join([ar[0]] + [base64.b64decode(ele.encode()).decode(errors='ignore') for ele in ar[1:]])
    line += '|' + timestamp
    if _filter(line):
        print(line)

一键得到一个精简版的手机QQ(Android)

转发别人的。

hackqq.sh

#!/system/bin/sh

# 使用方法:
#     adb shell "curl -Ssl https://gist.githubusercontent.com/kookxiang/1104e898f270c9a7a0784f70979ec532/raw/hackQQ.sh | su"

# 使用方法 (手动):
#     0.确保你手机 Root 了
#     1.下载这个脚本到某个地方
#     2.下载 Android SDK(需要其中的 adb)
#     3.在命令行运行 adb devices,确保能看到你的手机
#     4.通过命令 adb push 这个脚本保存的路径 /sdcard/hackqq.sh 把这份脚本发送到你的手机上
#     5.运行命令 adb shell su -c bash /sdcard/hackqq.sh 执行脚本
#     6.启动你的手机 QQ 试试
#     7.如有问题重装 QQ 一般就可恢复,如需完全恢复请删除 /sdcard/tencent/MobileQQ 目录

if [ `whoami` != "root" ]; then
    echo "请用 Root 权限运行"
    exit -1
fi

clearFile(){
    echo -n > $1
    chmod 551 $1
}

removeAndCreateFile(){
    rm -rf $1
    touch $1
}

clearAndPreventWrite(){
    if [ -d $1 ]; then
        rm -rf $1/*
    else
        mkdir $1
    fi
    chmod 551 $1
}

disableComponent(){
    pm disable com.tencent.mobileqq/${1} > /dev/null
}

echo 正在停止QQ...
am force-stop com.tencent.mobileqq

echo 开始组件清理
echo "正在清理: 动态..."
disableComponent com.tencent.mobileqq.activity.LebaEnabledPluginsActivity
disableComponent com.tencent.mobileqq.activity.LebaListMgrActivity
disableComponent com.tencent.biz.lebasearch.LebaSearchPluginManagerActivity

echo "正在清理: 应用宝..."
disableComponent com.tencent.open.appcenter.QZoneAppCenterActivity
disableComponent com.tencent.open.applist.QZoneAppListActivity
disableComponent com.tencent.open.appcenter.QZoneAppWebViewActivity
disableComponent com.tencent.open.applist.WebAppActivity2

echo "正在清理: 附近的群..."
disableComponent com.tencent.mobileqq.troop.activity.NearbyTroopsActivity
disableComponent com.tencent.mobileqq.troop.activity.NearbyTroopsLocationActivity
disableComponent com.tencent.biz.troop.activity.TroopNearByBigMapActivity

echo "正在清理: 热聊..."
disableComponent com.tencent.mobileqq.troop.activity.NearbyTroopsActivity
disableComponent com.tencent.mobileqq.activity.ChatSettingForHotChat
disableComponent com.tencent.mobileqq.activity.FakeHotChatBrowserActivity
disableComponent com.tencent.mobileqq.activity.HotChatAnnounceActivity
disableComponent com.tencent.mobileqq.activity.HotChatDemoActivity
disableComponent com.tencent.mobileqq.dating.HotChatFlashPicActivity
disableComponent com.tencent.mobileqq.hotchat.HotChatMemberListActivity

echo "正在清理: QQ 游戏..."
disableComponent com.tencent.gamecenter.activities.GameCenterActivity
disableComponent com.tencent.mobileqq.cooperation.InstallGameActivity

echo "正在清理: QQ 阅读..."
disableComponent com.tencent.mobileqq.activity.BookShareAdviceEditActivity
disableComponent cooperation.qqreader.QRBridgeActivity
disableComponent cooperation.qqreader.QRHardWareActivity
disableComponent cooperation.qqreader.QRPluginProxyActivity
disableComponent cooperation.qqreader.QRReaderPageProxyActivity
disableComponent cooperation.qqreader.QRWebBrowserActivity

echo "正在清理: QQ 动漫..."
disableComponent cooperation.comic.VipComicJumpActivity
disableComponent cooperation.comic.VipComicLandReaderProxyActivity
disableComponent cooperation.comic.VipComicPlayProxyActivity
disableComponent cooperation.comic.VipComicPortraitReaderProxyActivity
disableComponent cooperation.comic.VipComicProxyActivity
disableComponent cooperation.comic.VipComicProxyActivity\$SingleTop
disableComponent cooperation.comic.VipComicTranslucentBrowserActivity

echo "正在清理: QQ 看点..."
disableComponent cooperation.qqhotspot.QQHotSpotBridgeActivity
disableComponent cooperation.qqhotspot.QQHotSpotProxyActivity
disableComponent cooperation.qqhotspot.QQHotSpotProxyActivity\$SingleTop

echo 开始清理功能组件
echo "正在清理: 好友动态..."
disableComponent cooperation.qzone.CrashNotificationActivity
disableComponent cooperation.qzone.PluginDownloadActivity
disableComponent com.tencent.mobileqq.activity.QZoneDiscoverActivity
disableComponent com.qzone.feed.ui.activity.QZoneFriendFeedActivity
disableComponent cooperation.qzone.QZoneVideoDownloadActivity
disableComponent cooperation.qzone.QzoneCommonProxyActivity
disableComponent cooperation.qzone.QzoneFeedsPluginProxyActivity
disableComponent cooperation.qzone.QzoneGPUPluginProxyActivity
disableComponent cooperation.qzone.QzoneNOGPUPluginProxyActivity
disableComponent cooperation.qzone.QzoneOrientationPluginProxyActivity
disableComponent com.tencent.mobileqq.activity.QzonePhotoModeActivity
disableComponent cooperation.qzone.QzonePictureExtPluginProxyActivity
disableComponent cooperation.qzone.QzonePicturePluginProxyActivity
disableComponent cooperation.qzone.QzonePluginProxyActivity
disableComponent cooperation.qzone.QzonePublishMoodProxyActivity
disableComponent cooperation.qzone.QzoneTransNoTitlePluginProxyActivity
disableComponent cooperation.qzone.QzoneTransWithKeyboardPluginProxyActivity
disableComponent cooperation.qzone.QzoneTranslucentGPUPluginProxyActivity
disableComponent cooperation.qzone.QzoneTranslucentPluginProxyActivity
disableComponent cooperation.qzone.video.QzoneVideoPluginProxyActivity
disableComponent cooperation.qzone.TranslucentActivity
disableComponent cooperation.qzone.debug.ServerSetting
disableComponent cooperation.qzone.debug.UploadServerSetting
disableComponent cooperation.qzone.debug.QZoneStatisticsSettingActivity

echo "正在清理: QQ 收藏..."
disableComponent cooperation.qqfav.globalsearch.FavoriteSearchActivity
disableComponent cooperation.qqfav.widget.LocationDetailActivity
disableComponent cooperation.qqfav.widget.QfavJumpActivity
disableComponent cooperation.qqfav.QfavPluginProxyActivity
disableComponent cooperation.qqfav.QfavPluginProxyActivity\$DetailProxy
disableComponent cooperation.qqfav.QfavPluginProxyActivity\$ForResult
disableComponent cooperation.qqfav.QfavPluginProxyActivity\$ImageViewer
disableComponent cooperation.qqfav.QfavPluginProxyActivity\$ScreenOrientationProxy
disableComponent cooperation.qqfav.QfavPluginProxyActivity\$SingleTop

echo "正在清理: QQ WiFi..."
disableComponent cooperation.qqwifi.QQWIFIMapProxyActivity
disableComponent cooperation.qqwifi.QQWiFiConnectProxyActivity
disableComponent cooperation.qqwifi.QQWiFiPluginInstallActivity
disableComponent cooperation.qqwifi.QQWiFiProxyActivity

echo "正在清理: 群作业..."
disableComponent cooperation.troop_homework.outer.TroopHWCommitActivity
disableComponent cooperation.troop_homework.outer.TroopHWEmptyActivity
disableComponent cooperation.troop_homework.outer.TroopHWImagePreviewActivity
disableComponent cooperation.troop_homework.outer.TroopHWRecordActivity
disableComponent cooperation.troop_homework.outer.TroopHWRecordArrangeActivity
disableComponent cooperation.troop_homework.TroopHomeworkPluginInstallerActivity
disableComponent cooperation.troop_homework.TroopHomeworkProxyActivity

echo "正在清理: 智能设备..."
disableComponent com.tencent.device.bind.DevicePluginDownloadActivity
disableComponent cooperation.smartdevice.SmartDevicePluginDownloadActivity
disableComponent cooperation.smartdevice.SmartDevicePluginProxyActivity

echo "正在清理: 微云..."
disableComponent cooperation.weiyun.AlbumBackupLaunchProxyActivity
disableComponent cooperation.weiyun.AlbumBackupProxyActivity

echo "正在清理: 水印相机..."
disableComponent cooperation.zebra.WatermarkPluginProxyActivity

echo "正在清理: 悄悄话..."
disableComponent cooperation.secmsg.SecMsgPluginProxyActivity
disableComponent cooperation.secmsg.SecMsgPluginProxyTransparentActivity

echo "正在清理: 电话黄页..."
disableComponent cooperation.huangye.HYBlankActivity
disableComponent cooperation.huangye.HYBridgeActivity
disableComponent cooperation.huangye.HYPluginProxyActivity
disableComponent cooperation.huangye.HYPluginProxyActivity\$SingleTop
disableComponent com.tencent.biz.huangye.QQYPQRCodePreviewActivity

echo "正在清理: 文件近传..."
disableComponent cooperation.qlink.QlinkAgentActivity
disableComponent com.tencent.qlink.activity.QlinkApGuidelineActivity
disableComponent cooperation.qlink.QlinkBridgeActivity
disableComponent com.tencent.qlink.activity.QlinkDefaultActivity
disableComponent cooperation.qlink.QlinkDialogActivity
disableComponent com.tencent.qlink.widget.QlinkDialogWrapper
disableComponent com.tencent.qlink.activity.QlinkDiscoverActivity
disableComponent com.tencent.qlink.activity.QlinkGuidePageActivity
disableComponent cooperation.qlink.QlinkPluginProxyActivity
disableComponent com.tencent.qlink.activity.QlinkProxyActivity
disableComponent com.tencent.qlink.activity.QlinkSearchActivity
disableComponent cooperation.qlink.QlinkShareJumpActivity
disableComponent cooperation.qlink.QlinkStandardDialogActivity
disableComponent com.tencent.qlink.activity.QlinkTransferActivity

echo "正在清理: 来电..."
disableComponent cooperation.dingdong.DingdongPluginBridgeActivity
disableComponent cooperation.dingdong.DingdongPluginProxyActivity
disableComponent cooperation.dingdong.DingdongPluginProxyActivity\$DingActivity
disableComponent cooperation.dingdong.DingdongPluginProxyActivity\$ApprovalActivity
disableComponent cooperation.dingdong.OfficeOpenBrowserActivity

echo "正在清理: 兴趣号..."
disableComponent cooperation.readinjoy.ReadInJoyPluginInstallActivity
disableComponent cooperation.readinjoy.ReadInJoyProxyActivity
disableComponent cooperation.readinjoy.ReadInJoyProxyActivity\$ReadInJoyLandscapeActivity
disableComponent cooperation.readinjoy.ReadInJoyProxyActivity\$ReadInJoyStartActivity
disableComponent com.tencent.biz.pubaccount.readinjoy.activity.ReadInJoyAccountDetailActivity
disableComponent com.tencent.biz.pubaccount.readinjoy.activity.ReadInJoyArticleDetailActivity
disableComponent com.tencent.biz.pubaccount.readinjoy.activity.ReadInJoyFeedsActivity

echo "正在清理: 新鲜事..."
disableComponent com.tencent.mobileqq.freshnews.FreshNewsDetailActivity
disableComponent com.tencent.mobileqq.activity.FreshNewsEditActivity
disableComponent com.tencent.mobileqq.freshnews.MyFreshNewsActivity
disableComponent com.tencent.mobileqq.freshnews.topic.NearbyTopicFeedActivity

echo "正在清理: C2B..."
disableComponent cooperation.c2b.C2BBrowserActivity
disableComponent cooperation.c2b.C2BScanCodeActivity
disableComponent cooperation.c2b.C2BTakePhotoActivity
disableComponent cooperation.c2b.C2BUploadFileActivity
disableComponent cooperation.c2b.C2BUploadImageActivity
disableComponent cooperation.c2b.C2BVideoPreviewActivity

echo "正在清理: 热点..."
disableComponent cooperation.qqhotspot.QQHotSpotBridgeActivity
disableComponent cooperation.qqhotspot.QQHotSpotProxyActivity
disableComponent cooperation.qqhotspot.QQHotSpotProxyActivity\$SingleTop

echo "正在清理: 短视频..."
disableComponent com.tencent.mobileqq.activity.shortvideo.MX3ShortVideoOpenGlActivity
disableComponent com.tencent.mobileqq.activity.shortvideo.SendVideoActivity
disableComponent com.tencent.mobileqq.activity.shortvideo.ShortVideoOpenGlActivity
disableComponent com.tencent.mobileqq.activity.shortvideo.ShortVideoPlayActivity
disableComponent com.tencent.mobileqq.activity.shortvideo.ShortVideoPlayerActivity
disableComponent com.tencent.mobileqq.activity.shortvideo.ShortVideoPreviewActivity

echo "正在清理: 个性装扮..."
disableComponent com.tencent.mobileqq.activity.IndividuationSetActivity
disableComponent com.tencent.mobileqq.vas.AvatarPendantMarketActivity
disableComponent com.tencent.mobileqq.vas.ChatBackgroundMarketActivity
disableComponent com.tencent.mobileqq.activity.QQVasH5PayBrowserActivity
disableComponent com.tencent.mobileqq.theme.diy.ThemeDIYActivity
disableComponent com.tencent.mobileqq.activity.ThemeDownloadAndSetActivity
disableComponent com.tencent.mobileqq.activity.ThemeNoviceGuideActivity
disableComponent com.tencent.mobileqq.activity.ThemeSwitchDlgActivity

echo "正在清理: 个性签名..."
disableComponent com.tencent.mobileqq.richstatus.ActionGridActivity
disableComponent com.tencent.mobileqq.richstatus.ActionListActivity
disableComponent com.tencent.mobileqq.richstatus.ActionUrlActivity
disableComponent com.tencent.mobileqq.richstatus.EditActivity
disableComponent com.tencent.mobileqq.richstatus.MovieDetailActivity
disableComponent com.tencent.mobileqq.richstatus.StatusHistoryActivity

echo "正在清理: 附近..."
disableComponent com.tencent.mobileqq.nearby.interestTag.ChooseInterestTagActivity
disableComponent com.tencent.mobileqq.nearby.myvistor.MyVistorListActivity
disableComponent com.tencent.mobileqq.activity.NearPeopleActivity
disableComponent com.tencent.mobileqq.activity.NearPeopleFilterActivity
disableComponent com.tencent.mobileqq.activity.NearbyBaseActivity
disableComponent com.tencent.mobileqq.nearby.NearbyFlowerInfoActivity
disableComponent com.tencent.mobileqq.nearby.guide.NearbyGuideActivity
disableComponent com.tencent.mobileqq.nearby.profilecard.NearbyPeopleProfileActivity
disableComponent com.tencent.mobileqq.nearby.picbrowser.NearbyPicBrowserActivity
disableComponent com.tencent.mobileqq.nearby.picbrowser.NearbyProfilePicBrowserActivity
disableComponent com.tencent.mobileqq.activity.qqcard.NearbyQQCardActivity
disableComponent com.tencent.mobileqq.nearpeople.ranking.ShowLoveEditorActivity

echo "正在清理: 约会..."
disableComponent com.tencent.mobileqq.dating.DateEventMsgActivity
disableComponent com.tencent.mobileqq.dating.DatingDestinationActivity
disableComponent com.tencent.mobileqq.dating.DatingDetailActivity
disableComponent com.tencent.mobileqq.dating.DatingFeedActivity
disableComponent com.tencent.mobileqq.dating.DatingFilterActivity
disableComponent com.tencent.mobileqq.dating.DatingOthersActivity
disableComponent com.tencent.mobileqq.dating.DatingTopListActivity
disableComponent com.tencent.mobileqq.dating.DatingUserCenterActivity
disableComponent com.tencent.mobileqq.dating.HotChatFlashPicActivity
disableComponent com.tencent.mobileqq.dating.MsgBoxListActivity
disableComponent com.tencent.mobileqq.dating.NearbyTransitActivity
disableComponent com.tencent.mobileqq.dating.PublicDatingActivity
disableComponent com.tencent.mobileqq.dating.SayHelloMsgListActivity

echo "正在清理: 安全检测..."
disableComponent com.tencent.mobileqq.activity.SecurityDetectActivity
disableComponent com.tencent.mobileqq.activity.SecurityLoginDetectActivity
disableComponent com.tencent.mobileqq.activity.SecurityPickproofActivity
disableComponent com.tencent.mobileqq.activity.SecurityProtectActivity
disableComponent com.tencent.securemodule.ui.TransparentActivity
disableComponent com.tencent.mobileqq.activity.QQSpaceCleanActivity

echo "正在清理: 送花..."
disableComponent com.tencent.mobileqq.activity.bless.BlessActivity
disableComponent com.tencent.mobileqq.activity.BlessPTVActivity
disableComponent com.tencent.mobileqq.activity.bless.BlessResultActivity
disableComponent com.tencent.mobileqq.activity.bless.BlessSendTextActivity
disableComponent com.tencent.mobileqq.activity.bless.BlessTypeActivity

echo 开始流氓服务清理
echo "正在停用: 毒瘤服务..."
disableComponent com.tencent.mobileqq.app.CoreService
disableComponent com.tencent.mobileqq.app.CoreService\$KernelService

echo "正在停用: 好友动态..."
disableComponent com.tencent.mobileqq.app.CoreService
disableComponent com.tencent.mobileqq.app.CoreService\$KernelService
disableComponent cooperation.qzone.QzonePictureViewerProxyService
disableComponent cooperation.qzone.video.QzoneVideoPluginProxyService
disableComponent cooperation.qzone.QzonePluginProxyService
disableComponent cooperation.qzone.remote.logic.QzoneWebPluginProxyService
disableComponent cooperation.qzone.QzonePluginPublishQueueProxyService
disableComponent com.tencent.mobileqq.pluginsdk.ipc.PluginRemoteService$Sub1
disableComponent com.tencent.mobileqq.pluginsdk.ipc.PluginRemoteService$Sub2

echo "正在停用: QQ WiFi..."
disableComponent cooperation.qqwifi.QQWiFiAssistService
disableComponent cooperation.qqwifi.QQWiFiAutoJumpService

echo "正在停用: 插件服务..."
disableComponent cooperation.smartdevice.ipc.BluetoothLeProxyService
disableComponent cooperation.smartdevice.ipc.SmartDeviceProxyService
disableComponent cooperation.huangye.ipc.HYProxyService
disableComponent cooperation.qqhotspot.ipc.QQHotSpotProxyService
disableComponent cooperation.qlink.QlinkPluginProxyService
disableComponent cooperation.secmsg.SecMessagerService
disableComponent cooperation.troop_homework.ipc.TroopHomeworkProxyService
disableComponent cooperation.comic.VipComicProxyService
disableComponent com.tencent.mobileqq.music.QQPlayerService

echo "正在停用: 安全登录检查..."
disableComponent com.tencent.securemodule.impl.SecureService

echo "正在停用: 联系人同步..."
disableComponent com.tencent.mobileqq.contactsync.authenticator.AuthenticationService
disableComponent com.tencent.mobileqq.service.contactsync.ContactSyncPluginProxyService

echo "正在停用: 附近..."
disableComponent com.tencent.mobileqq.nearby.ipc.ConnectNearbyProcService

echo "正在停用: 腾讯寻找丢失儿童项目..."
disableComponent com.tencent.device.qfind.BluetoothLeService

echo 正在断开消息接收器
echo "正在禁用: 后台自启..."
disableComponent com.tencent.mobileqq.msf.core.NetConnInfoCenter

echo "正在禁用: QQ 空间..."
disableComponent cooperation.qzone.NotificationClickReceiver

echo "正在禁用: QQ WiFi..."
disableComponent cooperation.qqwifi.AutoConnectReceiver

echo "正在禁用: 系统报告..."
disableComponent com.tencent.open.business.base.appreport.AppReportReceiver

echo "正在禁用: 崩溃报告..."
disableComponent com.tencent.mobileqq.redtouch.RedPointBroadcastReceiver
disableComponent com.tencent.mobileqq.statistics.ReportReceiver
disableComponent com.tencent.mobileqq.statistics.UECReceiver
disableComponent com.tencent.mobileqq.activity.qwallet.report.VACDReportReceiver

echo "正在禁用: 插件崩溃报告..."
disableComponent cooperation.plugin.PluginCrashReceiver

echo "正在禁用: 插件相关..."
disableComponent cooperation.qzone.QzoneProxyReceiver
disableComponent cooperation.dingdong.DingdongPluginProxyBroadcastReceiver
disableComponent cooperation.photoedit.PhotoEditProxyReceiver
disableComponent cooperation.qqreader.QRAioCmdReceiver
disableComponent cooperation.qqfav.QfavPluginProxyReceiver
disableComponent cooperation.comic.VipProxyPreLoadComicProcess
disableComponent cooperation.qqreader.VipProxyRreLoadReaderProcess
disableComponent cooperation.weiyun.WeiyunProxyBroadcastReceiver
disableComponent cooperation.qwallet.plugin.QWalletProxyReceiver

echo "正在禁用: 主题相关..."
disableComponent com.tencent.mobileqq.statistics.UECReceiver

echo 正在清理 Data Provider
disableComponent cooperation.qqfav.content.FavoritesProvider
disableComponent cooperation.readinjoy.content.ReadInJoyDataProvider

if [ -d /sdcard/tencent/MobileQQ/.pendant ]; then
    echo 去除头像挂件
    removeAndCreateFile /sdcard/tencent/MobileQQ/.pendant
fi

if [ -d /sdcard/tencent/MobileQQ/.signatureTemplate ]; then
    echo 去签名气泡
    removeAndCreateFile /sdcard/tencent/MobileQQ/.signatureTemplate
fi

if [ -d /sdcard/tencent/MobileQQ/.custom_background ]; then
    echo 去自定义主题
    removeAndCreateFile /sdcard/tencent/MobileQQ/custom_background
fi

if [ -n /data/data/com.tencent.mobileqq/files/SensMsgTipsCfg.xml ]; then
    echo 去聊天蓝字
    clearFile /data/data/com.tencent.mobileqq/files/SensMsgTipsCfg.xml
fi

if [ -n "$(ls -a /data/data/com.tencent.mobileqq/files/bubble_info)" ]; then
    echo 去聊天气泡
    rm -rf /data/data/com.tencent.mobileqq/files/bubble_info/*
    chmod 0 /data/data/com.tencent.mobileqq/files/bubble_info
fi

if [ -d /sdcard/tencent/mobileQQ/font_info ]; then
    echo 去聊天字体
    removeAndCreateFile /sdcard/tencent/mobileQQ/font_info
fi

if [ -n "$(ls -a /data/data/com.tencent.mobileqq/files/splashpic)" ]; then
    echo 去启动图片
    clearAndPreventWrite /data/data/com.tencent.mobileqq/files/splashpic
fi

if [ -n /data/data/com.tencent.mobileqq/files/recommendEmotion.json ]; then
    echo 去除推荐表情包
    clearFile /data/data/com.tencent.mobileqq/files/recommemd_emotion_file_*
    clearFile /data/data/com.tencent.mobileqq/files/magic_promotion_*.json
    clearFile /data/data/com.tencent.mobileqq/files/recommendEmotion.json
fi

if [ -n "$(ls -a /data/data/com.tencent.mobileqq/app_qqwifi_dir)" ]; then
    echo 禁用 QQ Wifi
    clearAndPreventWrite /data/data/com.tencent.mobileqq/app_qqwifi_dir
    clearAndPreventWrite /data/data/com.tencent.mobileqq/app_qqwifi_jar_storage_name
    clearAndPreventWrite /data/data/com.tencent.mobileqq/app_qqwifi_jarinfo_storage_name
fi

if [ -f /data/data/com.tencent.mobileqq/app_installed_plugin/qzone_live_video_plugin_hack.apk ]; then
    echo 卸载插件 - QQ 空间小视频插件
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/qzone_live_video_plugin_hack.apk
fi

if [ -f /data/data/com.tencent.mobileqq/app_installed_plugin/qzone_plugin.apk ]; then
    echo 卸载插件 - QQ 空间
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/qzone_plugin.apk.cfg
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/qzone_plugin.apk
fi

if [ -f /data/data/com.tencent.mobileqq/app_installed_plugin/qqfav.apk ]; then
    echo 卸载插件 - QQ 收藏
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/qqfav.apk.cfg
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/qqfav.apk
fi

if [ -f /data/data/com.tencent.mobileqq/app_installed_plugin/comic_plugin.apk ]; then
    echo 卸载插件 - QQ 漫画
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/comic_plugin.apk.cfg
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/comic_plugin.apk
fi

if [ -f /data/data/com.tencent.mobileqq/app_installed_plugin/qlink_plugin.apk ]; then
    echo 卸载插件 - QQ 互连
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/qlink_plugin.apk.cfg
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/qlink_plugin.apk
fi

if [ -f /data/data/com.tencent.mobileqq/app_installed_plugin/qqreaderplugin.apk ]; then
    echo 卸载插件 - QQ 阅读
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/qqreaderplugin.apk.cfg
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/qqreaderplugin.apk
fi

if [ -f /data/data/com.tencent.mobileqq/app_installed_plugin/secmsg_plugin.apk ]; then
    echo 卸载插件 - QQ 悄悄话
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/secmsg_plugin.apk.cfg
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/secmsg_plugin.apk
fi

if [ -f /data/data/com.tencent.mobileqq/app_installed_plugin/qqsmartdevice.apk ]; then
    echo 卸载插件 - QQ 智能设备
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/qqsmartdevice.apk.cfg
    rm -rf /data/data/com.tencent.mobileqq/app_installed_plugin/qqsmartdevice.apk
fi

if stat -c %A /data/data/com.tencent.mobileqq/app_installed_plugin | grep w > /dev/null; then
    echo 锁定插件文件夹
    chmod 551 /data/data/com.tencent.mobileqq/app_installed_plugin
fi