mirror of
https://github.com/AndnixSH/APKToolGUI.git
synced 2026-06-03 11:07:39 +00:00
Move to handler classes
This commit is contained in:
@@ -44,11 +44,17 @@ namespace APKToolGUI.Utils
|
||||
|
||||
public string AppIcon = null;
|
||||
|
||||
public string FullInfo;
|
||||
|
||||
|
||||
public bool Parse(string file)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
string info = ParseApkInfo(file);
|
||||
|
||||
FullInfo = info;
|
||||
|
||||
if (!String.IsNullOrEmpty(info))
|
||||
{
|
||||
string[] lines = info.Split(
|
||||
|
||||
Generated
+706
-663
File diff suppressed because it is too large
Load Diff
@@ -27,15 +27,6 @@ namespace APKToolGUI
|
||||
internal UpdateChecker updateCheker;
|
||||
internal AaptParser aapt;
|
||||
|
||||
private DecodeControlEventHandlers decodeHandlers;
|
||||
private BuildControlEventHandlers buildHandlers;
|
||||
private SignControlEventHandlers signHandlers;
|
||||
private ZipalignControlEventHandlers zipalignHandlers;
|
||||
private FrameworkControlEventHandlers frameworkHandlers;
|
||||
private BaksmaliControlEventHandlers baksmaliHandlers;
|
||||
private SmaliControlEventHandlers smaliHandlers;
|
||||
private DragDropHandlers dragDropHandlers;
|
||||
|
||||
private bool IgnoreOutputDirContextMenu;
|
||||
private bool isRunning;
|
||||
|
||||
@@ -84,52 +75,14 @@ namespace APKToolGUI
|
||||
schemev4ComboBox.SelectedIndex = v4;
|
||||
Settings.Default.Sign_Schemev4 = v4;
|
||||
|
||||
decodeHandlers = new DecodeControlEventHandlers(this);
|
||||
|
||||
|
||||
buildHandlers = new BuildControlEventHandlers(this);
|
||||
button_BUILD_BrowseAaptPath.Click += buildHandlers.button_BUILD_BrowseAaptPath_Click;
|
||||
button_BUILD_BrowseFrameDir.Click += buildHandlers.button_BUILD_BrowseFrameDir_Click;
|
||||
button_BUILD_BrowseOutputAppPath.Click += buildHandlers.button_BUILD_BrowseOutputAppPath_Click;
|
||||
button_BUILD_BrowseInputProjectDir.Click += buildHandlers.button_BUILD_BrowseInputProjectDir_Click;
|
||||
button_BUILD_Build.Click += buildHandlers.button_BUILD_Build_Click;
|
||||
comApkOpenDir.Click += buildHandlers.comApkOpenDir_Click;
|
||||
|
||||
signHandlers = new SignControlEventHandlers(this);
|
||||
button_SIGN_BrowsePublicKey.Click += signHandlers.button_SIGN_BrowsePublicKey_Click;
|
||||
button_SIGN_BrowsePrivateKey.Click += signHandlers.button_SIGN_BrowsePrivateKey_Click;
|
||||
button_SIGN_BrowsePrivateKey.Click += signHandlers.button_SIGN_BrowsePrivateKey_Click;
|
||||
button_SIGN_BrowseInputFile.Click += signHandlers.button_SIGN_BrowseInputFile_Click;
|
||||
button_SIGN_BrowseOutputFile.Click += signHandlers.button_SIGN_BrowseOutputFile_Click;
|
||||
button_SIGN_Sign.Click += signHandlers.button_SIGN_Sign_Click;
|
||||
selectKeyStoreFileBtn.Click += signHandlers.selectKeyStoreFileBtn_Click;
|
||||
signApkOpenDirBtn.Click += signHandlers.signApkOpenDirBtn_Click;
|
||||
|
||||
zipalignHandlers = new ZipalignControlEventHandlers(this);
|
||||
checkBox_ZIPALIGN_CheckAlignment.Click += zipalignHandlers.checkBox_ZIPALIGN_CheckAlignment_CheckedChanged;
|
||||
button_ZIPALIGN_BrowseOutputFile.Click += zipalignHandlers.button_ZIPALIGN_BrowseOutputFile_Click;
|
||||
button_ZIPALIGN_BrowseInputFile.Click += zipalignHandlers.button_ZIPALIGN_BrowseInputFile_Click;
|
||||
button_ZIPALIGN_Align.Click += zipalignHandlers.button_ZIPALIGN_Align_Click;
|
||||
alignApkOpenDirBtn.Click += zipalignHandlers.alignApkOpenDirBtn_Click;
|
||||
|
||||
frameworkHandlers = new FrameworkControlEventHandlers(this);
|
||||
button_IF_BrowseFrameDir.Click += frameworkHandlers.button_IF_BrowseFrameDir_Click;
|
||||
button_IF_BrowseInputFramePath.Click += frameworkHandlers.button_IF_BrowseInputFramePath_Click;
|
||||
button_IF_InstallFramework.Click += frameworkHandlers.button_IF_InstallFramework_Click;
|
||||
clearFwBtn.Click += frameworkHandlers.clearFwBtn_Click;
|
||||
openFwFolderBtn.Click += frameworkHandlers.openFwFolderBtn_Click;
|
||||
|
||||
baksmaliHandlers = new BaksmaliControlEventHandlers(this);
|
||||
baksmaliBrowseOutputBtn.Click += baksmaliHandlers.baksmaliBrowseOutputBtn_Click;
|
||||
baksmaliBrowseInputDexBtn.Click += baksmaliHandlers.baksmaliBrowseInputDexBtn_Click;
|
||||
decSmaliBtn.Click += baksmaliHandlers.decSmaliBtn_Click;
|
||||
|
||||
smaliHandlers = new SmaliControlEventHandlers(this);
|
||||
smaliBrowseOutputBtn.Click += smaliHandlers.smaliBrowseOutputBtn_Click;
|
||||
smaliBrowseInputDirBtn.Click += smaliHandlers.smaliBrowseInputDirBtn_Click;
|
||||
comSmaliBtn.Click += smaliHandlers.comSmaliBtn_Click;
|
||||
|
||||
dragDropHandlers = new DragDropHandlers(this);
|
||||
new DecodeControlEventHandlers(this);
|
||||
new BuildControlEventHandlers(this);
|
||||
new SignControlEventHandlers(this);
|
||||
new ZipalignControlEventHandlers(this);
|
||||
new FrameworkControlEventHandlers(this);
|
||||
new BaksmaliControlEventHandlers(this);
|
||||
new SmaliControlEventHandlers(this);
|
||||
new DragDropHandlers(this);
|
||||
|
||||
stopwatch = new Stopwatch();
|
||||
}
|
||||
@@ -299,6 +252,7 @@ namespace APKToolGUI
|
||||
densityTxtBox.Text = aapt.Densities;
|
||||
permTxtBox.Text = aapt.Permissions;
|
||||
localsTxtBox.Text = aapt.Locales;
|
||||
fullInfoTextBox.Text = aapt.FullInfo;
|
||||
ZipUtils.ExtractFile(file, aapt.AppIcon, Path.Combine(Program.TEMP_DIR, aapt.PackageName));
|
||||
|
||||
string icon = Path.Combine(Program.TEMP_DIR, aapt.PackageName, Path.GetFileName(aapt.AppIcon));
|
||||
|
||||
+784
-679
File diff suppressed because it is too large
Load Diff
@@ -19,6 +19,9 @@ namespace APKToolGUI.Handlers
|
||||
public BaksmaliControlEventHandlers(FormMain Main)
|
||||
{
|
||||
main = Main;
|
||||
main.baksmaliBrowseOutputBtn.Click += baksmaliBrowseOutputBtn_Click;
|
||||
main.baksmaliBrowseInputDexBtn.Click += baksmaliBrowseInputDexBtn_Click;
|
||||
main.decSmaliBtn.Click += decSmaliBtn_Click;
|
||||
}
|
||||
|
||||
internal void baksmaliBrowseOutputBtn_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -21,6 +21,12 @@ namespace APKToolGUI.Handlers
|
||||
public BuildControlEventHandlers(FormMain Main)
|
||||
{
|
||||
main = Main;
|
||||
main.button_BUILD_BrowseAaptPath.Click += button_BUILD_BrowseAaptPath_Click;
|
||||
main.button_BUILD_BrowseFrameDir.Click += button_BUILD_BrowseFrameDir_Click;
|
||||
main.button_BUILD_BrowseOutputAppPath.Click += button_BUILD_BrowseOutputAppPath_Click;
|
||||
main.button_BUILD_BrowseInputProjectDir.Click += button_BUILD_BrowseInputProjectDir_Click;
|
||||
main.button_BUILD_Build.Click += button_BUILD_Build_Click;
|
||||
main.comApkOpenDir.Click += comApkOpenDir_Click;
|
||||
}
|
||||
|
||||
internal void button_BUILD_BrowseAaptPath_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace APKToolGUI.Handlers
|
||||
main.smaliGroupBox.AllowDrop = true;
|
||||
|
||||
DragEventHandler apkInfoEventHandler = new DragEventHandler((sender, e) => { DropApkToGetInfo(e); });
|
||||
Register(main.tabPageApkInfo, ".apk", apkInfoEventHandler);
|
||||
Register(main.basicInfoTabPage, ".apk", apkInfoEventHandler);
|
||||
Register(main.fileTxtBox, ".apk", apkInfoEventHandler);
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace APKToolGUI.Handlers
|
||||
if (e.DropOneByEnd(".apk", file => apkFile = file))
|
||||
{
|
||||
main.smaliBrowseInputDirTxtBox.Text = apkFile;
|
||||
main.tabPageApkInfo.BackColor = Color.White;
|
||||
main.basicInfoTabPage.BackColor = Color.White;
|
||||
main.GetApkInfo(apkFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,11 @@ namespace APKToolGUI.Handlers
|
||||
public FrameworkControlEventHandlers(FormMain Main)
|
||||
{
|
||||
main = Main;
|
||||
main.button_IF_BrowseFrameDir.Click += button_IF_BrowseFrameDir_Click;
|
||||
main.button_IF_BrowseInputFramePath.Click += button_IF_BrowseInputFramePath_Click;
|
||||
main.button_IF_InstallFramework.Click += button_IF_InstallFramework_Click;
|
||||
main.clearFwBtn.Click += clearFwBtn_Click;
|
||||
main.openFwFolderBtn.Click += openFwFolderBtn_Click;
|
||||
}
|
||||
|
||||
internal void button_IF_BrowseFrameDir_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -21,6 +21,14 @@ namespace APKToolGUI.Handlers
|
||||
public SignControlEventHandlers(FormMain Main)
|
||||
{
|
||||
main = Main;
|
||||
main.button_SIGN_BrowsePublicKey.Click += button_SIGN_BrowsePublicKey_Click;
|
||||
main.button_SIGN_BrowsePrivateKey.Click += button_SIGN_BrowsePrivateKey_Click;
|
||||
main.button_SIGN_BrowsePrivateKey.Click += button_SIGN_BrowsePrivateKey_Click;
|
||||
main.button_SIGN_BrowseInputFile.Click += button_SIGN_BrowseInputFile_Click;
|
||||
main.button_SIGN_BrowseOutputFile.Click += button_SIGN_BrowseOutputFile_Click;
|
||||
main.button_SIGN_Sign.Click += button_SIGN_Sign_Click;
|
||||
main.selectKeyStoreFileBtn.Click += selectKeyStoreFileBtn_Click;
|
||||
main.signApkOpenDirBtn.Click += signApkOpenDirBtn_Click;
|
||||
}
|
||||
|
||||
internal void button_SIGN_BrowsePublicKey_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -19,6 +19,9 @@ namespace APKToolGUI.Handlers
|
||||
public SmaliControlEventHandlers(FormMain Main)
|
||||
{
|
||||
main = Main;
|
||||
main.smaliBrowseOutputBtn.Click += smaliBrowseOutputBtn_Click;
|
||||
main.smaliBrowseInputDirBtn.Click += smaliBrowseInputDirBtn_Click;
|
||||
main.comSmaliBtn.Click += comSmaliBtn_Click;
|
||||
}
|
||||
|
||||
internal void smaliBrowseOutputBtn_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -21,6 +21,11 @@ namespace APKToolGUI.Handlers
|
||||
{
|
||||
main = Main;
|
||||
CheckAlignSwitch = !Settings.Default.Zipalign_CheckOnly;
|
||||
main.checkBox_ZIPALIGN_CheckAlignment.Click += checkBox_ZIPALIGN_CheckAlignment_CheckedChanged;
|
||||
main.button_ZIPALIGN_BrowseOutputFile.Click += button_ZIPALIGN_BrowseOutputFile_Click;
|
||||
main.button_ZIPALIGN_BrowseInputFile.Click += button_ZIPALIGN_BrowseInputFile_Click;
|
||||
main.button_ZIPALIGN_Align.Click += button_ZIPALIGN_Align_Click;
|
||||
main.alignApkOpenDirBtn.Click += alignApkOpenDirBtn_Click;
|
||||
}
|
||||
|
||||
internal bool CheckAlignSwitch
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user