Example #1
0
        public bool Decompile(DecompileOptions options)
        {
            lastActionType = ApktoolActionType.Decompile;
            lastFilePath   = options.AppPath;
            lastProjectDir = options.OutputDirectory;

            string keyNoSrc = null, keyNoRes = null, keyForce = null, keyFramePath = null, keyKeepBrokenRes = null, keyMatchOriginal = null, keyOutputDir = null;

            if (options.NoSource)
            {
                keyNoSrc = DecompileKeys.NoSource;
            }
            if (options.NoResource)
            {
                keyNoRes = DecompileKeys.NoResource;
            }
            if (options.Force)
            {
                keyForce = DecompileKeys.Force;
            }
            if (options.KeepBrokenResource)
            {
                keyKeepBrokenRes = DecompileKeys.KeepBrokenResource;
            }
            if (options.MatchOriginal)
            {
                keyMatchOriginal = DecompileKeys.MatchOriginal;
            }
            if (!String.IsNullOrWhiteSpace(options.FrameworkPath))
            {
                keyFramePath = String.Format("{0} \"{1}\"", DecompileKeys.FrameworkPath, options.FrameworkPath);
            }
            if (!String.IsNullOrWhiteSpace(options.OutputDirectory))
            {
                keyOutputDir = String.Format("{0} \"{1}\"", DecompileKeys.OutputDir, options.OutputDirectory);
            }

            //string args = String.Format("d{0}{1}{2}{3}{4}{5} -o \"{6}\" \"{7}\"", keyNoSrc, keyNoRes, keyForce, keyKeepBrokenRes, keyMatchOriginal, keyFramePath, options.ProjectDirectory, options.AppPath);
            string args = String.Format("d{0}{1}{2}{3}{4}{5}{6} \"{7}\"", keyNoSrc, keyNoRes, keyForce, keyKeepBrokenRes, keyMatchOriginal, keyFramePath, keyOutputDir, options.AppPath);

            bool started = this.Start(args);

            this.BeginOutputReadLine();
            this.BeginErrorReadLine();
            return(started);
        }
