#!/system/bin/sh

# 目标配置文件路径
CONFIG_FILE="/data/data/com.tsng.hidemyapplist/files/config.json"

# 新的隐藏应用列表配置内容
NEW_CONFIG={"configVersion":90,"detailLog":false,"maxLogSize":512,"forceMountData":true,"templates":{"白":{"isWhitelist":true,"appList":["com.tencent.mobileqq","com.tencent.mm"]}},"scope":{"com.tencent.tmgp.projectg":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.OrangeEnvironment.Detector":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"icu.nullptr.applistdetector":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.zhenxi.hunter":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"io.github.vvb2060.mahoshojo":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"icu.nullptr.nativetest":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.byxiaorun.detector":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.tencent.ig":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.tencent.tmgp.sgame":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"luna.safe.luna":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"chunqiu.safe":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":["com.example.ourom"]},"com.example.ourom":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"wu.keyChain.test":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.netease.yhtj.nearme.gamecenter":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"org.lsposed.manager":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.tencent.mf.uam":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.tencent.tmgp.codev":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.tencent.tmgp.dfm":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.lingqing.detector":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.reveny.nativecheck":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.daxiaamu.op7mutools":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.didjdk.adbhelper":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.duodian.freehire":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":["com.tencent.KiHan","com.tencent.tmgp.supercell.brawlstars"]},"com.tencent.tmgp.pubgmhd":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.heytap.health":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.tencent.tim":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"org.akanework.checker":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.godevelopers.OprekCek":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"io.github.huskydg.memorydetector":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.example.myapplication":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.youhu.laifu":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"io.liankong.riskdetector":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.tencent.KiHan":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.tencent.tmgp.supercell.brawlstars":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]},"com.lilithgames.solarland.android.cn":{"useWhitelist":true,"excludeSystemApps":true,"applyTemplates":["白"],"extraAppList":[]}}}
# 检查文件是否存在
if [ -f "$CONFIG_FILE" ]; then
    # 提示用户确认
    echo "你即将配置隐藏应用列表(仅检测软件)！"
    echo "输入 'yes' 以确认，输入其他内容以取消："
    read CONFIRMATION

    if [ "$CONFIRMATION" = "yes" ]; then
        # 替换文件内容
        echo "$NEW_CONFIG" > "$CONFIG_FILE"
        echo "隐藏应用列表配置成功！"
    else
        echo "操作已取消。"
    fi
else
    echo "您未安装隐藏应用列表！或已安装，请先点开隐藏应用列表再执行此脚本！"
fi