Esempio n. 1
0
        private void installApk(Object obj)
        {
            CmdOption option = new CmdOption(1);

            bool ret = false;

            option.state[0] = Enums.WorkState.RUNNING;
            option.path[0]  = (String)obj;
            option.calcSize();

            mProgress.showProgress(option);
            ret             = mCmd.excuteCmdInstallThirdApp(option.path[0]);
            option.state[0] = ret == true ? (int)Enums.WorkState.SUCC : (int)Enums.WorkState.ERROR;
            mIntfResult.setResult(Enums.CmdType.APK, ret);
            Thread.Sleep(1000);
            mProgress.dismissProgress(0);
        }
Esempio n. 2
0
        private void updateSystem(Object obj)
        {
            CmdOption option = (CmdOption)obj;
            bool      ret    = true;

            option.calcSize();
            if (mProgress != null)
            {
                mProgress.showProgress(option);
            }
            for (int i = 0; i < option.length; i++)
            {
                ret            &= mCmd.excuteCmdUpdate(option.path[i], option.dst[i], option.permission[i]);
                option.state[i] = ret == true ? (int)Enums.WorkState.SUCC : (int)Enums.WorkState.ERROR;
            }

            mIntfResult.setResult(Enums.CmdType.UPDATE, ret);
            Thread.Sleep(1000);
            if (mProgress != null)
            {
                mProgress.dismissProgress(0);
            }
        }
Esempio n. 3
0
        private CmdOption getPartitonOption(int index)
        {
            PATH_IMG = textBoxImgRoute.Text;
            CmdOption option = new CmdOption(1);

            option.index = index;
            switch (index)
            {
            case (Enums.PartitionIndex.ABOOT):
                option.state[0] = Enums.WorkState.RUNNING;
                option.path[0]  = PATH_IMG + @"\" + Enums.PartitionFileName.ABOOT;
                option.calcSize();

                break;

            case Enums.PartitionIndex.BOOT:
                option.state[0] = Enums.WorkState.RUNNING;
                option.path[0]  = PATH_IMG + @"\" + Enums.PartitionFileName.BOOT;
                option.calcSize();
                break;

            case Enums.PartitionIndex.SYSTEM:
                option.state[0] = Enums.WorkState.RUNNING;
                option.path[0]  = PATH_IMG + @"\" + Enums.PartitionFileName.SYSTEM;
                option.calcSize();
                break;

            case Enums.PartitionIndex.MODEM:
                option.state[0] = Enums.WorkState.RUNNING;
                option.path[0]  = PATH_IMG + @"\" + Enums.PartitionFileName.MODEM;
                option.calcSize();
                break;

            case (Enums.PartitionIndex.SPLASH):
                option.state[0] = Enums.WorkState.RUNNING;
                option.path[0]  = PATH_IMG + @"\" + Enums.PartitionFileName.SPLASH;
                option.calcSize();
                break;

            case (Enums.PartitionIndex.USERDATA):
                option.state[0] = Enums.WorkState.RUNNING;
                option.path[0]  = PATH_IMG + @"\" + Enums.PartitionFileName.USERDATA;
                option.calcSize();
                break;

            case (Enums.PartitionIndex.RECOVERY):
                option.state[0] = Enums.WorkState.RUNNING;
                option.path[0]  = PATH_IMG + @"\" + Enums.PartitionFileName.RECOVERY;
                option.calcSize();
                break;

            case (Enums.PartitionIndex.ALL):
                option         = new CmdOption(7);
                option.index   = Enums.PartitionIndex.ALL;
                option.path[0] = PATH_IMG + @"\" + Enums.PartitionFileName.ABOOT;
                option.path[1] = PATH_IMG + @"\" + Enums.PartitionFileName.BOOT;
                option.path[2] = PATH_IMG + @"\" + Enums.PartitionFileName.SYSTEM;
                option.path[3] = PATH_IMG + @"\" + Enums.PartitionFileName.MODEM;
                option.path[4] = PATH_IMG + @"\" + Enums.PartitionFileName.SPLASH;
                option.path[5] = PATH_IMG + @"\" + Enums.PartitionFileName.USERDATA;
                option.path[6] = PATH_IMG + @"\" + Enums.PartitionFileName.RECOVERY;

                option.state[0] = Enums.WorkState.RUNNING;
                option.state[1] = Enums.WorkState.RUNNING;
                option.state[2] = Enums.WorkState.RUNNING;
                option.state[3] = Enums.WorkState.RUNNING;
                option.state[4] = Enums.WorkState.RUNNING;
                option.state[5] = Enums.WorkState.RUNNING;
                option.state[6] = Enums.WorkState.RUNNING;
                option.calcSize();
                break;
            }
            return(option);
        }