Example #2
0
        private void buttonStart_Click(object sender, EventArgs e)
        {
            DecompileOptions options = new DecompileOptions(apkPath);

            options.NoResource         = checkBoxNoRes.Checked;
            options.NoSource           = checkBoxNoSrc.Checked;
            options.Force              = checkBoxForce.Checked;
            options.KeepBrokenResource = checkBoxKeepBrokenResource.Checked;
            options.MatchOriginal      = checkBoxMatchOriginal.Checked;
            if (checkBoxFrameworkPath.Checked)
            {
                if (System.IO.Directory.Exists(textBoxFrameworkPath.Text))
                {
                    options.FrameworkPath = textBoxFrameworkPath.Text;
                }
                else
                {
                    MessageBox.Show("Указанной директорию расположения фреймворков не существует.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }

            options.OutputDirectory = textBoxOutputProjectDir.Text;

            bool started = false;

#if !DEBUG
            try
            {
#endif
            started = apktool.Decompile(options);
#if !DEBUG
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
#endif
            if (started)
            {
                progressBarStyle   = ProgressBarStyle.Marquee;
                StartButtonEnabled = false;
            }
        }
Example #3
0
        private bool Decompiling()
        {
            //string projectDir = Path.GetDirectoryName(textBox_DECODE_InputAppPath.Text) + "\\" + System.IO.Path.GetFileNameWithoutExtension(textBox_DECODE_InputAppPath.Text);

            DecompileOptions options = new DecompileOptions(textBox_DECODE_InputAppPath.Text);

            options.NoSource           = checkBox_DECODE_NoSrc.Checked;
            options.NoResource         = checkBox_DECODE_NoRes.Checked;
            options.Force              = checkBox_DECODE_Force.Checked;
            options.KeepBrokenResource = checkBox_DECODE_KeepBrokenRes.Checked;
            options.MatchOriginal      = checkBox_DECODE_MatchOriginal.Checked;
            if (checkBox_DECODE_UseFramework.Checked)
            {
                options.FrameworkPath = textBox_DECODE_FrameDir.Text;
            }
            if (checkBox_DECODE_OutputDirectory.Checked)
            {
                options.OutputDirectory = textBox_DECODE_OutputDirectory.Text;
            }

            return(apktool.Decompile(options));
        }
Example #4
0
        public bool Decompile(DecompileOptions options)
        {
            lastActionType = ApktoolActionType.Decompile;
            lastFilePath = options.AppPath;
            lastProjectDir = options.OutputDirectory;

            string keyNoSrc = null, keyNoRes = null, keyForce = null, keyFramePath = null, keyKeepBrokenRes = null, keyMatchOriginal = null, keyOutputDir = null;

            if (options.NoSource)
                keyNoSrc = DecompileKeys.NoSource;
            if (options.NoResource)
                keyNoRes = DecompileKeys.NoResource;
            if (options.Force)
                keyForce = DecompileKeys.Force;
            if (options.KeepBrokenResource)
                keyKeepBrokenRes = DecompileKeys.KeepBrokenResource;
            if (options.MatchOriginal)
                keyMatchOriginal = DecompileKeys.MatchOriginal;
            if (!String.IsNullOrWhiteSpace(options.FrameworkPath))
                keyFramePath = String.Format("{0} \"{1}\"", DecompileKeys.FrameworkPath, options.FrameworkPath);
            if (!String.IsNullOrWhiteSpace(options.OutputDirectory))
                keyOutputDir = String.Format("{0} \"{1}\"", DecompileKeys.OutputDir, options.OutputDirectory);

            //string args = String.Format("d{0}{1}{2}{3}{4}{5} -o \"{6}\" \"{7}\"", keyNoSrc, keyNoRes, keyForce, keyKeepBrokenRes, keyMatchOriginal, keyFramePath, options.ProjectDirectory, options.AppPath);
            string args = String.Format("d{0}{1}{2}{3}{4}{5}{6} \"{7}\"", keyNoSrc, keyNoRes, keyForce, keyKeepBrokenRes, keyMatchOriginal, keyFramePath, keyOutputDir, options.AppPath);

            bool started = this.Start(args);
            this.BeginOutputReadLine();
            this.BeginErrorReadLine();
            return started;
        }
Example #5
0
        private void buttonStart_Click(object sender, EventArgs e)
        {
            DecompileOptions options = new DecompileOptions(apkPath);
            options.NoResource = checkBoxNoRes.Checked;
            options.NoSource = checkBoxNoSrc.Checked;
            options.Force = checkBoxForce.Checked;
            options.KeepBrokenResource = checkBoxKeepBrokenResource.Checked;
            options.MatchOriginal = checkBoxMatchOriginal.Checked;
            if (checkBoxFrameworkPath.Checked)
            {
                if (System.IO.Directory.Exists(textBoxFrameworkPath.Text))
                    options.FrameworkPath = textBoxFrameworkPath.Text;
                else
                {
                    MessageBox.Show("Указанной директорию расположения фреймворков не существует.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }

            options.OutputDirectory = textBoxOutputProjectDir.Text;

            bool started = false;
            #if !DEBUG
            try
                {
            #endif
            started = apktool.Decompile(options);
            #if !DEBUG
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            #endif
            if (started)
            {
                progressBarStyle = ProgressBarStyle.Marquee;
                StartButtonEnabled = false;
            }
        }
Example #6
0
        private bool Decompiling()
        {
            //string projectDir = Path.GetDirectoryName(textBox_DECODE_InputAppPath.Text) + "\\" + System.IO.Path.GetFileNameWithoutExtension(textBox_DECODE_InputAppPath.Text);

            DecompileOptions options = new DecompileOptions(textBox_DECODE_InputAppPath.Text);
            options.NoSource = checkBox_DECODE_NoSrc.Checked;
            options.NoResource = checkBox_DECODE_NoRes.Checked;
            options.Force = checkBox_DECODE_Force.Checked;
            options.KeepBrokenResource = checkBox_DECODE_KeepBrokenRes.Checked;
            options.MatchOriginal = checkBox_DECODE_MatchOriginal.Checked;
            if (checkBox_DECODE_UseFramework.Checked)
                options.FrameworkPath = textBox_DECODE_FrameDir.Text;
            if (checkBox_DECODE_OutputDirectory.Checked)
                options.OutputDirectory = textBox_DECODE_OutputDirectory.Text;

            return apktool.Decompile(options);
        }