Skip to content

Commit

Permalink
Added View APK info in context menu #9
Browse files Browse the repository at this point in the history
  • Loading branch information
AndnixSH committed May 8, 2023
1 parent a45b671 commit ab629c2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions APKToolGUI/Forms/FormMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions APKToolGUI/Forms/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System.Linq;
using System.Windows.Interop;
using System.Security.Cryptography;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace APKToolGUI
{
Expand Down Expand Up @@ -155,10 +156,6 @@ await Task.Factory.StartNew(() =>

ToStatus(Language.Done, Resources.done);

string decApkPath = Settings.Default.Decode_InputAppPath;

await GetApkInfo(decApkPath);

RunCmdArgs();

await ListDevices();
Expand Down Expand Up @@ -217,11 +214,11 @@ private async void RunCmdArgs()
if (await Smali(file) == 0)
Close();
break;
case "apkinfo":
await GetApkInfo(file);
case "viewinfo":
tabControlMain.SelectedIndex = 1;
await GetApkInfo(file);
break;
default: //Fix when running app as Release from Visual studio
default:
IgnoreOutputDirContextMenu = false;
break;
}
Expand Down Expand Up @@ -1423,11 +1420,15 @@ await Task.Factory.StartNew(() =>
}
#endregion

#region Main menu event handlers

#endregion

#region Form handlers
private async void tabControlMain_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabControlMain.SelectedIndex == 1 && String.IsNullOrEmpty(appTxtBox.Text) && Environment.GetCommandLineArgs().Length == 1)
{
await GetApkInfo(Settings.Default.Decode_InputAppPath);
}
}

private void FormMain_Activated(object sender, EventArgs e)
{
if (!isRunning)
Expand Down Expand Up @@ -1566,6 +1567,5 @@ private void CancelProcess()
}
}
#endregion

}
}
2 changes: 1 addition & 1 deletion APKToolGUI/Languages/Language.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion APKToolGUI/Languages/Language.resx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
<value>Disassemble DEX</value>
</data>
<data name="GetApkInfo" xml:space="preserve">
<value>Get APK Info</value>
<value>View APK Info</value>
</data>
<data name="NotDecompiledApk" xml:space="preserve">
<value>This folder is not a decompiled APK</value>
Expand Down
4 changes: 2 additions & 2 deletions APKToolGUI/Utils/ExplorerContextMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private static Status CreateContextMenu(string executablePath)
apkToolGUIFolderShell.SetValue("SubCommands", "APKToolGUI.Build;APKToolGUI.Smali");
apkToolGUIFolderShell.Close();

CreateFileAssociationsSubKey(executablePath, ".apk", "APKToolGUI.Decompile;APKToolGUI.Sign;APKToolGUI.Zipalign");
CreateFileAssociationsSubKey(executablePath, ".apk", "APKToolGUI.Apkinfo;APKToolGUI.Decompile;APKToolGUI.Sign;APKToolGUI.Zipalign");
CreateFileAssociationsSubKey(executablePath, ".xapk", "APKToolGUI.Decompile");
CreateFileAssociationsSubKey(executablePath, ".apks", "APKToolGUI.Decompile");
CreateFileAssociationsSubKey(executablePath, ".zip", "APKToolGUI.Decompile");
Expand Down Expand Up @@ -85,7 +85,7 @@ private static Status CreateContextMenu(string executablePath)
RegistryKey apkinfo = shell.CreateSubKey("APKToolGUI.Apkinfo", RegistryKeyPermissionCheck.ReadWriteSubTree);
apkinfo.SetValue("", Language.GetApkInfo, RegistryValueKind.String);
apkinfo.SetValue("Icon", executablePath, RegistryValueKind.String);
apkinfo.CreateSubKey("command").SetValue("", "\"" + executablePath + "\" \"apkinfo\" \"%1\"", RegistryValueKind.String);
apkinfo.CreateSubKey("command").SetValue("", "\"" + executablePath + "\" \"viewinfo\" \"%1\"", RegistryValueKind.String);
apkinfo.Close();

shell.Close();
Expand Down

0 comments on commit ab629c2

Please sign in to comment.