Example #1
0
        private void buttonStart_Click(object sender, EventArgs e)
        {
            BuildOptions options = new BuildOptions(projectDir);

            options.ForceAll     = checkBoxForceAll.Checked;
            options.CopyOriginal = checkBoxCopyOriginal.Checked;
            if (checkBoxCustomAapt.Checked)
            {
                if (System.IO.File.Exists(textBoxAaptPath.Text))
                {
                    options.AaptPath = textBoxAaptPath.Text;
                }
                else
                {
                    MessageBox.Show("Указанного файла aapt не существует.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }
            if (checkBoxUseFramework.Checked)
            {
                options.FrameworkPath = textBoxFrameworkPath.Text;
            }
            options.AppPath = textBoxOutputApkPath.Text;

            bool started = false;

#if !DEBUG
            try
            {
#endif
            started = apktool.Build(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 #2
0
        private bool Build()
        {
            //String outputAPK = textBox_BUILD_InputProjectDir.Text + DateTime.Now.ToString("_yyyyMMdd_HH-mm-ss") + ".apk";

            BuildOptions options = new BuildOptions(textBox_BUILD_InputProjectDir.Text);

            options.ForceAll     = checkBox_BUILD_ForceAll.Checked;
            options.CopyOriginal = checkBox_BUILD_CopyOriginal.Checked;
            if (checkBox_BUILD_UseAapt.Checked)
            {
                options.AaptPath = textBox_BUILD_AaptPath.Text;
            }
            if (checkBox_BUILD_UseFramework.Checked)
            {
                options.FrameworkPath = textBox_BUILD_FrameDir.Text;
            }
            if (checkBox_BUILD_OutputAppPath.Checked)
            {
                options.AppPath = textBox_BUILD_OutputAppPath.Text;
            }

            return(apktool.Build(options));
        }