mirror of
https://github.com/AndnixSH/APKToolGUI.git
synced 2026-05-04 11:02:27 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 25b1a409b3 | |||
| f8ebdd867b | |||
| e9e27dd38e | |||
| 01e1ac87a2 |
@@ -103,9 +103,8 @@ namespace APKToolGUI
|
||||
CancelErrorRead();
|
||||
}
|
||||
|
||||
public int Decompile(string outputDir)
|
||||
public int Decompile(string inputPath, string outputDir)
|
||||
{
|
||||
string inputPath = Settings.Default.Decode_InputAppPath;
|
||||
string keyNoSrc = null, keyNoRes = null, keyForce = null, keyFramePath = null, keyMatchOriginal = null, keyOutputDir = null, onlyMainClasses = null, noDebugInfo = null, keyKeepBrokenRes = null, apiLevel = null;
|
||||
|
||||
if (Settings.Default.Decode_NoSrc)
|
||||
|
||||
Generated
+1
@@ -1781,6 +1781,7 @@
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Menu = this.mainMenu1;
|
||||
this.Name = "FormMain";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormMain_FormClosing);
|
||||
this.Shown += new System.EventHandler(this.FormMain_Shown);
|
||||
this.tabControlMain.ResumeLayout(false);
|
||||
this.tabPageMain.ResumeLayout(false);
|
||||
|
||||
@@ -363,10 +363,11 @@ namespace APKToolGUI
|
||||
if (e.Result is UpdateChecker.Result)
|
||||
{
|
||||
UpdateChecker.Result result = (UpdateChecker.Result)e.Result;
|
||||
|
||||
switch (result.State)
|
||||
{
|
||||
case UpdateChecker.State.NeedUpdate:
|
||||
if (MessageBox.Show(Language.UpdateNewVersion, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
if (MessageBox.Show(Language.UpdateNewVersion + "\n\n" + result.Changelog, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
Process.Start("https://repo.andnixsh.com/tools/APKToolGUI/APKToolGUI.zip");
|
||||
break;
|
||||
case UpdateChecker.State.NoUpdate:
|
||||
@@ -378,6 +379,7 @@ namespace APKToolGUI
|
||||
MessageBox.Show(Language.ErrorUpdateChecking + " " + Environment.NewLine + result.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
break;
|
||||
}
|
||||
|
||||
Settings.Default.LastUpdateCheck = DateTime.Now;
|
||||
}
|
||||
}
|
||||
@@ -541,11 +543,11 @@ namespace APKToolGUI
|
||||
ToStatus(String.Format(Language.Decoding + " \"{0}\"...", Path.GetFileName(inputApk)), Resources.waiting);
|
||||
}));
|
||||
|
||||
string outputDir = PathUtils.GetDirectoryNameWithoutExtension(Settings.Default.Decode_InputAppPath);
|
||||
string outputDir = PathUtils.GetDirectoryNameWithoutExtension(inputApk);
|
||||
if (Settings.Default.Decode_UseOutputDir && !IgnoreOutputDirContextMenu)
|
||||
outputDir = Path.Combine(Settings.Default.Decode_OutputDir, Path.GetFileNameWithoutExtension(Settings.Default.Decode_InputAppPath));
|
||||
outputDir = Path.Combine(Settings.Default.Decode_OutputDir, Path.GetFileNameWithoutExtension(inputApk));
|
||||
|
||||
code = apktool.Decompile(outputDir);
|
||||
code = apktool.Decompile(inputApk, outputDir);
|
||||
|
||||
if (code == 0)
|
||||
{
|
||||
@@ -605,12 +607,14 @@ namespace APKToolGUI
|
||||
await Task.Factory.StartNew(() =>
|
||||
{
|
||||
string outputFile = inputFile + " compiled.apk";
|
||||
if (Settings.Default.Build_SignAfterBuild)
|
||||
outputFile = inputFile + " signed.apk";
|
||||
if (Settings.Default.Build_UseOutputAppPath && !IgnoreOutputDirContextMenu)
|
||||
{
|
||||
outputFile = Path.Combine(Settings.Default.Build_OutputAppPath, Path.GetFileName(inputFile)) + ".apk";
|
||||
inputFile = outputFile;
|
||||
if (Settings.Default.Build_SignAfterBuild)
|
||||
outputFile = Path.Combine(Settings.Default.Build_OutputAppPath, Path.GetFileName(inputFile)) + "signed.apk";
|
||||
}
|
||||
|
||||
code = apktool.Build(outputFile);
|
||||
|
||||
if (code == 0)
|
||||
@@ -626,7 +630,20 @@ namespace APKToolGUI
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Settings.Default.Build_CreateUnsignedApk)
|
||||
{
|
||||
ToLog(ApktoolEventType.Information, Language.CreateUnsignedApk);
|
||||
if (Directory.Exists(Path.Combine(inputFile, "original", "META-INF")))
|
||||
{
|
||||
ZipUtils.UpdateDirectory(outputFile, Path.Combine(inputFile, "original", "META-INF"), "META-INF");
|
||||
File.Copy(outputFile, Path.Combine(Path.GetDirectoryName(outputFile), Path.GetFileName(inputFile) + " unsigned.apk"), true);
|
||||
}
|
||||
else
|
||||
ToLog(ApktoolEventType.Warning, Language.MetainfNotExist);
|
||||
}
|
||||
ToLog(ApktoolEventType.Information, Language.Done);
|
||||
}
|
||||
}
|
||||
if (Settings.Default.Build_SignAfterBuild)
|
||||
{
|
||||
@@ -932,6 +949,27 @@ namespace APKToolGUI
|
||||
#endregion
|
||||
|
||||
#region Form handlers
|
||||
private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
//For debugging purposes
|
||||
try
|
||||
{
|
||||
using (TextWriter TW = new StreamWriter(Path.Combine(Program.TEMP_DIR, "logs.txt")))
|
||||
{
|
||||
for (int i = 0; i < logGridView.Rows.Count; i++)
|
||||
{
|
||||
string dateTime = (string)logGridView.Rows[i].Cells[1].Value;
|
||||
string text = (string)logGridView.Rows[i].Cells[2].Value;
|
||||
TW.WriteLine($"{dateTime} {text}");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void Application_ApplicationExit(object sender, EventArgs e)
|
||||
{
|
||||
Save();
|
||||
|
||||
@@ -87,8 +87,14 @@ namespace APKToolGUI.Handlers
|
||||
string decApkDir = main.textBox_BUILD_InputProjectDir.Text;
|
||||
|
||||
string outputFile = decApkDir + " compiled.apk";
|
||||
if (Settings.Default.Build_SignAfterBuild)
|
||||
outputFile = decApkDir + " signed.apk";
|
||||
if (Settings.Default.Build_UseOutputAppPath)
|
||||
outputFile = Path.Combine(Settings.Default.Build_OutputAppPath, Path.GetFileName(decApkDir) + ".apk");
|
||||
{
|
||||
outputFile = Path.Combine(Settings.Default.Build_OutputAppPath, Path.GetFileName(decApkDir)) + ".apk";
|
||||
if (Settings.Default.Build_SignAfterBuild)
|
||||
outputFile = Path.Combine(Settings.Default.Build_OutputAppPath, Path.GetFileName(decApkDir)) + "signed.apk";
|
||||
}
|
||||
|
||||
if (File.Exists(outputFile))
|
||||
Process.Start("explorer.exe", string.Format("/select,\"{0}\"", outputFile));
|
||||
|
||||
+18
@@ -204,6 +204,15 @@ namespace APKToolGUI.Languages {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Creating Unsigned APK.
|
||||
/// </summary>
|
||||
internal static string CreateUnsignedApk {
|
||||
get {
|
||||
return ResourceManager.GetString("CreateUnsignedApk", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Debug mode.
|
||||
/// </summary>
|
||||
@@ -663,6 +672,15 @@ namespace APKToolGUI.Languages {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to META-INF folder does not exist. Skipped.
|
||||
/// </summary>
|
||||
internal static string MetainfNotExist {
|
||||
get {
|
||||
return ResourceManager.GetString("MetainfNotExist", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to For the changes to take effect you must restart the program. You want to do it now?.
|
||||
/// </summary>
|
||||
|
||||
@@ -396,4 +396,10 @@
|
||||
<data name="ZipalignApk" xml:space="preserve">
|
||||
<value>Zipalign APK</value>
|
||||
</data>
|
||||
<data name="CreateUnsignedApk" xml:space="preserve">
|
||||
<value>Creating Unsigned APK</value>
|
||||
</data>
|
||||
<data name="MetainfNotExist" xml:space="preserve">
|
||||
<value>META-INF folder does not exist. Skipped</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// Можно задать все значения или принять номер построения и номер редакции по умолчанию,
|
||||
// используя "*", как показано ниже:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("3.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("3.0.0.0")]
|
||||
[assembly: AssemblyVersion("3.0.0.2")]
|
||||
[assembly: AssemblyFileVersion("3.0.0.2")]
|
||||
|
||||
@@ -31,9 +31,11 @@ namespace APKToolGUI
|
||||
private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
Version latestVersion = null;
|
||||
string changelog = null;
|
||||
try
|
||||
{
|
||||
latestVersion = GetVersion();
|
||||
changelog = GetChangelog();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -43,7 +45,7 @@ namespace APKToolGUI
|
||||
{
|
||||
if (CompareVersion(latestVersion))
|
||||
{
|
||||
e.Result = new Result(State.NeedUpdate, latestVersion.ToString(), (bool)e.Argument);
|
||||
e.Result = new Result(State.NeedUpdate, latestVersion.ToString(), (bool)e.Argument, changelog);
|
||||
}
|
||||
else
|
||||
e.Result = new Result(State.NoUpdate, null, (bool)e.Argument);
|
||||
@@ -83,6 +85,17 @@ namespace APKToolGUI
|
||||
return null;
|
||||
}
|
||||
|
||||
private string GetChangelog()
|
||||
{
|
||||
string changelog;
|
||||
using (WebClient webClient = new WebClient())
|
||||
{
|
||||
changelog = webClient.DownloadString("https://repo.andnixsh.com/tools/APKToolGUI/changelog.txt");
|
||||
}
|
||||
|
||||
return changelog;
|
||||
}
|
||||
|
||||
public enum State
|
||||
{
|
||||
NoUpdate,
|
||||
@@ -92,15 +105,17 @@ namespace APKToolGUI
|
||||
|
||||
public class Result
|
||||
{
|
||||
public Result(State state, string message, bool silently)
|
||||
public Result(State state, string message, bool silently, string changelog = null)
|
||||
{
|
||||
this.State = state;
|
||||
this.Message = message;
|
||||
this.Silently = silently;
|
||||
State = state;
|
||||
Message = message;
|
||||
Silently = silently;
|
||||
Changelog = changelog;
|
||||
}
|
||||
public State State { get; private set; }
|
||||
public string Message { get; private set; }
|
||||
public bool Silently { get; private set; }
|
||||
public string Changelog { get; private set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ Framework/system apps related issues, check on [XDA Forum](https://forum.xda-dev
|
||||
|
||||
# FAQ
|
||||
##### Q: Can it be ported to other OS like Linux?
|
||||
A: Maybe, but it's not easy since Microsoft is dumb for not making it easy for .NET Core unlike Java's GUI
|
||||
A: Maybe, but it's not easy since Microsoft is dumb for not making it easy for .NET Core unlike Java's GUI which supports all supported platforms
|
||||
|
||||
##### Q: How to update Apktool?
|
||||
A: Download [Apktool.jar](https://github.com/iBotPeaches/Apktool/releases) and replace it on Resources folder
|
||||
@@ -55,6 +55,12 @@ A: Download [Baksmali.jar/Smali.jar](https://bitbucket.org/JesusFreke/smali/down
|
||||
##### Q: How to reset?
|
||||
A: Simply delete the config.xml file
|
||||
|
||||
##### Q: Why this tool is a virus?
|
||||
A: It just a false positive, anti-virus always flag tools/softwares like this as virus. Don't always believe what your anti-virus are telling you. Try to compile the source by yourself and you will see
|
||||
|
||||
##### Q: Can you make an automatic APK injecting tool?
|
||||
A: No, that's not the point of this tool, and I don't have time for that. However, you can try making it by yourself, or have a look on [SaveToGame](https://github.com/And42/SaveToGame) which can give you ideas how to do it.
|
||||
|
||||
# Development
|
||||
Use Visual Studio 2019 and above. NET Framework 4.8 SDK is required
|
||||
|
||||
@@ -66,9 +72,9 @@ Currently there is two languages, english and russian. Russian is not complete b
|
||||
- Open any forms. Under properties, scroll down until you see Language, and select any language you would like to translate. It will create new resx file inside cs file
|
||||
|
||||
# Credits
|
||||
AndnixSH
|
||||
iBotPeaches ([Apktool](https://ibotpeaches.github.io/Apktool/))
|
||||
INF1NUM (Original author of [APKToolGUI](https://github.com/INF1NUM/APKToolGUI)
|
||||
- AndnixSH
|
||||
- iBotPeaches ([Apktool](https://ibotpeaches.github.io/Apktool/))
|
||||
- INF1NUM (Original author of [APKToolGUI](https://github.com/INF1NUM/APKToolGUI))
|
||||
|
||||
# Disclaimer
|
||||
Same as Apktool by iBotPeaches, It is NOT intended for piracy and other non-legal uses. It could be used for localizing, adding some features or support for custom platforms and other GOOD purposes. Just try to be fair with authors of an app, that you use and probably like.
|
||||
Same as Apktool by iBotPeaches, It is NOT intended for piracy and other non-legal uses. It could be used for localizing, adding some features or support for custom platforms and other GOOD purposes. Just try to be fair with authors of an app, that you use and probably like.
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
3.0.0.1
|
||||
- Show changelog on update prompt
|
||||
- Implement unsigned APK creation after compile. Totally forgotten it
|
||||
- Compiled APK named "signed" instead "compiled" when signng after compile
|
||||
|
||||
3.0.0.0
|
||||
- Updated apktool to 2.6.1
|
||||
- Updated apksinger, aapt, and zipalign to SDK 31
|
||||
|
||||
Reference in New Issue
Block a user