#!/bin/bash

function print_color() {
  local color=$1
  shift
  echo -e "\033[${color}m$@\033[0m"
}

# 检查用户是否为root用户
if [ $(id -u) != 0 ]; then
    echo "\n请使用root权限执行 !"
    exit 1
fi

sleep 0.3

echo -e "\033[1;33;40m启动~
作者：花落
如果追踪闪退请更换游戏底包
TG@hualuopd\033[0m"
echo -e "\033[33;31m**************************************\033[0m"   	

sleep 2

path=`pm path com.tencent.iglite | sed -E  's/(.*):(.*)/\2/'| sed -E 's/(.*)base.apk/\1/'`"lib/arm/"
cp -f `pwd`"/Inject_arm" $path"Inject_arm"
chmod 777 $path"Inject_arm"
cp -f `pwd`"/libhualuo.so" $path"libhualuo.so"
chmod 777 $path"libhualuo.so"

am start -n com.tencent.iglite/com.epicgames.ue4.SplashActivity
sleep 8

$path"Inject_arm" --pname com.tencent.iglite --libpath $path"libhualuo.so"