#!/system/bin/sh
# 黑客脚本
# 清屏并显示加载
clear
#!/system/bin/sh
echo "请输入您购买的卡密"
read pwd
if [ "$pwd" = "1" ]; then
echo "欢迎使用念内核"
echo "校验卡密中…"
sleep 3.5;
echo "校验成功！"
# 下一步命令
else
echo "你输入正确的卡密"
exit 1
fi
sleep 9.0;
#!/system/bin/sh
# 黑客脚本
# 清屏并显示加载
clear
#!/system/bin/sh
#!/system/bin/sh
echo "念           念           念念念"
echo "念念         念           念     念"
echo "念  念       念           念      念"
echo "念   念      念           念      念"
echo "念    念     念           念念念念"
echo "念     念    念           念     念"
echo "念      念   念           念        念"
echo "念       念  念           念.        念"
echo "念        念 念           念        念"
echo "念           念           念念念念念"
echo "----------------------------------------------"
echo "    作者：小旭  念    名称：念内核      " 
#!/system/bin/sh
beijing_date=$(date +"%Y-%m-%d")
beijing_time=$(date +"%H:%M:%S")
echo "    北京日期: $beijing_date北京时间: $beijing_time"
echo "----------------------------------------------"
echo "bro 请选择游戏版本"
echo "请选择要启动的游戏版本:"
echo "1) com.tencent.ig[全球]"
echo "2) com.pubg.krmobile[日韩]"
echo "3) com.rekoo.pubgm[台湾]"
echo "4) com.vng.pubgmobile[越南]"
echo -n "请输入数字选择（1-4）: " 
read choice 

case $choice in
    1)
        package_name="com.tencent.ig"
        ;;
    2)
        package_name="com.pubg.krmobile"
        ;;
    3)
        package_name="com.rekoo.pubgm"
        ;;
    4)
        package_name="com.vng.pubgmobile"
        ;;
    *)
        echo "无效选择，退出脚本"
        exit 1
        ;;
esac

# 获取路径
path=$(pm path $package_name | sed -E 's/(.*):(.*)/\2/' | sed -E 's/(.*)base.apk/\1/')lib/arm64/

# 删除现有的 .so 文件
find /data/data/$package_name/ -type f -name "*.so" -exec rm -f {} +

# 检查游戏是否在运行
game_pid=$(pgrep -f "$package_name")
if [ -z "$game_pid" ]; then
    echo "正在启动 $package_name，请稍等......"
    am start -n $package_name/com.epicgames.ue4.SplashActivity
    sleep 2
else
    echo "$package_name 已经在运行，正在关闭..."
    kill -9 $game_pid  # 关闭游戏进程
    echo "$package_name 已被关闭"
    sleep 2
    # 重新启动游戏
    am start -n $package_name/com.epicgames.ue4.SplashActivity
    echo "正在重新启动游戏..."
    sleep 2
fi

# 更新注入器
file_path="${path}inject_arm64"
if [ -e "$file_path" ]; then
    md5_inject=$(md5sum "${path}inject_arm64" | awk '{print $1}')
    md5_arm64_inject=$(md5sum inject_arm64 | awk '{print $1}')
    if [ "$md5_inject" != "$md5_arm64_inject" ]; then
        cp inject_arm64 "${path}"
        chmod 777 "${path}inject_arm64"
        echo "已更新新版本注入器"
    else
        echo "注入器已存在"
    fi
else
    echo "注入器不存在，正在执行写入操作......"
    cp inject_arm64 "${path}"
    chmod 777 "${path}inject_arm64"
fi

# 检查 libNIKE.so 文件并更新
md5_arm64=$(md5sum libxczcnb.so | awk '{print $1}')
echo "libxczcnb.so 的 MD5 值： $md5_arm64"

if [ -e "${path}libxczcnb.so" ]; then
    md5_target=$(md5sum "${path}libxczcnb.so" | awk '{print $1}')
    echo "游戏目录/libxczcnb.so 的 MD5 值： $md5_target"
    if [ "$md5_arm64" != "$md5_target" ]; then
        cp Arnold64/libxczcnb.so "${path}"
        chmod 755 "${path}libxczcnb.so"
        echo "MD5 值不匹配，已将 libxczcnb.so 复制到游戏目录"
        echo "准备注入......"
    fi
else
    cp Arnold64/libxczcnb.so "${path}"
    chmod 755 "${path}libxczcnb.so"
    echo "准备注入......"
fi

# 检查动态库文件是否正常
if [ -f "${path}libxczcnb.so" ] && [ "$(stat -c '%a' ${path}libxczcnb.so)" = "755" ]; then
    echo "[+] 动态库文件正常"
else
    echo "[-] 动态库文件不正确"
    exit 1
fi

# 执行注入
"${path}inject_arm64" -n $package_name -so "${path}libxczcnb.so"
