Exemplo n.º 1
0
        public static bool PanDuan_Qidong(string a_b, int dqinx)
        {
            //大框 原始 376 668 横过来后 960 540
            //小框 原始 217 387 横过来后216 122
            //1920 分辨率  2560 1440
            string dizhi = null;
            string path  = null;
            string seed  = null;

            MyFuncUtil.myqiehuancd(a_b, out dizhi, out path, out seed);
            myDm dm     = new myDm();
            int  x1     = -1;
            int  y1     = -1;
            int  jubing = MyLdcmd.getDqmoniqiJuBingByIndex(dqinx, dizhi);

            if (jubing <= 0)
            {
                WriteLog.WriteLogFile(dqinx + "", "游戏判断启动,句柄绑定错误");
                return(false);
            }
            dm.myGetClientRect(jubing, out x1, out y1);
            if (y1 != 540 && y1 != 122 && y1 != 668 && y1 != 432)
            {
                WriteLog.WriteLogFile(dqinx + "", "游戏启动不成功,界面有微信图标 " + x1 + " " + y1);
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
        public static void myReSizeNeiKuang(int index, out int width, out int height, string dizhi = @"d:\ChangZhi\dnplayer2\", string youxi = "luneng")
        {
            mylogandxianshi("模拟器内框" + index + "开始改位置");
            int dqwidth  = 1920; //1920 1024
            int dqheight = 1080; //1080 768
            int yiquanw  = 601;
            int yiquany  = 338;

            if (youxi.Equals("luneng"))
            {
                yiquanw = 688; //原来外框 727 425
                yiquany = 387;
            }
            width  = yiquanw;
            height = yiquany;
            lock (obj)
            {
                int    jubing = MyLdcmd.getDqmoniqiJuBingByIndex(index, dizhi);
                IntPtr p      = new IntPtr(jubing);
                IntPtr p2     = new IntPtr(HWND_TOP);
                int    x      = 0;
                int    y      = 0;
                x = (index % 4) * (dqwidth / 4);
                y = (index / 4) * (dqheight / 4);
                mylogandxianshi(index + "x:" + x + ",y:" + y);
                if (youxi.Equals("luneng"))
                {
                    SetWindowPos(p, p2, x + 20, y + 19, yiquanw, yiquany, SWP_SHOWWINDOW);
                }
                else
                {
                    SetWindowPos(p, p2, x, y, yiquanw, yiquany, SWP_SHOWWINDOW);
                }
            }
        }
Exemplo n.º 3
0
        public static void panduanqidong(int dqinx, string a_b)
        {
            string dizhi = null;
            string path  = null;
            string seed  = null;

            MyFuncUtil.myqiehuancd(a_b, out dizhi, out path, out seed);
            myDm dm     = new myDm();
            int  x1     = -1;
            int  y1     = -1;
            int  jubing = MyLdcmd.getDqmoniqiJuBingByIndex(dqinx, dizhi);

            if (jubing <= 0)
            {
                return;
            }
            dm.myGetClientRect(jubing, out x1, out y1);
            MyFuncUtil.mylogandxianshi("游戏启动不成功,界面有微信图标" + x1 + "  " + y1);
        }
Exemplo n.º 4
0
        public static bool PanDuan_QidongLurenzhanghao(string a_b, int dqinx)
        {
            myDm dm = new myDm();
            int  x1 = -1;
            int  y1 = -1;

            Entity.FuHeSanDian tysd = null;
            int w = -1, h = -1;

            getWindowSize(dqinx, out w, out h);
            //WriteLog.WriteLogFile(dqinx + "", w + " " + h);
            int a = 0;

            if (w == 489 && h == 840)
            {
                a    = 1;
                tysd = fuzhu.TongYong_SanDian.GetObject().findFuHeSandianByName("雷电首页截图-路人");
            }
            if (w == 1318 && h == 758)
            {
                a    = 1;
                tysd = fuzhu.TongYong_SanDian.GetObject().findFuHeSandianByName("雷电首页截图-平板");
            }
            if (a == 1)
            {
                int jubing = MyLdcmd.getDqmoniqiJuBingByIndex(dqinx);
                if (jubing <= 0)
                {
                    WriteLog.WriteLogFile(dqinx + "", "游戏判断启动,句柄绑定错误");
                    return(false);
                }
                dm.bindWindow(jubing);
                if (dm.mohuByLeiBool_duokai(tysd.Sd))
                {
                    WriteLog.WriteLogFile(dqinx + "", "游戏启动不成功,界面有雷电游戏 " + x1 + " " + y1);
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 5
0
        public static bool lurenResizeOk1(int index)
        {
            WriteLog.WriteLogFile(index + "", "改变窗口位置--开始");
            string dizhi = @"d:\ChangZhi\dnplayer2\";
            bool   t = false;
            long   ksjs = GetTimestamp();
            long   ks = GetTimestamp();
            int    width = -1, height = -1;

            myReSize1(index, out width, out height);
            int jubing  = MyLdcmd.getDqmoniqiWaiCengJuBingByIndex(index, dizhi);
            int jubing2 = MyLdcmd.getDqmoniqiJuBingByIndex(index, dizhi);

            if (jubing <= 0)
            {
                WriteLog.WriteLogFile(index + "", "改变窗口位置,句柄绑定错误");
                return(t);
            }
            Rect lprect = new Rect();

            GetWindowRect(new IntPtr(jubing), out lprect);
            Rect rprect = new Rect();

            GetWindowRect(new IntPtr(jubing2), out rprect);
            WriteLog.WriteLogFile(index + "", "当前width,height" + width + "," + height + " 改变位置外框" + (lprect.Right - lprect.Left) + " " + (lprect.Bottom - lprect.Top) + ",内框" + (rprect.Right - rprect.Left) + " " + (rprect.Bottom - rprect.Top));
            if ((lprect.Right - lprect.Left) == width && (lprect.Bottom - lprect.Top) == height)
            {
                WriteLog.WriteLogFile(index + "", "改变位置外框成功" + (lprect.Right - lprect.Left) + " " + (lprect.Bottom - lprect.Top) + ",内框" + (rprect.Right - rprect.Left) + " " + (rprect.Bottom - rprect.Top));
                t = true;
                return(t);
            }
            while (true)
            {
                long js = GetTimestamp();
                if ((js - ksjs) > 30 * 1000)
                {
                    lprect = new Rect();
                    GetWindowRect(new IntPtr(jubing), out lprect);
                    rprect = new Rect();
                    GetWindowRect(new IntPtr(jubing2), out rprect);
                    WriteLog.WriteLogFile(index + "", "当前width,height" + width + "," + height + " 改变位置外框" + (lprect.Right - lprect.Left) + " " + (lprect.Bottom - lprect.Top) + ",内框" + (rprect.Right - rprect.Left) + " " + (rprect.Bottom - rprect.Top));
                    if ((lprect.Right - lprect.Left) == width && (lprect.Bottom - lprect.Top) == height)
                    {
                        WriteLog.WriteLogFile(index + "", "改变位置外框" + (lprect.Right - lprect.Left) + " " + (lprect.Bottom - lprect.Top) + ",内框" + (rprect.Right - rprect.Left) + " " + (rprect.Bottom - rprect.Top));
                        t = true;
                        break;
                    }
                    if ((lprect.Right - lprect.Left) != width || (lprect.Bottom - lprect.Top) != height)
                    {
                        myReSize1(index, out width, out height);
                    }
                    ksjs = GetTimestamp();
                    WriteLog.WriteLogFile(index + "", "30s resize一次");
                }
                if ((js - ks) > 10 * 60 * 1000)
                {
                    WriteLog.WriteLogFile(index + "", "10分钟改变位置不成功 ");
                    break;
                }
            }
            return(t);
        }
Exemplo n.º 6
0
        public void getIP(int dqinx, string dizhi, string seed, int jubing, int waicengjubing, out string ip)
        {
            WriteLog.WriteLogFile(dqinx + "", "获取IP,jubing:" + jubing + ",waicengjubing:" + waicengjubing);
            ip = "";
            bool   t           = false;
            string packagename = "package:com.ddm.iptools";
            //lock (obj)
            {
                t = MyFuncUtil.lureninstallOk(dqinx, packagename, () =>
                {
                    WriteLog.WriteLogFile(dqinx + "", "安装app没成功--iptools");

                    /*temp = myQuit(dqinx, dizhi);
                     * if (!temp)
                     * {
                     *  WriteLog.WriteLogFile(dqinx + "", "模拟器" + dqinx + "关闭失败");
                     *  Thread.Sleep(20000);
                     *  return;
                     * }*/
                    WriteLog.WriteLogFile(dqinx + "", "模拟器" + dqinx + "安装iptools");
                    //MyLdcmd.myRestore(dqinx, seed, dizhi);
                    MyLdcmd.installApp(dqinx, @"C:\迅雷下载\2_1b823b1928a42f09423f28cb79179bfe.apk");

                    /*temp = myQuit(dqinx, dizhi);
                     * if (!temp)
                     * {
                     *  WriteLog.WriteLogFile(dqinx + "", "模拟器" + dqinx + "关闭失败");
                     *  Thread.Sleep(20000);
                     *  return;
                     * }
                     * temp = MyFuncUtil.Launch(dqinx, dizhi);
                     * if (!temp)
                     * {
                     *  WriteLog.WriteLogFile(dqinx + "", "模拟器" + dqinx + "打开失败");
                     *  Thread.Sleep(20000);
                     *  return;
                     * }*/
                    Thread.Sleep(3000);
                });
                if (t == false)
                {
                    Thread.Sleep(1000 * 60 * 2);
                    bool luren = MyLdcmd.jingjieisok(dqinx, packagename);
                    if (!luren)
                    {
                        return;
                    }
                }
                //窗口已打开 获取句柄
                if (jubing <= 0)
                {
                    WriteLog.WriteLogFile(dqinx + "", "准备获取句柄,在getIP处");
                    jubing = MyLdcmd.getDqmoniqiJuBingByIndex(dqinx, dizhi);
                    WriteLog.WriteLogFile(dqinx + "", "模拟器" + dqinx + "句柄为" + jubing);
                }
                myDm dm = new myDm();
                int  r1 = 0;
                if (jubing > 0)
                {
                    r1 = dm.bindWindow(jubing);
                }
                if (r1 != 1)
                {
                    WriteLog.WriteLogFile(dqinx + "", "模拟器" + dqinx + "绑定失败");
                    Thread.Sleep(20000);
                    return;
                }
                //dm.SetClipboard("请");
                //apkName = dict["IPtool"];
                string apkName = "com.ddm.iptools/com.ddm.iptools.ui.MainActivity";
                //int i = MyFuncUtil.QiDongWanChengLurenzhanghao("d", dqinx, apkName);
                fuzhu.YouXiFactory yxf = new fuzhu.YouXiFactory();
                int i = QiDongWanChengGetZhiDingDian(dqinx, apkName, dm, jubing, yxf.CreateYouXiSanDian("tongyongsandian"), "IPtool");
                if (i == -1)
                {
                    WriteLog.WriteLogFile(dqinx + "", "模拟器" + dqinx + "打开app" + apkName + "失败");
                    Thread.Sleep(20000);
                    return;
                }
                string yiqu = "";
                bool   t2   = PanDuan_QidongByYiQuDian_IP(dqinx, 1000 * 60, dm, jubing, out yiqu);
                if (t2)
                {
                    WriteLog.WriteLogFile(dqinx + "", "模拟器发现已取点" + yiqu);
                }
                ip = yiqu;

                /*if (ip != "" && ip.IndexOf("请") < 0)
                 * {
                 *  return;
                 * }  */
            }
        }