Beispiel #1
0
        public void Start(string block, long startedPos)
        {
            if (IsInitialized == true)
            {
                try
                {
                    var result = AndroidMirrorAPI.ImageDataZone(_deviceHandle, block, startedPos / 512, -1, ImageDataCallBack);
                    if (0 != result)
                    {
                        Exception(string.Format("安卓手机镜像出错!ImageDataZone失败,设备ID:{0} 错误码:{1}", _deviceSerialnumber, result));
                        return;
                    }
                }
                catch (Exception ex)
                {
                    MirrorFile.Close();
                    Console.WriteLine("{0}|{1}", CmdStrings.Progress, MirrorFile.WritedSize.ToString());
                    Exception(string.Format("镜像异常,设备ID:{0} 错误码:{1}", _deviceSerialnumber, ex));
                    return;
                }

                MirrorFile.Close();
                MirrorFile.CreateMD5File();
                Console.WriteLine(CmdStrings.FinishState);
            }
        }
Beispiel #2
0
 /// <summary>
 /// 发送异常状态到调用端
 /// </summary>
 /// <param name="msg"></param>
 private void Exception(string msg)
 {
     MirrorFile.Close();
     Console.WriteLine("{0}|{1}", CmdStrings.Exception, msg);
     IsInitialized = false;
 }