From 7accee6cc10f7816a864ef44e47cd23ebbdfffa9 Mon Sep 17 00:00:00 2001
From: q3b5q3 <40742924+AndnixSH@users.noreply.github.com>
Date: Sat, 31 Dec 2022 17:14:20 +0100
Subject: [PATCH] Added option to overwrite input apk of signing
---
APKToolGUI/ApkTool/Signapk.cs | 2 +-
APKToolGUI/Forms/FormMain.Designer.cs | 11 ++
APKToolGUI/Forms/FormMain.cs | 11 +-
APKToolGUI/Forms/FormMain.resx | 88 ++++++---
APKToolGUI/Forms/FormSettings.Designer.cs | 178 +++++++++---------
APKToolGUI/Forms/FormSettings.resx | 7 +-
APKToolGUI/Handlers/DragDropHandlers.cs | 2 +
.../Handlers/SignControlEventHandlers.cs | 2 +
APKToolGUI/Properties/Settings.Designer.cs | 12 ++
APKToolGUI/Properties/Settings.settings | 3 +
APKToolGUI/app.config | 3 +
changelog.txt | 1 +
12 files changed, 193 insertions(+), 127 deletions(-)
diff --git a/APKToolGUI/ApkTool/Signapk.cs b/APKToolGUI/ApkTool/Signapk.cs
index a38e17f..2fc8f58 100644
--- a/APKToolGUI/ApkTool/Signapk.cs
+++ b/APKToolGUI/ApkTool/Signapk.cs
@@ -80,7 +80,7 @@ namespace APKToolGUI
alias = String.Format("--ks-key-alias {0}", Settings.Default.Sign_Alias);
string outputDir = null;
- if (Settings.Default.Sign_UseOutputDir)
+ if (Settings.Default.Sign_UseOutputDir || !Settings.Default.Sign_OverwriteInputFile)
outputDir = String.Format("--out \"{0}\"", output);
string v1 = null;
diff --git a/APKToolGUI/Forms/FormMain.Designer.cs b/APKToolGUI/Forms/FormMain.Designer.cs
index 2903894..48cb00a 100644
--- a/APKToolGUI/Forms/FormMain.Designer.cs
+++ b/APKToolGUI/Forms/FormMain.Designer.cs
@@ -213,6 +213,7 @@
this.textBox_BUILD_AaptPath = new System.Windows.Forms.TextBox();
this.textBox_BUILD_FrameDir = new System.Windows.Forms.TextBox();
this.checkBox_BUILD_UseFramework = new System.Windows.Forms.CheckBox();
+ this.checkBox1 = new System.Windows.Forms.CheckBox();
this.autoDelIdsigChkBox = new System.Windows.Forms.CheckBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.aliasTxtBox = new System.Windows.Forms.TextBox();
@@ -855,6 +856,7 @@
//
// groupBox_SIGN_Options
//
+ this.groupBox_SIGN_Options.Controls.Add(this.checkBox1);
this.groupBox_SIGN_Options.Controls.Add(this.autoDelIdsigChkBox);
this.groupBox_SIGN_Options.Controls.Add(this.schemev4ComboBox);
this.groupBox_SIGN_Options.Controls.Add(this.label27);
@@ -1683,6 +1685,14 @@
this.checkBox_BUILD_UseFramework.Name = "checkBox_BUILD_UseFramework";
this.checkBox_BUILD_UseFramework.UseVisualStyleBackColor = true;
//
+ // checkBox1
+ //
+ resources.ApplyResources(this.checkBox1, "checkBox1");
+ this.checkBox1.Checked = global::APKToolGUI.Properties.Settings.Default.Sign_OverwriteInputFile;
+ this.checkBox1.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "Sign_OverwriteInputFile", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
+ this.checkBox1.Name = "checkBox1";
+ this.checkBox1.UseVisualStyleBackColor = true;
+ //
// autoDelIdsigChkBox
//
resources.ApplyResources(this.autoDelIdsigChkBox, "autoDelIdsigChkBox");
@@ -2212,6 +2222,7 @@
private System.Windows.Forms.ToolStripMenuItem baksmaliIssuesToolStripMenuItem;
private System.Windows.Forms.CheckBox autoDelIdsigChkBox;
private System.Windows.Forms.ToolStripMenuItem openTempFolderToolStripMenuItem;
+ private System.Windows.Forms.CheckBox checkBox1;
}
}
diff --git a/APKToolGUI/Forms/FormMain.cs b/APKToolGUI/Forms/FormMain.cs
index 702edee..436110d 100644
--- a/APKToolGUI/Forms/FormMain.cs
+++ b/APKToolGUI/Forms/FormMain.cs
@@ -156,13 +156,12 @@ namespace APKToolGUI
string outputDir = file;
if (Settings.Default.Zipalign_UseOutputDir && !IgnoreOutputDirContextMenu)
outputDir = Path.Combine(Settings.Default.Sign_OutputDir, Path.GetFileName(inputFile));
+ if (!Settings.Default.Sign_OverwriteInputFile)
+ outputDir = PathUtils.GetDirectoryNameWithoutExtension(outputDir) + "_signed.apk";
if (Sign(inputFile, outputDir) == 0)
{
- if (Settings.Default.Zipalign_UseOutputDir && !IgnoreOutputDirContextMenu)
- ToLog(ApktoolEventType.None, String.Format(Language.SignSuccessfullyCompleted, inputFile));
- else
- ToLog(ApktoolEventType.None, String.Format(Language.SignSuccessfullyCompleted, outputDir));
+ ToLog(ApktoolEventType.None, String.Format(Language.SignSuccessfullyCompleted, outputDir));
if (Settings.Default.AutoDeleteIdsigFile)
{
@@ -275,7 +274,7 @@ namespace APKToolGUI
#if DEBUG
ToLog(ApktoolEventType.Warning, Language.ErrorGettingApkInfo + "\n" + ex.ToString());
#else
- ToLog(ApktoolEventType.Warning, Language.ErrorGettingApkInfo);
+ ToLog(ApktoolEventType.Warning, Language.ErrorGettingApkInfo);
#endif
}
}
@@ -517,7 +516,7 @@ namespace APKToolGUI
if (ApkFixer.RemoveApkToolDummies(outputDir))
ToLog(ApktoolEventType.None, Language.RemoveApkToolDummies);
}
- ToLog(ApktoolEventType.Done, Language.AllDone);
+ ToLog(ApktoolEventType.Done, "=====[ " + Language.AllDone + " ]=====");
}
else
ToLog(ApktoolEventType.Error, Language.ErrorDecompiling);
diff --git a/APKToolGUI/Forms/FormMain.resx b/APKToolGUI/Forms/FormMain.resx
index cff144d..5065609 100644
--- a/APKToolGUI/Forms/FormMain.resx
+++ b/APKToolGUI/Forms/FormMain.resx
@@ -3283,6 +3283,36 @@ and change target SDK to 29
True
+
+ True
+
+
+ NoControl
+
+
+ 8, 329
+
+
+ 126, 17
+
+
+ 30
+
+
+ Overwrite input file
+
+
+ checkBox1
+
+
+ System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ groupBox_SIGN_Options
+
+
+ 0
+
True
@@ -3311,7 +3341,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 0
+ 1
Default
@@ -3341,7 +3371,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 1
+ 2
True
@@ -3371,7 +3401,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 2
+ 3
Default
@@ -3401,7 +3431,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 3
+ 4
True
@@ -3431,7 +3461,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 4
+ 5
Default
@@ -3461,7 +3491,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 5
+ 6
True
@@ -3491,7 +3521,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 6
+ 7
Default
@@ -3521,7 +3551,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 7
+ 8
True
@@ -3551,7 +3581,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 8
+ 9
249, 180
@@ -3572,7 +3602,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 9
+ 10
NoControl
@@ -3602,7 +3632,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 10
+ 11
247, 98
@@ -3623,7 +3653,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 11
+ 12
True
@@ -3653,7 +3683,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 12
+ 13
True
@@ -3683,7 +3713,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 13
+ 14
249, 152
@@ -3704,7 +3734,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 14
+ 15
True
@@ -3740,7 +3770,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 15
+ 16
True
@@ -3776,7 +3806,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 16
+ 17
True
@@ -3806,7 +3836,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 17
+ 18
True
@@ -3836,7 +3866,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 18
+ 19
True
@@ -3872,7 +3902,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 19
+ 20
True
@@ -3908,7 +3938,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 20
+ 21
NoControl
@@ -3938,7 +3968,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 21
+ 22
247, 208
@@ -3962,7 +3992,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 22
+ 23
NoControl
@@ -3992,7 +4022,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 23
+ 24
NoControl
@@ -4022,7 +4052,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 24
+ 25
247, 42
@@ -4046,7 +4076,7 @@ and change target SDK to 29
groupBox_SIGN_Options
- 25
+ 26
247, 69
@@ -4070,13 +4100,13 @@ and change target SDK to 29
groupBox_SIGN_Options
- 26
+ 27
- 6, 6
+ 7, 6
- 556, 348
+ 556, 385
17
diff --git a/APKToolGUI/Forms/FormSettings.Designer.cs b/APKToolGUI/Forms/FormSettings.Designer.cs
index 5eeebf5..d69fe39 100644
--- a/APKToolGUI/Forms/FormSettings.Designer.cs
+++ b/APKToolGUI/Forms/FormSettings.Designer.cs
@@ -32,26 +32,26 @@
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.label6 = new System.Windows.Forms.Label();
+ this.checkBox5 = new System.Windows.Forms.CheckBox();
+ this.checkBox4 = new System.Windows.Forms.CheckBox();
+ this.customTempLocationTxtBox = new System.Windows.Forms.TextBox();
+ this.textBoxCustomJavaLocation = new System.Windows.Forms.TextBox();
this.buttonCustomTempLocation = new System.Windows.Forms.Button();
+ this.checkBox3 = new System.Windows.Forms.CheckBox();
this.buttonCustomJavaLocation = new System.Windows.Forms.Button();
+ this.checkBox2 = new System.Windows.Forms.CheckBox();
+ this.checkBox1 = new System.Windows.Forms.CheckBox();
+ this.checkBoxCheckUpdateStartup = new System.Windows.Forms.CheckBox();
this.groupBoxLanguage = new System.Windows.Forms.GroupBox();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.groupBoxContextMenu = new System.Windows.Forms.GroupBox();
+ this.ignoreOutputContextMenuBox = new System.Windows.Forms.CheckBox();
this.labelAdminRights = new System.Windows.Forms.Label();
this.buttonAddContextMenu = new System.Windows.Forms.Button();
this.buttonRemoveContextMenu = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonОК = new System.Windows.Forms.Button();
- this.checkBox5 = new System.Windows.Forms.CheckBox();
- this.label6 = new System.Windows.Forms.Label();
- this.checkBox4 = new System.Windows.Forms.CheckBox();
- this.customTempLocationTxtBox = new System.Windows.Forms.TextBox();
- this.textBoxCustomJavaLocation = new System.Windows.Forms.TextBox();
- this.checkBox3 = new System.Windows.Forms.CheckBox();
- this.checkBox2 = new System.Windows.Forms.CheckBox();
- this.checkBox1 = new System.Windows.Forms.CheckBox();
- this.checkBoxCheckUpdateStartup = new System.Windows.Forms.CheckBox();
- this.ignoreOutputContextMenuBox = new System.Windows.Forms.CheckBox();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
@@ -92,6 +92,44 @@
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
+ // label6
+ //
+ resources.ApplyResources(this.label6, "label6");
+ this.label6.ForeColor = System.Drawing.Color.DimGray;
+ this.label6.Name = "label6";
+ //
+ // checkBox5
+ //
+ resources.ApplyResources(this.checkBox5, "checkBox5");
+ this.checkBox5.Checked = global::APKToolGUI.Properties.Settings.Default.Utf8FilenameSupport;
+ this.checkBox5.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "Utf8FilenameSupport", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
+ this.checkBox5.Name = "checkBox5";
+ this.checkBox5.UseVisualStyleBackColor = true;
+ //
+ // checkBox4
+ //
+ resources.ApplyResources(this.checkBox4, "checkBox4");
+ this.checkBox4.Checked = global::APKToolGUI.Properties.Settings.Default.UseCustomJavaExe;
+ this.checkBox4.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "UseCustomJavaExe", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
+ this.checkBox4.Name = "checkBox4";
+ this.checkBox4.UseVisualStyleBackColor = true;
+ //
+ // customTempLocationTxtBox
+ //
+ resources.ApplyResources(this.customTempLocationTxtBox, "customTempLocationTxtBox");
+ this.customTempLocationTxtBox.BackColor = System.Drawing.SystemColors.Window;
+ this.customTempLocationTxtBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "TempDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
+ this.customTempLocationTxtBox.Name = "customTempLocationTxtBox";
+ this.customTempLocationTxtBox.Text = global::APKToolGUI.Properties.Settings.Default.TempDir;
+ //
+ // textBoxCustomJavaLocation
+ //
+ resources.ApplyResources(this.textBoxCustomJavaLocation, "textBoxCustomJavaLocation");
+ this.textBoxCustomJavaLocation.BackColor = System.Drawing.SystemColors.Window;
+ this.textBoxCustomJavaLocation.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "JavaExe", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
+ this.textBoxCustomJavaLocation.Name = "textBoxCustomJavaLocation";
+ this.textBoxCustomJavaLocation.Text = global::APKToolGUI.Properties.Settings.Default.JavaExe;
+ //
// buttonCustomTempLocation
//
resources.ApplyResources(this.buttonCustomTempLocation, "buttonCustomTempLocation");
@@ -99,6 +137,14 @@
this.buttonCustomTempLocation.UseVisualStyleBackColor = true;
this.buttonCustomTempLocation.Click += new System.EventHandler(this.buttonCustomTempLocation_Click);
//
+ // checkBox3
+ //
+ resources.ApplyResources(this.checkBox3, "checkBox3");
+ this.checkBox3.Checked = global::APKToolGUI.Properties.Settings.Default.UseCustomTempDir;
+ this.checkBox3.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "UseCustomTempDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
+ this.checkBox3.Name = "checkBox3";
+ this.checkBox3.UseVisualStyleBackColor = true;
+ //
// buttonCustomJavaLocation
//
resources.ApplyResources(this.buttonCustomJavaLocation, "buttonCustomJavaLocation");
@@ -106,6 +152,31 @@
this.buttonCustomJavaLocation.UseVisualStyleBackColor = true;
this.buttonCustomJavaLocation.Click += new System.EventHandler(this.buttonCustomJavaLocation_Click);
//
+ // checkBox2
+ //
+ resources.ApplyResources(this.checkBox2, "checkBox2");
+ this.checkBox2.Checked = global::APKToolGUI.Properties.Settings.Default.PlaySoundWhenDone;
+ this.checkBox2.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "PlaySoundWhenDone", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
+ this.checkBox2.Name = "checkBox2";
+ this.checkBox2.UseVisualStyleBackColor = true;
+ //
+ // checkBox1
+ //
+ resources.ApplyResources(this.checkBox1, "checkBox1");
+ this.checkBox1.Checked = global::APKToolGUI.Properties.Settings.Default.ClearLogBeforeAction;
+ this.checkBox1.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "ClearLogBeforeAction", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
+ this.checkBox1.Name = "checkBox1";
+ this.checkBox1.UseVisualStyleBackColor = true;
+ //
+ // checkBoxCheckUpdateStartup
+ //
+ resources.ApplyResources(this.checkBoxCheckUpdateStartup, "checkBoxCheckUpdateStartup");
+ this.checkBoxCheckUpdateStartup.Checked = global::APKToolGUI.Properties.Settings.Default.CheckForUpdateAtStartup;
+ this.checkBoxCheckUpdateStartup.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.checkBoxCheckUpdateStartup.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "CheckForUpdateAtStartup", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
+ this.checkBoxCheckUpdateStartup.Name = "checkBoxCheckUpdateStartup";
+ this.checkBoxCheckUpdateStartup.UseVisualStyleBackColor = true;
+ //
// groupBoxLanguage
//
resources.ApplyResources(this.groupBoxLanguage, "groupBoxLanguage");
@@ -130,6 +201,14 @@
this.groupBoxContextMenu.Name = "groupBoxContextMenu";
this.groupBoxContextMenu.TabStop = false;
//
+ // ignoreOutputContextMenuBox
+ //
+ resources.ApplyResources(this.ignoreOutputContextMenuBox, "ignoreOutputContextMenuBox");
+ this.ignoreOutputContextMenuBox.Checked = global::APKToolGUI.Properties.Settings.Default.IgnoreOutputDirContextMenu;
+ this.ignoreOutputContextMenuBox.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "IgnoreOutputDirContextMenu", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
+ this.ignoreOutputContextMenuBox.Name = "ignoreOutputContextMenuBox";
+ this.ignoreOutputContextMenuBox.UseVisualStyleBackColor = true;
+ //
// labelAdminRights
//
resources.ApplyResources(this.labelAdminRights, "labelAdminRights");
@@ -163,85 +242,6 @@
this.buttonОК.UseVisualStyleBackColor = true;
this.buttonОК.Click += new System.EventHandler(this.buttonОК_Click);
//
- // checkBox5
- //
- resources.ApplyResources(this.checkBox5, "checkBox5");
- this.checkBox5.Checked = global::APKToolGUI.Properties.Settings.Default.Utf8FilenameSupport;
- this.checkBox5.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "Utf8FilenameSupport", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.checkBox5.Name = "checkBox5";
- this.checkBox5.UseVisualStyleBackColor = true;
- //
- // label6
- //
- resources.ApplyResources(this.label6, "label6");
- this.label6.ForeColor = System.Drawing.Color.DimGray;
- this.label6.Name = "label6";
- //
- // checkBox4
- //
- resources.ApplyResources(this.checkBox4, "checkBox4");
- this.checkBox4.Checked = global::APKToolGUI.Properties.Settings.Default.UseCustomJavaExe;
- this.checkBox4.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "UseCustomJavaExe", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.checkBox4.Name = "checkBox4";
- this.checkBox4.UseVisualStyleBackColor = true;
- //
- // customTempLocationTxtBox
- //
- resources.ApplyResources(this.customTempLocationTxtBox, "customTempLocationTxtBox");
- this.customTempLocationTxtBox.BackColor = System.Drawing.SystemColors.Window;
- this.customTempLocationTxtBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "TempDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.customTempLocationTxtBox.Name = "customTempLocationTxtBox";
- this.customTempLocationTxtBox.Text = global::APKToolGUI.Properties.Settings.Default.TempDir;
- //
- // textBoxCustomJavaLocation
- //
- resources.ApplyResources(this.textBoxCustomJavaLocation, "textBoxCustomJavaLocation");
- this.textBoxCustomJavaLocation.BackColor = System.Drawing.SystemColors.Window;
- this.textBoxCustomJavaLocation.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "JavaExe", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.textBoxCustomJavaLocation.Name = "textBoxCustomJavaLocation";
- this.textBoxCustomJavaLocation.Text = global::APKToolGUI.Properties.Settings.Default.JavaExe;
- //
- // checkBox3
- //
- resources.ApplyResources(this.checkBox3, "checkBox3");
- this.checkBox3.Checked = global::APKToolGUI.Properties.Settings.Default.UseCustomTempDir;
- this.checkBox3.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "UseCustomTempDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.checkBox3.Name = "checkBox3";
- this.checkBox3.UseVisualStyleBackColor = true;
- //
- // checkBox2
- //
- resources.ApplyResources(this.checkBox2, "checkBox2");
- this.checkBox2.Checked = global::APKToolGUI.Properties.Settings.Default.PlaySoundWhenDone;
- this.checkBox2.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "PlaySoundWhenDone", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.checkBox2.Name = "checkBox2";
- this.checkBox2.UseVisualStyleBackColor = true;
- //
- // checkBox1
- //
- resources.ApplyResources(this.checkBox1, "checkBox1");
- this.checkBox1.Checked = global::APKToolGUI.Properties.Settings.Default.ClearLogBeforeAction;
- this.checkBox1.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "ClearLogBeforeAction", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.checkBox1.Name = "checkBox1";
- this.checkBox1.UseVisualStyleBackColor = true;
- //
- // checkBoxCheckUpdateStartup
- //
- resources.ApplyResources(this.checkBoxCheckUpdateStartup, "checkBoxCheckUpdateStartup");
- this.checkBoxCheckUpdateStartup.Checked = global::APKToolGUI.Properties.Settings.Default.CheckForUpdateAtStartup;
- this.checkBoxCheckUpdateStartup.CheckState = System.Windows.Forms.CheckState.Checked;
- this.checkBoxCheckUpdateStartup.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "CheckForUpdateAtStartup", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.checkBoxCheckUpdateStartup.Name = "checkBoxCheckUpdateStartup";
- this.checkBoxCheckUpdateStartup.UseVisualStyleBackColor = true;
- //
- // ignoreOutputContextMenuBox
- //
- resources.ApplyResources(this.ignoreOutputContextMenuBox, "ignoreOutputContextMenuBox");
- this.ignoreOutputContextMenuBox.Checked = global::APKToolGUI.Properties.Settings.Default.IgnoreOutputDirContextMenu;
- this.ignoreOutputContextMenuBox.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "IgnoreOutputDirContextMenu", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.ignoreOutputContextMenuBox.Name = "ignoreOutputContextMenuBox";
- this.ignoreOutputContextMenuBox.UseVisualStyleBackColor = true;
- //
// FormSettings
//
resources.ApplyResources(this, "$this");
diff --git a/APKToolGUI/Forms/FormSettings.resx b/APKToolGUI/Forms/FormSettings.resx
index d5b7968..1f7781f 100644
--- a/APKToolGUI/Forms/FormSettings.resx
+++ b/APKToolGUI/Forms/FormSettings.resx
@@ -550,13 +550,16 @@
6, 45
- 263, 17
+ 278, 17
3
- Use default output directory for context menu
+ Ignore custom output directory for context menu
+
+
+ MiddleCenter
ignoreOutputContextMenuBox
diff --git a/APKToolGUI/Handlers/DragDropHandlers.cs b/APKToolGUI/Handlers/DragDropHandlers.cs
index 7d955ae..fab90ba 100644
--- a/APKToolGUI/Handlers/DragDropHandlers.cs
+++ b/APKToolGUI/Handlers/DragDropHandlers.cs
@@ -146,6 +146,8 @@ namespace APKToolGUI.Handlers
string outputDir = apkFile;
if (Settings.Default.Zipalign_UseOutputDir)
outputDir = Path.Combine(Settings.Default.Sign_OutputDir, Path.GetFileName(inputFile));
+ if (!Settings.Default.Sign_OverwriteInputFile)
+ outputDir = PathUtils.GetDirectoryNameWithoutExtension(outputDir) + "_signed.apk";
if (main.Sign(inputFile, outputDir) == 0)
{
diff --git a/APKToolGUI/Handlers/SignControlEventHandlers.cs b/APKToolGUI/Handlers/SignControlEventHandlers.cs
index b6e4f19..eaa418b 100644
--- a/APKToolGUI/Handlers/SignControlEventHandlers.cs
+++ b/APKToolGUI/Handlers/SignControlEventHandlers.cs
@@ -125,6 +125,8 @@ namespace APKToolGUI.Handlers
string outputDir = inputFile;
if (Settings.Default.Zipalign_UseOutputDir)
outputDir = Path.Combine(Settings.Default.Sign_OutputDir, Path.GetFileName(inputFile));
+ if (!Settings.Default.Sign_OverwriteInputFile)
+ outputDir = PathUtils.GetDirectoryNameWithoutExtension(outputDir) + "_signed.apk";
if (main.Sign(inputFile, outputDir) == 0)
{
diff --git a/APKToolGUI/Properties/Settings.Designer.cs b/APKToolGUI/Properties/Settings.Designer.cs
index a8c8c5f..8dd55ce 100644
--- a/APKToolGUI/Properties/Settings.Designer.cs
+++ b/APKToolGUI/Properties/Settings.Designer.cs
@@ -1121,5 +1121,17 @@ namespace APKToolGUI.Properties {
this["Utf8FilenameSupport"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool Sign_OverwriteInputFile {
+ get {
+ return ((bool)(this["Sign_OverwriteInputFile"]));
+ }
+ set {
+ this["Sign_OverwriteInputFile"] = value;
+ }
+ }
}
}
diff --git a/APKToolGUI/Properties/Settings.settings b/APKToolGUI/Properties/Settings.settings
index bbdb886..5a8fbc2 100644
--- a/APKToolGUI/Properties/Settings.settings
+++ b/APKToolGUI/Properties/Settings.settings
@@ -242,5 +242,8 @@
False
+
+ False
+
\ No newline at end of file
diff --git a/APKToolGUI/app.config b/APKToolGUI/app.config
index a2a4d01..c604245 100644
--- a/APKToolGUI/app.config
+++ b/APKToolGUI/app.config
@@ -247,6 +247,9 @@
False
+
+ False
+
diff --git a/changelog.txt b/changelog.txt
index af866bb..038f660 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -14,6 +14,7 @@
- Improved temp logic
- Improved Java logic
- Improved Apkinfo
+- Added option to overwrite input apk of signing
3.0.2.0