
[[ "$(id -u)" != "2000" && "$(id -u)" != "0" ]] && echo "\e[31m需求ROOT\e[0m" && exit

Pns=("com.idragoncheats.studio" "com.idragoncheats.studiopro" "com.goxome.aidestudio")  # 全部包名
Fd=()  # 找到的包名

for Pn in "${Pns[@]}"
do
    [ -e "/data/user/0/${Pn}/no_backup/ndksupport-1710240003/android-ndk-aide/ndk-build" ] && Fd+=("${Pn}")
done
[ ${#Fd[@]} -eq 0 ] && echo "\e[31m未找到ndk-build\e[0m" && exit 1
if [ ${#Fd[@]} != 1 ] ; then
    echo "\e[31m找到多个ndk-build，输入序号使用\e[0m"
    for i in "${!Fd[@]}"; do
        echo "\e[33m[$((i+1))]\e[90m ->\e[37m ${Fd[i]}\e[0m"
    done
    read Input
    if [[ $Input -ge 1 && $Input -le ${#Fd[@]} ]]; then
        UsePN="${Fd[$((Input-1))]}"
    else
        echo "\e[31m请输入1~${#Fd[@]}\e[0m"
        exit 1
    fi
else
    UsePN="${Fd[0]}"
fi

echo "\e[33m编译...QQ:1074493370 "
/data/user/0/${UsePN}/no_backup/ndksupport-1710240003/android-ndk-aide/ndk-build 2>&1

[ $? -eq 0 ] && echo "\e[32m编译成功\e[0m" || { echo "\e[31m编译错误\e[0m" && exit 1; }

tmp=/data/adb/
rm -rf ${tmp}/Ace编译.sh && mv ./libs/**/* ${tmp}/Ace编译.sh && chmod +x ${tmp}/Ace编译.sh
echo "下面执行辅助"
${tmp}/Ace编译.sh